Target detection method and device, electronic equipment and storage medium

The target detection method enhances detection accuracy and efficiency in dense scenes by employing multi-scale feature extraction, reconstruction, and fusion techniques, addressing the challenges of small target detection in crowded environments.

CN119206187APending Publication Date: 2024-12-27IFLYTEK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411353636.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

Existing target detection methods in dense scenes suffer from poor detection performance for small targets and low detection efficiency, particularly in scenarios with a large number of objects of the same type and similar postures, such as dense crowds and commodity displays.

Method used

A target detection method involving multi-scale feature extraction, feature reconstruction, and feature fusion using Fourier transforms and color features, combined with self-attention and cross-scale interactions, to enhance high-resolution features for accurate detection.

Benefits of technology

Improves detection accuracy and efficiency for small targets in dense scenes by introducing fine-grained information and reducing computational complexity, thereby overcoming the limitations of traditional methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119206187A_ABST
    Figure CN119206187A_ABST
Patent Text Reader

Abstract

The invention provides a target detection method and device, electronic equipment and a storage medium, and the method comprises the steps: carrying out the multi-scale feature extraction of a dense scene image, obtaining a multi-scale image feature, and carrying out the feature reconstruction based on the multi-scale image feature and the dense scene image, and obtaining a multi-scale high-resolution feature; according to the method, multi-scale high-resolution features are subjected to feature fusion, target detection is carried out based on the features obtained through fusion, a target detection result corresponding to a dense scene image is obtained, and the high-resolution features containing more fine-grained information are introduced in a feature extraction stage, so that target detection in a dense scene is more facilitated; according to the invention, a more accurate detection result can be obtained, the defect that the detection performance of a small target in a traditional detection scheme in a dense scene is poor is overcome, meanwhile, the problem of missing detection and the problem of tedious post-processing caused by bounding box overlapping in the dense scene are relieved, and dual improvement of the detection precision and the detection efficiency is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] With the development of computer vision technology, object detection in dense scenes has become one of the key technologies in many fields, and its application scenarios cover industrial monitoring, smart cities, public safety, etc. Dense scenes usually refer to scenes where there are a large number of objects of the same type with similar postures and close positions in the same field of view, such as dense crowds and commodity displays. Object detection in such scenes still faces many challenges.

[0003] At present, most methods for object detection in dense scenes are based on Transformer methods, such as the DETR (Detection Transformer) model. This method regards object detection in dense scenes as a set prediction problem. Compared with methods based on convolutional neural networks, it does not require the generation of candidate regions or complex post-processing steps, providing a new idea for object detection in dense scenes. However, the DETR model converges slowly during training, and its detection performance for small objects still needs to be improved. Summary of the invention

[0004] The present invention provides a target detection method, device, electronic device and storage medium to solve the problems of poor detection performance of target detection schemes in dense scenes in the prior art for small targets and low detection efficiency, thereby improving the detection accuracy and efficiency of small targets.

[0005] The present invention provides a target detection method, comprising: Determining a dense scene image to be detected; Performing multi-scale feature extraction on the dense scene image to obtain multi-scale image features, and performing feature reconstruction based on the multi-scale image features and the dense scene image to obtain multi-scale high-resolution features; The multi-scale high-resolution features are subjected to feature fusion, and target detection is performed based on the fused features to obtain a target detection result corresponding to the dense scene image.

[0006] According to a target detection method provided by the present invention, the feature reconstruction based on the multi-scale image features and the dense scene image to obtain multi-scale high-resolution features includes: Performing Fourier transform on the dense scene image to obtain Fourier features and color features; Feature reconstruction is performed based on the Fourier feature, the color feature and the multi-scale image feature to obtain multi-scale high-resolution features.

[0007] According to a target detection method provided by the present invention, multi-scale feature extraction is performed on the dense scene image to obtain multi-scale image features, and feature reconstruction is performed based on the multi-scale image features and the dense scene image to obtain multi-scale high-resolution features, including: Based on the feature enhancement network, multi-scale feature extraction is performed on the dense scene image to obtain multi-scale image features, and feature reconstruction is performed based on the multi-scale image features and the dense scene image to obtain multi-scale high-resolution features; Among them, the feature enhancement network is obtained by consistency training between the first image feature and the first low-resolution feature at the same scale corresponding to the first sample image, the first low-resolution feature is obtained by bias learning based on the first high-resolution feature of the corresponding scale, and the first sample image includes a first sample dense scene image and a first enhanced dense scene image corresponding to the first sample dense scene image.

[0008] According to a target detection method provided by the present invention, the feature fusion of the multi-scale high-resolution features and the target detection based on the fused features are performed to obtain the target detection result corresponding to the dense scene image, including: Performing self-attention interaction based on the high-resolution features of the target scale in the multi-scale high-resolution features to obtain a self-attention interaction feature; Performing attention interaction based on the self-attention interaction feature and high-resolution features of other scales in the multi-scale high-resolution features to obtain a cross-scale interaction feature; Target detection is performed based on the cross-scale interaction features to obtain a target detection result corresponding to the dense scene image.

[0009] According to a target detection method provided by the present invention, the feature fusion of the multi-scale high-resolution features and the target detection based on the fused features are performed to obtain the target detection result corresponding to the dense scene image, including: Based on the target detection network, feature fusion is performed on the multi-scale high-resolution features, and target detection is performed based on the fused features to obtain a target detection result corresponding to the dense scene image; wherein the target detection network is trained based on the initial detection result, the predicted detection result and the sample detection result corresponding to the second sample image; The initial detection result is obtained by performing target detection on the second sample image by the target detection network during the training process, and there are multiple prediction boxes, categories and classification scores corresponding to any target in the initial detection result; the predicted detection result is determined based on the initial detection result, and there is a prediction box and category corresponding to any target in the predicted detection result; the second sample image includes a second sample dense scene image, or a second enhanced dense scene image corresponding to the second sample dense scene image.

