Disclosure of Invention
The invention aims to avoid the defects in the prior art and provides a method for detecting the abnormal behaviors of people in a sensitive area based on behavior analysis.
The purpose of the invention is realized by the following technical scheme: the method for detecting the abnormal behaviors of the crowd in the sensitive area based on behavior analysis comprises the following steps:
(1) constructing an abnormal behavior feature library of the crowd and providing an accurate basis for detecting the abnormal behaviors of the crowd in the sensitive area;
(2) and detecting abnormal behaviors of the crowd in the sensitive area by an Euclidean distance method.
As a further improvement, the step (1) constructs an abnormal behavior feature library of the crowd, and provides an accurate basis for detecting the abnormal behavior of the crowd in the sensitive area, which is specifically represented as follows:
(11) for different crowd abnormalitiesThe behavior characteristics are assigned corresponding numerical values, provided that
The predicted value of human behavior y (n) is:
wherein i represents the class number of the abnormal behavior characteristics, N belongs to N and N is a natural number, aiThe weight of the behavior feature is used, and y (n-i) represents the abnormal behavior feature in the predicted value;
(12) setting the error of the prediction of the crowd behavior in the sensitive area as e (n), and then:
wherein when i is 1, a1=1;
(13) Converting the formula (2) in the step (12) into a mean square error criterion for description:
in the formula (I), the compound is shown in the specification,
mean square error representing a behavioral characteristic;
(14) the attribute of the behavior feature is normalized through the following formula:
in the formula, Y represents a crowd abnormal behavior feature library, X represents an abnormal behavior feature to be detected in a sensitive area, m represents an average value, and S represents an average deviation of behavior feature values, wherein expressions of S and X are respectively as follows:
in the formula, c represents a natural number, c belongs to N, and N is a natural number;
X=(x1,x2,...,xc) (6)
in the formula, x1、x2、xcRespectively, the 1 st, 2 nd and c th abnormal behaviors to be detected in the sensitive region.
As a further improvement, the step (2) detects abnormal behaviors of the population in the sensitive area by using a euclidean distance method, which is specifically represented as:
(21) setting n types of abnormal behavior characteristics in the crowd abnormal behavior characteristic library Y, wherein:
Y=(ωi) (7)
in the formula, ωiRepresenting the ith abnormal behavior characteristics in the crowd abnormal behavior characteristic library Y, wherein i is 1, 2.. n;
(22) since X is the abnormal behavior to be detected in the sensitive area, X is set(i)Is the mean vector of the i-th abnormal behavior characteristics to be detected in the sensitive area, then X(i)The expression of (a) is:
X(i)=(x1(i),x2(i),…xc(i)) (8)
in the formula, x1(i)、x2(i)、xc(i)Respectively representing mean value vectors of 1 st, 2 nd and c th abnormal behavior characteristics of the ith class to be detected in the sensitive area;
(23) the detection function of the abnormal behavior characteristics is described by the following formula:
in the formula, xjRepresenting the j-th abnormal behaviour, x, to be detected in the sensitive areaj(i)Representing a mean vector of jth abnormal behavior characteristics of an ith class to be detected in the sensitive area;
(24) if D is presentf(X) minD (X), wherein DfAnd (X) represents the abnormal behavior to be detected, and the type of the abnormal behavior to be detected is the same as the type of a certain abnormal behavior feature in the abnormal behavior feature library, namely X belongs to Y.
As a further improvement, the euclidean distance between the abnormal behavior features of the sensitive area population to be detected and the behavior features in the abnormal behavior feature library is inversely proportional to the similarity between the two abnormal behaviors: the closer the Euclidean distance between the abnormal behavior characteristics of the sensitive region population to be detected and the behavior characteristics in the abnormal behavior characteristic library is, the higher the similarity of the two abnormal behaviors is; the more the Euclidean distance between the abnormal behavior characteristics of the sensitive region population to be detected and the behavior characteristics in the abnormal behavior characteristic library is, the closer the similarity between the two abnormal behaviors is.
As a further improvement, the mean vector of the abnormal behavior features to be detected of the population in the sensitive area is solved according to the known abnormal behavior features, and then the mean vector X of the i-th class of abnormal behavior features to be detected in the sensitive area is calculated(i)Solving by the following formula:
in the formula, Xj(i)As a known type of abnormal behavior feature omegaiSample of (2), MiIs a sample Xj(i)Wherein j is 1,2iAnd M isi≤c。
As a further improvement, before the abnormal behavior feature sample is detected by the euclidean distance method, weighting is performed, which is specifically represented as:
(A) setting the number of samples of a certain abnormal behavior in a training sample set as M, wherein the feature set vector description is as follows:
xi=[xi,1,xi,2,...xi,d]T(11)
wherein d is 1,2, and M is a natural number, xi,1、xi,2、xi,dRespectively representing the i-th class exceptionA vector of the behavior feature set, T representing a matrix transpose;
(B) the vector variance of the abnormal behavior feature set is described by:
s2=[s12,s22,...,sD2]T(12)
in the formula, s12、s22、sD2Respectively representing a set of abnormal behavior characteristics, s2And D is the dimension of the abnormal behavior feature vector, and the vector variance of the abnormal behavior feature set is represented by the following steps:
in the formula, s
d2Represents the d-th abnormal behavior feature set,
as abnormal behavior feature vector x
i,dAnd its expression is as follows:
(C) the result of weighting the abnormal behavior characteristics is as follows:
in the formula (I), the compound is shown in the specification,
representing abnormal behavior feature weighting and w representing weighting processing.
As a further improvement, a multilayer resolution method is adopted to analyze the detection error of the abnormal behaviors of the crowd in the sensitive area.
As a further improvement, the method further comprises the step (3) of verifying the accuracy of the detection method through detection result sampling, wherein sampling points are collected according to the degree of curvature of the abnormal behavior characteristics of people in the sensitive area, the characteristic area with small curvature change is selected as a low-density sampling point, the characteristic area with large curvature change is selected as a high-density sampling point, and the average result of multiple sampling is used as a final result.
The invention provides a method for detecting the abnormal behaviors of people in a sensitive area based on behavior analysis, which provides an accurate basis for the abnormal detection of the people in the sensitive area by establishing a characteristic library of the abnormal behaviors of the people compared with the defects of the traditional method in the aspect of detecting the abnormal behaviors of the people in the sensitive area; the method for detecting the crowd abnormal behaviors in the sensitive area by utilizing the Euclidean distance method realizes the accurate detection of the crowd dangerous behaviors and has the advantage of high detection accuracy.
Detailed Description
In order to make those skilled in the art better understand the technical solution of the present invention, the following detailed description of the present invention is provided with reference to the accompanying drawings and specific embodiments, and it is to be noted that the embodiments and features of the embodiments of the present application can be combined with each other without conflict.
Fig. 1 is a flowchart of an embodiment of a method for detecting abnormal behaviors of people in a sensitive area based on behavior analysis according to the present invention. As shown in fig. 1, the invention provides a method for detecting abnormal behaviors of people in sensitive areas based on behavior analysis, which comprises the following steps:
(1) and (3) constructing an abnormal behavior feature library of the crowd, and providing an accurate basis for detecting the abnormal behaviors of the crowd in the sensitive area.
Specifically, step (1) is represented as:
(11) in the process of constructing the crowd abnormal behavior feature library, corresponding numerical values are given to different crowd abnormal behavior features, and the hypothesis is that
The predicted value of human behavior y (n) is:
i represents the number of categories of the abnormal behavior characteristics, N belongs to N and N is a natural number, aiThe weight of the behavior feature is used, and y (n-i) represents the abnormal behavior feature in the predicted value;
(12) setting the error of the prediction of the crowd behavior in the sensitive area as e (n), and then:
wherein when i is 1, a1=1;
In this step, it is preferable to analyze the detection error of the abnormal behavior of the human population by using a multilayer discrimination method.
(13) Converting the formula (2) in the step (12) into a mean square error criterion for description:
in the formula (I), the compound is shown in the specification,
mean square error representing a behavioral characteristic;
the abnormal behaviors of the crowd are expressed in different forms, and the measurement standards of the behavior characteristics are also different, which causes the problem that different behavior characteristics are covered, so that the attribute of the behavior characteristics needs to be normalized, and then:
(14) the attribute of the behavior feature is normalized through the following formula:
in the formula, Y represents a crowd abnormal behavior feature library, X represents an abnormal behavior feature to be detected in a sensitive area, m represents an average value, and S represents an average deviation of behavior feature values, wherein expressions of S and X are respectively as follows:
wherein c belongs to N and N is a natural number;
X=(x1,x2,...,xc) (6)
in the formula, x1、x2、xcRespectively, the 1 st, 2 nd and c th abnormal behaviors to be detected in the sensitive region.
Fig. 2 is a characteristic library of the abnormal behavior of the population, which is established according to the above method. Referring to fig. 2, it is obvious that the crowd abnormal behavior feature library established according to the above method can provide an accurate basis for detecting the crowd abnormal behavior in the sensitive area.
(2) And detecting abnormal behaviors of the crowd in the sensitive area by an Euclidean distance method.
The euclidean distance method classifies the similarity according to the minimum distance. The Euclidean distance between the abnormal behavior characteristics of the sensitive region population to be detected and the behavior characteristics in the abnormal behavior characteristic library is inversely proportional to the similarity of the two abnormal behaviors: the closer the Euclidean distance between the abnormal behavior characteristics of the sensitive region population to be detected and the behavior characteristics in the abnormal behavior characteristic library is, the higher the similarity of the two abnormal behaviors is; the more the Euclidean distance between the abnormal behavior characteristics of the sensitive region population to be detected and the behavior characteristics in the abnormal behavior characteristic library is, the closer the similarity between the two abnormal behaviors is.
The method can detect abnormal behaviors of people in sensitive areas by an Euclidean distance method, and comprises the following steps:
(21) setting n types of abnormal behavior characteristics in the crowd abnormal behavior characteristic library Y, wherein:
Y=(ωi) (7)
in the formula, ωiRepresenting the ith abnormal behavior characteristics in the crowd abnormal behavior characteristic library Y, wherein i is 1, 2.. n;
(22) since X is the abnormal behavior to be detected in the sensitive area, X is set(i)Is the mean vector of the i-th abnormal behavior characteristics to be detected in the sensitive area, then X(i)The expression of (a) is:
X(i)=(x1(i),x2(i),…xc(i)) (8)
in the formula, x1(i)、x2(i)、xc(i)Respectively representing mean value vectors of 1 st, 2 nd and c th abnormal behavior characteristics of the ith class to be detected in the sensitive area;
(23) the detection function of the abnormal behavior characteristics is described by the following formula:
in the formula, xjRepresenting the j-th abnormal behaviour, x, to be detected in the sensitive areaj(i)Representing a mean vector of jth abnormal behavior characteristics of an ith class to be detected in the sensitive area;
(24) if D is presentf(X) minD (X), wherein DfAnd (X) represents the abnormal behavior to be detected, and the type of the abnormal behavior to be detected is the same as the type of a certain abnormal behavior feature in the abnormal behavior feature library, namely X belongs to Y. As a further preferred embodiment, there is a difference between the mean vectors due to different types of abnormal behavior featuresIn the process of subdividing, the mean vector of the abnormal behavior features to be detected needs to be solved according to the known abnormal behavior features, and then the mean vector X of the i-th abnormal behavior features to be detected in the sensitive region(i)Solving by the following formula:
in the formula, Xj(i)As a known type of abnormal behavior feature omegaiSample of (2), MiIs a sample Xj(i)Wherein j is 1,2iAnd M isi≤c。
In addition, it is worth mentioning that, in order to avoid that the difference between the mean vectors of the abnormal behavior features is too large to cause the decrease of the classification accuracy, the sample features need to be weighted, that is, before the abnormal behavior feature samples are detected by the euclidean distance method, the weighting is performed first, which is specifically represented as:
(A) setting the number of samples of a certain abnormal behavior in a training sample set as M, wherein the feature set vector description is as follows:
xi=[xi,1,xi,2,...xi,d]T(11)
wherein d is 1,2, and M is a natural number, xi,1、xi,2、xi,dVectors respectively representing the ith abnormal behavior feature set, and T represents matrix transposition;
(B) the vector variance of the abnormal behavior feature set is described by:
s2=[s12,s22,...,sD2]T(12)
in the formula, s12、s22、sD2Respectively representing a set of abnormal behavior characteristics, s2And D is the dimension of the abnormal behavior feature vector, and the vector variance of the abnormal behavior feature set is represented by the following steps:
in the formula, s
d2Represents the d-th abnormal behavior feature set,
as abnormal behavior feature vector x
i,dAnd its expression is as follows:
(C) the result of weighting the abnormal behavior characteristics is as follows:
in the formula (I), the compound is shown in the specification,
representing abnormal behavior feature weighting and w representing weighting processing.
The characteristic vector of the abnormal behaviors of the crowd after weighting processing can increase the distance of the characteristic vector with smaller discrete degree and reduce the distance of the characteristic vector with larger discrete degree, so that the accuracy of the abnormal behaviors of the crowd to be detected is improved.
Meanwhile, as a further preferred embodiment, the method also comprises the step (3) of verifying the accuracy of the detection method by sampling the detection result, wherein sampling points are collected according to the degree of curvature of the abnormal behavior characteristic of people in the sensitive area, low-density sampling points are selected in the characteristic area with small curvature change, high-density sampling points are selected in the characteristic area with large curvature change, and the average result of multiple times of sampling is taken as a final result.
Taking a monitoring database of a traffic monitoring center in a certain city as an example, fig. 3 shows that a comparison experiment performed by the traffic monitoring center by using a conventional behavior analysis method and the detection method of the present invention includes 5 types of abnormal behavior images. The ratio of training samples to test samples was 3: 1. The abnormal behavior data of the population during the experiment can be described by different types of abnormal behavior sample data of the population as shown in the following table 1:
FIG. 4 is a diagram illustrating the detection result of abnormal behavior of people in sensitive areas according to a conventional method; FIG. 5 is a diagram of the detection result of the abnormal behavior of the crowd in the sensitive area according to the present invention. As can be seen from the image displays of fig. 3, 4 and 5, the detection effect of the present invention is significantly improved compared to the conventional method, and the accuracy of the crowd dangerous motion recognition is higher. The traditional method is only simple to extract the outline and the general view of dangerous actions of people by using the monitoring image, and has great limitation, so that the accuracy of dangerous behavior detection is reduced, and the detection effect is not ideal. The reason that the accuracy of the detection result is higher is that a characteristic library of the crowd abnormal action behaviors is constructed, the dangerous actions to be detected are compared with the characteristic library of the crowd abnormal action behaviors by using an Euclidean distance method, and in order to avoid that the classification accuracy is reduced due to overlarge difference between mean vectors of the abnormal action characteristics, weighting processing is carried out on sample characteristics, so that an accurate dangerous action detection result is obtained. This fully demonstrates the superiority of the detection method of the present invention.
In addition, in the experimental process of the present invention, which takes the monitoring database of a traffic monitoring center in a certain city as an example, the results of the crowd abnormal behavior detection of the conventional method and the method of the present invention are described by comparing the following experimental results in table 2:
according to the experimental results, the accuracy of the detection on the abnormal behaviors of the crowd in the sensitive area is far higher than that of the traditional method, which also shows that the detection method can better detect the abnormal behaviors of the crowd in the sensitive area and fully embodies the superiority of an improved algorithm.
Therefore, both the image data and the table data show that the detection method is superior to the traditional method, and has the advantage of high detection accuracy aiming at the detection of the dangerous behaviors of the crowd.
In the description above, numerous specific details are set forth in order to provide a thorough understanding of the present invention, however, the present invention may be practiced in other ways than those specifically described herein, and therefore should not be construed as limiting the scope of the present invention.
In conclusion, although the present invention has been described with reference to the preferred embodiments, it should be noted that, although various changes and modifications may be made by those skilled in the art, they should be included in the scope of the present invention unless they depart from the scope of the present invention.