Int ern at i onal  Journ al of Ele ctrical  an d  Co mput er  En gin eeri ng   (IJ E C E)   Vo l.   8 , No .   6 Decem ber   201 8 , p p.   4239 ~ 4252   IS S N: 20 88 - 8708 DOI: 10 .11 591/ ijece . v8 i 6 . pp 4239 - 42 52          4239       Journ al h om e page http: // ia es core .c om/ journa ls /i ndex. ph p/IJECE   Sm ar t   Mic rowave O ven  with Im age Clas sificatio n and  Tempe ratur e Recomm endation A lgorithm       Tareq  Kh an   School  of Engin ee ring   T ec hnolo g y ,   E aste rn   Mic higa Univ ersity ,   US A       Art ic le  In f o     ABSTR A CT    Art ic le  history:   Re cei ved   Ma y   25 , 201 8   Re vised  Ju l   5 ,   201 8   Accepte Aug   8 , 2 01 8       W hen  food  is  w armed  in  m ic r owave   oven ,   the  user  guesses  th est imated   ti m for  the  he a ti ng.   Thi cognitive  proc ess  of   guessing  ca n   be   inc orr ect  -   result ing   the  fi nal   food   te m pe rat ure   to   be  to hot  or   stil c old.   In   thi s   rese arc h ,   no vel   cl osed - loop   m ic r owave   o ven  is  d esign ed  whic h   aut om at i c al ly   suggests  the   t arg e te m per at ure   o f   food  b y   le ar ning  from   pre vious  exp erienc es  and  th hea t ing  stops  a utomati c al l y   wh en  th foo d   te m per at ur re a che the   ta rg et  te m per at ur e.   The   proposed  m ic rowave   ca ptur es  and  c la ss ifi es  the   fo od  image,   and   rec om m ends  the   ta rg e t   te m per at ur e,  th us  the   user   do es  not  n ee d   to   remem ber   th e   ta rg et   food   te m per at ur ea c ti m e   the   sam food  is  warm ed .   The  al gor it h m   gra dua l l y   le arn th t y pe  o foods  tha are   used  in  tha hou sehold  and  be co m es  s m art er   in  the  recom me ndation.   The   proposed  al gor i thm  ca r ec om m end  ta rge t   te m per at ur wit an  a cc ur acy   of   86. 31%  for  sol i food  and  100 for  li qu id   food.   prototy pe   of  th pro posed  m ic rowave   is  dev el ope using   th e   embedde s y s tem   and  t este d.   Ke yw or d:   C losed - lo op    E m bed ded  s yst e m     H ist ogram   I m age  c la ssific at ion     T em per at ur s ensin g   Copyright   ©   201 8   Instit ut o f Ad vanc ed   Engi n ee r ing  and  S cienc e   Al l   rights re serv ed .   Corres pond in Aut h or :   Tareq K ha n,     School  of E ng i neer i ng Tec hnology,    East ern Mi chig an Un i ver sit y,    118 Si ll  H al l,  Yp sil a nti, MI  4819 7,   USA.     Em a il : t areq .khan@em ic h. ed u       1.   INTROD U CTION   Digital   te chnol og y,   sen sors,  a nd  le arn i ng  al gorithm are  ch ang i ng  the  wa we  interact   with  dev ic e s   and   a ppli ances Re cent  ad vances  in  m iniat ure  sens or s em b edd e process or s an wi reless  te chnolo gies   have   cause a   ra pid  gro wth  in   sm art  ap plica ti ons  su c as  c ontrolli ng  a nd  m on it ori ng  hom ap pliances   [ 1] - [ 4] ,   m on it or ing  of  sm art  par king  lots  [ 5] ,   [ 6],  a uto m at ic   m e ter   rea ding  ( AMR)  usi ng  sm art  m et ers  [7 ]   et c.   m ic ro wa ve  ov en  (c omm on ly   ref e rr e to  as  a   m ic ro wa ve)   is   kitchen  a ppli ance  that  heat and   c ooks  f ood  by   exposi ng   it   to   el ect ro m agn et ic   rad ia ti on   i the  m ic ro w ave  f reque ncy  range.  It  has   beco m com m on   app li anc in   th m od ern  kitc he si nce  it release   to  t he  publ ic   for  re side ntial   and  com m e rcial   us e   in  19 67  [ 8 ].  Since the n, s om e so rt  of  ti m i ng m echan ism ,  whethe it  b e  thro ugh dial s or  thro ugh p us h - bu tt on  pro gr a m m ing is use to  contr ol ho lo n th e m ic ro wa ve h eat s t he  f ood.     In  this  process the   us e nee ds  to  est im at t he  e xact  ti m m ental ly   by  co ns ide rin se ve ral  va riables   su c as  the   cu rr e nt  te m per at ur of  the  foo ( f or   i ns ta nce the  foo co ul be  ta ken  out  f ro m   ref ri ge rator,   fr eeze r,   or   c ou ld  be  at   r oom   tem per at ur e ),   qu a ntit and   t her m al   pr opert ie of   t he  f ood,  powe le vel  of   t he   m ic ro wa ve  ov en,   a nd   finall the  desire ta r get  tem per at ur of   th f ood.   This  co gnit ive  process  of   cal c ulati ng   the  exact  requi red   ti m e   is  co m plex  and   m a be  est i m a te incorrect ly If  lon g er  ti m e   is  est i m at ed  than   the   require tim e,  then  the  f ood  beco m es  too   hot  to  eat It  m a cause  burn   in  the  m ou th  if  the  food   is  co nsum ed   with  s poon  without  c heck i ng  the  te m per a ture  by  to uch i ng  it   first.  Wh en  the   f ood  is  t oo  hot,  t he  us e nee ds  to  wait   u ntil   the  food   c oo ls  dow n.   I short er  tim is  est i m at ed  than   the   required   ti m e,   then  the  us e needs  to   Evaluation Warning : The document was created with Spire.PDF for Python.
                          IS S N :   2088 - 8708   In t J  Elec  &  C om En g,   V ol.  8 , N o.   6 Dece m ber  2 01 8   :   4239   -   4252   424 0   rep eat   t he  proc ess  of  c hec king  the   c urren te m per at ur e o t he  foo by  to uc h,   e stim at ing  tim e,  and   t hen h eat ing  again u ntil  the  desire ta r get t e m per at ur e is  r eached . T his  process is  ti resom e and  e rro r - pro ne.   In  this  pa per ,   so l ution  of  t he  a bove   pro bl e m is  pro po se d.   The   ove rall   op e rati on  of  th syst e m   is  sh ow in  Fi g ure   1.   T he  m ai con t rib ution s  of the  p a per are   m entioned  below.   1.   In   this  pr oj ect cl os e d - l oo m ic ro wa ve  ov e is  desig ned   wh ic co ntinuo us ly   m e asur e the  foo tem per at ur w it ho ut  physi ca con ta ct   wh i le   the  fo od  is  bein heate d,   an sto ps   the  m ic ro wa ve  autom at ic ally  wh e t he  f ood  tem per at ur e   r eaches  t he  ta r get  te m per at ure.  I this   proc ess,  the   us e doe s   no nee to  gu ess  the  e xtract   require ti m e   m entally This  is  m or conven ie nt  to  us e   an en sures  t he  exact t ar get tem per at ur e of t he fo od.    2.   In   this  resea rc h,   an  a uto m at i ta rg et   tem per at ur reco m m end at io al gori thm   is  al so   pr opos e d.   Wh e a   foo is  inse rte in   the prop ose m ic ro wa ve  ov e a nd  the   door  is  cl os e d,   it   ta ke s   a im age  of  the   f ood  a nd  store s   the  c olor  patte rn   (such   as  histogram of   the  f ood  i database.  Once  tem per at ur is  set   fo th at   foo us i ng  pus butt on  s witc hes,   t hat  te m p eratur e   is  assigne t the  st or e histo gr a m   in  the  data ba se.   Lat er,  w he th us er   heats  th sam kin of   foo agai (e ven   i the  foo is  on   dif fer e nt  plate   or  c up) ,   the  pr opos e al gorithm   automa ti cally   reco m m end the  t e m per at ure  w hi ch  wa assig ne for  that  f oo pr e viously T he   us e just  pr e sses  the   ‘sta rt’   butt on  a nd  do  not  need  to   r e m e m ber   or  re - enter   the   ta r ge tem per at ur e The  al gorithm   cal culat es  the  colo patte rn   s i m i la rity   between   the  curre nt   fo od  an th e   histo gr am stored   in  the  database.  T he  cl ose st  m at ch  histog ram ’s  assigne tem per at ure  is  reco m m end e as  the  ta r get  te m per at ur e.  If   t her is   no  si gnific ant  m at ch  between   t he  c urren foo c olo r   patte r a nd   t he   store histo gr a m s,  then  the  new   histo gr am   fo that  f ood  and   it desire tem per at ure  is  add e to  t h database I this  way,  t he  m ic ro wa ve  ov en  gra du al ly   le arn t he  ty pe   of   foo ds   that   are  us e in  t hat  hous e hold a nd  beco m es sm art er in rec omm e nd i ng or  pr e dic ti ng  the  tar get te m per at ure   3.   Fo r   20 18,  tota un it   s hip m ents  of  m ic ro wav ov e ns   a re  pro j ect ed   to  rea ch  12.69  m il l i on  unit [ 9 ]   a nd   96%  of  U .S.  hom es  us m i crowa ve  ove [ 10 ] T he  s urv ey   in  [ 11 ]   sho ws  that  Am eri cans  ar us i ng   m ic ro wa ves  to   war m   and   he at   m or e,  rathe pre par dis he from   scratch.  T he  m ark et   repo rt  in  [ 12 publishe i Decem ber   20 17  sta te t hat  m ic ro wa ves  la be hind  oth e m ajo r   ap pliances  i te rm of   “sm art”  featur es.  The  pro po sed  novel  m a chine  le ar ning   base aut onom ou m ic ro w ave  can  fill   this  m ark et  and  res earch  g a p.       ( a ) C a m er a   a n d   i n f r a r ed   tem p er a tu r s en s o r Au to m a ti c a l l y   s u g g es ted   ta r g et  te m p e r a tu r e   f r o m   e x p e r i e n c e C u r r en f o o d   te m p e r a tu r e ( b) Au t o m a t i c a l l y   s t o p s   w h en   t a r g et   t em p er a t u r i s   r ea c h ed     Fig ure   1.  The   ov e rall  oper at ion   of t he pr opose syst em . ( a)  when a  foo is  inser te a nd th e door is cl os e d,  t he  pro po se m ic ro wa ve su ggest s the tar get  foo te m per at ur e   us in im age classi ficat ion  al gorithm ; (b )  Afte the   “Sta rt” butt on i s presse d,  t he m ic ro wa ve hea ts t he  f ood u ntil  f oo te m per at ur e  r eac hes  t he  targ et  tem per a ture       Seve ral  work s   are  found  in  the  li te ratur about  m easur ing   the  tem per at ur of  the  sam ple  or   f oo wh il they   a re  heated  by  m ic ro wa ve  i r eal   tim e.  T he  us of  co nve ntion al   el ect ric   tem per at ur se nsor insid e   m ic ro wa ve  ov e is  pr ob l e m at ic   becau se  of   the  st ron el ect ro m agnet ic   fiel env i ronm ent.  Fibe r - op ti c   sens or s   [ 13 ]   a r inse ns it ive  to   el ect ro m agn et ic   fiel ds H owever,  they   re quire  direct   co nta ct   with  t he  f oo a nd   requires   cl eani n eac ti m t he  foo is  warm ed.   T his  is  i ncon ven ie nt.  I [14],  t he  us e   of  a in frare (I R fibero ptic ra dio m et er is p rop os e f or  non - c on ta ct   te m per at ur e m easur em ents insi de  m ic rowav e   ove n. In thi s   m et ho d,   t he  ti of  the  IR  fiber   is  sit uated   directl abov the  sam ple  and   tra ns m it the  therm al   rad ia ti on  e m itted  by  t he   heate sam ple  to  a   ra dio m et er.  In  [ 15] t her m al   i m aging   te c hn i qu e   w it f orward - lo ok i ng   infr a re (F L IR cam era   is  us ed,   w he re  te m per at ur a nd   oth er  data  is  tran sferred  t PC  fo m on it or i ng   a n Evaluation Warning : The document was created with Spire.PDF for Python.
In t J  Elec  &  C om En g     IS S N:  20 88 - 8708       Smart Micr ow ave  Oven w it h Image  Cl as sif ic ation a n d. . ..    ( Ta re K han)   4241   con t ro ll in th e   powe le vel  of  the   m ic ro wa ve.   I [16],  FL IR   cam era  is  use t ca pture  the  the rm al   i mage  of  the  foo su r fac e.  Howe ver F LIR  cam era s   a re   ex pen si ve  [ 17 ]   an can  si gn i ficantl y   increase  the  pri ce  of   the   m ic ro wa ve  ov en.   I [18],  tem per at ur m on it or ing   in side  m ic ro wav e   ov e is  pr op os e by  us in conve ntion al   c olor  cha r ge - c ouple dev ic ( CC D)   cam era.  This  m et ho cou l be  lo cost,  bu m ay   no be   accurate.  An   i nexpe ns ive  te m per at ur co ntro ll er  [ 19]   and  op ti m u m   po w er  co ntr ol  strat egies  f or   m ic r ow a v ov e a re  disc usse in  [ 20 ] ,   [21].  H oweve r,   t hey  do  not  discuss   the  a ut oma ti sh utdo wn   of   m ic ro wa ve  powe r   wh e t he fo od  tem per at ur e  r e aches t he desir ed  te m per at ur e   rece nt  heati ng   el em ent  based   ove ( no m ic ro wa ve - bas ed   heati ng in  [22],  us e hi gh   de fi niti on  (HD)  cam era  to  ide ntify  from   c omm on   pr e def i ned  set   of  foo ds   that   are   pu i ns ide   a nd  reco m m end   co ok i ng  tim es  and   temperat ur e.  r e sist ance  t e m per at ur detect ors  (RTD )   te m per at ur se nsor   pr obe  is  inse rted  m anu al ly   into  the  f ood  a nd  use ca get  a   noti ficat ion   on  s m art  dev ic es   wh e t he  foo is  co oked H oweve r ,   this  m et ho of  tem per at ure  sensing  re quir es  ph ysi cal   co ntact   of   th tem per at ure  se ns or  with  the   food.  More ov e r,   the  foo recog niti on   al go rithm   is   fixed   to  set   of   pre def i ned   f oods th us   it   do es  not  le arn   a ny  new  foo it e m   and  un a ble  to  reco m m end   their   tem per at ur es.   In   this  propo sed  resea rch,  foo tem per at ur is   m easur ed  us i ng  IR  te m per at ure  sens or.  It  is  insensiti ve  to  m ic ro wa ves,   m uch   c hea per   t ha FL IR  cam er a,  an do e not  nee ph ysi cal   c on ta ct   with  the   f oo d.   In  this  pro pose w ork the   autom at ic   sh ut down  of  m ic ro wa ve  powe w hen   t he   food   te m per a ture  reac hes  t he   desire te m p eratur is  al s discusse us in m ic ro con tr oller - base d   em bed de syst em The  pro po se food   cl assi ficat ion   al gorithm   gr a dual ly   le arn the  f ood  it e m by   i m age p r ocessi ng and  rec omm end s t heir  ta r get tem per at ures;  r at he tha n a p red e fine se t of f oods.       2.   RESEA R CH MET HO D     2.1.   Fo od   Clas si ficat i on  u sing  I ma ge  Pr ocessi ng   and Tem pe rature  Reco m mendatio Algo ri th m   T he  pro po se m ic ro wa ve  oven   ca ptures  a i m age  of   t he  f ood  w hen  it ’s  door  is  cl os e d.  The  im age  is   then  processe and  the  al go rithm   trie to  classify  the  im a ge  by  c om par ing   it c olor  pa tt ern   with   the  store colo patte r ns   i the  datab ase.   If   t he  f ood  is  cl assifi ed,   th en   it   reco m m end the  te m per at ur t hat  is  assi gn e t that  f ood.  I th foo is  uncl assifi ed,  the it col or   patte r and  de sired   te m per at ur is  a dd e t the   dat abase .   bl oc dia gra m   of   the  pro po s ed  cl assi ficat ion   al gorit hm   is  sh own  i Fig ure   2 bri ef  descr i ptio of  th al gorithm  is d isc us se d belo w.       I s   E q u a l I s   F o o d   S o l i d R e m o v e   B a c k g r o u n d   f r o m   S o l i d   F o o d   R e m o v e   B a c k g r o u n d   f r o m   L i q u i d   F o o d   G e n e r a t e   H i s t o g r a m C l a s s i f y   F o o d I s   C l a s s i f e d ? R e c o m m e n d   T e m p e r a t u r e A d d   i n   D a t a b a s e C a p t u r e   F o o d   I m a g e Y e s N o E m p t y   I m a g e N o N o Y e s E n d Y e s D a t a b a s e S t a r t     Fig ure   2.   Bl oc k diag ram  o th e f ood  cl assifi c at ion  a nd tem per at ur e  r ec omm end at ion al gorithm   Evaluation Warning : The document was created with Spire.PDF for Python.
                          IS S N :   2088 - 8708   In t J  Elec  &  C om En g,   V ol.  8 , N o.   6 Dece m ber  2 01 8   :   4239   -   4252   4242   2.1.1.   Existence  of F ood  Det ec tion   As  s oon  as  t he   door  of  the  m ic rowav oven   is  cl os ed an  i m age,  I captured is  captu red   us i ng   a HD  ca m era  m ou nt ed  on   the   r oof   of  the  oven T he  im age  is  an   RGB  col or  im age  of  siz 320  ×  240.  T he  fir st  ste of   the  al go rith m   is  to  determ ine   wh et her   t he re  is  food   i the  oven  or   it   is  e m pty.  To  do   that,  preex ist ing  i m age  of   the  m i cro wa ve  ov en  with out  an fo od,  I em pt y is  com par ed  with  I captured If  there  is  sign ific ant   m at ch,   then   th m ic ro wa ve  i em pty  and   the  al gorit hm   t erm inate witho ut  te m per at ure  reco m m e nd a ti on If  there  is  sign ific ant  m is m atch the there  is  fo od  in  the  m ic ro wa ve  an it   go es  to  the  nex blo c of  the   al gorithm As  the  m ic ro wav tur ntable  tray   can  r otate it   cou l be  i di ff e ren t   posit io tha the  pree xisti ng  I em pt y   i m age.  S o,  a  h a r d pixel  by p i xel co m pa rison  betwee I captured   an I em pt y   will  n ot work.    In   Fig ure   3,  an   exam ple   of   pr ee xisti ng  em pty  i m age  (a),  captu red   im a ge   without  f oo (c ),   a nd  a   captu red   im age   with  food   (e)  al on with  th ei gr ay scal hi stog ram (b ) (d)  an (f)  are  sh ow nam el y.   Her we  see  that,  e ven   t hough  (c is  ro ta te co m par ed  wit ( a),  their  histo gram (d an ( b)   a re  quit sim il ar  because   histo gram do   no con ta in  the  po s it ion   inform at i on   of   the  pixe ls  [1 2].  O the  oth e ha nd,  the   histo gr am   of   the  im age  with  foo d,   ( f),  is  qu it diff ere nt  f r om   (b an (d) To  c om par the  im ages,  h ist ogram   diff e re nce  bet ween   t he  tw i m ages  are  cal c ulate d.   If   t he  di ff ere nce  of   t he   histo gr am is  le ss  than  t hresh old HIST_DIFF_THRESHOLD then  the  i m ages  are  consi der e e qual el se  they   are  con si der e diff e ren t.  E xperi m ents   hav e   been  co nducte with   10  em pty  i m ages I em pt y ,   hav i ng  di ff e ren t   r ot at ion of  the   tur ntable  tray   and  thres ho l val ue   is  assigne d   as   100.   T he  ste ps   of  determ ining   w hethe th i m ages  are  equ al   are  s how in  the   ps e udoc od e  in Fi g ure   4.          (a)       (c)     (e)     (b)     (d)     (f)     Fig ure   3.  ( a ) P reex ist in im a ge wh e n n o food i n o ven ( b) H ist ogram  o f  (a ); ( c Ca pt ur e im age w he n no  foo in  ove n,  t he  tray  c ould  be  rotat ed  c om par ed  w it h (a ); (d)  H ist og ram  o (c ); ( e Ca ptured  im age w he foo is  pr ese nt ; (f)  Histogram  of ( e )       I captured_ gray   := grayscale of I captured    I empty_gray   := grayscale of I empty    h1 :=  histogram of I captured_gray        h 2 :=  histogram of I empty_gray    Calculate the average of histogram differences as d         12 : 256 hh d        IsEqual := ( d <  HIST_DIFF_THRESHOLD )     Fig ure   4. Pse udoc ode  for  c om par ing  im ages   Evaluation Warning : The document was created with Spire.PDF for Python.
In t J  Elec  &  C om En g     IS S N:  20 88 - 8708       Smart Micr ow ave  Oven w it h Image  Cl as sif ic ation a n d. . ..    ( Ta re K han)   4243   2.1.2.   So li an d  Li quid F ood C l assi ficat i on   Af te t he  exist ence of th e f oo is determ ined,  the  nex bloc of the alg or i thm  d et er m ine s w het her  the   foo is  so li d   or  li quid Li quids  (co m m on ly   ref err e as   dr inks are  ge ner al ly   serve in  cu ps   or   glasses,  wh e reas  so li ds  are  serv e on   plate or   bow ls.  Cl assify ing  wh et he the  f ood  is  so li or   li qu id  is  required   to  detect   and   rem ov the  foo ba ckgr ound  in  the  ne xt  blo c of   the  al g or it hm .   The  pr em is fo cl assify in so li and   li quid  foo is  that,  in  m os cases,  the  te xture  of  so li f ood  is  coa rse,   wh e reas  the  te xture  of  li qu i foo is   sm oo th  an ho m og enous.  S o,  the  var ia nce  ( σ 2 )   of   so li f ood  im age  will   be  m uch   highe tha t he  var i a nce  of   li qu id  f ood.    In   Fig ure   5,   t he   colo im age  of   s olid  foo is  sh ow in  (a ),   it gray scal i m age  is  sh ow in  (b)  wit 32 × 32  pix el   blo c draw in  m agen ta   color   at   m idd le ,   and   the  3D  plo of  the  bl ock   where  heigh is   pro portion al   to   the  pix el   va lu i sh own  i ( c).  Sim il arl y,  (d ) (e),  an ( f)   sh ows  t he  i m ages  f or   li qui f ood  nam ely.  Her e we  see   that  th e   pix el   val ues  i the   bl oc c ha ng e   m or in  s olid  foo as   show i (c) ,   whereas  the  pi xel  val ue are  al m os the  sam in  li qu id  f ood  as  s ho wn  in  (f).  For   this  exam ple,  the  var ia nce  of  (c)  is   746. an the  var ia nce  of  (f)  is  1. 7 The  var i ance  is  cal culat ed  us in ( 2)   a nd   (3)  w her e N   is  the  total   pix el   in  the  blo c k,   x i   is  the  i th   pix el   value,   an m   is  the  m ean  of   al pix el   values  i the  bl ock.  Sim ula ti on s   ha ve   been   cond ucted  with  263   so li foo an 5 3   li quid   food   im ages  fo r   a   blo c k   siz of   32 × 32  in   th m idd le It  ha bee fou nd   t hat  the  m axi m u m   var ia nce  f or   li qui foo is  4.6 thres ho l d MI N _S OL ID _F OO D_ VA R is  assig ne as  10   in  the  al gorith m .   If   the  blo c var ia nce  is  l ess  tha or  eq ual  to   the  t hr e sh ol d,  the the   f ood  is  cl as sifie a s   li qu id,  else i t i s  classi fied  as  s olid.          (a)     (b)     (c)       (d)     (e)     (f)     Fig ure   5.  ( a C olor im age o f  s olid  foo d; (b)  Gr ay scal e im a ge of  ( a ) wit a  b loc k d rawn i m agen ta  c olor at  m idd le ; (c)  3D  plo of the  blo c in  (b) w he re  heig ht is  propo rtion al  t the  p i xel v al ue; (d ) C olo r  im age o f   li qu id  f ood; (e)  G r ay scal e i m age  of (d)  w it a   blo c k d rawn  in m agen ta  co l or at m idd le ; (f)  3D   pl ot of the   blo c in  ( e ) whe re  heig ht is  pro po rtion al  t t he pixel  value       2.1.3.   Back ground Rem oval   In   this  co ntext on ly   the  foo portio of  the  captu re im age  is  def in ed  as  foregr ound,  as  sh ow inside  the  gr ee r e gion  in  Fi g ur 6( a ),   a nd  the  rest  of   the  i m age  is  def ine as  bac kgr ound  as  s how in  Fig ure   6( a a nd  Fig ure   6(b ).   The   c olor  in form at i on  of  t he  f oo is  c onta ined   in  the   f or e gr ound,  a nd  no t   in  the  backg rou nd.  T he  backg rou nd  m a var if  t he  sam food  is  ser ve in  a   di ff ere nt  ty pe  of  plate bowl,  or  c up .   Evaluation Warning : The document was created with Spire.PDF for Python.
                          IS S N :   2088 - 8708   In t J  Elec  &  C om En g,   V ol.  8 , N o.   6 Dece m ber  2 01 8   :   4239   -   4252   4244   So the  al gorithm   re m ov es  the  backgro und  f ro m   the  i m age  so   that  the  ge ner at e histo gra m   (d isc us se in  the   nex sect io n)   do   no co ntain   backgro und  c olor  inf or m at i on,  an thu t he  foo can  be   cl assifi ed  accuratel even if it  is  put o dif fer e nt  con ta ine r.         (a)     (b)     Fig ure   6. (a F or e gro und (insi de  the  gree r e gion)  and  bac kgr ound  (outsid e the  gr ee n re gi on) of   so li d f ood;  (b) fo regr ound  (the ora nge  part an d bac kground ( ou tsi de  th e oran ge part )   of li qu i f ood       So li f ood  is  gen e rall pu on   plate   or   po t.  When  food   is  pla ced  on   plate it   is  gen e rall y   su r rou nded  by   s m oo th  te xtu r hav i ng   m on ot onous  c ol or  of   t he  plate   a show in  Fig ure   6 (a ) .   F or  so li foo d,   t he  f oreg rou nd   has   hi gh  va riance,   as  s how in   Fig ure   5 (c) ,   a nd  it backg rou nd   ha lo var ia nce in  t he   pix el   val ues This  he ur ist ic   is  us ed  to  det ect   the  backgroun of   the  s olid  f ood.   Liq uid   f ood  or   dr ink   is  gen e rall serv e in   m ug   or   glass.  F or  li qu i f ood,  the  for egro und   has  lo va riance as  sh ow in  Fig ure   5 (f),  and   it   is  s urrounde by  t he  edg o the  c onta iner  a s   sho wn   i Fi g ure   6 ( b).  T he  bl oc co ve rin an   edg e as  sh ow in  Fig ure   6 (b)  in   blac col or,  will   ha ve  hi gher  vari ance  in  pix el   values T hese  high  va riance   edg e   blo c ks  a re  us e to  d et ect  t he back gro und o f t he  li qu i d foo d.   To  aut om at e   t he  bac kgr ound   re m ov al   p r oc ess,  cop of   the  i m age  is   first  conver te to  gr ay scal and   the di vide into  f our  qu adr a nts     top - r igh t,  to p - le ft,  bott om - le ft,  and  bo tt om - righ nam ely  as  sh ow in  Fig ure   7.  T hen  sta rting   f r om   the  center  of   t he  gray scal im age,  the  va ri ance   is  cal cula te f or   eac 10   ×  10   blo c k s   acc ordi ng  to  the   horiz on ta se qu e nce   (i.e.  row  a fter  row  in   raster   s can  fa sh i on)  as   show Fi g ure   7( a at   the  to p - rig ht  quad ra nt.  F or  s ol id  f ood,  if  t he  var ia nce  of  CO NS EC _B G_ BL K   num ber   of  c ons ecuti ve  blo c ks  is  le ss   than  th resh ol val ue,   BG_V AR_THRESHOLD then  the  ba ckgr ound  is  reached   a nd  the  rem ai nin bloc ks   of  that  row  are  m ade  blac on  th act ual  color   i m age.  For  li quid  foo d,   if  the  var ia nce  of  bl ock   is  great er  than  a   thres ho l val ue EDGE_VAR_THRESHOLD ,   t hen   t he  bac kgr oun is  reac he an the  rem ai nin blo c ks   of   that   row  are  m ade  black  on  the  act ual  color   im age.  The this  pr oces is  rep eat ed  f or   th re m a ining   top - le ft ,   bo tt om - le ft,  a nd  bo tt om - righ t   qua dr a nts   acc ordi ng  t t he  seq uen ce   s hown  in   Fig ure   (a).  Af te r   th at the   entire  proce ss   is  rep eat ed  a ccordin to  t he   ve rtic al   seq uen ce  a sho wn   i Fig ure   ( b).  A nother   si m il ar  horizo ntal  an ver ti cal   seq uence  are  re peated   wh e re  it   searc hes  f or   fu ll bl ack  bl ock   a nd  on ce  fou nd,  it   fill the  rest  of   t he  r ow  or  the  c ol um with  black  nam ely.  The  ba ckgr ound  of  t he  im ages  sh own   in  Fi g ure   5(a)  a nd  Fi gure   5(d is   rem ov ed  us in the  pro po se al gorithm   and   the  res ults  are   sh ow in   Fig ure   (a a nd  Fi g ure   (b) nam ely.         (a)     (b)     Fig ure   7.  Bl oc k varia nce c he ckin se quence s in  t he  f our  qu adr a nts  of the i m age: (a)   hor iz on ta pass;  (b)  ver ti cal  p a ss   Evaluation Warning : The document was created with Spire.PDF for Python.
In t J  Elec  &  C om En g     IS S N:  20 88 - 8708       Smart Micr ow ave  Oven w it h Image  Cl as sif ic ation a n d. . ..    ( Ta re K han)   4245     (a)     (b)     Fig ure   8.  ( a B ackgr ound r em ov e from   Fig ure   4   (a ); (b)  bac kgr ound r em ov e from   Fig ure   4 ( d)       2.1.4.   Histogr am Ge nera tion   Ther a re  se ve ral  featu re  extr act ion   te ch niques  av ai la ble  in  the  li te ratur e   ta rg et in dif fe ren ty pes  of   i m ages  [23] , [ 24] For  instan ce,  face  rec ogniti on   al gor it h m   will   extract  featur es  s uch   as  betwee n - ey distance,  widt h - le ngth  rati et c.  [25].  H owev er,   the  cl assifi c at ion   of  f ood  i m age  is  qu it diff e re nt  as  the   food  do e not  ha ve  any  fixe s ha pe   or   te xture.  A   foo will   ha ve   dif fer e nt  sh a pe  eac tim wh e it   is  plac ed  on  a   plate   or   wh e i is  sti rr ed.   T he   ov e rall   colo patte rn   (i.e.  histogram of   the  foo d   is  the  only   sign ific ant  fe at ur e   for  cl assify in foo d.   I the  propose al gorit hm the  histogram   of   the  i m a ge,   h_ te st is  ge ner at e f or   re (R) ,   gr ee ( G) a nd   blu (B cha nnel a fter  rem ov ing   the   bac kgr ound Th blac pix el   co unt  in  the  hi sto gr a m   (i.e.  R= 0 G= 0,   B= 0)  is  set   t ze r as   blac is   use t c ov e t he   bac kgr ound  and  it   has   no  e ff ect   on  the   f ood  col or  patte rn.  The  ge ner at e histo gr am of   Fig ure   8( a)  a nd   Fig ure   8( b)   are  s how in  Fig ure   9( a an Fig ure   9( b)   nam ely.         (a)     (b)     Fig ure   9. (a ) H ist og ram  o f  Fi g ure   7( a ); (b ) Hist ogram  o f F ig ure   7(b)       2.1.5.   Matchin g Sco re C alcula tion    In   t his  ste p,   t he  ge ne rated  te st  histogram h_te st is  co m par ed  with  the  previ ou sly   gen e rated   histo gr am stored   in  the  data base  an m a tch in sco res  are   cal culat ed.   Let ’s  con si der   th at fo od  was  heated   pr e viously   an it histo gr am h_ c omp is  al r eady  sto red  in  the  data base.   Now,  w he th sam fo od  is   heate again,   the  f oo can  be  in  a   diff ere nt  plac on   the  plate in  ro ta te po sit io n,   scal e (i.e.  dif fere nt   fo od  qu a ntit y),  or  sti rr ed  c om par ed  with   its   pr e vi ou sly   store hi stog ram The  al gorithm   sh ould  consi der   al l   these   trans form ations  an s houl i nd ic at t hey  a re  the   sam food.  T he  tra ns l at ion   (i.e.  dif f eren posit ion   in  the  plate a nd   t he  r otati on  of  the food w il not  ha ve  m uch   ef fect   on  the h ist ogr a m   becau se po sit ion   in form ation  o f   pix el is  no st or e in   histo gr a m s.  The  diff e ren sti r rin co nd it io ca ca us s om m inor  di ff e ren ces but  the   ov e rall   colo pa tt ern   will   be  s i m i la r.   Fig ure   10(a)   s how th sa m fo od  a s   sh ow in  Fi g ure   5(a),  howe ve r ,   th e   foo is  r otate an in   diff e r ent   sti rr i ng  co nd it io n.   Fig ure   10( b)  sho ws  t he  im age  a fter  backg rou nd  re m ov al   and   Fig ure   10( c)  sho ws  the  hi stog ram   of   Fi g ure   10 (b).   I we  com par th e   sh ape s   of  the   histogram in  Fig ure   9(a with  t he  histo gr am sh own  in  Fig ure   10(c),  we  see   that  they   are   qu it sim i la r.   This  sho ws  t hat  the   histo gr am the  sa m fo od  ha ving  dif fer e nt   translat io n,   ro ta ti on  an st irrin co ndit ion   will   be  sim i la r.   I f   there  is  scal in of  the  f ood,  then  one  of  the  histo gr am is  scal ed  befor c om par ing.  T he  sm al le r   area  histo gr am   is  sc al ed  to  the  la r ge area  hist ogr a m   us ing   the  pse udoc ode  as  s how in   Fig ure   11.  T his  is  do ne  f or   Evaluation Warning : The document was created with Spire.PDF for Python.
                          IS S N :   2088 - 8708   In t J  Elec  &  C om En g,   V ol.  8 , N o.   6 Dece m ber  2 01 8   :   4239   -   4252   4246   each c olor c ha nn el .         (a)     (b)     (c)       Fig ure   10 .   (a)  The  sam e foo d as s how in  Fi g ure   5( a ), h ow ever, in   diff e ren t   ro ta ti on a nd sti r rin c ondi ti on (b)  Ba c kgrou nd  rem ov ed fr om  Fig ure   10(a);  ( c)  Histo gr am  of F i g ure   10( b) , whic is  quit e sim il ar to        Fig ure   9 (a )       1.   Area_h_test := sum (h_test)   2.   Area_h_comp := sum (h_comp)     3.   If Area_h_test >=  Area_h_comp Then   4.      h_comp := h_comp * (Area_h_test / Area_h_comp)   5.   Else   6.      h_test := h_test * (Area_h_comp / Area_h_test)   7.   End     Fig ure   11 .   Pse udoc od e  for sc al ing   histo gr a m s       Af te r   scal in g,   Eucli dian   dista nce  is  cal c ulate betwee t he   histo gr am f or  eac c olor  c ha nn el   us i ng  (1).   The t he   total   m at ching   sc or e   is  cal culat ed  by  a ddin the   dista nces,   d,   f or  R G a nd  c hannel   histo gr am s.  Th e sm aller th distance ( or m at c hing sc or e ), t he  b et te t he  m a tc h.       2 te st c om p d h h    (1)     2.1.6.   Te mpera tu re  Recomm end ati on   Ma tc hin sco r es  are  cal culat ed  betwee the   ge ner at ed   te st  histo gr am h_ t est an with  the  f ood  it e m   histo gr am stored   in  the  database.  T he  assigne te m per at ur is  looke up   for  the  f ood  it e m   wh ic has  th e   m ini m u m   m at c hing  sco re.  T his  tem per at ur i reco m m end ed  by  the  al gori thm   to  the  us er The  u s er   can  then   increase  or  de crease  t he   rec omm end ed   te m per at ur if  wan ts   by  pus bu tt on  switc hes   or  can   ac cept  the  reco m m end ed  tem per at ur for  the  f ood.  I th ere  is  no  sig nif ic ant  m a tc between   t he  gen e r at ed  te st  histo gram h_ te st a nd  wit the  histogra m s   stored   in  t he  data base (i.e.  the  m in i m u m   m a tc hin sc or is  gr eat er  t han   a   thres ho l val ue MAX_MS ),   then  the  f ood  is  consi der e as  a   new   foo it e m   In   t his  case,  def a ult  tem per at ur e   is  reco m m end e by  the  al gorithm   to  the  us er .   The   u se r   m ay   change  t his  te m per at ur by  push  bu tt on  s witc hes.  Af te r   the   us e pr ess   the   sta rt  bu tt on  o n   t he  m ic ro wa ve,   t he   h_te st   an d   it s   assig ned  te m per at ur e   is  a dd e to   the   database  as  a   new   f ood  it em .   In   this  wa y,  the  al go rith m   gr ad ually   l earn wh at   te m per at ur it   s houl reco m m end   f or  diff e re nt  f oods   us e i that  h ouse hold.   Th al gorithm   al so   st or es   the  dat w hen  ne i tem   is  create d, ho m any tim es an  it e m  is u sed  sinc e it creati on   a nd the a ve rag e   tim e o the  day  when i t i s u se d.       2.2.   Te mpera tu re  Feedb ack Clo sed - Lo op S ys t em   Af te r   the   ta rg e foo te m per at ur is  set the   pro posed   m icr owa ve  ov e c on ti nues   to  he at   the  f oo it e m   un ti it   re aches  the   ta rg e tem per at ur e.  On ce  t he  ta r ge tem per at ur i reac hed,  the  heati ng  is  tur ne of f   autom at ic ally.  Ever y   physi cal   obje ct   ra diate inf rare ( IR)   wa ves  pro por ti on al   to   it te m per at ur e.  T he   f oo tem per at ur is  m easur ed  us in non - c onta ct   IR  tem per at ur sens or   [ 26]   The  sens or   is  m ou nted  on   th ou te r   side  of  the  m ic rowa ve  ov e cavit roo th r ough  a   4 - m m   ho le .   T he  m ic ro wa ve  has   wav el e ng t of  arou nd  120  m m   [2 7]  and   i nfrar e d   has   wa velen gth   i the  range  of  m m   -   75 nm   [2 8].  As  t he  m ic ro wa ves  ar long   wav e s,  t hey  do  no t   pas th 4 - m m   ho le   a nd  do  no dam age  t he  se nsor The  IR  wa ves  can  pass   th rou gh  the  ho le  a nd th us t he fo od tem per at ur e ca n be s e ns e d.       Evaluation Warning : The document was created with Spire.PDF for Python.
In t J  Elec  &  C om En g     IS S N:  20 88 - 8708       Smart Micr ow ave  Oven w it h Image  Cl as sif ic ation a n d. . ..    ( Ta re K han)   4247   3.   PROT OT YP E IMPLE MENTATI ON   An  em bed de syst e m   is  i m pl e m ented  in   c omm ercial   m icr owa ve  ov e [ 29 ]   a fter   disc onnecti ng   it s   m echan ic al   ti m ing   m echan ism The  hard war a nd  the  f irm war par of  the  prototype   are  bri efly   de scribe belo w.     3.1.   Ha rdw are  De sign   The  blo c diag ram   of   the  ha r dw a re  i s how in  Fig ure   12.   The  si ng le   board   c om pu te r,   Ra sp be rr P i   (RPi)  v3   [ 30 ] is  us ed   as  the  process or.  A im age  processi ng   nee ds   high  m e m or and   proces sin spe e [ 31] ,   the  RPi   is  ch os e over  othe m ic ro con tr ollers  s uch   as   Adva nced   Vi rtual  RISC  ( AV R an Pe rip her al   In te r face  C on t ro ll er  (PIC)  w hich  has  le sse r   m e m or capa ci ty   and   s peed.   An  RPi   H c a m era  m od ule  [32]  is   m ou nted  at   the  center  of   the  roof   of   the  m i crowa ve  oven  prototype  th rough  4 - m m   ho le To  get  sh ar per   i m age,  the  fo c us   le ng t is  a dju ste to   the   heig ht  of  the   oven   ca vity   wh ic is  15  c m non - co nt act   IR   tem per at ur se ns or  [ 33]   is  m ounted  sli ghtl away  from   the  center  of  the   roof   of   the  oven  t hroug 4 - mm  ho le .     The  se nsor  has   fiel of  view  (FO V)   of   degrees  a nd   di sta nce  f ro m   the  sens or   t the  tur ntable  tray   is  15   cm Thu s the  se ns or  get the  ave rag t e m per at ure  of  ci rc ular  a rea  hav i ng   ra dius  of   15 × tan   ( 5)  1.3   c m Wh e the  tur ntable  tray   r otate s,  the  sen so gets  the  te m per at ur of   di ff ere nt  port io ns   of  the  f ood  as  it   is   placed  sli gh tl away  from   the  center   of  t he  oven   cavit y.  T he   sens or  is  inte rf ace with  t he   RPi   us i n tw wire   I2 protoc ol.  16× cha rac te li qu id  c rysta disp la (LC D)   [34]  is  interface with  t he   RPi   us in un iversal  asy nchron ous   r ecei ver - t ransm it te (U ART prot oco l.  T i nteract  with  the  us er the  desig co ntains  fou r   push - bu tt on   keys  la beled  Up D ow n Sta rt,   an Stop buzzer   is  inclu ded  in   the  desig to   gen e rate  beep  so un ds On e   of  t he  door  s witc hes   of  t he  oven   is  c onnected   wit an   inter rupt  pin  of  RPi ,   an t he  oth e door  s wi tc i s   connecte to   t he  path  of  the   AC  ci rcu it   so   that  cur re nt  can  only   flow   wh e the  door   is  cl os ed.   dayl igh wh it LE bulb  [ 35 ]   is  conne ct ed  thr ough  th con ta ct of  sing le   pole   sin gle  thr ough  no rm ally   op en  (SPST - NO)  relay   [ 36] so li d - sta te   relay   (S SR)  [37]  is  us e to   turn   on/o ff   th m agn et r on   c ircuit   for  gen e rati ng   m ic ro wa ve  a nd  t he  m oto c onnecte t o   the  turntable  tray .  Th e pow e s up ply  f or  the   RPi   boar an t he  ca m era  is  su ppli ed  us i ng   11 0V   AC   to   5. 1V  DC  a dap te [38].  T he  RPi   bo a rd   gen e rates  3.3  DC  an it   is   us ed  to  powe the  LC D,   IR tem per at ur e  senso r,  a nd  buzzer .       R P i L C D R P i   c a m e r a K e y p a d I R   t e m p e r a t u r e   s e n s o r B u z z e r A C B u l b M o t o r T o   m a g n e t r o n   c i r c u i t S S R R e l a y D o o r   s w i t c h D o o r   s w i t c h     Fig ure  12. Blo ck diag ram  o t he har dware       3.2.   Fir mw are D e s ign   Deb ia n - base Li nux  operat ing  syst em Rasp bia [ 30 ] ,   is  instal le on   16  GB   S ca r of  the   RPi   bo a r d.   The  fir m war fo the  pro po se m ic r ow a ve  is  de velop e in  Pyt ho la ngua ge.   T he   fi rm war is  bu il on   two  la ye rs - the   dr i ver   la ye a nd   t he  a pp li ca ti on   la ye r.   T he   dr i ver   la ye consi sts  of   l ow - le vel   firm war f or  acce ssing  diff e ren ha rdwar e   per i ph e rals.  Th ap plica ti on   l ay er  acce ss   the   ha rdwa re  by  c al li ng   the   f unc ti on s   of the  dr i ver la ye r.   A pseud oc od e  of t he  a p pl ic at ion  lay er is  sh ow in  Fi g ure   13.     Evaluation Warning : The document was created with Spire.PDF for Python.
                          IS S N :   2088 - 8708   In t J  Elec  &  C om En g,   V ol.  8 , N o.   6 Dece m ber  2 01 8   :   4239   -   4252   4248   On DoorClo se  E vent :     BulbOn()     := Ca pt ure Im a ge( )     BulbOff         := Cla ss if y Im age (I)     If  (C  NO T EMP TY)                           Tr   : Ge t Requi red Te m p(C)                       BulbOn()       Hea tOn()       isF ini sh : =   False       while   (NO T   isF ini sh)         FIF O.a dd  (Rea d IRTe m p())         Tc   := FIF O.a vg  ()         Displa y LCD  ()         Butt onInput   ()         wait   (SA MP LE _ RATE_DEL AY )         is_food_rea d y   := (T c   > = Tr)           isF ini sh : =   is_fo od_re ad y   OR   is_ stop_pressed  OR i s_door_openne d       BulbOff()       Hea tOff()         if  is_food_re ad y         Pla y Bu zzer()     Fig ure   13.  Pse udoc od e  for ap plica ti on  lay er       4.   RESU LT S  AND DI SCUS S ION   4.1.   Simul at i on   Re sults   The  pro pose im age  cl assifi cat ion   an te m p eratur reco m m end at ion   al gorithm as  discuss e in  Sec.   2.1,  has  been   i m ple m ented  in  MATLAB  f or  si m ulati on   on   per s on al   co m pu te (P C).  I the  sim ulatio n,   26 i m ages  of   s olid  f ood,   53  i m a ges  of  li qu i f ood,   a nd  10  e m pt i m ages  (i.e.  w he no  f ood  i the  m ic r ow a ve wer us ed Al i m ages  wer e   captur e by  the  cam era  mo unte on   t he   top   of  the  m ic rowav e Dif f eren scenari os   wer e   create with  diff e re nt  foo ds  placed  in   dif f eren c on ta ine r s.  Thi rteen  dif fer e nt  ty pes  of   so li foo ds   an plate hav in c olor  of   wh it e,  blu e,  a nd   red   wer us ed Eac so li foo w as  placed  on  e ach  ty pe  of   t he  plate in   tur n.   T he the   or ie ntati on   of   the  p la te   wa c hange a nd   t he   foo wa sti rred  be f or putt ing   it   into  t he  m ic ro wav e   s t hat  the  sam foo i in  diff e re nt   sit uation  eac tim e.  Nine   di f fer e nt  ty pes   of   dri nks   (i.e.  li qu i f ood)   wer al s use in  the  te st.   Fig ure   14  sho ws  so m sa m ple  i m ages  of   the  f oods   us ed  in  the   te sts.    Durin g   t he  si m ula ti on t he  ta rg et   te m per at ur for  eac t ype  of  foo w as  assig ne by  ge ner at in norm al l distribu te ra ndom   nu m ber ha vin m ean  ( μ of  10 a nd   sta nd a rd   de via ti on   of   15 The  accuracy  of  th i m age  cl assif ic a ti on   an te m per at ur rec omm end at io al gorithm   is  s how in  Table   1.   Th e   pro po se al gor it h m   can  disti nguis betwee an  em pty  and   a   m ic ro wa ve  oven  with  f ood  w it 100%   accu r acy It  can  al s cl a ssify  w hethe the  f ood  is   so l id  or  li quid  ha ving  a acc uracy   of   100 %.  The the  al go rithm   rem ov es  the  ba ckgr ound  f rom   the  i m age,  gen e rate  hist ogram s,  cl assify   the  i m age,  an rec omm end   ta rg et   tem per at ur e I can  reco m m e nd   the  e xact  ta rg et   te m per at ur with  an  acc ur acy   of  86. 31%  for  so li an 10 0%   for  li qu i f ood.  As   the  al go rithm   is  le arn in g,  it   need to  detect   new   f ood  it e m s.  W he the   al gorithm   cl as sifie s   new   foo im age  as  one  of  the  f ood  it e m s   that  are   al read in  the  da ta base,  it   is  co ns ide red   a in correct   detect ion   of  ne f ood.  Co nve rsely w he the   al gorithm   cl as sifie s   f ood  i m age  that  is  al read in   the  da ta base   as  new   foo it e m i is  con sidere as  inc orrect  detect ion   of   new   foo d.   The  pr opos e al gorithm   can  detect   new f ood i tems ha ving a acc ur acy   of 89. 35 % for  so li d an d 9 2.45% f or li quid  f ood.         Evaluation Warning : The document was created with Spire.PDF for Python.