Target detection method, device, electronic device and storage medium

By performing feature aggregation processing on video frames and historical frames, it solves the low accuracy problem caused by image blur and target occlusion in video target detection, improves detection efficiency and accuracy, and is suitable for smart devices.

CN113191318BActive Publication Date: 2024-08-30BEIJING JUEYING INTELLIGENT TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110558156.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-21
Publication Date
2024-08-30
Estimated Expiration
2041-05-21

AI Technical Summary

Technical Problem

There are problems such as image blur, target occlusion, and abnormal target posture in video target detection, which lead to low accuracy of detection results and low detection efficiency of existing methods.

Method used

By obtaining the video frame to be tested and the historical video frame, feature aggregation processing is performed to generate aggregated feature data, and combined with the target detection results, the detection accuracy and efficiency are improved.

Benefits of technology

It improves the accuracy and efficiency of video target detection and can obtain more accurate detection results when the image is blurred or the target is blocked. It is suitable for intelligent equipment such as monitoring equipment and motor vehicles.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113191318B
    Figure CN113191318B
Patent Text Reader

Abstract

The present disclosure provides a target detection method, device, electronic device and storage medium, the method comprising: obtaining a video frame to be tested in a target video and a historical video frame before the video frame to be tested; performing feature aggregation processing on the historical video frame and the video frame to be tested to generate first aggregated feature data; and performing target detection on the video frame to be tested and the historical video frame respectively, determining first feature data of the number of targets corresponding to the video frame to be tested, and second feature data of the number of targets corresponding to the historical video frame; and performing feature aggregation processing on the first feature data and the second feature data to generate second aggregated feature data; and determining a detection result corresponding to the video frame to be tested based on the first aggregated feature data and the second aggregated feature data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of image processing technology, and in particular to a target detection method, device, electronic device and storage medium. Background Art

[0002] Video object detection is an emerging problem in the field of computer vision and intelligent video analysis. The task of video object detection is to detect a video sequence frame by frame and determine the detection result of each frame in the video sequence. Generally, video object detection can be applied to monitoring equipment, motor vehicles, wearable devices and other smart devices.

[0003] However, since the captured video may contain problems such as image blur, target occlusion, and abnormal target posture, the accuracy of video target detection results is relatively low. Summary of the invention

[0004] In view of this, the present disclosure at least provides a target detection method, device, electronic device and storage medium.

[0005] In a first aspect, the present disclosure provides a target detection method, comprising:

[0006] Acquire a video frame to be tested in a target video and a historical video frame before the video frame to be tested;

[0007] Performing feature aggregation processing on the historical video frame and the video frame to be tested to generate first aggregated feature data; and

[0008] Performing target detection on the video frame to be tested and the historical video frame respectively, determining first feature data of the number of targets corresponding to the video frame to be tested, and second feature data of the number of targets corresponding to the historical video frame; and performing feature aggregation processing on the first feature data and the second feature data to generate second aggregated feature data;

[0009] Based on the first aggregated feature data and the second aggregated feature data, a detection result corresponding to the video frame to be tested is determined.

[0010] In the above method, by acquiring the video frame to be tested and the historical video frame, feature aggregation processing is performed on the historical video frame and the video frame to be tested to generate first aggregated feature data, so that the first aggregated feature data can include the image feature information of the video frame to be tested and the historical video frame in time sequence; and target detection can be performed on the video frame to be tested and the historical video frame respectively to generate first feature data and second feature data, and feature aggregation processing is performed on the first feature data and the second feature data to generate second aggregated feature data, so that the generated second aggregated feature data contains the spatial features of the targets in the video frame to be tested and the historical video frame, and then based on the first aggregated feature data and the second aggregated feature data, the detection result of the video frame to be tested can be determined more accurately, thereby improving the accuracy of target video detection.

[0011] In a possible implementation manner, after obtaining the video frame to be tested in the target video and the historical video frame before the video frame to be tested, the method further includes:

[0012] Extracting features from the video frame to be tested to obtain first image feature data; and extracting features from the historical video frame to obtain second image feature data;

[0013] The performing feature aggregation processing on the historical video frame and the video frame to be tested to generate first aggregated feature data includes:

[0014] Performing feature aggregation processing on the second image feature data and the first image feature data to generate first aggregated feature data;

[0015] Performing target detection on the video frame to be tested and the historical video frame respectively includes:

[0016] The target detection is performed using the first image feature data and the second image feature data.

[0017] In a possible implementation manner, the feature data of the image to be processed corresponding to the video frame to be processed is determined according to the following steps:

[0018] Extracting features from the video frame to be processed to generate an intermediate feature map corresponding to the video frame to be processed;

[0019] Performing feature fusion processing on each feature data in the intermediate feature map to generate the image feature data to be processed corresponding to the video frame to be processed;

[0020] Among them, when the video frame to be processed is the video frame to be tested, the image feature data to be processed is the first image feature data; when the video frame to be processed is the historical video frame, the image feature data to be processed is the second image feature data.

[0021] Here, feature extraction can be performed on the video frame to be processed to generate an intermediate feature map; then, feature fusion processing can be performed on the feature data in the intermediate feature map to generate feature data of the image to be processed, thereby enhancing the extracted image features, that is, the generated first image feature data and second image feature data can have richer image features.

[0022] In a possible implementation manner, when the historical video frame includes multiple frames, performing feature aggregation processing on the second image feature data and the first image feature data to generate first aggregated feature data includes:

[0023] According to the acquisition time sequence of each historical video frame, the second image feature data corresponding to each historical video frame is cascaded to generate cascaded second image feature data;

[0024] The cascaded second image feature data and the first image feature data are subjected to feature aggregation processing to generate first aggregated feature data.

[0025] By adopting the above method, the second image feature data corresponding to each historical video frame is cascaded according to the acquisition time sequence corresponding to each historical video frame to generate cascaded second image feature data, so that the image features can be connected in time sequence, and then the cascaded second image feature data can be aggregated with the first image feature data to generate first aggregated feature data, so that the first aggregated feature data includes the image features and time sequence features in the historical video frames and the video frames to be tested.

[0026] In a possible implementation manner, performing feature aggregation processing on the cascaded second image feature data and the first image feature data to generate first aggregated feature data includes:

[0027] determining target image feature data from the cascaded second image feature data based on the determined quantity parameter; and

[0028] Performing feature fusion processing on each intermediate image feature data in the first image feature data to generate fused first image feature data;

[0029] The target image feature data and the fused first image feature data are feature aggregated to generate the first aggregated feature data.

