Dangerous behavior identification method, system, storage medium and computer equipment

By extracting and merging video and audio features through contrastive learning methods, combined with multi-classifier decision-making, it solves the problem of low accuracy of traditional multi-modal behavior recognition methods and achieves efficient identification of group dangerous behaviors.

CN116824495BActive Publication Date: 2024-10-11EAST CHINA JIAOTONG UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310756542.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-26
Publication Date
2024-10-11
Estimated Expiration
2043-06-26

AI Technical Summary

Technical Problem

Traditional multi-modal behavior recognition methods have shortcomings in feature expression and model scalability, feature fusion methods, performance complexity, etc., resulting in low recognition accuracy and difficulty in accurately identifying group dangerous behaviors.

Method used

By obtaining the video and audio features of the surveillance video, using the contrastive learning method for feature encoding and projection, calculating the total loss value for iterative training, a contrastive learning model is obtained, and the fused features are input into the multi-classifier weighted voting model for decision-making to achieve risky behaviors. identification.

Benefits of technology

It improves the identification accuracy and prediction accuracy of dangerous behaviors, can describe behaviors more comprehensively and accurately, and enhances the ability to identify group dangerous behaviors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116824495B_ABST
    Figure CN116824495B_ABST
Patent Text Reader

Abstract

The present invention proposes a dangerous behavior identification method, system, storage medium and computer equipment, the method comprising: extracting video features and audio features from video information; encoding and projecting the video features and audio features in each sample in turn to obtain projected video features and projected audio features, and calculating the total loss value of the video modality and the audio modality based on the projected video features and the projected audio features, and iterative training based on the total loss value; obtaining the fusion features of the projected video features and the projected audio features based on the contrastive learning model, and inputting the fusion features corresponding to at least one video information into N base classifiers for training to obtain a multi-classifier weighted voting model, and the behavior type results include dangerous and non-dangerous. The present invention can describe the behavior with more comprehensive and accurate information, and improve the accuracy of danger prediction, thereby realizing the recognition and prediction of group dangerous behaviors.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image recognition technology, and in particular to a dangerous behavior recognition method, system, storage medium and computer equipment. Background Art

[0002] Nowadays, with the rapid development of social economy, the safety of people in public places has received more and more attention. Once group dangerous behavior occurs, it is difficult to take effective measures in time, causing irreparable losses to people's lives and property, and causing a great impact on social stability.

[0003] At present, traditional multimodal behavior recognition methods mainly rely on manually designed multiple features to complete recognition tasks. These features usually require a long period of debugging and optimization to obtain good performance. At the same time, such manually designed features often cannot accurately express the association and interdependence between different modalities. Therefore, it is often difficult to achieve high-precision recognition in real scenarios. In other words, traditional multimodal behavior recognition methods not only have limitations in feature expression effects, but also have certain defects and deficiencies in model scalability, feature fusion methods, and performance complexity, which leads to low recognition accuracy. Summary of the invention

[0004] Based on this, the purpose of the present invention is to propose a dangerous behavior identification method, system, storage medium and computer device to solve the problem of low recognition accuracy in traditional dangerous behavior identification methods.

[0005] A dangerous behavior identification method proposed in the present invention is characterized in that the method comprises:

[0006] Obtain a historical surveillance video containing at least one segment of video information, and perform video feature extraction and audio feature extraction on at least one segment of the video information to obtain video feature and audio features ;

[0007] For each sample Video features in and audio features All are encoded and projected in turn to obtain the projection video features and projected audio features , and according to the projection video features and the projected audio features Calculate the total loss value of the video modality and the audio modality, and perform iterative training according to the total loss value to obtain a contrastive learning model;

[0008] According to the contrastive learning model, the projection video features are obtained and projected audio features The fusion feature F corresponding to at least one video information segment is input into N base classifiers for training to obtain a multi-classifier weighted voting model for outputting the behavior type result with the highest probability, wherein the behavior type result includes dangerous and non-dangerous.

[0009] In summary, according to the above-mentioned pedestrian re-identification method, by using the contrastive learning method to learn features of the two modalities (video and audio), more comprehensive and accurate information can be provided to describe the behavior, and the accuracy of danger prediction can be improved, thereby realizing the recognition and prediction of group dangerous behaviors. Specifically, by obtaining surveillance video information and extracting features from the video and audio in the video information, the multi-modal feature representation is learned by comparing the similarities between different data samples through contrastive learning, and the learned fusion feature representation is then used for behavior recognition, and the final output result is obtained by using the decision-level fusion method of multiple classifiers, which can identify group dangerous behaviors in closed areas such as hospitals, shops, restaurants, and office areas.

[0010] In a preferred embodiment of the present invention, the historical surveillance video containing at least one segment of video information is obtained, and video feature extraction and audio feature extraction are performed on at least one segment of the video information to obtain the video feature. and audio features The steps include:

