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.   9 , No .   4 Aug us t   201 9 , p p.   2403 ~ 2415   IS S N:  20 88 - 8708 DOI: 10 .11 591/ ijece . v 9 i 4 . pp2403 - 24 15           2403       Journ al h om e page http: // ia es core .c om/ journa ls /i ndex. ph p/IJECE   Autonom ous a b norm al b ehav i ou r detect ion usin   traject or y anal ysis       Muhamme d Shua au,   K a Fei  Tha n g,   N ai S hyan   L ai    School  of Engin ee ring ,   Fa cul t y   o Com puti ng,   En gine er ing  &   T echnolog y ,   As ia   Paci f ic Uni ver sit y   of   T ec hn olog y   &   Innova t ion,   Ma lay si a       Art ic le  In f o     ABSTR A CT   Art ic le  history:   Re cei ved   J un   16 , 2 01 8   Re vised  N ov   2 1 , 2 01 8   Accepte Ma r   4 , 2 01 9       Abnorm al   beha viour  det e ct ion  ha at tra cted  signif ic a ti on  amount  of  at te nt ion   in  the  past  d ecade   du to  inc r ea sed  se cu rity   c once rns  aro und   the   worl d .   The   amount  of  dat from   sur vei llanc ca m er as  have   excee d ed  hum an   ca pa ci t y   and  there  is  a   gre at er   n ee for   anomal det e ction  s y st e m for  cri m m onit oring.   Thi s   pape r   proposes  soluti on   to this   proble m   in a  r ecept ion area  cont ex b y   using   tra jector y   ext ra ct ion  through  G aussian  Mixture   Models  and   Kalman  Filt er  for  dat associati on.   Here ,   tr aj e ctor y   anal y s is  was  per form ed  on  ext r ac t ed  tr ajec tor ie to   detec four  diff ere n anomali es  such   as  enteri ng   staff   area,   runn i ng,   loiteri ng  an squatt ing  dow n.   The   d evelope anomal y   det e ct ion  al gori thms   were   te sted  on  vide os  ca ptur ed  at   As ia   Paci f i c   Univer sit y ’s  re ce pt ion  area.   The se  a lgori th m were   abl e   to  ac hi eve   prom ising  d et e ct ion   accura c y   o 89%  and  a   fa lse  posit ive   rate  of   4. 52% .   Ke yw or d s :   Abn or m al  b eh avio ur   Anom al y detec ti on   Secu rity   Traj ect or y a nal ysi s   Visu al  s urveil la nce   Copyright   ©   201 9   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 :   Ka  Fei   Tha ng,   School  of E ng i neer i ng,   Asia Pacific   U niv e rsity  o f  Te chnolo gy &  In novatio n,   Tech no l og Pa rk Mal ay sia , Bu kit Jal il , Kual a Lu m pu r , 570 00, Mal ay sia .   Em a il : dr .k a .f e i@ap u. e du.m y       1.   INTROD U CTION     Abn or m al   behavio ur  detect io is  one  of  the   m os i m po rtant  resea rch  area   in  c om pu te vision.  It  is  a   ver c halle nging  an di ver se   area  t hat  has  at tract ed  si gnific at ion  am ou nt  of  at te ntio in   the   past   de cade .   Au t horiti es  an c orp or at io ns  ve ry  oft en  rel on   s urveil la nc vid e fee ds  to  m on it or  pu blic  places  a nd   oth e com m on   areas   su c as  rece ption  areas H ow e ve r,   the   a m ou nt  of  data   from   su rv ei ll ance  cam eras  hav e   exceede t he  c apacit of   hu m an  operato rs.  Hu m an  ope ra tors  a re  of te sloppy,  s uffer   from   fati gu a n get  distract ed  easi l y.  Hen ce hu m an  operat or a re   un a ble  to  eff e ct ively   m on it or   the  vid e fee ds   an co uld  r e su lt   in  dange rous  occ urren ce bei ng   ne glect ed.   T he   so luti on  t t his  pr ob le m   is   to  use   a aut onom ou a nom al detect ion   i s urveil la nce  vid eo to  a ut om at ic ally  dete ct   wh e s uspic io us   e ven t   has  occ urred  bas e   on the c onte xt.   Ma ny  diff e re nt   app r oac hes  t aut onom ou s   ano m al dete ct ion   ha ve  be en  us e by  re searche rs  in  recent  ye ars.   I [ 1],  su s picious   be hav i our   detect ion   wa perform ed  by  util isi ng   con te xt ual  in for m at ion .   This  syst em   c on sist   of   c on te xt  sp ace  m od el   that  prov i des  c on te xt  sensiti ve  in f or m at ion   w hich  wa s   represe nted  by   the  beh a viou r   cl ass  an fr e quency  of  it oc currence T he data  stream   cl us te rin al gorithm   was  us e to  update  t he  beh a viour   m od el   e ff ic ie ntly   from   the  vid e fee with  li m it ed  res ources  a nd   tim e.  Finall y,  an  inf eren ce  al gorith m   was  us ed  to   cl assify   the  beh avi our  by  usi ng   the  in for m at ion   fr om   c urren t   con te xt  and   th pr e viously   l earn e co ntext   to  m ake  an  i nf e ren ce  a bout   an  ob se r v ed  beh a viou r.   I [2 ]   th e   researc hers  pr opos e an  uns up e r vised  a nom al detection  syst e m   us ing   featur cl us te ri ng.  Ga us sia Mi xtu re  Mod el   ( GMM)   based   foregr ound  detect io was  us e with  adap ti ve  reg i on  updati ng   in  wh ic the  in put  fr am e   was  div ide i to  no n - o ver la pp i ng  blo ck an gr a di ent  sim i la rity   betwee the   ba ckgr ound  an input   fr am was  cal culat ed.   Mult i ple  obj ect   tra ckin was  t he pe rfor m ed  and   obj ect   feat ur es  wer e xt racted  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.  9 , N o.   4 A ugust   201 9     24 03   -   2415   2404   fo ll owe by  scene  analy sis  to  cl assify   the  even t.  A no m al detect ion   without  pr i or   knowle dge  ab ou the  env i ronm ent  was  m ade  po s sib le   by  extracti ng  patte r ns   th rough  feat ur cl ust ering   a nd  m a tc hin t he  traj e ct or to  cl us te by  c om par ing   with   pr e de fine t hr es hold  unde r   Gaussi an  distr ibu ti on  to  dete ct   abnor m al   par of  the tra j ect ory .   The  al gorithm  w as a ble to  ach ie ve  go od r es ul ts.    In   [ 3],  ab nor m al   beh avio ur  detect ion   wa based   on   tr ajecto ry  Sp ar s Re con str uction  An al ysi s   (S RA ).   Tra j ect or ie extr act ed   fr om   ob j ect   tr ackin of   nor m al   beh avio urs  wer colle ct ed  an cat egoris ed  in  to  diff e re nt  Ro ute  set an sa m pled  with  Least - square Cub ic   S plin Curves  Appro xim a ti on   (LC SCA).   Test   trajecto ries  wer al so   re pr ese nted  with   LCSC featu res  an traject or ie we re  cl assifi ed  us i ng   S RA  on   the  dicti onary   dataset   us e d.  In   [ 4]  m eth od  was  pro pose f o l oiter ing   detect ion  wh ic is  a a bnorm a l   beh a viou in  m any  con te xts.   The  m e tho was  base on  Traj ect or Di r ect ion   Histo ry  An al ysi (T D HA)  an Inverse  Per sp e ct ive  Ma pp i ng  wh ic wa use to  reso l ve  di stortion   of  tra je ct or dire ct io due  to  pe rspect ive   eff e ct . In  T DHA,  d irect io be tween  t wo  vect or s   we re  cal cul at ed  f or  dir ect ion  histo ry  a nd an gle b et wee them   was  cal culat ed t analy se d ire ct ion  v a riat ions betwee vect or s . In  [ 5], a covar ia nce f eat ur e d escri pto r o ve the   whole  vid e f ram us ing   H orn - Schu nck  op ti cal   flow  co m pu ta ti on   al gorithm   was  us ed  to  e nc od e   m ov ing   inf or m at ion  and  on e - cl ass s up port  vector m a chine  al gorith m  w as u sed  to c la ssify ab nor m al  ev ents.    In   [6 ] a bnorm al   detect ion   al gorithm   was  pro posed  base on   a im age  descr ipto a nd   a   non - li ne ar   cl a ssific at ion   m et ho d.  H ist ogram   of   op ti cal   flow   ori entat ion  w as  us e to   encode  m ov ing   inf or m at ion   of   ev er y   fr am and   on e - cl ass  sup port  vecto m achine  for  cl assifi ca ti on T he the   researc hers  use sta te   tran sit ion  m od el   to  redu ce  false  detect i on s   due  t s ho rt  ab norm al   even ts  w hich   occ ur   ve ry  rar el in  sm all  nu m ber   of   fr am es  in  the  l ong  seq ue nce.  The  sta te   trans it ion   m od el   ch ang e s hort  ab norm al   even ts  to  norm al   s ta te  and  vice  ve rsa  a nd  it   was  fou nd  to  be  ve ry  eff e ct ive.  I [ 7]  ano m al detect i on   base on   hi erarc hical   ac ti vity - patte rn  disc ov ery  f ram ewo r was   pr opos e d.  I t he  offli ne   trai ning   pha se,  norm al   vid eos  we re  in pu an i m ages  wer e   s plit   in  to   fixe siz cel ls  to  get  lo le vel  visu al   featu res   from   the  cel ls.  T hen  an al ysi was   carried  out  to  fin dif fer e nt  norm al   activity  patte rn pr es ent  in  the  trai ning  vi deos.  T hen   i the  te st  ph ase ,   un i fied  e nergy  f un ct io was  de sig ned  to  cal culat ano m al ener gy  of  each  c el in  the  te st  fr am e.   Finall y,  com bin at io of  ene rg val ue  an sp at ia l - te m po ral  relat ion sh i p   of   cel ls  we re  use to  fi nd   a bn or m al  reg i on pr e sen t.  In   [ 8],  tra j ect ory   base sp ars rec on st ru ct io f ram e work   was  us e f or   vid e a no m al detect ion   in vo lving   m ulti ple  obj ect s.  T he  li near   sp a rsity   m od el   was  ke rn el iz ed  to  e nab le   s up e rio r   cl ass  separ a bili ty . Th is l ed  to  a i m pr ov e d detec ti on   rate.    In   [9 ] , a  l oiteri ng  a al gorith m  w as prop os e to  detect  loit erin g.  T raj ect ory  ex tract io n w as p er f or m ed  and   loit eri ng   de te ct ion   was  pe rfor m ed  by  analy zi ng   the  tr ajecto ry  thr ough  cal culat ed  an gles  betwee ve ct ors   on   the  tra j ect ory   and   fixe po i nt.  The tra j ect ory   is  con s idere loit erin if  the  traject or durati on  is   m or e   than  fi xed   ti m or   the  va ri ance  of  the  dif fer e nce  bet wee the  a ng le is   m or than  fixed   c onsta nt.  I [ 10 ] an  an om al d et ect ion   syst em   was  pro posed  usi ng  ob je ct   trackin a nd   cl assify i ng  act ivit ie based   on   sem antic s - based   a ppr oach.  T he  r esearc hers   detect ed  su s pi ci ou act ivit ie su c as   loit e rin g,   st olen  l ugga ge,  aband on e ob j ect s,  et c.   I [11],  histo gr a m   of   opti cal   flo or ie ntati on s   was  us e to  e nc od e   m ov ing   inf or m at ion   an one  cl ass  suppo rt  vector   m achine  or  ke r ne pr incipal   co m po nen analy sis  m et ho wa us ed  for  cl assifi cat ion o a bnorm al  act ivit ie s.    In  [ 12 ] ,   the  res earche rs  highli gh te th at   the  pr ese nce  of  pa ssive,  sta ndin c row is  a i nd i cat io a abno rm al  event   cou ld  occur.  The  m et ho do l og in vo l ve identify in sti ll   crowd   by  us i ng   e dges  an colo ur   var ia ti ons  dom inate by  s kin   colo ur   within  t he  cr owd.   Wh en  the  cr owd  was  detect ed  f or   certai nu m ber   of   fr am es,  the  incident  was  a na ly sed  for   ab no rm al  beh a viou r.   I [ 13] an om al detection  was  base on  sh ort   local   traject or i es  of  f oreg rou nd  supe r - pix el s.  I [14],  a onli ne  fr am ework   f or   vide an om aly  detect ion   was   pro po se with   com pact  set   of  hi gh ly   des cripti ve  featu r es  ext racted  f ro m   no vel  c el structu re.   A   cel structu re  was  const ru ct e f or   the  entire   sce ne  to  de fine  s pa ti o - te m po ral  r egio ns   to   be  a naly sed  a nd  co m pact   set   of  featur e s   we re  e xtracte d.  The   c om pact  featu res  we re  the analy s ed  t c onstruc var i ous  m odel an finall an  inf eren ce  m echan ism   that  us es  local   sp at io   tem po ral  nei ghbour hood  of  cel ls  wer us e t disti nguish ab norm al  acti on s.    In   [15],  rea l - tim m ov ing  obj ect   act io recog niti on   s yst e m   was  propose base on  m otion   analy sis.  The  syst e m   was  i m ple m ented  on   PixelSt rea m s - bas ed  FPGA.  The  m ov in obj ect   detect ion   wa s   perform ed  by  the  delta - fr am m e tho w hi ch  determ ines  the  a bs ol ute  diff e re nce  between  tw s uc cessi ve   i m ages.  This   m et ho was   use because   of  it abili ty   to  ad apt  to  c ha nges  in  li gh t   i ntensit var ia ti ons.   I [ 16 ] ,   h a rdwar e   m od el   t m easur m otion  es tim a ti on   wa pro po se us in bit  plane   m at ching   al gorithm .   The  al gorit hm  cal culat ed  th true  m otion  betwee vi de f ram es  fo r   blo c an rem ov ed  te m po ral   redu nd a ncies  be tween  vid e o f ram es. A lso,  it  tracke the  m otion   of f ea tu res  in vide se que nces.   In   t his  pa per,   ru le - base ano m al detect ion   syst em   in   rece pti on   a rea  co ntext  is   pro po se d.   The  a dvanta ge   of  s uch   sys tem   is  that  the  la rg am ounts   of  la belle tr ai nin data  re qu i red  with  m achine  le arn in a ppr oa ches  a re  no ne e ded  an t he  syst e m   is  m or reli able.  T he  a no m al ie that  are  detect ed  with  the   syst e m   are  ru nn i ng,  enteri ng  the  sta ff   ar ea,  loit ering   a nd   s udde squat   dow n.   Sudd e squat   do wn   is  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       Auton omo us   abnor ma be hav iou r  d et ect io n usin tr aject ory  ana ly sis  ( M uham med Sh uaau )   2405   consi der e as  an  an om al becau se  if  pe rson  s udde nly  sq uats  dow n,  it   cou ld  m ea that  there  w as  an  aggressi ve  act ion  f ro m   so m e body  s uch  as  s hootin or   t hrow i ng  thin gs .   The  blo c dia gr am   of   t he  propose syst e m  arch it ect ur e is  sho wn  in Fig ure   1.     The  rest  of  th pap e is  or ga nised  as  f ollo ws.   Sect io pr ese nts  the  vi deo   processi ng  al g or it hm Mult iple  obj e ct   trackin al gorithm and  an om aly  detect ion   al go rith m s   are  pr ese nted  i sect io ns   3 - 7.   In   sect io 8,   r esults  of   te sti ng  the  al gorith m s   al on with   discuss i on   are  presente d.   The  pa pe is  f inall con cl ud e i s ect ion   9.       F o r e g r o u n d   d e t e c t i o n   u s i n g   G M M M u l t i p l e   O b j e c t   t r a c k i n g   u s i n g   K a l m a n   F i l t e r F e a t u r e   e x t r a c t i o n   ( t r a j e c t o r y ,   B L O B   a r e a ,   v e l o c i t y ) C l a s s i f i c a t i o n   b a s e d   o n   f e a t u r e s O u t p u t   r e s u l t I n p u t   v i d e o     Figure   1.  Pro pose syst em  b lock  d ia gr am       2.   VID E O P ROCESSI NG AL GORIT HM   Fig ure   2   sho w the  flo wc hart   of  vi de pro cessi ng  al gorit hm The  al gor it h m   is  run   unti al the  fr am es  of   t he  vid e file   are  processe d.  O bj ect   trackin is   pe rfor m ed  fir st,  w hich   rea ds  the  fr am from   the  vid e file   and   detect m ov in obj ect s.  The  de te ct ed  m ov in obj ect are  t hen   ass ociat ed  to  tracks  w hic stor the  tra j ect ory   histor an m a ny  oth er  detai ls  about  the  m ov in obj ect T he  trackin m e thod  is  exp la in ed  in  the n e xt secti on.        S t a r t A r e   t h e r e   a n y   m o r e   f r a m e s   t o   r e a d   i n   v i d e o   f i l e ? S t o p N O T r a c k   m o v i n g   o b j e c t s Y E S I s   t h e r e   t r a j e c t o r y   h i s t o r y   o f   a n y   t r a c k e d   o b j e c t ? D i s p l a y   f r a m e N O r e l i a b l e T r a j e c t o r i e s   =   t r a j e c t o r y   h i s t o r y   o f   o b j e c t s   w h o s e   t o t a l   v i s i b l e   c o u n t   >   m i n i m u m   v i s i b l e   c o u n t   t h r e s h o l d Y E S A r e     t h e r e   a n y   r e l i a b l e T r a j e c t o r i e s ? N O n   =   n u m b e r   o f   r e l i a b l e T r a j e c t o r i e s i   =   1 Y E S I s   i   >   n ? I s   r e l i a b l e T r a j e c t o r i e s ( i )   i n   s t a f f   a r e a ? Y E S I s   r e l i a b l e T r a j e c t o r i e s ( i )   r u n n i n g ? I s   r e l i a b l e T r a j e c t o r i e s ( i )   L o i t e r i n g ? i   =   i   + 1   I s   r e l i a b l e T r a j e c t o r i e s ( i )   s q u a t t i n g   d o w n ? D r a w   a   g r e e n   b o x   a r o u n d   o b j e c t   a n d   l a b e l   M o v i n g N O N O N O N O D r a w   R e d   b o x   a r o u n d   o b j e c t   a n d   l a b e l   a n o m a l y   d e s c r i p t i o n N O Y E S Y E S Y E S Y E S     Figure   2 Vi de o processi ng algorit hm       Af te r   cal li n obj ect   t rack i ng  m et ho d,  the  al gorithm   checks  to  see  i the  m et ho retu rned  a ny  track s   of   m ov in ob j ect   w hich  co nt ai ns   the  traje ct or hist or y.  I no   trac ks   a re  r et urned,  the  al gorithm   con ti nues  by  disp la yi ng  the f ram and   m oves  on  to p r oces sing  n e xt  f ra m e.  I trac ks   are  av ai la ble  the t he  al gorithm   checks  to  see  if  t he  tra ck  is  reli able  track.   Re li able  tracks  are  t hose  trac ks   w hose  total   visible   co un is  m or than  a   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.  9 , N o.   4 A ugust   201 9     24 03   -   2415   2406   set   threshold This  is  done  t re du ce  false  detect ion of   noise   as  m ov ing   obje ct due  t sm all  illu m i nation  changes The  t hr es hold  has  to  be  determ ined  ex per im ental ly   and   it   depends  on  the  f r a m rate  of   th vid e o   input  use d.  If   t he  th res ho l is   too  high,  act ua m ov ing   obje ct m igh not   be   detect ed   a nd  if  t he  value   is  to low,   l ot  of   noise   will   be  de te ct ed.   The  t hresh old   us ed  i the  pro gr am   was  an the  fra m rate  of   the   vid e us e was  9.8  f r a m es  per   seco nd.  A obj ect   has  to  be  m ov ing   f or  at   le ast   fr am es  bef or it trajecto ry  histor will  b e a naly sed.     Wh e reli able   tracks  of  m ov i ng  ob j ec ts  are  a vaila ble,  their  tr ajec tory  hist or i analy sed .   The  tra j ect ori es  are  analy se in  loop  s that  the  al gori thm   can  detect   m ulti ple  people  an che ck   their  trajecto ry  histo ries  f or  an om alies.  They  a re  c heck e t see   if  the   pe rs on  is  in  the  sta ff  are a,   r unni ng,  loit erin or   s qu at ti ng  do wn.  If   a an oma ly   is  detect ed  in  the  traject ory   analy sis,  the  trajecto ry  is  cl assifi ed  as  ab norm al   and  it   is  hi gh l igh te wit red  bo unding  box  a nd  la belle with  a   desc riptio of  the  ano m al y.  W he on e   ano m al y i s d et ect ed   in a t raj e ct or y, the  sam e  traj ect or y i not chec ke f or  oth e an om al ies  beca us e t hat p ers on   will  already  be  classi fied  as  a bnorm al .   If   no  a no m al ies  are  detect ed  in  the  tr aject ory   analy sis,  the gr ee boun ding  box  is  dr awn  ar ound   the  pe rs on   a nd  is  la bell ed   as  “M ovin g”.   On ce   al the  traject or ie a re   analy sed  a nd   m ov ing   peop le   are  cl assifi ed  an highli gh te d,   t he   fr am is  disp la ye a nd   t he   al gorithm   c on ti nues  proce ssing   t he  rem ai nin fr am es  un ti al the  f ram es  a re  pr ocesse d.   The  m et ho ds  us e to  detect   the  a no m al ie s   are   e xp la i ned  in  th e   fo ll owin sect i on s       3.   MU LT IPLE   OBJECT  TR ACKIN AL GORIT HM   Figure  sho w the  m ulti ple  obj ect   trac king   m et ho pro posed.   T he  fr am e   is  read   f r om   vid eo  file   and  foregr ound  m a sk   is  obta ine by  us i ng   GM and   t hen   m orp ho l og ic al   openi ng   an cl osi ng   with  rectangula r   structu rin el em ents  are  done   to  rem ov no i se.  The bl ob   analy sis  is  per f or m ed  to  detec the   m ov ing   obj ect s The  BL OB  a na ly sis  returns   the  boun ding  boxe of  the   m ov i ng  obj ect and  their   ar ea  in  pix el s.  Th BLOB   area is  the n use to  fur t her re duce  detect ion n oise.       S t a r t S t o p M a s k   =       g e t   f o r e g r o u n d   m a s k   o f   F r a m e   u s i n g   G M M M a s k   =   p e r f o r m   m o r p h o l o g i c a l   p r o c e s s i n g   o n   M a s k B b o x e s ,   B l o b a r e a s   =   p e r f o r m   b l o b   a n a l y s i s   o n   M a s k F r a m e   =   R e a d   n e x t   v i d e o   f r a m e R e m o v e   d e t e c t i o n s   f r o m   B b o x e s   a n d   B l o b a r e a s   i f   b l o b   a r e a   <   A r e a   t h r e s h o l d P r e d i c t   n e w   l o c a t i o n s   o f   e x i s t i n g   T r a c k s   u s i n g   K a l m a n   F i l t e r C o s t   M a t r i x   =   d i s t a n c e s   b e t w e e n   p r e d i c t e d   B b o x   a n d   e a c h   d e t e c t e d   B b o x A s s i g n   d e t e c t i o n s   t o   T r a c k s   u s i n g   H u n g a r i a n   a s s i g n m e n t   A l g o r i t h m   b a s e d   o n   t h e   C o s t   M a t r i x F o r   a s s i g n e d   d e t e c t i o n s :   u p d a t e   p r e d i c t e d   B b o x   w i t h   d e t e c t e d   B b o x T r a c k . a g e   = T r a c k . a g e   +   1 T r a c k . T o t a l V i s i b l e C o u n t   =   T r a c k . T o t a l V i s i b l e C o u n t   +   1 T r a c k . C o n s e c u t i v e I n v i s i b l e C o u n t   =   0 F o r   u n a s s i g n e d   t r a c k s :   d e l e t e   p r e d i c t e d   B b o x T r a c k . a g e   = T r a c k . a g e   +   1 T r a c k . C o n s e c u t i v e I n v i s i b l e C o u n t   =   T r a c k . C o n s e c u t i v e I n v i s i b l e C o u n t   +   1 F o r   u n a s s i g n e d   d e t e c t i o n s : A d d   a   n e w   t r a c k   t o   t h e   e n d   o f   t h e   T r a c k   a r r a y D e l e t e   T r a c k s   w h o s e   a g e   <   a g e T h r e s h o l d   a n d   ( T o t a l V i s i b l e C o u n t   /   a g e )   <   0 . 6     Figure   3 Mult iple o bject  trac king m et ho d       S om detect ion a re r em ov ed   if  the   BLOB   a rea o f   the d et e ct ion   is  le ss   th an  a   set   th reshold.  T his  ste is  to  re du ce  noise T he  th res ho l d are   set   base on  the   distance  betwe en  the  obj ect   and   c am era.  Fig ure   4   sh ows   the t hr e e   re gions in  the  r ece ption area   to il lustrate  thi s approac h.     The  BLOB  a r ea  for  perso wal king  in  r egio is  m uch   m or than  oth e re gions  because   this  reg i on   is  cl ose to  cam era  posit ion T he  m i nim u m   BLOB   area  thres hol f or   t his  re gio is  higher  a nd   if  a   detect ion   area  is  s m aller  than   the  threshold that  detect ion   is  delet ed.   This  is  becau se  ve r s m all  detect i on in   this re gion is  noise   du e  to  il lu m inati on  c hanges. Si m i la rly , r egi on 2 an d re gion  is  proce ssed base d on  BLOB  area.  The  sam per s on   walkin in  re gion  ha m uch   s m a ll er  BLOB  area  com par ed  to  walkin i re gi on   3.   The regi on m i nim u m  area th r esh old s ho ud  be   determ ined exp e rim ental l y   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       Auton omo us   abnor ma be hav iou r  d et ect io n usin tr aject ory  ana ly sis  ( M uham med Sh uaau )   2407       Figure   4 Mult iple o bject  trac king m et ho d       Af te r   delet in t he  detect ion s   ba sed  on  are a,  t he  nex ste is   to  assig detec ti on t trac ks   and  ad t he   boundi ng   box  coor din at es  to  trajecto ry  histo ry  of   the  trac k.  In   or der   to  do  this,  Kalm an  Fil te is  first  us ed  t pr e dict  the  ne xt   locat ion  of  th exist in trac ks   wh ic a re  al read as sig ned.  I the re  a re  no  e xisti ng  trac ks   t he the  al gorithm   create ne w   tr ack  for  eac de te ct ion   a nd  in   the  fo ll owin cal ls  to  this  functi on  to   proc ess  th e   rem ai nin f ra m es o t he vide o fil e, it pre dic ts t he next l oca ti on   us in g Kal m an  Fil te if m otion i detect ed.   Af te predict in the  nex l oca ti on s,  c os m atr ix  is  cal culat e d.   C os m a trix  is  an  by  m at rix  that  con ta in the  E uclidia distan ces  betwe en  ea ch  detect ion   a nd  pr e dicte lo c at ion   of   e ve ry  existi ng   t rack  wh e re  repre se nts  t he  nu m ber   of  t rack s   an is   the  num ber   of  detect ion s Eac value  i t he  m at rix  re pr ese nts  the  cost  of   a ssig ni ng  the  N th   dete ct ion   t he  M th   t rack.   Af te r   cal culat ing  the  c ost   m a trix,  Jam es  Mu nkres ’s  var ia nt  of   the  H unga ri an  assig nm ent  al gorithm   is  us e to  determ ine  wh ic trac ks  are  m issi ng   and   wh ic dete ct ion sh oul be gin   new   t rack s T he  al gorithm   is  al so   s upplied  with  scal a val ue  w hich   is  the  cost  of  no n - assignm ent.  This  value  repre sents  the  cost  of   trac or   de te ct ion   rem ain in unassig ne d.   T his  value  was  al so  determ ined  ex per im ental ly   a nd   20  is  the  va lue  us e in  th e   i m ple m entat io n.   T he  assig nm ent  al gorithm   returns  the  ind ic es  of   the  track w hich  a re  assig ned   a nd  un ass ign e d.   It  al so  returns  t he  ind ic es  of  una ssigne detect ion s   Fo assi gn e de te c ti on retu r ned   f r om   assig nm ent  al go rith m ,   the  pr edict e boun ding  bo is  rep la ced   with  the  act ual   detect ed  bo unding  bo x.   T he track ’s  a ge  a nd   t otal  visible  count  are  in creased Co ns e cutive   inv isi ble  c ount   of  the   trac i set   to   0.  F or  unassig ne tr acks  t he  pr e di ct ed  bo undi ng  box  is  delet ed  from   trajecto ry  hist or because   traject or a naly sis  sh ould  only   be  perfor m ed  on  act ua detect ion a nd  no t   pr e dicti on s . T he the  trac k’ s  ot her   pro per ti es  are set acc ordi ng ly   Fo un a ssig ne detect ions,  a   new   track  is  a dd e d   an sto re in  the  tracks  arr ay A fter  th at   tracks  are   delet ed  if   the   track ’s  a ge  is   le ss  tha a ge  t hresh old  an (t otal  visible  c ount/ age is   le ss   than   0.6 T he  above   conditi on   will   beco m true  if  track  is  l os f or   s om fr am es  wh ic c ou l m ean  that  the  p ers on  st oppe m ov ing   or  if  no ise   is  detect ed  an only   ap pear for  very   sh or ti m e.  If   per son  sto pped  m ov in an the   track  of  that  per s on  is  del et ed,   w he th per s on  sta rt m ov in aga in  new   t ra ck  will   be  cr eat ed.   The  i nfor m at ion   st or e i eac trac k   are  t rac ID, b ou nd i ng  box hist or y,   B LOB  a rea h ist ory a ge,   t otal  vi sible  count a nd cons ecuti ve  i nv isi bl e co un t .   The  trac I of   is  assi gned  to  first  trac an t hen   it   is  increm ented  for  eac of  th fo ll owi ng   tracks.   new  boundi ng  box  is  ad ded  to   the   e nd  of  boundi ng  bo a rr ay   of  the   trac e ve ry  tim it   is  de te ct ed  and   t his  f or m the  boun ding  box  histo ry  w hich  is  al so   t he  tr ajecto ry  histo r y.  Ce ntro i ds   ar the  m idd le   po int o f   the  bo unding  box.  BLOB  a r ea  histo ry  is  a lso  sa ved   i a   si m il ar  way  to  boundi ng   b ox  histor y.  The se  two  pro per ti es  are   la te analy sed  for  a no m al detect ion T he  BLOB  area   hi story  is  on ly   use in   the  dete ct ion   of  sq ua tt ing   dow a no m al tog et he with  tr ajecto ry  hist ory The   a ge,   t otal  visible   co un an c onse cutiv e   inv isi ble  c ount   pro pe rti es  are  u se to   m anage  track a nd  to  d et erm ine  reli able  trac ks .   It  is   al so  u se t re m ov e   no ise  as e xp la i ned b e f or e.       4.   ALGO RITH TO  D ET E CT ENTE RI NG STAF A REA   The  al gorithm   us e to  detect   wh e pe rson   enters  the  sta f area  is  sh ow in  Fig ur e   5 The  ob j ect ’s   la st  boundi ng  box  is  us e t get  the  la st  ce nt ro id   w hich   gi ves  t he  obj ect cu rr e nt  locat i on.  T his  ce ntr oi d’ and   co ordina te are  check e to  see  if  it   is   inside  the  rec eption  desk   sta ff   area  w hich  can  be  bo unde by  rectan gle.  If   t he   ce ntr oid  is  w it hin   the   rece ption   sta ff  area   r ect ang le ,   the  obj ect ’s  tra j ect ory   histo ry  is  furthe r   analy sed  to  se if  the  ob j ect   ca m fr om   ou tsi de  the  recept ion   sta ff   ar ea.  This  is  done  to   avo id  cl assify ing   as   abno rm al   wh en  the   rece ptio ni st  m ov es  in side  the   r ece ptio a rea.  If  any  of   t he  obj ect s   previ ou s   cent r oid   is   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.  9 , N o.   4 A ugust   201 9     24 03   -   2415   2408   ou tsi de  the  rec eption  a rea  re ct ang le the the  pe rson  cam fr om   ou tsi de   and   that  is  de te ct ed  as  abno rm al.   Howe ver,  if  none   of  t he  obje ct ’s  pre vious   centr oid s   are   outsi de  t he  r ecepti on  area   rectan gl e,  that   is  not   detect ed  as  abn or m al  b ecause   it   m eans th at  th e rece ption ist  i s m ov ing.        S t a r t a b n o r m a l   =   f a l s e     I s   t h e   o b j e c t s   l a s t   c e n t r o i d   i n s i d e   t h e   r e c e p t i o n   d e s k   r e c t a n g l e ? S t o p N O I s   a n y   o f   t h e   o b j e c t s   p r e v i o u s   c e n t r o i d   o u t   o f   r e c e p t i o n   d e s k   r e c t a n g l e ? Y E S N O a b n o r m a l   =   t r u e Y E S     Figure   5 Al gorithm  to  detect  w he a  p e rs on  enters  sta ff are a       5.   ALGO RITH TO  D ET E CT RU NNIN G   Fig ure   6   s how the  al gorith m   that  is   us ed   to  detect   wh e per s on  is  run ning.  I the   nu m ber   of  boundi ng  bo xe or  ce ntro i ds   i the   tra j ect ory   histor of  th track  is   m or than   the  num ber   of  fr am es  use to   fin vel ocity   then  t he  a ver a ge   velocit of  the  trac is  cal c ulate d.   T he  num ber   of  f ram es  to  co ns i der   wh e cal culat ing   vel ocity   is  pr e de fine value   whose   m os optim u m   value  ca be  determ ined  ex per im e ntall y.   In   t his  re searc h 10  f ram es  wer us e t f ind   velocit a nd  this  is  rou ghly   eq uiv al ent   to  sec ond  s ince  the   fr am rate  of   t he  te st  vi deo s   wer 9.8  fr am es  pe sec ond.   S uch  sm al value  was   us e be cause  the   rece ption   area  is  ver sm al and   it   ta kes   ver short  tim to  ru ac ro ss   the  area.  If   th nu m ber   of   points  in  the  traj ect or y   histor y a re less  than f ram es n eede d t cal c ula te  v el ocity  the the  m et ho d r et urns  the  tra j e ct or y as  norm al   If   t her e   a re  e noug po i nts  in  the  traj ect or histor t hen   t he   instanta ne ou velocit bet ween  ad j ace nt  centr oid a re  c al culat ed.   Eac cent ro i can   be  re pr ese nte by  it a nd  coo r dina te and   t his  is  show i n     Figure  7 .   The   velocit ie of   the  trajecto ries   are  cal c ulate in  loop  w hich  r uns  dow nw a r d.   The  c ounter   var ia ble  is  ini ti al ise to  the  l ast   centr oid  in  the  be ginni ng  and  the  l oop  is   r un  unti the  c ounter   dec reas es  by   the  num ber   of   fr am es  need e to  cal culat th velocit y.  I each  it erati on   t he  insta ntane ous  ve locit between  adj ace nt ce ntr oi ds  i a nd i - 1 ar e cal culat ed .     Eucli dean   d ist a nc e = ( X i X i 1   ) 2 + ( Y i Y i 1   ) 2   (1)     Vel oc ity = Eucli dean   distanc e 1 fra me   ra te   (2)     The  E uclidea distance   is  cal culat ed  us in t he  f orm ula  in  ( 1 )   a nd  the th velocit is  c al culat ed  by   div idi ng   the  distance  by  dura ti on   of   the  fr a m e   as  in  ( 2 ) This  velocit is  add e to  var i able  to  find   th total   velocit of  al it erati on s.   The wh e t he  l oop  has  finis hed,   the  a ver a ge  ve locit is  cal culat ed  by  div i din th e   total   velocit by  the  nu m ber  of   fr am es  us ed  to  fin the  velocit y.   The the  aver age  ve locit is   com par e against  t he  r un ning  th res ho l wh ic was  det erm ined  ex per i m ental ly The  value  us e for  run ning  th res hold  is  150.   If   t he  ave rag velocit exceed s   this  thr esh old   the the   trajecto ry  is  con si der e a bnorm al If   the  thr esh ol is n ot ex cee de the t he  tra j e ct or y i s c onsid ered n or m al .   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       Auton omo us   abnor ma be hav iou r  d et ect io n usin tr aject ory  ana ly sis  ( M uham med Sh uaau )   2409   S t a r t a b n o r m a l   =   f a l s e     I s   n u m b e r   o f   c e n t r o i d   p o i n t s   i n   o b j e c t s   t r a j e c t o r y   h i s t o r y   >   F r a m e s T o F i n d V ? V e l o c i t y   =   0 n   =   i n d e x   o f   o b j e c t s   l a s t   c e n t r o i d i   =   n Y E S S t o p N O I s   i   >   ( n - F r a m e s T o F i n d V )   ? d i s t a n c e   = E u c l i d e a n   d i s t a n c e   b e t w e e n   c e n t r o i d   i   a n d   ( i   - 1 ) V e l o c i t y   =   V e l o c i t y   +   ( d i s t a n c e   /   ( 1 / f r a m e   r a t e )   ) Y E S i   =   i   - 1 V e l o c i t y   =   V e l o c i t y   /   F r a m e s T o F i n d V N O I s   V e l o c i t y   >   r u n n i n g   t h r e s h o l d ? N O a b n o r m a l   =   t r u e     Y E S     Figure   6 Al gorithm  to  detect  w he a  p e rs on  is run ning           Fig ure   7 Ce ntr oid   points  on a   traject or y       6.   ALGO RITH TO  D ET E CT LOITE R I NG   Figure  8   s how the  loit erin detect ion   al go r it h m The  m eth od  us ed  is  a dopte f ro m   [9] The  tw pr e def i ned  c on sta nts u se in t he  be ginnin g o the alg or it hm  are  m ini m u m   age of  the trac be f or e it s trajec tory   can  be  a naly sed  f or   loit eri ng   and   t he  m axi mu m   age  of   the  track  exce edi ng  w hich  will   cause  the  trac to  be  detect ed  as   loit erin g.   In  the  i m ple m entat ion   the  m ini m u m   age  was  set   t be  the   age   w hi ch  c orres ponds   to  30   seco nd of   co nt inu ous  m otion.  The  m axi m u m   age  was  set   to  be  the  age  equ al   to  60  se conds  to  co nti nuous  m ot ion T hese   con sta nts  can   be  set   based   on   the  l ocati on  w her loit eri ng   is  to  be  det ect ed.   Since  th A sia   P aci fic  U ni versi ty ’s   receptio area  is  very   s m all  place,  60   sec onds   of   con ti nu ous  m o ti on   can  be   flagg e as   loit ering b eca use  it  is not n or m al  to  kee m ov i ng conti nuously   in s uc s m al l place     The  trac k’ a ge   is  first  com par e to  the  m ini m u m   track  age  c onsta nt   and   if  it   is  m or than  the   m ini m u m   track  age  co ns ta nt   bu le ss  than  the  m axi m u m   track  ag con sta nt,  the traject or anal ysi i s   perform ed  to  s ee  if  the  perso is  loit eri ng.  If   t he  ab ove  c onditi on  fail t hen  the  trac k’s   age  is  c om par ed  to   m axi m u m  track  a ge  c onsta nt  and if it  e xceeds t he  c onsta nt, t he  tra j ect ory  is co ns ide re lo it ering .     Figure   9   s how the  traject or y   analy sis  m et ho us e d   ad opte f ro m   [9 ] .   po i nt  w hich  is  ou tsi de  the   trajecto ry  is  ta ken  ( point  O)  a nd  A   is  t he  init ia po i nt  w hile  D=  { D i   =   1, 2,   …  m is  c ollec ti on   of  m   po i nts   with a tim e int erv al   wh ic is  a co ns ta nt call ed  a ng le F ram eIn te val” ( se cond  i this  res earch ).   θ i   is t he  angle   betwee the   ve ct or       an t he   ve ct or     i T he  a ngle   ca be   cal c ulate in   l oop  a sta te i [ 9]  by  us in th e   fo ll owin g form ula.     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.  9 , N o.   4 A ugust   201 9     24 03   -   2415   2410   θ i = a rg cos < OA   , OD   i >   (3)     cos θ i =   OA     . OD   i | OA   |   | OD   i |   (4)       S t a r t a b n o r m a l   =   f a l s e   V a r i a n c e   =   0   I s   t r a c k s   a g e   >   m i n T r a c k A g e   A N D   t r a c k s   a g e   <   m a x T r a c k A g e ? a n g l e F r a m e I n t e r v a l   = n u m b e r   o f   f r a m e s   b e t w e e n   a n g l e   c a l c u l a t i o n s r e f P o i n t   =   a n y   p o i n t   o u t s i d e   t r a j e c t o r y n   =   i n d e x   o f   o b j e c t s   l a s t   c e n t r o i d i   =   1 Y E S S t o p I s   i   < =   ( n - a n g l e F r a m e I n t e r v a l )   ? t h e t a   = a n g l e   b e t w e e n   v e c t o r   o f   c e n t r o i d   i   f r o m   r e f P o i n t   a n d   v e c t o r   o f   i n i t i a l   c e n t r o i d   a n d   r e f P o i n t A d d   t h e t a   t o   e n d   o f   a n g l e A r r a y Y E S i   =   i   +   a n g l e F r a m e I n t e r v a l d e l t a A n g l e s   =   d i f f e r e n c e   b e t w e e n   a d j a c e n t   a n g l e s   o f   A n g l e A r r a y V a r i a n c e   =   v a r i a n c e   o f   d e l t a A n g l e s N O I s   t r a c k s   a g e   > =   m a x T r a c k A g e   O R   V a r i a n c e   >   t h r e s h o l d ? N O N O a b n o r m a l   =   t r u e   Y E S     Fig ure   8 Al gorithm  to  detect  loit ering           Figure   9 Loite rin tra j ect ory   analy sis m et ho d [9 ]   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       Auton omo us   abnor ma be hav iou r  d et ect io n usin tr aject ory  ana ly sis  ( M uham med Sh uaau )   2411   Wh e the  tra j e ct or is  loit ering   the  a ngle   θ cha ng e pe rio dical ly Ther ef or e the  dif fer e nce  bet wee the adjace nt a ngle wer e cal c ulate d nex t  as s ta te in  [9 ] .     Δθ i =   θ ( i + 1 )   θ i   (5)     The  tra j ect or was  t hen cla ssifie as  loit erin g base d on the  fo ll owin c ondi ti on     [ t rac k s   a ge > ma x imu m   tr ack   age ]   or   [ Va r ( Δθ i ) >   ξ ]   (6)     If  the trac k’ s a ge  is  m or e than  the m axi m u m  track  age constant ( 60  sec onds  in  this re se arch then  the   track  was  c ons idere loit erin g. Als o,  if  the  va riance  of the  diff e re nce bet ween ad j ace nt  ang le we re more  t han  set   thres hold ,   then  t he  trac was  c on si der e loit erin g.  Th thres hold  ca be  determ ined  experim ental l an the v al ue use d i the  resea rch   was 35.       7.   ALGO RITH TO  D ET E CT SQU ATTI NG DO WN   Figure  10   sho ws  the  al gorith m   us ed  to  detect   if  trajecto r is  sq uatti ng   dow n.   P red e fine co ns ta nt  is  the  nu m ber   of   po i nts  from   the  trajecto ry  hi story  to  be  use in  the  detect i on   of   s quat ti ng  down.  n’   po i nts  of  centr oid a nd  BLOB  areas  from   the  track  ar extracte a nd   then  th ey   are  us e to  determ ine  if  the  tra j ec tory  is  sq u at ti ng   do w n.   T he  co nd it ion   for  squat   dow is  if  the  BLOB  areas  a re  sorte in  de scen ding  orde r   wh ic m eans  they   a r dec reasin a nd  co ordi nates  of  the   ce ntr oid s   are  sorte in  asce ndin order  beca us e   wh e so m eon squat down   they   ar m ov ing   dow nw a r d.   Als o,   s ta nd a rd   dev ia ti on   of   c oor din at es  shou l be   le ss   than  a e xperi m ental ly   determ ined  co ns ta nt   an sta nda rd   de viati on   of   coor din at es  sh oul be   m or than  an  e xperim ent al ly   de te rm ined  c onsta nt  B.   The  reas on  f or  ab ov e   c onditi on s   are   that  w hen  s om eon sq ua t dow n,   ho rizo nt al   m otion   (x   coor din at m ov em ents)  will   be  ve ry  li tt le   and   ver ti cal   m otion   (y  co ord inate   m ot ion )   will   be   m or e.  I t he  conditi ons  a re  true  t hen  the   t raj ect or is   cl assifi ed  a s qua tt ing   dow a nd  t he  m et ho d   retu r ns t raj ect or y as  a bnorm al .       S t a r t a b n o r m a l   =   f a l s e     I s   b l o b A r e a s   s o r t e d   d e s c e n d i n g   A N D   y C o o r d s   s o r t e d   a s c e n d i n g A N D D e v i a t i o n   o f   x C o o r d s   <   A A N D D e v i a t i o n   o f   y C o o r d s   >   B ? b l o b A r e a s   =   l a s t   n   b l o b   a r e a s   o f   t r a c k x C o o r d s   =   l a s t   n   x C o o r d s   o f   c e n t r o i d s y C o o r d s   =   l a s t   n   y C o o r d s   o f   c e n t r o i d s S t o p a b n o r m a l   =   t r u e     N O Y E S     Figure  10.   Algorithm  to  detec t sq uatti ng   do wn             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.  9 , N o.   4 A ugust   201 9     24 03   -   2415   2412   8.   RESU LT S   A ND AN ALYSIS     The  pro po se al gorithm wer i m ple m ented  us in M ATL AB  an te ste on  on  a I ntel  Core  i 7 - 6700   m achine  with  3.40   GHz  CP U   an 1 6GB  RAM The  M ATL AB  pro gra m   was  able  to  proce ss  each   fr am in  35 m s w it t he l ongest e xecu ti on p at h.     8 . 1.     Ex peri ment al setup   The  pro po se al gorithm were  te ste on  vide os   ca ptured   by   su r veill anc cam era  at   Asia  Paci fic   Un i ver sit y’s  r ecepti on   area.   The  vid e os   wer ta ken   a ft er  sim ul at ing   diff e re nt  scena rios  s uc as  e nterin receptio a rea,   loit erin g,  r unning  a nd  s qua tt ing   dow n.   Vi deos  wer e   ta ke us in sin gle  pe rs on  sce ne an m ul ti ple p eo pl e scenes . F i gur e   11   s hows   exa m ples o vi deo i m ages u se a fter  run ning th e algori thm s.              F igure  11.   Vide im ages u se d i te sti ng       Evaluation Warning : The document was created with Spire.PDF for Python.