Multi-level feature fusion pedestrian detection method based on CSP model
By using the multi-level feature fusion method of the CSP model in pedestrian detection, combined with the PyconvResNet-101 network and Focal Loss/Smooth L1 loss function, the problem of missed detection and false detection under small targets and severe occlusions is solved, and the detection accuracy is significantly improved. .
Patent Information
- Application Number
- CN202110295911.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-19
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2041-03-19
AI Technical Summary
Existing pedestrian detection technology is prone to missed detections and false detections when small targets and severe occlusions occur, and it is difficult to effectively extract feature information.
A multi-level feature fusion method based on the CSP model is used to extract feature maps through the PyconvResNet-101 network and perform multi-level fusion. It combines Focal Loss and Smooth L1 loss functions to fuse high-level semantic information and low-level location information to reduce false detections and missed detections.
It effectively reduces false detections and missed detections in the case of small targets and severe occlusion, improves the accuracy of pedestrian detection, and shows good detection performance.
Smart Images

Figure CN113033371B
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of computer vision and target detection, and in particular to a video-oriented pedestrian detection method. Background Art
[0002] Computer vision has always been a hot topic and a difficult topic in computer science research, and pedestrian detection, as a subtask of target detection, has become a very important research issue in the field of computer vision. In recent years, convolutional neural networks (CNNs) have demonstrated powerful capabilities in the fields of computer vision and target detection. The introduction of many general target detection methods based on CNN has promoted the research and application progress in the direction of pedestrian detection. However, there is still a lot of room for improvement in pedestrian detection technology. The main problem is that the feature information of small targets and severely occluded targets is difficult to extract, resulting in missed detections and false detections. CSP (Center and Scale Prediction) is a pedestrian detection algorithm proposed in 2019. It learns pedestrian features through CNN and predicts the center point coordinates and size information of pedestrian targets to complete the pedestrian detection task. Summary of the invention
[0003] To address the problems of missed detection and false detection in pedestrian detection due to small targets and severe occlusion, the present invention proposes a multi-level feature fusion pedestrian detection method based on the CSP model. This method can fully integrate the rich semantic information of high-level feature maps and the rich position information of low-level feature maps, effectively reducing false detection and missed detection in the case of small targets and severe occlusion.
[0004] A multi-level feature fusion pedestrian detection method based on CSP model, comprising:
[0005] Step 1: adopt CSP architecture and use CNN to extract pedestrian features. Then the network is divided into three branches to predict the target center point, target height and center point offset respectively. In the training stage, the training image is preprocessed and input into the network. The preprocessing includes adjusting the image size to the set pixel, randomly cropping the image and adjusting the brightness. PyconvResNet-101 is used as the feature extraction network to extract pedestrian features. The four feature maps obtained in the second, third, fourth and fifth stages of the PyconvResNet-101 network are multi-level fused to obtain the final feature map. The number of channels of the final feature map is 1024. Random erasure data enhancement is used to expand the training data. Focal Loss and Smooth L1 are used to train the target center point, target height and center point offset.
[0006] Step 2: Send the final feature map obtained to the subsequent prediction network. The prediction network first uses a 3*3 convolution to adjust the number of channels of the final feature map to 2. n, n is a positive integer, 3≤n≤9, and then two 1*1 convolutions and one 2*2 convolution are used to predict the target center point, target height and center point offset respectively and generate the target detection frame. The non-maximum suppression algorithm is used to remove redundant detection frames to obtain the final detection result;
[0007] Step 3: During the test phase, the test image is resized to a specific size and then input into the network. The obtained feature map is fused at multiple levels and then sent to the prediction network. The prediction network outputs the center point of the target, the height of the target, and the offset of the center point of the target. The target width is obtained by multiplying the target height by a coefficient.
[0008] Further, the process of step 1 is: use the last feature maps p2, p3, p4 and p5 of stage 2, stage 3, stage 4 and stage 5 in the PyconvResNet-101 network for multi-level fusion, where p2, p3, p4 and p5 are obtained by downsampling the width and height of the input image by 4 times, 8 times, 16 times and 32 times respectively, and the steps of multi-level fusion are:
[0009] 1.1) Use a deconvolution with a convolution kernel size of 4*4, a step size of 2, and a margin of 1 to upsample p5 by 2 and concatenate it with p4 in the channel direction to obtain p 4_l1 ; Use deconvolution with a convolution kernel size of 4*4, a step size of 2, and a blank space of 1 to upsample p4 by 2 times and then concatenate it with p3 in the channel direction to obtain p 3_l1 ; Use deconvolution with a convolution kernel size of 4*4, a step size of 2, and a blank space of 1 to upsample p3 by 2 and then concatenate it with p2 in the channel direction to obtain p 2_l1 ;
[0010] 1.2) Use the deconvolution with a convolution kernel size of 4*4, a step size of 2, and a blank space of 1 to deconvolve the feature map p obtained in 1.1) 4_l1 After upsampling by 2 times, the feature map p obtained in 1.1) 3_l1 Splicing in the channel direction to get p 3_l2 ; Use a deconvolution with a convolution kernel size of 4*4, a step size of 2, and a blank space of 1 to deconvolve p 3_l1 After upsampling by 2 times, the feature map p obtained in (1) 2_l1 Splicing in the channel direction to get p 2_l2 ;
[0011] 1.3), use the deconvolution with a convolution kernel size of 4*4, a step size of 2, and a blank space of 1 to deconvolve the feature map p obtained in 1.2) 3_l2 After upsampling by 2 times, the feature map p obtained in 1.2) 2_l2 The final feature map p is obtained by splicing in the channel direction out Send to the subsequent prediction network.
[0012] Preferably, in step 3, the coefficient is 0.41.
[0013] The beneficial effects of the present invention are as follows: the present invention adopts the CSP model architecture, adopts PyconvResNet-101 as the feature extraction network, and performs multi-level fusion on the four feature maps output by the feature extraction network, which can fully integrate the rich semantic information of the high-level feature maps and the rich position information of the low-level feature maps, and can effectively reduce false detection and missed detection in small targets and severe occlusion situations. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 This is a flow chart of a multi-level feature fusion pedestrian detection method based on the CSP model of the present invention.
[0015] Figure 2 This is the CSP model architecture diagram.
[0016] Figure 3 Schematic diagram of pyramid convolution.
[0017] Figure 4 This is the structural diagram of the multi-level feature fusion pedestrian detection method based on the CSP model.
[0018] Figure 5 The figure shows the comparison of the multi-level feature fusion pedestrian detection method based on the CSP model and other pedestrian detection technologies on the Caltech dataset, where (a) represents the Reasonable subset, (b) represents the Heavy subset, (c) represents the Medium subset; (d) represents the Near subset; and (e) represents the All subset. DETAILED DESCRIPTION
[0019] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0020] Reference Figure 1 to Figure 5 , a multi-level feature fusion pedestrian detection method based on CSP model, comprising the following steps:
[0021] Step 1, refer to Figure 2, using CSP architecture, using CNN to extract pedestrian features, and then the network is divided into three branches to predict the target center point, target height and center point offset respectively. In the training stage, the training image is preprocessed and input into the network. The preprocessing includes adjusting the image size to the set pixel, randomly cropping the image and adjusting the brightness. PyconvResNet-101 is used as the feature extraction network to extract pedestrian features. The four feature maps obtained by the PyconvResNet-101 network stage 2, stage 3, stage 4 and stage 5 are multi-level fused to obtain the final feature map. The number of channels of the final feature map is 1024. Random erasure data enhancement is used to expand the training data. Focal Loss and Smooth L1 are used to train the target center point, target height and center point offset.
[0022] Each convolution kernel of PyconvResNet-101 contains a multi-layer pyramid structure, and each layer contains different types of convolution kernels. Figure 3 Pyramid convolution can process input images using convolution kernels of various scales without increasing the amount of computation and model complexity. Convolution kernels at different levels of the pyramid have different sizes and numbers of channels. From the bottom to the top, the size of the convolution kernel gradually increases. At the same time, the number of channels of the convolution kernel gradually decreases. In order to adapt to the number of channels of convolution kernels at different levels of the pyramid, the input feature maps are grouped and convolved.
[0023] The specific steps of random erasing are as follows: for an image I in a batch, the probability of random erasing is set to 0.5. For an image with a width of W and a height of H, the image area S = W × H. The randomly initialized erasing area is S e .set up Set the aspect ratio of the erase area to r e ∈[0.3,3.3]. The height of the erased area is Width Then, a point A=(x e ,y e ), if x e +W e ≤W and y e +H e ≤H, then set region I e =(x e ,y e ,x e +W e ,y e +H e ) as the random erase area, otherwise repeat the above steps until an I that meets the conditions is e Appear.e Each pixel in the region is assigned a random value in the range [0,255].
[0024] Reference Figure 4 , use the last feature maps p2, p3, p4 and p5 of the second, third, fourth and fifth stages of the PyconvResNet-101 network for multi-level fusion, where p2, p3, p4 and p5 are obtained by downsampling the width and height of the input image by 4 times, 8 times, 16 times and 32 times respectively. The fusion method specifically includes the following steps:
[0025] 1.1) Use a deconvolution with a convolution kernel size of 4*4, a step size of 2, and a margin of 1 to upsample p5 by 2 and concatenate it with p4 in the channel direction to obtain p 4_l1 ; Use deconvolution with a convolution kernel size of 4*4, a step size of 2, and a blank space of 1 to upsample p4 by 2 times and then concatenate it with p3 in the channel direction to obtain p 3_l1 ; Use deconvolution with a convolution kernel size of 4*4, a step size of 2, and a blank space of 1 to upsample p3 by 2 and then concatenate it with p2 in the channel direction to obtain p 2_l1 .
[0026] 1.2) Use the deconvolution with a convolution kernel size of 4*4, a step size of 2, and a blank space of 1 to deconvolve the feature map p obtained in step 1 4_l1 After upsampling by 2 times, the feature map p obtained in step 1.1 is 3_l1 Splicing in the channel direction to get p 3_l2 ; Use a deconvolution with a convolution kernel size of 4*4, a step size of 2, and a blank space of 1 to deconvolve p 3_l1 After upsampling by 2 times, the feature map p obtained in step 1.1 is 2_l1 Splicing in the channel direction to get p 2_l2 .
[0027] 1.3) Use the deconvolution with a convolution kernel size of 4*4, a step size of 2, and a blank space of 1 to deconvolve the feature map p obtained in step 1.2 3_l2 After upsampling by 2 times, the feature map p obtained in step 1.2 is 2_l2 The final feature map p is obtained by splicing in the channel direction out Send to the subsequent prediction network.
[0028] Use Focal Loss and Smooth L1 as loss functions: Predicting the target center point is a binary classification problem, that is, judging whether there is a target center point at each position of the feature map. If it is a center point, it is a positive sample, otherwise it is a negative sample. Since the negative samples around the positive samples are very close to the center point, it is easy to cause trouble for training, so a two-dimensional Gaussian mask is added to the positive sample points during training:
[0029]
[0030]
[0031] Where K is the number of objects in the image, is the center point, width and height information of the Kth target. The variance of the Gaussian mask Proportional to the height and width of a single target, respectively. If there is overlap between the Gaussian masks of two targets, the maximum value of the two is selected.
[0032] Focal Loss is used to predict the target center point:
[0033]
[0034]
[0035]
[0036] p ij ∈[0,1] indicates the possibility that the network judges that there is an object center at position (i,j), y ij ∈{0,1} represents the ground truth label, where y ij = 1 indicates a positive sample, β and γ are hyperparameters, which are set to 4 and 2 respectively.
[0037] Predicting the target height and center point offset is a regression problem, using Smooth L1:
[0038]
[0039]
[0040] where s k and t k Respectively represent the predicted value and true value of the network for each positive sample.
[0041] The total loss function is the weighted sum of the three branch loss functions:
[0042] L=λ c L center +λ s L scale +λ o L offset
[0043] where λ c ,λ s ,λ o are the weight coefficients for target center point classification loss, scale regression loss, and offset regression loss, which are set to 0.01, 1, and 0.1, respectively.
[0044] Step 2: Send the final feature map obtained to the subsequent prediction network. The prediction network first uses a convolution layer with a convolution kernel of 3*3, a step size of 1, and a blank space of 1 to adjust the channel of the input feature map to 2. n , n is a positive integer, 3≤n≤9, in this embodiment, n is 8, and then the target center point, the height of the target and the offset of the target center point are predicted respectively using 1*1, 1*1 and 2*2 convolution kernels.
[0045] During the test phase, the test image is resized to a specific size and then input into the network. The obtained feature map is fused at multiple levels and then sent to the prediction network. The prediction network outputs the center point of the target, the height of the target, and the offset of the center point of the target. The width of the target is obtained by multiplying the target height by a coefficient of 0.41. The pedestrian prediction box is obtained by parsing, and finally the non-maximum suppression algorithm is used to remove redundant prediction boxes to obtain the final pedestrian detection box.
[0046] The proposed multi-level feature fusion pedestrian detection method based on the CSP model was trained on the Citypersons training set and the Caltech training set, and tested on the Citypersons validation set and the Caltech test set. The evaluation index is the average logarithmic missed detection rate. As shown in Tables 1, 2 and Figure 5 As shown, the method of the present invention improves 0.8%, 3.1%, 1.0%, 0.1%, 1.8% and 1.0% in Reasonable subset, Heavy subset, Partial subset, Bare subset, Small subset and Large subset of the Citypersons validation set respectively. It improves 0.4%, 10.5% and 4.8% in Reasonable subset, Heavy subset and All subset of the Caltech test set respectively. At the same time, it also shows good results in comparison with existing pedestrian detection technology. Experimental results show that the present invention effectively improves the detection performance of the CSP algorithm for small targets and severely occluded targets.
[0047] Table 1 shows the average logarithmic missed detection rate of each subset on the Citypersons validation set
[0048]
[0049] Table 1
[0050] Table 2 shows the average logarithmic missed detection rate of each subset on the Caltech test set.
[0051]
[0052] Table 2.
Claims
1. A multi-level feature fusion pedestrian detection method based on CSP model, characterized in that: The method comprises the following steps: Step 1: adopt CSP architecture and use CNN to extract pedestrian features. Then the network is divided into three branches to predict the target center point, target height and center point offset respectively. In the training stage, the training image is preprocessed and input into the network. The preprocessing includes adjusting the image size to the set pixel, randomly cropping the image and adjusting the brightness. PyconvResNet-101 is used as the feature extraction network to extract pedestrian features. The four feature maps obtained in the second, third, fourth and fifth stages of the PyconvResNet-101 network are multi-level fused to obtain the final feature map. The number of channels of the final feature map is 1024. Random erasure data enhancement is used to expand the training data. FocalLoss and Smooth L1 are used to train the target center point, target height and center point offset. Step 2: Send the final feature map obtained to the subsequent prediction network. The prediction network first uses a 3*3 convolution to adjust the number of channels of the final feature map to 2. n , n is a positive integer, 3≤n≤9, and then two 1*1 convolutions and one 2*2 convolution are used to predict the target center point, target height and center point offset respectively and generate the target detection frame. The non-maximum suppression algorithm is used to remove redundant detection frames to obtain the final detection result; Step 3: During the test phase, the test image is resized to a specific size and then input into the network. The obtained feature map is fused at multiple levels and then sent to the prediction network. The prediction network outputs the center point of the target, the height of the target, and the offset of the center point of the target. The width of the target is obtained by multiplying the height of the target by a coefficient. The process of step 1 is: use the last feature maps p2, p3, p4 and p5 of stage 2, stage 3, stage 4 and stage 5 in the PyconvResNet-101 network for multi-level fusion, where p2, p3, p4 and p5 are obtained by downsampling the width and height of the input image by 4 times, 8 times, 16 times and 32 times respectively, and the steps of multi-level fusion are: 1.1) Use a deconvolution with a convolution kernel size of 4*4, a step size of 2, and a margin of 1 to upsample p5 by 2 and concatenate it with p4 in the channel direction to obtain p 4_l1 ; Use deconvolution with a convolution kernel size of 4*4, a step size of 2, and a blank space of 1 to upsample p4 by 2 times and then concatenate it with p3 in the channel direction to obtain p 3_l1 ; Use deconvolution with a convolution kernel size of 4*4, a step size of 2, and a blank space of 1 to upsample p3 by 2 and then concatenate it with p2 in the channel direction to obtain p 2_l1 ; 1.2) Use the deconvolution with a convolution kernel size of 4*4, a step size of 2, and a blank space of 1 to deconvolve the feature map p obtained in 1.1) 4_l1 After upsampling by 2 times, the feature map p obtained in 1.1) 3_l1 Splicing in the channel direction to get p 3_l2 ; Use a deconvolution with a convolution kernel size of 4*4, a step size of 2, and a blank space of 1 to deconvolve p 3_l1 After upsampling by 2 times, the feature map p obtained in (1) 2_l1 Splicing in the channel direction to get p 2_l2 ; 1.3), use the deconvolution with a convolution kernel size of 4*4, a step size of 2, and a blank space of 1 to deconvolve the feature map p obtained in 1.2) 3_l2 After upsampling by 2 times, the feature map p obtained in 1.2) 2_l2 The final feature map p is obtained by splicing in the channel direction out Send to the subsequent prediction network.
2. The multi-level feature fusion pedestrian detection method based on the CSP model as claimed in claim 1, characterized in that: In step 3, the coefficient is 0.41.
Citation Information
Patent Citations
Lightweight improved target detection method and detection system
CN111914937A
Pedestrian detection method based on depth separable convolution and standard convolution
CN112364804A
Pedestrian detection method based on semantic enhancement multi-scale feature pyramid fusion
CN112446308A