[0011] Video features are extracted from the video information according to the following formula:

[0012]

[0013] in, is the input video information, whose dimension is (c, V, T), c represents the number of channels, V is the number of nodes, and T is the number of frames. Indicates whether there is an edge connecting nodes i and j. If yes, 1 if yes, 0 if no, represents a diagonal matrix, represents symmetric normalization, represents the i-th eigenvalue in the diagonal matrix, W represents the weight matrix, represents the identity matrix, represents the value of the i-th row and j-th column in the identity matrix, Represents the output video features .

[0014] In a preferred embodiment of the present invention, the historical surveillance video containing at least one segment of video information is obtained, and video feature extraction and audio feature extraction are performed on at least one segment of the video information to obtain the video feature. and audio features The steps include:

[0015] The video information is pre-emphasized according to the following formula:

[0016]

[0017] in, Indicates the output of the nth video information after pre-emphasis. represents the video information of the nth segment, xn-1 represents the video information of the n-1th segment, and a represents the pre-emphasis coefficient;

[0018] The pre-emphasized output is windowed according to the following formula:

[0019]

[0020] in, represents the value of the window function in the time domain, represents the windowed signal;

[0021] The windowed signal is Fourier transformed according to the following formula:

[0022]

[0023] represents the signal after Fourier transformation, and N represents the number of sampling points after windowing;

[0024] Mel filtering is performed on the Fourier transformed signal according to the following formula:

[0025]

[0026] in, is the frequency of the Mel filter, represents the signal after Mel filtering;

[0027] The discrete cosine transform of the Mel-filtered signal is performed according to the following formula:

[0028]

[0029] Where M represents the number of filters, L represents the order of MFCC coefficients, represents the signal after discrete cosine transformation;

[0030] Normalize the signal after discrete cosine transformation to obtain audio features .

[0031] In a preferred embodiment of the present invention, for each sample Video features in and audio features All are encoded and projected in turn to obtain the projection video features and projected audio features , and according to the projection video features and the projected audio features The steps of calculating the total loss value of the video mode and the audio mode, and performing iterative training according to the total loss value to obtain the contrastive learning model include:

[0032] The video features are calculated according to the following formula and audio features To encode and project:

[0033]

[0034]

[0035] Among them, E v (·) and E a (·) indicates encoding operation, P v (·) and P a (·) all represent projection operations;

[0036] Will Consider it as an anchor sample and enumerate other samples The loss obtained by expressing is:

[0037]

[0038] in, represents the contrast loss of the projection of the jth sample from the video modality to the audio modality, τ is the temperature parameter, N represents the number of samples other than the anchor sample, and sim(·) represents the similarity between samples;

[0039] The total loss is calculated according to the following formula:

[0040]

[0041] in, represents the contrastive loss of the projection of the j-th sample from the audio modality to the video modality.

[0042] In a preferred embodiment of the present invention, the projection video features are obtained according to the contrast learning model. and projected audio features The step of fusing features F also includes:

[0043] Assume that the video feature vector output by the contrastive learning model is , the audio feature vector is , then the fusion feature F is calculated according to the following formula:

[0044]

[0045] Among them, α represents the weight coefficient of video features, and 1-α represents the weight coefficient of audio features.

[0046] In a preferred embodiment of the present invention, the projection video features are obtained according to the contrast learning model. and projected audio features The steps of inputting the fusion feature F corresponding to at least one video information into N base classifiers for training to obtain a multi-classifier weighted voting model for outputting the behavior type result with the highest probability, wherein the behavior type result includes dangerous and non-dangerous include:

[0047] Construct a training set based on the fusion feature F corresponding to the at least one video information , where F j represents the fusion feature corresponding to the jth video information, express The category it belongs to, 0 and 1 represent no danger and danger respectively, D is the dimension of the sample space, and k is the number of video information;

[0048] The training set X is input into N base classifiers for training. After training, the class probabilities of each base classifier are output respectively and used represents the probability that the classification category of the nth classifier is i, where i ∈ (dangerous, non-dangerous);

[0049] According to the performance of each base classifier, the initial weight is assigned. represents the initial weight of the nth base classifier, and the initial weight is optimized based on the class probability, and the trained base classifiers are linearly weighted combined according to the optimized initial weight to obtain the multi-classifier weighted voting model.

[0050] In a preferred embodiment of the present invention, the initial weights are assigned according to the performance of each base classifier. The steps of representing the initial weight of the nth base classifier, optimizing the initial weight based on the class probability, and performing linear weighted combination of the trained base classifiers according to the optimized initial weight to obtain the multi-classifier weighted voting model include:

[0051]

[0052] It represents the probability that the multi-classifier weighted voting model predicts that the fusion feature F belongs to category i, It indicates that the nth base classifier predicts the category of the fusion feature F as the output of i, and y indicates the predicted category. It means that the class with the highest probability is selected as the final result.