[0030] Here, by determining the target image feature data from the cascaded second image feature data based on a determined quantity parameter, the second image feature data is screened, and then when the target image feature data and the fused first image feature data are feature aggregated to generate the first aggregated feature data, the amount of calculation can be reduced, thereby improving the efficiency of video detection.

[0031] In a possible implementation manner, performing feature aggregation processing on the first feature data and the second feature data to generate second aggregated feature data includes:

[0032] Determine the confidence level corresponding to each of the second feature data; wherein the target quantity is used to characterize the number of preset targets included in the historical video frame or the video frame to be tested, and the confidence level is used to characterize the probability that the preset target corresponding to the second feature data exists in the historical video frame;

[0033] Based on the confidence level corresponding to the second feature data, feature aggregation processing is performed on the first feature data and the second feature data to generate second aggregated feature data.

[0034] Here, the confidence corresponding to the second feature data is used to characterize the probability that the preset target corresponding to the second feature data exists in the historical video frame. The greater the confidence, the more credible the feature information of the second feature data. Furthermore, when the first feature data and the second feature data are subjected to feature aggregation processing based on the confidence corresponding to the second feature data, the feature information of the generated second aggregated feature data is richer and more accurate.

[0035] In a possible implementation, the performing feature aggregation processing on the first feature data and the second feature data based on the confidence corresponding to the second feature data to generate second aggregated feature data includes:

[0036] Selecting N1 target second feature data from the plurality of second feature data corresponding to the historical video frame in descending order of confidence; and performing feature aggregation processing on the N1 target second feature data and the first feature data to generate intermediate feature data; wherein N1 is a positive integer;

[0037] Repeat the following feature aggregation process M-1 times: select N from the plurality of second feature data corresponding to the historical video frames in descending order of confidence. i target second feature data; and the N i The second feature data of each target and the latest intermediate feature data are subjected to feature aggregation processing to generate updated intermediate feature data; wherein N i is less than N i-1 A positive integer; i = 2, 3, ..., M; M is a positive integer;

[0038] The intermediate feature data generated in the Mth feature aggregation process is used as the second aggregated feature data.

[0039] Here, a coarse-to-fine screening mechanism is adopted. In multiple feature fusion processes, the number of selected target second feature data decreases gradually. Through multiple feature aggregation processes, the features of the generated second aggregated feature data can be richer.

[0040] In a possible implementation manner, determining the detection result corresponding to the video frame to be tested based on the first aggregated feature data and the second aggregated feature data includes:

[0041] Performing feature fusion processing on the first aggregated feature data to generate fused first aggregated feature data;

[0042] Performing feature aggregation on the fused first aggregated feature data and the second aggregated feature data to generate third aggregated feature data;

[0043] Performing feature extraction on the third aggregated feature data to generate the target feature data;

[0044] Based on the target feature data, a detection result corresponding to the video frame to be tested is determined.

[0045] In a possible implementation manner, when the target video includes video data collected by the driving device during driving, after determining the detection result corresponding to the video frame to be tested, the method further includes:

[0046] The driving device is controlled based on the detection result corresponding to the video frame to be tested.

[0047] Here, by detecting the video frame to be tested, a relatively accurate detection result can be obtained, and then based on the detection result corresponding to the video frame to be tested, the driving device can be controlled more accurately to ensure the safe driving of the driving device.

[0048] In a possible implementation manner, when the target video includes video data corresponding to a driving road, after determining the detection result corresponding to the video frame to be tested, the method further includes:

[0049] Determining a road congestion state of the driving road based on detection results corresponding to each video frame to be tested in the target video;

[0050] Based on the road congestion status of the driving road, a traffic strategy for the driving road is generated.

[0051] Here, after obtaining relatively accurate detection results, the road congestion status of the driving road can be more accurately determined based on the detection results of each video frame to be tested in the target video, and a more effective traffic strategy can be further generated to ensure smooth driving on the driving road.

[0052] The effects of the following devices, electronic devices, etc. are described in the description of the above method and will not be repeated here.

[0053] In a second aspect, the present disclosure provides a target detection device, comprising:

[0054] An acquisition module, used for acquiring a video frame to be tested in a target video and a historical video frame before the video frame to be tested;

[0055] A first generating module, configured to perform feature aggregation processing on the historical video frame and the video frame to be tested to generate first aggregated feature data; and

[0056] A second generating module is used to perform target detection on the video frame to be tested and the historical video frame respectively, determine first feature data of the number of targets corresponding to the video frame to be tested, and second feature data of the number of targets corresponding to the historical video frame; and perform feature aggregation processing on the first feature data and the second feature data to generate second aggregated feature data;

[0057] A determination module is used to determine a detection result corresponding to the video frame to be tested based on the first aggregated feature data and the second aggregated feature data.

[0058] In a third aspect, the present disclosure provides an electronic device comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the target detection method described in the first aspect or any one of the embodiments are performed.

[0059] In a fourth aspect, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the target detection method as described in the first aspect or any one of the embodiments above are executed.

[0060] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following is a brief introduction to the drawings required for use in the embodiments. The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used together with the specification to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can also be obtained based on these drawings without creative work.

[0062] Figure 1 A schematic diagram of a process of a target detection method provided by an embodiment of the present disclosure is shown;

[0063] Figure 2 A schematic flow chart of a specific method of generating first aggregated feature data in a target detection method provided by an embodiment of the present disclosure is shown;

[0064] Figure 3 A schematic diagram of the architecture of a target neural network in a target detection method provided by an embodiment of the present disclosure is shown;

[0065] Figure 4 A schematic diagram of the architecture of a target detection device provided by an embodiment of the present disclosure is shown;

[0066] Figure 5 A schematic structural diagram of an electronic device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0067] In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The components of the embodiments of the present disclosure generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the drawings is not intended to limit the scope of the present disclosure for protection, but merely represents the selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present disclosure.

[0068] The task of video object detection is to detect a video sequence frame by frame and determine the detection result of each frame in the video sequence. Video object detection can be applied to smart devices such as monitoring equipment, motor vehicles, wearable devices, etc. However, due to the problems such as image blur, target occlusion, and abnormal target posture in the collected video, the accuracy of video object detection results is low.

[0069] Generally, when performing target detection on a video to be detected, target detection can be first performed on each frame of the image to be detected in the video to be detected to obtain the detection result of each frame of the image to be detected; then, a post-processing method is used to link the detection results of each frame of the image to be detected to obtain the detection result of the video to be detected. However, using the above method, when the image to be detected is blurred or the target object in the image to be detected is blocked, the accuracy of the detection result of the image to be detected is low, which will reduce the accuracy of the detection result of the video to be detected. At the same time, the method of linking the detection results of each frame of the image to be detected to obtain the detection result of the video to be detected will make the detection of the video to be detected more cumbersome and the detection efficiency is low.

