A method for identifying abnormal target behavior based on multi-channel video stream analysis
Through the multi-channel video stream analysis method and the target detection algorithm, the video stream data is extracted and characterized by multi-color channels and optical flow frames, which solves the problem of high-dimensional feature extraction of video data in the existing technology and improves the identification of abnormal target behaviors. accuracy and robustness.
Patent Information
- Application Number
- CN202410147777.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-02
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2044-02-02
AI Technical Summary
Existing technology is challenging to extract effective information from high-dimensional features in video data, and it is difficult to achieve accurate identification and robustness of abnormal target behaviors.
The multi-channel video stream analysis method is used to extract multi-color channels and optical flow frames from the video stream data by combining the target detection algorithm, self-attention weight calculation and weighted coding are performed, and the feature vector sequence of the multi-channel frames and optical flow frames is constructed, based on This information is used for temporal feature representation and abnormal behavior discrimination.
It improves the accuracy and robustness of abnormal target behavior recognition, reduces the loss of computing resources, and achieves effective recognition of target behavior in video stream data.
Smart Images

Figure CN118247696B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of abnormal behavior recognition, and in particular to a target abnormal behavior recognition method for multi-channel video stream analysis. Background Art
[0002] With the rapid development of video surveillance technology, a large amount of video data is widely collected and recorded. Using these video data for target behavior analysis and anomaly detection has important application value, such as security monitoring, traffic management, intelligent video analysis, etc. Although many studies have been devoted to the recognition of abnormal target behavior, there are still some problems. Video data usually has high-dimensional features, including the appearance, movement, trajectory and other aspects of the target. How to extract effective information from these high-dimensional features is a challenging problem. To address this problem, the present invention proposes a target abnormal behavior recognition method for multi-channel video stream analysis, which enhances the accuracy and robustness of target abnormal behavior recognition by fusing information from multiple channels, timely discovers and warns of abnormal behavior of the target, and improves safety and monitoring effects. Summary of the invention
[0003] In view of this, the present invention provides a method for identifying abnormal behavior of a target by analyzing a multi-channel video stream, the purpose of which is to: 1) extract channel frames and optical flow frames of multiple color channels from video stream data in combination with a target detection algorithm, improve the accuracy of identifying abnormal behavior of the target based on the feature information of multiple channels and the optical flow information, perform self-attention weight calculation on the channel frames and the optical flow frames to obtain the weight values of the channel frames and the optical flow frames, implement weighted coding processing of the channel frames and the optical flow frames, implement dimensionality reduction of the channel frames and the optical flow frames, reduce the loss of computing resources, and obtain a multi-channel frame feature vector sequence and a flow feature vector sequence that characterize the channel information of the target in different colors and the motion optical flow information; 2) based on the similarity measurement results of the channel information and the difference of the motion optical flow information, calculate the time difference of the multi-channel frame feature vectors and the flow feature vectors corresponding to the adjacent video frame images, and construct a time feature vector that characterizes the time feature of the target in the video stream data, perform abnormal behavior discrimination on the behavior of the target in the video stream data based on the multi-channel information and the multi-dimensional information, and realize the recognition of abnormal behavior of the target based on the multi-channel and multi-dimensional information.
[0004] To achieve the above object, the present invention provides a method for identifying abnormal behavior of a target through multi-channel video stream analysis, comprising the following steps:
[0005] S1: Collect video stream data and perform target detection marking, divide the video stream data into channel frames and optical flow frames with target detection markings, and obtain channel frame sequences and optical flow frame sequences;
[0006] S2: Perform self-attention weight calculation on the segmented channel frame and optical flow frame to obtain weight values of the channel frame and the optical flow frame, wherein the multi-dimensional parameter-free attention mechanism is the main implementation method of the weight calculation;
[0007] S3: weighted encoding and feature extraction are performed on the segmented channel frames and optical flow frames to obtain a multi-channel frame feature vector sequence and a flow feature vector sequence;
[0008] S4: Performing time series feature representation on the multi-channel frame feature vector sequence and the stream feature vector sequence to obtain a time series feature vector;
[0009] S5: Construct an abnormal behavior recognition model to receive a multi-channel frame feature vector sequence, a stream feature vector sequence, and a time series feature vector, and output an abnormal behavior identification result. If the abnormal behavior identification result shows that an abnormal behavior exists, the behavior of the target in the corresponding video stream is used as the target abnormal behavior identification result.
[0010] As a further improvement method of the present invention:
[0011] Optionally, collecting video stream data and performing target detection marking in step S1 includes:
[0012] Collect video stream data, perform target detection on each video frame image in the video stream data, obtain the target detection result of each video frame image, mark the pixel area where the target is detected in the video frame image, and perform target detection marking on the video frame image where the target is detected, to obtain a video frame image sequence with target detection markings; in the embodiment of the present invention, the target detection algorithm model used is the Yolo model;
[0013] Combined with the target detection labeling results of the video frame images, the video stream data is divided into channel frames and optical flow frames with target detection labels to obtain channel frame sequences and optical flow frame sequences.
[0014] Optionally, in step S1, dividing the video stream data into channel frames and optical flow frames with target detection marks includes:
[0015] The video stream data is divided into channel frames and optical flow frames with target detection marks, where the video stream data segmentation process is:
[0016] S11: Extract a video frame image sequence with target detection marks from the video stream data in frame order:
[0017] in:
[0018] represents the nth video frame image with target detection mark, and N represents the total number of video frame images with target detection mark;
[0019] S12: graying the extracted video frame image with the target detection mark;
[0020] S13: extracting color values of multiple color channels from the extracted video frame image with the target detection mark;
[0021] S14: Construct channel frames of video frame images in different channels, wherein the video frame images The channel frames in different color channels are:
[0022] in:
[0023] Represents a video frame image In the color channel The channel frame, Sequentially indicate Color channels and grayscale channels;
[0024] Represents a video frame image Medium Pixels In the color channel The color value of
[0025] , , Indicates the number of pixel rows in the video frame image. Indicates the number of pixel columns of the video frame image;
[0026] S15: Based on the grayscale processing result, an optical flow frame of the video frame image is formed, wherein the video frame image The optical flow frame is:
[0027] in:
[0028] Represents a video frame image The corresponding optical flow frame;
[0029] Represents a video frame image Medium Pixels Optical flow information;
[0030] T stands for transpose;
[0031] Represents a video frame image Medium Pixels The gradient value of
[0032] represents a diagonal matrix;
[0033] In pixels centered In the pixel area, the pixel The gradient value of the jth neighborhood pixel;
[0034] Represents a video frame image Medium Pixels Gray value of
[0035] Represents the jth neighborhood pixel to pixel The Euclidean distance of
[0036] represents an exponential function with a natural constant as base;
[0037] Represents a video frame image Medium Pixels The gradient information of Represents a video frame image Medium Pixels The optical flow information, Represents a video frame image Medium Pixels Optical flow transformation information;
[0038] S16: The channel frame and optical flow frame area corresponding to the pixel area of the video frame image where the target is not detected are modified to 0 to form a channel frame sequence M and an optical flow frame sequence m of the video stream data:
[0039] in:
[0040] Represents a video frame image Channel frames in multiple color channels.
[0041] Optionally, in step S2, self-attention weight calculation is performed on the segmented channel frame and the optical flow frame to obtain weight values of the channel frame and the optical flow frame, including:
[0042] The self-attention weights of the channel frames and optical flow frames obtained by segmentation are calculated to obtain the weight values of the channel frames and optical flow frames. The multi-dimensional parameter-free attention mechanism is the main implementation method of the weight calculation, in which the channel frames And optical flow frame The self-attention weight calculation formula is:
[0043] in:
[0044] represents the adjustment coefficient;
[0045] Indicates channel frame The self-attention weight, Indicates channel frame The self-attention weights of the channel frames corresponding to different color channels in ;
[0046] Represents an optical flow frame The self-attention weight of
[0047] Indicates channel frame The variance of Indicates channel frame The mean of
[0048] Represents an optical flow frame The variance of Represents an optical flow frame The mean of .
[0049] Optionally, in step S3, weighted encoding and feature extraction are performed on the segmented channel frame and the optical flow frame respectively, including:
[0050] Based on the calculated weight values of the channel frame and the optical flow frame, the segmented channel frame and the optical flow frame are weighted encoded and feature extracted respectively to construct a multi-channel frame feature vector sequence and a flow feature vector sequence of the video stream data, where the channel frame And optical flow frame The weighted coding and feature extraction process is as follows:
[0051] Channel Frame And optical flow frame Perform weighted coding, where the weighted coding formula is:
[0052] in:
[0053] Indicates channel frame The weighted coding result is Represents an optical flow frame The weighted coding result of
[0054] Represents the weighted encoding results of channel frames of different color channels;
[0055] represents the convolutional encoding matrix of the channel frame, The convolutional encoding matrix representing the optical flow frame;
[0056] Perform feature extraction on the weighted coding results to form a video frame image The multi-channel frame feature vector and stream feature vector are as follows:
[0057] in:
[0058] Represents a video frame image Multi-channel frame feature vector of;
[0059] Represents a video frame image The flow feature vector of .
[0060] Optionally, constructing a multi-channel frame feature vector sequence and a stream feature vector sequence of video stream data in step S3 includes:
[0061] The multi-channel frame feature vector sequence and stream feature vector sequence of the video stream data are:
[0062] in:
[0063] A sequence of multi-channel frame feature vectors representing video stream data;
[0064] A sequence of stream feature vectors representing video stream data.
[0065] Optionally, in step S4, performing temporal feature representation on the multi-channel frame feature vector sequence and the stream feature vector sequence includes:
[0066] The multi-channel frame feature vector sequence and the stream feature vector sequence are represented by time series features to obtain time series feature vectors, wherein the time series feature representation process is as follows:
[0067] S41: Calculate and obtain the video frame image sequence The time interval between two adjacent video frame images in the video frame image and The time interval between ;
[0068] S42: Calculate the time sequence difference of the multi-channel frame feature vectors and the flow feature vectors corresponding to the adjacent video frame images, where the video frame images and The calculation formula for the timing difference of the corresponding multi-channel frame feature vector and stream feature vector is:
[0069] in:
[0070] Represents a video frame image and The timing difference of the corresponding multi-channel frame feature vector and stream feature vector;
[0071] Represents the control parameter, Set to 0.1;
[0072] represents the L1 norm;
[0073] S43: Constructing time series feature vector:
[0074] in:
[0075] Represents the time series feature vector.
[0076] Optionally, in step S5, the abnormal behavior recognition model is constructed to receive a multi-channel frame feature vector sequence, a stream feature vector sequence, and a time series feature vector, and output an abnormal behavior discrimination result, including:
[0077] Construct an abnormal behavior recognition model to receive multi-channel frame feature vector sequences , flow feature vector sequence And the time series feature vector , and perform abnormal behavior discrimination, and output abnormal behavior discrimination results. The abnormal behavior recognition model includes an input layer, a sequence mapping layer, a sequence fusion layer, and a recognition output layer. The abnormal behavior discrimination process based on the abnormal behavior recognition model is as follows:
[0078] S51: The input layer receives a sequence of multi-channel frame feature vectors , flow feature vector sequence And the time series feature vector ;
[0079] S52: Sequence mapping layer maps multi-channel frame feature vector sequences based on temporal feature vectors and the sequence of stream feature vectors Perform mapping processing, where the mapping processing formula is:
[0080] in:
[0081] They are respectively multi-channel frame feature vector sequences and the sequence of stream feature vectors The mapping processing result;
[0082] represents a multi-layer perceptron, represents the regularization layer;
[0083] S53: The sequence fusion layer performs fusion processing on the multi-channel frame feature vector sequence and the stream feature vector sequence after the mapping processing, wherein the fusion processing formula is:
[0084] in:
[0085] Indicates the fusion processing result;
[0086] represents the Hadamard product;
[0087] S54: The recognition output layer uses a fully connected matrix to perform convolution mapping on the fusion processing result to obtain the discrimination probability of abnormal behavior. If the discrimination probability is higher than a preset threshold, it is output that abnormal behavior exists;
[0088] According to the abnormal behavior identification result output by the abnormal behavior identification model, if the abnormal behavior identification result shows that abnormal behavior exists, the behavior of the target in the corresponding video stream is used as the target abnormal behavior identification result.
[0089] In order to solve the above problem, the present invention provides an electronic device, the electronic device comprising:
[0090] A memory storing at least one instruction;
[0091] Communication interface, enabling electronic equipment to communicate; and
[0092] The processor executes the instructions stored in the memory to implement the target abnormal behavior recognition method of multi-channel video stream analysis described above.
[0093] In order to solve the above problems, the present invention also provides a computer-readable storage medium, in which at least one instruction is stored. The at least one instruction is executed by a processor in an electronic device to implement the target abnormal behavior identification method of multi-channel video stream analysis described above.
[0094] Compared with the prior art, the present invention proposes a method for identifying target abnormal behavior by multi-channel video stream analysis, which has the following advantages:
[0095] First, this scheme proposes a feature extraction method for video stream data, which performs self-attention weight calculation on the channel frames and optical flow frames obtained by segmentation to obtain the weight values of the channel frames and optical flow frames, including: performing self-attention weight calculation on the channel frames and optical flow frames obtained by segmentation to obtain the weight values of the channel frames and optical flow frames, wherein the channel frames And optical flow frame The self-attention weight calculation formula is:
[0096] in: represents the adjustment coefficient; Indicates channel frame The self-attention weight of Represents an optical flow frame The self-attention weight of Indicates channel frame The variance of Indicates channel frame The mean of Represents an optical flow frame The variance of Represents an optical flow frame The mean of . Based on the calculated weight values of the channel frames and optical flow frames, the segmented channel frames and optical flow frames are weighted encoded and feature extracted respectively to construct a multi-channel frame feature vector sequence and a flow feature vector sequence of the video stream data. This scheme combines the target detection algorithm to perform channel frame extraction and optical flow frame extraction of multi-color channels on the video stream data, improves the accuracy of abnormal target behavior recognition based on the feature information of multiple channels and optical flow information, and performs self-attention weight calculation on the channel frames and optical flow frames to obtain the weight values of the channel frames and optical flow frames, implements weighted encoding processing of the channel frames and optical flow frames, realizes dimensionality reduction of the channel frames and optical flow frames, reduces the loss of computing resources, and obtains a multi-channel frame feature vector sequence and a flow feature vector sequence that represent the channel information of the target in different colors and the motion optical flow information.
[0097] At the same time, this scheme proposes a method for identifying abnormal target behavior, which constructs a multi-channel frame feature vector sequence and a stream feature vector sequence of video stream data as follows:
[0098] in: A sequence of multi-channel frame feature vectors representing video stream data; The stream feature vector sequence representing the video stream data. The multi-channel frame feature vector sequence and the stream feature vector sequence are represented by time series features to obtain a time series feature vector. The time series feature representation process is as follows: the video frame image sequence is calculated The time interval between two adjacent video frame images in the video frame image and The time interval between ; Calculate the time difference of multi-channel frame feature vectors and flow feature vectors corresponding to adjacent video frame images, where the video frame image and The calculation formula for the timing difference of the corresponding multi-channel frame feature vector and stream feature vector is:
[0099] in: Represents a video frame image and The timing difference of the corresponding multi-channel frame feature vector and stream feature vector; Represents the control parameter, Set to 0.1; Represents the L1 norm; constitutes the time series feature vector:
[0100] in: Represents a time series feature vector. Construct an abnormal behavior recognition model to receive a multi-channel frame feature vector sequence , flow feature vector sequence And the time series feature vector , and perform abnormal behavior discrimination, and output abnormal behavior discrimination results. Based on the similarity measurement results of channel information and the difference of motion optical flow information, this scheme calculates the time difference of multi-channel frame feature vectors and flow feature vectors corresponding to adjacent video frame images, and constructs a time feature vector that represents the time feature of the target in the video stream data. Based on multi-channel information and multi-dimensional information, the behavior of the target in the video stream data is discriminated for abnormal behavior, and the target abnormal behavior recognition based on multi-channel and multi-dimensional is realized. BRIEF DESCRIPTION OF THE DRAWINGS
[0101] Figure 1 A schematic diagram of a flow chart of a method for identifying abnormal target behavior by analyzing a multi-channel video stream according to an embodiment of the present invention;
[0102] Figure 2 A schematic diagram of the structure of an electronic device for implementing a method for identifying target abnormal behavior by analyzing multi-channel video streams provided by an embodiment of the present invention.
[0103] In the figure: 1 electronic device, 10 processor, 11 memory, 12 program, 13 communication interface.
[0104] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0105] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0106] The embodiment of the present application provides a method for identifying target abnormal behavior by multi-channel video stream analysis. The execution subject of the method for identifying target abnormal behavior by multi-channel video stream analysis includes but is not limited to at least one of the electronic devices such as a server and a terminal that can be configured to execute the method provided by the embodiment of the present application. In other words, the method for identifying target abnormal behavior by multi-channel video stream analysis can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc.
[0107] Embodiment 1:
[0108] S1: Collect video stream data and perform target detection marking, divide the video stream data into channel frames and optical flow frames with target detection markings, and obtain channel frame sequences and optical flow frame sequences.
[0109] The step S1 includes collecting video stream data and performing target detection marking, including:
[0110] Collect video stream data, perform target detection on each video frame image in the video stream data, obtain the target detection result of each video frame image, mark the pixel area where the target is detected in the video frame image, and perform target detection marking on the video frame image where the target is detected, to obtain a video frame image sequence with target detection markings; in the embodiment of the present invention, the target detection algorithm model used is the Yolo model;
[0111] Combined with the target detection labeling results of the video frame images, the video stream data is divided into channel frames and optical flow frames with target detection labels to obtain channel frame sequences and optical flow frame sequences.
[0112] In the step S1, the video stream data is divided into channel frames and optical flow frames with target detection marks, including:
[0113] The video stream data is divided into channel frames and optical flow frames with target detection marks, where the video stream data segmentation process is:
[0114] S11: Extract a video frame image sequence with target detection marks from the video stream data in frame order:
[0115] in:
[0116] represents the nth video frame image with target detection mark, and N represents the total number of video frame images with target detection mark;
[0117] S12: graying the extracted video frame image with the target detection mark;
[0118] S13: extracting color values of multiple color channels from the extracted video frame image with the target detection mark;
[0119] S14: Construct channel frames of video frame images in different channels, wherein the video frame images The channel frames in different color channels are:
[0120] in:
[0121] Represents a video frame image In the color channel The channel frame, Sequentially indicate Color channels and grayscale channels;
[0122] Represents a video frame image Medium Pixels In the color channel The color value of
[0123] , , Indicates the number of pixel rows in the video frame image. Indicates the number of pixel columns of the video frame image;
[0124] S15: Based on the grayscale processing result, an optical flow frame of the video frame image is formed, wherein the video frame image The optical flow frame is:
[0125] in:
[0126] Represents a video frame image The corresponding optical flow frame;
[0127] Represents a video frame image Medium Pixels Optical flow information;
[0128] T stands for transpose;
[0129] Represents a video frame image Medium Pixels The gradient value of
[0130] represents a diagonal matrix;
[0131] In pixels centered In the pixel area, the pixel The gradient value of the jth neighborhood pixel;
[0132] Represents a video frame image Medium Pixels Gray value of
[0133] Represents the jth neighborhood pixel to pixel The Euclidean distance of
[0134] represents an exponential function with a natural constant as base;
[0135] Represents a video frame image Medium Pixels The gradient information of Represents a video frame image Medium Pixels The optical flow information, Represents a video frame image Medium Pixels Optical flow transformation information;
[0136] S16: The channel frame and optical flow frame area corresponding to the pixel area of the video frame image where the target is not detected are modified to 0 to form a channel frame sequence M and an optical flow frame sequence m of the video stream data:
[0137] in:
[0138] Represents a video frame image Channel frames in multiple color channels.
[0139] S2: Perform self-attention weight calculation on the segmented channel frame and optical flow frame to obtain the weight values of the channel frame and the optical flow frame.
[0140] In the step S2, the self-attention weights are calculated for the segmented channel frames and optical flow frames to obtain weight values of the channel frames and optical flow frames, including:
[0141] The self-attention weights of the channel frames and optical flow frames obtained by segmentation are calculated to obtain the weight values of the channel frames and optical flow frames. The multi-dimensional parameter-free attention mechanism is the main implementation method of the weight calculation, in which the channel frames And optical flow frame The self-attention weight calculation formula is:
[0142] in:
[0143] represents the adjustment coefficient;
[0144] Indicates channel frame The self-attention weight, Indicates channel frame The self-attention weights of the channel frames corresponding to different color channels in ;
[0145] Represents an optical flow frame The self-attention weight of
[0146] Indicates channel frame The variance of Indicates channel frame The mean of
[0147] Represents an optical flow frame The variance of Represents an optical flow frame The mean of .
[0148] S3: weighted encoding and feature extraction are performed on the segmented channel frames and optical flow frames respectively to obtain a multi-channel frame feature vector sequence and a flow feature vector sequence.
[0149] In the step S3, weighted encoding and feature extraction are performed on the segmented channel frame and optical flow frame respectively, including:
[0150] Based on the calculated weight values of the channel frame and the optical flow frame, the segmented channel frame and the optical flow frame are weighted encoded and feature extracted respectively to construct a multi-channel frame feature vector sequence and a flow feature vector sequence of the video stream data, where the channel frame And optical flow frame The weighted coding and feature extraction process is as follows:
[0151] Channel Frame And optical flow frame Perform weighted coding, where the weighted coding formula is:
[0152] in:
[0153] Indicates channel frame The weighted coding result is Represents an optical flow frame The weighted coding result of
[0154] Represents the weighted encoding results of channel frames of different color channels;
[0155] represents the convolutional encoding matrix of the channel frame, The convolutional encoding matrix representing the optical flow frame;
[0156] Perform feature extraction on the weighted coding results to form a video frame image The multi-channel frame feature vector and stream feature vector are as follows:
[0157] in:
[0158] Represents a video frame image Multi-channel frame feature vector of;
[0159] Represents a video frame image The flow feature vector of .
[0160] The multi-channel frame feature vector sequence and stream feature vector sequence of the video stream data constructed in step S3 include:
[0161] The multi-channel frame feature vector sequence and stream feature vector sequence of the video stream data are:
[0162] in:
[0163] A sequence of multi-channel frame feature vectors representing video stream data;
[0164] A sequence of stream feature vectors representing video stream data.
[0165] S4: Perform time series feature representation on the multi-channel frame feature vector sequence and the stream feature vector sequence to obtain a time series feature vector.
[0166] In the step S4, the multi-channel frame feature vector sequence and the stream feature vector sequence are represented by time series features, including:
[0167] The multi-channel frame feature vector sequence and the stream feature vector sequence are represented by time series features to obtain time series feature vectors, wherein the time series feature representation process is as follows:
[0168] S41: Calculate and obtain the video frame image sequence The time interval between two adjacent video frame images in the video frame image and The time interval between ;
[0169] S42: Calculate the time sequence difference of the multi-channel frame feature vectors and the flow feature vectors corresponding to the adjacent video frame images, where the video frame images and The calculation formula for the timing difference of the corresponding multi-channel frame feature vector and stream feature vector is:
[0170] in:
[0171] Represents a video frame image and The timing difference of the corresponding multi-channel frame feature vector and stream feature vector;
[0172] Represents the control parameter, Set to 0.1;
[0173] represents the L1 norm;
[0174] S43: Constructing time series feature vector:
[0175] in:
[0176] Represents the time series feature vector.
[0177] S5: Construct an abnormal behavior recognition model to receive a multi-channel frame feature vector sequence, a stream feature vector sequence, and a time series feature vector, and output an abnormal behavior identification result. If the abnormal behavior identification result shows that an abnormal behavior exists, the behavior of the target in the corresponding video stream is used as the target abnormal behavior identification result.
[0178] In the step S5, the abnormal behavior recognition model is constructed to receive the multi-channel frame feature vector sequence, the stream feature vector sequence and the time series feature vector, and output the abnormal behavior discrimination result, including:
[0179] Construct an abnormal behavior recognition model to receive multi-channel frame feature vector sequences , flow feature vector sequence And the time series feature vector , and perform abnormal behavior discrimination, and output abnormal behavior discrimination results. The abnormal behavior recognition model includes an input layer, a sequence mapping layer, a sequence fusion layer, and a recognition output layer. The abnormal behavior discrimination process based on the abnormal behavior recognition model is as follows:
[0180] S51: The input layer receives a sequence of multi-channel frame feature vectors , flow feature vector sequence And the time series feature vector ;
[0181] S52: Sequence mapping layer maps multi-channel frame feature vector sequences based on temporal feature vectors and the sequence of stream feature vectors Perform mapping processing, where the mapping processing formula is:
[0182] in:
[0183] They are respectively multi-channel frame feature vector sequences and the sequence of stream feature vectors The mapping processing result;
[0184] represents a multi-layer perceptron, represents the regularization layer;
[0185] S53: The sequence fusion layer performs fusion processing on the multi-channel frame feature vector sequence and the stream feature vector sequence after the mapping processing, wherein the fusion processing formula is:
[0186] in:
[0187] Indicates the fusion processing result;
[0188] represents the Hadamard product;
[0189] S54: The recognition output layer uses a fully connected matrix to perform convolution mapping on the fusion processing result to obtain the discrimination probability of abnormal behavior. If the discrimination probability is higher than a preset threshold, it is output that abnormal behavior exists;
[0190] According to the abnormal behavior identification result output by the abnormal behavior identification model, if the abnormal behavior identification result shows that abnormal behavior exists, the behavior of the target in the corresponding video stream is used as the target abnormal behavior identification result.
[0191] Embodiment 2:
[0192] like Figure 2 , is a schematic diagram of the structure of an electronic device for implementing a method for identifying target abnormal behavior by analyzing multi-channel video streams provided by an embodiment of the present invention.
[0193] The electronic device 1 may include a processor 10 , a memory 11 , a communication interface 13 and a bus, and may also include a computer program stored in the memory 11 and executable on the processor 10 , such as a program 12 .
[0194] The memory 11 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a magnetic memory, a disk, an optical disk, etc. In some embodiments, the memory 11 may be an internal storage unit of the electronic device 1, such as a mobile hard disk of the electronic device 1. In other embodiments, the memory 11 may also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 1. Further, the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device. The memory 11 may not only be used to store application software and various types of data installed in the electronic device 1, such as the code of the program 12, etc., but also be used to temporarily store data that has been output or is to be output.
[0195] The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips, etc. The processor 10 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and executes or executes programs or modules stored in the memory 11 (such as the program 12 for realizing target abnormal behavior recognition of multi-channel video stream analysis), and calls data stored in the memory 11, so as to execute various functions of the electronic device 1 and process data.
[0196] The communication interface 13 may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device 1 and other electronic devices, and to achieve connection and communication between internal components of the electronic device.
[0197] The bus may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to realize connection and communication between the memory 11 and at least one processor 10, etc.
[0198] Figure 2 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 2 The structure shown does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.
[0199] For example, although not shown, the electronic device 1 may also include a power source (such as a battery) for supplying power to various components. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The electronic device 1 may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
[0200] Optionally, the electronic device 1 may further include a user interface, which may be a display, an input unit (such as a keyboard), or a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device. The display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device 1 and to display a visual user interface.
[0201] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.
[0202] The program 12 stored in the memory 11 in the electronic device 1 is a combination of multiple instructions. When running in the processor 10, it can achieve:
[0203] Collect video stream data and perform target detection marking, divide the video stream data into channel frames and optical flow frames with target detection markings, and obtain channel frame sequences and optical flow frame sequences;
[0204] The self-attention weights are calculated for the segmented channel frames and optical flow frames to obtain the weight values of the channel frames and optical flow frames;
[0205] The channel frames and optical flow frames obtained by segmentation are respectively weighted encoded and feature extracted to obtain a multi-channel frame feature vector sequence and a flow feature vector sequence;
[0206] Performing time series feature representation on the multi-channel frame feature vector sequence and the stream feature vector sequence to obtain a time series feature vector;
[0207] An abnormal behavior recognition model is constructed to receive a multi-channel frame feature vector sequence, a stream feature vector sequence, and a time series feature vector, and output an abnormal behavior identification result. If the abnormal behavior identification result shows that an abnormal behavior exists, the behavior of the target in the corresponding video stream is used as the target abnormal behavior identification result.
[0208] Specifically, the specific implementation method of the processor 10 for the above instructions can refer to Figure 1 to Figure 2 The description of the relevant steps in the corresponding embodiments will not be repeated here.
[0209] It should be noted that the serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages and disadvantages of the embodiments. And the terms "including", "comprising" or any other variants thereof in this article are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "including a ..." does not exclude the presence of other identical elements in the process, device, article or method including the element.
[0210] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0211] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for identifying abnormal behavior of a target by analyzing multi-channel video streams, characterized in that: The method comprises: S1: Collect video stream data and perform target detection marking, divide the video stream data into channel frames and optical flow frames with target detection markings, and obtain channel frame sequences and optical flow frame sequences; S2: Perform self-attention weight calculation on the segmented channel frame and optical flow frame to obtain the weight values of the channel frame and optical flow frame; S3: weighted encoding and feature extraction are performed on the segmented channel frames and optical flow frames to obtain a multi-channel frame feature vector sequence and a flow feature vector sequence; S4: Performing time series feature representation on the multi-channel frame feature vector sequence and the stream feature vector sequence to obtain a time series feature vector; S5: construct an abnormal behavior recognition model to receive a multi-channel frame feature vector sequence, a stream feature vector sequence, and a time series feature vector, and output an abnormal behavior identification result. If the abnormal behavior identification result shows that an abnormal behavior exists, the behavior of the target in the corresponding video stream is used as the target abnormal behavior identification result; The step S1 includes collecting video stream data and performing target detection marking, including: Collecting video stream data, and performing target detection on each video frame image in the video stream data to obtain the target detection result of each video frame image, marking the pixel area where the target is detected in the video frame image, and performing target detection marking on the video frame image where the target is detected to obtain a video frame image sequence with target detection markings; Combined with the target detection labeling results of the video frame images, the video stream data is divided into channel frames and optical flow frames with target detection labels to obtain channel frame sequences and optical flow frame sequences; In the step S1, the video stream data is divided into channel frames and optical flow frames with target detection marks, including: The video stream data is divided into channel frames and optical flow frames with target detection marks, where the video stream data segmentation process is: S11: Extract a video frame image sequence with target detection marks from the video stream data in frame order: ; in: represents the nth video frame image with target detection mark, and N represents the total number of video frame images with target detection mark; S12: graying the extracted video frame image with the target detection mark; S13: extracting color values of multiple color channels from the extracted video frame image with the target detection mark; S14: Construct channel frames of video frame images in different channels, wherein the video frame images The channel frames in different color channels are: ; in: Represents a video frame image In the color channel The channel frame, Sequentially indicate Color channels and grayscale channels; Represents a video frame image Medium Pixels In the color channel The color value of , , Indicates the number of pixel rows in the video frame image. Indicates the number of pixel columns of the video frame image; S15: Based on the grayscale processing result, an optical flow frame of the video frame image is formed, wherein the video frame image The optical flow frame is: ; in: Represents a video frame image The corresponding optical flow frame; Represents a video frame image Medium Pixels Optical flow information; T stands for transpose; Represents a video frame image Medium Pixels The gradient value of represents a diagonal matrix; In pixels centered In the pixel area, the pixel The gradient value of the jth neighborhood pixel; Represents a video frame image Medium Pixels Gray value of Represents the jth neighborhood pixel to pixel The Euclidean distance of represents an exponential function with a natural constant as base; Represents a video frame image Medium Pixels The gradient information of Represents a video frame image Medium Pixels The optical flow information, Represents a video frame image Medium Pixels Optical flow transformation information; S16: The channel frame and optical flow frame area corresponding to the pixel area of the video frame image where the target is not detected are modified to 0 to form a channel frame sequence M and an optical flow frame sequence m of the video stream data: ; in: Represents a video frame image Channel frames in multiple color channels; In the step S2, the self-attention weights are calculated for the segmented channel frames and optical flow frames to obtain weight values of the channel frames and optical flow frames, including: The self-attention weights are calculated for the segmented channel frames and optical flow frames to obtain the weight values of the channel frames and optical flow frames. And optical flow frame The self-attention weight calculation formula is: ; in: represents the adjustment coefficient; Indicates channel frame The self-attention weight, Indicates channel frame The self-attention weights of the channel frames corresponding to different color channels in ; Represents an optical flow frame The self-attention weight of Indicates channel frame The variance of Indicates channel frame The mean of Represents an optical flow frame The variance of Represents an optical flow frame The mean of In the step S3, weighted encoding and feature extraction are performed on the segmented channel frame and optical flow frame respectively, including: Based on the calculated weight values of the channel frame and the optical flow frame, the segmented channel frame and the optical flow frame are weighted encoded and feature extracted respectively to construct a multi-channel frame feature vector sequence and a flow feature vector sequence of the video stream data, where the channel frame And optical flow frame The weighted coding and feature extraction process is as follows: Channel Frame And optical flow frame Perform weighted coding, where the weighted coding formula is: ; in: Indicates channel frame The weighted coding result is Represents an optical flow frame The weighted coding result of Represents the weighted encoding results of channel frames of different color channels; represents the convolutional encoding matrix of the channel frame, The convolutional encoding matrix representing the optical flow frame; Perform feature extraction on the weighted coding results to form a video frame image The multi-channel frame feature vector and stream feature vector are as follows: ; in: Represents a video frame image Multi-channel frame feature vector of; Represents a video frame image The flow feature vector of The multi-channel frame feature vector sequence and stream feature vector sequence of the video stream data constructed in step S3 include: The multi-channel frame feature vector sequence and stream feature vector sequence of the video stream data are: ; in: A sequence of multi-channel frame feature vectors representing video stream data; A sequence of stream feature vectors representing video stream data; In the step S4, the multi-channel frame feature vector sequence and the stream feature vector sequence are represented by time series features, including: The multi-channel frame feature vector sequence and the stream feature vector sequence are represented by time series features to obtain time series feature vectors, wherein the time series feature representation process is as follows: S41: Calculate and obtain the video frame image sequence The time interval between two adjacent video frame images in the video frame image and The time interval between ; S42: Calculate the time sequence difference of the multi-channel frame feature vectors and the flow feature vectors corresponding to the adjacent video frame images, where the video frame images and The calculation formula for the timing difference of the corresponding multi-channel frame feature vector and stream feature vector is: ; in: Represents a video frame image and The timing difference of the corresponding multi-channel frame feature vector and stream feature vector; Represents the control parameter, Set to 0.1; represents the L1 norm; S43: Constructing time series feature vector: in: represents the time series feature vector; In the step S5, the abnormal behavior recognition model is constructed to receive the multi-channel frame feature vector sequence, the stream feature vector sequence and the time series feature vector, and output the abnormal behavior discrimination result, including: Construct an abnormal behavior recognition model to receive multi-channel frame feature vector sequences , flow feature vector sequence And the time series feature vector , and perform abnormal behavior discrimination, and output abnormal behavior discrimination results. The abnormal behavior recognition model includes an input layer, a sequence mapping layer, a sequence fusion layer, and a recognition output layer. The abnormal behavior discrimination process based on the abnormal behavior recognition model is as follows: S51: The input layer receives a sequence of multi-channel frame feature vectors , flow feature vector sequence And the time series feature vector ; S52: Sequence mapping layer maps multi-channel frame feature vector sequences based on temporal feature vectors and the sequence of stream feature vectors Perform mapping processing, where the mapping processing formula is: ; in: They are respectively multi-channel frame feature vector sequences and the sequence of stream feature vectors The mapping processing result; represents a multi-layer perceptron, represents the regularization layer; S53: The sequence fusion layer performs fusion processing on the multi-channel frame feature vector sequence and the stream feature vector sequence after the mapping processing, wherein the fusion processing formula is: ; in: Indicates the fusion processing result; represents the Hadamard product; S54: The recognition output layer uses a fully connected matrix to perform convolution mapping on the fusion processing result to obtain the discrimination probability of abnormal behavior. If the discrimination probability is higher than a preset threshold, it is output that abnormal behavior exists; According to the abnormal behavior identification result output by the abnormal behavior identification model, if the abnormal behavior identification result shows that abnormal behavior exists, the behavior of the target in the corresponding video stream is used as the target abnormal behavior identification result.
Citation Information
Patent Citations
Video action detection method based on scale attention hole convolution network
CN111611847A
Group abnormal behavior identification method and system based on multi-scale time information fusion
CN112016500A