[0053] Another aspect of the present invention provides a dangerous behavior identification system, the system comprising:

[0054] The feature extraction module is used to obtain historical surveillance videos containing at least one video information, and perform video feature extraction and audio feature extraction on at least one video information to obtain video feature information. and audio features ;

[0055] Iterative training module for each sample Video features in and audio features All are encoded and projected in turn to obtain the projection video features and projected audio features , and according to the projection video features and the projected audio features Calculate the total loss value of the video modality and the audio modality, and perform iterative training according to the total loss value to obtain a contrastive learning model;

[0056] The voting module constructs a module for obtaining information about the projection video features according to the contrastive learning model. and projected audio features The fusion feature F corresponding to at least one video information segment is input into N base classifiers for training to obtain a multi-classifier weighted voting model for outputting the behavior type result with the highest probability, wherein the behavior type result includes dangerous and non-dangerous.

[0057] Another aspect of the present invention provides a storage medium, wherein the storage medium stores one or more programs, which, when executed, implement the dangerous behavior identification method as described above.

[0058] Another aspect of the present invention further provides a computer device, the computer device comprising a memory and a processor, wherein:

[0059] The memory is used to store computer programs;

[0060] When the processor is used to execute the computer program stored in the memory, the dangerous behavior identification method as described above is implemented.

[0061] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description or will be learned through embodiments of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Figure 1 is a flow chart of a dangerous behavior identification method in a first embodiment of the present invention;

[0063] Figure 2 This is a schematic flow chart of dangerous behavior identification in the first embodiment of the present invention;

[0064] Figure 3 It is a structural diagram of a multi-classifier weighted voting model in the first embodiment of the present invention;

[0065] Figure 4 A schematic diagram of the structure of a dangerous behavior identification system proposed in a second embodiment of the present invention.

[0066] The following specific implementation manner will further illustrate the present invention in conjunction with the above-mentioned drawings. DETAILED DESCRIPTION

[0067] In order to facilitate understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. Several embodiments of the present invention are provided in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive.

[0068] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.

[0069] See also Figure 1 , which is a flow chart of a dangerous behavior identification method in a first embodiment of the present invention, the method comprises steps S01 to S03, wherein:

[0070] Step S01: obtaining a historical surveillance video containing at least one segment of video information, and performing video feature extraction and audio feature extraction on at least one segment of the video information to obtain video features and audio features;

[0071] See also Figure 2 ,shown is a schematic flow chart of dangerous behavior recognition.,In this step, for video feature extraction, it is first necessary to read the surveillance video file (historical surveillance video),in order to determine whether there is any dangerous behavior in the surveillance video, and perform video preprocessing,such as cropping, scaling, background removal, etc. These preprocessing steps help reduce noise and redundant information,and improve the efficiency and accuracy of subsequent processing.

[0072] Furthermore, the pre-processed historical surveillance video with group behavior is segmented into video frames, that is, at least one segment of video information, and then Openpose is used to lock the human target and extract the skeleton joint points. Then, the video frames with the skeleton point sequence information are input into the spatiotemporal graph convolutional network ST-GCN for action behavior feature extraction.

[0073] The ST-GCN network uses an adjacency matrix A to represent the connection relationship between the internal joints of the skeleton in a single frame, and uses an identity matrix I to represent the self-connection relationship between the joints in a single frame. The network output is:

[0074]

[0075] in, is the input video information, whose dimension is (c, V, T), c represents the number of channels, V is the number of nodes, and T is the number of frames. Indicates whether there is an edge connecting nodes i and j. If yes, 1 if yes, 0 if no, represents a diagonal matrix, that is, a vector of eigenvalues ​​of the Laplace matrix, represents symmetric normalization, represents the i-th eigenvalue in the diagonal matrix, W represents the weight matrix, W is composed of the weight vectors of several output channels stacked together, represents the identity matrix, represents the value of the i-th row and j-th column in the identity matrix, Represents the output video features .

[0076] For audio feature extraction, it is necessary to extract audio signals from the video and perform audio preprocessing, such as noise reduction, filtering, and silence removal. These preprocessing steps can reduce the impact of environmental noise and other interfering signals and improve the reliability and stability of audio features;

[0077] Furthermore, a speech segmentation algorithm is used to segment the audio signal into different speech segments so as to perform feature extraction and speech recognition on each speech segment. Common speech segmentation algorithms include energy-based, zero-crossing rate-based, endpoint detection-based, and the like.

[0078] Mel cepstral coefficients (MFCC) are used to extract audio features, including human intonation, volume, speech speed, etc. For a piece of audio, the MFCC extraction process is as follows:

[0079] The video information is pre-emphasized according to the following formula, and the function of pre-emphasis is to enhance high frequencies:

[0080]

