Target detection model training method, detection method and system
By upsampling the low-dimensional feature map and adaptive fusion of high-dimensional feature maps, combining feature pyramids and dynamic weight calculations, the problem of small target features loss in SSD detection technology is solved, and the accuracy and efficiency of small target detection is improved.
Patent Information
- Application Number
- CN202510395190.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2045-03-31
AI Technical Summary
The existing SSD detection technology downsamples the multi-scale feature map after image input, resulting in the loss of small target features and the inability to fully utilize the small target features of the image, resulting in low accuracy of small target detection.
By upsampling the low-dimensional feature map and adaptively fusion of the high-dimensional feature map, combining the feature pyramid structure and dynamic weight calculation, redundant and conflicting feature information are suppressed, and feature normalization and enhancement are performed to improve the accuracy of small-object detection.
The model's detection accuracy and efficiency of small targets is improved, the influence of background noise on small target features is reduced, and the model's attention to small target features is enhanced.
Smart Images

Figure CN120375044A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a training method, a detection method and a system for a target detection model. Background Art
[0002] Object detection is a core technology in the field of computer vision, aiming to automatically identify and locate specific objects from images or videos. Specifically, in natural light scenarios, the detection networks used in object detection technology generally include detection networks based on the YOLO series, detection networks based on Faster RCNN, and detection networks based on SSD (Single Shot MultiBoxDetector).
[0003] Currently, the existing SSD detection technology usually downsamples the multi-scale feature maps output by the neural network after the image is input into the corresponding neural network, and fuses and detects the features of different levels. This method cannot fully utilize the small object features of the image, and the accuracy of small object detection is not satisfactory.
[0004] Therefore, the problems existing in the prior art still need to be solved and optimized urgently. Summary of the Invention
[0005] An object of the present invention is to solve at least to some extent one of the technical problems existing in the related art.
[0006] To this end, an object of an embodiment of the present invention is to provide a training method, a detection method and a system for a target detection model. Among them, the training method can enable the model to fully utilize the small object features of the image, thereby being beneficial to improving the accuracy of the model for detecting small objects.
[0007] In order to achieve the above technical objectives, the technical solutions adopted in the embodiments of the present application include:
[0008] In the first aspect, an embodiment of the present application provides a training method for a target detection model, including:
[0009] Obtain a sample image of a target sample;
[0010] Perform multi-dimensional feature extraction on the sample image to obtain a sample feature set, where the sample feature set includes a plurality of sample feature maps obtained according to the extraction order of the multi-dimensional feature extraction, and the feature dimension of the latter sample feature map is smaller than that of the previous sample feature map;
[0011] Perform feature pyramid upsampling and adaptive fusion on the sample feature set to obtain a plurality of fused feature maps. Each fused feature map is used to represent the feature fusion information of the first feature map and the upsampled second feature map. The first feature map is a sample feature map with the same feature dimension as the fused feature map, and the second feature map is the next sample feature map after the first feature map;
[0012] Update the parameters of the initialized object detection model according to all the fused feature maps to obtain a trained object detection model.
[0013] In addition, according to the method of the above embodiments of the present application, the following additional technical features may also be included:
[0014] Further, in an embodiment of the present application, the performing multi-dimensional feature extraction on the sample image to obtain a sample feature set includes:
[0015] Perform feature dimension elevation processing on the sample image to obtain an elevated feature map;
[0016] Extract features from the elevated feature map through a plurality of cascaded dimensionality reduction feature extraction units to obtain the sample feature maps output by each dimensionality reduction feature extraction unit.
[0017] Further, in an embodiment of the present application, the performing feature pyramid upsampling and adaptive fusion on the sample feature set to obtain a fused feature map includes:
[0018] Perform feature upsampling on the second feature map to obtain a third feature map;
[0019] Perform adaptive feature fusion processing on the first feature map and the third feature map to obtain the fused feature map.
[0020] Further, in an embodiment of the present application, the performing adaptive feature fusion processing on the first feature map and the third feature map to obtain the fused feature map includes:
[0021] Perform dynamic weight calculation according to the first feature map and the third feature map to obtain the first dynamic weight of the first feature map and the second dynamic weight of the third feature map;
[0022] Perform feature weighted fusion on the second dynamic weight and the third feature map according to the first dynamic weight and the first feature map to obtain a fourth feature map;
[0023] Perform feature enhancement on the fourth feature map to obtain the fused feature map.
[0024] Further, in an embodiment of the present application, performing dynamic weight calculation based on the first feature map and the third feature map to obtain a first dynamic weight of the first feature map and a second dynamic weight of the third feature map includes:
[0025] Performing a similarity measurement calculation on the first feature map and the third feature map to obtain a feature similarity;
[0026] Evaluating the feature complementarity of the first feature map according to the feature similarity to obtain a first complement value of the first feature map, and the first complement value is negatively correlated with the feature similarity;
[0027] Evaluating the feature complementarity of the third feature map according to the feature similarity to obtain a second complement value of the third feature map, and the second complement value is negatively correlated with the feature similarity;
[0028] Obtaining a first dynamic weight of the first feature map and a second dynamic weight of the third feature map according to the first complement value and the second complement value.
[0029] Further, in an embodiment of the present application, the method further includes:
[0030] Performing global normalization on the fused feature map to obtain a normalized feature map;
[0031] Performing feature enhancement processing on the normalized feature map to obtain an enhanced feature map;
[0032] Performing attention extraction on the enhanced feature map to obtain a feature attention map;
[0033] Performing attention weighted fusion update on the fused feature map according to the feature attention map to obtain a fused and updated fused feature map.
[0034] Further, in an embodiment of the present application, performing feature enhancement processing on the normalized feature map to obtain an enhanced feature map includes:
[0035] Performing region segmentation on the normalized feature map to obtain a number of first feature regions;
[0036] Performing region statistics on all the first feature regions to obtain a region mean and a region standard deviation of each first feature region;
[0037] Performing conditional feature enhancement on the corresponding first feature region according to the region mean and the region standard deviation to obtain a second feature region;
[0038] Obtaining the enhanced feature map according to all the second feature regions.
[0039] In a second aspect, an embodiment of the present application provides a detection method for a target detection model, including:
[0040] Obtain a target image of the target to be detected;
[0041] Input the target image into the trained target detection model as described above for detection and recognition to obtain the target detection result of the target to be detected.
[0042] In a third aspect, an embodiment of the present application provides a training system for a target detection model, including:
[0043] A first processing unit for obtaining a sample image of a target sample;
[0044] A second processing unit for performing multi-dimensional feature extraction on the sample image to obtain a sample feature set, where the sample feature set includes a plurality of sample feature maps obtained according to the extraction order of the multi-dimensional feature extraction, and the feature dimension of the latter sample feature map is smaller than that of the previous sample feature map;
[0045] A third processing unit for performing feature pyramid upsampling and adaptive fusion on the sample feature set to obtain a plurality of fusion feature maps, and each fusion feature map is used to represent the feature fusion information of a first feature map and a second feature map after upsampling, where the first feature map is a sample feature map with the same feature dimension as the fusion feature map, and the second feature map is the next sample feature map after the first feature map;
[0046] A fourth processing unit for updating the parameters of the initialized target detection model according to all the fusion feature maps to obtain a trained target detection model.
[0047] In a fourth aspect, an embodiment of the present application further provides an electronic device, including:
[0048] At least one processor;
[0049] At least one memory for storing at least one program;
[0050] When the at least one program is executed by the at least one processor, the at least one processor implements the above method.
[0051] In a fifth aspect, an embodiment of the present application further provides a computer-readable storage medium, in which a program executable by a processor is stored, and the program executable by the processor is used to implement the above method when executed by the processor.
[0052] The advantages and beneficial effects of the present application will be partially given in the following description, partially will become obvious from the following description, or will be understood through the practice of the present application:
[0053] A training method, a detection method and a system for a target detection model disclosed in an embodiment of the present application. In the training method, a sample image of a target sample is obtained; multi-dimensional feature extraction is performed on the sample image to obtain a sample feature set, the sample feature set includes a plurality of sample feature maps obtained according to the extraction order of the multi-dimensional feature extraction, and the feature dimension of the latter sample feature map is smaller than that of the previous sample feature map; feature pyramid upsampling and adaptive fusion are performed on the sample feature set to obtain a plurality of fusion feature maps, each fusion feature map is used to represent the feature fusion information of a first feature map and a second feature map after upsampling, the first feature map is a sample feature map with the same feature dimension as the fusion feature map, and the second feature map is the next sample feature map of the first feature map; according to all the fusion feature maps, parameter update is performed on the initialized target detection model to obtain a trained target detection model. By upsampling the low-dimensional second feature map and then performing adaptive fusion with the first feature map, the training method can enable the model to make full use of the small target features existing in the image, thereby being beneficial to improving the accuracy of the model for detecting small targets. Description of the Drawings
[0054] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following introduces the accompanying drawings of the relevant technical solutions in the embodiments of the present application or the prior art. It should be understood that the accompanying drawings below are only for conveniently and clearly expressing some embodiments of the technical solutions in the present application. For those skilled in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0055] Figure 1 It is a schematic flowchart of a training method for a target detection model provided by an embodiment of the present application;
[0056] Figure 2 It is a schematic diagram of the overall network structure of a target detection model provided by an embodiment of the present application;
[0057] Figure 3 It is a schematic diagram of the structural framework of a training system for a target detection model provided by an embodiment of the present application;
[0058] Figure 4 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Detailed Embodiments
[0059] Embodiments of the present application will be described in detail below. Examples of the embodiments are shown in the accompanying drawings, where the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the accompanying drawings are exemplary and are only used to explain the present application and should not be construed as a limitation of the present application. For the step numbers in the following embodiments, they are only set for the convenience of description and illustration, and no limitation is imposed on the order between the steps. The execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.
[0060] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0061] Currently, existing SSD detection technologies usually perform downsampling operations on the multi-scale feature maps output by the convolutional neural network after the image is input into the convolutional neural network, and fuse and detect the features of different levels. Specifically, since the small target features in the feature map will be quickly lost after several downsampling operations on the input feature map, this method cannot fully utilize the small target features of the image, and the accuracy of small target detection is not satisfactory.
[0062] In addition, when existing SSD detection technologies fuse the features of different levels, they usually simply add the features. This method will bring certain redundant and conflicting feature information, require more computing resources, generate poor-quality fused features, and the accuracy and efficiency of small target detection are not satisfactory. Moreover, there are some SSD detection technologies that can improve the detection performance of the SSD network model for small targets to a certain extent by constructing multi-level feature detection models, reducing the screening threshold of small target whole samples, etc. However, since these methods do not improve the attention of the SSD network model to small target information, the accuracy of small target detection is relatively low.
[0063] In view of this, an embodiment of the present invention provides a training method, a detection method and a system for a target detection model. In the training method, after upsampling a low-dimensional second feature map and adaptively fusing it with a first feature map, the model can make full use of small target features existing in the image and suppress redundant and conflicting feature information in the fused feature map, which is beneficial to improving the accuracy and efficiency of small target detection. In addition, the training method also performs feature normalization on the fused feature map, which can effectively reduce the influence of background noise on small target features in the fused feature map, and performs feature enhancement on the normalized feature map (specifically, performs conditional feature enhancement on each first feature region), which can effectively improve the model's attention to small target features, thereby being beneficial to improving the accuracy of small target detection.
[0064] Referring Figure 1 and Figure 2 , in an embodiment of the present application, a training method for a target detection model includes:
[0065] Step 110: Obtain a sample image of a target sample;
[0066] In an embodiment of the present application, the target sample may be a sample to be detected by the target detection model, which may specifically be a person, a vehicle, an airplane, etc.; and the sample image may be an image that contains the target sample and is used for training the target detection model.
[0067] Step 120: Perform multi-dimensional feature extraction on the sample image to obtain a sample feature set, where the sample feature set includes a plurality of sample feature maps obtained based on the extraction order of the multi-dimensional feature extraction, and the feature dimension of the latter sample feature map is smaller than that of the previous sample feature map;
[0068] In an embodiment of the present application, based on the extraction order from large to small in feature dimension, feature extraction can be performed on the input feature map of the sample image dimension by dimension, and the sample feature map obtained by feature extraction of each dimension is sorted after the sample feature map of the previous feature dimension, so as to obtain a plurality of sample feature maps with gradually decreasing feature dimensions.
[0069] In some embodiments, the performing multi-dimensional feature extraction on the sample image to obtain a sample feature set includes:
[0070] Perform feature dimension elevation processing on the sample image to obtain an elevated feature map;
[0071] Perform feature extraction on the elevated feature map through a plurality of cascaded dimension reduction feature extraction units to obtain a sample feature map output by each dimension reduction feature extraction unit.
[0072] In the embodiments of the present application, the multi-dimensional feature extraction of the sample image can be implemented by the MobileNet-V3 backbone network in the object detection model. Specifically, the feature dimension increase process can be to input the input feature map of the sample image into a 2D convolutional layer (Conv2d) and three bottleneck layers (Bottleneck, abbreviated as Bneck) with different convolutional kernel sizes for dimension increase layer by layer, so as to obtain the dimension-increased feature map output by the last Bneck layer. The feature dimension of the dimension-increased feature map is greater than the feature dimension of the input feature map.
[0073] It can be understood that the MobileNet-V3 backbone network can include a number of cascaded dimension reduction feature extraction units. Continuing to refer to Figure 2 , in the embodiments of the present application, taking the number of cascaded dimension reduction feature extraction units as 6 as an example, the first dimension reduction feature extraction unit can include a Bneck layer with a convolutional kernel size of 5×5; the second dimension reduction feature extraction unit can include a Bneck layer with a convolutional kernel size of 5×5 and a 2D convolutional layer; the remaining dimension reduction feature extraction units can each include a depthwise separable convolutional layer (Depthwise Conv) and a 2D convolutional layer; wherein, the feature dimension corresponding to the latter dimension reduction feature extraction unit is smaller than the feature dimension corresponding to the previous dimension reduction feature extraction unit.
[0074] Specifically, the feature extraction of the dimension-increased feature map can be to use the dimension-increased feature map as the input and input it into the first dimension reduction feature extraction unit among all the cascaded dimension reduction feature extraction units, so as to obtain the sample feature maps output by each dimension reduction feature extraction unit. The feature dimension of the latter sample feature map is smaller than the feature dimension of the previous sample feature map. For example, for the sample feature map of the third dimension reduction feature extraction unit, denoted as the third sample feature map, and the sample feature map of the fourth dimension reduction feature extraction unit, denoted as the fourth sample feature map, the feature dimension of the third sample feature map is smaller than that of the fourth sample feature map. The same applies to the other sample feature maps, and it can be simply deduced by analogy.
[0075] Step 130: Perform feature pyramid upsampling and adaptive fusion on the sample feature set to obtain a number of fused feature maps. Each fused feature map is used to represent the feature fusion information of the first feature map and the second feature map after upsampling. The first feature map is a sample feature map with the same feature dimension as the fused feature map, and the second feature map is the next sample feature map after the first feature map;
[0076] In the embodiments of the present application, each sample feature map in the sample feature set is respectively denoted as the first sample feature map, the second sample feature map, the third sample feature map, the fourth sample feature map, the fifth sample feature map, and the sixth sample feature map based on the sample feature maps of the corresponding dimensionality reduction feature extraction units. For example, the first sample feature map is the sample feature map of the first dimensionality reduction feature extraction unit, and the fifth sample feature map is the sample feature map of the fifth dimensionality reduction feature extraction unit.
[0077] It can be understood that step 130 may be to perform upsampling on the remaining sample feature maps except the first sample feature map and perform adaptive fusion on the remaining sample feature maps except the sixth sample feature map based on the feature pyramid structure, so as to obtain a fusion feature map corresponding to each feature dimension.
[0078] In some embodiments, performing feature pyramid upsampling and adaptive fusion on the sample feature set to obtain a fusion feature map includes:
[0079] Performing feature upsampling on the second feature map to obtain a third feature map;
[0080] In the embodiments of the present application, for any sample feature map in the sample feature set except the sixth sample feature map, this sample feature map may be determined as the first feature map, and the second feature map of the first feature map is obtained. Specifically, for the third sample feature map in the sample feature set, this third sample feature map may be denoted as the first feature map, and the fourth sample feature map with a feature dimension smaller than the third sample feature map is denoted as the second feature map.
[0081] It can be understood that the feature upsampling of the second feature map may be to sequentially input the second feature map into a convolutional layer with a convolutional kernel size of 3×3, a normalization layer (Batch Normalization Layer, BN), and a ReLU activation function layer, and then perform an upsampling operation on the activated second feature map. The specific upsampling operations include any one of nearest neighbor interpolation, bilinear interpolation, bicubic interpolation, etc., so as to obtain a third feature map with the same feature dimension as the first feature map.
[0082] Performing adaptive feature fusion processing on the first feature map and the third feature map to obtain the fusion feature map.
[0083] Further, the performing adaptive feature fusion processing on the first feature map and the third feature map to obtain the fusion feature map includes:
[0084] Based on the first feature map and the third feature map, perform dynamic weight calculation to obtain the first dynamic weight of the first feature map and the second dynamic weight of the third feature map;
[0085] Further, the performing dynamic weight calculation based on the first feature map and the third feature map to obtain the first dynamic weight of the first feature map and the second dynamic weight of the third feature map includes:
[0086] Perform similarity measurement calculation on the first feature map and the third feature map to obtain a feature similarity;
[0087] According to the feature similarity, perform feature complementarity evaluation on the first feature map to obtain a first complementary value of the first feature map, and the first complementary value is negatively correlated with the feature similarity;
[0088] According to the feature similarity, perform feature complementarity evaluation on the third feature map to obtain a second complementary value of the third feature map, and the second complementary value is negatively correlated with the feature similarity;
[0089] According to the first complementary value and the second complementary value, obtain the first dynamic weight of the first feature map and the second dynamic weight of the third feature map.
[0090] In the embodiments of the present application, the adaptive feature fusion of the first feature map and the third feature map can be realized based on the dynamic weights between the first feature map and the third feature map. For a certain first feature map and its corresponding third feature map, the relationship between the first feature map and the third feature map can be obtained through feature similarity measurement and feature complementarity evaluation. Specifically, the similarity measurement calculation between the first feature map and the third feature map can be calculated in any one of the ways such as cosine similarity, Euclidean distance, KL divergence, etc. In the embodiments of the present application, taking the KL divergence method as an example, the feature similarity between the first feature map and the third feature map can be expressed as:
[0091]
[0092] where D KL (F1∥F2) is the first feature similarity between the first feature map and the third feature map; F1 is the first feature map; F2 is the third feature map; C is the number of channels of the feature map, and H and W are the height and width of the feature map respectively; is the feature value of the first feature map at position (i, j) and channel c; is the feature value of the second feature map at position (i, j) and channel c.
[0093] And after the first feature map is evaluated for feature complementarity, its first complementary value can be expressed as:
[0094]
[0095] Among them, W comp (F1, F2) is the first complementary value of the first feature map.
[0096] It can be understood that since the KL divergence is asymmetric, the first feature similarity D KL (F1∥F2) and the second feature similarity D KL (F2∥F1) between the first feature map and the third feature map are usually different. Therefore, in the embodiments of the present application, if the similarity between the first feature map and the third feature map is measured by the KL divergence, the first feature similarity and D KL (F1∥F2) and the second feature similarity D KL (F2∥F1) can be obtained respectively. Then, based on the first feature similarity and D KL (F1∥F2) and the second feature similarity D KL (F2∥F1), the first complementary value of the first feature map and the second complementary value of the third feature map are determined. For example, the first complementary value of the first feature map is determined based on the first feature similarity, and the second complementary value of the third feature map is determined based on the second feature similarity; or, the second complementary value of the third feature map can be determined based on the first feature similarity, and the first complementary value of the first feature map can be determined based on the second feature similarity. The examples of the present application are only for illustration and do not limit the present application.
[0097] It should be noted that the first complementary value and the second complementary value can reflect the complementarity between two feature maps. The lower the similarity between the two feature maps, the higher the complementary value, that is, the first complementary value or the second complementary value is negatively correlated with the feature similarity. In addition, for the similarity measurement calculation based on the cosine similarity or the Euclidean distance, etc., the obtained feature similarity is one, and at this time, the first complementary value of the first feature map is equal to the second complementary value of the third feature map, which will not be elaborated in the present application.
[0098] It is worth mentioning that after obtaining the first complementary value and the second complementary value, dynamic weights for feature fusion can be assigned to the first feature map and the third feature map respectively. Among them, the first dynamic weight of the first feature map can be expressed as:
[0099]
[0100] Among them, is the first dynamic weight of the first feature map; W comp (F1, F2) is the first complementary value of the first feature map; W comp (F2, F1) is the third complementary value of the third feature map.
[0101] It should be noted that the second dynamic weight of the third feature map is similar to the first dynamic weight of the aforementioned first feature map, and can be simply deduced by analogy. Therefore, this application will not elaborate on it here.
[0102] According to the first dynamic weight and the first feature map, perform feature weighted fusion on the second dynamic weight and the third feature map to obtain a fourth feature map;
[0103] Perform feature enhancement on the fourth feature map to obtain the fused feature map.
[0104] In the embodiments of the present application, based on methods such as weighted summation and weighted averaging, the second dynamic weight and the corresponding third feature map can be weighted and fused through the first dynamic weight and the corresponding first feature map to obtain a fourth feature map; then, the fourth feature map is input into a lightweight feature enhancement module composed of a convolutional layer and a ReLU activation function layer for enhancement, so as to obtain the fused feature map output by the lightweight feature enhancement module. The fused feature map can be expressed as:
[0105]
[0106] where F enhanced is the fused feature map; ReLU(·) is the activation function; Conv(·) is the convolution function.
[0107] Step 140: According to all the fused feature maps, update the parameters of the initialized object detection model to obtain a trained object detection model.
[0108] In the embodiments of the present application, each fused feature map can be detected and classified to obtain the detection probability value corresponding to each fused feature map, and then a detection result corresponding to the sample image of the target sample is generated based on the maximum detection probability value; then, based on the Scale-aware Focal Loss loss function optimized by the scale perception mechanism, denoted as the Scale-aware FocalLoss loss function, and the Focal EIoU loss function optimized by the scale perception mechanism and the Focal loss idea, denoted as the Focal EIoU Loss loss function, jointly determine the target loss value through the detection probability value, and use the backpropagation algorithm to update the parameters of the model. After several rounds of iteration, a trained object detection model can be obtained. The specific number of iteration rounds can be preset in advance, or it is considered that the training is completed when the accuracy requirement is met on the test set.
[0109] Exemplarily, the Scale-aware Focal Loss loss function can be expressed as:
[0110] L class= -α_pos * (1 - p_pos) γ * log(p_pos) · ω s
[0111] Where L class is the loss value of the Scale-aware Focal Loss function, denoted as the first sub-loss value; α_pos is the weight parameter of the positive sample; γ is an adjustable parameter; p_pos is the probability of predicting a positive sample; ω s is the scale-aware weight under the scale-aware mechanism.
[0112] The Focal EIoU Loss function can be expressed as:
[0113]
[0114] Where L reg is the loss value of the Focal EIoU Loss function, denoted as the second sub-loss value; IoU is the intersection over union of the predicted bounding box and the ground truth bounding box; ρ is the Euclidean distance between the centers of the predicted bounding box and the ground truth bounding box; ρ w and ρ h are the differences in width and height between the predicted bounding box and the ground truth bounding box respectively; r is the diagonal length of the minimum enclosing box, which is used to represent the smallest rectangle that contains both the predicted bounding box and the ground truth bounding box; R w and R h are the width and height of the minimum enclosing box respectively, and β is the focusing factor, which is used to enhance the penalty for easily classified boxes, and ω s is the scale-aware weight.
[0115] It can be understood that after calculating the first sub-loss value and the second sub-loss value, a simple summation operation can be performed on the first sub-loss value and the second sub-loss value to obtain the target loss value, which will not be elaborated herein in this application.
[0116] In some embodiments, the method further includes:
[0117] Performing global normalization on the fused feature map to obtain a normalized feature map;
[0118] In the embodiments of this application, in order to make the distribution of the fused feature map more uniform and reduce the influence of background noise on the small target features in the fused feature map, a global normalization operation can be performed on the fused feature map. The specific global normalization operation can be any one of Min-Max normalization, Z-Score normalization, L2 norm normalization, etc., so as to obtain the normalized fused feature map, denoted as the normalized feature map.
[0119] Performing feature enhancement processing on the normalized feature map to obtain an enhanced feature map;
[0120] Further, the feature enhancement processing of the normalized feature map to obtain an enhanced feature map includes:
[0121] Performing region segmentation on the normalized feature map to obtain a number of first feature regions;
[0122] Performing region statistics on all the first feature regions to obtain the region mean and region standard deviation of each first feature region;
[0123] Performing conditional feature enhancement on the corresponding first feature region according to the region mean and the region standard deviation to obtain a second feature region;
[0124] Obtaining the enhanced feature map according to all the second feature regions.
[0125] In the embodiments of the present application, the feature enhancement processing is used to enhance the small target features in the normalized feature map. Specifically, the region segmentation can divide the normalized feature map into several local regions, and each local region is denoted as a first feature region. For example, the normalized feature map can be divided into several local regions of size 5×5.
[0126] It can be understood that in the first feasible implementation manner, the region statistics can be to calculate the mean and standard deviation of all the first feature regions, and respectively determine the calculated mean and standard deviation as the region mean and region standard deviation of each first feature region; or, in the second feasible implementation manner, for a certain first feature region, the region statistics can be to calculate the mean and standard deviation of all the feature values of the first feature region, and respectively denote them as the region mean and region standard deviation. The same applies to the remaining first feature regions, and the present application will not elaborate here.
[0127] It should be noted that for a certain feature value of the first feature region, its conditional feature enhancement can be based on judging the size relationship between the feature value and the region mean, and selectively enhancing the feature value based on the size relationship and the region standard deviation. The same applies to the remaining feature values of the first feature region, and it can be simply deduced by analogy. Exemplarily, the functional expression of the conditional feature enhancement in the embodiments of the present application can be:
[0128]
[0129] where E(·) is the expression function of the conditional feature enhancement; x is the feature value of the first feature region; α is a learnable parameter; σ is the region standard deviation of the first feature region; μ is the region mean of the first feature region.
[0130] It is worth mentioning that after obtaining all the second feature regions, all the second feature regions can be reconstructed to obtain an enhanced normalized feature map, denoted as the enhanced feature map.
[0131] Perform attention extraction on the enhanced feature map to obtain a feature attention map;
[0132] According to the feature attention map, perform attention weighted fusion update on the fusion feature map to obtain a fusion updated fusion feature map.
[0133] In the embodiment of the present application, based on the attention mechanism, attention feature extraction and weighted fusion can be performed on the enhanced feature map to obtain a fusion updated fusion feature map. Specifically, the enhanced feature map can be sequentially input into a 1×1 convolutional layer, a ReLU activation function layer, and a Sigmoid activation function layer to obtain the feature attention map of the enhanced feature map; then, the enhanced feature map and the feature attention map are weighted and fused through an element-wise multiplication operation to obtain a fusion updated fusion feature map.
[0134] In the embodiment of the present application, a detection method for an object detection model includes:
[0135] Step 210, obtain a target image of the target to be detected;
[0136] Step 220, input the target image into the trained object detection model as described above for detection and recognition to obtain the object detection result of the target to be detected.
[0137] In the embodiment of the present application, the target image can be input into the trained object detection model for detection and recognition to obtain the object detection result output by the object detection model. For example, the target image containing the target to be detected, such as a small aircraft, can be input into the trained object detection model to obtain the object detection result of the target to be detected, such as a small aircraft.
[0138] Next, a training system for an object detection model proposed according to an embodiment of the present application will be described in detail with reference to the accompanying drawings.
[0139] Refer to Figure 3 , a training system for an object detection model proposed in the embodiment of the present application includes:
[0140] A first processing unit 101, configured to obtain a sample image of a target sample;
[0141] A second processing unit 102, configured to perform multi-dimensional feature extraction on the sample image to obtain a sample feature set, where the sample feature set includes a plurality of sample feature maps obtained based on the extraction order of the multi-dimensional feature extraction, and the feature dimension of the latter sample feature map is smaller than that of the previous sample feature map;
[0142] A third processing unit 103, configured to perform feature pyramid upsampling and adaptive fusion on the sample feature set to obtain a plurality of fusion feature maps, where each fusion feature map is used to represent the feature fusion information of a first feature map and a second feature map after upsampling, the first feature map is a sample feature map with the same feature dimension as the fusion feature map, and the second feature map is the next sample feature map of the first feature map;
[0143] A fourth processing unit 104, configured to update the parameters of the initialized object detection model according to all the fusion feature maps to obtain a trained object detection model.
[0144] It can be understood that the content in the above method embodiments is applicable to the system embodiments of the present application. The functions specifically implemented in the system embodiments of the present application are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those in the above method embodiments.
[0145] Referring to Figure 4 , an embodiment of the present application further provides an electronic device, including:
[0146] At least one processor 201;
[0147] At least one memory 202, configured to store at least one program;
[0148] When the at least one program is executed by the at least one processor 201, the at least one processor 201 implements the above method embodiments.
[0149] Similarly, it can be understood that the content in the above method embodiments is applicable to the device embodiments of the present application. The functions specifically implemented in the device embodiments of the present application are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those in the above method embodiments.
[0150] An embodiment of the present application further provides a computer-readable storage medium, in which a program executable by a processor 201 is stored, and the program executable by the processor 201 is used to implement the above method embodiments when executed by the processor 201.
[0151] Similarly, the content in the above method embodiments is applicable to the embodiments of this computer-readable storage medium. The functions specifically implemented in the embodiments of this computer-readable storage medium are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those in the above method embodiments.
[0152] In some alternative embodiments, the functions / operations mentioned in the block diagrams may not occur in the order mentioned in the operation diagrams. For example, depending on the functions / operations involved, two consecutive blocks shown may actually be executed substantially simultaneously or the blocks can sometimes be executed in the reverse order. Additionally, the embodiments presented and described in the flowcharts of this application are provided by way of example for the purpose of providing a more comprehensive understanding of the technology. The disclosed methods are not limited to the operations and logical flows presented herein. Alternative embodiments are contemplated where the order of various operations is changed and where sub-operations described as part of a larger operation are executed independently.
[0153] Furthermore, although this application is described in the context of functional modules, it should be understood that, unless otherwise stated to the contrary, one or more of the functions and / or features may be integrated in a single physical device and / or software module, or one or more functions and / or features may be implemented in separate physical devices or software modules. It can also be understood that a detailed discussion of the actual implementation of each module is not necessary for understanding this application. Rather, given the attributes, functions, and internal relationships of the various functional modules in the devices disclosed herein, the actual implementation of the modules will be understood within the ordinary skills of an engineer. Therefore, those skilled in the art can implement this application as set forth in the claims without undue experimentation. It can also be understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of this application, which is determined by the full scope of the appended claims and their equivalents.
[0154] If a function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method in the embodiments of this application. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.
[0155] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a definable list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device), or used in conjunction with these instruction execution systems, apparatus, or devices. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0156] More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection portion (electronic device) having one or more wirings, a portable computer diskette (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, a computer-readable medium can even be paper or other suitable media on which a program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpretation, or otherwise processing as appropriate, and then stored in a computer memory.
[0157] It should be understood that various parts of the present application can be implemented by hardware, software, firmware, or a combination thereof. In the above-described embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, any one or a combination of the following techniques well known in the art can be used: discrete logic circuits having logic gate circuits for implementing logical functions on data signals, application specific integrated circuits having appropriate combinational logic gate circuits, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.
[0158] In the above description of this specification, the descriptions referring to the terms "one embodiment / example", "another embodiment / example", or "certain embodiments / examples", etc., mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0159] Although the embodiments of the present application have been shown and described, those of ordinary skill in the art can understand that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present application. The scope of the present application is defined by the claims and their equivalents.
[0160] The above has specifically described the preferred embodiments of the present application, but the present application is not limited to the embodiments. Those skilled in the art can make various equivalent deformations or substitutions without violating the spirit of the present application, and these equivalent deformations or substitutions are all included within the scope defined by the claims of the present application.
Claims
1. A training method for an object detection model, characterized in that, Including: Obtain a sample image of a target sample; Perform multi-dimensional feature extraction on the sample image to obtain a sample feature set, where the sample feature set includes a plurality of sample feature maps obtained based on the extraction order of the multi-dimensional feature extraction, and the feature dimension of the latter sample feature map is smaller than that of the previous sample feature map; Perform feature pyramid upsampling and adaptive fusion on the sample feature set to obtain a plurality of fusion feature maps, where each fusion feature map is used to represent the feature fusion information of a first feature map and a second feature map after upsampling, the first feature map is a sample feature map with the same feature dimension as the fusion feature map, and the second feature map is the next sample feature map of the first feature map; According to all the fusion feature maps, update the parameters of the initialized target detection model to obtain a trained target detection model.
2. The method according to claim 1, wherein The performing multi-dimensional feature extraction on the sample image to obtain a sample feature set includes: Perform feature dimension elevation processing on the sample image to obtain an elevation feature map; Perform feature extraction on the elevation feature map through a plurality of cascaded dimension reduction feature extraction units to obtain a sample feature map output by each dimension reduction feature extraction unit.
3. The method according to claim 1, characterized in that The performing feature pyramid upsampling and adaptive fusion on the sample feature set to obtain a fusion feature map includes: Perform feature upsampling on the second feature map to obtain a third feature map; Perform adaptive feature fusion processing on the first feature map and the third feature map to obtain the fusion feature map.
4. The method according to claim 3, characterized in that, The performing adaptive feature fusion processing on the first feature map and the third feature map to obtain the fusion feature map includes: Perform dynamic weight calculation according to the first feature map and the third feature map to obtain a first dynamic weight of the first feature map and a second dynamic weight of the third feature map; Perform feature weighted fusion on the second dynamic weight and the third feature map according to the first dynamic weight and the first feature map to obtain a fourth feature map; Perform feature enhancement on the fourth feature map to obtain the fusion feature map.
5. The method according to claim 4, wherein The performing dynamic weight calculation according to the first feature map and the third feature map to obtain the first dynamic weight of the first feature map and the second dynamic weight of the third feature map includes: Perform similarity measurement calculation on the first feature map and the third feature map to obtain a feature similarity; Perform feature complementarity evaluation on the first feature map according to the feature similarity to obtain a first complement value of the first feature map, where the first complement value is negatively correlated with the feature similarity; Perform feature complementarity evaluation on the third feature map according to the feature similarity to obtain a second complement value of the third feature map, where the second complement value is negatively correlated with the feature similarity; Obtain the first dynamic weight of the first feature map and the second dynamic weight of the third feature map according to the first complement value and the second complement value.
6. The method according to claim 1, characterized in that The method further includes: Perform global normalization on the fusion feature map to obtain a normalized feature map; Perform feature enhancement processing on the normalized feature map to obtain an enhanced feature map; Perform attention extraction on the enhanced feature map to obtain a feature attention map; According to the feature attention map, perform attention-weighted fusion update on the fused feature map to obtain a fused feature map after fusion update.
7. The method according to claim 6, wherein The performing feature enhancement processing on the normalized feature map to obtain an enhanced feature map includes: Perform region segmentation on the normalized feature map to obtain a plurality of first feature regions; Perform region statistics on all the first feature regions to obtain the region mean and region standard deviation of each first feature region; According to the region mean and the region standard deviation, perform conditional feature enhancement on the corresponding first feature region to obtain a second feature region; According to all the second feature regions, obtain the enhanced feature map.
8. A detection method for an object detection model, characterized in that, Includes: Obtain a target image of the target to be detected; Input the target image into the trained target detection model according to any one of claims 1-7 for detection and recognition to obtain the target detection result of the target to be detected.
9. A training system for an object detection model, characterized in that, Includes: A first processing unit for obtaining a sample image of a target sample; A second processing unit for performing multi-dimensional feature extraction on the sample image to obtain a sample feature set, the sample feature set including a plurality of sample feature maps obtained according to the extraction order of the multi-dimensional feature extraction, and the feature dimension of the latter sample feature map being smaller than that of the previous sample feature map; A third processing unit for performing feature pyramid upsampling and adaptive fusion on the sample feature set to obtain a plurality of fused feature maps, each fused feature map being used to represent the feature fusion information of a first feature map and a second feature map after upsampling, the first feature map being a sample feature map with the same feature dimension as the fused feature map, and the second feature map being the next sample feature map of the first feature map; A fourth processing unit for updating the parameters of the initialized target detection model according to all the fused feature maps to obtain a trained target detection model.
10. An electronic device, characterized in that, Includes: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method according to any one of claims 1-7.
Citation Information
Patent Citations
Camera shielding detection method and device, storage medium and electronic equipment
CN116188790A
Base station resource scheduling method based on traffic and communication feature complementary prediction
CN116634442A
Food safety detection system and method thereof
CN116858789A
Method, device and equipment for expanding defect sample and storage medium
CN117710371A
Remote sensing image ship small target detection method and system
CN117789030A