Method and device for detecting target object

By combining optical flow estimation and spatio-temporal sampling technology, multi-scale features of video frames are extracted and fused for detection, which solves the problem of insufficient utilization of spatio-temporal continuity in the existing technology and improves the accuracy and efficiency of video target detection.

CN112307872BActive Publication Date: 2024-09-24BEIJING JINGDONG SHANGKE INFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010536869.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-12
Publication Date
2024-09-24
Estimated Expiration
2040-06-12

AI Technical Summary

Technical Problem

Existing video target detection technology is difficult to effectively utilize spatiotemporal continuity, resulting in low target detection accuracy and efficiency.

Method used

The first feature aggregation network based on optical flow estimation and the second feature aggregation network based on spatiotemporal sampling are used to extract the first aggregation feature and the second aggregation feature of the image frame sequence respectively, and perform fusion detection in the video through the pre-trained detection network. target audience.

Benefits of technology

It improves the accuracy and efficiency of target object detection in videos, and achieves accurate detection of target locations and categories through multi-scale feature aggregation and utilization of spatio-temporal information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112307872B
    Figure CN112307872B
Patent Text Reader

Abstract

The present application discloses a method and device for detecting a target object, and relates to the fields of artificial intelligence and image processing. The method comprises: obtaining an image frame sequence in a video; extracting a first aggregate feature of the image frame sequence using a first feature aggregation network based on optical flow estimation between image frames; extracting a second aggregate feature of the image frame sequence using a second feature aggregation network based on spatiotemporal sampling of the image frames; and detecting the target object in the video based on a pre-trained detection network based on the first aggregate feature and the second aggregate feature of the image frame sequence. The method can improve the accuracy of target detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure relate to the field of computer technology, specifically to the fields of artificial intelligence and image processing, and more particularly to a method and apparatus for detecting a target object. Background Art

[0002] Object detection in images is one of the basic tasks of computer vision. Recent methods of object detection are designed based on region detection patterns. For the detection task of target objects in videos formed by continuous image frames, it is necessary to consider the continuity of target objects in time and space to improve the accuracy of detection results. The detection problem of target objects includes detecting the location of target objects and determining the category of target objects. Some current video detection technologies extract image features frame by frame and detect possible regions of target objects. They locate the regions where target objects may appear based on the continuous movement characteristics of target objects between adjacent frames, and then classify and identify target objects in possible regions. Summary of the invention

[0003] The present disclosure provides a method, an apparatus, an electronic device, and a computer-readable storage medium for detecting a target object.

[0004] According to a first aspect of the present disclosure, a method for detecting a target object is provided, comprising: acquiring a sequence of image frames in a video; extracting first aggregated features of the image frame sequence using a first feature aggregation network based on optical flow estimation between image frames; extracting second aggregated features of the image frame sequence using a second feature aggregation network based on spatiotemporal sampling of the image frames; and detecting the target object in the video using a pre-trained detection network based on the first aggregated features and the second aggregated features of the image frame sequence.

[0005] In some embodiments, the above-mentioned use of the first feature aggregation network based on optical flow estimation between image frames to extract the first aggregated features of the image frame sequence includes: using the first feature aggregation network to aggregate the features of each non-target frame in the image frame sequence and the features of the target frame in the image frame sequence into the first aggregated features, and the first feature aggregation network uses the optical flow estimation method to perform motion compensation on the non-target frames and the target frames; the above-mentioned use of the second feature aggregation network based on spatiotemporal sampling of image frames to extract the second aggregated features of the image frame sequence includes: predicting the offset of each non-target frame in the image frame sequence relative to the target frame in the image frame sequence based on a self-learning offset prediction network, and aggregating the features of each non-target frame and the features of the target frame into the second aggregated features based on the offset.

[0006] In some embodiments, the above-mentioned aggregating the features of each non-target frame and the features of the target frame into a second aggregate feature based on the offset includes: sampling each non-target frame based on the offset between each non-target frame and the target frame, and generating a second aggregate feature of the target frame based on the sampling result.

[0007] In some embodiments, the first feature aggregation network further includes a first feature pyramid network, and the second feature aggregation network further includes a second feature pyramid network; the first feature aggregation network based on optical flow estimation between image frames is used to extract the first aggregation features of the image frame sequence, and further includes: using the first feature pyramid network to extract the first multi-scale features of each image frame in the image frame sequence; the second feature aggregation network based on spatiotemporal sampling of image frames is used to extract the second aggregation features of the image frame sequence, and further includes: using the second feature pyramid network to extract the second multi-scale features of each image frame in the image frame sequence.

[0008] In some embodiments, the above-mentioned aggregating the features of each non-target frame in the image frame sequence and the features of the target frame in the image frame sequence into a first aggregated feature includes: mapping the first multi-scale features of each non-target frame to the target frame, and aggregating the features of each scale of each target frame mapped to the target frame to obtain the first multi-scale aggregated feature; and the above-mentioned self-learning-based offset prediction network predicts the offset of each non-target frame in the image frame sequence relative to the target frame in the image frame sequence, and aggregating the features of each non-target frame and the features of the target frame into a second aggregated feature based on the offset, including: based on the second multi-scale features of each image frame, using the offset prediction network in the second feature aggregation network to predict the offset of each non-target frame relative to the target frame at each scale, and based on the offset of the non-target frame relative to the target frame at each scale, sampling the second multi-scale features of each non-target frame at the corresponding scale, and aggregating the sampling results of each scale to obtain the second multi-scale aggregated feature.