[0010] According to a target detection method provided by the present invention, the target detection network is trained based on the following steps: Performing multi-scale feature extraction on the second sample image to obtain multi-scale second image features, and performing feature reconstruction based on the multi-scale second image features and the second sample image to obtain multi-scale second high-resolution features; Based on the target detection network in the training process, feature fusion is performed on the multi-scale second high-resolution features, and target detection is performed based on the fused second features to obtain an initial detection result corresponding to the second sample image; Based on the classification scores of the prediction boxes of any target in the initial detection result, multiple target prediction boxes are obtained by screening the prediction boxes, and classification prediction is performed based on the multiple target prediction boxes of each target to obtain a prediction detection result corresponding to the second sample image; Based on the predicted detection result and the sample detection result corresponding to the second sample image, and the consistency between the classification score of each target prediction frame of the any target in the initial detection result and the overlap score of each target prediction frame of the any target, iterating parameters of the target detection network in the training process to obtain the target detection network; Among them, the overlap score of any target prediction box is determined based on the overlap between the any target prediction box and other target prediction boxes of the corresponding target.

[0011] According to a target detection method provided by the present invention, the second sample image is determined based on the following steps: Obtain an initial dense scene image; Performing size normalization processing on the initial dense scene image to obtain a normalized dense scene image; Performing normalization processing on the normalized dense scene image to obtain a second sample dense scene image; Data enhancement is performed on the second sample dense scene image to obtain a second enhanced dense scene image.

[0012] The present invention also provides a target detection device, comprising: An image determination unit, used to determine a dense scene image to be detected; A feature enhancement unit, configured to perform multi-scale feature extraction on the dense scene image to obtain multi-scale image features, and perform feature reconstruction based on the multi-scale image features and the dense scene image to obtain multi-scale high-resolution features; The target detection unit is used to perform feature fusion on the multi-scale high-resolution features, and perform target detection based on the fused features to obtain a target detection result corresponding to the dense scene image.

[0013] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the target detection method as described above is implemented.

[0014] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the target detection method as described in any one of the above is implemented.

[0015] The target detection method, device, electronic device and storage medium provided by the present invention perform multi-scale feature extraction on dense scene images to obtain multi-scale image features, and perform feature reconstruction based on the multi-scale image features and the dense scene images to obtain multi-scale high-resolution features; perform feature fusion on the multi-scale high-resolution features, and perform target detection based on the fused features to obtain target detection results corresponding to the dense scene images. Feature enhancement is performed in the feature extraction stage to introduce high-resolution features containing more fine-grained information, which is more conducive to target detection in dense scenes and can obtain accurate detection results in dense scenes. The defect of poor detection performance for small targets in traditional detection schemes in dense scenes is well overcome, and both detection accuracy and detection efficiency are improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0017] Figure 1 It is a flow chart of the target detection method provided by the present invention; Figure 2 is a schematic diagram of the feature enhancement network training process provided by the present invention; Figure 3 is a schematic diagram of a learnable upsampling module provided by the present invention; Figure 4 is a schematic diagram of a learnable downsampling module provided by the present invention; Figure 5 is a schematic diagram of the target detection network training process provided by the present invention; Figure 6 It is a structural schematic diagram of the target detection device provided by the present invention; Figure 7 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0018] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0019] In the field of computer vision and artificial intelligence, object detection in dense scenes is a very challenging and widely used research direction. Dense scenes usually refer to scenes with a large number of objects of the same type with similar postures and close positions in the same field of view. These objects are relatively small in size in the image, and are close in position and similar in posture. Therefore, there is often a lot of overlap between the detected bounding boxes. This feature makes it difficult for traditional detection methods to be applied to dense scene detection.

[0020] At present, target detection in dense scenes has been widely used in all corners of life and industry, such as dense crowd monitoring in schools, patient flow management in hospitals, pedestrian flow analysis in transportation hubs, and commodity inventory in new retail scenarios. These applications require detection to have not only high accuracy, but also real-time and stability to meet the complex needs in actual scenarios.

[0021] In terms of technical implementation, there are two main types of traditional target detection methods, namely, methods based on Convolutional Neural Networks (CNN) and methods based on Transformer. Among the CNN-based methods, two-stage solutions (such as Faster R-CNN and Mask R-CNN) achieve high detection accuracy by generating candidate regions and performing refined instance predictions, which is especially suitable for small targets and dense scenes. However, such methods have high computational complexity and are difficult to deploy on mobile terminals. In contrast, single-stage solutions (such as YOLO (You Only Look Once), SSD (Single Shot MultiBox Detector), and RetinaNet) significantly improve the detection speed by classifying and regressing anchor points in the image, but the accuracy decreases in dense scenes, and it is necessary to rely on post-processing steps such as non-maximum suppression (NMS) to reduce overlapping boxes, which further increases the complexity and execution time of the algorithm.

[0022] With the rise of Transformer in the field of image processing, Transformer-based object detection methods (such as DETR) have been proposed. This method regards object detection as a set prediction problem, without the need to generate candidate regions or complex post-processing steps, thus simplifying the detection process. However, the Transformer-based method converges slowly during training and lacks detection performance for small objects.

[0023] In this regard, the present invention provides a target detection method for dense scenes, which aims to perform feature enhancement in the feature extraction stage and introduce high-resolution features containing more fine-grained information, which is naturally conducive to target detection in dense scenes. Feature fusion and target detection can then be performed based on the high-resolution features to obtain accurate target detection results, which overcomes the defect of poor detection performance for small targets in traditional detection schemes in dense scenes and can obtain more precise and accurate detection results in dense scenes. Figure 1 It is a flow chart of the target detection method provided by the present invention, such as Figure 1 As shown, the method includes: Step 110, determining a dense scene image to be detected; Step 120, performing multi-scale feature extraction on the dense scene image to obtain multi-scale image features, and performing feature reconstruction based on the multi-scale image features and the dense scene image to obtain multi-scale high-resolution features; Step 130 , performing feature fusion on the multi-scale high-resolution features, and performing target detection based on the fused features to obtain target detection results corresponding to the dense scene image.

[0024] Specifically, before performing target detection, the first thing to be determined is the image for target detection, that is, the dense scene image to be detected. The dense scene image here can be understood as an image of a scene containing multiple people and objects of the same type with similar positions and postures. It can be a color three-channel image, such as an RGB (Red, Green, Blue) image, or an infrared image, such as an NIR (Near Infrared) image, which is not specifically limited in the embodiments of the present invention.