[0081] in, Indicates the output of the nth video information after pre-emphasis. represents the video information of the nth segment, xn-1 represents the video information of the n-1th segment, and a represents the pre-emphasis coefficient. The value of the pre-emphasis coefficient a is generally between 0.9 and 1. Here, the pre-emphasis coefficient a is selected as 0.97 to filter out the low-frequency noise and retain the high-frequency component information;

[0082] The pre-emphasized output is windowed according to the following formula. The speech is divided into small segments through the windowing operation. The window function is non-zero only in some areas and zero in other areas. The processed features are segmented into N frames, and the locally stable signal is extracted using the Hamming window:

[0083]

[0084]

[0085] in, represents the value of the window function in the time domain, represents the windowed signal;

[0086] The windowed signal is Fourier transformed according to the following formula:

[0087]

[0088] represents the signal after Fourier transformation, and N represents the number of sampling points after windowing;

[0089] After performing fast Fourier transform on the segmented signal, Mel filtering is performed to obtain the logarithmic energy of the logarithmic frequency. Specifically, Mel filtering is performed on the Fourier transformed signal according to the following formula:

[0090]

[0091] in, is the frequency of the Mel filter, represents the signal after Mel filtering;

[0092] In order to reduce the linear correlation between features, the MFCC coefficient C (n) can be obtained by discrete cosine transform DCT. Specifically, the discrete cosine transform of the Mel-filtered signal is performed according to the following formula:

[0093]

[0094] Where M represents the number of filters, L represents the order of MFCC coefficients, represents the signal after discrete cosine transformation;

[0095] The signal after discrete cosine transformation is normalized to make its mean 0 and variance 1, and the audio feature is obtained .

[0096] Step S02: Encode and project the video features and audio features in each sample in turn to obtain projected video features and projected audio features, calculate the total loss value of the video modality and the audio modality according to the projected video features and the projected audio features, and perform iterative training according to the total loss value to obtain a contrastive learning model;

[0097] In this step, for each sample in the training batch (where v and a denote the video modality and audio modality, respectively), two model-specific encoder and projection heads are used to generate projections and , these representations are considered as a positive sample. Negative samples are formed by all inter-modal combinations that are not from the projection to the same input instance (i.e., for each anchor sample , all projections from different input instances or the same input instance but different modalities are considered as negative samples). Therefore, Consider it as an anchor sample and enumerate other samples The loss obtained by expressing is:

[0098]

[0099] in, represents the contrast loss of the projection of the j-th sample from the video modality to the audio modality, τ is a temperature parameter, N represents the number of samples other than the anchor sample, sim(·) represents the similarity between samples, the symbol v→a represents the projection from modality v to modality a, z represents the embedding after projection, k and j are the indices of samples in modality v and modality a, respectively, which are used to calculate the negative samples in the negative pair loss function. In some embodiments of the present invention, τ is a hyperparameter used to adjust the loss function. For example, τ taking 0.07 can make the output of the model smoother.

[0100] Specifically, for the vector representation of the jth sample in modality v, take it as the anchor sample, and then enumerate all samples in modality a as negative samples, including the vector representation of the kth sample in modality a. In this way, we can calculate the anchor sample under the projection from modality v to modality a. and negative samples The goal of this loss is to make the projections of modality v and modality a in the same input instance as close as possible, while the projections of different input instances are as far apart as possible.

[0101] The calculation formula of sim(·) is as follows, which represents the dot product between the L2-normalized vectors a and v (i.e. Cosine similarity function):

[0102]

[0103] Finally, the total loss accumulated over the entire training batch is calculated as follows:

[0104]

[0105] The loss under the projection from modality v to modality a and the loss under the projection from modality a to modality v are added together as the total loss function. This can encourage the representations between modalities to be close to each other to better represent multimodal data.

[0106] Step S03: Obtain a fusion feature F of the projected video feature and the projected audio feature according to the contrastive learning model, and input the fusion feature F corresponding to at least one video information into N base classifiers for training, to obtain a multi-classifier weighted voting model for outputting the behavior type result with the highest probability, wherein the behavior type result includes dangerous and non-dangerous.

[0107] It should be noted that after the feature vectors of the two modalities are compared and learned, the feature vector output from the encoder is , It is an abstract representation of the behavior, which contains some abstract features of the behavior. In this case, the action feature can provide information about body posture, motion state, etc., while the audio feature can provide information about environmental noise, etc. The purpose of fusing these two features is to complement their advantages and improve the accuracy and robustness of behavior recognition.

[0108] The video features output from the encoder and audio features To perform fusion, the visual and audio features are weighted and added using the weighted average method. Each feature vector is given a weight coefficient to indicate the contribution of the feature to the final feature vector.

[0109] Assume that the video feature vector output by the contrastive learning model is , the audio feature vector is , then the fusion feature F is calculated according to the following formula:

[0110]