[0070] The defects existing in the above solutions are the results obtained by the inventor after practice and careful research. Therefore, the discovery process of the above problems and the solutions proposed by the present disclosure for the above problems below should be the contributions made by the inventor to the present disclosure during the disclosure process.

[0071] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0072] To facilitate understanding of the embodiments of the present disclosure, a target detection method disclosed in the embodiments of the present disclosure is first introduced in detail. The execution subject of the target detection method provided in the embodiments of the present disclosure is generally a computer device with a certain computing capability, and the computer device includes, for example: a terminal device or a server or other processing device, and the terminal device can be a user equipment (User Equipment, UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (Personal Digital Assistant, PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. In some possible implementations, the target detection method can be implemented by a processor calling a computer-readable instruction stored in a memory.

[0073] See also Figure 1 FIG. 1 is a flow chart of a target detection method provided by an embodiment of the present disclosure, the method comprising S101-S104, wherein:

[0074] S101, obtaining a video frame to be tested and a historical video frame before the video frame to be tested in a target video;

[0075] S102, performing feature aggregation processing on the historical video frame and the video frame to be tested to generate first aggregated feature data;

[0076] S103, performing target detection on the video frame to be tested and the historical video frame respectively, determining first feature data of the number of targets corresponding to the video frame to be tested and second feature data of the number of targets corresponding to the historical video frame; and performing feature aggregation processing on the first feature data and the second feature data to generate second aggregated feature data;

[0077] S104: Determine a detection result corresponding to the video frame to be tested based on the first aggregated feature data and the second aggregated feature data.

[0078] In the above method, by acquiring the video frame to be tested and the historical video frame, feature aggregation processing is performed on the historical video frame and the video frame to be tested to generate first aggregated feature data, so that the first aggregated feature data can include the image feature information of the video frame to be tested and the historical video frame in time sequence; and target detection can be performed on the video frame to be tested and the historical video frame respectively to generate first feature data and second feature data, and feature aggregation processing is performed on the first feature data and the second feature data to generate second aggregated feature data, so that the generated second aggregated feature data contains the spatial features of the targets in the video frame to be tested and the historical video frame, and then based on the first aggregated feature data and the second aggregated feature data, the detection result of the video frame to be tested can be determined more accurately, thereby improving the accuracy of target video detection.

[0079] For S101:

[0080] The target video can be any video to be detected. For example, in an autonomous driving scenario, the target video can be a road video captured by a camera installed on the vehicle; in an augmented reality (AR) scenario, the target video can be a scene video captured in real time by an AR device during movement.

[0081] The video frame to be tested is any frame of the image to be detected in the target video, and the historical video frame is a historical image whose acquisition time is before the video frame to be tested, wherein the number of historical video frames can be one frame or multiple frames.

[0082] After obtaining the video frame to be tested and the historical video frames before the video frame to be tested in the target video in S101, the method further includes: extracting features from the video frame to be tested to obtain first image feature data; and extracting features from the historical video frames to obtain second image feature data.

[0083] After obtaining the first image feature data and the second image feature data, the second image feature data and the first image feature data can be subjected to feature aggregation processing to generate first aggregated feature data. Furthermore, target detection can be performed on the first image feature data and the second image feature data respectively to determine the first feature data corresponding to the first preset target in the video frame to be tested and the second feature data corresponding to the second preset target in the historical video frame.

[0084] In an optional implementation manner, the feature data of the image to be processed corresponding to the video frame to be processed is determined according to the following steps A1 and A2:

[0085] Step A1: extract features from the video frame to be processed and generate an intermediate feature map corresponding to the video frame to be processed.

[0086] Step A2, performing feature fusion processing on each feature data in the intermediate feature map to generate the image feature data to be processed corresponding to the video frame to be processed. When the video frame to be processed is a video frame to be tested, the image feature data to be processed is the first image feature data; when the video frame to be processed is a historical video frame, the image feature data to be processed is the second image feature data.

[0087] Taking the video frame to be processed as the video frame to be tested, and the image feature data to be processed as the first image feature data as an example, a feature extraction module (such as a convolutional neural network) can be used to extract features from the video frame to be tested, and generate an intermediate feature map corresponding to the video frame to be tested. Then, the encoder in the transformer structure can be used to perform feature fusion processing on each feature data in the intermediate feature map to generate the first image feature data corresponding to the video frame to be tested. Among them, the process of determining the second image feature data corresponding to the historical video frame can refer to the above-mentioned process of determining the first image feature data, which will not be described in detail here.

[0088] Here, feature extraction can be performed on the video frame to be processed to generate an intermediate feature map; then, feature fusion processing can be performed on the feature data in the intermediate feature map to generate feature data of the image to be processed, thereby enhancing the extracted image features, that is, the generated first image feature data and second image feature data can have richer image features.

[0089] In this method, S102 and S103 are executed in any order and can be executed in parallel.

[0090] For S102:

[0091] After the second image feature data corresponding to the historical video frame and the first image feature data corresponding to the video frame to be tested are generated, feature aggregation processing may be performed on the first image feature data and the second image feature data to generate first aggregated feature data.

[0092] In an alternative embodiment, see Figure 2 As shown, in the case where the historical video frame includes multiple frames, performing feature aggregation processing on the second image feature data and the first image feature data to generate first aggregated feature data may include:

[0093] S201, cascading the second image feature data corresponding to each historical video frame according to the acquisition time sequence of each historical video frame to generate cascaded second image feature data;

[0094] S202, performing feature aggregation processing on the cascaded second image feature data and the first image feature data to generate first aggregated feature data.

[0095] By adopting the above method, the second image feature data corresponding to each historical video frame is cascaded according to the acquisition time sequence corresponding to each historical video frame to generate cascaded second image feature data, so that the image features can be connected in time sequence, and then the cascaded second image feature data can be aggregated with the first image feature data to generate first aggregated feature data, so that the first aggregated feature data includes the image features and time sequence features in the historical video frames and the video frames to be tested.

[0096] In S201, it is assumed that the number of historical video frames is 3 frames, namely, the first historical video frame, the second historical video frame, and the third historical video frame, and the second image feature data corresponding to each historical video frame includes 16 feature vectors. According to the acquisition time corresponding to each historical video frame, the cascaded second image feature data can be generated. The cascaded second image feature data includes 48 feature vectors, among which the first 16 feature vectors of the 48 feature vectors correspond to the first historical video frame; the middle 16 feature vectors correspond to the second historical video frame; and the last 16 feature vectors correspond to the third historical video frame.

[0097] Furthermore, the encoder in the transformer structure can be used to perform feature aggregation processing on the cascaded second image feature data and the first image feature data to generate first aggregated feature data. Exemplarily, in step b1, the self-attention network can be used to perform feature fusion processing on the latest first image feature data to generate fused first image feature data. In step b2, the cross-attention network can be used to perform feature fusion processing on the cascaded second image feature data and the fused first image feature data to generate fused second image feature data. In step b3, the feed-forward neural network Feed-Forword Network can be used to extract features from the fused second image feature data to generate updated first image feature data. Repeat the above steps b1 to b3 for X times, and use the updated first image feature data generated for the last time as the first aggregated feature data. Among them, the value of X can be set according to actual needs, for example, X can be 3, 5, 8, etc.

[0098] For example, feature processing layers such as an attention network layer and a convolutional network layer can be used to perform feature fusion processing on feature data to generate fused feature data. Also, network structures such as an encoder or a decoder can be used to perform feature aggregation processing on feature data to generate aggregated feature data.

[0099] In S202, the cascaded second image feature data and the first image feature data are subjected to feature aggregation processing to generate first aggregated feature data, including:

[0100] S2021: Determine target image feature data from the cascaded second image feature data based on the determined quantity parameter.

[0101] S2022: Perform feature fusion processing on each intermediate image feature data in the first image feature data to generate fused first image feature data.

[0102] S2023: Perform feature aggregation on the target image feature data and the fused first image feature data to generate first aggregated feature data.

[0103] Among them, the execution order of S2021 and S2022 is not specific and can be executed in parallel.

[0104] In S2021, the value of the quantity parameter is smaller than the dimension of the second image feature data corresponding to each historical video frame. For example, when the second image feature data corresponding to each historical video frame includes 16 feature vectors, the value of the quantity parameter may be a positive integer smaller than 16.

[0105] During implementation, when the target detection method is executed by a trained target neural network, the quantity parameter can be used as a learnable network parameter of the target neural network, and the quantity parameter can be obtained after the target neural network is trained.

[0106] After determining the quantity parameter, the target image feature data can be determined from the cascaded second image feature data according to the following steps: for the candidate second image feature data corresponding to each historical video frame indicated by the cascaded second image feature data, select local image feature data consistent with the quantity parameter from the candidate second image feature data; then the local image feature data corresponding to each historical video frame can be obtained, and the local image feature data corresponding to each historical video frame can be cascaded again in the order of acquisition time to obtain the target image feature data.

[0107] Continuing with the example of S201, the second image feature data after cascading includes 48 feature vectors, and the first 16 feature vectors of the 48 feature vectors correspond to the first historical video frame; the middle 16 feature vectors correspond to the second historical video frame; and the last 16 feature vectors correspond to the third historical video frame. If the value of the quantity parameter is 9, then for the first 16 feature vectors (i.e., for the candidate second image feature data corresponding to the first historical video frame), using the set fully connected network, 9 serial numbers (each serial number corresponds to a feature vector) are obtained, and 9 feature vectors are selected from the first 16 feature vectors according to the obtained 9 serial numbers as the local image feature data corresponding to the first historical video frame; in the same way, 9 feature vectors are selected from the middle 16 feature vectors as the local image feature data corresponding to the second historical video frame; and in the same way, 9 feature vectors are selected from the last 16 feature vectors as the local image feature data corresponding to the third historical video frame.

[0108] Finally, the local image feature data corresponding to the first historical video frame, the local image feature data corresponding to the second historical video frame, and the local image feature data corresponding to the third historical video frame are cascaded to generate target image feature data, that is, the target image feature data includes the selected 27 feature vectors.

[0109] In S2022, illustratively, a self-attention network may be used to perform feature fusion processing on each intermediate image feature data in the first image feature data to generate fused first image feature data.

[0110] In S2023, the attention mechanism network can be used to perform feature aggregation on the target image feature data and the fused first image feature data to generate the fused target image feature data. The feed-forward neural network Feed-Forword Network can then be used to perform feature extraction on the fused target image feature data to generate updated first image feature data. The updated first image feature data can then be used to repeatedly perform S2021 to S2023 multiple times, and the updated first image feature data generated by the last process is used as the first aggregated feature data.

[0111] Here, by determining the target image feature data from the cascaded second image feature data based on a determined quantity parameter, the second image feature data is screened, and then when the target image feature data and the fused first image feature data are feature aggregated to generate the first aggregated feature data, the amount of calculation can be reduced, thereby improving the efficiency of video detection.

[0112] For S103:

[0113] After generating the second image feature data corresponding to the historical video frame and the first image feature data corresponding to the video frame to be tested, target detection can be performed on the first image feature data and the second image feature data respectively to determine the first feature data corresponding to the first preset target in the video frame to be tested, and the second feature data corresponding to the second preset target in the historical video frame.

[0114] During implementation, the initial feature vector of the target quantity and the first image feature data can be input into the decoder in the transformer structure to generate the first feature data of the target quantity corresponding to the video frame to be tested. The target quantity can be set according to the specific scenario, and the target quantity can be used to characterize the number of preset targets included in the video frame to be tested or the historical video frame, and each preset target in the video frame to be tested corresponds to a first feature data. For example, when the target quantity is 10, 10 first feature data can be generated.

[0115] When there are multiple historical video frames, for each historical video frame, the target number of initial feature vectors and the second image feature data corresponding to the historical video frame can be input into the decoder in the transformer structure to generate the target number of second feature data corresponding to the historical video frame, and each preset target in the historical video frame corresponds to one second feature data. Then, the second feature data corresponding to each historical video frame in the multiple historical video frames can be obtained.

[0116] In an optional implementation, in S103, performing feature aggregation processing on the first feature data and the second feature data to generate second aggregated feature data may include:

[0117] S1031, determining the confidence level corresponding to each second feature data; wherein the confidence level is used to characterize the probability that the preset target corresponding to the second feature data exists in the historical video frame.

[0118] S1032: Based on the confidence level corresponding to the second feature data, perform feature aggregation processing on the first feature data and the second feature data to generate second aggregated feature data.

[0119] Here, the confidence corresponding to the second feature data is used to characterize the probability that the preset target corresponding to the second feature data exists in the historical video frame. The greater the confidence, the more credible the feature information of the second feature data. Furthermore, when the first feature data and the second feature data are subjected to feature aggregation processing based on the confidence corresponding to the second feature data, the feature information of the generated second aggregated feature data is richer and more accurate.

[0120] In S1031, for example, a fully connected neural network may be used to determine the confidence level of the second feature data corresponding to each preset target, wherein the confidence level may be used to characterize the probability that the preset target corresponding to the second feature data exists in the historical video frame.

[0121] In an optional implementation, in S1032, based on the confidence corresponding to the second feature data, performing feature aggregation processing on the first feature data and the second feature data to generate second aggregated feature data may include:

[0122] Step C1, selecting N1 target second feature data from multiple second feature data corresponding to the historical video frame in descending order of confidence; and performing feature aggregation processing on the N1 target second feature data and the first feature data to generate intermediate feature data; wherein N1 is a positive integer;

[0123] Step C2, repeat the following feature aggregation process M-1 times: select N from the plurality of second feature data corresponding to the historical video frames in descending order of confidence. i The second characteristic data of the target; and N i The second feature data of each target and the latest intermediate feature data are subjected to feature aggregation processing to generate updated intermediate feature data; wherein N i is less than N i-1 A positive integer; i = 2, 3, ..., M; M is a positive integer;

[0124] Step C3: Use the intermediate feature data generated by the Mth feature aggregation process as the second aggregated feature data.

[0125] In step C1, when the historical video frame is a plurality of frames, the plurality of second feature data include the second feature data corresponding to the plurality of frames of historical video frames. For example, if the historical video frame is k frames, and each frame of the historical video frame corresponds to j second feature data (i.e., the target number is j), then the plurality of second feature data corresponding to the historical video frame include k×j second feature data. That is, N1 target second feature data can be selected from the k×j second feature data in descending order of confidence. The value of N1 can be any positive integer less than or equal to the number of the plurality of second feature data (i.e., N1≤k×j).

[0126] Exemplarily, when the number of N1 is equal to the number of multiple second feature data (i.e., multiple second feature data are all selected), the self-attention network can be used to perform feature fusion processing on multiple first feature data to generate fused first feature data; when the second preset target is 16, the 16 target second feature data can be sorted according to confidence, and the cross-attention network can be used to perform feature fusion processing on the sorted N1 (i.e., 16) target second feature data and the fused first feature data to generate fused second feature data; and then the feedforward neural network Feed-Forword Network can be used to perform feature extraction on the fused second feature data to generate intermediate feature data.

[0127] In steps C2 and C3, during the M feature aggregation process, N i The value is less than N i-1 , that is, during the feature fusion process, the target second feature data will decrease successively. During implementation, in the first feature aggregation process (i.e., when i=2), N2 target second feature data can be selected from each second feature data in order of confidence from large to small; and the Self-Attention network can be used to perform feature fusion processing on multiple intermediate feature data to generate fused intermediate feature data, and then the Cross-Attention Network can be used to perform feature fusion processing on the sorted N2 target second feature data and the fused intermediate feature data to generate fused second feature data; and then the Feed-ForwordNetwork can be used to perform feature extraction on the fused second feature data to generate updated intermediate feature data. And the updated intermediate feature data is used to perform the second feature aggregation process (i.e., i=3); after executing M times, the intermediate feature data generated by the Mth feature aggregation process can be used as the second aggregated feature data.

[0128] Here, a coarse-to-fine screening mechanism is adopted. In multiple feature aggregation processes, the number of selected target second feature data decreases gradually. Through multiple feature aggregation processes, the features of the generated second aggregated feature data can be richer.

[0129] For S104:

[0130] The first aggregated feature data and the second aggregated feature data may be subjected to feature aggregation processing to generate target feature data, and then based on the target feature data, the detection result corresponding to the video frame to be detected may be determined. For example, the detection result may include the category and location information corresponding to the target included in the video to be detected. The target object may be any object appearing in the target video, for example, the target object may be a pedestrian, a vehicle, an animal, a traffic sign, and the like.

[0131] In an optional implementation, in S104, determining the detection result corresponding to the video frame to be tested based on the first aggregated feature data and the second aggregated feature data may include:

[0132] S1041, performing feature fusion processing on the first aggregated feature data to generate fused first aggregated feature data;

[0133] S1042, performing feature aggregation on the fused first aggregated feature data and the second aggregated feature data to generate third aggregated feature data;

[0134] S1043, performing feature extraction on the third aggregated feature data to generate target feature data;

[0135] S1044: Determine a detection result corresponding to the video frame to be tested based on the target feature data.

[0136] Exemplarily, the Self-Attention network can be used to perform feature fusion processing on the first aggregated feature data to generate fused first aggregated feature data. The Cross-Attention Network can then be used to perform feature aggregation on the fused first aggregated feature data and the second aggregated feature data to generate third aggregated feature data. The Feed-Forword Network can then be used to perform feature extraction on the third aggregated feature data to generate target feature data. The target feature data is then feature processed to determine the detection result corresponding to the video frame to be tested.

[0137] In an optional implementation, when the target video includes video data collected by the driving device during driving, after determining the detection result corresponding to the video frame to be tested, it also includes: controlling the driving device based on the detection result corresponding to the video frame to be tested.

[0138] In this application scenario, the detection result corresponding to the video frame to be tested may include the category and location information of the target object, and the target object may be any obstacle encountered by the driving device during driving, such as pedestrians, vehicles, traffic road signs, fences, etc. The driving device may be, for example, but not limited to, any of the following: an autonomous driving vehicle, a vehicle equipped with an Advanced Driving Assistance System (ADAS), or a robot, etc.

[0139] During implementation, the traveling device can be controlled according to the category and / or location information of the target object, for example, including controlling the acceleration, deceleration, steering, braking, etc. of the traveling device, or voice prompt information can be played to prompt the driver to control the acceleration, deceleration, steering, braking, etc. of the traveling device.

[0140] Here, by detecting the video frame to be tested, a relatively accurate detection result can be obtained, and then based on the detection result of the target object included in the video frame to be tested, the driving device can be controlled more accurately to ensure the safe driving of the driving device.

[0141] In an optional implementation, when the target video includes video data corresponding to the driving road, after determining the detection results corresponding to the video frames to be tested, it also includes: determining the road congestion status of the driving road based on the detection results of each video frame to be tested in the target video; and generating a traffic strategy for the driving road based on the road congestion status of the driving road.

[0142] Exemplarily, based on the detection results corresponding to each video frame to be tested in the target video, vehicle traffic information such as the number of vehicles existing on the driving road and the number of vehicles passing through the intersection per unit time can be determined; then, based on the vehicle traffic information, the road congestion state of the driving road can be determined. For example, if the number of vehicles existing on the driving road is greater than a set first vehicle threshold, and / or the number of vehicles passing through the intersection per unit time is less than a set second vehicle threshold, then the driving road is determined to be congested. Then, based on the road congestion state of the driving road, a traffic strategy for the driving road can be generated. For example, staff can be controlled to clear vehicles, or a congestion warning can be generated to prevent other vehicles from driving on the driving road.

[0143] Here, after obtaining relatively accurate detection results, the road congestion status of the driving road can be more accurately determined based on the detection results of the target objects corresponding to each video frame to be tested in the target video, and a more effective traffic strategy can be further generated to ensure smooth driving on the driving road.

[0144] In specific implementation, the target detection method can be executed by the trained target neural network, see Figure 3A schematic diagram of the architecture of a target neural network in a target detection method shown in FIG. Figure 3 The target neural networks in the method include Convolutional Neural Networks (CNN), Spatial Transformer Encoder (STE), Spatial Transformer Decoder (STD), Temporal Query Encoder (TQE), Temporal Deformable Transformer Encoder (TDTE), Temporal Deformable Transformer Decoder (TDTD), and Feedforward Neural Network (FNN). Among them, CNN, STE, and STD can share weight parameters, for example, the same CNN can be used to extract features from the test video frames and historical video frames respectively.

[0145] The following combination Figure 3 The target neural network is used to exemplify the execution process of the target detection method. The video frame to be tested and the historical video frame can be input into the target neural network, and the CNN in the target neural network extracts features from the video frame to be tested and the historical video frame, respectively, to generate an intermediate feature map to be tested corresponding to the video frame to be tested and a historical intermediate feature map corresponding to the historical video frame; and then the STE is used to perform feature fusion processing on the intermediate feature map to be tested and the historical intermediate feature map, respectively, to generate first image feature data corresponding to the video frame to be tested and second image feature data corresponding to the historical video frame.

[0146] On the one hand, the Self-Attention network included in TDTE can be used to perform feature fusion processing on the first image feature data to generate fused first image feature data; and the second image feature data corresponding to each historical video frame can be cascaded according to the acquisition time sequence of each historical video frame to generate cascaded second image feature data; and the Temporal Deformable Attention network in TDTE can be used to determine the target image feature data from the cascaded second image feature data based on a determined quantity parameter; and the target image feature data and the fused first image feature data are feature aggregated to generate fused target image feature data. The Feed-Forword Network in TDTE is then used to extract features from the fused target image feature data to generate updated first image feature data. The above process is repeated multiple times for the updated first image feature data, and the updated first image feature data generated last is used as the first aggregated feature data.

[0147] On the other hand, STD can be used to perform target detection on the first image feature data and the second image feature data respectively, to determine the first feature data corresponding to the first preset target in the video frame to be tested, and the second feature data corresponding to the second preset target in the historical video frame. Specifically, the initial feature vector of the target quantity and the first image feature data can be input into STD to generate the first feature data of the target quantity corresponding to the video frame to be tested. And the initial feature vector of the target quantity and the second image feature data can be input into STD to generate the second feature data of the target quantity corresponding to the historical video frame.

[0148] The target quantity is used to characterize the quantity of preset targets included in the historical video frame or the video frame to be tested, and each preset target in the video frame to be tested corresponds to a first feature data, and each preset target in the historical video frame corresponds to a second feature data.

[0149] The Self-Attention network in TQE performs feature fusion processing on multiple first feature data to generate fused first feature data; and the fully connected network included in TQE can determine the confidence of the second feature data corresponding to each second preset target, and can sort each second feature data in order from large to small confidence. Then, N1 target second feature data can be selected from the sorted multiple second feature data, and the Cross-Attention Network in TQE performs feature fusion processing on the N1 target second feature data and the fused first feature data to generate intermediate feature data. Then, the updated intermediate feature data and the selected N iThe above feature fusion process is repeated M times, and the intermediate feature data generated by the M-th feature fusion process can be used as the second aggregated feature data.

[0150] Next, the Self-Attention network in TDTD can perform feature fusion processing on the first aggregated feature data to generate fused first aggregated feature data. Then, the Cross-Attention Network can be used to perform feature aggregation on the fused first aggregated feature data and the second aggregated feature data to generate third aggregated feature data. Then, the Feed-Forword Network can be used to extract features from the third aggregated feature data to generate target feature data.

[0151] Finally, FNN can be used to perform feature processing on the target feature data to determine the detection result of the target object included in the video frame to be tested. For example, FNN1 can be used to determine the category of the target object, and FNN2 can be used to determine the position information of the detection frame of the target object.

[0152] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.

[0153] Based on the same concept, the present disclosure also provides a target detection device, see Figure 4 As shown, it is a schematic diagram of the architecture of the target detection device provided by the embodiment of the present disclosure, including an acquisition module 401, a first generation module 402, a second generation module 403, and a determination module 404. Specifically:

[0154] An acquisition module 401 is used to acquire a video frame to be tested in a target video and a historical video frame before the video frame to be tested;

[0155] A first generating module 402 is used to perform feature aggregation processing on the historical video frame and the video frame to be tested to generate first aggregated feature data; and

[0156] The second generating module 403 is used to perform target detection on the video frame to be tested and the historical video frame respectively, determine the first feature data of the number of targets corresponding to the video frame to be tested, and the second feature data of the number of targets corresponding to the historical video frame; and perform feature aggregation processing on the first feature data and the second feature data to generate second aggregated feature data;

[0157] The determination module 404 is used to determine the detection result corresponding to the video frame to be tested based on the first aggregated feature data and the second aggregated feature data.

[0158] In a possible implementation manner, after obtaining the video frame to be tested in the target video and the historical video frame before the video frame to be tested, the method further includes: an extraction module 405, which is used to: perform feature extraction on the video frame to be tested to obtain first image feature data; and perform feature extraction on the historical video frame to obtain second image feature data;

[0159] The first generating module 402, when performing feature aggregation processing on the historical video frame and the video frame to be tested to generate first aggregated feature data, is used to: perform feature aggregation processing on the second image feature data and the first image feature data to generate first aggregated feature data;

[0160] The second generating module 403 is used to perform the target detection by using the first image feature data and the second image feature data when performing target detection on the video frame to be detected and the historical video frame respectively.

[0161] In a possible implementation, the extraction module 405 is used to determine the feature data of the image to be processed corresponding to the video frame to be processed according to the following steps:

[0162] Extracting features from the video frame to be processed to generate an intermediate feature map corresponding to the video frame to be processed;

[0163] Performing feature fusion processing on each feature data in the intermediate feature map to generate the image feature data to be processed corresponding to the video frame to be processed;

[0164] Among them, when the video frame to be processed is the video frame to be tested, the image feature data to be processed is the first image feature data; when the video frame to be processed is the historical video frame, the image feature data to be processed is the second image feature data.

[0165] In a possible implementation manner, when the historical video frame includes multiple frames, the first generating module 402, when performing feature aggregation processing on the second image feature data and the first image feature data to generate first aggregated feature data, is used to:

[0166] According to the acquisition time sequence of each historical video frame, the second image feature data corresponding to each historical video frame is cascaded to generate cascaded second image feature data;

[0167] The cascaded second image feature data and the first image feature data are subjected to feature aggregation processing to generate first aggregated feature data.

[0168] In a possible implementation manner, the first generating module 402 performs feature aggregation processing on the cascaded second image feature data and the first image feature data to generate first aggregated feature data, including:

[0169] determining target image feature data from the cascaded second image feature data based on the determined quantity parameter; and

[0170] Performing feature fusion processing on each intermediate image feature data in the first image feature data to generate fused first image feature data;

[0171] The target image feature data and the fused first image feature data are feature aggregated to generate the first aggregated feature data.

[0172] In a possible implementation manner, the second generating module 403, when performing feature aggregation processing on the first feature data and the second feature data to generate second aggregated feature data, is used to:

[0173] Determine the confidence level corresponding to each of the second feature data; wherein the target quantity is used to characterize the number of preset targets included in the historical video frame or the video frame to be tested, and the confidence level is used to characterize the probability that the preset target corresponding to the second feature data exists in the historical video frame;

[0174] Based on the confidence level corresponding to the second feature data, feature aggregation processing is performed on the first feature data and the second feature data to generate second aggregated feature data.

[0175] In a possible implementation, when there are multiple first preset targets and multiple second preset targets, the second generating module 403, when performing feature aggregation processing on the first feature data and the second feature data based on the confidence corresponding to the second feature data to generate second aggregated feature data, is used to:

[0176] Selecting N1 target second feature data from the plurality of second feature data corresponding to the historical video frame in descending order of confidence; and performing feature aggregation processing on the N1 target second feature data and the first feature data to generate intermediate feature data; wherein N1 is a positive integer;

[0177] Repeat the following feature aggregation process M-1 times: select N from the plurality of second feature data corresponding to the historical video frames in descending order of confidence. i target second feature data; and the N iThe second feature data of each target and the latest intermediate feature data are subjected to feature aggregation processing to generate updated intermediate feature data; wherein N i is less than N i-1 A positive integer; i = 2, 3, ..., M; M is a positive integer;

[0178] The intermediate feature data generated in the Mth feature aggregation process is used as the second aggregated feature data.

[0179] In a possible implementation, the determination module 404, when determining the detection result corresponding to the video frame to be tested based on the first aggregated feature data and the second aggregated feature data, is configured to:

[0180] Performing feature fusion processing on the first aggregated feature data to generate fused first aggregated feature data;

[0181] Performing feature aggregation on the fused first aggregated feature data and the second aggregated feature data to generate third aggregated feature data;

[0182] Performing feature extraction on the third aggregated feature data to generate the target feature data;

[0183] Based on the target feature data, a detection result corresponding to the video frame to be tested is determined.

[0184] In a possible implementation manner, when the target video includes video data collected by the driving device during driving, after determining the detection result corresponding to the video frame to be tested, the method further includes: a control module 406 for:

[0185] The driving device is controlled based on the detection result corresponding to the video frame to be tested.

[0186] In a possible implementation manner, when the target video includes video data corresponding to a driving road, after determining the detection result corresponding to the video frame to be tested, the method further includes: a third generating module 407, which is used to:

[0187] Determining a road congestion state of the driving road based on detection results corresponding to each video frame to be tested in the target video;

[0188] Based on the road congestion status of the driving road, a traffic strategy for the driving road is generated.

[0189] In some embodiments, the functions or templates contained in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0190] Based on the same technical concept, the embodiment of the present disclosure also provides an electronic device. Figure 5 As shown, it is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure, including a processor 501, a memory 502, and a bus 503. Among them, the memory 502 is used to store execution instructions, including a memory 5021 and an external memory 5022; the memory 5021 here is also called an internal memory, which is used to temporarily store the operation data in the processor 501, and the data exchanged with the external memory 5022 such as a hard disk. The processor 501 exchanges data with the external memory 5022 through the memory 5021. When the electronic device 500 is running, the processor 501 communicates with the memory 502 through the bus 503, so that the processor 501 executes the following instructions:

[0191] Acquire a video frame to be tested in a target video and a historical video frame before the video frame to be tested;

[0192] Performing feature aggregation processing on the historical video frame and the video frame to be tested to generate first aggregated feature data; and

[0193] Performing target detection on the video frame to be tested and the historical video frame respectively, determining first feature data of the number of targets corresponding to the video frame to be tested, and second feature data of the number of targets corresponding to the historical video frame; and performing feature aggregation processing on the first feature data and the second feature data to generate second aggregated feature data;

[0194] Based on the first aggregated feature data and the second aggregated feature data, a detection result corresponding to the video frame to be tested is determined.

[0195] In addition, the embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the target detection method described in the above method embodiment are executed. The storage medium can be a volatile or non-volatile computer-readable storage medium.

[0196] The embodiments of the present disclosure also provide a computer program product, which carries a program code. The instructions included in the program code can be used to execute the steps of the target detection method described in the above method embodiment. For details, please refer to the above method embodiment, which will not be repeated here.

[0197] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is implemented as a computer storage medium. In another optional embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).

