TELK OMNIKA Indonesian Journal of Electrical Engineering V ol. 12, No . 11, No v ember 2014, pp . 7778 7784 DOI: 10.11591/telk omnika.v12i11.6545 7778 W eighted Samples Based Bac kgr ound Modeling f or the T ask of Motion Detection in Video Sequences Boubekeur Mohamed Bac hir *1 , Benlefki T arek 2 , and Luo SenLin , Labidi Hocine 1 1 School of Inf or mation and Electronics , Beijing Institute of T echnology 1 Beijing, China 100081 2 School of Electronics and Inf or mation Engineer ing, Beihang Univ ersity Beijing, China 100191 *1 corresponding author , e-mail: msboubek eur@y ahoo .fr Abstract In this paper , a non par ametr ic method f or bac kg round subtr action and mo ving object detection based on adaptiv e threshold using successiv e squared diff erences and including fr ame diff erence process is proposed. the presented scheme f ocused on the case of adaptiv e threshold and dependent distance calculation using a w eighted estimation procedure . In contr ast with the e xisting update procedures (First- in First-out, r andom pic kup), W e proposed an intuitiv e update policy to the bac kg round model based on associated decreasing w eights . The presented algor ithm succeeds on e xtr acting the mo ving f oreg round with efficiency and o v er passes the prob lematic of ghost situations . The proposed fr ame w or k pro vides rob ustness to noise . Exper iments sho w competitiv e results compared to e xisting approaches and demonstr ate the applicability of the proposed scheme in a v ar iety of video sur v eillance scenar ios . K e yw or ds: Bac kg round Subtr action, sur v eillance , w eighted samples . Cop yright c 2014 Institute of Ad v anced Engineering and Science . All rights reser v ed. 1. Intr oduction Most of static camer a based monitor ing systems f or secur ity pur poses rely on bac kg round modeling and subtr action process f or detecting and identifying mo ving f ore g round objects in the video scene , the main adv antage of bac kg round subtr action techniques is that no pr ior kno wledge on the nature of the target object to be detected is needed. The subtr action of inconsistent in- f or mation e xisting in the bac kg round implies the retr ie v al of interesting f oreg round objects . One ma y easily v er ify the spatial consistency betw een neighbor ing pix els resulting of a high correlation betw een the intensity v alues in a tight neighborhood. The tempor al inf or mation pro vided b y the succession of fr ames is also a cue to detect relativ ely g r adual or f ast change in the scene . By compar ing the intensity v alue of pix el at the same position in diff erence time lapses , a change if e xist should be detected. One w a y to do is to compute the distance betw een the current pix el v alue and the bac kg round model pix el(s) f ollo w ed b y a compar ison with a threshold. After clas- sification, an update of the bac kg round model is necessar y to ensure that the bac kg round model can lear n the changes in the video scene or to lear n the en vironment changes . In this paper w e consider that the estimation of the distance metr ic computed to tell where the current pix el v alue stands should include the w a y that the bac kg round model is updated. In this paper w e introduce a T empor al based approach f or bac kg round subtr action task, using a sample bac kg round mod- eling with adaptiv e threshold. In contr ast to some e xisting methods which consider a sampled bac kg round model, the considered set of samples is directly e xploited to deter mine the distance metr ics [1, 2], w e do not assume that the bac kg round samples are equally distr ib uted, in f act the proposed approach used associated w eights to estimate the distance betw een the bac kg round model and the streaming fr ames . In addition, the update procedure in our approach neither does replace the sample o f the first fr ame or the last fr ame [1], nor choose a r andom location to update [2]. The proposed method applied a w eight re lated update to all the samples in the bac kg round model. Receiv ed A ugust 7, 2014; Re vised September 14, 2014; Accepted October 2, 2014 Evaluation Warning : The document was created with Spire.PDF for Python.
TELK OMNIKA ISSN: 2302-4046 7779 This paper is organiz ed as f ollo ws; in section II, a shor t re vie w of bac kg round subtr action (BS) algor ithms dealing with diff erent video sur v eillance challenges has been presented. Section III in- troduces the proposed fr ame w or k which consists of (i) a tr aining phase f or b uilding the bac kg round model, (ii) a distance metr ic estimation and a v ar iab le threshold ba sed decision f or classifying and separ ating bac kg round and f oreg round pix els , and (iii) the proposed updating str ategy adopted in the fr ame w or k. Exper imental results of the proposed scheme and a discussion of the issues relat- ed to noise and ghost cancellation are presented in section IV . The fifth section is de v oted to the perf or mance analysis of the proposed fr ame w or k and tab les a compar ison betw een the proposed algor ithm and some e xisting bac kg round subtr action approaches . 2. Related w ork In [1 ], the authors presented a non-par ametr ic k er nel density estimation (KDE) f or bac k- g round and f oreg round mod elling using a shor t ter m and a long ter m model based on the selection of N bac kg round model samples , KDE is an efficient solution to mo ving object e xtr action, ho w e v er it needs a consider ab le computational cost. The authors in [3], classified e xisting bac kg round sub- tr action methods into recursiv e and non-recursiv e approaches , and made a compar ison betw een simple basic methods and probabilistic modeling based approaches , their e xper iment s sho w ed that e v en basic method could produce good results , while the computatio nal cost k ept lo w . A f ast and rob ust algor ithm f or bac kg round subtr action w as proposed in [4], the authors presented a ne w hier archical motion detection algor ithm based on sigma-delta modulation. The y ha v e consid- ered a conditional approach b y inser ting controllers into the classification and the update process . In [2], a po w erful algor ithm f or bac kg round modeling and f oreg round e xtr action named the Visual Bac kg round Extr actor (ViBe) is proposed; the algor ithm adopts a sample based bac kg round mod- eling appro ach with a stochastic replacement and a spatial diffusion f or the update step . Using a constant threshold v alue f or bac kg round /f oreg round separ ation; ViBe o v ercomes most of bac k- g round subtr action challenges . It has been argued in [5] that impro v ed results ha v e been f ou nd b y using a threshold as the half of the standard de viation computed f or all the samples in the bac k- g round model o v er time . The authors in [ 6] used to w threshold v alues and a three successiv e fr ames f or mo ving object detection, the y affir med that such a consider ation is strongly adapted to the en vironment changes . In [7], the authors introduced an algor ithm f or mo ving v ehicle detection using a comb ination of semantic and bac kg round diff erences , the y used a limited threshold v alue to b uild the binar y images , e v en though the results w as quite impressiv e . The authors in [8] dr a w a compar ison betw een a set of bac kg round subtr action techniques using v ar ious distance com- putations , in addition the y ha v e introduced a square sum of diff erences betw een RGB entr ies and the bac kg round fr ame . In this paper , w e propose to use w eighted squared diff erences betw een entr y fr ames and the bac kg round model as a distance metr ic , as w ell as e xploiting the w eights on the update procedure . The f ollo wing par ag r aphs present the e xtents of the proposed approach, and detail the steps and the choices of the adopted par ameter ization. 3. PR OPOSED ALGORITHM: AD APTIVE THRESHOLD The presented algor ithm consists of three phases: tr aining and bac kg round modeling stage , f oreg round/bac kg round separ ation phase , and an update step . In the f ollo wing; w e detail these steps and justify the choices that w ere made . 3.1. Bac kgr ound Modeling A non par ametr ic bac kg round modeling str ategy is adopted in the fr ame w or k, the bac k- g round model is considered to be a set of K fr ames tak en dur ing the initialization. Let: B GM ( x; y ) = f b 1 ; b 2 ; : : : ; b K g (1) be th e collection of K bac kg round samples at location ( x; y ) , where b m ; m = 1 ; 2 ; : : : ; K are the samples collected at diff erent times at location ( x; y ) . Moreo v er , a w eight giv en b y equation (2) is w eighted samples f or bac kg round subtr action(Boubek eur) Evaluation Warning : The document was created with Spire.PDF for Python.
7780 ISSN: 2302-4046 associated with each bac kg round sample , W i = 1 = 2 i 1 P K m =1 1 2 m 1 (2) Where; i is the inde x of the sample in the bac kg round model, the v alues w i are in the r ange [0 ; 1] , the nor malization of the w eights came to ensure that regardless the n umber of samples chosen to b uild the BGM, the sum of the w eights remains equal to 1. If no f oreg round object is present dur ing the initialization step , the set of K pix els should represent a r ange of possib le v alues f or a bac kg round pix el. In such a case , the v ar iation in intensity v alue o v er time f or B GM ( x; y ) should not be significant at all, w e introduce then in equation (3) a measure S ( x; y ) defined as the mean square of successiv e diff erences betw een bac kg round model samples in the same location ( x; y ) . S ( x; y ) = 1 K 1 K X m =2 ( b m b m 1 ) 2 (3) W e are interested in the beha vior of the pix el belonging to the bac kg round model at location ( x; y ) , the metr ic S ( x; y ) tak es a v alues according to the deg ree of similar ity betw een bac kg round model samples . 3.2. Foregr ound/ Bac kgr ound separation In the algor ithm, a decision scheme based on a distance met r ic estimation and a v ar iab le threshold is used f or separ ating and classifying f oreg roun d and bac kg roun d pix els . The proposed f oreg round/ bac kg round separ ation scheme in v olv es tw o successiv e tests: First , f or e v er y ne w pix el; a w eighted distance d ( x; y ) metr ic is estimated using equation (4). d ( x; y ) = 1 K K X m =1 w m ( b m V t ( x; y )) (4) Where V t ( x; y ) denotes a current pix el v alue at location ( x; y ) and w m are the w eights v alues associated with bac kg round model samples defined in equation (2). No w giv en the v alue of the distance computed using equation (4), this calculated v alue is compared to the metr ic estimated b y equation (3), if the distance is g reater than S ( x; y ) ; the pix el is classified a pr ior i as a f ore- g round, otherwise is considered a bac kg round pix el. The f oreg round pix els are labeled 1 and the bac kg round pix els b y 0. Equation (5) sho ws the pr ior obtained binar y mask. M pr ioir ( x; y ) = f or eg r ound if d ( x; y ) > S ( x; y ) back g r ound if d ( x; y ) < S ( x; y ) (5) Second, b y analyzing the f oreg round mask p ro v i ded b y this first test, w e note the presence of ghost pix els in the binar y mask, especially when f oreg round objects are present in the scene dur- ing the initialization phase . T o deal with this challenge and in order to mak e the fr ame w or k more imm une to the prob lem of ghost; a second test based on the computation of the diff erence be- tw een successiv e fr ames and making use of the metr ic S ( x; y ) is added to the algor ithm. A pr ior i classified f oreg round pix el is finally v alidated as a f oreg round pix el in the case where only the dis- tance betw een successiv e fr ames is larger than the measure S ( x; y ) , otherwise the corresponding pix el is declared as a bac kg round pix el. Equation (6) sho ws the obtained labeled mask. M ( x; y ) = 8 < : 2 if M pr ior ( x; y ) = 1 and D if f ( x; y ) > S ( x; y ) 1 if M pr ior ( x; y ) = 1 and D if f ( x; y ) < S ( x; y ) 0 if M pr ior ( x; y ) = 0 (6) and D if f ( x; y ) = ( V t ( x; y ) V t 1 ( x; y )) : ( V t 1 ( x; y ) V 0 ( x; y )) (7) TELK OMNIKA V ol. 12, No . 11, No v ember 2014 : 7778 7784 Evaluation Warning : The document was created with Spire.PDF for Python.
TELK OMNIKA ISSN: 2302-4046 7781 Only pix els with M ( x; y ) = 2 are actually f oreg round p ix e ls , tw o types of bac kg round pix els to be distinguished: bac kg round pix els with M ( x; y ) = 0 and those where M ( x; y ) = 1 . In the equation (7), the v alue V 0 ( x; y ) represents the first fr ame , in f act in our fr ame w or k w e do not mak e an y supposition regarding the first fr ame , fur ther more if a ghost situation occurs , it w ould be eliminated b y the diff erence betw een fr ames in the equation (7). 3.3. Update phase When coming to upd ating the bac kg round model, the reader can distinguish betw een tw o str ategies: the b lind update policy and the conser v ativ e approach str ategy . In the b lind update pro- cedure , each bac kg round model pix el is updated without consider ing the output of the f oreg round/ bac kg round separ ation phase . The conser v ativ e approach str ategy depends on the result of the classification step in a w a y that only classified bac kg round pix els are allo w ed to update the bac k- g round model samples , as a consequence bac kg round samples in the locations corresponding to actually classified f oreg round pix els remain without change . In the fr ame w or k, the proposed updating str ategy is neither a b lind update approach nor a conser v ativ e one . A conditional w eight- ed conser v ativ e update str ategy is presented in this paper ; ear lier ; w e ha v e identified tw o types of classified bac kg round pix els in the proposed f oreg round/ bac kg round separ ation stage: pix els which are classified bac kg round f rom the first test, and other pix els that w ere first declared as a f oreg round and later set to bac kg round pix els using t he second test. F or the first type , the v alue of those pix els are included directly in the bac kg round model samples . Moreo v er f or t he second type and f or tho se pix els which their corresponding fr ame diff erence is less than the S v alue , bac kg round model updating f ollo ws a w eighted v alues as sho wn in equation (8) B GM ( x; y ) new = w m :B GM ( x; y ) ol d + (1 w m ) :V ( x; y ) if M ( x; y ) = 1 V ( x; y ) if M ( x; y ) = 0 (8) More e xplicitly , at each location and f or the first type of classified bac kg round pix els where M ( x; y ) = 0 ; all the corresponding bac kg round samples are replaced b y the current pix el v alue V ( x; y ) . F or the second type of bac kg round pix els where , M ( x; y ) = 1 , the updating process is achie v ed b y using a w eighted sum betw een e v er y bac kg round model sample and the current pix el v alue , this update can be understood as f ollo ws: t he first bac kg round sample k eeps w 1 of its o wn v alue and gets (1 w 1 ) from the current pix el v alue . The ne xt bac kg round pix el k eeps only w m and gets the (1 w m ) left from the current pix el v alue V ( x; y ) . The increasing percentage of the current fr ame v alue in the update of other la y ers e xplains that fur ther la y er updated more impact obtained b y the bac kg round model samples from the current fr ame . Fur ther more , the metr ic defined b y equation (3) should be updated to ensure that the threshold considered f or fur ther decision is up to date . The update process goes as mentioned on equation (9). S ( x; y ) = 8 < : x if M pr ior ( x; y ) = 1 1 K 1 P K m =2 ( b m b m 1 ) 2 if M ( x; y ) = 1 S ( x; y ) other w ise (9) Note that the threshold tak es the v alue of the current pix el v alue when the pix el is classified as f oreg round object. This v alue has been chosen to mak e sure that the update f or the w eighted f or m ula presented in equation (8) be eff ectiv e f or pix els satisfying M ( x; y ) = 1 , in the case where these pix els are classified in fur ther process as bac kg round pix els . 4. EXPERIMENT AL RESUL TS The proposed fr ame w or k w as first implemented o n MA TLAB and later on Visual Stu- dio C++ to test its real time perf or mance . Our e xper iments w ere conducted on an I7 CPU with 2.2 GHz, the Change Detection dataset introduced b y [ 9] and pub licly a v ailab le on www . changedetection.net has been used. This data set contains a v ar iety of video sequences includ- ing most of the challenges that usually f ace bac kg round subtr action algor ithms . A set of video w eighted samples f or bac kg round subtr action(Boubek eur) Evaluation Warning : The document was created with Spire.PDF for Python.
7782 ISSN: 2302-4046 sequences ha v e been chosen to test the perf or mance of the proposed approach, and to e xper- iment our algor ithm with v ar ious challenges presented in this dataset in its 2012 v ersion. The n umber of initials fr ames chosen to initializ e the bac kg round model is considered K = 10 in all our conducted e xper iments . Figure 1 sho ws the results of the proposed algor ithm using fr ames from the baseline categor y .Figure 2 illustr ates the results of the proposed algor ithm applied to the case of dynamic bac kg round presented as the Canoe sequence . In order to challenge our algor ithm with ghost situation, w e ha v e considered the highw a y sequence with the 860 th fr ame as the initial fr ame . Figure 3 sho ws the obtained results compared to the adaptiv e mixture of Gaussian intro- duced b y Zivk o vic in [10]. Exper iments sho w competitiv e results compared to e xisting approaches and demonstr ate the applicability of the proposed fr ame w or k in a v ar iety of video sur v eillance s- cenar ios . In the f ollo wing, w e will discuss the perf or mance of the proposed scheme , and mak e a compar ison with some e xisting methods and algor ithms dealing with bac kg round subtr action. Figure 1. Proposed method f or Baseline categor y: fr ames from the highw a y sequence . 5. EV ALU A TION AND DISCUSSION In most of the liter ature , the perf or mance of Bac kg round/F oreg round classification is es- timated b y consider ing a ref erence as g round tr uth, and computing se v er al metr ics .The authors in [9] presented se v en (07) metr ics to assess the efficiency of motion segmentation algor ithms , through the computation of TP , TN, FP , and FN that are respectiv ely tr ue positiv e count, tr ue neg- ativ e count, f alse positiv e count, and the f alse negativ e count. The se v en metr ic presented in [9] are the f ollo wing: R ecal l ( R E ) = T P T P + F N (10) S pecicity ( S P ) = T N T N + F P (11) F al s e P ositiv e R ate ( F P R ) = F P F P + T N (12) F al se N eg ativ e R ate ( F N R ) = F N T N + F P (13) P er centag e of W r ong C l assif ication ( P W C ) = 100 : F N + F P T P + F N + F P + T N (14) P r ecision ( P R ) = T P T P + F P (15) F measur e = 2 P r :R e P r + R e (16) In order to e v aluate the proposed scheme , w e ha v e compared the obtained results with those pub licly a v ailab le on the change detection w ebsite (T ab le 2). W e ha v e computed the se v en TELK OMNIKA V ol. 12, No . 11, No v ember 2014 : 7778 7784 Evaluation Warning : The document was created with Spire.PDF for Python.
TELK OMNIKA ISSN: 2302-4046 7783 T ab le 1. The perf or mance of the proposed algor ithm. Sequence RE SP FPR FNR PWC PR F-Measure Highw a y 0,9340 0,9918 0,0082 0,0660 1,1581 0,8783 0,9053 Office 0,8056 0,9989 0,0011 0,1944 1,4431 0,9821 0,8852 P edestr ian 0,8966 0,9977 0,0023 0,1034 0,3251 0,7977 0,8443 PETS 2006 0,8368 0,9966 0,0034 0,1632 0,5509 0,7625 0,7979 Canoe 0.8014 0.9957 0.0043 0.1986 0.0114 0.8778 0.8379 Ov er pass 0.7188 0.9969 0.0031 0.2812 0.0069 0.7584 0.7381 metr ics sta ted ear lier . The proposed fr ame w or k achie v ed a percentage of missed classification less than 1% f or the categor y of baseline , ho w e v er it sho ws some lac k of precision when tested with sequences including dynamic bac kg round. By analyzing the obtained results w e belie v e that the proposed fr ame w or k is v er y suitab le f or video based tr affic monitor ing systems . The proposed method has sho wn rob ustness against ghost situation due to the conditional instan- taneous update of the bac kg round model, and to the computation of the distance metr ic which in v olv ed decreasing w eights from the BGM. The tab le 1, sho ws the results obtained when applying the presented algor ithm on the categor y of baseline with the high sequences . The proposed algor ithm has some def ects when consider ing the other categor ies (camer a jitters , Dynamic bac kg round). 6. CONCLUSION AND FUR THER W ORK In this paper ; w e ha v e presented a fr ame w or k f or bac kg round subtr action using an adap- tiv e threshold presented as the mean square of successiv e diff erences f or the bac kg round model samples , and a w eighted distance computation f or estimating the distance betw een incoming fr ames and the bac kg round model. In contr ast with e xisting upd ate str ategies , w e ha v e intro- duced a w eighted update policy to the bac kg round model based on associated w eights to ensure the accur acy in the distance estimation step . The proposed fr ame w or k achie v ed compar ativ e re- sults when consider ing sur v eillance application sequences and tr affic monitor ing systems videos . The presented fr ame w or k deals with prob lem of ghost and noisy scene , as w ell as the g r adual slo w illumination change . In fur ther w or k w e seek to impro v e the presented appr oach to fit an e xtensiv e r ange of challenges: dynamic scene and bad w eather situations . Figure 2. Proposed method f or Dynamic Bac kg round Categor y: fr ames from the canoe sequence . Ref erences [1] Elgammal. A. et al., “No n-par ametr ic model f or bac kg round subtr action, In Computer Vi- sionECCV 2000 , v ol. -, pp . 751–767, 2000. w eighted samples f or bac kg round subtr action(Boubek eur) Evaluation Warning : The document was created with Spire.PDF for Python.
7784 ISSN: 2302-4046 T ab le 2. Compar ison b etw een the proposed method and some of the e xisting bac kg round sub- tr action algor ithms Method RE SP FPR FNR PWC PR F-Measure Proposed 0.8683 0.9963 0.0037 0.1317 0.8693 0.8582 0.8551 Mahalanobis distance [8] 0.3154 0.9991 0.0009 0.6846 2.8698 0.4642 0.9270 GMM/Zivk o vic [10] 0.8085 0.9972 0.0028 0.1915 1.3298 0.8382 0.8993 Euclidean distance [8] 0.8385 0.9955 0.0045 0.1615 1.0260 0.8720 0.9114 Figure 3. Rob ustness of the proposed algor ithm to ghost sutuation. 1 st column sho ws the or iginal, 2 nd : The g round tr uth, 3 r d : A GMM[10],and 4 th : The Proposed. [2] Bar nich. O and M. V an Dro ogenbroec k, “Vibe: A un iv ersal bac kg round subtr action algor ithm f or video sequences , IEEE T r ansactions on Image Processing , v ol. 6, pp . 1709–1724, 2011. [3] S .-C . S . Cheung and C . Kamath, “Rob ust techniques f or bac kg round subtr action in urban tr affic video , In Proceedings of SPIE , v ol. 5308, pp . 881–892, 2004. [4] Lacassagne . L. et al., “High perf or mance motion detection: some trends to w ard ne w embed- ded architectures f or vision systems , Jour nal of Real-Time Image Processing , v ol. 4-2, pp . 127–146, 2009. [5] M. V an Droogenbroec k and O . P aquot, “Bac kg round subtr action: Exper iments and impro v e- ments f or vibe , In Computer Vision and P atter n Recognition W or kshops (CVPR W) , pp . 32–37, 2012. [6] M. Li, J . F an, Y . Zhang, R. Zhang, X. W eijing, and H. Dingding, “A mo ving object detection algor ithm based on m ult iple judgments , TELK OMNIKA Indonesian Jour nal of Electr ical Engi- neer ing , v ol. 11, no . 10, pp . 5539–5544, 2013. [7] Shisong et al., “Mo ving v ehicle detection and tr ac king algor ithm in tr affic video , TELK OMNIKA Indonesian Jour nal of Electr ical Engineer ing , v ol. 11, no . 06, pp . 3053–3059, 2013. [8] B . Y . et al., “Compar ativ e study of bac kg round subtr action algor ithms , Jour nal of Electronic Imaging , v ol. 19-3, 2010. [9] Go y ette , N. et al., “Changedetection.net: A ne w change detection benchmar k dataset, In- Computer Vision and P atter n Recognition W or kshops (CVPR W) , v ol. -, pp . 1–8, 2012. [10] Zivk o vic , Z. “Impro v ed adaptiv e gaussian mixture model f or bac kg round subtr action, In P at- ter n Recognition, 2004. ICPR , v ol. 2, pp . 28–31, 2004. TELK OMNIKA V ol. 12, No . 11, No v ember 2014 : 7778 7784 Evaluation Warning : The document was created with Spire.PDF for Python.