[0009] In some embodiments, the first aggregate feature and the second aggregate feature based on the image frame sequence use a pre-trained detection network to detect the target object in the video, including: fusing the first aggregate feature and the second aggregate feature to obtain a fused feature, inputting the fused feature into the pre-trained detection network to obtain a detection result of the target object in the video; or detecting the target object in the video based on the first aggregate feature and the second aggregate feature respectively, fusing the detection result based on the first aggregate feature and the detection result based on the second aggregate feature, to obtain a detection result of the target object in the video.

[0010] In some embodiments, the above-mentioned fusing the first aggregate feature and the second aggregate feature to obtain the fused feature includes: splicing the first aggregate feature and the second aggregate feature into the fused feature; or correcting the second aggregate feature based on the first aggregate feature to obtain the fused feature.

[0011] In some embodiments, the target frame includes an intermediate frame in the image frame sequence.

[0012] According to a second aspect of the present disclosure, there is provided an apparatus for detecting a target object, comprising: an acquisition unit configured to acquire a sequence of image frames in a video; a first aggregation unit configured to extract first aggregated features of the image frame sequence using a first feature aggregation network based on optical flow estimation between image frames; a second aggregation unit configured to extract second aggregated features of the image frame sequence using a second feature aggregation network based on spatiotemporal sampling of the image frames; and a detection unit configured to detect the target object in the video using a pre-trained detection network based on the first aggregated features and the second aggregated features of the image frame sequence.

[0013] In some embodiments, the first aggregation unit includes: a first feature aggregation subunit, configured to use a first feature aggregation network to aggregate features of each non-target frame in the image frame sequence and features of the target frame in the image frame sequence into a first aggregate feature, and the first feature aggregation network uses an optical flow estimation method to perform motion compensation on the non-target frame and the target frame; the second aggregation unit includes: a second feature aggregation subunit, configured to predict the offset of each non-target frame in the image frame sequence relative to the target frame in the image frame sequence based on a self-learning offset prediction network, and aggregate the features of each non-target frame and the features of the target frame into a second aggregate feature based on the offset.

[0014] In some embodiments, the second feature aggregation subunit is configured to generate the second aggregate feature in the following manner: based on the offset between each non-target frame and the target frame, each non-target frame is sampled, and the second aggregate feature of the target frame is generated based on the sampling result.

[0015] In some embodiments, the first feature aggregation network further includes a first feature pyramid network, and the second feature aggregation network further includes a second feature pyramid network; the first aggregation unit further includes: a first multi-scale feature extraction unit, configured to use the first feature pyramid network to extract first multi-scale features of each image frame in the image frame sequence; the second aggregation unit further includes: a second multi-scale feature extraction unit, configured to use the second feature pyramid network to extract second multi-scale features of each image frame in the image frame sequence.

[0016] In some embodiments, the first aggregation unit is further configured to: map the first multi-scale features of each non-target frame to the target frame, and aggregate the features of each scale mapped from each target frame to the target frame to obtain the first multi-scale aggregated features; and the second aggregation unit is further configured to: based on the second multi-scale features of each image frame, use the offset prediction network in the second feature aggregation network to predict the offset of each non-target frame relative to the target frame at each scale, and sample the second multi-scale features of each non-target frame at the corresponding scale based on the offset of the non-target frame relative to the target frame at each scale, and aggregate the sampling results of each scale to obtain the second multi-scale aggregated features.

[0017] In some embodiments, the detection unit is configured to detect the target object in the video based on the first aggregate feature and the second aggregate feature of the image frame sequence in the following manner: fuse the first aggregate feature and the second aggregate feature to obtain a fused feature, input the fused feature into a pre-trained detection network, and obtain a detection result of the target object in the video; or detect the target object in the video based on the first aggregate feature and the second aggregate feature respectively, fuse the detection result based on the first aggregate feature and the detection result based on the second aggregate feature, and obtain a detection result of the target object in the video.

[0018] In some embodiments, the detection unit is further configured to fuse the first aggregate feature and the second aggregate feature to obtain a fused feature in the following manner: concatenate the first aggregate feature and the second aggregate feature into a fused feature; or correct the second aggregate feature based on the first aggregate feature to obtain a fused feature.

[0019] In some embodiments, the target frame includes an intermediate frame in the image frame sequence.

[0020] According to a third aspect of the present disclosure, an electronic device is provided, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method for detecting a target object as provided in the first aspect.

[0021] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, wherein when the program is executed by a processor, the method for detecting a target object provided in the first aspect is implemented.

[0022] According to the method, device, electronic device and computer-readable storage medium disclosed in the present invention, features of different image frames in a video can be aggregated, thereby improving the accuracy of detection results of target objects based on the video.

[0023] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present application.

[0025] Figure 1 is an exemplary system architecture diagram to which embodiments of the present application may be applied;

[0026] Figure 2 is a flow chart of an embodiment of a method for detecting a target object according to the present application;

[0027] Figure 3 is a flow chart of another embodiment of a method for detecting a target object according to the present application;

[0028] Figure 4 is an architectural diagram of a method for detecting a target object according to the present application;