[0025] Among them, dense scene images can be obtained by field collection through relevant equipment, such as cameras, scanners, infrared cameras, infrared thermal imagers, etc., that is, such image acquisition equipment can be used to collect images of dense scenes (such as stations, hospitals, commodity warehouses, etc.), so as to obtain dense scene images to be detected; dense scene images can also be obtained directly through network crawling, for example, images of dense scenes can be crawled from public data sets, or images of dense scenes can be downloaded from specific networks or image libraries, which are not specifically limited in the embodiments of the present invention.

[0026] Here, it should be noted that after obtaining the dense scene image, before formally performing the target detection in the dense scene, the dense scene image can also be preprocessed to make it more standardized and normalized so that it can meet the subsequent detection network's requirements for input images. For example, the dense scene image can be preprocessed in terms of size, pixels, etc. to meet the network's requirements for the size and pixels of the input image.

[0027] Subsequently, target detection in dense scenes can be performed based on dense scene images. Feature extraction can be performed first in the detection process. However, considering that the current target detection scheme in dense scenes has low detection accuracy for small targets and poor network detection performance, in an embodiment of the present invention, it is proposed that feature enhancement can be performed in the feature extraction stage to enhance the useful information in the features so that they contain more fine-grained information that is beneficial to the detection of small targets in dense scenes, thereby greatly improving the detection accuracy of small targets in subsequent detection processes.

[0028] Here, the feature extraction process is specifically to first perform multi-scale feature extraction on the dense scene image to extract information about the target in the image at different scales, thereby obtaining features at different scales, that is, multi-scale image features corresponding to the dense scene image. Since the information about small targets contained in the image features obtained at this time is not rich enough, it is still necessary to enhance them, that is, the multi-scale image features can be enhanced to contain more and richer fine-grained information, thereby obtaining enhanced features, that is, high-resolution features. Here, specifically, the dense scene image can be used to enhance the multi-scale image features to obtain high-resolution features; this process is essentially to reconstruct features based on the dense scene image and image features, so as to reconstruct features with high resolution and richer information on the basis of the two, and easily obtain multi-scale high-resolution features.

[0029] It should be noted that the entire feature extraction process here can be implemented by a feature extractor, a feature enhancement network, etc., and the feature extractor, the feature enhancement network, etc. can be pre-trained by sample images in dense scenes. For example, the pre-collected sample images in dense scenes can be used to carry out feature extraction tasks in a targeted manner, and network training can be carried out based on the feature extraction tasks to obtain trained feature extractors, feature enhancement networks, etc.

[0030] After obtaining the multi-scale high-resolution features, in the embodiment of the present invention, the subsequent process of target detection in dense scenes can be executed according to the features to obtain the target detection results.

[0031] Since features at different scales contain different information, for example, features at higher magnifications contain high-order semantic information, while features at low magnifications contain richer fine-grained information. The information contained in the two is different. Therefore, in an embodiment of the present invention, in order to reduce the computational complexity of subsequent detection while ensuring detection accuracy, feature fusion can be performed first, that is, feature fusion is performed on high-resolution features at multiple scales to obtain fused features.

[0032] Here, feature fusion can be splicing, weighting, cascading, fusion based on attention mechanism, etc. The fused features not only contain rich appearance information of each target in the dense scene image, but also include high-order semantic information. Therefore, it can reflect the target information more completely and comprehensively, which is more conducive to target detection in dense scenes.

[0033] After that, the fused features can be used for target detection to obtain target detection results corresponding to dense scene images; that is, the features containing complete and comprehensive target information after fusion can be used to perform target detection on dense scene images, thereby obtaining the results of each detected target, that is, the target detection results. This detection process can be implemented through a target detection network. Since the output of the network is optimized during the training process, that is, each target has only one output, and only one prediction box and category can be obtained in the end, the target detection results obtained by the actual detection here also only contain one detection box and one category for each target in the dense scene image. This avoids the problem of multiple overlapping detection boxes detected in traditional detection schemes, which requires tedious post-processing and leads to poor detection efficiency.

[0034] The target detection method provided by the present invention performs multi-scale feature extraction on dense scene images to obtain multi-scale image features, and performs feature reconstruction based on the multi-scale image features and the dense scene images to obtain multi-scale high-resolution features; performs feature fusion on the multi-scale high-resolution features, and performs target detection based on the fused features to obtain a target detection result corresponding to the dense scene image. By performing feature enhancement in the feature extraction stage and introducing high-resolution features containing more fine-grained information, it is more conducive to target detection in dense scenes, and accurate detection results in dense scenes can be obtained, which well overcomes the defect of poor detection performance for small targets in traditional detection schemes in dense scenes. At the same time, it alleviates the missed detection problem caused by overlapping bounding boxes in dense scenes, and avoids the cumbersome post-processing problem caused by overlapping bounding boxes, thereby achieving a dual improvement in detection accuracy and detection efficiency.

[0035] Based on the above embodiment, in step 120, feature reconstruction is performed based on multi-scale image features and dense scene images to obtain multi-scale high-resolution features, including: Perform Fourier transform on dense scene images to obtain Fourier features and color features; Feature reconstruction is performed based on Fourier features, color features and multi-scale image features to obtain multi-scale high-resolution features.

[0036] Specifically, in step 120, the process of performing feature reconstruction based on the multi-scale image features and the dense scene image to obtain the multi-scale high-resolution features may specifically include: It is understandable that in the embodiment of the present invention, feature enhancement for multi-scale image features can be achieved through a learnable upsampling module. In the upsampling module, high-resolution features are obtained by parameterizing using an implicit function MLP (Multilayer Perceptron), and in this process, Fourier features are used to improve the spatial resolution of the implicit representation, and color features are added to make the information granularity of the target finer and richer. In addition, Fourier features and color features can also significantly speed up the convergence speed of the module during training, without the need to use technologies such as conditional random fields.