[0111] Among them, α represents the weight coefficient of video features, 1-α represents the weight coefficient of audio features, and their sum should be 1. In some embodiments, since video features have higher relevance and greater contribution than audio features, assigning a larger weight to video features can make the fused features better reflect the task requirements, thereby improving the performance of the task. For example, the weight coefficient α is set to 0.7, that is, the weight of action features accounts for 70%, the weight of audio features accounts for 30%, and weighted average is used for feature fusion.

[0112] It should also be noted that the dangerous behavior recognition result can be regarded as a binary classification problem, and the classification result is to predict whether the behavior is dangerous or not. This application uses the voting method to solve this problem. The voting method is a commonly used integration method, which is implemented by linearly combining the voting results of multiple base classifiers. Generally speaking, the combined classifier reduces the error of a single classifier and has better performance than a single classifier.

[0113] In some embodiments, see Figure 3 , which is a schematic diagram of the structure of the multi-classifier weighted voting model. The construction process is as follows:

[0114] First, a training set is constructed based on the fusion feature F corresponding to at least one video information. , where F j represents the fusion feature corresponding to the jth video information, express The category it belongs to, 0 and 1 represent no danger and danger respectively, D is the dimension of the sample space, and k is the number of video information;

[0115] The training set X is input into N base classifiers for training. After training, the class probabilities of each base classifier are output respectively and used represents the probability that the classification category of the nth classifier is i, where i ∈ (dangerous, non-dangerous);

[0116] According to the performance of each base classifier, the initial weight is assigned. represents the initial weight of the nth base classifier, and the initial weight is optimized based on the class probability, and the trained base classifiers are linearly weighted combined according to the optimized initial weight to obtain the multi-classifier weighted voting model.

[0117] In the test phase, the test sample F is input, and the model outputs the probability of predicting category i , and according to the probability of the output Get its final predicted category y.

[0118]

[0119]

[0120] In order to minimize the error rate, the base classifiers should be unrelated and have independent errors. In some embodiments of the present invention, the classic logistic regression model and the SVM model with excellent performance in classification problems are selected as the base classifiers.

[0121] In addition, weighted voting is a more common decision fusion method. The voting method is more suitable for situations where the models in decision fusion are independent of each other. The overall idea of ​​voting is to integrate the choices of voters to obtain a generally correct result.

[0122] Assume that there are N output results that are linearly combined to represent the voting method, is the output of classifier n predicting that the category of fused feature F is i, then the voting result of fused feature F for category i is:

[0123]

[0124] in, , w represents the weight vector, but at this time , if classifier n predicts x to be of category i, then ,otherwise , this only outputs the final category, and the predicted probability of each category cannot be obtained;

[0125] Therefore, the initial weight coefficient is automatically adjusted by fusing the class probability output by the base classifier. represents the probability that the base classifier n predicts that x belongs to category i, It means the probability that the voting classifier finally predicts that x belongs to category i. The voting result can be expressed as:

[0126]

[0127] It represents the probability that the multi-classifier weighted voting model predicts that the fusion feature F belongs to category i, It indicates that the nth base classifier predicts the category of the fusion feature F as the output of i, and y indicates the predicted category. It means that the category with the highest probability is selected as the final result, that is, the category with the highest probability is selected as the final result (that is, the probability of danger or non-danger occurrence), so as to obtain the final classification category.

[0128] It should also be noted that after completing the construction of the multi-classifier weighted voting model, the real-time monitoring video is obtained, and the audio features and video features are extracted according to step S01, and then input into the constructed comparative learning model, and the fusion features are output. The fusion features are then input into the trained multi-classifier weighted voting model, and the classification results of the video with behavioral information can be accurately identified, and the classification results are dangerous or non-dangerous.

[0129] In summary, the present invention uses video and audio information extraction and fusion to improve the efficiency of group dangerous behavior identification. By adopting the method of multimodal contrastive learning and multi-classifier fusion, the information extracted from the visual modality and the auditory modality is contrasted and learned to obtain a multimodal feature representation, thereby identifying whether dangerous behavior has occurred. Multimodal fusion technology can provide more comprehensive and accurate information by combining features of different modalities (video and audio), and can improve prediction accuracy, robustness and adaptability; the contrastive learning method is applied to behavior classification tasks, which improves the ability to describe and distinguish behaviors, and the demand for labeled data can be reduced through unsupervised learning; the use of multi-classifier weighted voting method for fusion can improve the accuracy, stability and generalization ability of the model.

[0130] See also Figure 4 , which is a schematic diagram of the structure of a dangerous behavior identification system in a second embodiment of the present invention, and the system includes:

[0131] The feature extraction module 10 is used to obtain a historical surveillance video containing at least one video information segment, and perform video feature extraction and audio feature extraction on at least one video information segment to obtain a video feature segment. and audio features ;