[0029] Figure 5 is a schematic structural diagram of an embodiment of a device for detecting a target object according to the present application;

[0030] Figure 6 It is a block diagram of an electronic device used to implement the method for detecting a target object according to an embodiment of the present application. DETAILED DESCRIPTION

[0031] The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0032] Figure 1 An exemplary system architecture 100 is shown to which embodiments of the method for detecting a target object or the apparatus for detecting a target object of the present application can be applied.

[0033] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0034] The terminal devices 101, 102, and 103 may be various electronic devices that have a camera and support interaction with the receiving server message, including but not limited to an independent camera, such as a surveillance camera, or a functional device with a camera, such as a smart phone, a tablet computer, etc. The terminal devices 101, 102, and 103 may collect video data and send the video data to the server 105 for processing.

[0035] The terminal devices 101, 102, 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices. When the terminal devices 101, 102, 103 are software, they may be installed in the electronic devices listed above. They may be implemented as multiple software or software modules, or as a single software or software module. No specific limitation is made here.

[0036] The server 105 can run a neural network model based on deep learning to solve the target detection problem. The server 105 can obtain the collected video data from the terminal devices 101, 102, and 103, decode it into a continuous sequence of image frames, and perform the target object detection task based on the image frame sequence. The server 105 can use a trained neural network model to perform the target object detection task, or it can also obtain sample data and train a neural network model for performing the target object detection task, and can further send the configuration file (including model structure and parameters) of the trained neural network model to the terminal devices 101, 102, and 103. The terminal devices 101, 102, and 103 can run the neural network model locally to perform the target object detection task.

[0037] The server 105 may be hardware or software. When the server 105 is software, it may be implemented as multiple software or software modules (e.g., multiple software modules for providing distributed services), or it may be implemented as a single software or software module. No specific limitation is made here.

[0038] It should be noted that the method for detecting the target object provided in the embodiments of the present disclosure can be executed by the terminal device 101, 102, 103 or the server 105, and accordingly, the device for detecting the target object can be set in the terminal device 101, 102, 103 or the server 105.

[0039] In some practical scenarios, the server 105 can read the video data of the target object to be detected locally. In this case, the exemplary architecture may not include the terminal devices 101, 102, 103 and the network 104. Alternatively, in some practical scenarios, the terminal devices 101, 102, 103 can locally run the neural network model for performing the target detection task after acquiring the video data to obtain the detection result of the target object. In this case, the exemplary system architecture may not include the network 104 and the server 105.

[0040] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0041] Continue to refer Figure 2 , which shows a process 200 of an embodiment of a method for detecting a target object according to the present disclosure. The method for detecting a target object comprises the following steps:

[0042] Step 201, obtaining a sequence of image frames in a video.

[0043] In this embodiment, the execution subject of the method for detecting a target object may first obtain a video of the target object to be detected. The video may be collected for a specific scene, where the target object may appear, for example, the specific scene is a waiting room, where the target object is a person; or the specific scene is a road, where the target object is a vehicle. The above execution subject may obtain the video from the network, or directly request to obtain the video from the video acquisition terminal.

[0044] After acquiring the video, the video may be parsed into individual image frames, and an image frame sequence may be formed according to the time sequence of the image frames in the video.

[0045] Usually, a video is formed by continuous image frames. The continuous image frames in the video can be directly used as the above image frame sequence, or the above image frame sequence can be formed by uniformly or non-uniformly sampling the continuous image frames in the video, so as to reduce the number of image frames to be processed and speed up the target detection speed.

[0046] Step 202: extract first aggregated features of the image frame sequence using a first feature aggregation network based on optical flow estimation between image frames.

[0047] The first feature aggregation network is a pre-trained neural network for aggregating features of different image frames. The first feature aggregation network may include a pre-trained convolutional neural network based on optical flow estimation, such as FlowNet (optical flow network), which can be pre-trained based on the task of detecting target objects in the video. The first feature aggregation network can compensate for the motion deviation between the two image frames according to the optical flow estimation result, thereby realizing motion correction, and extract features based on the corrected image frames to obtain aggregated features of the two image frames.

[0048] In this embodiment, one image frame in the image frame sequence can be used as the target frame, and the other image frames can be used as non-target frames. The first feature aggregation network can perform optical flow estimation and motion compensation on each non-target frame and the target frame, respectively, and aggregate the features of each non-target frame into the target frame to obtain the first aggregated features of the image frame sequence.

[0049] Step 203: extract second aggregated features of the image frame sequence using a second feature aggregation network based on spatiotemporal sampling of the image frames.

[0050] The second feature aggregation network can extract features of image frames based on sampling of spatiotemporal information of image frames. The second feature aggregation network can extract features based on potential spatiotemporal associations between image frames. For example, it can extract features of regions that have certain associations in spatial positions between image frames that are consecutive in time. The association in spatial position here means that the positions of spatial regions have differences within a preset range. The second feature aggregation network can sample information on spatial position associations of each image frame based on the spatiotemporal associations between image frame sequences, and aggregate the sampled information to obtain second aggregated features.

[0051] The second feature aggregation network can be constructed based on a convolutional neural network and trained based on the task of detecting target objects in videos. The second feature aggregation network can be trained together with other networks used in the method for detecting target objects in this embodiment, by self-learning the spatiotemporal sampling method between image frames during training.

