Summary of the invention
This patent mainly comprises two aspects: first invented a kind of unsupervised many characteristic locuses pattern learning method and extracted typical orbiting motion pattern; Then invented on this basis that a kind of online many feature abnormalities detection method detects that the starting point of track is abnormal simultaneously, local anomaly, global abnormal.
One, unsupervised many characteristic locuses pattern learning method
First the present invention provides a kind of pattern learning method based on the many features of track, by consider direction of motion and locus between track simultaneously, weigh the similarity between track, the Agglomerative Hierarchical Clustering that carries out layering extracts typical orbiting motion pattern, and improves hierarchical clustering algorithm efficiency by introducing Laplacian matrix.Concrete pattern learning framework as shown in Figure 1.
Specific implementation step of the present invention is as follows:
1, similarity measurement between many feature extractions and track
The present invention makes full use of track position and direction character information is weighed the similarity between track, adopts respectively IMHD distance and Bhattacharyya apart from the similarity of calculating between track.Pretreated effective track can be expressed as:
T wherein
jrepresent track T
ij sampled point, N
irepresent course length.(x
j, y
j) represent that j sampled point is at the two-dimensional position coordinate of the plane of delineation.
1) orbiting motion direction similarity measurement
Trajectory direction feature extraction as shown in Figure 2, defines m
j=(x
j+1-x
j, y
j+1-y
j), represent direction vector between neighbouring sample point; m
0=(1,0), represents direction level vector of unit length to the right.Track T
ij sampled point deflection can be expressed as:
θ wherein
j∈ (0,360), is divided into N (N=18) individual uniformly-spaced sub-range (I trajectory direction angular region (0,360)
1, I
2... I
n).Each sub-range length is △ θ=360/N=20 degree, track T
iall deflection θ
jbe mapped to corresponding sub-range.Track T
jdeflection is distributed in interval I
qprobability be p
q=M
q/ M (M
q: θ
j∈ I
qnumber, M: track T
ideflection number).
Track T
idirection character can be expressed as
track T has been described
istatistics directional information.Adopting Bhattacharyya apart from weighing direction of motion similarity between track is:
Dire (T wherein
i)
qand Dire (T
j)
qrepresent respectively track T
iand T
jdeflection be distributed in the probability in q deflection interval.Dire (T
i, T
j) more close to 1, represent that two orbiting motion directions are more similar; Dire (T
i, T
j) be more bordering on 0, contrary.
2) trajectory range location similarity is measured
By target following, can directly obtain track position feature,
this patent adopts the improvement Hausdorff distance (IMHD) based on line segment interpolation to weigh the similarity of trajectory range position, and track line segment interpolation model as shown in Figure 3, represents track T with broken line
iand T
j:
In IMHD algorithm, track T
isampled point t
ato T
jbee-line is expressed as:
Wherein || || represent Euclidean distance between sampled point,
t
abe mapped to
the vertical interpolation point of corresponding line segment,
in Fig. 3, dot, known according to mathematical principle, if existed
for t
ato T
jbee-line, otherwise traversal track T
jall sampled points, find minor increment
Last track T
ito T
jdistance be:
track T
iand T
jlocus distance be:
D
IMHD(T
i,T
j)=max(h(T
i,T
j),h(T
j,T
i)) (4)
2, many characteristic locus classification
This patent is introduced the Laplacian mapping thought of spectral clustering in Agglomerative Hierarchical Clustering algorithm, and structure Laplacian matrix also carries out Eigenvalues Decomposition.According to the perturbation theory of matrix, by the automatic hard clustering number of the difference between eigenwert k; Original higher-dimension track data is mapped to a bit in new k dimensional feature space simultaneously, with the unit of low dimensional feature vector, usually represents original track data, greatly reduce the dimension of track.In conjunction with many characteristic similarities of track comparison above, a kind of many feature hierarchies clustering algorithm based on Laplacian Matrix has been proposed, as shown in empty frame in Fig. 1.
If the set that contains m effective track is Ω
traj={ T
1, T
2..., T
m, algorithm 1 is described below:
1) the thick cluster stage---based on direction of motion cluster
Step1 uses Bhattacharyya apart from calculating track T
i, T
jbetween direction of motion similarity Dire (T
i, T
j), the similar matrix W with gaussian kernel function structure based on direction of motion
dire∈ R
m * m, w wherein
ij=exp (Dire (T
i, T
j)
2/ 2 σ
2), σ is scale parameter.
Step2 structure standard Laplacian matrix
d wherein
1for diagonal matrix, matrix element is
Step3 is to L
direcarry out Eigenvalues Decomposition, eigenwert is numbered to λ by descending sort
1>=λ
2>=...>=λ
m, calculate the poor of adjacent feature value, if i eigenwert and i+1 eigenwert difference are maximum, determine thick cluster number
Step4 structure m * k matrix L=[l
1, l
2..., l
k], l wherein
1, l
2..., l
kfor front k eigenwert characteristic of correspondence vector.Each row of L is carried out to unit processing, obtain matrix X, wherein
track set after dimensionality reduction is Ω
traj'={ x
1, x
2..., x
m, x
1, x
2..., x
meach row vector of homography X, represents R respectively
ka bit of space.
Step5 is to x
1, x
2..., x
mcarry out Agglomerative Hierarchical Clustering, use similarity between two bunches of minimum distance calculation, when finally merging into k bunch, iteration stops, and obtains k centre cluster { O
1, O
2, O
i..., O
k.
2) the thin cluster stage---based on locus cluster
Step6 is to cluster O in the middle of each
ithe former track of middle correspondence uses IMHD apart from the similar matrix W constructing based on locus
iMHD, w wherein
ij=exp (D
iMHD(T
i, T
j)
2/ 2 σ
2).Repeat Step2 to Step5 step, determine each cluster O
icluster number q
i, construct low dimensional feature space, last cluster obtains cluster { C
1, C
2, C
k, total cluster number
Two, online many feature abnormalities detection method
1, abnormal track is described
The present invention is from the character of abnormal trajectory generation, in conjunction with many feature abnormalities detection method below, without any priori in the situation that, the degree and the character that according to abnormal track, depart from proper motion pattern, defined starting point abnormal, three kinds of common Exception Types of global abnormal and local anomaly.Instantiation as shown in Figure 4, has track motor pattern C in figure
1and C
2, track T
cand T
dlocus and direction of motion all run counter to pattern C
1, be global abnormal; And track T
aand T
blocus meet respectively pattern C
1and C
2, but T
adirection and pattern C
1on the contrary, T
bfrequent break-in, institute thinks local anomaly.
2, online many feature abnormalities detect
Fig. 5 is abnormality detection general frame, and according to, local anomaly abnormal to starting point and global abnormal definition, first the present invention learns scene start position by GMM model and distribute.Then set Moving Window that a length is k as basic comparing unit, each motor pattern after on-line study cluster
locus and the distribution of direction of motion, set up position-based distance and direction distance classification device, learning model parameter; Online many feature abnormalities detection-phase, weighs difference between track to be measured and normal trace motor pattern from starting point, position and three levels of direction, judges whether it is abnormal track, and which kind of type judgement is.
1) set up track starting point distributed model
Study moving target enters the starting point distributed areas of monitoring scene, significant to abnormal behaviour identification.The present invention distributes by normal trace cluster start position in two-dimentional GMM model learning scene, sets up starting point position distribution model.First to training the point set that rises of track
with K mean cluster, obtain the initial parameter of GMM model, each gauss component parameter (p of recycling EM Algorithm Learning GMM
l, u
l, ∑
l).Enter scene track starting point z=(x
1, y
1)
tthe probability that meets GMM model profile is:
Wherein k represents single gauss component number, p
lfor single gauss component prior probability, meet
the probability density function of single gauss component is:
Each track sample starting point (x '
1, y '
1) as input z
i=(x '
1, y '
1)
t, try to achieve the probability density P (z under GMM model
i), get minimum probability value as GMM model threshold
2) set up the online classification device of position-based distance and direction distance
To the every class normal trace cluster C after cluster
iresample, make the track in each cluster
equal in length is l
i, obtain each cluster C
iposition represent pattern
wherein
if the Moving Window that length is k is as the basic comparing unit of online abnormality detection, definition position distance H
positionweigh track to be measured
and the locus match condition of normal trace motor pattern between basic comparing unit.
Define 4 positional distance (H
position).If track T to be measured and position represent pattern R
imoving Window comparing unit be respectively T '
p={ t
p..., t
p+k-1| 1≤p≤N-k+1} and R '
i, q={ t
q..., t
q+k-1| 1≤q≤l
i-k+1}.With IMHD distance definition positional distance, be equally:
Set up position-based distance H below
positiononline classification device, because of stochastic variable H
position(T '
p, R '
i, q) be similar to and obey the exponential distribution that parameter is λ, so orbit segment T '
pbelong to mode position R '
i, qconditional probability be:
According to maximum likelihood assessment level, calculate cluster C
ieach track
represent pattern R with position
ipositional distance between corresponding Moving Window
parameter lambda
qbe estimated as:
According to bayesian theory, p the Moving Window T ' of track T to be measured
pposition sign syntype R
iq corresponding Moving Window R '
i, qprobability be:
Wherein
cluster C
itrack number account for the ratio of total sample number.Cluster C
ieach sample track as input, the parameter threshold of obtaining each Moving Window is
Then set up based on direction distance H
directiononline classification device, define equally direction distance H
directionweigh track T and the normal trace pattern direction of motion match condition between Moving Window.First according to formula (1), obtain orbit segment T ' to be measured
pcorresponding deflection θ
p, direction vector m wherein
p=(x
p+k-1-x
p, y
p+k-1-y
p).Direction distance definition is as follows:
Define 5 direction distance (H
direction).If pattern C
imean motion direction at q Moving Window is
corresponding orientation average departure degree is
utilize Mahalanobis distance, by average θ
i, qand variance
calculate orbit segment T '
pto pattern C
ithe direction distance of q Moving Window is:
Wherein
for pattern C
imiddle track
at the deflection of q Moving Window, correspondence direction vector is
ask pattern C
ieach track
direction distance at corresponding Moving Window
get maximal value as the parameter threshold of q Moving Window
3) online many feature abnormalities detection algorithm
Character according to the present invention to abnormal definition is known, when determining that the locus of track occurs extremely or adjacent track section does not belong to same position pattern, can be judged as global abnormal, need not judge that whether direction is abnormal again, can improve online detection efficiency like this; And online detection of track local anomaly be take malposition detection as basis, if orbit segment T '
pposition distribution belongs to
judge again orbit segment T '
pdirection of motion whether still belong to
determine whether as local anomaly, as shown in Outlier Detection Algorithm flow process frame as empty in Fig. 5.
Setting Moving Window length is k, and algorithm 2 is described below:
Step1 extracts track starting point z=(x to be measured
1, y
1)
t, calculate P (z), if P (z)>=Ω
gMM, judge that track to be measured enters scene from normal start position region; Otherwise be that starting point is abnormal.
Step2 calculates course length Length to be measured (T), the Moving Window T ' of online extract real-time track T to be measured
p.
Step3 is at each mode position R
iunder, find and orbit segment T ' to be measured
pthe Moving Window of positional distance minimum
bring into corresponding to H
positionsorter, searching makes
the track position pattern of maximum probability
If Step4 judgement
bing and previous Moving Window T '
p-1meet same pattern
the orbit segment T ' of track T so to be measured
pposition distribution is normal, belongs to
, enter Step5, judge whether local anomaly; Otherwise output trajectory section T '
pfor global abnormal, enter Step6.
Step5 calculates Moving Window T '
pdeflection θ
p, bring associative mode into
based on H
directionsorter, calculate itself and the direction distance of corresponding window
if
direction of motion meets
judge orbit segment T ' to be measured
pfor normal trace section, belong to pattern C
i; Otherwise output trajectory section T '
pfor local anomaly.
Step6 judges whether Length (T) changes, if changed, extracts next Moving Window, repeats Step2 to Step5; If length is constant, each Moving Window T ' of Bing
pall belong to motor pattern C
i, T is normal trace.
embodiment
1, the hierarchical clustering algorithm experimental verification of the many features based on Laplacian matrix
Validity for proof clustering algorithm, a two-way lane traffic video image (as adopting two dimension target track algorithm, is followed the tracks of the moving target of Fig. 6 in a), frame speed is 25 frames/s, image resolution ratio is 320 * 240, gather altogether 296 vehicle movement tracks, by retaining 216 effective tracks after pre-service such as level and smooth grade, as shown in Figure 6 b.
The clustering algorithm that application proposes, first carries out based on the thick cluster of direction of motion training track, and cluster result as shown in Figure 7a, is roughly divided into track the two class O that direction of motion is contrary
1and O
2; Then cluster in the middle of each is carried out respectively based on the thin cluster in locus, final cluster result as shown in Figure 7b, represents respectively middle cluster O
1and O
2thin cluster result, cluster obtains 5 different classification in the middle of each, has 10 track clusters, just corresponding one by one with the region, 10 tracks of reality.
In every strata class process, clusters number, by by Laplacian proper value of matrix sequencing numbers from big to small, is found and is had the adjacent feature value of maximum disparity automatically to determine.As shown in Figure 8, transverse axis is eigenwert numbering, and the longitudinal axis is characteristic of correspondence value.The thick cluster of ground floor disparity between the 2nd and the 3rd eigenwert is △ λ
1=0.373, so thick cluster number is 2; The thin cluster of the second layer is all with the biggest gap between the 5th and the 6th eigenwert, is respectively △ λ
2=0.523 and △ λ
3=0.463, so thin cluster number is all 5.
In addition, the clustering algorithm proposing because of this patent is the improvement based on Agglomerative Hierarchical Clustering algorithm, so two kinds of methods are compared on the time in cluster accuracy rate and cluster.In experimental data, total number of tracks is 216, and cluster numbers is all 10, and the average result that algorithm operation is 10 times is as shown in table 1.
The comparison of table 1 cluster result
As seen from the results in Table 1, the clustering algorithm that this patent proposes all increases in cluster accuracy rate and time efficiency, be due to the clustering algorithm proposing adopt simultaneously the direction of motion of track and locus feature weigh orbit interval from, carried out hierarchical cluster, therefore improved cluster accuracy rate; In hierarchical cluster from coarse to fine experiment, owing to having introduced Laplacian mapping, the low-dimensional data representation higher-dimension track data of tieing up with 2 peacekeepings 5 respectively, greatly reduces computation complexity, thus cluster time decreased 61.22%, cluster efficiency significantly improves.
2, online many feature abnormalities detection algorithm experimental verification
First judge that starting point is abnormal, by GMM model learning, enter the position distribution of monitoring scene track starting point, judge that whether track starting point to be measured is abnormal.As shown in Figure 9, these scene track starting point distributed areas consist of three single Gaussian distribution.Then establish Moving Window length k=5, by slip Moving Window, judge online global abnormal and local anomaly.As shown in figure 10, the 1st classifies the different vehicle track of tracking as to online testing process, and arrow represents the direction of Vehicle Driving Cycle; The transverse axis of the 2nd each figure of row is Moving Window numbering, and the longitudinal axis is probability, is expressed as the probability that the position distribution of corresponding track to be measured under each Moving Window belongs to each motor pattern, with solid line and dotted line, shows front two maximum probability pattern; The transverse axis of the 3rd each figure of row is Moving Window numbering, the longitudinal axis is deflection, in figure solid line be track to be measured at the direction of motion angle of each Moving Window, dotted line represents that motor pattern that track to be measured meets in locus corresponding to Figure 10 b is most at the mean motion deflection of corresponding window.Figure 10 (a) is normal trace, and the probability that each Moving Window of track to be measured meets pattern 6 is always between 0.9 to 1, and direction of motion meets pattern 6 too; The track of Figure 10 (b) and 10 (c) is global abnormal, as Figure 10 (b2) with (c2), respectively the 7th and 8 Moving Windows start the probability that locus belongs to original pattern 6 and decline, and the probability that belongs to mode 7 and 5 increases progressively, when being less than pattern 6 threshold value, can report to the police abnormal, and corresponding deflection changes as Figure 10 (b3) with (c3); Figure 10 (d) and (e) in trajectory range position belong to pattern 6 and 7 probability always between 0.9 to 1, but the direction distance that can judge track to be measured and associative mode 6 and 7 by direction distance classification device surpasses threshold value, judges that two tracks are local anomaly.
The validity of the online many feature abnormalities detection algorithm proposing for checking, adopts respectively path matching algorithm based on single Gauss model and the locus model matching process based on C-HMM to compare.Secondary tracking obtains the track of vehicle of Fig. 6 scene again, and Bing people is adds various abnormal next abundant detection algorithm efficiency.Finally in experimental traces data, hand labeled normal trace be 265, abnormal track is 89.In abnormal behaviour detects, by precision ratio and recall ratio, weigh abnormality detection efficiency more effective, comparative result is as shown in table 2.
The comparison of table 2 method for detecting abnormality result
The experimental result of table 2 shows, the abnormal track identification efficiency of method that this patent proposes is higher, and especially recall ratio, has improved respectively 20.22% and 25.84% than two kinds of traditional methods.Because classic method is only considered the differences in spatial location of track and large abnormal of rough detection shape difference, the abnormal and local subsegment of direction is extremely difficult to identify.And the Outlier Detection Algorithm that this patent proposes can be weighed the direction of motion of track to be measured and the difference of locus, by slip Moving Window, detect local anomaly and global abnormal simultaneously, therefore abnormal discrimination is higher.