[0198] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.

[0199] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0200] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0201] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0202] The above are only specific embodiments of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present disclosure, which should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.

Claims

1. A target detection method, characterized in that: include: Acquire a video frame to be tested in a target video and a historical video frame before the video frame to be tested; Performing feature aggregation processing on the historical video frame and the video frame to be tested to generate first aggregated feature data; and Performing target detection on the video frame to be tested and the historical video frame respectively, determining first feature data of the number of targets corresponding to the video frame to be tested, and second feature data of the number of targets corresponding to the historical video frame; and performing feature aggregation processing on the first feature data and the second feature data to generate second aggregated feature data; Determine a detection result corresponding to the video frame to be tested based on the first aggregated feature data and the second aggregated feature data; The performing feature aggregation processing on the first feature data and the second feature data to generate second aggregated feature data includes: Determine the confidence level corresponding to each of the second feature data; wherein the target quantity is used to characterize the number of preset targets included in the historical video frame or the video frame to be tested, and the confidence level is used to characterize the probability that the preset target corresponding to the second feature data exists in the historical video frame; Based on the confidence level corresponding to the second feature data, performing feature aggregation processing on the first feature data and the second feature data to generate second aggregated feature data; The first feature data and the second feature data are subjected to feature aggregation processing based on the confidence corresponding to the second feature data to generate second aggregated feature data, including: selecting N1 target second feature data from multiple second feature data corresponding to the historical video frame in descending order of confidence; and performing feature aggregation processing on the N1 target second feature data and the first feature data to generate intermediate feature data; wherein N1 is a positive integer; and repeatedly performing the following feature aggregation process M-1 times: selecting N1 target second feature data from multiple second feature data corresponding to the historical video frame in descending order of confidence; i target second feature data; and the N i The second feature data of each target and the latest intermediate feature data are subjected to feature aggregation processing to generate updated intermediate feature data; wherein N i is less than N i-1 i=2, 3, ..., M; M is a positive integer; the intermediate feature data generated by the Mth feature aggregation process is used as the second aggregated feature data; The determining of the detection result corresponding to the video frame to be tested based on the first aggregated feature data and the second aggregated feature data includes: performing feature fusion processing on the first aggregated feature data to generate fused first aggregated feature data; performing feature aggregation on the fused first aggregated feature data and the second aggregated feature data to generate third aggregated feature data; performing feature extraction on the third aggregated feature data to generate target feature data; and determining the detection result corresponding to the video frame to be tested based on the target feature data.