[0052] Step 204 : Based on the first aggregated features and the second aggregated features of the image frame sequence, a pre-trained detection network is used to detect the target object in the video.

[0053] After extracting the first aggregate feature and the second aggregate feature of the image frame sequence, the first aggregate feature and the second aggregate feature can be input into a pre-trained detection network, which can determine the category and position of the target object in the image frame sequence through classification and regression, thereby realizing the detection of the target object in the video.

[0054] In some embodiments, the first aggregate feature and the second aggregate feature may be fused to obtain a fused feature, and the fused feature may be input into a pre-trained detection network to obtain a detection result of the target object in the video. The fused feature may be obtained by normalizing the first aggregate feature and the second aggregate feature and then performing weighted summation on the corresponding dimension. The pre-trained detection network may identify the category of the target object and detect the location of the target object based on the fused feature.

[0055] Furthermore, the fused feature can be obtained by concatenating (such as the add operation or concat operation in some deep neural networks) the first aggregate feature and the second aggregate feature. Alternatively, the fused feature can be obtained by correcting the second aggregate feature based on the first aggregate feature, for example, a correction sub-network can be used to correct the second aggregate feature. The correction sub-network can be trained together with the first feature aggregation network and the second feature aggregation network.

[0056] In some embodiments, the target object in the video can be detected based on the first aggregate feature and the second aggregate feature, and the detection result based on the first aggregate feature and the detection result based on the second aggregate feature are fused to obtain the detection result of the target object in the video. That is, two detection sub-networks can be used to detect the target object based on the first aggregate feature and the second aggregate feature, respectively, and the detection results of the two detection sub-networks are fused to obtain the final detection result of the target object.

[0057] The method for detecting a target object in this embodiment can aggregate features of multiple image frames and extract effective features by fusing features extracted based on the first feature aggregation network and features extracted based on the second feature aggregation network, thereby improving the accuracy of the target object detection result in the video. In addition, the method can complete the position detection and classification of the target object in one stage, thereby improving the efficiency of target object detection.

[0058] Continue to refer Figure 3 , which shows a flow chart of another embodiment of the method for detecting a target object disclosed in the present invention. Figure 3 As shown, the process 300 of the method for detecting a target object in this embodiment includes the following steps:

[0059] Step 301, obtaining an image frame sequence in a video.

[0060] The specific implementation method of step 301 is consistent with step 201 of the aforementioned embodiment and will not be repeated here.

[0061] Step 302: A first feature aggregation network is used to aggregate features of each non-target frame in the image frame sequence and features of the target frame in the image frame sequence into a first aggregated feature.

[0062] In this embodiment, the first feature aggregation network may be a feature extraction network, which may be constructed based on a convolutional neural network. The first feature aggregation network may use an optical flow estimation method to perform motion compensation on non-target frames and target frames. Specifically, the first feature aggregation network may first estimate the motion deviation of the non-target frame relative to the target frame based on the optical flow estimation method. For example, the first feature aggregation network may include an optical flow learning network PWC-Net for estimating motion deviation based on optical flow, and the optical flow learning network may extract a flow field vector that characterizes the motion deviation between the non-target frame and the target frame. Optionally, the optical flow learning network may be pre-trained, or the optical flow learning network in the first feature aggregation network may be implemented using a PWC-Net that has been trained in other non-target object detection scenarios. Then, the first feature aggregation network may perform motion correction based on the motion deviation between each non-target frame and the target frame and aggregate the features of the corrected non-target frame into the features of the target frame to obtain a first aggregated feature.

[0063] Step 303, predicting the offset of each non-target frame in the image frame sequence relative to the target frame in the image frame sequence based on the self-learning offset prediction network, and aggregating the features of each non-target frame and the features of the target frame into a second aggregated feature based on the offset.

[0064] Similar to the first feature aggregation network, the second feature aggregation network can be constructed based on a convolutional neural network. In this embodiment, the second feature aggregation network includes an offset prediction network, which can be a self-learning neural network, that is, it can be trained together with a sub-network such as a detection network in a method for detecting a target object based on a target object detection task. The offset prediction network can predict the offset of a non-target frame in an image frame sequence relative to a target frame in an image frame sequence, and the offset represents the offset of the temporal correlation between the two image frames, which can be used as a representation of the motion offset of the target object.

[0065] The target frame may be any frame in the image frame sequence, for example, it may be the first frame or the last frame. Furthermore, the target frame may include an intermediate frame in the image frame sequence. When the image frame sequence contains 2K+1 image frames, the target frame may be the Kth frame; when the image frame sequence contains 2K frames, the target frame may be the Kth frame or the K+1th frame. The other frames in the image frame sequence except the target frame are non-target frames. When the target frame is an intermediate frame in the image sequence, the motion deviation between the non-target frames and the target frame will not exceed a predetermined range, and it can be avoided that the motion deviation between the first frame and the last frame in the image frame sequence is large, or even that multiple target objects do not appear together in the first frame and the last frame, resulting in inaccurate features aggregated by the first feature aggregation network and the second feature aggregation network.

[0066] The second feature aggregation network can convert the features of each non-target frame according to the corresponding offset based on the offset between each non-target frame and the target frame, and map it to the target frame, and aggregate it with the features extracted from the target frame to form a second aggregated feature.