[0037] In detail, in an embodiment of the present invention, the feature enhancement process for multi-scale image features can be to first perform Fourier transform on the dense scene image to decompose the dense scene image into a series of frequency components, and the Fourier features can be determined based on the amplitude, phase and other information of these frequency components. Furthermore, after obtaining the Fourier features, it is necessary to perform processing on the color channel, and indirectly obtain the color features by analyzing the grayscale image spectra of different color channels (such as RGB). For example, the spectra of the grayscale images of the three RGB channels can be calculated separately, and their frequency distribution characteristics can be compared to extract color features, such as color-related frequency features, which can specifically be color frequency distribution, color frequency peak, etc., which can reflect the spatial distribution and change characteristics of the colors in the image.

[0038] After that, feature reconstruction can be performed based on Fourier features, color features, and multi-scale image features to obtain reconstructed high-resolution features. That is, based on Fourier features, color features, and multi-scale image features, the implicit function MLP can be used to reconstruct high-resolution implicit representation features, that is, multi-scale high-resolution features.

[0039] Based on the above embodiment, step 120 includes: Based on the feature enhancement network, multi-scale feature extraction is performed on dense scene images to obtain multi-scale image features, and feature reconstruction is performed based on the multi-scale image features and dense scene images to obtain multi-scale high-resolution features; Among them, the feature enhancement network is obtained by consistency training between the first image feature and the first low-resolution feature at the same scale corresponding to the first sample image, the first low-resolution feature is obtained by bias learning based on the first high-resolution feature of the corresponding scale, and the first sample image includes a first sample dense scene image and a first enhanced dense scene image corresponding to the first sample dense scene image.

[0040] Specifically, the above process of performing multi-scale feature extraction on dense scene images to obtain multi-scale image features, performing feature reconstruction based on the multi-scale image features and dense scene images to obtain multi-scale high-resolution features can be achieved through a feature enhancement network.

[0041] Specifically, the dense scene image can be input into the feature enhancement network, and the feature enhancement network can first extract multi-scale features through the backbone network to obtain multi-scale image features output by the backbone network. Then, a learnable upsampling module can be used to enhance the multi-scale image features. Specifically, the dense scene image and the multi-scale image features output by the backbone network are input into the learnable upsampling module, and the features are reconstructed through the module to obtain reconstructed multi-scale high-resolution features. It should be noted that the process of feature reconstruction here has been described in detail above and will not be repeated here.

[0042] It is worth noting that before the dense scene image is input into the feature enhancement network for image processing, the feature enhancement network needs to be pre-trained. Here, the feature enhancement network can be pre-trained by the first sample image.

[0043] Figure 2 is a schematic diagram of the feature enhancement network training process provided by the present invention, such as Figure 2 As shown, the training process of the feature enhancement network is as follows: first, sample images in dense scenes required for training, i.e., first sample dense scene images, can be collected; then, the first sample dense scene images can be randomly enhanced, such as random cropping, random padding, horizontal flipping, etc., to obtain randomly enhanced images, i.e., first enhanced dense scene images; thereafter, the first sample dense scene images and the first enhanced dense scene images can be input into the backbone network in the training process to perform multi-scale feature extraction, thereby obtaining multi-scale first image features, i.e., multi-scale first image features corresponding to the first sample dense scene images (features 40*40, 20*20, and 10*10, where 20*20 is the feature size), and multi-scale first image features corresponding to the first enhanced dense scene image.

[0044] Furthermore, the multi-scale first image features output by the backbone network and the corresponding dense scene image can be input into the learnable upsampling module in the training process. Figure 3 is a schematic diagram of a learnable upsampling module provided by the present invention, such as Figure 3As shown, the module can reconstruct high-resolution features containing more fine-grained information, namely, multi-scale first high-resolution features, through Fourier transform and implicit function MLP processing, which specifically include multi-scale first high-resolution features corresponding to the first sample dense scene image and multi-scale first high-resolution features corresponding to the first enhanced dense scene image.

[0045] After that, the reconstructed multi-scale first high-resolution features need to be input into the downsampling module in the training process for bias learning. Figure 4 is a schematic diagram of a learnable downsampling module provided by the present invention, such as Figure 4 As shown in FIG. 1 , the module can restore the first high-resolution feature of the input to a low-resolution feature. Specifically, a 1x1 convolution block is first used to predict the saliency map based on the first high-resolution feature, and then the predicted saliency map is weighted with a learnable bias kernel to achieve normalization. A spatially varying blur kernel is created based on the normalized weighted saliency map. These blur kernels will be used to blur the features to obtain the first low-resolution feature.

[0046] Finally, the loss of the network during the training process can be determined according to the first low-resolution features and the first image features. That is, the first low-resolution features and the first image features at the same scale can be constrained for consistency, and the loss, namely, the consistency loss, can be determined through this constraint.

[0047] Here, specifically, the loss of the network in the training process, i.e., the consistency loss, is determined based on the consistency between the first image feature and the first low-resolution feature at the same scale corresponding to the first sample dense scene image, as well as the consistency between the first image feature and the first low-resolution feature at the same scale corresponding to the first enhanced dense scene image. The network can be trained based on the consistency loss to obtain a trained feature enhancement network.

[0048] It should be noted that in the actual detection process, when using the trained feature enhancement network for feature extraction and feature reconstruction, there is no need to use the learnable downsampling module, and only the trained backbone network and the learnable upsampling module are used. In other words, the feature enhancement network can be constructed based on the trained backbone network and the learnable upsampling module, and the learnable downsampling module is only involved in the training process.

[0049] Based on the above embodiment, step 130 includes: Based on the high-resolution features of the target scale in the multi-scale high-resolution features, self-attention interaction is performed to obtain self-attention interaction features; Based on the self-attention interaction features and the high-resolution features of other scales in the multi-scale high-resolution features, attention interaction is performed to obtain cross-scale interaction features; Object detection is performed based on cross-scale interactive features to obtain object detection results corresponding to dense scene images.

