Indonesian J ournal of Ele c trical Engin eering and  Computer Sci e nce   Vol. 1, No. 3,  March 20 16, pp. 635 ~ 6 4 6   DOI: 10.115 9 1 /ijeecs.v1.i3.pp63 5-6 4 6        635     Re cei v ed O c t ober 3 0 , 201 5; Revi se d Ja nuar y 29, 20 1 6 ; Acce pted  February 9, 2 016   Real-Time Automatic Obstacle Detection and Alert  System for Driver Assistance on Indian Roads      Sachin Shar ma 1 , Dharme sh Shah 2   Electron ics & Commun i cati o n  Dep a rtment, Gu jarat T e chnolo g ica l  Univ er sit y , Ahme dab ad   India   e-mail: sh arma .f@gmail.com, djsh ah9 9@ gmail.com       A b st r a ct   Roa d  cras hes  hav bee a  maj o r pr obl e m   in  Indi a in recent  ti mes. T he  occ u rrenc es  h a v e   incre a sed  cons ider ably  ow ing   to the  influx  of f our-w hee lers  a nd tw o-w heel er s on In di an r o a d s. T he  nu mb e r   of road traffic collis io ns has  also i n creas ed  due to  the a b senc e of aut omatic hi ghw a y  safety and a l er t   systems o n   major ro ads c o n nectin g  cities  and tow n s. Th e interi or ro ad s conn ecting v illa ges  and to w n s   have b e e n  inst rumenta l  in  mu ltiple  ani mal-ve hicle c o ll isio ns. Althoug h the fi gure is n o t too larg e co mpar e d   to other caus e s  of road-rel a te d inj u ries, they  are sign ifica n t in nu mb er. T he associ ated n u mber of fatalit ie s   and  inj u ri es ar e substa ntia l too.   T hou gh  nu mer ous  efforts have  be en i n  p r ogress to s o lv e an d re duce  t h e   nu mb er of c o ll isions,  lack  of  practica l a ppl ic ations  an d r e s ources  al on w i th qua lity a n a lytical  d a ta (f or  traini ng  and  testing) r e l a ted  to an i m al-v e h icle  co l lisi on has  i m pe ded  any ma jor bre a kthrou gh in  t h e   scenar io.  I o u r curre nt w o rk, w e  have  pr opos ed  an d d e sig ned  a syst em bas ed  on   histogr a m  res e arch   inclu d i ng ori ent ed gra d ie nts a nd bo osted ca scade cl assi fie r s for automati c  cow  detection. T he India n  cow   has b e e n  the   big gest o b stacl e  co mp are d  to  other  ani mals  on In dia n  ro a d s. T he d i stan ce betw e e n  a   cow   and the ve hicl e  is calculate d  p r omptin g an al ert signa l to  no tify the driver for app lyin g bra k es or und erta ke  any si mil a r act i on. T he  meth od is i m p l e m e n ted in Op enc v softw are and tested on v a rio u s vide o cl ip s   involv in g cow   mov e me nts in  vario u s scen a ri os. The pr opos ed syste m   has  achi eved  an  ov erall  efficie n cy  of   80%  in ter m s  of cow detection. The  propos ed system   is a low-cost, highl y r e liable system   which can easily   be i m ple m ente d  in  auto m ob ile s for detecti on  of cow  or a n y o t her an i m al  after pro per tra i ni ng a nd t e sting   o n   the hig h w a y.     Ke y w ords : A n i m al  detecti o n  syste m ; Ca scade c l assifi er; His togr a m  of orie nted   grad ient; Intel l i ge nt  hig h w a y safety; Road acci de n t s       1. Introduc tion  Today’s auto m obile  de sig n  p r imarily  d epen ds  on  safety mea s ures,  se cu rity tools an d   comfo r t mech anism. Th e a ppro a ch ha s facilitated  the  developm ent of several int e lligent vehicl es  that rely on mode rn tools and techn o lo gy for t heir perform an ce. The safety of an automobil e  is  of the hi ghe st  pri o rity a c cording to  a  re ce nt re port  [1]. The rep o rt co mmission ed by  Wo rld   Hea l th  Orga nization  in its  Global   Status stu d on  Road  Saf e ty 2013,  rev ealed th at th e main  cau s e  o f   death fo r yo u ng p eopl (15 - 29  ag e) glob ally is due  to  road  traffic  co llision s . Even   though  vario u cou n trie s h a ve initiated  an d taken  step s to redu ce  ro ad traffic  colli sion and  a c cide nts, the  total   numbe r of co llision s  and traffic accident s remai n   as  high as 1.2 4  million per ye ar [2]. By 2020,  the road  traffi c fatalitie are p r oje c ted  to in crea se  by aroun d 6 5 % glob ally [3].  In  a co untry li ke   India, 1 in  20, 000  peopl e di e an d 12  in  7 0 ,000  peopl su stain  se rio u s i n juri es ev ery yea r  du to   road a c cide nts [4].    India h a s the  se con d  la rge s t road  net wo rk in th worl d an d i s  al so   kno w n  for the  high est   numbe r of ro ad accide nts  and fatalities  in the wo rl d [5]. Data publi s he d by the Nation al Cri m e   Re cords Bureau  (NCRB),  Minist ry of  Home  Affair s, Governmen t  of India,  shows th at ro ad   accide nt fatalities have b e en ste adily ri sing e a ch  ye ar an d in ye ar 20 08, there we re 1 18,2 3 9   fatalities d u e  to road  a cci dents [6]. A  signifi cant  po rtion  of the s e   ro ad  crashe a nd  accid e n ts  involve cars a nd two-wh eel ers.   The ro ad a c cidents a r e in cre a si ng du e  to increa se i n  numbe r of vehicle s  on t he roa d   day by day a nd al so the  d ue to the a b sence of  any i n telligent hig h way  safety and al ert sy stem.  Acco rdi ng to  data given in  a study [7], the num ber  of people  wh o l o st their live s  in India du to   road a c cide nts wa s alm o st  0.11 million death s  in 200 6, which wa almost 10%  of the total road   accide nt dea ths in the world. Accordi ng to  the accide nt research  study co ndu cted by JP  Evaluation Warning : The document was created with Spire.PDF for Python.
                             ISSN: 25 02-4 752                   IJEECS  Vol.  1, No. 3, March 20 16 :  635 – 646   636 Re sea r ch In dia Pvt. Ltd. for the Ah medab ad -G a ndhin aga r re gion (citie of India), for the  duratio n Feb r uary 20 14 to  Jan uary 2 0 1 5 , total 206 road traffic  accide nts  were  recorded a n d   these  we re  in fluenced by t h ree  main  factors i.e.  huma n , vehicle, i n frast r u c ture  o r  a combi natio of them [8].           Figure 1. Influences o n  roa d  traffic accid ents      The nu mbe r   in the figure  1 is p e rcenta ge of  the tot a l numb e of  accide nts su rveyed.  Acco rdi ng to  the re co rd, h u man fa ctor i n fluen ce  o n  road traffic a c cide nts wa s 92%,  vehicle  9%  and i n fra s tru c ture 4 5 %. Ou t of total 45%  (91  a cci dent s) infra s tru c tu re influ e n c ed   road  a cci dent s,  6% (1 2 a c cid ents) were d ue to  animal s  o n  the  ro a d  wherea s o u t of total 9 2 %  (17 1 hum an  factor influe n c ed road a c cidents, 14% (24) were  d u e  to driver inattention and a b se nce of any  timely alert  system for preventing  the collision.  Similar types of   surveys were co nducted for the  Mumbai -Pun e expre s swa y  and Coimb a tore by JP  Re sea r ch Ind i a Pvt. Ltd. and the co ncl u sion hinted at  a si gnifica nt  pe rcentage  of  roa d  a cci dent resultin g d ue  to an  obje c (animal )  o n  th road, d r iver in attention and  absen ce of a n  intelligent hi ghway safety alert sy stem     2. Literature  Sur v e y   Applicatio ns  based o n  ani mal dete c tion  have an  im p o rtant role in  providin g sol u tions to   many real-life  problem s. S o me of  the s appli c atio n s   a r detect  an d  tra c k anim a l s  li ke  elep ha nts   in forest s for und erstandi ng thei beh avior  with  th e environm e n t, preve n tin g  anim a l ve hicle   colli sion  on road s, and fo r preventin g the entry of   d ange rou s  a n i m als in  a residential a r ea  [9].  The ba se for most of the appli c ation s  i s  the det e c ti on of animal s  in the vide o or imag e. Many  appli c ation s  require hum an  intervention.   A rece nt stu d y [10] rece n t ly also reve al ed that hu man bein g need to take  the final  deci s io n duri ng driving  wh ether they ca n cont rol  thei r ca r to prevent colli sion  with a re sp o n se   time of 150m s. The proble m  with this m e thod is  that  human eye s   get tired ea sil y  and need  some   rest  co nsi s te ntly which is  why this  met hod i s  not  th at effective. Re sea r che r in [11] reve aled a   techni que fo r the identifica t ion of sala m ande rs  by  do rsal  skin p a ttern s. Thi s  techni que  reve als  key point s al ong the skel eton of the a n imal to  be l abelle d physi cally (m a nual ly) by the user.  Similar  user i nput [12]  is required  for th e dete c ti on  a nd id entificati on of  ele pha nts from th ear  profile.   Some scientif ic re se arche r s [13] have  categor i z e d  an imals u s in g a n  arrang eme n t with a  still ca mera  mounted  at o ne si de of  a strip (corrido r).  This  arra ng ement ma ke s the dete c tion  of  animal s  pa ssing the st rip  (co rri do r) trivi a l. Some  me thods [14] n eed the a n i m als to  strike a   particula r a n g l e o r  a  po se  t o wa rd s th camera fo r the  trigg e r, in clu d ing fa ce  det ection. A  po p u lar  clue for the  detectio n  of animal s  is m o tion. T he fundame n tal h y pothesi s  he re [15] is that th e   default po sition is  station a ry and  ca n  simply  be  subtracte d . All blobs  wh ich remain  a fter  backg rou n d  subtra ction  are  co nsi d e r ed  a s   regi on  of  int e re st (ca ndid a te)  dete c tion s. Th oug h thi s   Evaluation Warning : The document was created with Spire.PDF for Python.
IJEECS   ISSN:  2502-4 752     Real -Tim e Autom a tic Obst acle  Dete ctio n and Alert  System  for Dri v er A ssi stan ce … (Sachin  S.)  637 works fine in  rest ricted  areas, e.g., for unde rwat er  videos, such  mech ani sm d oes n o t hold  in   gene ral settings.   Re sea r che r s [16] used thre shol d se g m entation a ppro a ch for  getting the targete d   animal’ s deta ils from b a ckgrou nd. Recent re sea r ch es  [17] al so  reveale d  that  it is difficult to   deci de the th reshold valu e  as the ba ckgrou nd  chan ges often. A  method a ppli c abl e to moving   backg rou n d s  (e.g., due to came ra motio n ) is p r e s ente d  in sub s e q u ent studie s  [1 8] and [19]. The   tracking lig ht (sp a rse )  feature s  point s over  time and applie s RA NSAC to separate backg rou nd &  foreg r ou nd  motion. The  backg rou nd  motion is ta ken as the m a in (do m ina n t ) motion in  th e   scene. T he  rest of th e mo tion is taken  as  singl e  o b ject  whi c can b e  the  ani mal/ ob stacl e  of  intere st. The probl em with  this metho d  is that  other  moving obje c ts woul d dist urb the a ppro a ch   and may be falsely dete c te d as anim a ls.   Re sea r che r s in [20] trie d to di scove r  an  anim a l’ s p r e s en ce i n  the  scene  (imag e affecting the  powe r  spe c trum of the  image. This method of  animal detection was  also   con s id ere d  n o t app rop r iat e  si nce q u icker  re sults  wit h  this metho d  wo uld i n volve gig antic am ount  of image p r o c e ssi ng in a  sho r t peri od  of time  [21].  Some re se arche r s [2 2] propo sed a m e thod  for anim a l sp ecie s d e tecti on an d ma de  simila r rest riction s  rega rdi ng the fo reg r ound  obje c ts in  the video.  Th e d r awba ck o f  this p r o p o s e d  meth od  wa s that it  was  highly  spe c ifi c  to th sp eci f ic   setting  and  n o t valid in  the  co ntext of th e India n   roa d s   whe r e  seve ral  animal s   m a y be  present  a t   the s a me time.   Re sea r che r in [23] al so u s ed th e fa ce  detecto r te ch nique i n itiate d by Viola a n d  Jo ne for a  spe c ific  animal type.  Once an  ani mal face  is   d e tected  and i dentified, the  resea r chers t r y to   track it  over time. The  p r o b lem  with thi s  te chni que  i s  that  face d e tection  ne ed s the  a n imal s to  look i n to the  cam e ra  whi c h i s , in g e n e ral, n o t ne cessarily  capt ured  by the  road travel video.  Animals  can  arrive fro m  a scene fro m  variou s di re ctions a nd in va riou s si ze s, pose s  an d col o rs.   An intere sting approa ch for the animal  detection  an d tracking u s es a texture  descri p tor ba se d   on SIFT that tries to mat c h it against a  pred efi ned li bra r y of anim a l textures [2 4]. The probl em  with thi s  m e thod i s  th at it  is  re stri cted  to video s h a ving  singl animal  only  and ve ry min i mal  backg rou nd clutter.  Both condition s are not met  espe cially with ani mals p r e s ent  on roa d  sid e s.  In Saudi Ara b ia, the num ber of collisi ons b e twe e n  the camel  and a vehi cl e we re  estimated to  rea c h mo re t han a h und re d each year.  To preve n t these  colli sion s, an intelligen Camel  Vehi cle Accide nt  Avoidance S y stem (CVA AS) was de sign ed  usi n g  GPS (glob a pos itioning sys tem) [25].  For find ing  th e corre c t p o sition of fi she s  in th sea,  rese arche r s [ 26]  desi gne d a tech niqu e usi ng LIDAR (li ght detec tion  and rangi ng ). Usin g the micro - Doppl er  techni que [27 ], resea r chers also tried av oiding ri sky animal intru s io ns in the ho u s ing a r ea.    Lack of re so urces  and q u a lity database of image (for trainin g  a nd testing )  of  animal s   on the road i s  still o ne of t he challen g in g tasks.  D ue  to this fact a nd a s  pe r ou r latest survey s,  very less  wo rk ha s bee n re ported  so far i n  this are a  at least in conte x t to  Indian hi ghways. In this   pape r, we  prese n t a nove l  approa ch fo r the dete c tio n  of animal s   (co w ) on Indi an ro ad s and  a  method fo calcul ating the  dista n ce of  detecte a n imal from  the  came ra  mou n ted vehi cle  (after  detectio n ) wh ich can hel p the drive r  to av oid the colli sion vehicl e-a n imal colli sio n Intelligent hig h way safety and d r iver a s sista n ce sy stems a r e ve ry helpful to re duce the   numbe r of a c cide nts that a r e ha ppe ning  due to vehi cl e-ani mal colli sion s. With  resp ect to Indi an   road s, two types of anim a ls – the co w and t he dog  are foun d more often tha n  others on the  road s. Spe c ific obje c tives o f  the rese arch  work are:     To develop  a n  automatic a n imal dete c ti on syste m  in context to Indian roa d s.      Finding the a pproxim ate di stan ce of ani mal fr om the  vehicle in  whi c h came ra is  mounted.     To develop a n  alert sy ste m  once th e a n imal gets d e t ected on the  road which will help the   driver in  appl ying b r akes  or ta kin g  oth e ne ce ssa ry  actio n  fo r a v oiding  colli si on b e twe e n   vehicle a nd a n imal.      3. Brief Ov erv i e w   and Ad v a ntages of  HOG a nd Ca scade  Classi fier   A histogram  of oriente d  gradient s (HO G ) is a c tually  a feature de scripto r  used  to detect  obje c ts in  co mputer visi on  and imag e p r ocessin g  [28 ]. The HOG  descri p tor te chniqu e re cou n ts  occurre n ces  of gradi ent o r ientation i n  locali ze d po rtions  of an im age -  dete c tion win d o w , or  region of interes t  (ROI). Fi g u re 2 sho w s t he algo rithmi c implem enta t ion scheme  of HOG.   Evaluation Warning : The document was created with Spire.PDF for Python.
                             ISSN: 25 02-4 752                   IJEECS  Vol.  1, No. 3, March 20 16 :  635 – 646   638     Figure 2. Algorithmi c  impl ementation  schem e of hog       The  HO G de scripto r  i s  p a rticularly  app ropria te  for an imal dete c tio n  or hu man  d e tection   in video o r  im age s du e to some  key adv antage com pare d  to othe r de scripto r s.  First, it ope rat e on lo cal  cell s so it i s  i n variant to ge om etric  and  ph o t ometric tran sform a tion s.  Secon d ly coa r se  (sp a tial)  sam p ling, fine ori entation sam p ling an d strong lo cal ph otometri c no rmalizatio n all o individual  bo dy moveme nt of anim a ls/p ede strian to  be  overlo oked if they m a intain a  ro ug hly  uprig ht positi on [29].   Ca scadin g   is a  pa rticul ar case   of  gro up l earni ng  ba se on   the con c aten ation of several   cla ssifie r s, u s ing all info rm ation collecte d  from t he  o u tput from a  given cl assifier a s  ad ditio nal  information for the next  c l as s i fier in the  c a s c ade  [30]. The  key adv antage of b ooste ca sca de  cla ssifie r s over mo nolithi c cla ssifie r s are that it  is a  fast lea r ne r a nd requi re s l o com putation   time. Ca scad ing al so elim inates  ca ndid a tes  (false  po s i tive s)  e a r l y o n ,  s o  la ter  s t ag es  d on’t   bother a bout  them.          Figure 3. Boosted casca d e  classifier      As sh own in the figure 3, e a ch filter  reje cts n on-obje c t windo ws  an d let obje c t windo ws  past to  the n e xt layer of t he  ca scade.  A wind ow  is  con s id ere d  a s  a n  obj ect if  and  only of  all   layers of the  ca scade  cla s sifies it as o b j e ct  [31]. The filter i of the cascad e is de signed to     Reje ct the large po ssi ble n u mbe r  of non -obje c t win d o w   To allow la rg e possibl e nu mber of obj ect windo ws for  quick evalu a tion       Evaluation Warning : The document was created with Spire.PDF for Python.
IJEECS   ISSN:  2502-4 752     Real -Tim e Autom a tic Obst acle  Dete ctio n and Alert  System  for Dri v er A ssi stan ce … (Sachin  S.)  639 4. Rese arch  Metho dolog As sho w n a b o ve in Fig u re  4, a video i s  taken f r om  a  forward - fa cin g  ca mera in  whi c h a  moving anim a l is pre s ent  apart from ot her stat io nary and non-stationary obj e c ts. This vide o is  store d  in th comp uter  and  conve r ted i n to diffe re nt  fra m es. We are  usin a com b ination  of HO and  b o o s ted ca scade cla s sifiers  for ani mal  dete c ti on . All the imag e pro c e s sing  techni que s a r e   impleme n ted  in Op en  CV  software.  On ce the  anim a l gets dete c ted   in  th vide o, the  next step  is  to find the  distance  of the  a n imal fro m  th e testin g vehi cle  and th en  alert the  drive r  so that  he  can  apply the  bra k e s  o r  p e rfo r m any oth e necessa ry  a c tion which i s   displ a yed o n   comm and  pro m p t   as a me ssag e.          Figure 4. Block di agram of  the propo se d  method       Followi ng is  the pro posed  pro c edu re f o r traini ng a nd testing of  the data for animal  detectio n     Colle ct all po sitive and ne gative image s in the data folder   Gene rate  An notation     Cre a te sa mpl e  i.e. generat e .vec file (figure 5 )     Train d a ta i.e. generating xml file (figure  6, 7)   Testing  (figure  8)  Evaluation Warning : The document was created with Spire.PDF for Python.
                             ISSN: 25 02-4 752                   IJEECS  Vol.  1, No. 3, March 20 16 :  635 – 646   640     Figure 5. Cre a te sampl e           Figure 6. Trai n data   Evaluation Warning : The document was created with Spire.PDF for Python.
IJEECS   ISSN:  2502-4 752     Real -Tim e Autom a tic Obst acle  Dete ctio n and Alert  System  for Dri v er A ssi stan ce … (Sachin  S.)  641     Figure 7. XML file        Figure 8. Testing              Evaluation Warning : The document was created with Spire.PDF for Python.
                             ISSN: 25 02-4 752                   IJEECS  Vol.  1, No. 3, March 20 16 :  635 – 646   642     Figure 9. Dist ance cal c ul ation     As sho w n in the figure 9, video is taken  and co nverte d into frames (image of si ze 640 *  480). Follo wi ng is the pro c ed ure for  ca lculatin g t he distan ce of the detecte d  animal from t he  came ra -mo u n ted vehicl e:    Image re sol u tion is 64 0 × 4 8 0     X range i s  0 to 640     Y range i s  0 to 480     Let the right b o ttom coo r din a te of the detected  co w be  (x, y)     Then the di stance of co w from the lo wer edge (ca r /ca m era )  is 48 0 – y       5. Data  Anal y s is and Interpretation   W e   a r e us in g H O G  de scr ip to r s  wh ich  ar e  fe a t u r e   de scripto r an d are used  i n  compute r   vision an d image processi ng for the  pu rpose of obje c t detection. F o r obje c t cla s sificatio n , we  are   usin g boo ste d  ca scade cl assifiers. For prepa ring  th e requi r ed d a taba se, we  are pe rformi ng  animal detect ion in relation to the Indian  scenario  as no research has been  performed till date i n   this are a , an d not many sou r ces a r pre s ent relat ed to this scenari o . A good so urce fo r th e   animal im age s is the KT dataset  [32] and NEC dat aset  [33]  th at  inclu ded i m a ges  of cows  and  dog s (of our interest ). Some more a n i m al image s  have been  cl icked for cre a ting a healt h databa se of  almost 9 00 i m age s con s i s ting of po si t i ve image s  i n  whi c h the  target ani mal  is   pre s ent a nd  negative ima ges i n  which  there i s  n o  target  animal  for feature e x traction  and  for  training the  cl assifier.   After the cla s sifier i s  train e d  and the d e t ecti on sy ste m  is built, we  tested the  same on   variou s vide o s . We te sted  our meth od  on at l e a s t 2 8  to 3 0  vide os  (fra me s of  si ze  640* 48 0),  inclu d ing  80  animal s  (co w ) in th e video . A detectio n   rate of  almo st 80% was  achieved  with l o false  dete c tio n  rate in  case of  singl e o b ject  (c ow) i n  the f r ame   (testing  video ) . Training  a n d   testing on l a rge datasets  with diffe rent orientations  a nd different weather  co nditi ons will  improve   the detectio n  rate and ove r all  efficien cy of the system Some of the  scre en shot s of the  cam e ra -mou nted  vehicle  an d  re sults (with  different  climate condit i ons a nd with  different sp ee ds) a r sho w n in figure s  1 0 , 11, 12, 13, 14 and 1 5   Evaluation Warning : The document was created with Spire.PDF for Python.
IJEECS   ISSN:  2502-4 752     Real -Tim e Autom a tic Obst acle  Dete ctio n and Alert  System  for Dri v er A ssi stan ce … (Sachin  S.)  643     Figure 10. Ca mera mo unte d  vehicle           Figure 11. Animal detectio n  at 0 kmph  speed  wi th obj ect station a ry  in mornin g condition           Figure 12. Animal detecte d  at a speed of  40 kmph in a fternoon  con d i tion  Evaluation Warning : The document was created with Spire.PDF for Python.
                             ISSN: 25 02-4 752                   IJEECS  Vol.  1, No. 3, March 20 16 :  635 – 646   644     Figure 13. Animal detecte d  at a distance  of 228  pixels from the cam e ra mo unted  vehicle  with  the spe ed of 60 kmp h  in e v ening time           Figure 14. Multiple animal s  dete c ted in  one of the testing video           Figure 15. Multiple animal s  dete c ted in  the se con d  testing video   Evaluation Warning : The document was created with Spire.PDF for Python.