[0067] Optionally, the offset prediction network is used to predict an offset that characterizes the temporal correlation between the non-target frame and the target frame. The closer the acquisition time of the two image frames is, the stronger the corresponding temporal correlation is, and vice versa. Further, the offset of each non-target frame and the target frame can be predicted based on the offset prediction network.

[0068] The offset prediction network may include three convolution groups. Given the features of the target frame and the non-target frame, the two features may be connected and input into the three convolution groups of the above offset prediction network. One of the convolution groups retains the scale of the connected features, and the remaining two convolution groups reduce the scale by a certain coefficient. The outputs of the three convolution groups may be upsampled, and the results of the upsampling operation may be used to predict the offset.

[0069] The second feature aggregation network can perform a corresponding offset on the non-target frame according to the offset prediction result, and then extract the features of the non-target frame, and aggregate the extracted features of the non-target frame with the features of the target frame to obtain a second aggregated feature.

[0070] Alternatively, the second feature aggregation network may sample each non-target frame based on the prediction result of the offset between each non-target frame and the target frame, and generate a second aggregation feature of the target frame based on the sampling result.

[0071] Specifically, deformable convolution can be used to sample each non-target frame to extract valid information from each non-target frame. The offset between the non-target frame and the target frame can be used as a two-dimensional offset in the deformable convolution, and features corresponding to the two-dimensional offset can be sampled from the non-target frame as "pseudo" features of the target frame. Then, the "pseudo" features of each non-target frame corresponding to the target frame can be aggregated by averaging, weighted summing, etc. to obtain a second aggregated feature.

[0072] After using the offset prediction network to predict the offset that characterizes the temporal correlation between the non-target frame and the target frame, the features of the non-target frame are sampled based on the predicted offset, thereby realizing self-guided sampling feature aggregation. The second aggregated features obtained by sampling and aggregation contain spatiotemporal context information and can more accurately characterize the information of the object in the video.

[0073] Further optionally, the first feature aggregation network also includes a first feature pyramid network, and the second feature aggregation network also includes a second feature pyramid network. The first feature pyramid network and the second feature pyramid network can adopt the same feature pyramid network structure, and the parameters of the two can be different. The first detection network and the second detection network in this embodiment can be jointly trained, based on the same sample data set, and the parameters of the first detection network and the parameters of the second detection network are iteratively adjusted respectively.

[0074] The first feature pyramid network and the second feature pyramid network can respectively extract features of multiple scales for each image frame. The structures of the first feature pyramid network and the second feature pyramid network can be designed in order of the scales of the extracted features from small to large. For example, the scale of the extracted features can be controlled by setting the size of the convolution kernel, or some upsampling layers can be added between the convolution layers to increase the scale of the features.

[0075] Before aggregating the features of the non-target frame and the target frame into the first aggregated features, the first feature pyramid network can be used to extract the corresponding first multi-scale features of each image frame. In this way, the first feature aggregation network can perform motion compensation and feature aggregation of optical flow at each scale based on the first multi-scale features of each image frame.

[0076] Similarly, before aggregating the features of the non-target frame and the target frame into the second aggregated features, the second feature pyramid network can be used to extract the corresponding second multi-scale features of each image frame. In this way, the second feature aggregation network can estimate the offset at each scale based on the second multi-scale features of each image frame, and sample the features of the corresponding scale of the non-target frame based on the offset.

[0077] Since the feature pyramid can effectively extract multi-scale features of the image, by setting the feature pyramid network in the first detection network and the second detection network, the motion deviation or offset between the non-target frame and the target frame can be estimated from different scales respectively, so as to more comprehensively extract the relative motion information of each scale between the image frames, and thus obtain more accurate feature aggregation results.

[0078] Furthermore, the above-mentioned step of aggregating the features of each non-target frame in the image frame sequence and the features of the target frame in the image frame sequence into a first aggregated feature can be specifically implemented as follows: mapping the first multi-scale features of each non-target frame to the target frame, and aggregating the features of each scale mapped from each target frame to the target frame to obtain the first multi-scale aggregated feature; and the above-mentioned step of aggregating the features of each non-target frame and the features of the target frame into a second aggregated feature can be specifically implemented as follows: based on the second multi-scale features of each image frame, using the offset prediction network in the second feature aggregation network to predict the offset of each non-target frame relative to the target frame at each scale, and based on the offset of the non-target frame relative to the target frame at each scale, the second multi-scale features of each non-target frame are sampled at the corresponding scale, and the sampling results of each scale are aggregated to obtain the second multi-scale aggregated feature.

[0079] Specifically, the first feature aggregation network can map the features of each non-target frame at each scale to the corresponding scale of the target frame based on the motion compensation of each non-target frame relative to the target frame, and aggregate them with the features of the corresponding scale of the target frame to form the first multi-scale aggregated features of the target frame.

[0080] The offset prediction network in the second feature aggregation network can predict the offset of the non-target frame relative to the target frame at each scale based on the second multi-scale features of each image frame. Specifically, the features of the same scale of the non-target frame and the target frame can be spliced ​​and input into the offset prediction network to obtain the offset prediction result of the corresponding scale. Then, based on the offset prediction results of each scale, the features of the corresponding scale of the non-target frame are sampled to obtain the corresponding sampling results of the scale. Then, the sampling results of different non-target frames corresponding to the same scale are aggregated with the features of the target frame at the scale, for example, the average value, weighted sum, etc. can be calculated as the second aggregated feature of the scale. The above prediction offset, sampling and aggregation operations are performed for each scale respectively to obtain the second multi-scale aggregated feature.