[0050] Specifically, in step 130, the process of performing feature fusion on multi-scale high-resolution features, and performing target detection based on the fused features to obtain target detection results corresponding to the dense scene image specifically includes the following steps: Taking into account the high computational complexity and excessive computing power required by traditional CNN-based methods, which make it difficult to deploy them directly on mobile terminals, a lightweight solution is proposed in an embodiment of the present invention to reduce the amount of computation in the feature fusion stage through "internal interaction" and "external interaction", thereby reducing the computing power requirements, facilitating deployment on mobile terminals that prioritize computing power, and improving scenario adaptability and practicality.

[0051] In detail, in the embodiment of the present invention, the process of feature fusion of multi-scale high-resolution features is to first perform "internal interaction", specifically, first select features with relatively rich high-order semantic information from the multi-scale high-resolution features, and the features with rich high-order semantic information are mostly features at high magnifications, such as 32x features among the high-resolution features at three scales of 8x, 16x and 32x. Here, the selected high-resolution features at high magnifications are referred to as high-resolution features at the target scale. Then, the high-resolution features at the target scale can be "internal interacted", and the internal interaction here is actually a single-scale self-attention interaction, and the self-attention interaction feature can be obtained.

[0052] In the embodiment of the present invention, the correlation between different positions in the feature can be made stronger through self-attention interaction, and the overall expressiveness of the feature can be better. In addition, by performing self-attention interaction only on high-resolution features of the target scale, the amount of calculation can be greatly reduced while obtaining sufficient high-order semantic information, thereby reducing the computing power requirements.

[0053] After completing the internal interaction, in the embodiment of the present invention, external interaction is required to obtain fine-grained information, that is, the apparent information of each target, so as to ensure the integrity and comprehensiveness of the fused features. Specifically, external interaction is performed on the self-attention interaction features obtained by the internal interaction, and the high-resolution features of other scales except the high-resolution features of the target scale in the multi-scale high-resolution features. The external interaction process is actually a cross-scale attention interaction. This interaction process is inspired by the feature pyramid network. Through up and down sampling, cross-attention Cross-Attention and other methods, the self-attention interaction features (such as the features at 32x after the internal interaction) and the high-resolution features of other scales (such as the features at 16x and 8x) are fused to obtain the fused features, that is, the cross-scale interaction features.

[0054] After that, target detection can be performed based on cross-scale interactive features to obtain target detection results corresponding to dense scene images; that is, the features containing complete and comprehensive target information after fusion can be used to perform target detection on dense scene images, thereby obtaining the results of each detected target, i.e., target detection results. Here, the target detection results only contain one detection box and one category for each target.

[0055] In an embodiment of the present invention, high-resolution features of dense scene images are implicitly introduced to achieve feature enhancement, and the enhanced high-resolution features are fused through "internal interaction" and "external interaction", and target detection is performed based on the fused features, which can improve detection efficiency while achieving high-precision detection.

[0056] Based on the above embodiment, step 130 includes: Based on the target detection network, feature fusion is performed on multi-scale high-resolution features, and target detection is performed based on the fused features to obtain target detection results corresponding to dense scene images; Among them, the target detection network is trained based on the initial detection results, predicted detection results and sample detection results corresponding to the second sample image; the initial detection result is obtained by the target detection network in the training process performing target detection based on the second sample image, and there are multiple prediction boxes, categories and classification scores corresponding to any target in the initial detection result; the predicted detection result is determined based on the initial detection result, and there is a prediction box and category corresponding to any target in the predicted detection result; the second sample image includes a second sample dense scene image, or a second enhanced dense scene image corresponding to the second sample dense scene image.

[0057] Specifically, in step 130, the process of performing feature fusion on multi-scale high-resolution features, performing target detection based on the fused features, and obtaining target detection results corresponding to the dense scene image can be achieved through a target detection network.

[0058] Specifically, here, high-resolution features of multiple scales may be input into the target detection network, and the target detection network may first perform internal interaction through an inner-scale interaction module, that is, self-attention interaction is performed on the high-resolution features of the target scale in the inner-scale interaction module to obtain self-attention interaction features output by the module; then, external interaction may be performed through a cross-scale interaction module, that is, attention interaction is performed on the self-attention interaction features and high-resolution features of other scales in the cross-scale interaction module to obtain cross-scale interaction features; thereafter, target detection may be performed using the detection head based on the cross-scale interaction features to obtain target detection results corresponding to dense scene images.

[0059] It is worth noting that before inputting the multi-scale high-resolution features into the target detection network for feature fusion and target detection, the target detection network needs to be pre-trained. Here, the target detection network can be pre-trained by the initial detection results, predicted detection results and sample detection results corresponding to the second sample image.

[0060] The initial detection result is obtained by performing feature fusion and target detection based on the multi-scale second high-resolution features corresponding to the second sample image by the target detection network in the training process. The multi-scale second high-resolution features are obtained by performing multi-scale feature extraction and feature enhancement on the second sample image. In the initial detection result, for any target in the second sample image, there are multiple prediction boxes, categories and classification scores.

[0061] The predicted detection result is determined based on the initial detection result. That is, the prediction box with a high classification score in the initial detection result is classified again to obtain the predicted detection result. In the predicted detection result, there is only one prediction box and category for any target.

[0062] The second sample image here is a sample image in a dense scene required for network training, that is, a second sample dense scene image, or an image after data enhancement of the second sample dense scene image, that is, a second enhanced dense scene image.

[0063] Compared with the traditional CNN-based method, in the embodiment of the present invention, no NMS post-processing is required, and the detection efficiency is far superior to the two-stage solution. In addition, since no NMS post-processing is required, the missed detection problem caused by overlapping bounding boxes in dense scenes is alleviated, which effectively avoids the problem of multiple overlapping detection boxes being detected in the traditional CNN-based detection solution, which requires tedious post-processing and leads to poor detection efficiency.

