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 n  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 d  Aug   8 , 2 01 8       W hen  food  is  w armed  in  a  m ic r owave   oven ,   the  user  guesses  th e  est imated   ti m e  for  the  he a ti ng.   Thi s  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 o  hot  or   stil l  c old.   In   thi s   rese arc h ,   a  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 t  te m per at ure   o f   a  food  b y   le ar ning  from   pre vious  exp erienc es  and  th e  hea t ing  stops  a utomati c al l y   wh en  th e  foo d   te m per at ur e  re a che s  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 e  ea c h  ti m e   the   sam e  food  is  warm ed .   The  al gor it h m   gra dua l l y   le arn s  th e  t y pe  o f  foods  tha t  are   used  in  tha t  hou sehold  and  be co m es  s m art er   in  the  recom me ndation.   The   proposed  al gor i thm  ca n  r ec om m end  ta rge t   te m per at ur e  wit h  an  a cc ur acy   of   86. 31%  for  sol i d  food  and  100 %  for  li qu id   food.   A  prototy pe   of  th e  pro posed  m ic rowave   is  dev el ope d  using   th e   embedde d  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 e  s ensin g   Copyright   ©   201 8   Instit ut e  o f Ad vanc ed   Engi n ee r ing  and  S cienc e .    Al l   rights re serv ed .   Corres pond in g  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 s  are  ch ang i ng  the  wa y  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 d  process or s ,  an d  wi reless  te chnolo gies   have   cause d  a   ra pid  gro wth  in   sm art  ap plica ti ons  su c h  as  c ontrolli ng  a nd  m on it ori ng  hom e  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.   A  m ic ro wa ve  ov en  (c omm on ly   ref e rr e d  to  as  a   m ic ro wa ve)   is   a  kitchen  a ppli ance  that  heat s  and   c ooks  f ood  by   exposi ng   it   to   el ect ro m agn et ic   rad ia ti on   i n  the  m ic ro w ave  f reque ncy  range.  It  has   beco m e  a  com m on   app li anc e  in   th e  m od ern  kitc he n  si nce  it s  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 r  it  b e  thro ugh dial s or  thro ugh p us h - bu tt on  pro gr a m m ing ,  is use d  to  contr ol ho w  lo n g  th e m ic ro wa ve h eat s t he  f ood.     In  this  process ,  the   us e r  nee ds  to  est im at e  t he  e xact  ti m e  m ental ly   by  co ns ide rin g  se ve ral  va riables   su c h  as  the   cu rr e nt  te m per at ur e  of  the  foo d  ( f or   i ns ta nce ,  the  foo d  co ul d  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 y  and   t her m al   pr opert ie s  of   t he  f ood,  powe r  le vel  of   t he   m ic ro wa ve  ov en,   a nd   finall y  the  desire d  ta r get  tem per at ur e  of   th e  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 y  be  est i m a te d  incorrect ly .  If  a  lon g er  ti m e   is  est i m at ed  than   the   require d  tim e,  then  the  f ood  beco m es  too   hot  to  eat .  It  m a y  cause  burn   in  the  m ou th  if  the  food   is  co nsum ed   with  a  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 r  nee ds  to  wait   u ntil   the  food   c oo ls  dow n.   I f  a  short er  tim e  is  est i m at ed  than   the   required   ti m e,   then  the  us e r  needs  to   Evaluation Warning : The document was created with Spire.PDF for Python.
                          IS S N :   2088 - 8708   In t J  Elec  &  C om p  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 t  te m per at ur e o f  t he  foo d  by  to uc h,   e stim at ing  tim e,  and   t hen h eat ing  again u ntil  the  desire d  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 ,   a  so l ution  of  t he  a bove   pro bl e m s  is  pro po se d.   The   ove rall   op e rati on  of  th e  syst e m   is  sh ow n  in  Fi g ure   1.   T he  m ai n  con t rib ution s  of the  p a per are   m entioned  below.   1.   In   this  pr oj ect ,  a  cl os e d - l oo p  m ic ro wa ve  ov e n  is  desig ned   wh ic h  co ntinuo us ly   m e asur e s  the  foo d  tem per at ur e  w it ho ut  physi ca l  con ta ct   wh i le   the  fo od  is  bein g  heate d,   an d  sto ps   the  m ic ro wa ve  autom at ic ally  wh e n  t he  f ood  tem per at ur e   r eaches  t he  ta r get  te m per at ure.  I n  this   proc ess,  the   us e r  doe s   no t  nee d  to  gu ess  the  e xtract   require d  ti m e   m entally .  This  is  m or e  conven ie nt  to  us e   an d  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 c  ta rg et   tem per at ur e  reco m m end at io n  al gori thm   is  al so   pr opos e d.   Wh e n  a   foo d  is  inse rte d  in   the prop ose d  m ic ro wa ve  ov e n  a nd  the   door  is  cl os e d,   it   ta ke s   a n  im age  of  the   f ood  a nd  store s   the  c olor  patte rn   (such   as  histogram )  of   the  f ood  i n  a  database.  Once  a  tem per at ur e  is  set   fo r  th at   foo d  us i ng  pus h  butt on  s witc hes,   t hat  te m p eratur e   is  assigne d  t o  the  st or e d  histo gr a m   in  the  data ba se.   Lat er,  w he n  th e  us er   heats  th e  sam e  kin d  of   foo d  agai n  (e ven   i f  the  foo d  is  on   a  dif fer e nt  plate   or  c up) ,   the  pr opos e d  al gorithm   automa ti cally   reco m m end s  the  t e m per at ure  w hi ch  wa s  assig ne d  for  that  f oo d  pr e viously .  T he   us e r  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 t  tem per at ur e .  The  al gorithm   cal culat es  the  colo r  patte rn   s i m i la rity   between   the  curre nt   fo od  an d  th e   histo gr am s  stored   in  the  database.  T he  cl ose st  m at ch  histog ram ’s  assigne d  tem per at ure  is  reco m m end e d  as  the  ta r get  te m per at ur e.  If   t her e  is   no  si gnific ant  m at ch  between   t he  c urren t  foo d  c olo r   patte r n  a nd   t he   store d  histo gr a m s,  then  the  new   histo gr am   fo r  that  f ood  and   it s  desire d  tem per at ure  is  add e d  to  t h e  database .  I n  this  way,  t he  m ic ro wa ve  ov en  gra du al ly   le arn s  t he  ty pe   of   foo ds   that   are  us e d  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 l  un it   s hip m ents  of  m ic ro wav e  ov e ns   a re  pro j ect ed   to  rea ch  12.69  m il l i on  unit s  [ 9 ]   a nd   96%  of  U .S.  hom es  us e  a  m i crowa ve  ove n  [ 10 ] .  T he  s urv ey   in  [ 11 ]   sho ws  that  Am eri cans  ar e  us i ng   m ic ro wa ves  to   war m   and   he at   m or e,  rathe r  pre par e  dis he s  from   scratch.  T he  m ark et   repo rt  in  [ 12 ]  publishe d  i n  Decem ber   20 17  sta te s  t hat  m ic ro wa ves  la g  be hind  oth e r  m ajo r   ap pliances  i n  te rm s  of   “sm art”  featur es.  The  pro po sed  novel  m a chine  le ar ning   base d  aut onom ou s  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 e  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 t  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 e  i s   r ea c h ed     Fig ure   1.  The   ov e rall  oper at ion   of t he pr opose d  syst em . ( a)  when a  foo d  is  inser te d  a nd th e door is cl os e d,  t he  pro po se d  m ic ro wa ve su ggest s the tar get  foo d  te m per at ur e   us in g  im age classi ficat ion  al gorithm ; (b )  Afte r  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 d  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 e  about  m easur ing   the  tem per at ur e  of  the  sam ple  or   f oo d  wh il e  they   a re  heated  by  m ic ro wa ve  i n  r eal   tim e.  T he  us e  of  co nve ntion al   el ect ric   tem per at ur e  se nsor s  insid e   a  m ic ro wa ve  ov e n  is  pr ob l e m at ic   becau se  of   the  st ron g  el ect ro m agnet ic   fiel d  env i ronm ent.  Fibe r - op ti c   sens or s   [ 13 ]   a r e  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 d  a nd   requires   cl eani n g  eac h  ti m e  t he  foo d  is  warm ed.   T his  is  i ncon ven ie nt.  I n  [14],  t he  us e   of  a n  in frare d  (I R )  fibero ptic ra dio m et er is p rop os e d  f or  non - c on ta ct   te m per at ur e m easur em ents insi de  a  m ic rowav e   ove n. In thi s   m et ho d,   t he  ti p  of  the  IR  fiber   is  sit uated   directl y  abov e  the  sam ple  and   tra ns m it s  the  therm al   rad ia ti on  e m itted  by  t he   heate d  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 h  f orward - lo ok i ng   infr a re d  (F L IR )  cam era   is  us ed,   w he re  te m per at ur e  a nd   oth er  data  is  tran sferred  t o  a  PC  fo r  m on it or i ng   a n d  Evaluation Warning : The document was created with Spire.PDF for Python.
In t J  Elec  &  C om p  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 q  K han)   4241   con t ro ll in g  th e   powe r  le vel  of  the   m ic ro wa ve.   I n  [16],  FL IR   cam era  is  use d  t o  ca pture  the  the rm al   i mage  of  the  foo d  su r fac e.  Howe ver ,  F LIR  cam era s   a re   ex pen si ve  [ 17 ]   an d  can  si gn i ficantl y   increase  the  pri ce  of   the   m ic ro wa ve  ov en.   I n  [18],  tem per at ur e  m on it or ing   in side  a  m ic ro wav e   ov e n  is  pr op os e d  by  us in g  conve ntion al   c olor  cha r ge - c ouple d  dev ic e  ( CC D)   cam era.  This  m et ho d  cou l d  be  lo w  cost,  bu t  m ay   no t  be   accurate.  An   i nexpe ns ive  te m per at ur e  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 e  ov e n  a re  disc usse d  in  [ 20 ] ,   [21].  H oweve r,   t hey  do  not  discuss   the  a ut oma ti c  sh utdo wn   of   m ic ro wa ve  powe r   wh e n  t he fo od  tem per at ur e  r e aches t he desir ed  te m per at ur e .    A  rece nt  heati ng   el em ent  based   ove n  ( no t  m ic ro wa ve - bas ed   heati ng )  in  [22],  us e s  a  hi gh   de fi niti on  (HD)  cam era  to  ide ntify  from   a  c omm on   pr e def i ned  set   of  foo ds   that   are   pu t  i ns ide   a nd  reco m m end   co ok i ng  tim es  and   temperat ur e.  A  r e sist ance  t e m per at ur e  detect ors  (RTD )   te m per at ur e  se nsor   pr obe  is  inse rted  m anu al ly   into  the  f ood  a nd  use r  ca n  get  a   noti ficat ion   on  s m art  dev ic es   wh e n  t he  foo d  is  co oked .  H oweve r ,   this  m et ho d  of  tem per at ure  sensing  re quir es  ph ysi cal   co ntact   of   th e  tem per at ure  se ns or  with  the   food.  More ov e r,   the  foo d  recog niti on   al go rithm   is   fixed   to  a  set   of   pre def i ned   f oods ,  th us   it   do es  not  le arn   a ny  new  foo d  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 d  tem per at ur e  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 n  FL IR  cam er a,  an d  do e s  not  nee d  ph ysi cal   c on ta ct   with  the   f oo d.   In  this  pro pose d  w ork ,  the   autom at ic   sh ut down  of  m ic ro wa ve  powe r  w hen   t he   food   te m per a ture  reac hes  t he   desire d  te m p eratur e  is  al s o  discusse d  us in g  a  m ic ro con tr oller - base d   em bed de d  syst em .  The  pro po se d  food   cl assi ficat ion   al gorithm   gr a dual ly   le arn s  the  f ood  it e m s  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 r  tha n a p red e fine d  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 n  Algo ri th m   T he  pro po se d  m ic ro wa ve  oven   ca ptures  a n  i m age  of   t he  f ood  w hen  it ’s  door  is  cl os e d.  The  im age  is   then  processe d  and  the  al go rithm   trie s  to  classify  the  im a ge  by  c om par ing   it s  c olor  pa tt ern   with   the  store d  colo r  patte r ns   i n  the  datab ase.   If   t he  f ood  is  cl assifi ed,   th en   it   reco m m end s  the  te m per at ur e  t hat  is  assi gn e d  t o  that  f ood.  I f  th e  foo d  is  uncl assifi ed,  the n  it ’ s  col or   patte r n  and  de sired   te m per at ur e  is  a dd e d  t o  the   dat abase .   A  bl oc k  dia gra m   of   the  pro po s ed  cl assi ficat ion   al gorit hm   is  sh own  i n  Fig ure   2 .  A  bri ef  descr i ptio n  of  th e  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 f  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 p  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 e  oven   is  cl os ed ,  an  i m age,  I captured ,  is  captu red   us i ng   a n  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 e  320  ×  240.  T he  fir st  ste p  of   the  al go rith m   is  to  determ ine   wh et her   t he re  is  food   i n  the  oven  or   it   is  e m pty.  To  do   that,  a  preex ist ing  i m age  of   the  m i cro wa ve  ov en  with out  an y  fo od,  I em pt y ,  is  com par ed  with  I captured .  If  there  is  a  sign ific ant   m at ch,   then   th e  m ic ro wa ve  i s  em pty  and   the  al gorit hm   t erm inate s  witho ut  te m per at ure  reco m m e nd a ti on .  If  there  is  a  sign ific ant  m is m atch ,  the n  there  is  fo od  in  the  m ic ro wa ve  an d  it   go es  to  the  nex t  blo c k  of  the   al gorithm .  As  the  m ic ro wav e  tur ntable  tray   can  r otate ,  it   cou l d  be  i n  a  di ff e ren t   posit io n  tha n  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 n  I captured   an d  I em pt y   will  n ot work.    In   Fig ure   3,  an   exam ple   of   a  pr ee xisti ng  em pty  i m age  (a),  a  captu red   im a ge   without  f oo d  (c ),   a nd  a   captu red   im age   with  food   (e)  al on g  with  th ei r  gr ay scal e  hi stog ram s  (b ) ,  (d)  an d  (f)  are  sh ow n  nam el y.   Her e  we  see  that,  e ven   t hough  (c )  is  ro ta te d  co m par ed  wit h  ( a),  their  histo gram s  (d )  an d  ( b)   a re  quit e  sim il ar  because   histo gram s  do   no t  con ta in  the  po s it ion   inform at i on   of   the  pixe ls  [1 2].  O n  the  oth e r  ha nd,  the   histo gr am   of   the  im age  with  foo d,   ( f),  is  qu it e  diff ere nt  f r om   (b )  an d  (d) .  To  c om par e  the  im ages,  h ist ogram   diff e re nce  bet ween   t he  tw o  i m ages  are  cal c ulate d.   If   t he  di ff ere nce  of   t he   histo gr am s  is  le ss  than  a  t hresh old ,  HIST_DIFF_THRESHOLD ,  then  the  i m ages  are  consi der e d  e qual ,  el se  they   are  con si der e d  diff e ren t.  E xperi m ents   hav e   been  co nducte d  with   10  em pty  i m ages ,  I em pt y ,   hav i ng  di ff e ren t   r ot at ion s  of  the   tur ntable  tray   and  a  thres ho l d  val ue   is  assigne d   as   100.   T he  ste ps   of  determ ining   w hethe r  th e  i m ages  are  equ al   are  s how n  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 g  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 d  im age w he n no  foo d  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 f  (c ); ( e )  Ca ptured  im age w he n  foo d  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 p  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 q  K han)   4243   2.1.2.   So li d  an d  Li quid F ood C l assi ficat i on   Af te r  t he  exist ence of th e f oo d  is determ ined,  the  nex t  bloc k  of the alg or i thm  d et er m ine s w het her  the   foo d  is  so li d   or  li quid .  Li quids  (co m m on ly   ref err e d  as   dr inks )  are  ge ner al ly   serve d  in  cu ps   or   glasses,  wh e reas  so li ds  are  serv e d  on   plate s  or   bow ls.  Cl assify ing  wh et he r  the  f ood  is  so li d  or   li qu id  is  required   to  detect   and   rem ov e  the  foo d  ba ckgr ound  in  the  ne xt  blo c k  of   the  al g or it hm .   The  pr em is e  fo r  cl assify in g  so li d  and   li quid  foo d  is  that,  in  m os t  cases,  the  te xture  of  so li d  f ood  is  coa rse,   wh e reas  the  te xture  of  li qu i d  foo d  is   sm oo th  an d  ho m og enous.  S o,  the  var ia nce  ( σ 2 )   of   so li d  f ood  im age  will   be  m uch   highe r  tha n  t he  var i a nce  of   li qu id  f ood.    In   Fig ure   5,   t he   colo r  im age  of   a  s olid  foo d  is  sh ow n  in  (a ),   it s  gray scal e  i m age  is  sh ow n  in  (b)  wit h  a  32 × 32  pix el   blo c k  draw n  in  m agen ta   color   at   m idd le ,   and   the  3D  plo t  of  the  bl ock   where  heigh t  is   pro portion al   to   the  pix el   va lu e  i s  sh own  i n  ( c).  Sim il arl y,  (d ) ,  (e),  an d  ( f)   sh ows  t he  i m ages  f or   a  li qui d  f ood  nam ely.  Her e ,  we  see   that  th e   pix el   val ues  i n  the   bl oc k  c ha ng e   m or e  in  s olid  foo d  as   show n  i n  (c) ,   whereas  the  pi xel  val ue s  are  al m os t  the  sam e  in  li qu id  f ood  as  s ho wn  in  (f).  For   this  exam ple,  the  var ia nce  of  (c)  is   746. 9  an d  the  var ia nce  of  (f)  is  1. 7 .  The  var i ance  is  cal culat ed  us in g  ( 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 d  m   is  the  m ean  of   al l  pix el   values  i n  the  bl ock.  Sim ula ti on s   ha ve   been   cond ucted  with  263   so li d  foo d  an d  5 3   li quid   food   im ages  fo r   a   blo c k   siz e  of   32 × 32  in   th e  m idd le .  It  ha s  bee n  fou nd   t hat  the  m axi m u m   var ia nce  f or   li qui d  foo d  is  4.6 .  A  thres ho l d ,  MI N _S OL ID _F OO D_ VA R ,  is  assig ne d  as  10   in  the  al gorith m .   If   the  blo c k  var ia nce  is  l ess  tha n  or  eq ual  to   the  t hr e sh ol d,  the n  the   f ood  is  cl as sifie d  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 h  a  b loc k d rawn i n  m agen ta  c olor at  m idd le ; (c)  3D  plo t  of the  blo c k  in  (b) w he re  heig ht is  propo rtion al  t o  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 h  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 k  in  ( e ) whe re  heig ht is  pro po rtion al  t o  t he pixel  value       2.1.3.   Back ground Rem oval   In   this  co ntext ,  on ly   the  foo d  portio n  of  the  captu re d  im age  is  def in ed  as  foregr ound,  as  sh ow n  inside  the  gr ee n  r e gion  in  Fi g ur e  6( a ),   a nd  the  rest  of   the  i m age  is  def ine d  as  bac kgr ound  as  s how n  in  Fig ure   6( a )  a nd  Fig ure   6(b ).   The   c olor  in form at i on  of  t he  f oo d  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 y  var y  if  t he  sam e  food  is  ser ve d  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 p  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 d  histo gra m   (d isc us se d  in  the   nex t  sect io n)   do   no t  co ntain   backgro und  c olor  inf or m at i on,  an d  thu s  t he  foo d  can  be   cl assifi ed  accuratel y  even if it  is  put o n  a  dif fer e nt  con ta ine r.         (a)     (b)     Fig ure   6. (a )  F or e gro und (insi de  the  gree n  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 d  f ood       So li d  f ood  is  gen e rall y  pu t  on   a  plate   or   po t.  When  food   is  pla ced  on   a  plate ,  it   is  gen e rall y   su r rou nded  by   s m oo th  te xtu r e  hav i ng   a  m on ot onous  c ol or  of   t he  plate   a s  show n  in  Fig ure   6 (a ) .   F or  so li d  foo d,   t he  f oreg rou nd   has   hi gh  va riance,   as  s how n  in   Fig ure   5 (c) ,   a nd  it s  backg rou nd   ha s  lo w  var ia nce s  in  t he   pix el   val ues .  This  he ur ist ic   is  us ed  to  det ect   the  backgroun d  of   the  s olid  f ood.   Liq uid   f ood  or   dr ink   is  gen e rall y  serv e d  in   a  m ug   or   glass.  F or  li qu i d  f ood,  the  for egro und   has  lo w  va riance ,  as  sh ow n  in  Fig ure   5 (f),  and   it   is  s urrounde d  by  t he  edg e  o f  the  c onta iner  a s   sho wn   i n  Fi g ure   6 ( b).  T he  bl oc k  co ve rin g  an   edg e ,  as  sh ow n  in  Fig ure   6 (b)  in   blac k  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 d  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,  a  cop y  of   the  i m age  is   first  conver te d  to  gr ay scal e  and   the n  di vide d  into  f our  qu adr a nts   –   top - r igh t,  to p - le ft,  bott om - le ft,  and  bo tt om - righ t  nam ely  as  sh ow n  in  Fig ure   7.  T hen  sta rting   f r om   the  center  of   t he  gray scal e  im age,  the  va ri ance   is  cal cula te d  f or   eac h  10   ×  10   blo c k s   acc ordi ng  to  the   horiz on ta l  se qu e nce   (i.e.  row  a fter  row  in   raster   s can  fa sh i on)  as   show n  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  a  th resh ol d  val ue,   BG_V AR_THRESHOLD ,  then  the  ba ckgr ound  is  reached   a nd  the  rem ai nin g  bloc ks   of  that  row  are  m ade  blac k  on  th e  act ual  color   i m age.  For  li quid  foo d,   if  the  var ia nce  of  a  bl ock   is  great er  than  a   thres ho l d  val ue ,  EDGE_VAR_THRESHOLD ,   t hen   t he  bac kgr oun d  is  reac he d  an d  the  rem ai nin g  blo c ks   of   that   row  are  m ade  black  on  the  act ual  color   im age.  The n  this  pr oces s  is  rep eat ed  f or   th e  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 o  t he  seq uen ce   s hown  in   Fig ure   7  (a).  Af te r   th at ,  the   entire  proce ss   is  rep eat ed  a ccordin g  to  t he   ve rtic al   seq uen ce  a s  sho wn   i n  Fig ure   7  ( b).  A nother   si m il ar  horizo ntal  an d  ver ti cal   seq uence  are  re peated   wh e re  it   searc hes  f or   fu ll y  bl ack  bl ock   a nd  on ce  fou nd,  it   fill s  the  rest  of   t he  r ow  or  the  c ol um n  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 g  the  pro po se d  al gorithm   and   the  res ults  are   sh ow n  in   Fig ure   8  (a )  a nd  Fi g ure   8  (b) nam ely.         (a)     (b)     Fig ure   7.  Bl oc k varia nce c he ckin g  se quence s in  t he  f our  qu adr a nts  of the i m age: (a)   hor iz on ta l  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 p  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 q  K han)   4245     (a)     (b)     Fig ure   8.  ( a )  B ackgr ound r em ov e d  from   Fig ure   4   (a ); (b)  bac kgr ound r em ov e d  from   Fig ure   4 ( d)       2.1.4.   Histogr am Ge nera tion   Ther e  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 g  dif fe ren t  ty pes  of   i m ages  [23] , [ 24] .  For  instan ce,  a  face  rec ogniti on   al gor it h m   will   extract  featur es  s uch   as  betwee n - ey e  distance,  widt h - le ngth  rati o  et c.  [25].  H owev er,   the  cl assifi c at ion   of  f ood  i m age  is  qu it e  diff e re nt  as  the   food  do e s  not  ha ve  any  fixe d  s ha pe   or   te xture.  A   foo d  will   ha ve   dif fer e nt  sh a pe  eac h  tim e  wh e n  it   is  plac ed  on  a   plate   or   wh e n  i t  is  sti rr ed.   T he   ov e rall   colo r  patte rn   (i.e.  histogram )  of   the  foo d   is  the  only   sign ific ant  fe at ur e   for  cl assify in g  foo d.   I n  the  propose d  al gorit hm ,  the  histogram   of   the  i m a ge,   h_ te st ,  is  ge ner at e d  f or   re d  (R) ,   gr ee n  ( G) ,  a nd   blu e  (B )  cha nnel s  a fter  rem ov ing   the   bac kgr ound .  Th e  blac k  pix el   co unt  in  the  hi sto gr a m   (i.e.  R= 0 ,  G= 0,   B= 0)  is  set   t o  ze r o  as   blac k  is   use d  t o  c ov e r  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 d  histo gr am s  of   Fig ure   8( a)  a nd   Fig ure   8( b)   are  s how n  in  Fig ure   9( a )  an d  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 s  stored   in  the  data base  an d  m a tch in g  sco res  are   cal culat ed.   Let ’s  con si der   th at ,  a  fo od  was  heated   pr e viously   an d  it s  histo gr am ,  h_ c omp ,  is  al r eady  sto red  in  the  data base.   Now,  w he n  th e  sam e  fo od  is   heate d  again,   the  f oo d  can  be  in  a   diff ere nt  plac e  on   the  plate ,  in  a  ro ta te d  po sit io n,   scal e d  (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 d  hi stog ram .  The  al gorithm   sh ould  consi der   al l   these   trans form ations  an d  s houl d  i nd ic at e  t hey  a re  the   sam e  food.  T he  tra ns l at ion   (i.e.  dif f eren t  posit ion   in  the  plate )  a nd   t he  r otati on  of  the food w il l  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 s  is  no t  st or e d  in   histo gr a m s.  The  diff e ren t  sti r rin g  co nd it io n  ca n  ca us e  s om e  m inor  di ff e ren ces ,  but  the   ov e rall   colo r  pa tt ern   will   be  s i m i la r.   Fig ure   10(a)   s how s  th e  sa m e  fo od  a s   sh ow n  in  Fi g ure   5(a),  howe ve r ,   th e   foo d  is  r otate d  an d  in   a  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 f  we  com par e  th e   sh ape s   of  the   histogram s  in  Fig ure   9(a )  with  t he  histo gr am s  sh own  in  Fig ure   10(c),  we  see   that  they   are   qu it e  sim i la r.   This  sho ws  t hat  the   histo gr am s  the  sa m e  fo od  ha ving  a  dif fer e nt   translat io n,   ro ta ti on  an d  st irrin g  co ndit ion   will   be  sim i la r.   I f   there  is  scal in g  of  the  f ood,  then  one  of  the  histo gr am s  is  scal ed  befor e  c om par ing.  T he  sm al le r   area  histo gr am   is  sc al ed  to  the  la r ge r  area  hist ogr a m   us ing   the  pse udoc ode  as  s how n  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 p  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 n  in  Fi g ure   5( a ), h ow ever, in   a  diff e ren t   ro ta ti on a nd sti r rin g  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 h  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 d  betwee n  t he   histo gr am s  f or  eac h  c olor  c ha nn el   us i ng  (1).   The n  t he   total   m at ching   sc or e   is  cal culat ed  by  a ddin g  the   dista nces,   d,   f or  R ,  G ,  a nd  B  c hannel   histo gr am s.  Th e sm aller th e  distance ( or m at c hing sc or e ), t he  b et te r  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 g  sco r es  are  cal culat ed  betwee n  the   ge ner at ed   te st  histo gr am ,  h_ t est ,  an d  with  the  f ood  it e m   histo gr am s  stored   in  the  database.  T he  assigne d  te m per at ur e  is  looke d  up   for  the  f ood  it e m   wh ic h  has  th e   m ini m u m   m at c hing  sco re.  T his  tem per at ur e  i s  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 e  if  wan ts   by  pus h  bu tt on  switc hes   or  can   ac cept  the  reco m m end ed  tem per at ur e  for  the  f ood.  I f  th ere  is  no  sig nif ic ant  m a tc h  between   t he  gen e r at ed  te st  histo gram ,  h_ te st ,  a nd  wit h  the  histogra m s   stored   in  t he  data base ,  (i.e.  the  m in i m u m   m a tc hin g  sc or e  is  gr eat er  t han   a   thres ho l d  val ue ,  MAX_MS ),   then  the  f ood  is  consi der e d  as  a   new   foo d  it e m .    In   t his  case,  a  def a ult  tem per at ur e   is  reco m m end e d  by  the  al gorithm   to  the  us er .   The   u se r   m ay   change  t his  te m per at ur e  by  push  bu tt on  s witc hes.  Af te r   the   us e r  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 d  to   the   database  as  a   new   f ood  it em .   In   this  wa y,  the  al go rith m   gr ad ually   l earn s  wh at   te m per at ur e  it   s houl d  reco m m end   f or  diff e re nt  f oods   us e d  i n  that  h ouse hold.   Th e  al gorithm   al so   st or es   the  dat e  w hen  a  ne w  i tem   is  create d, ho w  m any tim es an  it e m  is u sed  sinc e it s  creati on   a nd the a ve rag e   tim e o f  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 t  foo d  te m per at ur e  is  set ,  the   pro posed   m icr owa ve  ov e n  c on ti nues   to  he at   the  f oo d  it e m   un ti l  it   re aches  the   ta rg e t  tem per at ur e.  On ce  t he  ta r ge t  tem per at ur e  i s  reac hed,  the  heati ng  is  tur ne d  of f   autom at ic ally.  Ever y   physi cal   obje ct   ra diate s  inf rare d  ( IR)   wa ves  pro por ti on al   to   it s  te m per at ur e.  T he   f oo d  tem per at ur e  is  m easur ed  us in g  a  non - c onta ct   IR  tem per at ur e  sens or   [ 26] .    The  sens or   is  m ou nted  on   th e  ou te r   side  of  the  m ic rowa ve  ov e n  cavit y  roo f  th r ough  a   4 - m m   ho le .   T he  m ic ro wa ve  has   a  wav el e ng t h  of  arou nd  120  m m   [2 7]  and   i nfrar e d   has   a  wa velen gth   i n  the  range  of  1  m m   -   75 0  nm   [2 8].  As  t he  m ic ro wa ves  ar e  long   wav e s,  t hey  do  no t   pas s  th e  4 - m m   ho le   a nd  do  no t  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 p  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 q  K han)   4247   3.   PROT OT YP E IMPLE MENTATI ON   An  em bed de d  syst e m   is  i m pl e m ented  in   a  c omm ercial   m icr owa ve  ov e n  [ 29 ]   a fter   disc onnecti ng   it s   m echan ic al   ti m ing   m echan ism .  The  hard war e  a nd  the  f irm war e  par t  of  the  prototype   are  bri efly   de scribe d  belo w.     3.1.   Ha rdw are  De sign   The  blo c k  diag ram   of   the  ha r dw a re  i s  s how n  in  Fig ure   12.   The  si ng le   board   c om pu te r,   Ra sp be rr y  P i   (RPi)  v3   [ 30 ] ,  is  us ed   as  the  process or.  A s  im age  processi ng   nee ds   high  m e m or y  and   proces sin g  spe e d  [ 31] ,   the  RPi   is  ch os e n  over  othe r  m ic ro con tr ollers  s uch   as   Adva nced   Vi rtual  RISC  ( AV R )  an d  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 y  capa ci ty   and   s peed.   An  RPi   H D  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  a  4 - m m   ho le .  To  get  a  sh ar per   i m age,  the  fo c us   le ng t h  is  a dju ste d  to   the   heig ht  of  the   oven   ca vity   wh ic h  is  15  c m .  A  non - co nt act   IR   tem per at ur e  se ns or  [ 33]   is  m ounted  sli ghtl y  away  from   the  center  of  the   roof   of   the  oven  t hroug h  a  4 - mm  ho le .     The  se nsor  has   a  fiel d  of  view  (FO V)   of   5  degrees  a nd   di sta nce  f ro m   the  sens or   t o  the  tur ntable  tray   is  15   cm .  Thu s ,  the  se ns or  get s  the  ave rag e  t e m per at ure  of  a  ci rc ular  a rea  hav i ng   a  ra dius  of   15 × tan   ( 5)  =  1.3   c m .  Wh e n  the  tur ntable  tray   r otate s,  the  sen so r  gets  the  te m per at ur e  of   di ff ere nt  port io ns   of  the  f ood  as  it   is   placed  sli gh tl y  away  from   the  center   of  t he  oven   cavit y.  T he   sens or  is  inte rf ace d  with  t he   RPi   us i n g  tw o  wire   I2 C  protoc ol.  A  16× 2  cha rac te r  li qu id  c rysta l  disp la y  (LC D)   [34]  is  interface d  with  t he   RPi   us in g  un iversal  asy nchron ous   r ecei ver - t ransm it te r  (U ART )  prot oco l.  T o  i nteract  with  the  us er ,  the  desig n  co ntains  fou r   push - bu tt on   keys  la beled  Up ,  D ow n ,  Sta rt,   an d  Stop .  A  buzzer   is  inclu ded  in   the  desig n  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 h  an   inter rupt  pin  of  RPi ,   an d  t he  oth e r  door  s wi tc h  i s   connecte d  to   t he  path  of  the   AC  ci rcu it   so   that  cur re nt  can  only   flow   wh e n  the  door   is  cl os ed.   A  dayl igh t  wh it e  LE D  bulb  [ 35 ]   is  conne ct ed  thr ough  th e  con ta ct s  of  a  sing le   pole   sin gle  thr ough  no rm ally   op en  (SPST - NO)  relay   [ 36] .  A  so li d - sta te   relay   (S SR)  [37]  is  us e d  to   turn   on/o ff   th e  m agn et r on   c ircuit   for  gen e rati ng   m ic ro wa ve  a nd  t he  m oto r  c onnecte d  t o   the  turntable  tray .  Th e pow e r  s up ply  f or  the   RPi   boar d  an d  t he  ca m era  is  su ppli ed  us i ng   a  11 0V   AC   to   5. 1V  DC  a dap te r  [38].  T he  RPi   bo a rd   gen e rates  3.3  V  DC  an d  it   is   us ed  to  powe r  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 f  t he har dware       3.2.   Fir mw are D e s ign   A  Deb ia n - base d  Li nux  operat ing  syst em ,  Rasp bia n  [ 30 ] ,   is  instal le d  on   a  16  GB   S D  ca r d  of  the   RPi   bo a r d.   The  fir m war e  fo r  the  pro po se d  m ic r ow a ve  is  de velop e d  in  Pyt ho n  la ngua ge.   T he   fi rm war e  is  bu il t  on   two  la ye rs - the   dr i ver   la ye r  a nd   t he  a pp li ca ti on   la ye r.   T he   dr i ver   la ye r  consi sts  of   l ow - le vel   firm war e  f or  acce ssing  diff e ren t  ha rdwar e   per i ph e rals.  Th e  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 n  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 p  En g,   V ol.  8 , N o.   6 ,  Dece m ber  2 01 8   :   4239   -   4252   4248   On DoorClo se  E vent :     BulbOn()     I  := Ca pt ure Im a ge( )     BulbOff         C  := 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 d  im age  cl assifi cat ion   an d  te m p eratur e  reco m m end at ion   al gorithm ,  as  discuss e d  in  Sec.   2.1,  has  been   i m ple m ented  in  MATLAB  f or  si m ulati on   on   a  per s on al   co m pu te r  (P C).  I n  the  sim ulatio n,   26 3  i m ages  of   s olid  f ood,   53  i m a ges  of  li qu i d  f ood,   a nd  10  e m pt y  i m ages  (i.e.  w he n  no  f ood  i n  the  m ic r ow a ve )  wer e  us ed .  Al l  i m ages  wer e   captur e d  by  the  cam era  mo unte d  on   t he   top   of  the  m ic rowav e .  Dif f eren t  scenari os   wer e   create d  with  diff e re nt  foo ds  placed  in   dif f eren t  c on ta ine r s.  Thi rteen  dif fer e nt  ty pes  of   so li d  foo ds   an d  3  plate s  hav in g  a  c olor  of   wh it e,  blu e,  a nd   red   wer e  us ed .  Eac h  so li d  foo d  w as  placed  on  e ach  ty pe  of   t he  plate s  in   tur n.   T he n  the   or ie ntati on   of   the  p la te   wa s  c hange d  a nd   t he   foo d  wa s  sti rred  be f or e  putt ing   it   into  t he  m ic ro wav e   s o  t hat  the  sam e  foo d  i s  in  a  diff e re nt   sit uation  eac h  tim e.  Nine   di f fer e nt  ty pes   of   dri nks   (i.e.  li qu i d  f ood)   wer e  al s o  use d  in  the  te st.   Fig ure   14  sho ws  so m e  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 e  for  eac h  t ype  of  foo d  w as  assig ne d  by  ge ner at in g  norm al l y  distribu te d  ra ndom   nu m ber s  ha vin g  a  m ean  ( μ )  of  10 0  a nd   sta nd a rd   de via ti on   (σ )  of   15 .  The  accuracy  of  th e  i m age  cl assif ic a ti on   an d  te m per at ur e  rec omm end at io n  al gorithm   is  s how n  in  Table   1.   Th e   pro po se d  al gor it h m   can  disti nguis h  betwee n  an  em pty  and   a   m ic ro wa ve  oven  with  f ood  w it h  100%   accu r acy .  It  can  al s o  cl a ssify  w hethe r  the  f ood  is   so l id  or  li quid  ha ving  a n  acc uracy   of   100 %.  The n  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 d  rec omm end   a  ta rg et   tem per at ur e .  I t  can  reco m m e nd   the  e xact  ta rg et   te m per at ur e  with  an  acc ur acy   of  86. 31%  for  so li d  an d  10 0%   for  li qu i d  f ood.  As   the  al go rithm   is  le arn in g,  it   need s  to  detect   new   f ood  it e m s.  W he n  the   al gorithm   cl as sifie s   a  new   foo d  im age  as  one  of  the  f ood  it e m s   that  are   al read y  in  the  da ta base,  it   is  co ns ide red   a s  in correct   detect ion   of  ne w  f ood.  Co nve rsely ,  w he n  the   al gorithm   cl as sifie s   a  f ood  i m age  that  is  al read y  in   the  da ta base   as  a  new   foo d  it e m ,  i t  is  con sidere d  as  inc orrect  detect ion   of   new   foo d.   The  pr opos e d  al gorithm   can  detect   new f ood i tems ha ving a n  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.