Video anomaly detection system, method, computer device and storage medium
By interactively integrating video and audio features in the video anomaly detection system and using text information alignment, the problems of low detection accuracy and modal asynchrony in the existing technology are solved, and more efficient video anomaly detection is achieved.
Patent Information
- Application Number
- CN202410949974.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-16
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2044-07-16
AI Technical Summary
Existing video anomaly detection methods have low detection accuracy under weakly supervised learning, and ignore the temporal correlation and modal asynchrony issues between video and audio information, resulting in low anomaly detection rates.
By building a video anomaly detection system, the cross-modal information interaction module is used to interactively fuse video features and audio features, and the text information alignment module is used to align features and calculate the similarity of multi-modal features to improve the accuracy of anomaly detection.
It improves the accuracy and detection capabilities of video anomaly detection, and can more effectively utilize the complementarity and correlation of video and audio information to quickly determine whether a video is an abnormal video.
Smart Images

Figure CN118485954B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision technology, and more specifically, to a video anomaly detection system, method, computer equipment and storage medium. Background Art
[0002] With the increasing popularity of surveillance cameras, video anomaly detection relying solely on human supervision is insufficient to meet the needs of practical applications. Therefore, the demand for efficient, accurate and automated video anomaly detection methods has increased rapidly in recent years. These methods are becoming increasingly important in various fields, including public safety and road monitoring. Video anomaly detection methods have important practical value for preventing potential threats and improving work efficiency. In addition, video anomaly detection methods based on strong supervision need to rely on a large amount of video frame-level annotation information, while unsupervised anomaly detection methods will lead to low anomaly detection rates, false detections and missed detections. Therefore, anomaly detection algorithms based on weak supervision have been favored by researchers.
[0003] However, under weakly supervised learning, since there is not enough labeled data to define anomalies, it is difficult for the network model to obtain a good feature representation of a video clip, which hinders the detection accuracy of the anomaly detection model. In addition, since most video anomaly detection works only focus on video information and ignore the corresponding audio information, and there is a modal asynchrony problem between video and audio information, the performance of the anomaly detection model is also limited.
[0004] At present, there are still many defects in the video anomaly detection method based on audio and video fusion. On the one hand, most of the current research methods simply splice or add the audio and video modal features, ignoring the temporal inconsistency of video and audio abnormal information, resulting in difficulties in fusion. For example, a normal scene in a video may be accompanied by abnormal sound, or an abnormal video may be accompanied by normal sound, which will make the fused feature representation inaccurate. On the other hand, in the video anomaly detection task, time series information plays an important role in identifying abnormal events, because abnormal events usually show different temporal behaviors from normal events. However, most of the existing research methods focus on a few key visual frames, while ignoring the temporal continuity and correlation of audio and video, which limits the ability of the anomaly detection model to detect abnormal events.
[0005] After searching, the Chinese patent application, application number 202410042500.5, published on May 28, 2024, discloses a video anomaly detection model training method and a video anomaly detection method. The training method includes obtaining a sample video frame sequence and a video anomaly detection model; the video anomaly detection model includes an appearance encoder, a motion encoder, a consistency fusion module and a decoder; inputting 0 to t-1 frames in the sample video frame sequence into the video anomaly detection model, and outputting a predicted frame of frame t; using a first loss function to perform convergence judgment on the predicted frame of frame t and the sample frame, and optimizing the model parameters; repeating the above video anomaly detection model prediction step and convergence judgment step until the first loss function converges, and the video anomaly detection model is trained. This scheme improves the prediction error of the anomaly, but does not take into account the interaction problem of video and audio in the sample video frame sequence, and the anomaly detection accuracy is not high. Summary of the invention
[0006] 1. Technical problems to be solved
[0007] In view of the problem of poor video anomaly detection accuracy in the prior art, the present invention provides a video anomaly detection system, method, computer device and storage medium, which interactively fuse video features and audio features, help to learn more video feature information, and make full use of text prompt information to make the output score of video anomaly segments higher, so as to quickly determine whether the video to be detected is an abnormal video, thereby effectively improving the video anomaly detection accuracy.
[0008] 2. Technical solution
[0009] The purpose of the present invention is achieved through the following technical solutions.
[0010] A video anomaly detection system, comprising: an input module, a feature extraction module, a cross-modal information interaction module, a text information alignment module, and an anomaly score calculation module;
[0011] The input module collects the video to be detected and inputs the video to be detected;
[0012] The feature extraction module extracts video features and audio features of the video to be detected;
[0013] The cross-modal information interaction module interacts with the video features and the audio features to obtain fusion features;
[0014] The text information alignment module collects text information, builds a text dictionary, and extracts text features from the text dictionary; performs convolution processing on the fused features to obtain multimodal features, aligns the multimodal features with the text features, constrains the multimodal features through the text features, and calculates the similarity between the multimodal features and the text features;
[0015] The anomaly score calculation module performs convolution processing on multimodal features to obtain high-level features, calculates anomaly scores through the high-level features, and determines whether the video to be detected is an abnormal video according to the anomaly score.
[0016] Furthermore, in the cross-modal information interaction module, the video features are input into the convolution layer to obtain spatial features and spatial correlation features; the video features are subjected to global average pooling to obtain the video global features;
[0017] The audio features are input into the convolution layer to obtain time series features and time series correlation features; the audio features are globally averaged pooled to obtain the audio global features.
[0018] Furthermore, the video features are guided by spatial features and temporal correlation features to obtain the video similarity matrix, which is expressed as:
[0019]
[0020] in, represents the video similarity matrix, V c1 Represents spatial features, A c2 Represents the time series correlation characteristics, T represents the transpose operation, d 1 represents the dimension of time series correlation features, softmax ()express softmax Activation function;
[0021] The audio similarity matrix is obtained by guiding the audio features through spatial correlation features and temporal features. The audio similarity matrix is expressed as:
[0022]
[0023] in, represents the audio similarity matrix, A c1 Represents the time series characteristics, V c2 Represents spatial association features, d 2 represents the dimension of spatial correlation features.
[0024] Furthermore, the video similarity matrix is guided by the audio global features and fused with the video features to obtain the enhanced video features. The enhanced video features are expressed as:
[0025]
[0026] in, X v represents the enhanced video features,F v Represents video features, W v represents the learnable parameters in the video features, A g Represents the global characteristics of audio;
[0027] The audio similarity matrix is guided by the video global features and fused with the audio features to obtain the enhanced audio features. The enhanced audio features are expressed as:
[0028]
[0029] in, X a represents the enhanced audio features, F a Represents audio features, W a represents the learnable parameters in the audio features, V g Represents the global features of the video;
[0030] The enhanced video features and enhanced audio features are connected in series to obtain the fusion features, which are expressed as:
[0031]
[0032] in, X represents the fusion feature, Concat Indicates a series connection.
[0033] Furthermore, the fused features are input into a multi-layer perceptron to obtain multimodal features, which are expressed as:
[0034]
[0035] Among them, X c Represents multimodal features, Dropout Represents the multi-layer perceptron Dropout operate, GELU ()express GELU Activation function, Conv1D Represents a convolutional layer.
[0036] Furthermore, in the text information alignment module, the multimodal features and the text features are clustered to obtain clustered multimodal features and clustered text features. Multiple clustered multimodal features constitute aggregated multimodal features, and multiple clustered text features constitute aggregated text features. The aggregated multimodal features and the aggregated text features are aligned to calculate the similarity between the aggregated multimodal features and the aggregated text features. The calculation formula is:
[0037]
[0038] Among them, S(G,G text ) represents the similarity between the aggregated multimodal features and the aggregated text features, G represents the aggregated multimodal features, G text represents the aggregated text features, i represents a natural number, K Indicates shared K Cluster centers, g i represents the multimodal features after clustering, Represents the text features after clustering.
[0039] Furthermore, the multimodal features are input into the multi-layer perceptron to obtain high-level features, and the high-level features are input into the causal convolution layer to calculate the abnormality score of the video to be detected. The calculation formula is:
[0040]
[0041] in, y i represents the abnormal score of the video to be detected, X e Represents high-level features, f t represents the causal convolutional layer, σ ()express sigmoid Activation function.
[0042] A video anomaly detection method comprises the following steps:
[0043] Constructing a video anomaly detection system as described above;
[0044] Collect the video to be detected, input the video to be detected, and extract the video features and audio features of the video to be detected;
[0045] Interact video features and audio features to obtain fusion features;
[0046] Collect text information, build a text dictionary, and extract text features from the text dictionary; perform convolution processing on the fused features to obtain multimodal features, align the multimodal features with the text features, constrain the multimodal features through the text features, and calculate the similarity between the multimodal features and the text features;
[0047] The multimodal features are convolved to obtain high-level features, and the anomaly score is calculated through the high-level features. The anomaly score is used to determine whether the video to be detected is an abnormal video.
[0048] A computer device comprises a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and the processor implements the above-mentioned method when executing the computer program.
[0049] A computer-readable storage medium stores a computer program, and the computer program executes the above method when executed by a processor.
[0050] 3. Beneficial effects
[0051] Compared with the prior art, the advantages of the present invention are:
[0052] (1) A video anomaly detection system, method, computer device and storage medium of the present invention construct a cross-modal information interaction module to interactively fuse video features and audio features using an attention mechanism, which helps to learn more video feature information, so that the video anomaly detection system can more effectively utilize the complementarity and correlation between video information and audio information, thereby improving the accuracy of video anomaly detection.
[0053] (2) A video anomaly detection system, method, computer device and storage medium of the present invention constructs a text information alignment module to perform feature alignment operations on text features and multimodal features, making full use of text prompt information to increase the output score of video anomaly segments, and can quickly determine whether the video to be detected is an abnormal video, thereby improving the accuracy of the video anomaly detection system.
[0054] (3) The video anomaly detection system, method, computer device and storage medium of the present invention input the fused video features and audio features into the anomaly scoring module. By aligning the constraints of the loss function and the multi-instance loss function, the video anomaly scoring module outputs a higher score, thereby effectively improving the anomaly detection capability of the video anomaly detection system. The system has strong practicality and wide applicability. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 This is a structural diagram of a video anomaly detection system according to an embodiment of the present invention;
[0056] Figure 2 This is a structural diagram of a cross-modal information interaction module according to an embodiment of the present invention;
[0057] Figure 3 This is a structural diagram of a text information alignment module according to an embodiment of the present invention. DETAILED DESCRIPTION
[0058] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.
[0059] Example
[0060] like Figure 1 As shown, a video anomaly detection system provided by this embodiment includes an input module, a feature extraction module, a cross-modal information interaction module, a text information alignment module, and an anomaly score calculation module.
[0061] Specifically in this embodiment, in the input module, the video to be detected is collected and input.
[0062] In the feature extraction module, the video features and audio features of the video to be detected are extracted. It should be noted that in this embodiment, the feature extraction module uses the pre-trained I3D network, C3D Network or ResNet In this embodiment, the video to be detected is divided into T Each segment includes a video segment and an audio segment. I3D The network extracts video segment features of the video segment. Specifically, randomly select k consecutive frames of video feature maps, using I3D The network extracts video segment features from the video segment, and the video segment features are expressed as:
[0063]
[0064] in, l Indicates video or audio. F v (l) Represents the characteristics of the video clip, i represents a natural number, i ={ 1 , 2 ,..., T}, T Indicates the number of video clips to be detected. Indicates i video clip features, R represents the vector space, H 1 represents the height of the video feature map, W 1 represents the width of the video feature map, C 1 represents the dimension of the video feature map.
[0065] In this embodiment, the pre-trained VGGish network is used to extract the audio segment features in the audio segment, and the audio segment features are expressed as:
[0066]
[0067] in, Fa (l) Represents the audio segment features, Indicates i audio clip features, H 2 represents the height of the audio feature map, W 2 represents the width of the audio feature map, C 2 represents the dimension of the audio feature map.
[0068] It is worth noting that in order to better capture the temporal dependency between the video segment features and the audio segment features, in this embodiment, the spatial average pooling operation is used to reshape the video segment features into video features, which can be expressed as: ,in, F v Represents the video feature. Similarly, the audio segment feature is reshaped into an audio feature using a spatial average pooling operation, which can be expressed as: ,in, F a Represents audio features.
[0069] In the cross-modal information interaction module, the video features and audio features are interacted to obtain fused features, and the fused features are convolved to obtain multimodal features. In this embodiment, in order to better locate important segments in video sequences and audio sequences, the correlation between different segments needs to be considered. It should be noted that in the process of video anomaly detection, including detecting video modality and audio modality, there is complementary information between different modalities, and in some cases, the correlation between different video segments cannot be represented by a single modality. For example, at night, the dark environment cannot effectively convey visual information, so audio information is needed for auxiliary judgment. Furthermore, in this embodiment, the information interaction between the video modality and the audio modality is realized through the cross-modal information interaction module, and the time correlation between the video modality and the audio modality is calculated.
[0070] like Figure 2 As shown in the figure, the video features are input into the convolution layer to obtain spatial features and spatial correlation features, and the video features are subjected to global average pooling to obtain video global features. The audio features are input into the convolution layer to obtain temporal features and temporal correlation features, and the audio features are subjected to global average pooling to obtain audio global features. Specifically, the video features are F v Input to two 2D convolutional layers with kernel size 3 Conv2D-C1 and Conv2D-C2 In order to obtain the spatial features after convolution output V c1 and spatial association features V c2 It should be noted that the spatial characteristics Vc1 and spatial association features V c2 The feature information contained is different. Spatial features V c1 Contains feature information related to the video, and is therefore used in the calculation of the video similarity matrix in the subsequent steps. Spatial correlation features V c2 Contains feature information related to audio, and is therefore used for the calculation of the audio similarity matrix in the subsequent step. At the same time, in order to effectively capture the global information of the entire video to be detected, in this embodiment, the video features are globally averaged pooled ( Global Average Pooling , GAP ) operation to obtain the global features of the video V g .
[0071] In this embodiment, the audio feature F a Including audio timing information, audio features F a It is a one-dimensional sequence used to represent the amplitude or spectrum information in time. Therefore, one-dimensional convolution can be used to perform audio features. F a This helps extract local features of the audio in the time dimension. F a Input to two one-dimensional convolutional layers with a kernel size of 3 Conv1D-C1 and Conv1D-C2 In order to obtain the temporal characteristics after convolution output A c1 and time series correlation features A c2 It should be noted that the timing characteristics A c1 and time series correlation features A c2 The feature information contained is different. Time series features A c1 Contains feature information related to the audio, and is therefore used in the calculation of the audio similarity matrix in the subsequent steps. A c2 Contains feature information related to the video, and is therefore used in the calculation of the video similarity matrix in the subsequent step. At the same time, in order to effectively capture the global information of the entire video to be detected, in this embodiment, the audio feature F a Perform global average pooling operation to obtain global audio features A g .
[0072] Furthermore, in this embodiment, through the spatial featureV c1 , time series correlation features A c2 Guide video features F v , we get the video similarity matrix, which is expressed as:
[0073]
[0074] in, represents the video similarity matrix, V c1 Represents spatial features, A c2 Represents the time series correlation characteristics, T represents the transpose operation, d 1 represents the dimension of time series correlation features, softmax ()express softmax Activation function;
[0075] By spatially associating features V c2 , Timing Characteristics A c1 Guide the audio features to obtain the audio similarity matrix, which is expressed as:
[0076]
[0077] in, represents the audio similarity matrix, A c1 Represents the time series characteristics, V c2 Represents spatial association features, d 2 represents the dimension of spatial correlation features.
[0078] In this embodiment, the global audio feature A g Guide the video similarity matrix and compare it with the video features F v After fusion, the enhanced video features are obtained. The enhanced video features are expressed as:
[0079]
[0080] in, X v represents the enhanced video features, F v Represents video features, W v represents the learnable parameters in the video features, A gRepresents the global characteristics of audio;
[0081] Through the global characteristics of the video V g Guide the audio similarity matrix and compare it with the audio features F a Fusion, to obtain enhanced audio features, the enhanced audio features are expressed as:
[0082]
[0083] in, X a represents the enhanced audio features, F a Represents audio features, W a represents the learnable parameters in the audio features, V g Represents the global characteristics of the video.
[0084] In this embodiment, the enhanced video feature and the enhanced audio feature are connected in series to obtain a fusion feature, and the fusion feature is expressed as:
[0085]
[0086] in, X represents the fusion feature, Concat Indicates a series connection. Thus, in this embodiment, the enhanced video features X v and enhanced audio features X a Serial connections can obtain more representative fusion feature representations.
[0087] In this embodiment, the video features are transformed into F v and audio features F a The fusion and mutual complementation of these two modal information helps to learn more video feature information, achieve more efficient information integration, and greatly improve the accuracy of video anomaly detection.
[0088] like Figure 3 As shown, in the text information alignment module, the fusion feature is obtained X Finally, in order to learn a higher level of feature representation, in this embodiment, the fusion feature X Input to a two-layer multilayer perceptron ( Multilayer Perceptron , MLP ), the output is the multimodal feature X c In this embodiment, each layer of the multi-layer perceptron MLPinclude Con1D Convolutional layer, GELU Activation function and Dropout operation, and each Conv1D After the convolutional layer is a GELU Activation function and Dropout Operation. Thus, the multimodal feature X c It can be expressed as:
[0089]
[0090] Among them, X c Represents multimodal features, Dropout Represents the multi-layer perceptron Dropout operate, GELU ()express GELU Activation function, Conv1D Represents a convolutional layer.
[0091] In the text information alignment module, for the extraction of text features, text information is first collected. For example, in this embodiment, the collected text information may be "abuse", "car accident", "explosion", etc. A text dictionary is constructed by collecting a large amount of text information. Specifically, Figure 3 As shown in the figure, first determine all possible abnormal event types based on the pre-trained data set, and record the total number of abnormal event types as N , then the number of text dictionary items is N +1 for inclusion N In this embodiment, the existing XD-Violence Taking the data set as an example, XD-Violence The dataset contains 6 types of abnormal events. The text information of one of them, such as "abuse", is input into ConceptNet In the semantic network, text information with similar meanings to the text information is output, such as "torture", "bullying", etc., and the correlation scores between the text information are also output. Then, the text information with similar meanings to the text information is selected. M The text information with higher relevance scores is used as the key vector, and the relevance score is used as the value vector. The dictionary item of the abnormal event type "abuse" is constructed through the key vector and the value vector.
[0092] After obtaining the text dictionary, in this embodiment, the pre-trained BERT ( Bidirectional Encoder Representations from Transformers ) model extracts text features from the text dictionary. Specifically, for a given abnormal event type c , selects a set of key vectors from its text dictionary As a contextual reminder, the exception event type cwith the key vector in its text dictionary, i.e. M Type of abnormal event c Text information with similar meanings is entered into BERT Extracting text feature vectors from the model Finally, the average value of all text feature vectors is used as the prompt feature based on text information, that is, the text feature. In this embodiment, the text feature is expressed as:
[0093]
[0094] Among them, T c Represents text features, i , M All represent natural numbers, c Indicates the type of abnormal event. In this embodiment, the text feature combines the correlation between various types of events, which can effectively promote the semantic enhancement of video features and audio features.
[0095] Therefore, in the text information alignment module, after obtaining the multimodal features and the text features, the multimodal features and the text features are clustered to obtain the clustered multimodal features and the clustered text features. Multiple clustered multimodal features constitute an aggregated fusion feature. Multiple clustered text features constitute an aggregated text feature. The aggregated multimodal features and the aggregated text features are aligned to calculate the similarity of the aggregated multimodal features and the aggregated text features. Specifically, the multimodal feature X c Input into the clustering space, where ,in, T represents the number of multimodal features, C Represents the multimodal feature dimension. Using the existing K-Means Clustering method performs clustering operation and obtains K Cluster Centers , calculate the multimodal features after clustering on each cluster center, the calculation formula is:
[0096]
[0097] in, g i represents the multimodal features after clustering, nor express L 2 Normalization operation, i , k All represent natural numbers, T represents the number of multimodal features, exp represents the exponential function, K Indicates shared K Cluster centers, Indicatesi Multimodal features, c i represents the i-th cluster center, Indicates i The transpose of the cluster centers, b i represents the learnable training weights, represents the transpose of the kth cluster center, b k Represents a learnable parameter. Thus, multiple clustered multimodal features are represented as aggregated multimodal features G , ,in, g 1 represents the multimodal features after the first clustering, g 2 represents the multimodal features after the second clustering. g K Indicates K Multimodal features after clustering.
[0098] Furthermore, the text features Input into the clustering space, using the obtained K Clustering is performed using cluster centers, and the text features after clustering are calculated in the same way. The text features after clustering are expressed as:
[0099]
[0100] in, represents the text features after clustering, Represents any text feature. Thus, multiple clustered text features are represented as aggregated text features G text , ,in, Represents the text features after the first clustering, Represents the text features after the second clustering, Indicates K The text features after clustering.
[0101] In this embodiment, due to the multimodal characteristics of aggregation G and the aggregated text features G text Share the same set of cluster centers, so the aggregated multimodal features can be G and the aggregated text features G text Perform alignment operations to better align multimodal features with text features so as to better constrain the output results of the video anomaly detection system. Use Euclidean distance to calculate the aggregated multimodal features. G and the aggregated text features G text The similarity is calculated as:
[0102]
[0103] Among them, S(G,G text ) represents the similarity between the aggregated multimodal features and the aggregated text features, G represents the aggregated multimodal features, G text represents the aggregated text features, i represents a natural number, K Indicates shared K Cluster centers, g i represents the multimodal features after clustering, Represents the text features after clustering.
[0104] Therefore, by constructing a text information alignment module, the text features are aligned with the multimodal features, and the text prompt information is fully utilized to make the output score of the video abnormal clips higher, thereby improving the detection accuracy of the video anomaly detection system.
[0105] In this embodiment, for the aggregated multimodal features G and the aggregated text features G text The similarity of text information alignment loss is obtained through the existing KL ( Kullback-Leibler ) divergence is calculated using the following formula:
[0106]
[0107] in, L KL express KL Divergence loss function, E represents the expected probability, S i Represents the similarity score between the aggregated multimodal features and the aggregated text features, log S i represents the result after taking the logarithm of the similarity score. In this embodiment, the similarity score can be normalized to a smaller range to avoid being affected by extreme values. p Indicates the consistency tag, log p represents the result after taking the logarithm of the consistent label. In this embodiment, if the aggregated multimodal features G and the aggregated text features G text Aligned, then consistency label p =1, otherwise, the consistency label p =0.
[0108] In the abnormality score calculation module, the multimodal features are convolved to obtain high-level features, and the abnormality score is calculated by the high-level features. It is determined whether the video to be detected is an abnormal video based on the abnormality score. It should be noted that the abnormality score calculation module used in this embodiment is a prior art. Specifically, the multimodal feature X c Input to a multi-layer perceptron MLP Processing to obtain high-level features X e , the high-level feature X e Input into the causal convolutional layer to calculate the abnormal score of the video to be detected. The calculation formula is:
[0109]
[0110] in, y i represents the abnormal score of the video to be detected, X e Represents high-level features, f t represents the causal convolutional layer, σ ()express sigmoid Activation function. Thus, the anomaly score threshold is set α , after obtaining the anomaly score, if the anomaly score y i ≥ Anomaly score threshold α , then the video to be detected is an abnormal video; if the abnormal score y i <Anomaly score threshold α , then the video to be detected is a normal video. In this embodiment, the abnormal score threshold is set α is 0.7.
[0111] It should be noted that, in this embodiment, the causal convolution layer used needs to ensure that the current output result only depends on the current and previous input results, so as to better capture the temporal dependency between video features and audio features.
[0112] After obtaining the anomaly score of the video to be detected, use the predicted score k The average of the maximum scores As the abnormal score of the video to be detected, at the same time, the multi-instance based ( Multiple Instance Learning , MIL ) loss as the loss function, MIL The loss function is expressed as:
[0113]
[0114] in, L MIL represents the multi-instance loss function, y lrepresents the video-level label, N Indicates the number of videos.
[0115] Furthermore, during the training phase, the total loss function of the video anomaly detection system is expressed as:
[0116]
[0117] in, L represents the total loss function, Therefore, in this embodiment, the multimodal features are input into the anomaly scoring module, and through the constraints of the alignment loss function and the multi-instance loss function, the anomaly scoring module outputs a higher score for the abnormal segment and a lower score for the normal segment, thereby effectively improving the anomaly detection capability of the video anomaly detection system.
[0118] The present embodiment also provides a video anomaly detection method, comprising the following steps: constructing a video anomaly detection system as described above; collecting a video to be detected, and inputting the video to be detected, extracting video features and audio features of the video to be detected; interacting the video features and the audio features to obtain fusion features; collecting text information, constructing a text dictionary, and extracting text features in the text dictionary; performing convolution processing on the fusion features to obtain multimodal features, aligning the multimodal features and the text features, constraining the multimodal features through the text features, and calculating the similarity between the multimodal features and the text features; performing convolution processing on the multimodal features to obtain high-level features, calculating anomaly scores through the high-level features, and judging whether the video to be detected is an abnormal video according to the anomaly scores.
[0119] Therefore, the video anomaly detection method provided by this embodiment can more effectively utilize the complementarity and correlation between video information and audio information through the constructed video anomaly detection system to improve the accuracy of video anomaly detection. By performing feature alignment operations on text features and multimodal features, the text prompt information is fully utilized to make the output score of the video anomaly segment higher, and it is possible to quickly determine whether the video to be detected is an abnormal video, thereby improving the accuracy of the video anomaly detection system. In addition, by aligning the constraints of the loss function and the multi-instance loss function, the video anomaly scoring module outputs a higher score, effectively improving the anomaly detection capability of the video anomaly detection system, and having strong practicality and wide applicability.
[0120] This embodiment also provides a computer device. A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the video anomaly detection method when executing the computer program.
[0121] This embodiment also provides a computer-readable storage medium. A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, a video anomaly detection method described in this embodiment is executed. The computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, device or device; the program code contained on the computer-readable medium can be transmitted using any appropriate medium, including but not limited to wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0122] The above schematically describes the invention and its implementation methods, which is not restrictive. Without departing from the spirit or basic features of the invention, the invention can be implemented in other specific forms. What is shown in the accompanying drawings is only one of the implementation methods of the invention. The actual structure is not limited thereto, and any figure mark in the claims should not limit the claims involved. Therefore, if a person of ordinary skill in the art is inspired by it, without departing from the purpose of the invention, a structural method and an embodiment similar to the technical solution are designed without creativity, which should all belong to the protection scope of the present invention. In addition, the word "including" does not exclude other elements or steps, and the word "one" before the element does not exclude the inclusion of "multiple" elements. The multiple elements stated in the product claim can also be implemented by one element through software or hardware. The words first, second, etc. are used to indicate the name, and do not indicate any specific order.
Claims
1. A video anomaly detection system, characterized in that: include: Input module, feature extraction module, cross-modal information interaction module, text information alignment module, anomaly score calculation module; The input module collects the video to be detected and inputs the video to be detected; The feature extraction module extracts video features and audio features of the video to be detected; The cross-modal information interaction module interacts the video features and the audio features to obtain fusion features; in the cross-modal information interaction module, the video features are input into the convolution layer to obtain spatial features and spatial correlation features; the video features are subjected to global average pooling to obtain video global features; the audio features are input into the convolution layer to obtain temporal features and temporal correlation features; the audio features are subjected to global average pooling to obtain audio global features; the video features are guided by spatial features and temporal correlation features to obtain a video similarity matrix, and the video similarity matrix is expressed as: in, represents the video similarity matrix, V c1 Represents spatial features, A c2 Represents the time series correlation characteristics, T represents the transpose operation, d 1 represents the dimension of time series correlation features, softmax ()express softmax Activation function; The audio similarity matrix is obtained by guiding the audio features through spatial correlation features and temporal features. The audio similarity matrix is expressed as: in, represents the audio similarity matrix, A c1 Represents the time series characteristics, V c2 Represents spatial association features, d 2 represents the dimension of spatial correlation features; The video similarity matrix is guided by the audio global features and fused with the video features to obtain the enhanced video features. The enhanced video features are expressed as: in, X v represents the enhanced video features, F v Represents video features, W v represents the learnable parameters in the video features, A g Represents the global characteristics of audio; The audio similarity matrix is guided by the video global features and fused with the audio features to obtain the enhanced audio features. The enhanced audio features are expressed as: in, X a represents the enhanced audio features, F a Represents audio features, W a represents the learnable parameters in the audio features, V g Represents the global features of the video; The enhanced video features and enhanced audio features are connected in series to obtain the fusion features, which are expressed as: in, X represents the fusion feature, Concat Indicates a series connection; The text information alignment module collects text information, builds a text dictionary, and extracts text features from the text dictionary; performs convolution processing on the fused features to obtain multimodal features, aligns the multimodal features with the text features, constrains the multimodal features through the text features, calculates the similarity between the multimodal features and the text features, and calculates the similarity through KL divergence to obtain an alignment loss function; The anomaly score calculation module performs convolution processing on multimodal features to obtain high-level features, obtains anomaly scores through high-level feature calculation, and calculates the anomaly scores based on multi-instance loss to obtain a multi-instance loss function; constrains the anomaly scores output by the anomaly score calculation module through the alignment loss function and the multi-instance loss function, and determines whether the video to be detected is an abnormal video according to the anomaly score.
2. A video anomaly detection system according to claim 1, characterized in that: The fusion features are input into the multi-layer perceptron to obtain multimodal features. The multimodal features are expressed as: Among them, X c Represents multimodal features, Dropout Represents the multi-layer perceptron Dropout operate, GELU ()express GELU Activation function, Conv1D Represents a convolutional layer.
3. A video anomaly detection system according to claim 2, characterized in that: In the text information alignment module, the multimodal features and the text features are clustered to obtain clustered multimodal features and clustered text features. Multiple clustered multimodal features constitute aggregated multimodal features, and multiple clustered text features constitute aggregated text features. The aggregated multimodal features and the aggregated text features are aligned to calculate the similarity between the aggregated multimodal features and the aggregated text features. The calculation formula is: Among them, S(G,G text ) represents the similarity between the aggregated multimodal features and the aggregated text features, G represents the aggregated multimodal features, G text represents the aggregated text features, i represents a natural number, K Indicates shared K Cluster centers, g i represents the multimodal features after clustering, Represents the text features after clustering.
4. A video anomaly detection system according to claim 3, characterized in that: The multimodal features are input into the multi-layer perceptron to obtain high-level features, and the high-level features are input into the causal convolution layer to calculate the abnormality score of the video to be detected. The calculation formula is: in, y i represents the abnormal score of the video to be detected, X e Represents high-level features, f t represents the causal convolutional layer, σ ()express sigmoid Activation function.
5. A video anomaly detection method, comprising the following steps: Constructing a video anomaly detection system based on any one of claims 1-4; Collect the video to be detected, input the video to be detected, and extract the video features and audio features of the video to be detected; Interact video features and audio features to obtain fusion features; In the cross-modal information interaction module, the video features are input into the convolution layer to obtain spatial features and spatial correlation features; the video features are subjected to global average pooling to obtain video global features; the audio features are input into the convolution layer to obtain temporal features and temporal correlation features; the audio features are subjected to global average pooling to obtain audio global features; the video features are guided by spatial features and temporal correlation features to obtain the video similarity matrix, which is expressed as: in, represents the video similarity matrix, V c1 Represents spatial features, A c2 Represents the time series correlation characteristics, T represents the transpose operation, d 1 represents the dimension of time series correlation features, softmax ()express softmax Activation function; The audio similarity matrix is obtained by guiding the audio features through spatial correlation features and temporal features. The audio similarity matrix is expressed as: in, represents the audio similarity matrix, A c1 Represents the time series characteristics, V c2 Represents spatial association features, d 2 represents the dimension of spatial correlation features; The video similarity matrix is guided by the audio global features and fused with the video features to obtain the enhanced video features. The enhanced video features are expressed as: in, X v represents the enhanced video features, F v Represents video features, W v represents the learnable parameters in the video features, A g Represents the global characteristics of audio; The audio similarity matrix is guided by the video global features and fused with the audio features to obtain the enhanced audio features. The enhanced audio features are expressed as: in, X a represents the enhanced audio features, F a Represents audio features, W a represents the learnable parameters in the audio features, V g Represents the global features of the video; The enhanced video features and enhanced audio features are connected in series to obtain the fusion features, which are expressed as: in, X represents the fusion feature, Concat Indicates a series connection; Collect text information, build a text dictionary, and extract text features from the text dictionary; perform convolution processing on the fused features to obtain multimodal features, align the multimodal features with the text features, constrain the multimodal features through the text features, calculate the similarity between the multimodal features and the text features, and calculate the similarity through KL divergence to obtain the alignment loss function; The multimodal features are convolved to obtain high-level features, and the anomaly score is calculated through the high-level features. The anomaly score is calculated based on the multi-instance loss to obtain the multi-instance loss function. The anomaly score output by the anomaly score calculation module is constrained by the alignment loss function and the multi-instance loss function, and whether the video to be detected is an abnormal video is determined according to the anomaly score.
6. A computer device comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, characterized in that: When the processor executes the computer program, the method according to claim 5 is implemented.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to claim 5 is performed.
