A target detection method based on iterative design
Through an iteratively designed target detection method, deformable convolution and balanced feature pyramid are used to enhance detection accuracy and robustness, solve detection problems under target occlusion and deformation, and achieve higher detection accuracy and recall rate.
Patent Information
- Application Number
- CN202111260563.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-28
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2041-10-28
AI Technical Summary
Existing target detection algorithms are difficult to achieve high-precision detection in target occlusion scenarios, mainly because the non-maximum suppression post-processing algorithm cannot distinguish redundant detection frames and overlapping targets, and the traditional model cannot adapt to target deformation and insufficient information.
It adopts a target detection method based on iterative design to construct a target detection main network and a historical information feature extraction sub-network, obtain multi-scale features through deformable convolution and balanced feature pyramid, and enhance detection accuracy and robustness through a historical information feature fusion mechanism. .
It significantly improves the accuracy and robustness of target detection with severe occlusion and deformation, reduces the difficulty and complexity of model training, and improves recall rate and detection accuracy.
Smart Images

Figure CN113947756B
Abstract
Description
Technical Field
[0001] The invention relates to a target detection method, and in particular to a target detection method based on iterative design. Background Art
[0002] In daily life, there are many scenarios where the targets to be detected occlude each other, such as the pedestrian detection system in public places, the vehicle flow monitoring system in road traffic management, and the automatic detection system of dense cells under a microscope in medical laboratories. The overlap and occlusion between the targets to be detected in the above scenarios will pose a huge challenge to the target detection algorithm. How to accurately detect targets in the scenario of target occlusion is a topic of great concern to both academia and industry, but the current general target detection algorithms are difficult to meet the requirements in terms of detection accuracy and recall rate in the scenario of target occlusion.
[0003] The general object detection algorithm cannot achieve satisfactory results in complex scenes such as object occlusion. The fundamental reasons are as follows: (1) Traditional post-processing algorithms such as non-maximum suppression cannot distinguish whether two adjacent detection frames are redundant detection frames of the same object or detection frames belonging to two overlapping objects. (2) Moving objects not only deform but also occlude each other. Traditional object detection models cannot adapt to object deformation and handle insufficient object information. Summary of the invention
[0004] The purpose of the present invention is to provide a target detection method based on iterative design, which effectively enhances detection accuracy and robustness, reduces the difficulty and complexity of training, and is more universal.
[0005] The above technical objectives of the present invention are achieved through the following technical solutions:
[0006] A target detection method based on iterative design includes the following steps:
[0007] Construct the main network for target detection, including several residual blocks, and the output of each residual block corresponds to a feature map of one layer scale;
[0008] Construct a historical information feature extraction sub-network, including several residual blocks, and the output of each residual block obtains a sub-historical information feature group, and each sub-historical information feature group has the same scale as the feature map outputted by the main network;
[0009] The historical information features are fused, and the sub-historical information feature group is added to the pixels of the corresponding channel of the main network at the corresponding scale to perform feature fusion operation;
[0010] The constructed target detection model is trained on the training set of the target crowded scene dataset, and the main network and sub-network are trained at the same time until the model converges;
[0011] The trained target detection model is applied to target detection in target occlusion scenarios and verified through the test set of the dataset;
[0012] The target to be detected is input into the target detection model for the first detection, and feature extraction is performed through the historical information feature extraction sub-network to obtain historical information feature maps of multiple scales;
[0013] Through historical information feature fusion, the historical information features obtained from the first detection are integrated into the second detection from multiple scales; the two detection results are merged to obtain the final optimal result set.
[0014] In summary, the present invention has the following beneficial effects:
[0015] The designed historical information feature sub-network uses deformable convolution to replace traditional convolution and adopts balanced feature pyramid to obtain multi-scale balanced features, which significantly enhances the detection accuracy and robustness of the model for severely occluded and deformed targets. The design of historical information feature fusion mechanism greatly reduces the difficulty of model training and simplifies the model training steps. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 This is the network structure diagram of the target detection method;
[0017] Figure 2 Structural diagram of using a balanced feature pyramid for the historical information feature extraction subnetwork. DETAILED DESCRIPTION
[0018] The present invention is further described in detail below in conjunction with the accompanying drawings.
[0019] According to one or more embodiments, a target detection method based on iterative design is disclosed, such as Figure 1 As shown, the following steps are included:
[0020] S1. Build the main network for target detection, including several residual blocks, and the output of each residual block corresponds to a feature map of a layer scale.
[0021] The structure of the main target detection network is shown in Table 1 below:
[0022] It consists of five residual blocks: conv1, conv2_x, conv3_x, conv4_x, and conv5_x;
[0023]
[0024] Table 1
[0025] The first residual block: the convolution kernel size is 7x7, the number of convolution kernels is 64, and the output feature map size is 112x112;
[0026] The second residual block: first passes through a 3x3 maximum pooling layer, and then passes through three residual layers with a convolution kernel size of 1x1 and 64 convolution kernels; a convolution kernel size of 3x3 and 64 convolution kernels; and a convolution kernel size of 1x1 and 256 convolution kernels.
[0027] The third residual block: four residual layers with a convolution kernel size of 1x1 and 128 convolution kernels, a convolution kernel size of 3x3 and 128 convolution kernels, and a convolution kernel size of 1x1 and 512 convolution kernels.
[0028] The fourth residual block: six residual layers with a convolution kernel size of 1x1 and 256 convolution kernels, a convolution kernel size of 3x3 and 256 convolution kernels, and a convolution kernel size of 1x1 and 1024 convolution kernels.
[0029] The fifth residual block: three residual layers with a convolution kernel size of 1x1 and 512 convolution kernels, a convolution kernel size of 3x3 and 512 convolution kernels, and a convolution kernel size of 1x1 and 2048 convolution kernels.
[0030] S2. Construct a historical information feature extraction sub-network, including several residual blocks. The output of each residual block obtains a sub-historical information feature group. Each sub-historical information feature group has the same scale as the feature map outputted by the main network.
[0031] The historical information feature extraction subnetwork uses deformable convolution, which learns the deformation characteristics of the target and adapts to the geometric deformation caused by the target's movement, thereby enhancing the adaptability of the model's geometric deformation. Its structure is shown in Table 2 below:
[0032] It consists of four residual blocks: conv1', conv2'_x, conv3'_x, and conv4'_x. The output of each residual block obtains a sub-historical information feature group T1, T2, T3, and T4 with the same feature map scale as the output of conv1, conv2_x, conv3_x, and conv4_x in the main network;
[0033]
[0034] Table 2
[0035] The first residual block: the convolution kernel size is 7x7, the number of convolution kernels is 64, and the output feature map size is 112x112;
[0036] The second residual block: first passes through a 3x3 maximum pooling layer, then passes through two residual layers with two layers of convolution kernels of size 3x3 and 256 convolution kernels, and the output feature map size is 56x56;
[0037] The third residual block: two residual layers with two convolution kernels of size 3x3, 512 convolution kernels, and an output feature map size of 28x28;
[0038] The fourth residual block: two residual layers with two layers of convolution kernel size of 3x3, the number of convolution kernels is 1024, and the output feature map size is 14x14.
[0039] S3. Fuse the historical information features, add the pixels of the corresponding channels of the sub-historical information feature group and the main network at the corresponding scale to perform feature fusion operation.
[0040] A balanced feature pyramid is used to fuse historical information features. The balanced feature pyramid can obtain more balanced features at multiple scales, thereby effectively improving the detection accuracy of the model.
[0041] like Figure 2 As shown in the figure, the traditional convolution kernel is replaced with a deformable convolution to build a balanced feature pyramid: First, the features C2, C3, C4, and C5 of different scales extracted by the historical information feature extraction subnetwork are scaled to the same scale as C4 using interpolation or maximum pooling methods, and then the average value of all scales is taken to obtain the fused feature map C. The formula for calculating the average value is as follows:
[0042]
[0043] Where L is the number of layers of feature extraction network output features, and Cl is the feature of the lth layer.
[0044] Then, Gaussian Non-local Attention is used to enhance the information of C, which fuses the information of each scale, to obtain C', so that the fused features have high-resolution information. Finally, the fused features after information enhancement are rescaled back to the original scale size and added to the previous initial feature map to obtain the final balanced feature.
[0045] The specific fusion mechanism for fusion is:
[0046] Input the original image into the main target detection network to obtain the detection box result of the first detection:
[0047]
[0048] where x k ,y k is the coordinate of the upper left corner of the kth detection box, w k 、h k is the width and height of the coordinate frame; define a historical information graph H with the same size as the original image xy , H xy The value of each pixel in is the statistical value of the number of detection boxes in B that cover the pixel;
[0049] Historical Infographic H xy The calculation formula is as follows:
[0050]
[0051] Where 1 is a counting symbol, and all pixels that meet the coordinate range are recorded as being covered by the detection frame once;
[0052] The calculated historical information graph H xy Input the historical information feature extraction sub-network to obtain the sub-historical information feature group with the same scale as the feature map output by conv1, conv2_x, conv3_x, and conv4_x in the target detection main network: T1, T2, T3, and T4;
[0053] Add the pixels on each channel of the feature map output by the main network conv1, conv2_x, conv3_x, conv4_x to the sub-network output T1, T2, T3, T4 pixel by pixel
[0054] S4. Train the constructed target detection model on the training set of the target crowded scene WiderPerson and CrowdHuman datasets, and train the main network and sub-network until the model converges.
[0055] The training of the constructed target detection model based on the training set of the target crowded scene dataset is as follows:
[0056] Divide the true value boxes in the training set of the dataset into two parts B old and B new ;
[0057] B old Directly converted into historical information graph H xy , input into the historical information feature extraction sub-network to obtain historical information features of multiple dimensions; B new Directly used as the target prediction box for model training;
[0058] The historical information features of multiple dimensions are integrated into the main network, where the feature integration method is to directly add the corresponding pixels;
[0059] The training sample is input into the model, and the features are further extracted to obtain the prediction box P. new The error back propagation between them optimizes the loss function of the model, and the main network and the sub-network are trained simultaneously until the model converges.
[0060] S5. Apply the trained target detection model to target detection in target occlusion scenarios and verify it through the test set of the dataset. Transplant the trained model to the embedded platform, use the model to detect targets in surveillance cameras, and develop a target detection system in occlusion scenarios.
[0061] The first detection is performed through the target detection model of the main network, and the obtained detection box is converted into a grayscale image recording the first detection result in a statistical way; and further feature extraction is performed on it through the historical information feature extraction sub-network to obtain historical information feature maps of multiple scales; finally, the historical information features obtained from the first detection at multiple scales are integrated into the second detection using the historical information feature fusion mechanism, and the two detection results are merged to obtain the final optimal result set.
[0062] By designing a historical information feature subnetwork, deformable convolution replaces traditional convolution and uses a balanced feature pyramid to obtain multi-scale balanced features, which significantly enhances the detection accuracy and robustness of the model for targets with severe occlusion and deformation. In addition, by designing a historical information feature fusion mechanism, the difficulty of model training is greatly reduced and the training steps of the model are simplified. It can effectively solve the problem that the post-processing method of non-maximum suppression of traditional target detection algorithms in target occlusion scenarios leads to missed detection of targets. Compared with traditional target detection algorithms, the present invention has higher detection accuracy and recall rate in target occlusion scenarios. At the same time, the detection method proposed by the present invention is versatile and can adapt to the detection requirements of various detection targets. It uses deformable convolution to replace traditional convolution and uses a balanced feature pyramid to obtain multi-scale balanced features, which significantly enhances the detection accuracy and robustness of the model for targets with severe occlusion and deformation.
[0063] This specific embodiment is merely an explanation of the present invention and is not a limitation of the present invention. After reading this specification, those skilled in the art may make non-creative modifications to the present embodiment as needed. However, as long as they are within the scope of the claims of the present invention, they are protected by the patent law.
Claims
1. A target detection method based on iterative design, characterized in that: The following steps are included: Construct the main network for target detection, including several residual blocks, and the output of each residual block corresponds to a feature map of one layer scale; Construct a historical information feature extraction sub-network, including several residual blocks, and the output of each residual block obtains a sub-historical information feature group, and each sub-historical information feature group has the same scale as the feature map outputted by the main network; The historical information features are fused, and the sub-historical information feature group is added to the pixels of the corresponding channel of the main network at the corresponding scale to perform feature fusion operation; The constructed target detection model is trained on the training set of the target crowded scene dataset, and the main network and sub-network are trained at the same time until the model converges; The trained target detection model is applied to target detection in target occlusion scenarios and verified through the test set of the dataset; The target to be detected is input into the target detection model for the first detection, and feature extraction is performed through the historical information feature extraction sub-network to obtain historical information feature maps of multiple scales; By fusing historical information features, the historical information features obtained from the first detection are integrated into the second detection from multiple scales; the results of the two detections are combined to obtain the final optimal result set; The structure of the main target detection network is as follows: It consists of five residual blocks: conv1, conv2_x, conv3_x, conv4_x, and conv5_x; The first residual block: the convolution kernel size is 7x7, the number of convolution kernels is 64, and the output feature map size is 112x112; The second residual block: first passes through a 3x3 maximum pooling layer, and then passes through three residual layers with a convolution kernel size of 1x1 and 64 convolution kernels; a convolution kernel size of 3x3 and 64 convolution kernels; and a convolution kernel size of 1x1 and 256 convolution kernels. The third residual block: four residual layers with a convolution kernel size of 1x1 and 128 convolution kernels, a convolution kernel size of 3x3 and 128 convolution kernels, and a convolution kernel size of 1x1 and 512 convolution kernels. The fourth residual block: six residual layers with a convolution kernel size of 1x1 and 256 convolution kernels, a convolution kernel size of 3x3 and 256 convolution kernels, and a convolution kernel size of 1x1 and 1024 convolution kernels. The fifth residual block: three residual layers with a convolution kernel size of 1x1 and 512 convolution kernels, a convolution kernel size of 3x3 and 512 convolution kernels, and a convolution kernel size of 1x1 and 2048 convolution kernels. The structure of the historical information feature extraction subnetwork is as follows: It consists of four residual blocks: conv1', conv2'_x, conv3'_x, and conv4'_x. The output of each residual block obtains a sub-historical information feature group T1, T2, T3, and T4 with the same feature map scale as the output of conv1, conv2_x, conv3_x, and conv4_x in the main network; The first residual block: the convolution kernel size is 7x7, the number of convolution kernels is 64, and the output feature map size is 112x112; The second residual block: first passes through a 3x3 maximum pooling layer, then passes through two residual layers with two layers of convolution kernels of size 3x3 and 256 convolution kernels, and the output feature map size is 56x56; The third residual block: two residual layers with two convolution kernels of size 3x3, 512 convolution kernels, and an output feature map size of 28x28; The fourth residual block: two residual layers with two convolution kernels of size 3x3, 1024 convolution kernels, and an output feature map size of 14x14; The specific fusion mechanism for fusing historical information features is as follows: Input the original image into the main target detection network to obtain the detection box result of the first detection: where x k ,y k is the coordinate of the upper left corner of the kth detection box, w k 、h k is the width and height of the coordinate frame; define a historical information graph H with the same size as the original image xy , H xy The value of each pixel in is the statistical value of the number of detection boxes in B that cover the pixel; Historical Infographic H xy The calculation formula is as follows: Where 1 is a counting symbol, and all pixels that meet the coordinate range are recorded as being covered by the detection frame once; The calculated historical information graph H xy Input the historical information feature extraction sub-network to obtain the sub-historical information feature group with the same scale as the feature map output by conv1, conv2_x, conv3_x, and conv4_x in the target detection main network: T1, T2, T3, and T4; Add the pixels on each channel of the feature map output by the main network conv1, conv2_x, conv3_x, and conv4_x to the sub-network output T1, T2, T3, and T4 pixel by pixel.
2. The target detection method based on iterative design according to claim 1, characterized in that: The training of the constructed target detection model based on the training set of the target crowded scene dataset is as follows: Divide the true value boxes in the training set of the dataset into two parts B old and B new ; B old Directly converted into historical information graph H xy , input into the historical information feature extraction sub-network to obtain historical information features of multiple dimensions; B new Directly used as the target prediction box for model training; The historical information features of multiple dimensions are integrated into the main network, where the feature integration method is to directly add the corresponding pixels; The training samples are input into the model, and the features are further extracted to obtain the prediction box P. The loss function of the model is optimized by back propagating the error between the prediction box and the true value box. The main network and the sub-network are trained simultaneously until the model converges.
3. The target detection method based on iterative design according to claim 1, characterized in that: The historical information feature extraction subnetwork adopts deformable convolution.
4. The target detection method based on iterative design according to claim 1, characterized in that: The historical information feature extraction subnetwork uses a balanced feature pyramid for feature fusion.