[0132] Furthermore, the feature extraction module 10 also includes:

[0133] The video feature extraction unit is used to extract video features from the video information according to the following formula:

[0134]

[0135] in, is the input video information, whose dimension is (c, V, T), c represents the number of channels, V is the number of nodes, and T is the number of frames. Indicates whether there is an edge connecting nodes i and j. If yes, 1 if yes, 0 if no, represents a diagonal matrix, represents symmetric normalization, represents the i-th eigenvalue in the diagonal matrix, W represents the weight matrix, represents the identity matrix, represents the value of the i-th row and j-th column in the identity matrix, Represents the output video features .

[0136] The audio feature extraction unit is used to pre-emphasize the video information according to the following formula:

[0137]

[0138] in, Indicates the output of the nth video information after pre-emphasis. represents the video information of the nth segment, xn-1 represents the video information of the n-1th segment, and a represents the pre-emphasis coefficient;

[0139] The pre-emphasized output is windowed according to the following formula:

[0140]

[0141] in, represents the value of the window function in the time domain, represents the windowed signal;

[0142] The windowed signal is Fourier transformed according to the following formula:

[0143]

[0144] represents the signal after Fourier transformation, and N represents the number of sampling points after windowing;

[0145] Mel filtering is performed on the Fourier transformed signal according to the following formula:

[0146]

[0147] in, is the frequency of the Mel filter, represents the signal after Mel filtering;

[0148] The discrete cosine transform of the Mel-filtered signal is performed according to the following formula:

[0149]

[0150] Where M represents the number of filters, L represents the order of MFCC coefficients, represents the signal after discrete cosine transformation;

[0151] Normalize the signal after discrete cosine transformation to obtain audio features .

[0152] Iterative training module 20 is used to train each sample Video features in and audio features All are encoded and projected in turn to obtain the projection video features and projected audio features , and according to the projection video features and the projected audio features Calculate the total loss value of the video modality and the audio modality, and perform iterative training according to the total loss value to obtain a contrastive learning model;

[0153] Furthermore, the iterative training module 20 also includes:

[0154] The encoding projection unit is used to encode the video features according to the following formula and audio features To encode and project:

[0155]

[0156]

[0157] Among them, E v (·) and E a (·) indicates encoding operation, P v (·) and P a (·) all represent projection operations;

[0158] Total loss calculation unit, used to convert Consider it as an anchor sample and enumerate other samples The loss obtained by expressing is:

[0159]

[0160] in, represents the contrast loss of the projection of the jth sample from the video modality to the audio modality, τ is the temperature parameter, N represents the number of samples other than the anchor sample, and sim(·) represents the similarity between samples;

[0161] The total loss is calculated according to the following formula:

[0162]

[0163] in, represents the contrastive loss of the projection of the j-th sample from the audio modality to the video modality.

[0164] The voting module constructs a module 30 for obtaining information about the projection video features according to the contrast learning model. and projected audio features The fusion feature F corresponding to at least one video information segment is input into N base classifiers for training to obtain a multi-classifier weighted voting model for outputting the behavior type result with the highest probability, wherein the behavior type result includes dangerous and non-dangerous.

[0165] Furthermore, the voting module construction module 30 also includes:

[0166] A fusion feature calculation unit is used to assume that the video feature vector output by the contrastive learning model is , the audio feature vector is , then the fusion feature F is calculated according to the following formula:

[0167]

[0168] Among them, α represents the weight coefficient of video features, and 1-α represents the weight coefficient of audio features;

[0169] A training set construction unit, configured to construct a training set according to the fusion feature F corresponding to the at least one video information segment , where F j represents the fusion feature corresponding to the jth video information, express The category it belongs to, 0 and 1 represent no danger and danger respectively, D is the dimension of the sample space, and k is the number of video information;

[0170] The class probability output unit is used to input the training set X into N base classifiers for training. After training, the class probability of each base classifier is output and used represents the probability that the classification category of the nth classifier is i, where i∈(dangerous, non-dangerous);

[0171] The weighted combination execution unit is used to assign initial weights according to the performance of each base classifier. represents the initial weight of the nth base classifier, and optimizes the initial weight based on the class probability, and performs linear weighted combination of the trained base classifiers according to the optimized initial weight to obtain the multi-classifier weighted voting model;

[0172] Furthermore, the weighted combination execution unit further includes:

[0173] The voting model construction execution unit is used to construct the multi-classifier weighted voting model according to the following formula:

[0174]

[0175] It represents the probability that the multi-classifier weighted voting model predicts that the fusion feature F belongs to category i, It indicates that the nth base classifier predicts the category of the fusion feature F as the output of i, and y indicates the predicted category. It means that the class with the highest probability is selected as the final result.

[0176] On the other hand, the present invention further provides a readable storage medium on which one or more programs are stored, and when the program is executed by a processor, the above-mentioned dangerous behavior identification method is implemented.