[0064] Based on the above embodiment, the target detection network is trained based on the following steps: Performing multi-scale feature extraction on the second sample image to obtain multi-scale second image features, and performing feature reconstruction based on the multi-scale second image features and the second sample image to obtain multi-scale second high-resolution features; Based on the target detection network in the training process, feature fusion is performed on the second high-resolution features of multiple scales, and target detection is performed based on the fused second features to obtain an initial detection result corresponding to the second sample image; Based on the classification scores of the prediction boxes of any target in the initial detection result, multiple target prediction boxes are obtained by screening from the prediction boxes, and classification prediction is performed based on the multiple target prediction boxes of each target to obtain a prediction detection result corresponding to the second sample image; Based on the predicted detection result and the sample detection result corresponding to the second sample image, and the consistency between the classification score of each target prediction box of the target in the initial detection result and the overlap score of each target prediction box of the target, iterate the parameters of the target detection network in the training process to obtain the target detection network; Among them, the overlap score of any target prediction box is determined based on the overlap between the target prediction box and other target prediction boxes of the corresponding target.

[0065] Specifically, Figure 5 It is a schematic diagram of the target detection network training process provided by the present invention, such as Figure 5 As shown in Figure 1, the training process of the target detection network specifically includes: First, a second sample dense scene image can be obtained, and its category and bounding box can be annotated to form a sample label, that is, a sample detection result; then, data enhancement can be performed on the second sample dense scene image to obtain an enhanced image, that is, a second enhanced dense scene image; here, the first sample dense scene image and the second sample dense scene image can be the same or different, but the first enhanced dense scene image and the second enhanced dense scene image are different.

[0066] Subsequently, multi-scale feature extraction can be performed on the second sample image to obtain multi-scale second image features, and feature reconstruction can be performed based on the multi-scale second image features and the second sample image to obtain multi-scale second high-resolution features; that is, the trained feature enhancement network can be used to perform multi-scale feature extraction on the second sample dense scene image or the second enhanced dense scene image to obtain multi-scale second image features, and the second sample dense scene image or the second enhanced dense scene image can be used to perform feature enhancement on the extracted multi-scale second image features to obtain multi-scale second high-resolution features.

[0067] Then, the target detection network in the training process can be used to perform feature fusion on the second high-resolution features of multiple scales, and perform target detection based on the fused second features to obtain the initial detection result corresponding to the second sample image; here, the feature fusion process is to first perform self-attention interaction on the second high-resolution features of the target scale in the multi-scale second high-resolution features (such as the features under 32x) to obtain the second self-attention interaction features, and then perform attention interaction on the second self-attention interaction features and the second high-resolution features of other scales (such as the features under 16x and 8x) to obtain the second cross-scale interaction features; finally, target detection is performed based on the second cross-scale interaction features to obtain the initial detection result.

[0068] Different from the actual detection process, since the network has not been trained and constrained at this time, it will output multiple prediction boxes, as well as their corresponding categories and classification scores for any target. Therefore, after obtaining multiple prediction boxes and classification scores for each target, in an embodiment of the present invention, classification optimization can be performed based on this, that is, a part of the multiple prediction boxes can be selected for further optimization according to the classification scores. Specifically, according to the classification scores of the prediction boxes of any target in the initial detection results, the prediction boxes with the top K classification scores are selected from each prediction box as the target prediction boxes, and classification optimization can be performed based on the multiple target prediction boxes of each target, so as to obtain the predicted detection result corresponding to the second sample image.

[0069] Usually, in the selection of target prediction boxes, the top K prediction boxes are selected from the encoder using the classification scores. However, considering that the distribution of classification scores and position confidences is not completely consistent in some cases, some prediction boxes have high classification scores, but are not close to the distribution of real boxes. Therefore, in an embodiment of the present invention, in order to ensure the consistency of classification scores and position distributions, an IoU (Intersection over Union) perception strategy is proposed, which constrains the model in the training stage so that it generates high classification scores for prediction boxes with high overlap scores, so that the prediction boxes in the prediction detection results obtained by performing classification prediction on the prediction boxes selected according to the classification scores can be closer to the real boxes.

[0070] Here, specifically, the loss of the target detection network during the training process can be determined based on the predicted detection results corresponding to the second sample image and the positions of the prediction boxes and bounding boxes in the sample detection results, as well as the consistency in categories, and the consistency between the classification scores of each target prediction box of any target in the initial detection results and the overlap scores of each target prediction box of the target (whether the classification score of the box with a high overlap score is high, and whether the two are consistent).

[0071] The overlap score is determined according to the overlap between the corresponding target prediction box and other target prediction boxes of the target, and can be specifically determined according to the IoU between the corresponding target prediction box and the target prediction box with the largest classification score among other target prediction boxes of the target.

[0072] Afterwards, based on this loss, the parameters of the target detection network in the training process can be iterated so that the target detection network after parameter iteration and update can generate high classification scores for prediction boxes with high overlap scores, and finally a trained target detection network can be obtained.

[0073] In the embodiments of the present invention, through feature enhancement processing, the extracted image features can be supplemented with fine-grained information, and through lightweight internal and external interaction processing, the detection efficiency can be greatly improved while ensuring the detection accuracy; further, by constraining the consistency of regression and classification tasks, the detection effect in dense scenes can be optimized, and the cumbersome post-processing process can be abandoned to achieve end-to-end target detection.

[0074] Based on the above embodiment, the second sample image is determined based on the following steps: Obtain an initial dense scene image; Performing size normalization on the initial dense scene image to obtain a normalized dense scene image; Performing normalization processing on the normalized dense scene image to obtain a second sample dense scene image; Data enhancement is performed on the second sample dense scene image to obtain a second enhanced dense scene image.

[0075] Specifically, the second sample image can be determined by the following steps: First, an initial image in a dense scene can be obtained, which is referred to herein as an initial dense scene image. The initial dense scene image can be collected in advance or pre-collected by relevant equipment. It can be a color three-channel image or an infrared image, and the embodiment of the present invention does not make specific limitations on this.

[0076] Next, the initial dense scene image may be resized normalized, for example, by scaling the long side and padding the short side, so as to unify its size to the size of the input image required by the feature enhancement network, such as 320*320.

[0077] Subsequently, the size-normalized image, namely the normalized dense scene image, may be subjected to standardization processing, such as subtracting the mean, dividing the variance, etc., to standardize the image, thereby obtaining a standardized image, namely the second sample dense scene image.

