A method and device for detecting online sequential motion
Through the online temporal action detection method, one-dimensional convolution and long short-term memory network and other technologies are used to solve the problem of detecting the temporal relationship between video frames, achieve accurate screening and efficient detection of action clips, and are suitable for real-time video analysis.
Patent Information
- Application Number
- CN202011381164.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2020-07-21
- Filing Date
- 2020-12-01
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2040-12-01
AI Technical Summary
Existing video analysis technology is difficult to effectively detect the timing relationship between frames in the video, resulting in the inability to accurately distinguish the start and end times of actions, such as opening and closing doors, picking up and putting down, etc., affecting the accuracy of video segmentation and key paragraphs.
Using online time-series action detection method, through operations such as online one-dimensional convolution, long short-term memory network and boundary matching layer, video features are extracted in real time, candidate action clips are generated, and confidence scores are calculated to filter action clips and reduce redundant action clips. Improve recall rate.
It achieves accurate detection of video action clips, reduces redundant action clips, improves recall rate, and reduces calculation time under high real-time requirements. The number of parameters is less than traditional methods, and it is suitable for real-time video analysis.
Smart Images

Figure CN112434629B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer vision, and in particular to an online sequential motion detection method and an online sequential motion detection device. Background Art
[0002] As one of the subfields of Computer Vision, video analysis technology has developed rapidly in recent years. Prior to this, video analysis problems usually used manually set rules to find key points in the picture, and analyzed the gradient, optical flow and other information of the key point position changes through machine learning methods. Unlike two-dimensional images, videos are composed of a series of ordered frames, so they have an additional time dimension. If the sequence relationship of frames in the video is ignored and the video is only regarded as a collection of images, it is possible that problems such as opening and closing doors, picking up and putting down, etc., which must be solved by considering the order of frame association. Therefore, one of the focuses of video analysis is to learn the relationship between frames.
[0003] Temporal Action Proposal Generation in the field of video analysis can locate time segments that may contain specific human actions or events from unedited videos, and is suitable for scenarios such as video segmentation and selection of key video segments. In specific implementations, temporal action detection requires simultaneous analysis of the spatial content of the video on the image and the temporal relationship between the video at the frame level, and involves multiple steps such as video decoding, feature extraction, candidate action segment generation, and segment screening, making it a challenging problem that requires the integration of multiple methods and technologies. Summary of the invention
[0004] Embodiments of the present application provide an online sequential action detection method, an online sequential action detection apparatus, an online sequential action detection device, and a computer-readable medium.
[0005] In a first aspect, an online sequential action detection method is provided, the method comprising:
[0006] Acquire a video online and extract an initial feature vector for action detection from the video; perform candidate action segment generation processing to construct the candidate action segment based on the initial feature vector and generate a confidence score associated with the candidate action segment, wherein the confidence score represents the degree of match between the candidate action segment and a real action segment in the video; perform action segment screening processing to screen out redundant action segments from the candidate action segments and output a generated action segment;
[0007] Among them, in the candidate action segment generation process, at least one online one-dimensional convolution operation is performed based on the initial feature vector, and a basic feature vector is outputted at each time point; based on the basic feature vector, a timing evaluation process and a segment evaluation process are respectively performed, wherein, in the timing evaluation process, a single basic feature vector is received at each time point, and operations including a recurrent neural network are performed to generate a starting point probability sequence and an end point probability sequence of the candidate action segment at each time point; in the segment evaluation process, a preset number of the basic feature vectors generated at each time point are cumulatively received, and operations including sampling and convolution are performed to output a classification confidence vector and a regression confidence vector; based on the starting point probability sequence, the end point probability sequence, the classification confidence vector and the regression confidence vector, the confidence score is calculated.
[0008] The online temporal action detection method in the present application adopts lightweight online one-dimensional convolution, long short-term memory network and boundary matching layer and other operations, which can infer the probability of the current time point as the segment boundary as the real-time generation of the video stream, and examine the possibility of each time period with the current time as the end point as the segment interval. Compared with the prior art, the online temporal action detection method of the present application has a more accurate estimate of the confidence score of the candidate segment. In the actual application scenario of online temporal action detection, in order to control redundancy, when too many action segments cannot be generated at each time point t, fewer segments can be used to achieve a higher recall rate. On the other hand, compared with the (offline) boundary matching network (BMN) with a similar structure, the number of parameters of the online boundary matching network is less than one-tenth. In the case of high real-time requirements, the single-step calculation time of milliseconds can be achieved without relying on graphics card acceleration calculation, which is four to five times faster than the online boundary sensitive network of the benchmark method. Even in a platform with limited computing power, and in an end-to-end environment where features need to be extracted in real time based on the generated video stream and then action detection is performed, the online action detection method can also be used in application scenarios with finer granularity requirements in the time dimension.
[0009] In a possible implementation of the first aspect above, the online one-dimensional convolution operation includes: inputting the initial feature vector into a first feature buffer point by point in time, wherein the first feature buffer can store k initial feature vectors arranged point by point in time, and k is the size of the convolution kernel of the online one-dimensional convolution operation.
[0010] In a possible implementation of the first aspect above, the online one-dimensional convolution operation further includes: inputting the initial feature vector into the first feature buffer in the online one-dimensional convolution at a time point, and deleting the initial feature vector that is first placed in the first feature buffer to ensure that the first feature buffer stores the k initial feature vectors that are most recently input at a time point, where k is the size of the convolution kernel; the convolution kernel performs a convolution operation on the k initial feature vectors in the first feature buffer, and obtains the basic feature vector as an output result.
[0011] In a possible implementation of the first aspect above, in the timing evaluation processing, it includes: receiving a single basic feature vector at each time point, and performing operations including a recurrent neural network, wherein the recurrent neural network processes the current basic feature vector in combination with the result of processing the basic feature vector at the previous time point.
[0012] In a possible implementation of the first aspect, the time series evaluation process further includes: the recurrent neural network is a long short-term memory network; the long short-term memory network receives a single basic feature vector at each time point, and the original hidden state h obtained by the long short-term memory network at the previous time point t-1 and original cell state c t-1 , and based on the basic feature vector, the original hidden state h t-1 and the original cell state c t-1 Calculate and output the current new hidden state h t ; The new hidden state h is t Input the fully connected layer, and output the starting point probability sequence and the end point probability sequence through the activation function, where the starting point probability is the starting point probability p of the candidate segment from time point t. s,t The endpoint probability is composed of the time point t as the endpoint probability p of the candidate segment e,t composition.
[0013] In a possible implementation of the first aspect above, the method further includes: setting the initial hidden state h0 and the initial cell state c0 to 0.
[0014] In a possible implementation of the first aspect above, in the segment evaluation process, the basic feature vector is input into a second feature buffer point by point in time, wherein the second feature buffer accumulates, receives and stores a preset number of the basic feature vectors generated point by point in time.
[0015] In a possible implementation of the first aspect, the segment evaluation process further includes: a second feature buffer accumulates and receives a preset number of basic feature vectors at each time point, and saves them as a basic feature sequence SF ∈R C ×D ; The basic feature sequence and sampling weight matrix W∈R N×D Input the boundary matching layer for point multiplication, and obtain and output the boundary matching matrix M∈R with the end point t as the end point, the time region length from 1 to D and the sampling time length N. C×N ; Input the boundary matching matrix into a convolutional neural network including at least one layer to perform a convolution operation, and output the classification confidence vector M cc ∈R D and the regression confidence vector M cr ∈R D ;
[0016] Wherein, C represents the number of channels of the basic feature vector, D represents the length of the longest candidate action segment in the basic feature sequence, and the sampling weight matrix represents the basic feature sequence S F The weight within the sampling time N, M cc represents the probability of whether the candidate action segment with a length of 1 to D and the current time as the end point is an action segment, M cr It represents the probability that the candidate action segment with a length of 1 to D and ending at the current time is close to the real action segment.
[0017] In a possible implementation of the first aspect above, the at least one layer of convolutional neural network may include four convolutional layers, wherein the first layer is a two-dimensional convolutional layer, which acts on the two dimensions of the sampling duration N and the length D of the boundary matching matrix to integrate the information of each sampling point; the second and fourth layers are both one-dimensional convolutional layers, which act on the dimension of the length D to integrate the information of each channel; the third layer is a one-dimensional convolutional layer, which acts on the dimension of the length D to integrate the information of adjacent fragment lengths.
[0018] In a possible implementation of the first aspect, constructing the candidate segments further includes: determining that time point t is a candidate action starting point, adding the time point t of the candidate action starting point to a candidate action starting point list; determining that time point t is a candidate action ending point, selecting the candidate starting point that can form a candidate action segment with a length less than a maximum length D from the candidate action starting point list with time point t, and outputting a set of the candidate action segments. Among them, φ i represents the i-th candidate action segment, N c represents the number of candidate action segments, t s,i represents the starting time of the i-th candidate action segment.
[0019] In a possible implementation of the first aspect, the confidence score of the candidate action segment is calculated by the following formula:
[0020]
[0021] Among them, tt s,i +1 indicates that the candidate action segment φ i The length, p s,t and p e,t They represent the probability of time point t being the starting point and the end point of the candidate action segment, respectively. cc,t represents the probability of whether the candidate action segment with a length of 1 to D and ending at time point t is an action segment, M cr,t It represents the probability that the candidate action segment with a length of 1 to D and ending at time point t is close to the real action segment.
[0022] In a possible implementation of the first aspect above, the initial feature vector includes time series structure information.
[0023] In a second aspect, an online sequential action detection device is provided, comprising: a video acquisition unit, used to acquire a video online and extract an initial feature vector for action detection from the video; a candidate action segment generation unit, used to construct the candidate action segment based on the initial feature vector, and generate a confidence score associated with the candidate action segment according to the candidate action segment and the corresponding real action segment in the video, wherein the confidence score indicates the matching degree between the candidate action segment and the real action segment in the video; an action segment screening unit, used to screen out redundant action segments from the candidate action segments and output a generated action segment;
[0024] Among them, in the candidate action segment generation unit, the online one-dimensional convolution operation subunit is used to perform at least one online one-dimensional convolution operation based on the initial feature vector, and output a basic feature vector at each time point; the basic feature vector is respectively input into the timing evaluation subunit and the segment evaluation subunit for operation, wherein the timing evaluation subunit is used to receive a single basic feature vector at each time point, and perform operations including a recurrent neural network to generate a starting point probability sequence and an end point probability sequence of the candidate action segment at each time point; the segment evaluation subunit is used to cumulatively receive a preset number of the basic feature vectors generated at each time point, and perform operations including sampling and convolution to output a classification confidence vector and a regression confidence vector; the confidence score calculation subunit is used to calculate the confidence score based on the starting point probability sequence, the end point probability sequence, the classification confidence vector and the regression confidence vector.
[0025] In a possible implementation of the second aspect above, in the online one-dimensional convolution operation subunit, the initial feature vector is input into the first feature buffer point by point in time, wherein the first feature buffer can save k initial feature vectors arranged point by point in time, and k represents the size of the convolution kernel of the online one-dimensional convolution operation.
[0026] In a possible implementation of the second aspect above, the online one-dimensional convolution operation subunit further includes: a first feature buffer, used to receive the initial feature vector at each time point, and delete the initial feature vector that is first placed in the first feature buffer to ensure that the first feature buffer stores the k initial feature vectors that are most recently input at each time point, where k is the size of the convolution kernel; a one-dimensional convolution layer, performing a convolution operation on the k initial feature vectors in the first feature buffer, and obtaining the basic feature vector as an output result.
[0027] In a possible implementation of the second aspect above, in the timing evaluation subunit, it includes: receiving a single basic feature vector at each time point, and performing operations including a recurrent neural network, wherein the recurrent neural network combines the results of processing the basic feature vector at the previous time point with the processing of the basic feature vector at the current time point.
[0028] In a possible implementation of the second aspect, the time series evaluation subunit further includes: a long short-term memory network, the recurrent neural network is the long short-term memory network, and is used to receive the single basic feature vector at each time point, the original hidden state h obtained by the long short-term memory network at the previous time point t-1 and original cell state c t-1 , and based on the basic feature vector, the original hidden state h t-1 and the original cell state c t-1 Calculate and output the current new hidden state h t ; Fully connected layer, used to receive the new hidden state h at each time point t , the activation function outputs the starting point probability sequence and the end point probability sequence, wherein the starting point probability is the starting point probability p of the candidate segment from time point t s,t The endpoint probability is composed of the time point t as the endpoint probability p of the candidate segment e,t composition.
[0029] In a possible implementation of the second aspect, the apparatus further includes: setting the initial hidden state h0 and the initial cell state c0 to 0.
[0030] In a possible implementation of the second aspect, in the segment evaluation subunit, the basic feature vectors are input into a second feature buffer point by point in time, wherein the second feature buffer accumulates, receives and stores a preset number of the basic feature vectors generated point by point in time.
[0031] In a possible implementation of the second aspect, the segment evaluation subunit further includes: a second feature buffer, configured to accumulate and receive a preset number of basic feature vectors at each time point, and save them as a basic feature sequence S F ∈R C×D ; Boundary matching layer, the basic feature sequence and sampling weight matrix W∈R N×D Perform point multiplication to obtain and output the boundary matching matrix M∈R with the end point t as the end point, the time region length from 1 to D and the sampling duration of N C× N; a convolutional neural network, the convolutional neural network comprising at least one layer, inputting the boundary matching matrix to perform a convolution operation, and outputting the classification confidence vector M cc ∈R D and the regression confidence vector M cr ∈R D ;
[0032] Wherein, C represents the number of channels of the basic feature vector, D represents the length of the longest candidate action segment in the basic feature sequence, and the sampling weight matrix represents the basic feature sequence S F The weight within the sampling time N, M cc represents the probability of whether the candidate action segment with a length of 1 to D and the current time as the end point is an action segment, M cr It represents the probability that the candidate action segment with a length of 1 to D and ending at the current time is close to the real action segment.
[0033] In a possible implementation of the second aspect above, the at least one layer of convolutional neural network may include four convolutional layers, wherein the first layer is a two-dimensional convolutional layer, which acts on the two dimensions of the sampling duration N and the length D of the boundary matching matrix to integrate the information of each sampling point; the second and fourth layers are both one-dimensional convolutional layers, which act on the dimension of the length D to integrate the information of each channel; the third layer is a one-dimensional convolutional layer, which acts on the dimension of the length D to integrate the information of adjacent fragment lengths.
[0034] In a possible implementation of the second aspect, constructing the candidate segments further includes: determining that time point t is a candidate action starting point, adding time point t of the candidate action starting point to a candidate action starting point list; determining that time point t is a candidate action ending point, selecting the candidate starting point that can form a candidate action segment with a length less than a maximum length D from the candidate action starting point list with time point t, and outputting a set of the candidate action segments. Among them, φ i represents the i-th candidate action segment, N c represents the number of candidate action segments, t s,i represents the starting time of the i-th candidate action segment.
[0035] In a possible implementation of the second aspect, the confidence score of the candidate action segment is calculated by the following formula:
[0036]
[0037] Among them, tt s,i +1 indicates that the candidate action segment φ i The length, p s,t and p e,t They represent the probability of time point t being the starting point and the end point of the candidate action segment, respectively. cc,t represents the probability of whether the candidate action segment with a length of 1 to D and ending at time point t is an action segment, M cr,t It represents the probability that the candidate action segment with a length of 1 to D and ending at time point t is close to the real action segment.
[0038] In a possible implementation of the second aspect above, the initial feature vector includes time series structure information.
[0039] The online temporal action detection device in the present application adopts lightweight online one-dimensional convolution, long short-term memory network and boundary matching layer operations, which can infer the probability of the current time point as the segment boundary as the real-time generation of the video stream, and examine the possibility of each time period with the current time as the end point as the segment interval. Compared with the prior art, the online temporal action detection method of the present application has a more accurate estimate of the confidence score of the candidate segment. In the actual application scenario of online temporal action detection, in order to control redundancy, when too many action segments cannot be generated at each time point t, fewer segments can be used to achieve a higher recall rate. On the other hand, compared with the (offline) boundary matching network (BMN) with a similar structure, the number of parameters of the online boundary matching network is less than one-tenth. In the case of high real-time requirements, the single-step calculation time of milliseconds can be achieved without relying on graphics card acceleration calculation, which is four to five times faster than the online boundary sensitive network of the benchmark method. Even in a platform with limited computing power, and in an end-to-end environment where features need to be extracted in real time according to the generated video stream and then action detection is performed, the online action detection device can also be used in application scenarios with finer granularity requirements in the time dimension.
[0040] In a third aspect, an online sequential motion detection device is provided, comprising:
[0041] a memory for storing instructions to be executed by one or more processors of the system, and
[0042] The processor is one of the processors of the system, and is used to execute the instructions to implement any one of the online sequential action detection methods in the first aspect.
[0043] In a fourth aspect, a computer-readable storage medium encoded with a computer program is provided, characterized in that instructions are stored on the computer-readable medium, and when the instructions are executed on a computer, the computer executes any one of the online timing action detection methods in the above-mentioned first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 According to some embodiments of the present application, a block diagram of an online sequential action detection system is shown;
[0045] Figure 2 According to some embodiments of the present application, an application scenario of online sequential action detection is shown;
[0046] Figure 3 According to some embodiments of the present application, a structural block diagram of an electronic device is shown;
[0047] Figure 4 According to some embodiments of the present application, a flow chart of an online sequential action detection method is shown;
[0048] Figure 5 According to some embodiments of the present application, a schematic diagram of online extraction of an initial feature vector from a video is shown;
[0049] Figure 6 According to some embodiments of the present application, a flowchart of the steps of generating candidate action segments is shown;
[0050] Figure 7 According to some embodiments of the present application, a structural block diagram of an online one-dimensional convolution operation is shown;
[0051] Figure 8 According to some embodiments of the present application, a start point and end point probability graph output by a timing evaluation process is shown;
[0052] Fig. 9 According to some embodiments of the present application, a structural block diagram of a boundary matching layer is shown;
[0053] Fig.10 According to some embodiments of the present application, a confidence vector map output by a fragment assessment process is shown;
[0054] Fig.11 According to some embodiments of the present application, a schematic structural diagram of an online sequential action detection device is shown. Specific embodiments
[0055] The illustrative embodiments of the present application include, but are not limited to, an online sequential action detection method, an online sequential action detection apparatus, an online sequential action detection device, and a computer-readable medium.
[0056] Figure 1 According to some embodiments of the present application, a block diagram of an online sequential action detection system is shown. Figure 2 As shown, the system includes: a front-end device 220 and an electronic device 240. The front-end device 220 and the electronic device 240 are connected in communication, for example, through a wired network, WIFI, ZigBee, Bluetooth, etc.
[0057] The front-end device 220 may be a surveillance camera, a smart home device, a chat robot, a desktop computer, a smart phone, etc. The front-end device 220 can collect videos, generate videos, store videos, or download videos. The front-end device 220 provides the video to be processed to the electronic device 240 in real time.
[0058] The electronic device 240 is provided with an online temporal action detection model, which is used to perform temporal evaluation and segment evaluation on the video online, and output the generated action segment of the video according to the evaluation result. The generated action segment can be used for subsequent action detection, video analysis and security alarm.
[0059] Temporal Action Proposal Generation: also known as Temporal Action Clip Generation. For a video, find several candidate time clips (Proposal) that may contain specific character actions or events (collectively referred to as "actions"). Due to the lack of a common Chinese translation, Temporal Action Detection sometimes also represents Temporal Action Detection (or Temporal Action Localization, the same meaning). The main difference between the two is that Temporal Action Proposal Generation only selects action clips, while Temporal Action Detection also needs to provide the category information of the action clips. For the two-step Temporal Action Detection method of first selecting action clips and then classifying them, Temporal Action Proposal Generation can be regarded as the first step. In this application, temporal action detection refers specifically to Temporal Action Proposal Generation.
[0060] There are many application scenarios for temporal action detection. In real life, videos are often untrimmed. Figure 2 The specific scene of the video of playing the musical instrument is described in detail, such as Figure 2As shown, the entire video time interval is from 0.0s to 119.2s, and the video content includes the explanation of the performance, the performance of the musicians, and the list of producers. The key part is the real action clip from the musicians getting ready to putting down the instrument at the end of the performance, with a start and end time of 13.8s to 97.9s. In order to make this clip receive more attention on the video website and facilitate the annotation of video categories or other analysis work, this application obtains the performance video online and extracts the initial feature vector for action detection from the video; based on the initial feature vector, constructs a candidate action clip, and generates a confidence score associated with the candidate action clip based on the candidate action clip and the corresponding real action clip from the musician getting ready to putting down the instrument at the end of the performance in the video; performs action clip screening processing to filter out redundant action clips from the candidate action clips, and outputs the generated action clips. The time-series action detection method in this application marks the clips played by the musicians, and the generated action clips with a start and end time of 14.2s to 98.0s are close to the real action clips, making it possible to locate the action clips that may contain specific character actions or events in real time from the unedited video. In addition, in the analysis tasks such as replacing wearable devices for human action recognition, teacher's class action analysis in educational scenarios, student classroom performance analysis in educational scenarios, extraction of essence videos in long videos, and key action detection in short videos, the time-series action detection method can be used to find the clips of each action from the video, which is convenient for subsequent processing of each action one by one.
[0061] So far, most of the temporal action detection methods are offline, that is, after obtaining the complete video, the temporal action detection is performed. Offline temporal action detection methods need to fully consider the information of the entire video. For example, in a video of playing a musical instrument, even if the musician does not pay attention to the action of putting down the instrument, the producer list that appears later can infer that the performance has ended at a certain time before. However, in some occasions with high real-time requirements, offline temporal action detection methods that need to obtain the complete video before starting processing are no longer applicable. For example, in the processing of surveillance video, it is necessary to detect suspicious human actions in the picture in real time online, and to give an action clip immediately when the action ends (within a very short millisecond delay time used for method operation), so as to promptly remind security personnel to pay attention, or then perform downstream tasks such as action recognition.
[0062] Therefore, the online temporal action detection method needs to give action clips in real time as the video progresses. The biggest difference from the offline method is that it is impossible to obtain the video content after the current moment, and can only provide the action clip with the current moment as the end point by analyzing the previous video content. Temporal Recurrent Network is a rare example that can detect action clips from videos online. The implementation process requires the support of action category tags, which causes the method to be unable to process videos containing unseen action categories, and the method for generating clips based on the combined action category prediction results cannot distinguish multiple actions that occur simultaneously and overlap in time in the video. For this reason, it is necessary to break away from the limitation of action categories and focus more on the spatial and temporal changes of the video itself, so that it is applicable to various video contents. For this reason, the present application provides an online temporal action detection method with high accuracy and real-time performance, which can take into account both effect and efficiency to meet such needs.
[0063] It can be understood that the above description of the application scenario of performing online sequential motion detection is merely exemplary and not restrictive.
[0064] Figure 3 According to some embodiments of the present application, a structural block diagram of an electronic device 100 is shown. Specifically, Figure 2 As shown, the electronic device 100 includes one or more processors 104, a system control logic 108 connected to at least one of the processors 104, a system memory 112 connected to the system control logic 108, a non-volatile memory (NVM) 116 connected to the system control logic 108, and a network interface 120 connected to the system control logic 108.
[0065] In some embodiments, the processor 104 may include one or more single-core or multi-core processors. In some embodiments, the processor 104 may include any combination of a general-purpose processor and a dedicated processor (e.g., a graphics processor, an application processor, a baseband processor, etc.). In an embodiment where the electronic device 100 uses an eNB (Evolved Node B, enhanced base station) or a RAN (Radio Access Network, radio access network) controller, the processor 104 may be configured to execute various embodiments that comply with the present invention.
[0066] In some embodiments, the processor 104 can be used to detect online sequential actions based on a neural network model. Specifically, for example, during the image processing process of each layer of the neural network model, the processor 104 continuously adjusts the neural network model according to the acquired image information until a candidate action segment with high accuracy is obtained. The processor 104 can also periodically update the above neural network model to better adapt to the changes in various actual needs of the neural network model.
[0067] In some embodiments, system control logic 108 may include any suitable interface controller to provide any suitable interface to at least one of processors 104 and / or any suitable device or component in communication with system control logic 108 .
[0068] In some embodiments, the system control logic 108 may include one or more memory controllers to provide an interface to the system memory 112. The system memory 112 may be used to load and store data and / or instructions. In some embodiments, the system memory 112 of the electronic device 100 may include any suitable volatile memory, such as a suitable dynamic random access memory (DRAM). In some embodiments, the system memory 112 may be used to load or store instructions for implementing the above-mentioned online sequential action detection, or the system memory 112 may be used to load or store instructions for implementing an application program for image generation using the above-mentioned neural network model. The processor 104 can implement the method for online sequential action detection according to an embodiment of the present application by running the instruction.
[0069] NVM / memory 116 may include one or more tangible, non-transitory computer-readable media for storing data and / or instructions. In some embodiments, NVM / memory 116 may include any suitable non-volatile memory such as flash memory and / or any suitable non-volatile storage device, such as at least one of a HDD (Hard Disk Drive), a CD (Compact Disc) drive, and a DVD (Digital Versatile Disc) drive. NVM / memory 116 may also be used to store the neural network model used in the above-mentioned online sequential action detection process.
[0070] NVM / storage 116 may include a portion of storage resources on a device on which electronic device 100 is installed, or it may be accessible to the device but not necessarily a part of the device. For example, NVM / storage 116 may be accessed over a network via network interface 120.
[0071] In particular, the system memory 112 and the NVM / storage 116 may include, respectively, a temporary copy and a permanent copy of the instruction 124. The instruction 124 may include instructions that, when executed by at least one of the processors 104, cause the electronic device 100 to implement the online sequential motion detection method of the present application. In some embodiments, the instruction 124, hardware, firmware and / or software components thereof may be additionally / alternatively placed in the system control logic 108, the network interface 120 and / or the processor 104.
[0072] The network interface 120 may include a transceiver for providing a radio interface for the electronic device 100, thereby communicating with any other suitable device (such as a front-end module, an antenna, etc.) through one or more networks. In some embodiments, the network interface 120 may be integrated with other components of the electronic device 100. For example, the network interface 120 may be integrated with at least one of the processor 104, the system memory 112, the NVM / storage 116, and a firmware device (not shown) having instructions. When at least one of the processors 104 executes the instructions, the electronic device 100 implements the online sequential action detection method in the present application.
[0073] The network interface 120 may further include any suitable hardware and / or firmware to provide a multiple-input multiple-output radio interface. For example, the network interface 120 may be a network adapter, a wireless network adapter, a telephone modem and / or a wireless modem.
[0074] In some embodiments, at least one of the processors 104 may be packaged together with logic for one or more controllers of the system control logic 108 to form a system in package (SiP). In some embodiments, at least one of the processors 104 may be integrated on the same die with logic for one or more controllers of the system control logic 108 to form a system on a chip (SoC).
[0075] The electronic device 100 may further include an input / output (I / O) device 132. The I / O device 132 may include a user interface to enable a user to interact with the electronic device 100; the design of the peripheral component interface enables the peripheral components to interact with the electronic device 100. In some embodiments, the electronic device 100 further includes a sensor for determining at least one of an environmental condition and location information related to the electronic device 100.
[0076] According to some embodiments of the present application, an online sequential action detection method 400 is provided, such as Figure 4 As shown, the method 400 includes the following steps:
[0077] Step 401: Obtain a video online, and extract an initial feature vector for action detection from the video.
[0078] Specifically, in step 401, for example, in the processing of real-time surveillance video, it is necessary to detect suspicious human actions in the picture in real time, so it is necessary to obtain real-time video online, that is, to obtain the video generated in real time time by time, and the video ends at the current time point. After obtaining the video, feature extraction is performed on the video. The specific operation is based on the action recognition method framework, removing the last fully connected layer (Fully Connected Layer, FC Layer) and global temporal pooling (Global Temporal Pooling), retaining the convolution and / or recurrent neural network part, so as to extract the video features containing the time sequence structure, which is called the initial feature vector. The initial feature vector includes static features such as color features, texture features, shape features, sound features, and motion features containing the time sequence structure.
[0079] In this application, Represents a video. v Indicates the number of frames in this video, x i Indicates the content of the i-th frame, which may include image RGB, optical flow and other information according to the input used in the feature extraction step 401. Figure 5 According to some embodiments of the present application, a schematic diagram of extracting an initial feature vector from a video online is shown. Figure 5 After the feature extraction steps shown in Represents the initial feature vector sequence, where l f represents the sequence length, and f j ∈R C represents the initial eigenvector at the jth position in the sequence, and C represents the number of channels of the initial eigenvector. Figure 5 As shown in C = 6, l f =8, that is, the video of the performer playing the instrument is evenly mapped to 8 initial feature vectors with 6 channels through feature extraction. Generally speaking, features can be extracted from the video in proportion (for example, each σ frame in the original video corresponds to one of the feature vectors); or different σ can be used for each video according to the length of the video, and the length of the feature sequence l can be fixed by the method of linear interpolation. f In summary, it can be understood that the feature extraction process is to transform the original video l v The content of the frame is evenly mapped to l f The initial feature vector is the length of time in the original video corresponding to each initial feature vector, and F is the abstract representation of the original video after time scale scaling. Therefore, for the subsequent sequential action detection method, the time length in the original video corresponding to each initial feature vector is the smallest time unit. For convenience, this application will use T to represent l f, and in order to avoid confusion, the ordinal number of the initial feature sequence is called the time point t.
[0080] Step 402: Execute candidate action segment generation processing, construct candidate action segments, and generate confidence scores.
[0081] Specifically, in step 402, based on the initial feature vector extracted from the video, the probability of time point t being the starting point and the end point of the candidate action segment are obtained through time series evaluation processing, based on which, the candidate action segment is constructed, and then based on the classification confidence vector and regression confidence vector obtained by the segment evaluation processing, a confidence score associated with the candidate action segment is generated, wherein the confidence score represents the matching degree of the candidate action segment with the real action segment. The specific implementation method will be described in detail later.
[0082] use Represents the set of candidate action fragments, and uses represents the set of ground truth action clips, where N c Represents the number of candidate action clips in the video, N g represents the number of real action clips in the video, t s,i and t e,i Respectively represent the i-th action segment φ i The start time and end time of the sequential action detection are constructed by constructing a set of candidate action segments Φ c , and through the judgment of confidence scores, it can cover the set of real action clips as accurately and comprehensively as possible. g .
[0083] Step 403: Execute action segment screening processing, screen out redundant action segments according to the confidence scores, and output the generated action segments.
[0084] Specifically, in step 403, in the temporal action detection, the boundary probabilities of two moments that are very close to each other are likely to be very close, resulting in repeated and redundant segments in the candidate action segment set.
[0085] The non-maximum suppression method (NMS) is very commonly used in tasks such as screening out redundant candidate frames and candidate video clips. The method of retaining the one with the largest confidence score among similar candidate action clips and setting the confidence score to 0 eliminates the remaining clips. However, there is a disadvantage that when two candidate action clips are close enough but both are real actions, the one with a small confidence score will be directly excluded, so it is also called the hard non-maximum suppression (Hard-NMS) method. In the technical solution of the present application, the softened non-maximum suppression method (Soft-NMS) derived from the non-maximum suppression method is used to retain the possibility of candidate action clips that are close to each other being selected. The process is as follows:
[0086] 1. Let the final set of generated action fragments to be retained be Φ p ={}.
[0087] 2. From the candidate action clip set In the above example, select the candidate action segment with the largest confidence score, denoted as φ p =[t s,p t,score p ]. p From Φ c Select to Φ p middle.
[0088] 3. Traverse Φ c All the remaining candidate action segments in i With φ p The intersection-over-union ratio satisfies IoU(φ i ,φ p )>0.8, then φ i The confidence score is changed to:
[0089]
[0090] 4. Repeat steps 2-3. When Φ p The number of retained fragments in reaches the preset N p or Φ c All the clips in have been selected into Φ p When , the screening ends and returns Φ p .
[0091] Finally, the set Φ p All the segments in are the generated action segments with time point t as the end point given by the online temporal action detection method. p When the start and end times of the generated action clips (in this case, the ordinal number of the corresponding feature vector) are mapped to real time, the time interval corresponding to the feature sequence i is used. The midpoint of the real time where t v is the original video length, and T is the feature sequence length.
[0092] The following combination Figure 6 The specific process of generating the candidate action segments in step 402 is further explained. Figure 6 As shown, the following steps may be exemplarily included:
[0093] Step 4021: Based on the initial feature vector, perform at least one online one-dimensional convolution operation to output the basic feature vector at each time point.
[0094] Specifically, in step 4021, in a real-time video environment, it can be considered that the initial feature vector in the video feature sequence is generated point by point in time and input into the online one-dimensional convolution layer, so it is impossible to perform a convolution operation on the complete sequence. To this end, the present application proposes a technical solution of online one-dimensional convolution (Online Conv1d). Figure 7 According to some embodiments of the present application, a structural block diagram of an online one-dimensional convolution operation is shown, such as Figure 7 As shown, the online one-dimensional convolution includes a first feature buffer and a one-dimensional convolution. The first feature buffer can save the k initial feature vectors input most recently, where k is the size of the convolution kernel. As time goes by, whenever an initial feature vector extracted from a video corresponding to a new time point is generated and passed into the online one-dimensional convolution, it will be placed at the end of the first feature buffer, and the initial feature vector first placed in the first feature buffer will be deleted to ensure that the first feature buffer stores the k initial feature vectors input most recently at each time point. Then, the convolution kernel performs a single-step, non-sliding convolution operation on the initial feature vector in the first feature buffer, and finally generates a basic feature vector as the output result. The online one-dimensional convolution operation can meet the requirements of real-time online calculation as the basic feature vector is extracted at each time point, and can achieve the same effect as ordinary one-dimensional convolution. Specifically, it can be optionally composed of two layers of online one-dimensional convolutional neural networks, as shown in Table 1, and the size k of the convolution kernel is 3, that is, the first buffer stores the three most recent initial feature vectors, and as the initial feature vectors are input into the first feature buffer point by point in time, a convolution operation is performed on each of the three adjacent initial feature vectors, and each of the three adjacent initial feature vectors generates a basic feature vector, so that the basic feature vectors are output point by point in time.
[0095] The above values of k are only exemplary descriptions according to the embodiments of the present application. The value of k is determined by the actual application. For example, in other cases, a convolution kernel size of k of 5 or 7 may be selected.
[0096] Table 1
[0097]
[0098] The following is a quantitative representation of the operation of an online one-dimensional convolutional layer. Assume that the number of input channels of an online one-dimensional convolutional layer is C in , the number of output channels is C out , the convolution kernel size is k, then the layer has a total weight (Weight) W∈R Cout×Cin×k and bias B∈R Cout Two sets of parameters. The initialization of the parameters of the online one-dimensional convolution layer follows the method of initializing the parameters of the ordinary convolution, changing the value of each element of the weight matrix and the offset vector from Randomly selected from, where U(a, b) is uniformly distributed from a to b. For the input features of the online one-dimensional convolution of this layer (including the features in the buffer) F in ∈R Cin×k , the output features are:
[0099]
[0100] The calculated F out After the linear rectifier function (Rectified Linear Unit, ReLU) ReLU(x) = max(0, x), the output is the application range of deep learning in video analysis [0, +∞). The above operation is simple to calculate and can be completed by only one matrix multiplication and one matrix addition, which can meet the real-time requirements of online temporal action detection. The online one-dimensional convolution operation further processes the initial feature vector generated in the feature extraction stage, and at the same time increases the receptive field of the feature, so that the generated basic feature vector can contain more time sequence information associated with the previous and next video frames.
[0101] Step 4022: In the timing evaluation process, a single basic feature vector is received at each time point, and operations including a recurrent neural network are performed to generate a start point probability sequence and an end point probability sequence of the candidate action segment at each time point.
[0102] Specifically, in step 4022, unlike most frame / segment video-based temporal action detection methods that use convolutional neural networks to obtain the probability sequence of the starting point and the end point, the temporal evaluation process in the present application consists of a layer of long short-term memory network and a layer of fully connected layer, as shown in Table 2. Compared with the offline temporal action detection method, the online temporal action detection cannot obtain information after the current time, so in order to utilize historical information for a longer time, a recurrent neural network is used instead of a convolutional neural network in the present application. For each basic feature vector output by the online one-dimensional convolution operation, it is input into the long short-term memory network cell (LSTM Cell). The long short-term memory network cell will simultaneously receive the hidden state (Hidden State) and cell state (Cell State) obtained last time, and calculate the current new hidden state and new cell state, and output the new hidden state as a feature. And set the initial hidden state and initial cell state to 0. The hidden state enters the fully connected layer, and finally outputs the time point t as the starting probability p of the candidate action segment. s,t and endpoint probability p e,t .
[0103] Table 2
[0104]
[0105] The following is a quantitative representation of the operation of the LSTM network. Suppose the input feature vector at time point t is F t ∈R Cin , the original hidden state calculated last time is h t-1 ∈R S , the original cell state is c t-1 ∈R S , where S is the length of the hidden state and the cell state. The operation of the long short-term memory network can be expressed as:
[0106] i t =σ(W ii ·F t +b ii +W hi ·h t-1 +b hi ) (3)
[0107] f t =σ(W if ·F t +b if +W hf ·h t-1 +b hf ) (4)
[0108] g t =tanh(W ig ·F t+b ig +W hg ·h t-1 +b hg ) (5)
[0109] ο t =σ(W io ·F t +b io +W ho ·h t-1 +b ho ) (6)
[0110] c t =f t *c t-1 +i t *g t (7)
[0111] h t =o t *tanh(c t ) (8)
[0112] Where A*B represents the Hadamard Product, that is, for vectors of the same size, A={a i} and B = {b i}, returns a vector of the same size C = {c i}, so that each element in vector C is the product of the values of the elements in the corresponding positions of A and B, that is, c i =a i ×b i .
[0113] Represents the Sigmoid function, with an output range of (0, 1). represents the hyperbolic tangent function, with an output range of (-1, 1). i represents the input gate, which processes input information. g represents the cell gate, which is used to control which input information is added to the new cell state c. t f represents the forget gate, which is used to control which contents of the original cell state are retained and discarded. o represents the output gate, which processes and prepares the output information. Each W and b are the basic feature vectors F that each gate acts on the input. t and the original hidden state h t-1 The weights and offsets are initialized by taking the value of each element from The new hidden state h is finally used as the output feature t The vector generated by the output gate is determined together with the new cell state.
[0114] The subsequent fully connected layer is used to integrate the new hidden state output by the long short-term memory network, and outputs two values in the range of (0, 1) after the Sigmoid activation function, which respectively represent the probability of time point t being the starting point and end point of the candidate action segment. The probability of time point t being the starting point of the candidate action segment can be understood as the probability that the time point or time interval of the video time corresponding to the t-th feature vector is the starting point. In general, the role of the timing evaluation operation is to cyclically receive the basic feature vectors output by the online one-dimensional convolution operation at each time point, and generate the starting point probability sequence and the end point probability sequence of the candidate action segment at each time point. For the initial feature sequence of the video with a length of T, the output of the timing evaluation processing is the starting point probability sequence. and the endpoint probability sequence Figure 8 According to some embodiments of the present application, a start point and end point probability diagram output by a timing evaluation process is shown, such as Figure 8 As shown, the horizontal axis is the time from 0 to time point t, the vertical axis is the probability value from 0 to 1, and the solid line represents the probability p of the current time as the starting point of the candidate action segment s,t , the dotted line indicates the probability p of the current time being the end point of the candidate action segment e,t .
[0115] Step 4023: Execute segment evaluation processing, accumulate and receive a preset number of basic feature vectors generated at each time point, and perform operations including sampling and convolution, and output classification confidence vectors and regression confidence vectors.
[0116] Specifically, in step 4023, it is composed of a second feature buffer, a boundary matching layer and a four-layer convolutional neural network, as shown in Table 3.
[0117] Table 3
[0118]
[0119] The second feature buffer accumulates and receives a preset number of basic feature vectors at each time point, for example, receives the most recent D basic feature vectors, and saves them as a basic feature sequence S F ∈R C×D ; Fig. 9 According to some embodiments of the present application, a structural block diagram of a boundary matching layer is shown, such as Fig. 9 As shown in FIG. 1 , the function of the boundary matching layer is to input the most recent D basic feature vectors (D represents the length of the longest action segment in the feature sequence, and the specific value depends on the length of the real action segment in the data set) output by the online one-dimensional convolution operation and stored in the second feature buffer. By multiplying these basic feature vectors by the sampling weight matrix, the feature samples of all intervals with lengths from 1 to D and their surroundings with the end point at time t and the lengths thereof are converted into a new feature matrix of fixed length in the time dimension, which is convenient for subsequent calculations.
[0120] For a segment with a time point t as the end point and a length of d (i.e., the starting point s = t-d+1, d = 1, 2, ..., D), its surrounding time region is defined as [s-0.25d, t]. In order to uniformly select N time points within the surrounding time region and then add them to the basic feature sequence S F Upsampling, propose the sampling weight matrix W∈R N×D The D values in the i-th row W[i] of the sampling weight matrix represent the feature sequence S F The weight of the feature vector of D time points to the i-th sampling time point. For integer sampling time points, directly set the position of the time point in W[i] to 1, and the rest to 0. For sampling time points that are not integers, use linear interpolation to proportionally accumulate the basic feature vectors corresponding to the two integer time points before and after the time point. For example, for the i-th sampling time point t i :
[0121]
[0122] Among them, floor(·), ceil(·), and dec(·) represent rounding down to an integer, rounding up to an integer, and rounding down to a decimal, respectively.
[0123] The feature sequence S F and the transpose of the sampling weight matrix W T Multiply them together to get the boundary matching feature M∈R C×N , each column corresponds to a sampling time point. For each segment length d between 1 and D, a corresponding N×D sampling weight matrix can be used in the feature sequence S F Sampling is performed on the , so the sampling weight matrix is actually a three-dimensional matrix W∈R N ×D×D . The feature sequence S F and the sampling weight matrix W with the first two dimensions transposed T Multiply, the result is the complete boundary matching feature matrix M∈R C×N×D , which is expressed in the form of:
[0124]
[0125] Thus, a new feature matrix with a sampling duration of N is realized at one time, which samples the surrounding time areas of all intervals with a length of 1 to D and ends at t. It is worth noting that the value of the sampling weight matrix W is fixed and has nothing to do with the feature sequence S. F Therefore, the value of the sampling weight matrix W can be calculated once in advance without the need for real-time calculation during training or testing.
[0126] The boundary matching feature matrix M obtained by the boundary matching layer is passed into the subsequent four-layer convolutional neural network. Among them, the two-dimensional convolutional layer Conv2d acts on the N and D dimensions, and the convolutional kernel sizes are 32 and 1 respectively, integrating the information of each sampling time point. Then the two one-dimensional convolutional layers Conv1d 1 and Conv1d 2 both act on the D dimension, and the convolutional kernel sizes are 1 and 3 respectively. The functions are to integrate the information of each channel and the information of adjacent segment lengths. The above three convolutional layers all use ReLU as the activation function. The last one-dimensional convolutional layer Conv1d 3 also acts on D, and the convolutional kernel size is 1. After passing through the Sigmoid activation function, two confidence vectors M cc , M cr ∈R D are output, where the classification confidence vector M cc represents the probability that the candidate action segments with lengths from 1 to D ending at the current time are action segments, which is used to assist classification; the regression confidence vector M cr represents the probability that the candidate action segments with lengths from 1 to D ending at the current time approach the true action segments, which is used for accurate prediction. That is, the two confidence vectors output by the segment evaluation process contain the possibility information of the candidate action segments with lengths from 1 to D ending at the time point t. When the current time point t < D, the input of the segment evaluation process will add padding with all values being zero to补齐 the feature sequence length D. The lengths of the corresponding output classification confidence vector M cc and regression confidence vector M cr are still D, but only the part with segment lengths from 1 to t is used when calculating the loss. Specifically, the label of the segment evaluation process is G c ∈R D ×T , G c [d, t] represents the possibility that the time interval with the end point at t and the length of d is an action segment. Corresponding to the time point t, the output classification confidence vector M cc and regression confidence vector M cr correspond to the t-th column of G c , that is, G c [:, t]. Among them, the classification confidence vector M cc is used to calculate the weighted cross entropy loss (WCE) with G c [:, t], making the positive examples approach 1 and the negative examples approach 0, which helps to correctly divide the positive and negative examples; the regression confidence vector M cr is used to calculate the loss with G c[:, t] calculates the mean square error loss function (MSE), the goal is to make the confidence vector as close as possible to the action segment possibility label in terms of value. Both confidence vectors are set to calculate the two-part loss, and together represent the probability that the candidate action segment is an action segment. Fig.10 According to some embodiments of the present application, a confidence vector map output by a fragment evaluation process is shown, such as Fig.10 As shown, the horizontal axis is the time interval from time d to time point t, the vertical axis is the probability value from 0 to 1, and the solid line represents the probability of whether the candidate action segment with a length of 1 to D with the current time as the end point is an action segment, that is, the classification confidence vector M cc , the dotted line represents the probability that the candidate action segment with a length of 1 to D and the current time as the end point is close to the real action segment, that is, the regression confidence vector M cr .
[0127] The candidate action segment generation process in this application is also called the online boundary matching network. The segment evaluation process therein is similar to the segment evaluation process function of the (offline) boundary matching network (BMN), both of which select N sampling time points from the feature sequence inside and around a series of time segments to obtain a boundary matching feature matrix, and then obtain a confidence vector (online boundary matching network) or a confidence matrix ((offline) boundary matching network) through a series of convolution operations. The difference is that the (offline) boundary matching network only performs a segment evaluation process on the complete video feature sequence once, and samples any time segment that satisfies a length less than D. The online boundary matching network only focuses on the time segment with an end point of t and a length less than D at time point t, so one dimension is reduced in parameters, operations, and results, namely the time dimension T. For example, the output of the segment evaluation process of the (offline) boundary matching network is the confidence matrix M cc , M cr ∈R D×T , and the online boundary matching network outputs the confidence vector M cc , M cr ∈R D .
[0128] The above step 4022 and step 4023 can be executed in parallel, and the order here is only for exemplary description.
[0129] Step 4024: Calculate the confidence score based on the starting point probability sequence, the end point probability sequence, the classification confidence vector and the regression confidence vector.
[0130] Specifically, for time point t, after passing the tth feature vector into the online boundary matching network, we can obtain the probability p of time point t as the starting point from the timing evaluation process. s,t and endpoint probability p e,t, from the fragment evaluation process we can obtain the confidence vector M with t as the end point cc and M cr .
[0131] In order to give the final generated action fragment, we first need to determine whether the time point t is the starting point or the end point by probability. If the starting point probability p s,t satisfy or p s,t >p s,t-1 , t is regarded as a candidate action starting point and stored in a list containing all candidate action starting points from 0 to t. Use a similar method to determine the candidate action starting point to determine whether time point t is a candidate action endpoint. If time point t does not meet the requirements of the candidate action endpoint, no action segment is given at the current time, and the basic feature vector of the next time is directly processed. If time point t is a candidate endpoint, all starting points that meet the candidate action segment length that can be composed with time point t is less than the maximum length limit D are selected from the candidate action starting point list, and all generated candidate action segments are passed to the next step. Specifically, D can be set to 20s.
[0132] The confidence score of the segment is given by comprehensively considering the starting probability, the end probability, and the two confidence vectors: the classification confidence vector and the regression confidence vector. i The confidence score i Defined as:
[0133]
[0134] where tt s,i +1 is the candidate action segment φ i The set of candidate action segments with confidence scores can be expressed as
[0135] In order to verify the effect of the online boundary matching network (Online Boundary Matching Network, Online BMN) method and compare it with offline methods and benchmark methods, this application designs and conducts multiple sets of experiments to comprehensively examine the accuracy and real-time performance of the online boundary matching network. The experiment is based on ActivityNet v1.3, a large-scale video analysis dataset including 27,801 videos, which is suitable for multiple video analysis tasks including action recognition and temporal action detection. In this application, two methods are used to extract features from the ActivityNet v1.3 dataset video, but because they are two different sets of features for the temporal action detection method that uses features as direct input, they can be regarded as different datasets. For convenience, the feature dataset extracted by the two-stream convolutional network is recorded as ActivityNet v1.3TS, and the feature dataset extracted by the SlowFast network is recorded as ActivityNet v1.3SF.
[0136] The programming language of the code in the experiment is Python 3.7, and the machine learning framework used is PyTorch 1.5. We implemented three temporal action detection methods:
[0137] 1) (Offline) Boundary Matching Network (BMN): The part that obtains the probability that each small video segment is the starting point and the end point is similar to the boundary sensitive network, and is composed of convolutional neural networks. A boundary matching layer (BM Layer) is used to multiply the video feature information of a period of time by the sampling weight matrix calculated in advance, and the feature information between all possible start-end points in this period of time is sampled as a new feature of fixed length, and through several layers of convolutional neural networks, the confidence scores of all start-end points are obtained at one time. The generation process of candidate action segments in the online temporal action detection method of the present application is named the online boundary matching network (Online BMN). In order to better distinguish, the boundary matching network is called the (offline) boundary matching network. The model of the (offline) boundary matching network is used in this application to compare the effect with the online boundary matching network. During training, the learning rate of the (offline) boundary matching network is 0.001 or 0.0001; the batch size is 64, 16 per graphics card; the weight used to balance the weighted cross entropy loss and mean squared error loss in the fragment evaluation process (the same function as in the online boundary matching network) is 1.0 or 10.0.
[0138] 2) Online Boundary Sensitive Network (Online BSN): The input video features are passed through a one-dimensional convolutional neural network on a three-layer time dimension to obtain the probability that each small video segment is the starting point, end point, and middle point. Afterwards, for each high-probability start-end point pair, a new sequence of fixed length is sampled from the middle point probability sequence in the start-end point interval, and passed through a fragment evaluation process (Proposal Evaluation Module, PEM) consisting of two fully connected layers, and finally the output result is multiplied by the probability of the start and end points to obtain the confidence score of the fragment. In this application, the (offline) boundary sensitive network is changed to an online method as the baseline model (Baseline). During the training process, the learning rate of the online boundary sensitive network is 0.0003; the batch size is 128, 32 per graphics card.
[0139] 3) Online Boundary Matching Network (Online BMN): During training, the learning rate of the online boundary matching network is 0.002 or 0.001; the batch size is 128, 32 per graphics card; the weight used to balance the weighted cross entropy loss and mean square error loss in the fragment evaluation process is 1.0 or 10.0.
[0140] In the above three methods, the maximum segment length D of the online and offline boundary matching networks is the same as the feature sequence length T to ensure that all lengths of real action segments are covered; the online boundary sensitive network itself has no maximum segment length limit. The number of sampling time points N of the boundary matching layer of the online and offline boundary matching networks is set to 32. In addition, the above three methods are trained for 10 rounds (epochs), and the optimizer used is the Adam method. Except that the learning rate is determined according to the model and the weight decay is set to 0.0001 for regularization, the rest of the parameters use the default parameters of the Adam method in PyTorch 1.5 (β=(0.9, 0.999), ε=1e-8). For parameters with multiple values, experiments are conducted on all parameter combinations and the best experimental results are retained.
[0141] In the initial experiments, it was found that the softened non-maximum suppression method used to screen out redundant candidate action segments took a long time. Although the softened non-maximum suppression method has a simple process, it requires selecting a segment φ each time. p Time calculation and Φ c The intersection-and-union ratio of all fragments in and the confidence score are updated accordingly, with a time complexity of O(N P ·|Φ c |), where N P is the target number of generated action clips, |Φ c | is the number of segments in the candidate action segment set.c When there are thousands of candidate action fragments, the softened non-maximum suppression method will occupy most of the time in the inference process. To reduce the time consumption, we compiled the source file containing the softened non-maximum suppression method with Cython and replaced the source file with the generated dynamic link library. Experimental results show that the efficiency of the softened non-maximum suppression method is improved by 3.5-4 times.
[0142] 1) Offline detection experiment
[0143] In the problem of sequential action detection, the offline method can observe the complete video feature sequence, while the online method can only observe the feature sequence before t at each time point t for inference. Therefore, in theory, the offline method with similar structure should be the upper limit of the effect that the online method can obtain. Although the technical solution protected by this application is an online sequential action detection method, in order to be able to directly compare with the offline method and observe the difference in effect, an offline detection experiment is also set up. In the inference process of the offline detection experiment, only the candidate action segment generation and score combination steps are performed, and segment screening is not performed for the time being. When the video processing is completed, the set of candidate action segments Φ at each time point t has been obtained. c,t , these sets are merged into a candidate action set for the entire video, denoted as Φ c , and finally for Φ c A fragment screening was performed using the softened non-maximum suppression method to obtain Φ p , contains at most N P The offline detection experiment is characterized by being able to integrate all candidate action clips and select up to N action clips with the highest global confidence scores. P This detection method is the same as the detection method of offline temporal action detection research in recent years (including offline boundary-sensitive networks and boundary matching networks).
[0144] The basic evaluation index of the temporal action detection task is the recall rate of the real action clips, that is, for each real action clip (Ground Truth) φ g , in the inferred action segment set Φ p There is a fragment φ p The probability of matching it, and the quantitative definition of matching is φ g With φ p The intersection-over-union ratio of reaches a certain set threshold z. On the other hand, the number of action clips given will also affect the recall rate. Therefore, what we want to measure is the maximum number of action clips generated for each video, N PThe average recall rate of real action clips in each video under the condition of , is called AR@AN, that is, the average recall rate under the average number of action clips. Following the common evaluation criteria of temporal action detection research in recent years, in the offline detection experiments on ActivityNetv1.3 TS and SF datasets, we consider the average AR@AN of the intersection-over-union ratio threshold z = [0.5:0.05:0.95], and pay attention to N P ∈{10,50,100} (respectively denoted as AR@10, AR@50, AR@100), and the area under the AR@AN curve (AUC) when the value is an integer between 1 and 100:
[0145]
[0146] The results of offline detection experiments on the ActivityNet v1.3 TS dataset are shown in Table 4. In general, the boundary matching network (BMN) is an offline method and can obtain all the information of the feature sequence during operation, so the effect is better than the two online methods. Among the online methods, the online boundary matching network (Online BMN) uses a long short-term memory network that can better utilize historical information in the temporal evaluation process, and directly analyzes the feature sequence in the fragment evaluation process, so it is more suitable for the task of temporal action detection. Its overall effect is better than the online boundary sensitive network (Online BSN) as the baseline model. It is worth noting that when generating the number of action fragments N, P When controlled at a relatively small value of 10, the AR@10 result of the online boundary matching network is nearly 2% higher than that of the online boundary sensitive network, which is a clear advantage. This shows that the confidence score given by the online boundary matching network to the action clip is more accurate, and the positive examples that can match the real action clip are ranked at the top. On the other hand, although there is still a certain gap between the online boundary matching network and the (offline) boundary matching network, the online boundary matching network uses less than one-tenth of the number of parameters of the (offline) boundary matching network to achieve an effect that is only 3%-4% lower than that of the (offline) boundary matching network. For online temporal action detection tasks that have high real-time requirements and tend to prefer lightweight methods, the online boundary matching network still has certain advantages.
[0147] The offline detection experimental results on the ActivityNet v1.3 SF dataset are shown in Table 5. The trend is similar to the results on the ActivityNet v1.3 TS dataset. The increase in the number of parameters is due to the fact that the number of feature channels in the ActivityNet v1.3 SF dataset is much larger than that in the TS dataset.
[0148] Table 4
[0149]
[0150] Table 5
[0151]
[0152] 2) Online detection experiment
[0153] In the offline experiment, at time point t, we can put any number of time intervals into the candidate action segment set Φ c In the process of , when the video ends, the clips with high confidence scores are selected from the whole video. Different from the offline detection experiment, the online detection experiment should be as close to the real-time video environment as possible, and the action clips are given as the video is generated. Therefore, when reaching the time point t, we should immediately select a small number of intervals that are most likely to match the real action clips from the time interval ending at t according to the situation.
[0154] To meet the above requirements, in the inference process of the online detection experiment, the three stages of candidate action fragment generation, score combination and fragment screening are performed at each time point. In the fragment screening stage, only a maximum of 10 action fragments are allowed to be given at each time point t. However, reducing redundant action fragments is also one of the goals of online temporal action detection methods. The method may aim to achieve a higher recall rate and generate as many unnecessary (low confidence score or redundant) action fragments as possible within the limit of 10 fragments at each time point. To avoid this, we still put the up to 10 action fragments generated at each time point into the set Φ at the end of the method. c Then use the softened non-maximum suppression method to screen the fragments again, and finally select no more than N P In an ideal situation, if the confidence score of the method for the time interval is good enough, the final segment screening can be omitted in the application scenario, and only the confidence score threshold can be set as the output standard, so that the method can output the appropriate amount of action segments according to the situation, while ensuring that the inference process of the method is completely online.
[0155] The evaluation criteria for the online detection experiment are the same as those for the offline detection, which are the average AR@AN of the intersection-over-union ratio threshold z = [0.5:0.05:0.95], and the focus is on N P The AR@AN is the area under the AR@AN curve (AUC) when the AR@AN takes three values ∈{10,50,100} (respectively denoted as AR@10, AR@50, AR@100), and the area under the AR@AN curve (AUC) when the AR@AN takes three values ∈{10,50,100}.
[0156] The (offline) boundary matching network (BMN) cannot be used for online detection, so we only compare the results of the online boundary matching network (Online BMN) and the online boundary sensitive network (Online BSN) as the baseline. From Table 6, it can be seen that the effect of the online boundary matching network in the online detection experiment is better than that of the online boundary sensitive network, and the improvement is more significant than that of the offline experiment, indicating that the online boundary matching network can better learn video features in an online environment. Similar to the situation in the offline detection experiment, when the total number of action clips generated is controlled to a small value of 10, on both ActivityNet v1.3TS and SF datasets, the online boundary matching network has an improvement of more than 2% compared to the online boundary sensitive network, which once again proves the accuracy of the online boundary matching network in evaluating the confidence score of action clips.
[0157] Table 6
[0158]
[0159] On the other hand, the data of the single-step time column represents the time from receiving the input of the feature vector to giving no more than 10 candidate action segments with the current time as the end point when the method processes each feature vector of a video feature sequence in sequence. This part of the test does not use the GPU and is only completed on the CPU. The data shows that the processing speed of the online boundary matching network is more than four to five times that of the online boundary sensitive network, and it is more real-time. Even on platforms with limited computing power, or using end-to-end online temporal action detection that requires simultaneous extraction of video features, the more efficient online boundary matching network method can still maintain a finer granularity in the time dimension.
[0160] 3) Structural comparison experiment
[0161] In the temporal action detection methods proposed in recent years, the modules with similar functions to the temporal evaluation processing of the online boundary matching network usually use convolutional neural networks to obtain the start and end probability sequences. The advantage of using convolutional neural networks is that they have strong parallelism and fast running speed in offline temporal action detection methods, but they also inevitably have the defects of limited receptive field and inability to make good use of the historical information of the feature sequence, which is particularly important in the problem of online temporal action detection where the features after the current time cannot be known. In order to verify the improvement brought by using the long short-term memory network (LSTM) instead of the commonly used convolutional neural network as the main structure of the temporal evaluation processing, we designed a structural comparison experiment of the online boundary matching network with two types of temporal evaluation processing on the ActivityNet v1.3 TS dataset. Among them, the online boundary matching network we proposed uses a long short-term memory network, which is temporarily recorded as Online BMN-RNN in the structural comparison experiment; the model using two layers of online one-dimensional convolutional neural networks is recorded as Online BMN-CNN, and the temporal evaluation processing TEM structure is shown in Table 7. The experimental results shown in Tables 8 and 9 show that the Online BMN-RNN achieves better results than the Online BMN-CNN in both offline and online detection experiments. In addition, although the long short-term memory network used has more parameters and more complex operations than the online one-dimensional convolution, the single-step operation time of the Online BMN-RNN is still 0.3 milliseconds faster than that of the Online BMN-CNN.
[0162] Table 7
[0163]
[0164] Table 8
[0165]
[0166] Table 9
[0167]
[0168] The online temporal action detection method in this application adopts lightweight online one-dimensional convolution, long short-term memory network and boundary matching layer operations, which can infer the probability of the current time point as the segment boundary as the real-time generation of the video stream, and examine the possibility of each time period with the current time as the end point as the segment interval. The experimental results of offline detection and online detection on the ActivityNetv1.3 TS and SF data sets respectively show that the online boundary matching network (Online BMN) can achieve better results than the baseline model (Baseline), that is, the online boundary sensitive network (Online BSN). Compared with the prior art, the online temporal action detection method of this application estimates the confidence score of the candidate segment more accurately. In the actual application scenario of online temporal action detection, in order to control redundancy, when too many action segments cannot be generated at each time point t, fewer segments can be used to achieve a higher recall rate. On the other hand, compared with the (offline) boundary matching network (BMN) with similar structure, the online boundary matching network, and the number of parameters is less than one-tenth. In the case of high real-time requirements, the single-step calculation time can be achieved in milliseconds without relying on graphics card acceleration, which is four to five times faster than the baseline method of online boundary-sensitive network. Even in platforms with limited computing power and end-to-end environments where features need to be extracted from the generated video stream in real time before action detection, the online action detection method can also be used in application scenarios that require finer granularity in the time dimension.
[0169] According to some embodiments of the present application, an online sequential action detection device 600 is provided. Fig.11 According to some embodiments of the present application, a schematic diagram of the structure of an online sequential action detection device is shown. Fig.11 As shown, the device 600 for performing online sequential action detection is as follows:
[0170] A video acquisition unit 601 is used to acquire a video online and extract an initial feature vector for action detection from the video;
[0171] A candidate action segment generating unit 602 is used to construct a candidate action segment based on the initial feature vector, and generate a confidence score associated with the candidate action segment according to the candidate action segment and the corresponding real action segment in the video, wherein the confidence score indicates the matching degree between the candidate action segment and the real action segment in the video;
[0172] An action segment screening unit 603 is used to screen out redundant action segments from candidate action segments and output a generated action segment;
[0173] The candidate action segment generating unit 602 includes:
[0174] An online one-dimensional convolution operation subunit 6021, configured to perform at least one online one-dimensional convolution operation based on the initial feature vector, and output a basic feature vector at each time point;
[0175] The basic feature vectors are input into the timing evaluation subunit 6022 and the segment evaluation subunit 6023 for operation, wherein:
[0176] A time series evaluation subunit 6022, for receiving a single basic feature vector at each time point, and performing operations including a recurrent neural network to generate a start probability sequence and an end probability sequence of the candidate action segment at each time point;
[0177] The segment evaluation subunit 6023 is used to accumulate and receive a preset number of basic feature vectors generated at each time point, perform operations including sampling and convolution, and output a classification confidence vector and a regression confidence vector;
[0178] The confidence score calculation subunit 6024 is used to calculate the confidence score based on the starting point probability sequence, the end point probability sequence, the classification confidence vector and the regression confidence vector.
[0179] In some embodiments, in the online one-dimensional convolution operation subunit 6022, the initial feature vector is input into the first feature buffer point by point in time, where the first feature buffer can store k initial feature vectors arranged point by point in time, and k represents the size of the convolution kernel of the online one-dimensional convolution operation.
[0180] In some embodiments, the online one-dimensional convolution operation subunit 6021 further includes:
[0181] A first feature buffer is used to receive the initial feature vector at each time point, and delete the initial feature vector first put into the first feature buffer, so as to ensure that the first feature buffer stores the k initial feature vectors input at the most recent time point, where k is the size of the convolution kernel;
[0182] The one-dimensional convolution layer performs a convolution operation on the k initial feature vectors in the first feature buffer and obtains a basic feature vector as the output result.
[0183] In some embodiments, the timing evaluation subunit 6022 includes:
[0184] A single basic feature vector is received at each time point, and operations including a recurrent neural network are performed, where the recurrent neural network processes the current basic feature vector in combination with the result of processing the basic feature vector at the previous time point.
[0185] In some embodiments, the timing evaluation subunit 6022 further includes:
[0186] Long short-term memory network, the recurrent neural network is a long short-term memory network, which is used to receive a single basic feature vector at each time point, the original hidden state h obtained by the previous long short-term memory network t-1 and original cell state c t-1 , and based on the basic feature vector, the original hidden state h t-1 and original cell state c t-1 Calculate and output the current new hidden state h t ;
[0187] Fully connected layer, used to receive the new hidden state h at each time point t , after the activation function outputs the starting point probability sequence and the end point probability sequence, where the starting point probability is the starting point probability p of the candidate segment from time point t s,t The endpoint probability is composed of time point t as the endpoint probability p of the candidate segment e,t composition.
[0188] In some embodiments, the apparatus 600 further comprises: setting the initial hidden state and the initial cell state to 0.
[0189] In some embodiments, in the segment evaluation subunit 6023, the basic feature vectors are input into the second feature buffer at each time point, wherein the second feature buffer accumulates, receives and stores a preset number of basic feature vectors at each time point.
[0190] In some embodiments, the fragment evaluation subunit 6023 further includes:
[0191] The second feature buffer is used to accumulate and receive a preset number of basic feature vectors at each time point and save them as a basic feature sequence S F ∈R C×D ;
[0192] Boundary matching layer, the basic feature sequence and the sampling weight matrix W∈R N×D Perform point multiplication to obtain and output the boundary matching matrix M∈R with the end point t as the end point, the time region length from 1 to D and the sampling duration N C×N ;
[0193] Convolutional neural network, the convolutional neural network includes at least one layer, the input boundary matching matrix performs the convolution operation, and the output classification confidence vector M cc ∈R D and the regression confidence vector M cr ∈R D ;
[0194] Among them, C represents the number of channels of the basic feature vector, D represents the length of the longest candidate action segment in the basic feature sequence, and the sampling weight matrix represents the basic feature sequence S FThe weight within the sampling time N, M cc represents the probability that the candidate action segment with the current time as the end point and the length from 1 to D is an action segment, M cr Indicates the accuracy from 1 to D of the candidate action segment with a length from 1 to D ending at the current time.
[0195] In some embodiments, the at least one convolutional neural network may include four convolutional layers, wherein:
[0196] The first layer is a two-dimensional convolutional layer, which acts on the sampling time N and length D of the boundary matching matrix to integrate the information of each sampling point;
[0197] The second and fourth layers are both one-dimensional convolutional layers, acting on the dimension of length D to integrate the information of each channel;
[0198] The third layer is a one-dimensional convolutional layer, which acts on the dimension of length D to integrate the information of adjacent segment lengths.
[0199] In some embodiments, constructing the candidate fragment further comprises:
[0200] Determine that time point t is a candidate action starting point, and add time point t of the candidate action starting point to a candidate action starting point list;
[0201] Determine that time point t is the end point of the candidate action, select the candidate starting points that can form a candidate action segment with a length less than the maximum length D with time point t from the list of candidate action starting points, and output the set of candidate action segments
[0202]
[0203] Among them, φ i represents the i-th candidate action segment, N c represents the number of candidate action segments, t s,i represents the starting time of the i-th candidate action segment.
[0204] In some embodiments, the confidence score of the candidate action segment is calculated by the following formula:
[0205]
[0206] Among them, tt s,i +1 indicates a candidate action segment φ i The length, p s,t and p e,t They represent the probability of time point t being the starting point and end point of the candidate action segment, respectively. cc,t represents the probability that a candidate action segment with a length of 1 to D ending at time point t is an action segment, M cr,trepresents the accuracy of the candidate action segment with length 1 to D ending at time point t.
[0207] In some embodiments, the initial feature vector includes temporal structure information.
[0208] The online temporal action detection device in the present application adopts lightweight online one-dimensional convolution, long short-term memory network and boundary matching layer operations, which can infer the probability of the current time point as the segment boundary as the real-time generation of the video stream, and examine the possibility of each time period with the current time as the end point as the segment interval. Compared with the prior art, the online temporal action detection method of the present application has a more accurate estimate of the confidence score of the candidate segment. In the actual application scenario of online temporal action detection, in order to control redundancy, when too many action segments cannot be generated at each time point t, fewer segments can be used to achieve a higher recall rate. On the other hand, compared with the (offline) boundary matching network (BMN) with a similar structure, the number of parameters of the online boundary matching network is less than one-tenth. In the case of high real-time requirements, the single-step calculation time of milliseconds can be achieved without relying on graphics card acceleration calculation, which is four to five times faster than the online boundary sensitive network of the benchmark method. Even in a platform with limited computing power, and in an end-to-end environment where features need to be extracted in real time according to the generated video stream and then action detection is performed, the online action detection device can also be used in application scenarios with finer granularity requirements in the time dimension.
[0209] According to some embodiments of the present application, an online sequential action detection device is provided. It can be understood that the electronic device for online sequential action detection corresponds to the online sequential action detection method provided in the present application, and the technical details in the above specific description of the online sequential action detection method provided in the present application are still applicable to the electronic device for online sequential action detection. For the specific description, please refer to the above text and will not be repeated here.
[0210] According to some embodiments of the present application, a computer-readable storage medium encoded with a computer program is provided. It can be understood that the computer-readable storage medium encoded with a computer program corresponds to the online sequential action detection method provided in the present application, and the technical details in the above specific description of the online sequential action detection method provided in the present application are still applicable to the computer-readable storage medium encoded with a computer program, and the specific description is referred to above, which will not be repeated here.
[0211] It can be understood that exemplary applications of online temporal action detection provided in the embodiments of the present application include but are not limited to image generation in the field of artificial intelligence.
[0212] It will be understood that, as used herein, the terms "module", "unit" may refer to or include an application specific integrated circuit (ASIC), an electronic circuit, a processor (shared, dedicated, or group) and / or memory that executes one or more software or firmware programs, a combinational logic circuit, and / or other appropriate hardware components that provide the described functionality, or may be part of these hardware components.
[0213] It is understood that in each embodiment of the present application, the processor may be a microprocessor, a digital signal processor, a microcontroller, etc., and / or any combination thereof. According to another aspect, the processor may be a single-core processor, a multi-core processor, etc., and / or any combination thereof.
[0214] It can be understood that the online sequential motion detection method provided by the present application can be implemented on various electronic devices, including but not limited to servers, distributed server clusters consisting of multiple servers, mobile phones, tablet computers, laptop computers, desktop computers, wearable devices, head-mounted displays, mobile email devices, portable game consoles, portable music players, reader devices, personal digital assistants, virtual reality or augmented reality devices, televisions and other electronic devices in which one or more processors are embedded or coupled, etc.
[0215] In particular, the online sequential motion detection method provided by the present application is applicable to edge devices. Edge computing is a distributed open platform (architecture) that integrates network, computing, storage, and application core capabilities at the edge of the network close to the source of objects or data, and provides edge intelligence services nearby, which can meet key requirements in terms of real-time business, data optimization, application intelligence, security and privacy protection, etc. For example, an edge device can be a device that can perform edge computing on image data in a video in a video surveillance system close to the video data source (network smart camera).
[0216] The various embodiments of the mechanism disclosed in the present application can be implemented in hardware, software, firmware or a combination of these implementation methods. The embodiments of the present application can be implemented as a computer program or program code executed on a programmable system, which includes at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device and at least one output device.
[0217] Program code can be applied to input instructions to perform the functions described in this application and generate output information. The output information can be applied to one or more output devices in a known manner. For the purposes of this application, a processing system includes any system having a processor such as, for example, a digital signal processor (DSP), a microcontroller, an application specific integrated circuit (ASIC), or a microprocessor.
[0218] Program code can be implemented with high-level programming language or object-oriented programming language to communicate with the processing system. When necessary, program code can also be implemented with assembly language or machine language. In fact, the mechanism described in this application is not limited to the scope of any specific programming language. In either case, the language can be a compiled language or an interpreted language.
[0219] In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried or stored on one or more temporary or non-temporary machine-readable (e.g., computer-readable) storage media, which may be read and executed by one or more processors. For example, instructions may be distributed over a network or through other computer-readable media. Therefore, machine-readable media may include any mechanism for storing or transmitting information in a machine (e.g., computer) readable form, including, but not limited to, floppy disks, optical disks, optical disks, read-only memories (CD-ROMs), magneto-optical disks, read-only memories (ROMs), initial access memories (RAMs), erasable programmable read-only memories (EPROMs), electrically erasable programmable read-only memories (EEPROMs), magnetic or optical cards, flash memory, or a tangible machine-readable memory for transmitting information (e.g., carrier waves, infrared signals, digital signals, etc.) using the Internet in electrical, optical, acoustic, or other forms of propagation signals. Therefore, machine-readable media include any type of machine-readable media suitable for storing or transmitting electronic instructions or information in a machine (e.g., computer) readable form.
[0220] In the accompanying drawings, some structural or method features may be shown in a specific arrangement and / or order. However, it should be understood that such a specific arrangement and / or order may not be required. Instead, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the illustrative drawings. In addition, the inclusion of structural or method features in a particular figure does not mean that such features are required in all embodiments, and in some embodiments, these features may not be included or may be combined with other features.
[0221] It should be noted that the units / modules mentioned in the various device embodiments of the present application are all logical units / modules. Physically, a logical unit / module can be a physical unit / module, or a part of a physical unit / module, or can be implemented as a combination of multiple physical units / modules. The physical implementation method of these logical units / modules themselves is not the most important. The combination of functions implemented by these logical units / modules is the key to solving the technical problems proposed by the present application. In addition, in order to highlight the innovative part of the present application, the above-mentioned device embodiments of the present application do not introduce units / modules that are not closely related to solving the technical problems proposed by the present application, which does not mean that there are no other units / modules in the above-mentioned device embodiments.
[0222] It should be noted that, in the examples and description of the present application, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or equipment. In the absence of further restrictions, the elements defined by the statement "comprise one" do not exclude the presence of other identical elements in the process, method, article or equipment including the elements.
[0223] Although the present application has been illustrated and described with reference to certain preferred embodiments thereof, it will be apparent to those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the present application.
Claims
1. An online sequential motion detection method, characterized in that: Acquire a video online and extract an initial feature vector for action detection from the video; Performing candidate action segment generation processing to construct the candidate action segment based on the initial feature vector and generate a confidence score associated with the candidate action segment, wherein the confidence score indicates a degree of match between the candidate action segment and a real action segment in the video; Performing action segment screening processing to screen out redundant action segments from the candidate action segments and outputting generated action segments; Among them, in the candidate action segment generation process, Performing at least one online one-dimensional convolution operation based on the initial feature vector, and outputting a basic feature vector at each time point; Based on the basic feature vector, a timing evaluation process and a segment evaluation process are performed respectively, wherein: In the timing evaluation process, a single basic feature vector is received at each time point, and an operation including a recurrent neural network is performed to generate a start probability sequence and an end probability sequence of the candidate action segment at each time point; In the segment evaluation process, a preset number of basic feature vectors generated at each time point are cumulatively received, and operations including sampling and convolution are performed to output a classification confidence vector and a regression confidence vector; The confidence score is calculated based on the starting point probability sequence, the end point probability sequence, the classification confidence vector and the regression confidence vector.
2. The method according to claim 1, characterized in that The online one-dimensional convolution operation includes: inputting the initial feature vector into a first feature buffer point by point in time, wherein the first feature buffer can store k initial feature vectors arranged point by point in time, and k is the size of the convolution kernel of the online one-dimensional convolution operation.
3. The method according to claim 2, characterized in that Inputting the initial feature vector into the first feature buffer point by point in time further comprises: Inputting the initial feature vector into a first feature buffer in the online one-dimensional convolution point by point in time, and deleting the initial feature vector firstly input into the first feature buffer, so as to ensure that the first feature buffer stores the k initial feature vectors input most recently point by point in time, where k represents the size of the convolution kernel; The online one-dimensional convolution operation also includes: The convolution kernel performs a convolution operation on the k initial feature vectors in the first feature buffer and obtains the basic feature vector as an output result.
4. The method according to claim 1, characterized in that The timing evaluation process comprises: The processing of the current basic feature vector by the recurrent neural network is combined with the result of processing the basic feature vector at the previous time point.
5. The method according to claim 4, characterized in that The recurrent neural network operation further comprises: The recurrent neural network is a long short-term memory network; The long short-term memory network receives a single basic feature vector at each time point, and the original hidden state h obtained by the long short-term memory network at the previous time point t-1 and original cell state c t-1 , and based on the basic feature vector, the original hidden state h t-1 and the original cell state c t-1 Calculate and output the current new hidden state h t ; The timing evaluation process also includes, The new hidden state h is transformed into t Input the fully connected layer, and output the starting point probability sequence and the end point probability sequence through the activation function, where the starting point probability is the starting point probability p of the candidate action segment from time point t s,t The endpoint probability is composed of the time point t as the endpoint probability p of the candidate action segment e,t composition.
6. The method according to claim 5, characterized in that The method also includes: setting the initial hidden state h0 and the initial cell state c0 to 0.
7. The method according to claim 1, characterized in that The segment evaluation process includes: inputting the basic feature vector into a second feature buffer at each time point, wherein the second feature buffer accumulates, receives and stores a preset number of the basic feature vectors input at each time point.
8. The method according to claim 7, characterized in that Inputting the basic feature vector into the second feature buffer point by point in time further comprises: The second feature buffer accumulates and receives a preset number of basic feature vectors generated at each time point, and saves them as a basic feature sequence S F ∈R C×D ; The segment evaluation process further includes, The basic feature sequence and the sampling weight matrix W∈R N×D Input the boundary matching layer for point multiplication, and obtain and output the boundary matching matrix M∈R with the end point t as the end point, the time region length from 1 to D and the sampling time length N. C×N ; The boundary matching matrix is input into a convolutional neural network including at least one layer to perform a convolution operation, and the classification confidence vector M is output. cc ∈R D and the regression confidence vector M cr ∈R D ; Among them, C represents the number of channels of the basic feature vector, D represents the length of the longest candidate action segment in the basic feature sequence, the sampling weight matrix represents the weight of the basic feature sequence SF within the sampling duration N, Mcc represents the probability of whether the candidate action segment with a length of 1 to D with the current time as the end point is an action segment, and Mcr represents the probability that the candidate action segment with a length of 1 to D with the current time as the end point is close to the real action segment.
9. The method according to claim 8, characterized in that The at least one layer of convolutional neural network may include four convolutional layers, wherein: The first layer is a two-dimensional convolutional layer, which acts on the sampling time length N and the length D of the boundary matching matrix to integrate the information of each sampling point; The second layer and the fourth layer are both one-dimensional convolutional layers, which act on the dimension of length D to integrate the information of each channel; the third layer is a one-dimensional convolutional layer, which acts on the dimension of length D to integrate the information of adjacent segment lengths.
10. The method according to claim 1, characterized in that Constructing the candidate action fragment further includes: Determine that time point t is a candidate action starting point, and add the time point t of the candidate action starting point to a candidate action starting point list; Determine that time point t is the end point of the candidate action, select the candidate action starting point from the list of candidate action starting points that can form a candidate action segment with a length less than the maximum length D with time point t, and output the set of candidate action segments Among them, φ i represents the i-th candidate action segment, N c represents the number of candidate action segments, t s,i represents the starting time of the i-th candidate action segment.
11. The method according to claim 1, characterized in that The confidence score is calculated by the following formula: Among them, tt s,i+1 Represents the candidate action segment φ i The length, p s,t and p e,t They represent the probability of time point t being the starting point and the end point of the candidate action segment, respectively. cc,t represents the probability of whether the candidate action segment with a length of 1 to D and ending at time point t is an action segment, M cr,t It represents the probability that the candidate action segment with a length of 1 to D and ending at time point t is close to the real action segment.
12. An online sequential motion detection device, characterized in that: include: A video acquisition unit, used to acquire a video online and extract an initial feature vector for action detection from the video; a candidate action segment generating unit, configured to construct the candidate action segment based on the initial feature vector, and generate a confidence score associated with the candidate action segment according to the candidate action segment and the corresponding real action segment in the video, wherein the confidence score indicates a matching degree between the candidate action segment and the real action segment in the video; An action segment screening unit, used to screen out redundant action segments from the candidate action segments and output a generated action segment; Wherein, in the candidate action segment generating unit, An online one-dimensional convolution operation subunit, used to perform at least one online one-dimensional convolution operation based on the initial feature vector, and output a basic feature vector at each time point; The basic feature vectors are respectively input into the timing evaluation subunit and the segment evaluation subunit for operation, wherein: The timing evaluation subunit is used to receive a single basic feature vector at each time point, and perform operations including a recurrent neural network to generate a starting point probability sequence and an end point probability sequence of the candidate action segment at each time point; The segment evaluation subunit is used to accumulate and receive a preset number of basic feature vectors generated at each time point, perform operations including sampling and convolution, and output a classification confidence vector and a regression confidence vector; The confidence score calculation subunit is used to calculate the confidence score based on the starting point probability sequence, the end point probability sequence, the classification confidence vector and the regression confidence vector.
13. The device according to claim 12, characterized in that The operation performed by the online one-dimensional convolution operation subunit includes: inputting the initial feature vector into the first feature buffer point by point in time, wherein the first feature buffer can store k initial feature vectors arranged point by point in time, and k is the size of the convolution kernel of the online one-dimensional convolution operation.
14. The device according to claim 13, characterized in that The online one-dimensional convolution operation subunit further comprises: A first feature buffer, used to receive the initial feature vectors at each time point, and delete the initial feature vectors first put into the first feature buffer, so as to ensure that the first feature buffer stores the k initial feature vectors input at the most recent time point, where k represents the size of the convolution kernel; A one-dimensional convolution layer performs a convolution operation on the k initial feature vectors in the first feature buffer and obtains the basic feature vector as an output result.
15. The device according to claim 12, characterized in that The timing evaluation subunit includes: The processing of the current basic feature vector by the recurrent neural network is combined with the result of processing the basic feature vector at the previous time point.
16. The device according to claim 15, characterized in that The timing evaluation subunit further comprises: Long short-term memory network, the recurrent neural network is the long short-term memory network, which is used to receive the single basic feature vector at each time point, the original hidden state h obtained by the long short-term memory network at the previous time point t-1 and original cell state c t-1 , and based on the basic feature vector, the original hidden state h t-1 and the original cell state c t-1 Calculate and output the current new hidden state h t ; A fully connected layer is used to receive the new hidden state h at each time point t , the activation function outputs the starting point probability sequence and the end point probability sequence, wherein the starting point probability is the starting point probability p of the candidate action segment from time point t s,t The endpoint probability is composed of the time point t as the endpoint probability p of the candidate action segment e,t composition.
17. The device according to claim 12, characterized in that In the segment evaluation subunit, the basic feature vector is input into a second feature buffer at each time point, wherein the second feature buffer accumulatively receives and stores a preset number of the basic feature vectors input at each time point.
18. The device according to claim 17, characterized in that The fragment evaluation subunit further comprises: The second feature buffer is used to accumulate and receive a preset number of basic feature vectors generated at each time point and save them as a basic feature sequence S F ∈R C×D ; The boundary matching layer combines the basic feature sequence and the sampling weight matrix W∈R N×D Perform point multiplication to obtain and output the boundary matching matrix M∈R with the end point t as the end point, the time region length from 1 to D and the sampling duration N C×N ; A convolutional neural network, wherein the convolutional neural network includes at least one layer, inputs the boundary matching matrix to perform a convolution operation, and outputs the classification confidence vector M cc ∈R D and the regression confidence vector M cr ∈R D ; Wherein, C represents the number of channels of the basic feature vector, D represents the length of the longest candidate action segment in the basic feature sequence, and the sampling weight matrix represents the basic feature sequence S F The weight within the sampling time N, M cc represents the probability of whether the candidate action segment with a length of 1 to D and the current time as the end point is an action segment, M cr It represents the probability that the candidate action segment with a length of 1 to D and ending at the current time is close to the real action segment.
19. An online sequential motion detection device, characterized in that: include: a memory for storing instructions to be executed by one or more processors of the system, and The processor is one of the processors of the system, and is used to execute the instructions to implement the online sequential action detection method according to any one of claims 1 to 11.
20. A computer-readable storage medium encoded with a computer program, characterized in that The computer-readable storage medium stores instructions, and when the instructions are executed on a computer, the computer executes the online sequential action detection method according to any one of claims 1 to 11.