[0177] Another aspect of the present invention further provides a computer device, comprising a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory to implement the above-mentioned dangerous behavior identification method.

[0178] Those skilled in the art will appreciate that the logic and / or steps represented in the flowchart or otherwise described herein, for example, may be considered as an ordered list of executable instructions for implementing logical functions, and may be specifically implemented in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For purposes of this specification, "computer-readable medium" may be any device that can contain storage, communication, propagation or transmission of a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.

[0179] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.

[0180] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or a combination thereof: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0181] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0182] The above-described embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the present invention. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the attached claims.

Claims

1. A dangerous behavior identification method, characterized in that: The method comprises: Obtain a historical surveillance video containing at least one segment of video information, and perform video feature extraction and audio feature extraction on at least one segment of the video information to obtain video feature and audio features ; The method comprises obtaining a historical surveillance video including at least one segment of video information, and performing video feature extraction and audio feature extraction on at least one segment of the video information to obtain a video feature. and audio features The steps include: First, it is necessary to read the historical surveillance video and perform video preprocessing, including cropping, scaling, and background removal. Then, the preprocessed historical surveillance video with group behavior is segmented into at least one video information segment. Then, Openpose is used to lock the human target and extract the skeleton joint points. Then, the video frame with the skeleton point sequence information is input into the spatiotemporal graph convolutional network ST-GCN to extract the action behavior features. The ST-GCN network uses an adjacency matrix A Represents the connection relationship between the internal joints of the skeleton in a single frame, and uses a unit matrix I to represent the self-connection relationship between the joints in a single frame. The network output is: in, is the input video information, whose dimension is (c, V, T), c represents the number of channels, V is the number of nodes, and T is the number of frames. Representation Node i and nodes j Are there edges connecting them? If so, 1 if yes, 0 if no, represents a diagonal matrix, represents symmetric normalization, Represents the first i eigenvalues, W represents the weight matrix, I represents the identity matrix, Represents the identity matrix i Line j The value of the column, Represents the output video features ; For each sample Video features in and audio features All are encoded and projected in turn to obtain the projection video features and projected audio features , and according to the projection video features and the projected audio features Calculate the total loss value of the video modality and the audio modality, and perform iterative training according to the total loss value to obtain a contrastive learning model; For each sample Video features in and audio features All are encoded and projected in turn to obtain the projection video features and projected audio features , and according to the projection video features and the projected audio features The steps of calculating the total loss value of the video mode and the audio mode, and performing iterative training according to the total loss value to obtain the contrastive learning model include: The video features are calculated according to the following formula and audio features Encoding and projection: in, and Both represent encoding operations. and Both represent projection operations; Will Consider it as an anchor sample and enumerate other samples The loss obtained by expressing is: in, Indicates j The contrastive loss of the projection of samples from the video modality to the audio modality, is the temperature parameter, N represents the number of samples other than the anchor point samples, Indicates the similarity between samples; The total loss is calculated according to the following formula: in, Indicates j Contrastive loss for the projection of samples from the audio modality to the video modality; According to the contrastive learning model, the projection video features are obtained and projected audio features The fusion feature F corresponding to at least one video information segment is input into N base classifiers for training to obtain a multi-classifier weighted voting model for outputting the behavior type result with the highest probability, wherein the behavior type result includes dangerous and non-dangerous.

2. The dangerous behavior identification method according to claim 1, characterized in that: The method comprises obtaining a historical surveillance video including at least one segment of video information, and performing video feature extraction and audio feature extraction on at least one segment of the video information to obtain a video feature. and audio features The steps include: The video information is pre-emphasized according to the following formula: in, Indicates n The video information is pre-emphasized and then output. Indicates n Segment video information, Indicates The video information of the segment, a represents the pre-emphasis coefficient; The pre-emphasized output is windowed according to the following formula: in, represents the value of the window function in the time domain, represents the windowed signal; The windowed signal is Fourier transformed according to the following formula: represents the signal after Fourier transformation, N Indicates the number of sampling points after windowing; Mel filtering is performed on the Fourier transformed signal according to the following formula: in, is the frequency of the Mel filter, represents the signal after Mel filtering; The discrete cosine transform of the Mel-filtered signal is performed according to the following formula: in, M represents the number of filters, L Represents the order of MFCC coefficients, represents the signal after discrete cosine transformation; Normalize the signal after discrete cosine transformation to obtain audio features .

3. The dangerous behavior identification method according to claim 1, characterized in that: The projection video features are obtained according to the contrastive learning model and projected audio features The step of fusing features F also includes: Assume that the video feature vector output by the contrastive learning model is , the audio feature vector is , then the fusion feature F is calculated according to the following formula: in, Represents the video feature weight coefficient, 1- Represents the weight coefficient of the audio feature.