[0078] Here, it should be noted that since the annotation is usually performed after the initial dense scene image is obtained, in order to ensure the compatibility between the image and the bounding box, when the initial dense scene image is resized, the bounding box annotated therein also needs to be processed in the same way. If the annotation is performed after the second sample dense scene image is obtained, this problem does not exist.

[0079] Afterwards, data enhancement can be performed on the second sample dense scene image to obtain a second enhanced dense scene image. Here, data enhancement can be strong data enhancement such as Mosaic and Mixup, or conventional data enhancement such as Random Crop, RandomScale and Flip, which is not specifically limited in the embodiment of the present invention.

[0080] The target detection device provided by the present invention is described below. The target detection device described below and the target detection method described above can be referenced to each other.

[0081] Figure 6 is a schematic diagram of the structure of the target detection device provided by the present invention, such as Figure 6 As shown, the device comprises: An image determination unit 610, configured to determine a dense scene image to be detected; A feature enhancement unit 620 is used to perform multi-scale feature extraction on the dense scene image to obtain multi-scale image features, and perform feature reconstruction based on the multi-scale image features and the dense scene image to obtain multi-scale high-resolution features; The target detection unit 630 is used to perform feature fusion on the multi-scale high-resolution features, and perform target detection based on the fused features to obtain a target detection result corresponding to the dense scene image.

[0082] The target detection device provided by the present invention performs multi-scale feature extraction on dense scene images to obtain multi-scale image features, and performs feature reconstruction based on the multi-scale image features and the dense scene images to obtain multi-scale high-resolution features; performs feature fusion on the multi-scale high-resolution features, and performs target detection based on the fused features to obtain a target detection result corresponding to the dense scene image. By performing feature enhancement in the feature extraction stage and introducing high-resolution features containing more fine-grained information, it is more conducive to target detection in dense scenes and can obtain accurate detection results in dense scenes, which well overcomes the defect of poor detection performance for small targets in traditional detection schemes in dense scenes. At the same time, it alleviates the problem of missed detection caused by overlapping bounding boxes in dense scenes and avoids the problem of cumbersome post-processing caused by overlapping bounding boxes, thereby achieving a dual improvement in detection accuracy and detection efficiency.

[0083] Based on the above embodiment, the feature enhancement unit 620 is used to: Performing Fourier transform on the dense scene image to obtain Fourier features and color features; Feature reconstruction is performed based on the Fourier feature, the color feature and the multi-scale image feature to obtain multi-scale high-resolution features.

[0084] Based on the above embodiment, the feature enhancement unit 620 is used to: Based on the feature enhancement network, multi-scale feature extraction is performed on the dense scene image to obtain multi-scale image features, and feature reconstruction is performed based on the multi-scale image features and the dense scene image to obtain multi-scale high-resolution features; Among them, the feature enhancement network is obtained by consistency training between the first image feature and the first low-resolution feature at the same scale corresponding to the first sample image, the first low-resolution feature is obtained by bias learning based on the first high-resolution feature of the corresponding scale, and the first sample image includes a first sample dense scene image and a first enhanced dense scene image corresponding to the first sample dense scene image.

[0085] Based on the above embodiment, the target detection unit 630 is used to: Performing self-attention interaction based on the high-resolution features of the target scale in the multi-scale high-resolution features to obtain a self-attention interaction feature; Performing attention interaction based on the self-attention interaction feature and high-resolution features of other scales in the multi-scale high-resolution features to obtain a cross-scale interaction feature; Target detection is performed based on the cross-scale interaction features to obtain a target detection result corresponding to the dense scene image.

[0086] Based on the above embodiment, the target detection unit 630 is used to: Based on the target detection network, feature fusion is performed on the multi-scale high-resolution features, and target detection is performed based on the fused features to obtain a target detection result corresponding to the dense scene image; The target detection network is trained based on the initial detection result, the predicted detection result and the sample detection result corresponding to the second sample image; The initial detection result is obtained by performing target detection on the second sample image by the target detection network during the training process, and there are multiple prediction boxes, categories and classification scores corresponding to any target in the initial detection result; the predicted detection result is determined based on the initial detection result, and there is a prediction box and category corresponding to any target in the predicted detection result; the second sample image includes a second sample dense scene image, or a second enhanced dense scene image corresponding to the second sample dense scene image.

[0087] Based on the above embodiment, the device further includes a network training unit, which is used to: Performing multi-scale feature extraction on the second sample image to obtain multi-scale second image features, and performing feature reconstruction based on the multi-scale second image features and the second sample image to obtain multi-scale second high-resolution features; Based on the target detection network in the training process, feature fusion is performed on the multi-scale second high-resolution features, and target detection is performed based on the fused second features to obtain an initial detection result corresponding to the second sample image; Based on the classification scores of the prediction boxes of any target in the initial detection result, multiple target prediction boxes are obtained by screening the prediction boxes, and classification prediction is performed based on the multiple target prediction boxes of each target to obtain a prediction detection result corresponding to the second sample image; Based on the predicted detection result and the sample detection result corresponding to the second sample image, and the consistency between the classification score of each target prediction box of the target in the initial detection result and the overlap score of each target prediction box of the target, iterating parameters of the target detection network in the training process to obtain the target detection network; Among them, the overlap score of any target prediction box is determined based on the overlap between the target prediction box and other target prediction boxes of the corresponding target.

[0088] Based on the above embodiment, the device further includes an image processing unit, which is used to: Obtain an initial dense scene image; Performing size normalization processing on the initial dense scene image to obtain a normalized dense scene image; Performing normalization processing on the normalized dense scene image to obtain a second sample dense scene image; Data enhancement is performed on the second sample dense scene image to obtain a second enhanced dense scene image.

[0089] Figure 7 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 7 As shown, the electronic device may include: a processor 710, a communication interface 720, a memory 730 and a communication bus 740, wherein the processor 710, the communication interface 720 and the memory 730 communicate with each other through the communication bus 740. The processor 710 may call the logic instructions in the memory 730 to execute the target detection method, which includes: determining a dense scene image to be detected; performing multi-scale feature extraction on the dense scene image to obtain multi-scale image features, and performing feature reconstruction based on the multi-scale image features and the dense scene image to obtain multi-scale high-resolution features; performing feature fusion on the multi-scale high-resolution features, and performing target detection based on the fused features to obtain a target detection result corresponding to the dense scene image.