2. The method according to claim 1, characterized in that After obtaining the video frame to be tested in the target video and the historical video frame before the video frame to be tested, the method further includes: Extracting features from the video frame to be tested to obtain first image feature data; and extracting features from the historical video frame to obtain second image feature data; The performing feature aggregation processing on the historical video frame and the video frame to be tested to generate first aggregated feature data includes: Performing feature aggregation processing on the second image feature data and the first image feature data to generate first aggregated feature data; Performing target detection on the video frame to be tested and the historical video frame respectively includes: The target detection is performed using the first image feature data and the second image feature data.

3. The method according to claim 2, characterized in that Determine the image feature data to be processed corresponding to the video frame to be processed according to the following steps: Extracting features from the video frame to be processed to generate an intermediate feature map corresponding to the video frame to be processed; Performing feature fusion processing on each feature data in the intermediate feature map to generate the image feature data to be processed corresponding to the video frame to be processed; Among them, when the video frame to be processed is the video frame to be tested, the image feature data to be processed is the first image feature data; when the video frame to be processed is the historical video frame, the image feature data to be processed is the second image feature data.

4. The method according to claim 2, characterized in that In the case where the historical video frame includes multiple frames, performing feature aggregation processing on the second image feature data and the first image feature data to generate first aggregated feature data includes: According to the acquisition time sequence of each historical video frame, the second image feature data corresponding to each historical video frame is cascaded to generate cascaded second image feature data; The cascaded second image feature data and the first image feature data are subjected to feature aggregation processing to generate first aggregated feature data.