4. The dangerous behavior identification method according to claim 1, characterized in that: The step of obtaining a fusion feature F about the projected video feature and the projected audio feature according to the contrastive learning model, and inputting the fusion feature F corresponding to at least one video information into N base classifiers for training to obtain a multi-classifier weighted voting model for outputting a behavior type result with the highest probability, wherein the behavior type result includes dangerous and non-dangerous includes: Construct a training set based on the fusion feature F corresponding to the at least one video information ,in, Indicates j The fusion features corresponding to the video information, express The category it belongs to, 0 and 1 represent no danger and danger respectively. D is the dimension of the sample space, k is the amount of video information; The training set X Input to N After training, the class probabilities of each base classifier are output and used Indicates n The classification categories of the classifier are i The probability of i ∈(danger, no danger); According to the performance of each base classifier, the initial weight is assigned. Indicates n The initial weights of the base classifiers are obtained, and the initial weights are optimized based on the class probabilities. The trained base classifiers are linearly weighted combined according to the optimized initial weights to obtain the multi-classifier weighted voting model.

5. The dangerous behavior identification method according to claim 4, characterized in that: The steps of allocating initial weights according to the performance of each base classifier, using to represent the initial weight of the nth base classifier, optimizing the initial weights based on the class probabilities, and performing linear weighted combination of the trained base classifiers according to the optimized initial weights to obtain the multi-classifier weighted voting model include: The multi-classifier weighted voting model is constructed according to the following formula: Indicates that the multi-classifier weighted voting model predicts that the fusion feature F belongs to the category i The probability of Indicates n The category of the fusion feature F predicted by the base classifier is i The output, y represents the predicted category, It means that the class with the highest probability is selected as the final result.

6. A dangerous behavior identification system, characterized in that: The system comprises: The feature extraction module is used to obtain historical surveillance videos containing at least one video information, and perform video feature extraction and audio feature extraction on at least one video information to obtain video feature information. and audio features ; The method comprises obtaining a historical surveillance video including at least one segment of video information, and performing video feature extraction and audio feature extraction on at least one segment of the video information to obtain a video feature. and audio features The steps include: First, it is necessary to read the historical surveillance video and perform video preprocessing, including cropping, scaling, and background removal. Then, the preprocessed historical surveillance video with group behavior is segmented into at least one video information segment. Then, Openpose is used to lock the human target and extract the skeleton joint points. Then, the video frame with the skeleton point sequence information is input into the spatiotemporal graph convolutional network ST-GCN to extract the action behavior features. The ST-GCN network uses an adjacency matrix A Represents the connection relationship between the internal joints of the skeleton in a single frame, and uses a unit matrix I to represent the self-connection relationship between the joints in a single frame. The network output is: in, is the input video information, whose dimension is (c, V, T), c represents the number of channels, V is the number of nodes, and T is the number of frames. Representation Node i and nodes j Are there edges connecting them? If so, 1 if yes, 0 if no, represents a diagonal matrix, represents symmetric normalization, represents the first i eigenvalues, W represents the weight matrix, I represents the identity matrix, Represents the identity matrix i Line j The value of the column, Represents the output video features ; Iterative training module for each sample Video features in and audio features All are encoded and projected in turn to obtain the projection video features and projected audio features , and according to the projection video features and the projected audio features Calculate the total loss value of the video modality and the audio modality, and perform iterative training according to the total loss value to obtain a contrastive learning model; For each sample Video features in and audio features All are encoded and projected in turn to obtain the projection video features and projected audio features , and according to the projection video features and the projected audio features The steps of calculating the total loss value of the video mode and the audio mode, and performing iterative training according to the total loss value to obtain the contrastive learning model include: The video features are calculated according to the following formula and audio features Encoding and projection: in, and Both represent encoding operations. and Both represent projection operations; Will Consider it as an anchor sample and enumerate other samples The loss obtained by expressing is: in, Indicates j The contrastive loss of the projection of samples from the video modality to the audio modality, is the temperature parameter, N represents the number of samples other than the anchor point samples, Indicates the similarity between samples; The total loss is calculated according to the following formula: in, Indicates j Contrastive loss for the projection of samples from the audio modality to the video modality; The voting module constructs a module for obtaining information about the projection video features according to the contrastive learning model. and projected audio features The fusion feature F corresponding to at least one video information segment is input into N base classifiers for training to obtain a multi-classifier weighted voting model for outputting the behavior type result with the highest probability, wherein the behavior type result includes dangerous and non-dangerous.

7. A storage medium, characterized in that: include: The storage medium stores one or more programs, which, when executed by the processor, implement the dangerous behavior identification method as described in any one of claims 1-5.

8. A computer device, characterized in that: The computer device comprises a memory and a processor, wherein: The memory is used to store computer programs; When the processor is used to execute the computer program stored in the memory, the dangerous behavior identification method described in any one of claims 1-5 is implemented.