[0081] Step 304: Based on the first aggregated features and the second aggregated features of the image frame sequence, a pre-trained detection network is used to detect the target object in the video.

[0082] The description of step 304 in this embodiment may refer to the description of step 204 in the above embodiment, which will not be repeated here.

[0083] Furthermore, the detection network can detect the target object based on the first multi-scale aggregated features and the second multi-scale aggregated features. Since the multi-scale aggregated features contain richer image information, target objects of different scales can be accurately detected, thereby achieving comprehensive detection of the target object.

[0084] More specifically, target detection can be performed based on the first multi-scale aggregation features and the second multi-scale aggregation features respectively, and the two detection results can be fused to obtain the final detection result; alternatively, the first multi-scale aggregation features and the second multi-scale aggregation features can be fused to obtain fused features, and the fused features can be input into a classification regression network to detect the position and category of the target object at each scale.

[0085] Figure 4 FIG. 2 shows an overall architecture diagram of the method for detecting a target object in this embodiment. Figure 4 As shown, the image frame sequence I can be first t-τ ,…,I t …、I t+τ Each frame in (representing the t-τ, ..., t, ..., t+τ frame images in sequence) is input into a preprocessing network, which can perform operations such as image enhancement, normalization, or preliminary feature extraction. The preprocessed image frame sequence is input into the first feature aggregation network and the second feature aggregation network respectively.

[0086] The first feature aggregation network includes a first feature pyramid FPN1. After the multi-scale features of each image frame are extracted through the first feature pyramid, they are input into the aggregation network FA1 based on motion correction. The aggregation network FA11 based on motion correction aggregates the features of each image frame into the first aggregation feature and then inputs it into the classification regression sub-network. Figure 4 In the above, for the first aggregated feature of each scale, a classification regression sub-network is used to detect the category and location of the target object.

[0087] The second feature aggregation network includes a second feature pyramid FPN2. Each image frame is input into the aggregation network FA2 based on self-guided sampling after extracting multi-scale features through the second feature pyramid. The aggregation network FA2 based on self-guided sampling aggregates the features of each image frame into the second aggregated features and then inputs them into the classification regression sub-network. Figure 4 In the above, for the second aggregated features of each scale, a classification regression sub-network is used to detect the category and location of the target object.

[0088] Then, the detection result based on the first aggregated feature may be fused with the detection result based on the second aggregated feature to obtain a final target object detection result.

[0089] Further references Figure 5 As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a device for detecting a target object. Figure 2 and Figure 3 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0090] like Figure 5 As shown, the device 500 for detecting a target object in this embodiment includes: an acquisition unit 501, a first aggregation unit 502, a second aggregation unit 503, and a detection unit 504. The acquisition unit 501 is configured to acquire an image frame sequence in a video; the first aggregation unit 502 is configured to extract a first aggregate feature of the image frame sequence using a first feature aggregation network based on optical flow estimation between image frames; the second aggregation unit 503 is configured to extract a second aggregate feature of the image frame sequence using a second feature aggregation network based on spatiotemporal sampling of image frames; the detection unit 504 is configured to detect the target object in the video using a pre-trained detection network based on the first aggregate feature and the second aggregate feature of the image frame sequence.

[0091] In some embodiments, the first aggregation unit 502 includes: a first feature aggregation subunit, configured to use a first feature aggregation network to aggregate features of each non-target frame in the image frame sequence and features of the target frame in the image frame sequence into a first aggregate feature, and the first feature aggregation network uses an optical flow estimation method to perform motion compensation on the non-target frame and the target frame; the second aggregation unit 503 includes: a second feature aggregation subunit, configured to predict the offset of each non-target frame in the image frame sequence relative to the target frame in the image frame sequence based on a self-learning offset prediction network, and aggregate the features of each non-target frame and the features of the target frame into a second aggregate feature based on the offset.

[0092] In some embodiments, the second feature aggregation subunit is configured to generate the second aggregate feature in the following manner: based on the offset between each non-target frame and the target frame, each non-target frame is sampled, and the second aggregate feature of the target frame is generated based on the sampling result.

[0093] In some embodiments, the above-mentioned first feature aggregation network also includes a first feature pyramid network, and the second feature aggregation network also includes a second feature pyramid network; the first aggregation unit 502 also includes: a first multi-scale feature extraction unit, configured to use the first feature pyramid network to extract first multi-scale features of each image frame in the image frame sequence; the second aggregation unit 503 also includes: a second multi-scale feature extraction unit, configured to use the second feature pyramid network to extract second multi-scale features of each image frame in the image frame sequence.

[0094] In some embodiments, the first aggregation unit 502 is further configured to: map the first multi-scale features of each non-target frame to the target frame, and aggregate the features of each scale mapped from each target frame to the target frame to obtain the first multi-scale aggregated features; and the second aggregation unit 503 is further configured to: based on the second multi-scale features of each image frame, use the offset prediction network in the second feature aggregation network to predict the offset of each non-target frame relative to the target frame at each scale, and sample the second multi-scale features of each non-target frame at the corresponding scale based on the offset of the non-target frame relative to the target frame at each scale, and aggregate the sampling results of each scale to obtain the second multi-scale aggregated features.

