2011 Intenational Confeence on Compute Science and Infomation Technology (ICCSIT 2011) IPCSIT vol. 51 (2012) (2012) IACSIT Pess, Singapoe DOI: 10.7763/IPCSIT.2012.V51.50 Pediction of Motion Tajectoies Based on Makov Chains Ling Gan and Li na Su College of Compute Science and Technology, Chongqing Univesity of Posts & Telecommunications, Chongqing, China Abstact. As the eseach of object behavios become moe and moe impotant of compute vision in ecent yeas, Tajectoies analysis became a hot topic as it is an basic poblem of object behavios leaning and desciption. In this pape we pesent a pedict object tajectoies model based on MARKOV CHAINS fo the leaning of tajectoy distibution pattens of event ecognition. Due to MARKOV CHAINS pedict tajectoy model s epetition featue, it keeps coecting the pediction by calculated the data fom abnomal behavios, which called automatic leaning. With the two diffeent sets of data used to do the expeimental that appoved pedict object tajectoies model of MARKOV CHAINS has highly accuacy, efficiency and less dimensions compaed with othe leaning of tajectoy distibution pattens. Keywods: MARKOV CHAINS, tajectoy analysis and leaning, anomaly detection, behavio pediction. 1. Intoduction As the temendous potential value of visual suveillance, people pay moe attention on it. Taget detect, object classification, object tacking and event analysis which ae the basic poblems of visual suveillance obtained widely consideation especially event ecognition. In this pape we focus on tajectoy analysis which also is the basic poblem of event ecognition, without discussing othe fields such as object tacking. Most visual suveillance system and event ecognition based on scenes that is aleady known, in which objects moving with a established way. In this case, each scene needs to define a set of object behavios and keep updating since object behavios changed. We can t pedict object behavios even in this way the envionment is fixed, so it is useful and necessay to find a geneal method of event ecognition fo pedicting object behavios based on automatic geneate model. Johnson et al. pesent a statistics object tajectoy model which geneated fom image sequences, in this model object behavios ae descibed as a set of sequence flow volumes, each volume contains 4 elements to expess the object s position and velocity of image plane. The statistical model of object tajectoies is fomed with two two-laye competitive leaning netwoks that ae connected with leaky neuons. Pape 2 descibed a non-adaptive pedict model, which pedicts moving ca diection in time k+1 based on a sequence statuses of the font k times. As without adaptive leaning, pedict accuacy can be low. 2. Makov chains 2.1. Makov pocess and Makov chain Definition 1: a usually discete stochastic pocess (as a andom walk) in which the pobabilities of occuence of vaious futue states depend only on the pesent state of the system o on the immediately peceding state and not on the path by which the pesent state was achieved called also Makov chain. { X ( n ), n 0,1,2,...} Conside a discete state space E and a andom sequence, if any non-negative integes n, 1 n,... (0... ) 2 n m n 1 n 2 n m and natual numbe k, also with any sequence i, i,... i, j E 1 2 m which fom discete state space E can make below fomula, then { X ( n ), n 0,1,2,...} is the Makov chain. E-mail addess: Kanling_@163.com 292
n n i n i n i n m n m i m P { X ( k ) j X ( ), X ( ),..., X ( ) } m 1 1 2 2 m m P{ X ( k) j X ( ) } In the fomula (1), if n,,... m means the time of now, 1 2 m 1 n n n means the time of past, at time of n k m (1), status j only depends on time n m s status, not depends on status of n, 1 n,... 2 n m 1,this featue called no afte-effects of Makov chain. Homogeneous Makov chain and k steps tansition pobability n n i P{ X ( k) j X ( ) }, k 1 ( n, n k) m m m Called k steps tansition pobability of Makov chain, maked as. Tansition pobability means when time n s status is i, the pobability of j which is k unit time afte ( n, n k) n, if p does not depend on Makov chain, which defined as homogeneous Makov chain. This condition only depends on tansition stat off status--i, tansition steps--k and tansition eached status j, ( k) nothing to do with n. Meanwhile k steps tansition pobability is maked as p, like below p p ( k) ( n, n k) P{ X ( n k) j X ( n) i}, k 0 In the fomula 0 p p j E ( k) 1, ( k) 1. p (2) 2.2. The detemination of multiple steps (1) Suppose k=1, p called one step tansition pobability, also maked as p fo shot. Matix which contains all one step tansition pobability p maked as P(1) means one step tansition matix at time m ( i, j E),as usual, ( n) we called it p fo shot. So all n steps tansition pobability is p.matix p(n) called n steps tansition pobability Makov chain, use C-K equation we can get the ecuence elations Then P( n) PP( n 1) P( n 1) P (3) Pn ( ) P n 3. K Steps Tansition Pobability matix And The Pediction 3.1. Build the k steps tansition pobability matix We successfully changed the model fom complicated path pediction to fok-to-fok connection, each fok coesponds to the status of Makov chain. We suppose thee ae n foks which means the tansition matix is n n, p means the pobability of fok i connects to j in one step tansition pobability matix (1 i, j n).obviously p can be geneated by statistics. Take N to expess the times of fok i connects fok j fom the vast eal statistical data p N n N j 1 (1 i, j n) (5) We can geneate the one step tansition pobability matix, accoding to the fomula (4) we also can geneate any k steps tansition pobability matix. Pk ( ) P k (4) (6) 3.2. The basic theoy and method of pediction The pediction fo choosing fok in the oad based on the statistical of histoy infomation and tajectoy. So the neaest pevious fok which is chosen takes moe affectivity on the pediction, meanwhile the ealy histoy is less impot as we can ignoe them. Then we can geneate the Makov chain and the pedict pobability of each fok by weighting. 2 a1 a 2 a k ( ) ( 1) ( 2)... ( ) k X t S t P S t P S t k P (7) In the fomula, t means the time of next fok, t-1 means the time of pevious fok, the simila as othes. X(t) means the pedict pobability fom above fomula calculates by weight,it is a 1 n matix with the value 293
of each element in it stands fo the pedict pobability fo the ight fok to be the next. As S(i), t k i t 1means the statuses of pev-i foks, it also is a matix of 1 n,which the value of line one, ow i is 1, the othes ae 0. It is a elative pobability, totally added the value of all elements may ove 1. a,,... 1a 2 a k is sepaately maked as how the impaction takes fom the font 1,2,...,k foks to the next fok. These values can be gained fom expeience, fistly, we set a... 1 a 2 a k. We also need to mak these foks as 0 which did not connect with the fok that is chosen just now, so we can the maximal element fom X(t) and take the coesponding fok as the next fok. 3.3. Desciption of main aithmetic and analysis Aithmetic 1: How to gain the matix of 1 to k steps pobability Input: N { N } n n Output: { N k} K n n // tansition matix of times M //1 to k steps tansition matix //accoding to statistics the one step tansition matix P is geneated FOREACH N N i // cumulate is accumulate pocess Sum=cumulate N N FOREACH N N i P / sum; N M P; 1 // the matix of 1 to k steps tansition pobability can be geneated fom fomula (3) FOR i=2 to k DO //matixmul saves the temp esult of multiply matixs M matixmul (, P ); i M i 1 ENDFOR RETURN M; The whole pocess need 2 n n epeat times, afte statistics we can geneate matix P fom matix N, complexity is O( n n). Thee is no need to use fomula (6) to gain 2 to k steps tansition pobability matix fom one steps tansition pobability matix, just as fomula (3) can be ecusive and also gained 1 to k steps tansition pobability matix. Complexity of each multiply matixs pocess is O( n n n), so the complexity of one to k steps tansition pobability matix is O( K n n n). Aithmetic 2 How to calculate pediction Input: G {G } n n M {M k} { } 1 k //taffic net K n n S Si Now X { X i} 1 n A { Ai} 1 K Output: Result //the most likely next fok //clea X to 0 and calculate the pediction setzeo( X ); FOR i 1 to k DO // matixmul saves the temp esult of multiply matixs Tepmatix matixmul ( Si, Mi) ; X=matixAdd(X,Tepmatix) ; 294
ENDFOR // filte out the foks which could be eached though the infomation of G FOR i 1 to n DO IF now, i G THEN X i =0 ; ENDIF ENDFOR //the fok with maximum value in X i esult=selectmax( X1, X 2,..., X n) ; RETURN esult Thee is need k-1 times of addition and multiplication to geneated each pediction, as S i is onedimensional, so the time complexity of the whole pocess is O(k n n+k n), it also needs n times to filte which complexity is O(n), at last, the complexity of filte final esult is O(n), total complexity is O(k n n). 4. Abnomal Tajectoy Detection Above tajectoy pediction system based on histoy data and was geneated by taining MARKOV CHAINS, as we found when emegency happens locally, like taffic was been boken off by natual disastes, o getting busy by taffic accident, then we expect the system esponds as the alet quickly. That is a pedict system which can detect abnomal tajectoy, it tacking cas and use exist MARKOV CHAINS model to pedict and take it is nomal if successfully pedict which fok the ca chosen, when pedict failed the system will keep the ecod into failue list, at the same time maked the fok numbe that ca chosen. Meanwhile the system calculates the times of failue timely, once the ate eaches to a theshold it will tigge a ectification use the ecods which wee kept as abnomal tajectoy happened. 4.1. Tacking ca Each fok of tacking ca system which based on camea need to setup one to ecod the fok that ca chosen and the chaacteistic of the ca so that we can ecognize it at next fok. Fom the exist methods like neual netwok, SVM, template matching we found at the same way many cas shae the same chaacteistic, at this condition eoganization of chaacteistics may not accuate as vehicle detection. Thee ae many stable and accuate methods of plate numbe identify, at each fok we set a camea to captue the plate numbe, then seach with it at the backgound database fo cas tacking. 4.2. Abnomal tajectoy detection Fo cas tacking, it is not only ecods the fok which the ca taken and do the pediction, it also check the esult fom which the system can use to detect the abnomal tajectoy. Suppose that ca V i just passed by fok k, at k, it is need to identify the plate numbe and also checked out the histoy tajectoy 1, 2,..., k 1,then begin to tain MARKOV CHAINS model by input these data, finally get ' k 1 the pediction esult of fok that the ca V i pobably will take. When the ca goes to the next fok ' k 1, the system do the exactly the same pocedue as above, moe it also checks the last pediction ' k 1, If the esult fom cuent ecod is the same with the pedication, shows pedict success, then go on the next one ' k 2, othewise means fail, at this condition it is need to ecod the eal choice, and count the ate of fail, but it is no need to do the pediction. Once the ate of fail eached theshold, MARKOV CHAINS model needs a evise. 5. Expeiment Result And Analysis To veify above method s validity, we setup an expeiment of path pedict. In this expeiment we statistics 10000 ecods of histoy tajectoy with 5 foks to choose. Then calculated and saved one to k steps tansition matixes, afte these peconditioning we used the MARKOV CHAINS model to do the pediction fo the kth fok based on the 10000 histoy data. Fom 1 shows the majo paametes of the whole expeiment. 295
Fom 1: Paametes Paametes value Meanings N 5 The numbe of foks K 3 Pediction of k steps histoy tajectoy a [4,1,0.25] Weight aay 1,...,k This expeiment takes monito of cas at 5 foks, and identifies plate numbe also pedicts moving tajectoy, below shows the esult: Pictue 1: Result of detect abnomal tajectoy Pictue 1 shows that compaison of ca tacking befoe and afte the taffic accident, obviously afte the time 4 when the accident happened, the pedict accuacy of tajectoy keeps falling down in those model who can not evise fom abnomal tajectoy. Since taffic police diected othe cas to go by a oundabout oute afte the accident, between the time 6 and 8, models without the ability to detect abnomal tajectoy failed to pedict until at time 8, taffic became nomal again. As ou model which was been impoved kept failing to pedict at the begging just like the othe models, but once the ate eached the theshold (it was been set as 0.4 in the expeiment), it tiggeed a ectification of MARKOV CHAINS, at time 6 afte the e-taining, the pedict system become effective. At time 8 the pocedue taken as the same way until time 10 it ecoveed. 6. Summay This pape pesent a pedict tajectoy method based on Makov chain, this model can pedict the cas tajectoy effectively and can evise once thee is abnomal behavios, with expeiment that poved this model has a highe accuacy and significance. 7. Refeences [1] N. Johnson and D. Hogg, Leaning the distibution of object tajectoies fo event ecognition, Image and Vision Computing, vol. 14, no. 8, pp.609 615, 1996. [2] PENG Qu,DING Zhi-ming,GUO Li-min.Pediction of Tajectoy Based on Makov Chains. Computing Technology.vol,37.no.8. [3] Weiming Hu, Dan Xie. A Hieachical Self-Oganizing Appoach fo Leaning the Pattens of Motion Tajectoies. IEEE TRANSACTIONS ON NEURAL NETWORKS, VOL. 15, NO. 1, JANUARY 2004. [4] T. Collins, A. J. Lipton, and T. Kanade, Intoduction to the special sectionon video suveillance, IEEE Tans. Patten Anal. Machine Intell.,vol. 22, pp. 745 746, 2000. [5] R. J. Howath and H. Buxton, Conceptual desciptions fom monitoing and watching image sequences, Image and Vision Computing, vol. 18, no. 9, pp. 105 135, 2000. [6] R. J. Howath and B. Hilay, An analogical epesentation of space and time, Image and Vision Computing, vol. 10, no. 7, pp. 467 478, 1992. [7] E. Ande, G. Hezog, and T. Rist, On the simultaneous intepetation of eal wold image sequences and thei natual language desciption: The System Socce, in Poc. ECAI-88, Munich, 1988, pp. 449 454. 296
[8] K. Schaefe, M. Haag, W. Theilmann, and H. Nagel, Integation of image sequence evaluation and fuzzy metic tempoal logic pogamming, in KI-97: Advances in Atificial Intelligence, Lectue Notes in Compute Science, 1303, C. Habel, G. Bewka, and B. Nebel, Eds. New Yok: Spinge, 1997, pp. 301 312. [9] M. Band and V. Kettnake, Discovey and segmentation of activities in video, IEEE Tans. Patten Anal. Machine Intell., vol. 22, pp. 844 851,2000. 297