[0090] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable 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 invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0091] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the target detection method provided by the above-mentioned methods, and the method includes: determining a dense scene image to be detected; performing multi-scale feature extraction on the dense scene image to obtain multi-scale image features, and performing feature reconstruction based on the multi-scale image features and the dense scene image to obtain multi-scale high-resolution features; performing feature fusion on the multi-scale high-resolution features, and performing target detection based on the fused features to obtain a target detection result corresponding to the dense scene image.

[0092] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the target detection method provided by the above-mentioned methods, the method comprising: determining a dense scene image to be detected; performing multi-scale feature extraction on the dense scene image to obtain multi-scale image features, and performing feature reconstruction based on the multi-scale image features and the dense scene image to obtain multi-scale high-resolution features; performing feature fusion on the multi-scale high-resolution features, and performing target detection based on the fused features to obtain a target detection result corresponding to the dense scene image.

[0093] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0094] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0095] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A target detection method, characterized in that: include: Determining a dense scene image to be detected; Performing multi-scale feature extraction on the dense scene image to obtain multi-scale image features, and performing feature reconstruction based on the multi-scale image features and the dense scene image to obtain multi-scale high-resolution features; The multi-scale high-resolution features are subjected to feature fusion, and target detection is performed based on the fused features to obtain a target detection result corresponding to the dense scene image.

2. The target detection method according to claim 1, characterized in that: The performing feature reconstruction based on the multi-scale image features and the dense scene image to obtain multi-scale high-resolution features includes: Performing Fourier transform on the dense scene image to obtain Fourier features and color features; Feature reconstruction is performed based on the Fourier feature, the color feature and the multi-scale image feature to obtain multi-scale high-resolution features.

3. The target detection method according to claim 2, characterized in that: The step of performing multi-scale feature extraction on the dense scene image to obtain multi-scale image features, and performing feature reconstruction based on the multi-scale image features and the dense scene image to obtain multi-scale high-resolution features includes: Based on the feature enhancement network, multi-scale feature extraction is performed on the dense scene image to obtain multi-scale image features, and feature reconstruction is performed based on the multi-scale image features and the dense scene image to obtain multi-scale high-resolution features; Among them, the feature enhancement network is obtained by consistency training between the first image feature and the first low-resolution feature at the same scale corresponding to the first sample image, the first low-resolution feature is obtained by bias learning based on the first high-resolution feature of the corresponding scale, and the first sample image includes a first sample dense scene image and a first enhanced dense scene image corresponding to the first sample dense scene image.

4. The target detection method according to any one of claims 1 to 3, characterized in that: The step of fusing the multi-scale high-resolution features and performing target detection based on the fused features to obtain a target detection result corresponding to the dense scene image includes: Performing self-attention interaction based on the high-resolution features of the target scale in the multi-scale high-resolution features to obtain a self-attention interaction feature; Performing attention interaction based on the self-attention interaction feature and high-resolution features of other scales in the multi-scale high-resolution features to obtain a cross-scale interaction feature; Target detection is performed based on the cross-scale interaction features to obtain a target detection result corresponding to the dense scene image.

5. The target detection method according to any one of claims 1 to 3, characterized in that: The step of fusing the multi-scale high-resolution features and performing target detection based on the fused features to obtain a target detection result corresponding to the dense scene image includes: Based on the target detection network, feature fusion is performed on the multi-scale high-resolution features, and target detection is performed based on the fused features to obtain a target detection result corresponding to the dense scene image; The target detection network is trained based on the initial detection result, the predicted detection result and the sample detection result corresponding to the second sample image; The initial detection result is obtained by performing target detection on the second sample image by the target detection network during the training process, and there are multiple prediction boxes, categories and classification scores corresponding to any target in the initial detection result; the predicted detection result is determined based on the initial detection result, and there is a prediction box and category corresponding to any target in the predicted detection result; the second sample image includes a second sample dense scene image, or a second enhanced dense scene image corresponding to the second sample dense scene image.

6. The target detection method according to claim 5, characterized in that: The target detection network is trained based on the following steps: Performing multi-scale feature extraction on the second sample image to obtain multi-scale second image features, and performing feature reconstruction based on the multi-scale second image features and the second sample image to obtain multi-scale second high-resolution features; Based on the object detection network in the training process, feature fusion is performed on the multi-scale second high-resolution features, and object detection is performed based on the fused second features to obtain an initial detection result corresponding to the second sample image; Based on the classification scores of the prediction boxes of any target in the initial detection result, multiple target prediction boxes are obtained by screening the prediction boxes, and classification prediction is performed based on the multiple target prediction boxes of each target to obtain a prediction detection result corresponding to the second sample image; Based on the predicted detection result and the sample detection result corresponding to the second sample image, and the consistency between the classification score of each target prediction frame of the any target in the initial detection result and the overlap score of each target prediction frame of the any target, iterating parameters of the target detection network in the training process to obtain the target detection network; Among them, the overlap score of any target prediction box is determined based on the overlap between the any target prediction box and other target prediction boxes of the corresponding target.

7. The target detection method according to claim 5, characterized in that: The second sample image is determined based on the following steps: Obtain an initial dense scene image; Performing size normalization processing on the initial dense scene image to obtain a normalized dense scene image; Performing normalization processing on the normalized dense scene image to obtain a second sample dense scene image; Data enhancement is performed on the second sample dense scene image to obtain a second enhanced dense scene image.

8. A target detection device, characterized in that: include: An image determination unit, used to determine a dense scene image to be detected; A feature enhancement unit, configured to perform multi-scale feature extraction on the dense scene image to obtain multi-scale image features, and perform feature reconstruction based on the multi-scale image features and the dense scene image to obtain multi-scale high-resolution features; The target detection unit is used to perform feature fusion on the multi-scale high-resolution features, and perform target detection based on the fused features to obtain a target detection result corresponding to the dense scene image.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the target detection method according to any one of claims 1 to 7 is implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the target detection method according to any one of claims 1 to 7 is implemented.