[0095] In some embodiments, the detection unit 504 is configured to detect the target object in the video based on the first aggregate feature and the second aggregate feature of the image frame sequence in the following manner: fuse the first aggregate feature and the second aggregate feature to obtain a fused feature, input the fused feature into a pre-trained detection network, and obtain a detection result of the target object in the video; or detect the target object in the video based on the first aggregate feature and the second aggregate feature respectively, fuse the detection result based on the first aggregate feature and the detection result based on the second aggregate feature, and obtain a detection result of the target object in the video.

[0096] In some embodiments, the detection unit 504 is further configured to fuse the first aggregate feature and the second aggregate feature to obtain a fused feature in the following manner: concatenate the first aggregate feature and the second aggregate feature into a fused feature; or correct the second aggregate feature based on the first aggregate feature to obtain a fused feature.

[0097] In some embodiments, the target frame includes an intermediate frame in the image frame sequence.

[0098] Each unit in the above device 500 is similar to the reference Figure 2 and Figure 3 Therefore, the operations, features and technical effects described above for the method for detecting a target object are also applicable to the device 500 and the units included therein, and will not be described in detail here.

[0099] According to an embodiment of the present application, the present application also provides an electronic device and a readable storage medium.

[0100] like Figure 6, is a block diagram of an electronic device 600 for detecting a target object according to an embodiment of the present application. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples, and are not intended to limit the implementation of the present application described herein and / or required.

[0101] like Figure 6 As shown, the electronic device includes: one or more processors 601, a memory 602, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are interconnected using different buses and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In other embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 6 A processor 601 is taken as an example.

[0102] The memory 602 is a non-transient computer-readable storage medium provided in the present application. The memory stores instructions executable by at least one processor to enable the at least one processor to perform the method for detecting a target object provided in the present application. The non-transient computer-readable storage medium of the present application stores computer instructions, which are used to enable a computer to perform the method for detecting a target object provided in the present application.

[0103] The memory 602 is a non-transient computer-readable storage medium that can be used to store non-transient software programs, non-transient computer executable programs and modules, such as program instructions / modules corresponding to the method for detecting a target object in the embodiment of the present application (for example, the attached Figure 5 The processor 601 executes various functional applications and data processing of the server by running the non-transient software programs, instructions and modules stored in the memory 602, that is, implements the method for detecting the target object in the above method embodiment.

[0104] The memory 602 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device for detecting the target object, etc. In addition, the memory 602 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory 602 may optionally include a memory remotely arranged relative to the processor 601, and these remote memories may be connected to the electronic device for detecting the target object via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0105] The electronic device for detecting a target object may further include: an input device 603, an output device 604, and a bus 605. The processor 601, the memory 602, the input device 603, and the output device 604 may be connected via the bus 605 or in other ways. Figure 6 The connection via bus 605 is taken as an example.

[0106] The input device 603 can receive input digital or character information, and generate key signal input related to user settings and function control of the electronic device for detecting the target object, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator rod, one or more mouse buttons, a trackball, a joystick and other input devices. The output device 504 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display and a plasma display. In some embodiments, the display device may be a touch screen.

[0107] Various implementations of the systems and techniques described herein can be realized in digital electronic circuit systems, integrated circuit systems, dedicated ASICs (application specific integrated circuits), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0108] These computer programs (also referred to as programs, software, software applications, or code) include machine instructions for programmable processors and can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, device, and / or means (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.

[0109] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0110] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0111] A computer system may include clients and servers. Clients and servers are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship to each other.

[0112] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the expected results of the technical solution disclosed in this application can be achieved, and this document is not limited here.

[0113] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.

Claims

1. A method for detecting a target object, comprising: Get the image frame sequence in the video; Extracting first aggregated features of the image frame sequence using a first feature aggregation network based on optical flow estimation between image frames; Extracting second aggregated features of the image frame sequence using a second feature aggregation network based on spatiotemporal sampling of image frames; Detecting a target object in the video using a pre-trained detection network based on the first aggregated features and the second aggregated features of the image frame sequence; The first feature aggregation network further includes a first feature pyramid network, and the first feature aggregation network based on optical flow estimation between image frames is used to extract the first aggregation feature of the image frame sequence, including: extracting first multi-scale features of each image frame in the image frame sequence using the first feature pyramid network; A first feature aggregation network is used to map the first multi-scale features of each non-target frame to a target frame, and the features of each scale mapped from each target frame to the target frame are aggregated to obtain a first aggregated feature. The first feature aggregation network uses an optical flow estimation method to perform motion compensation on the non-target frame and the target frame.

2. The method according to claim 1, wherein: The extracting second aggregated features of the image frame sequence by using a second feature aggregation network based on spatiotemporal sampling of the image frames comprises: The offset prediction network based on self-learning predicts the offset of each non-target frame in the image frame sequence relative to the target frame in the image frame sequence, and aggregates the features of each non-target frame and the features of the target frame into a second aggregate feature based on the offset.

3. The method according to claim 2, wherein: Aggregating the features of the non-target frames and the features of the target frame into second aggregated features based on the offset includes: Based on the offset between each non-target frame and the target frame, each non-target frame is sampled, and a second aggregated feature of the target frame is generated based on the sampling result.