5. The method according to claim 4, characterized in that The step of performing feature aggregation processing on the cascaded second image feature data and the first image feature data to generate first aggregated feature data includes: determining target image feature data from the cascaded second image feature data based on the determined quantity parameter; and Performing feature fusion processing on each intermediate image feature data in the first image feature data to generate fused first image feature data; The target image feature data and the fused first image feature data are feature aggregated to generate the first aggregated feature data.

6. The method according to any one of claims 1 to 5, characterized in that: In the case where the target video includes video data collected by the driving device during driving, after determining the detection result corresponding to the video frame to be tested, the method further includes: The driving device is controlled based on the detection result corresponding to the video frame to be tested.

7. The method according to any one of claims 1 to 5, characterized in that: In the case where the target video includes video data corresponding to a driving road, after determining the detection result corresponding to the video frame to be tested, the method further includes: Determining a road congestion state of the driving road based on detection results corresponding to each video frame to be tested in the target video; Based on the road congestion status of the driving road, a traffic strategy for the driving road is generated.

8. A target detection device, characterized in that: include: An acquisition module, used for acquiring a video frame to be tested in a target video and a historical video frame before the video frame to be tested; A first generating module, configured to perform feature aggregation processing on the historical video frame and the video frame to be tested to generate first aggregated feature data; as well as A second generating module is used to perform target detection on the video frame to be tested and the historical video frame respectively, determine first feature data of the number of targets corresponding to the video frame to be tested, and second feature data of the number of targets corresponding to the historical video frame; and perform feature aggregation processing on the first feature data and the second feature data to generate second aggregated feature data; A determination module, configured to determine a detection result corresponding to the video frame to be tested based on the first aggregated feature data and the second aggregated feature data; The second generating module, when performing feature aggregation processing on the first feature data and the second feature data to generate second aggregated feature data, is used to: Determine the confidence level corresponding to each of the second feature data; wherein the target number is used to characterize the number of preset targets included in the historical video frame or the video frame to be tested, and the confidence level is used to characterize the probability that the preset target corresponding to the second feature data exists in the historical video frame; based on the confidence level corresponding to the second feature data, perform feature aggregation processing on the first feature data and the second feature data to generate second aggregated feature data; The second generating module, when performing feature aggregation processing on the first feature data and the second feature data based on the confidence corresponding to the second feature data to generate second aggregated feature data, is used to: select N1 target second feature data from multiple second feature data corresponding to the historical video frame in descending order of confidence; and perform feature aggregation processing on the N1 target second feature data and the first feature data to generate intermediate feature data; wherein N1 is a positive integer; and repeatedly perform the following feature aggregation process M-1 times: select N1 target second feature data from multiple second feature data corresponding to the historical video frame in descending order of confidence; i target second feature data; and the N i The second feature data of each target and the latest intermediate feature data are subjected to feature aggregation processing to generate updated intermediate feature data; wherein N i is less than N i-1 i=2, 3, ..., M; M is a positive integer; the intermediate feature data generated by the Mth feature aggregation process is used as the second aggregated feature data; The determination module, when determining the detection result corresponding to the video frame to be tested based on the first aggregated feature data and the second aggregated feature data, is used to: perform feature fusion processing on the first aggregated feature data to generate fused first aggregated feature data; perform feature aggregation on the fused first aggregated feature data and the second aggregated feature data to generate third aggregated feature data; perform feature extraction on the third aggregated feature data to generate target feature data; and determine the detection result corresponding to the video frame to be tested based on the target feature data.

9. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the target detection method as described in any one of claims 1 to 7 are performed.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the target detection method according to any one of claims 1 to 7 are executed.

Citation Information

Patent Citations

  • Target object detection method and device, storage medium and electronic equipment

    CN110738108A