4. The method according to claim 2, wherein: The second feature aggregation network also includes a second feature pyramid network; The extracting second aggregated features of the image frame sequence by using a second feature aggregation network based on spatiotemporal sampling of the image frames also includes: The second feature pyramid network is used to extract second multi-scale features of each image frame in the image frame sequence.

5. The method according to claim 4, wherein: The self-learning-based offset prediction network predicts the offset of each non-target frame in the image frame sequence relative to the target frame in the image frame sequence, and aggregates the features of each non-target frame and the features of the target frame into a second aggregate feature based on the offset, including: Based on the second multi-scale features of each image frame, an offset prediction network in the second feature aggregation network is used to predict the offset of each non-target frame relative to the target frame at each scale, and based on the offset of the non-target frame relative to the target frame at each scale, the second multi-scale features of each non-target frame are sampled at the corresponding scale, and the sampling results of each scale are aggregated to obtain a second aggregated feature.

6. The method according to any one of claims 1 to 5, wherein: The detecting the target object in the video using a pre-trained detection network based on the first aggregated features and the second aggregated features of the image frame sequence includes: fusing the first aggregated feature and the second aggregated feature to obtain a fused feature, and inputting the fused feature into a pre-trained detection network to obtain a detection result of the target object in the video; or The target object in the video is detected based on the first aggregate feature and the second aggregate feature respectively, and the detection result based on the first aggregate feature and the detection result based on the second aggregate feature are fused to obtain the detection result of the target object in the video.

7. The method according to claim 6, wherein: The fusing the first aggregate feature and the second aggregate feature to obtain a fused feature includes: concatenating the first aggregate feature and the second aggregate feature into a fused feature; or The second aggregated feature is corrected based on the first aggregated feature to obtain a fused feature.

8. The method according to any one of claims 2 to 5, wherein: The target frame includes an intermediate frame in the image frame sequence.

9. A device for detecting a target object, comprising: An acquisition unit, configured to acquire a sequence of image frames in a video; A first aggregation unit is configured to extract a first aggregation feature of the image frame sequence using a first feature aggregation network based on optical flow estimation between image frames; A second aggregation unit is configured to extract second aggregated features of the image frame sequence using a second feature aggregation network based on spatiotemporal sampling of the image frames; a detection unit configured to detect a target object in the video using a pre-trained detection network based on the first aggregated feature and the second aggregated feature of the image frame sequence; The first feature aggregation network further includes a first feature pyramid network, and the first aggregation unit includes: A first multi-scale feature extraction unit is configured to extract a first multi-scale feature of each image frame in the image frame sequence by using the first feature pyramid network; The first feature aggregation subunit is configured to use a first feature aggregation network to map the first multi-scale features of each non-target frame to the target frame, and aggregate the features of each scale mapped from each target frame to the target frame to obtain a first aggregated feature; the first feature aggregation network uses an optical flow estimation method to perform motion compensation on the non-target frame and the target frame.

10. The device according to claim 9, wherein: The second polymerization unit comprises: The second feature aggregation subunit is configured to predict the offset of each non-target frame in the image frame sequence relative to the target frame in the image frame sequence based on a self-learning offset prediction network, and aggregate the features of each non-target frame and the features of the target frame into a second aggregated feature based on the offset.

11. The device according to claim 10, wherein: The second feature aggregation subunit is configured to generate the second aggregated feature in the following manner: Based on the offset between each non-target frame and the target frame, each non-target frame is sampled, and a second aggregated feature of the target frame is generated based on the sampling result.

12. The device according to claim 10, wherein: The second feature aggregation network also includes a second feature pyramid network; The second polymerization unit further comprises: The second multi-scale feature extraction unit is configured to extract second multi-scale features of each image frame in the image frame sequence by using the second feature pyramid network.

13. The device according to claim 12, wherein: The second aggregation unit is further configured to: Based on the second multi-scale features of each image frame, an offset prediction network in the second feature aggregation network is used to predict the offset of each non-target frame relative to the target frame at each scale, and based on the offset of the non-target frame relative to the target frame at each scale, the second multi-scale features of each non-target frame are sampled at the corresponding scale, and the sampling results of each scale are aggregated to obtain a second aggregated feature.

14. The device according to any one of claims 9 to 13, wherein: The detection unit is configured to detect the target object in the video based on the first aggregate feature and the second aggregate feature of the image frame sequence in the following manner: fusing the first aggregated feature and the second aggregated feature to obtain a fused feature, and inputting the fused feature into a pre-trained detection network to obtain a detection result of the target object in the video; or The target object in the video is detected based on the first aggregate feature and the second aggregate feature respectively, and the detection result based on the first aggregate feature and the detection result based on the second aggregate feature are fused to obtain the detection result of the target object in the video.

15. The device according to claim 14, wherein: The detection unit is further configured to fuse the first aggregate feature and the second aggregate feature to obtain a fused feature in the following manner: concatenating the first aggregate feature and the second aggregate feature into a fused feature; or The second aggregated feature is corrected based on the first aggregated feature to obtain a fused feature.

16. The device according to any one of claims 10 to 13, wherein: The target frame includes an intermediate frame in the image frame sequence.

17. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 8.

18. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 8.