A dense pedestrian detection method based on YOLO

CN117456452BActive Publication Date: 2026-09-18NANJING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311380891.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-24
Publication Date
2026-09-18
Estimated Expiration
2043-10-24

AI Technical Summary

Technical Problem

[0005]本发明针对上述现有技术存在的问题,提供一种基于YOLO的密集行人检测方法,该方法能够提高密集场景下行人的检测效果,提高MAP值的同时保持检测速度,以解决上述背景技术中提出的密集场景下行人检测效果较差的问题

Benefits of technology

[0061] 1) To address the issue of missed detection of small-target pedestrians in dense pedestrian detection scenarios, a small-target detection layer is added to the head network to enable the network to detect smaller targets and improve the network's ability to detect small-target pedestrians.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117456452B_ABST
    Figure CN117456452B_ABST
Patent Text Reader

Abstract

The present application belongs to the field of human target detection in computer vision, and discloses a dense pedestrian detection method based on YOLO. The method first acquires a CrowdHuman data set for dense pedestrian detection, then pre-processes the data set by using a Mosaic data enhancement method, then inputs the enhanced data set picture into a backbone network to extract feature maps of different sizes, then inputs the feature maps into a BiFPN weighted bidirectional feature pyramid network for feature fusion to obtain enhanced feature maps, and finally inputs the enhanced feature maps into a head network to obtain detection results. The present application makes full use of various information existing in the picture, can obtain more comprehensive feature representation, effectively improves the detection accuracy of the target person, and greatly avoids the problems of false detection and missed detection caused by dense pedestrians.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a method for detecting human targets based on fragmented video information, belonging to the interdisciplinary technical fields of computer vision, image processing, and target detection. Background Technology

[0002] Pedestrian detection is a crucial field in object detection, playing a key role in areas such as ADAS, intelligent driving systems, and intelligent robots. Although pedestrian detection technology has made continuous progress in recent years and achieved good detection results in some simple scenarios, problems such as pedestrian overlap and small size remain unresolved in real-life scenarios with dense crowds, such as subways, shopping malls, and streets.

[0003] Currently, the most representative deep learning algorithms in the field of object detection include R-CNN, Fast R-CNN, Faster R-CNN, and YOLO. R-CNN and its derivatives are two-stage convolutional neural networks. They first use region proposal techniques to find the possible locations of objects in an image, and then use feature information extracted from the feature layer to classify the objects. This detector has the advantage of high accuracy but cannot meet real-time requirements. On the other hand, YOLO is an end-to-end convolutional neural network based on a regression problem, which significantly improves its real-time performance, but its accuracy is lower than that of two-stage detectors like Faster R-CNN. These object detection models have good detection results in their respective areas of expertise, but in dense pedestrian detection, due to problems such as occlusion, the detection accuracy is generally low.

[0004] When pedestrians are densely packed, occlusion between people and significant size differences between detected objects can lead to missed and false detections. Furthermore, existing pedestrian detection technologies cannot simultaneously guarantee detection accuracy and recognition speed when faced with a large number of densely packed and overlapping targets. YOLOv5, the fifth-generation algorithm in the YOLO series of one-stage detection algorithms, maintains excellent detection speed while maintaining accuracy; however, its performance still needs improvement when dealing with a large number of densely packed targets of varying sizes. Summary of the Invention

[0005] To address the problems existing in the prior art, this invention provides a dense pedestrian detection method based on YOLO. This method can improve the detection effect of pedestrians in dense scenes, increase the MAP value while maintaining the detection speed, thereby solving the problem of poor pedestrian detection effect in dense scenes mentioned in the background art.

[0006] To achieve the above objectives, the present invention adopts the following technical solution:

[0007] A dense pedestrian detection method based on YOLO employs the YOLOv7 target detection model, which includes a backbone network CSPDarknet53, a neck network, and a head network; the method includes the following steps:

[0008] Step 1) Using the CrowdHuman dataset, preprocess it using the Mosaic data augmentation method, and divide the preprocessed dataset into training set and validation set;

[0009] Step 2) After the dataset is augmented, it is input into the YOLOv7 backbone network CSPDarknet53. The backbone network CSPDarknet53 is an eleven-layer network structure consisting of CBS convolutional network, ELAN gradient network, and MP downsampling convolutional network. The feature information of the fifth, seventh, ninth and eleventh layers of the backbone network CSPDarknet53 is extracted to obtain four different sizes of feature maps.

[0010] Step 3) The four different sizes of feature maps obtained in Step 2) are transmitted to the neck network of YOLOv7 to obtain the spatial and channel information of the feature maps; the neck network introduces the FCSA attention mechanism, which introduces the ECA channel attention mechanism to the CBAM spatial attention mechanism.

[0011] Step 4) Input the spatial and channel information of the feature map obtained in Step 3) into the BiFPN weighted bidirectional feature pyramid network, and perform feature fusion in two ways, top-down and bottom-up, to obtain four different sizes of enhanced feature maps.

[0012] Step 5): The YOLOv7 head network contains four object detection heads. The four different sizes of enhanced feature maps obtained in Step 4) are input into the four object detection heads respectively, and finally four different sizes of predicted feature maps are obtained.

[0013] Step 6): Based on step 5), the head network outputs the final preselection box through nonmaximum suppression to obtain the detection result of the target pedestrian.

[0014] Further improvements are made in the following steps: Step 1) includes the following steps:

[0015] Step 11): In the CrowdHuman dataset, four images are randomly selected each time, and they are cropped, stitched, and randomly arranged at random positions to form a new image and added to the CrowdHuman dataset.

[0016] Step 12): Repeat step 11) multiple times to obtain the enhanced dataset;

[0017] Step 13): Divide the enhanced dataset and corresponding image labels obtained in step 12) into training and validation sets in an 8:2 ratio.

[0018] Further improvements are made in step 2), which includes the following steps:

[0019] Step 21) Input the 640×640 image into the YOLOv7 backbone network CSPDarknet53;

[0020] Step 22): YOLOv7 uses the backbone network CSPDarknet53 to perform convolution, pooling, and normalization operations on the image input in step 21). First, the four-layer CBS module enhances the expressive ability of human features. Then, the enhanced image is sequentially input into three sets of ELAN and MP combination modules and one layer of ELAN gradient network to reduce information loss, increase the receptive field, and enable the network to learn more feature information.

[0021] Step 23) Extract the feature information of the fifth, seventh, ninth and eleventh layers of the backbone network CSPDarknet53 to obtain four feature maps of different sizes.

[0022] Further improvements are made in step 3), which includes the following steps:

[0023] Step 31): Input the four different sized feature maps extracted in step 2) into the neck network of YOLOv7;

[0024] Step 32): For the input feature map F1, after passing through the ECA channel attention mechanism, global average pooling is performed on the input channels to obtain a vector of size 1×1×C;

[0025] Step 33): Input the vector output from Step 32) into a 1×1 convolution of size k to output the channel attention feature map F2, realizing cross-channel interactive learning; the expression of F2 is as follows:

[0026] F2 = Conv(GAP(F1))

[0027] Where GAP represents global average pooling and Conv represents convolution operation;

[0028] Step 34): Multiply the channel attention feature map F2 with the input feature map F1 channel by channel to obtain the specific channel attention feature map F3;

[0029] Step 35): Input the feature map F3 of the specific channel attention into the spatial attention mechanism of CBAM, obtain the max pooling vector and average pooling vector through global max pooling and average pooling operations respectively, and concatenate the two.

[0030] Step 36): The concatenated result is dimensionality reduced by a 7×7 convolution kernel and then input into the Sigmoid function to obtain the spatial attention feature map F4;

[0031] Step 37): Multiply the spatial attention feature map F4 element by element with the specific channel attention feature map F3 to obtain the final feature map F5, which makes the model pay more attention to the features at different locations and improves performance.

[0032] k represents the size of the Conv convolution kernel, which depends on the number of channels and the structure of the neural network. The formula for calculating the relationship between the kernel size k and the number of channels C is as follows:

[0033]

[0034] Where r represents the depth of the convolutional kernel and b represents the offset of the convolutional network;

[0035] By modifying the formula, the formula for calculating the convolution kernel size k is obtained as follows:

[0036]

[0037] Further improvements include: introducing a BiFPN weighted bidirectional pyramid network to replace the PAFPN pyramid network in YOLOv7. BiFPN assigns a weight to each input feature and employs a fast normalization method during feature fusion. The BiFPN calculation formula is as follows:

[0038]

[0039] Where, ω i This represents the weight factor of the current i-th input feature, and the weight ω is guaranteed by the ReLU activation function. i ,ω j ≥0, ρ takes the value 0.0001, I i This represents the current i-th input feature, and n represents the total number of input features.

[0040] Step 4) includes the following steps:

[0041] Step 41): Input the spatial and channel information of the feature map obtained in Step 3) into BiFPN;

[0042] Step 42): BiFPN performs upsampling and downsampling operations on the feature maps of each size to make them have the same size;

[0043] Step 43): Fuse the feature maps obtained in step 42) to output four different sizes of enhanced feature maps.

[0044] Further improvements are made in step 5, which includes the following steps:

[0045] Step 51): Add a small target detection head to the original three target detection heads of YOLOv7. Its output size is 160×160, so that the model can detect pedestrians larger than 4×4 pixels and improve the model's ability to predict small target pedestrians.

[0046] Step 52): Input the four different sizes of enhanced feature maps obtained in Step 4) into the four target detection heads obtained in Step 51) for detection;

[0047] Step 53): The four object detection heads perform multi-size prediction on feature maps from different levels, with each detection head responsible for detecting objects of different sizes;

[0048] Step 54): Each object detection head outputs bounding box prediction information, including center horizontal and vertical coordinates, width, height offset, bounding box confidence, and class confidence, which are used to predict the location of the bounding box.

[0049] Further improvements are made in step 6, which includes the following steps:

[0050] Step 61): Filter out prediction boxes with confidence scores below the threshold from the four different sizes of prediction feature maps obtained in step 5).

[0051] Step 62): Introducing the Soft-NMS non-maximum suppression method can help the model retain more bounding boxes, thereby improving the accuracy of dense pedestrian detection;

[0052]

[0053] Where M represents the bounding box with the highest score, b i S represents the current bounding box. i σ represents the score of the current bounding box, D represents the set of target boxes, and σ is the penalty factor with a value of (0,1).

[0054] Soft-NMS receives the Intersection over Union (IOU) of two object detection bounding boxes through a Gaussian function and applies different levels of penalty. The confidence level of the object is modified based on the strength of the penalty. When the IOU is zero, no penalty is applied; when the IOU is high, a larger penalty is applied; and when the IOU is low, the penalty is gradually increased in ascending order of magnitude.

[0055] Step 63): Perform Soft-NMS post-processing on the bounding boxes obtained after the initial filtering in Step 61). Sort all the bounding boxes in descending order of their confidence scores and start traversing from the bounding box with the highest score.

[0056] Step 64): For the currently traversed bounding box, calculate the overlap with other already traversed bounding boxes, and reduce the confidence of the current bounding box based on the overlap and a specified reduction rate.

[0057] Step 65): Continue traversing the next bounding box, repeating step 64), until all bounding boxes have been traversed;

[0058] Step 66): Restore the position information of the bounding box obtained after Soft-NMS processing to the size of the original image to obtain the final detection result.

[0059] In summary, firstly, due to mutual occlusion among pedestrians in dense scenes, some pedestrians appear as small targets. A small target detection head is added to the YOLOv7 head network to improve the missed detection of small target pedestrians. Secondly, to enhance the feature fusion effect of the network and strengthen shallow features, a BiFPN weighted bidirectional feature pyramid structure is introduced to replace the original PAFPN structure. This integrates BiFPN with different feature layers, improving detection accuracy. Finally, to enhance the network's attention to important target features, a FCSA attention mechanism is proposed to improve the network's sensitivity to targets and reduce the impact of noise.

[0060] Compared with the prior art, the present invention, employing the above technical solution, has the following technical effects:

[0061] 1) To address the issue of missed detection of small-target pedestrians in dense pedestrian detection scenarios, a small-target detection layer is added to the head network to enable the network to detect smaller targets and improve the network's ability to detect small-target pedestrians.

[0062] 2) To address the severe occlusion phenomenon in dense scenes and fully acquire pedestrian feature information, an FCSA attention mechanism is proposed. This attention mechanism integrates the CBAM attention mechanism and the ECA channel attention mechanism, enabling the network to pay attention to more channel and spatial information of the occluded target, thereby improving the network's feature extraction and prediction capabilities.

[0063] 3) Introduce the BiFPN bidirectional weighted feature pyramid network structure, which strengthens shallow features by assigning weight parameters to each input feature and optimizes the feature fusion effect.

[0064] 4) The YOLOv7 target detection model has good detection speed and can meet real-time requirements. Attached Figure Description

[0065] Figure 1 This is the overall methodology flowchart.

[0066] Figure 2 It is a newly added small target detection layer.

[0067] Figure 3 This is a flowchart of the FCSA attention mechanism.

[0068] Figure 4 This is a structural diagram of the improved YOLOv7 object detection model. Detailed Implementation

[0069] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings:

[0070] like Figure 1 , Figure 2 , Figure 3 and Figure 4 As shown, a dense pedestrian detection method based on YOLOv7 is presented. This method employs the YOLOv7 target detection model, which includes a backbone network CSPDarknet53, a neck network, and a head network. The method comprises the following steps:

[0071] Step 1: Using the CrowdHuman dataset, preprocess it using the Mosaic data augmentation method, and divide the preprocessed dataset into training and validation sets; the specific steps are as follows;

[0072] Step 11): In the CrowdHuman dataset, four images are randomly selected each time, and they are cropped, stitched, and randomly arranged at random positions to form a new image and added to the CrowdHuman dataset.

[0073] Step 12): Repeat step 11) multiple times to obtain the enhanced dataset;

[0074] Step 13): Divide the enhanced dataset and corresponding image labels obtained in step 12) into training and validation sets in an 8:2 ratio.

[0075] Step 2: After augmentation, the dataset is input into the YOLOv7 backbone network CSPDarknet53. The backbone network CSPDarknet53 is an eleven-layer network structure consisting of CBS convolutional network, ELAN gradient network, and MP downsampling convolutional network. The feature information of the fifth, seventh, ninth, and eleventh layers of the backbone network CSPDarknet53 is extracted to obtain four different sizes of feature maps; the specific steps are as follows.

[0076] Step 21) Input the 640×640 image into the YOLOv7 backbone network CSPDarknet53;

[0077] Step 22): YOLOv7 uses the backbone network CSPDarknet53 to perform convolution, pooling, and normalization operations on the image input in step 21). First, the four-layer CBS module enhances the expressive ability of human features. Then, the enhanced image is sequentially input into three sets of ELAN and MP combination modules and one layer of ELAN gradient network to reduce information loss, increase the receptive field, and enable the network to learn more feature information.

[0078] Step 23) Extract the feature information of the fifth, seventh, ninth and eleventh layers of the backbone network CSPDarknet53 to obtain four feature maps of different sizes.

[0079] Step 3: The four different sizes of feature maps obtained in Step 2 are transmitted to the neck network of YOLOv7 to obtain the spatial and channel information of the feature maps; the neck network introduces the FCSA attention mechanism, which introduces the ECA channel attention mechanism to the CBAM spatial attention mechanism; the specific steps are as follows;

[0080] Step 31): Input the four different sizes of feature maps extracted in Step 2 into the neck network of YOLOv7;

[0081] Step 32): For the input feature map F1, after passing through the ECA channel attention mechanism, global average pooling is performed on the input channels to obtain a vector of size 1×1×C;

[0082] Step 33): Input the vector output from Step 32) into a 1×1 convolution of size k to output the channel attention feature map F2, realizing cross-channel interactive learning; the expression of F2 is as follows:

[0083] F2 = Conv(GAP(F1))

[0084] Where GAP represents global average pooling and Conv represents convolution operation;

[0085] k represents the size of the Conv convolution kernel, which depends on the number of channels and the structure of the neural network. The formula for calculating the relationship between the kernel size k and the number of channels C is as follows:

[0086]

[0087] Where r represents the depth of the convolutional kernel and b represents the offset of the convolutional network;

[0088] By modifying the formula, the formula for calculating the convolution kernel size k is obtained as follows:

[0089]

[0090] Step 34): Multiply the channel attention feature map F2 with the input feature map F1 channel by channel to obtain the specific channel attention feature map F3;

[0091] Step 35): Input the feature map F3 of the specific channel attention into the spatial attention mechanism of CBAM, obtain the max pooling vector and average pooling vector through global max pooling and average pooling operations respectively, and concatenate the two.

[0092] Step 36): The concatenated result is dimensionality reduced by a 7×7 convolution kernel and then input into the Sigmoid function to obtain the spatial attention feature map F4;

[0093] Step 37): Multiply the spatial attention feature map F4 element by element with the specific channel attention feature map F3 to obtain the final feature map F5, which makes the model pay more attention to the features at different locations and improves performance.

[0094] Step 4: Input the spatial and channel information of the feature maps obtained in Step 3 into the BiFPN weighted bidirectional feature pyramid network, and perform feature fusion in two ways, top-down and bottom-up, to obtain four different sizes of enhanced feature maps; the specific steps are as follows;

[0095] YOLOv7 introduces the BiFPN weighted bidirectional pyramid network. BiFPN assigns a weight to each input feature and employs a fast normalization method during feature fusion. The BiFPN calculation formula is as follows:

[0096]

[0097] Where, ω i This represents the weight factor of the current i-th input feature, and the weight ω is guaranteed by the ReLU activation function. i ,ω j ≥0, ρ takes the value 0.0001, I i This represents the current i-th input feature, and n represents the total number of input features.

[0098] Step 41): Input the spatial and channel information of the feature map obtained in Step 3 into BiFPN;

[0099] Step 42): BiFPN performs upsampling and downsampling operations on the feature maps of each size to make them have the same size;

[0100] Step 43): Fuse the feature maps obtained in step 42) to output four different sizes of enhanced feature maps.

[0101] Step 5: The YOLOv7 head network contains four object detection heads. The four different sizes of enhanced feature maps obtained in Step 4 are input into the four object detection heads respectively, and finally four different sizes of predicted feature maps are obtained.

[0102] The specific steps are as follows;

[0103] Step 51): Add a target detection head to the YOLOv7 head, with an output size of 160×160, so that the model can detect pedestrians larger than 4×4 pixels;

[0104] Step 52): Input the four different sizes of enhanced feature maps obtained in step 4) into the four target detection heads for detection;

[0105] Step 53): The four object detection heads perform multi-size prediction on feature maps from different levels, with each detection head responsible for detecting objects of different sizes;

[0106] Step 54) Each object detection head outputs bounding box prediction information, including center horizontal and vertical coordinates, width, height offset, bounding box confidence, and class confidence, which are used to predict the location of the bounding box.

[0107] Step 6: Based on step 5, the head network outputs the final preselected box through nonmaximum suppression to obtain the detection result of the target pedestrian; the specific steps are as follows:

[0108] Step 61): Filter out the predicted bounding boxes with confidence scores below the threshold from the four different sizes of predicted feature maps obtained in Step 5.

[0109] Step 62): Introduce the Soft-NMS non-maximum suppression method to allow the model to retain more bounding boxes, thereby improving the accuracy of dense pedestrian detection;

[0110]

[0111] Where M represents the prediction box with the highest score, b i S represents the current prediction box. i σ represents the score of the current predicted bounding box, D represents the set of target boxes; σ is the penalty factor, with a value of (0,1);

[0112] Soft-NMS receives the Intersection over Union (IOU) of two object detection candidate boxes using a Gaussian function and applies different levels of penalty. The confidence level of the target object is then modified based on the magnitude of the penalty. When the IOU is zero, no penalty is applied; when the IOU is high, a larger penalty is applied; and when the IOU is low, the penalty is gradually increased in ascending order of IOU value.

[0113] Step 63): Perform Soft-NMS post-processing on the bounding boxes obtained after the initial filtering in Step 61). Sort all the bounding boxes in descending order of their confidence scores and start traversing from the bounding box with the highest score.

[0114] Step 64): For the currently traversed bounding box, calculate the overlap with other already traversed bounding boxes, and reduce the confidence of the current bounding box based on the overlap and a specified reduction rate.

[0115] Step 65): Continue traversing the next bounding box, repeating step 64), until all bounding boxes have been traversed;

[0116] Step 66): Restore the position information of the bounding box obtained after Soft-NMS processing to the size of the original image to obtain the final detection result.

[0117] The above description of the disclosed embodiments enables those skilled in the art to use the present invention. Furthermore, the above embodiments are merely illustrative of the technical concept of the present invention and should not be construed as limiting the scope of protection of the present invention. Any modifications made to the technical solutions based on the technical concept proposed in this invention fall within the scope of protection of this invention.

Claims

1. A dense pedestrian detection method based on YOLO, characterized in that, The target detection model using YOLOv7 includes a backbone network CSPDarknet53, a neck network, and a head network; the method includes the following steps: Step 1) Using the CrowdHuman dataset, preprocess it using the Mosaic data augmentation method, and divide the preprocessed dataset into training set and validation set; Step 2) After the dataset is augmented, it is input into the YOLOv7 backbone network CSPDarknet53. The backbone network CSPDarknet53 is an eleven-layer network structure consisting of CBS convolutional network, ELAN gradient network, and MP downsampling convolutional network. The feature information of the fifth, seventh, ninth and eleventh layers of the backbone network CSPDarknet53 is extracted to obtain four different sizes of feature maps. Step 3) The four different sized feature maps obtained in Step 2) are transmitted to the neck network of YOLOv7 to obtain the spatial and channel information of the feature maps. The neck network introduces the FCSA attention mechanism, which introduces the ECA channel attention mechanism to the CBAM spatial attention mechanism, including the following steps: Step 31): Input the four different sized feature maps extracted in Step 2) into the neck network of YOLOv7; Step 32): For the input feature map F1, after passing through the ECA channel attention mechanism, global average pooling is performed on the input channels to obtain a vector of size 1×1×C; Step 33): Input the vector output from Step 32) into a 1×1 convolution of size k to output the channel attention feature map F2, realizing cross-channel interactive learning; the expression of F2 is as follows: ; Where GAP represents global average pooling and Conv represents convolution operation; Step 34): Multiply the channel attention feature map F2 with the input feature map F1 channel by channel to obtain the specific channel attention feature map F3; Step 35): Input the feature map F3 of the specific channel attention into the spatial attention mechanism of CBAM, obtain the max pooling vector and average pooling vector through global max pooling and average pooling operations respectively, and concatenate the two. Step 36): The concatenated result is dimensionality reduced by a 7×7 convolution kernel and then input into the Sigmoid function to obtain the spatial attention feature map F4; Step 37): Multiply the spatial attention feature map F4 element-wise with the channel-specific attention feature map F3 to obtain the final feature map F5. This makes the model pay more attention to features at different locations, improving performance. Step 4) Input the spatial and channel information of the feature map obtained in Step 3) into the BiFPN weighted bidirectional feature pyramid network, and perform feature fusion in two ways, top-down and bottom-up, to obtain four different sizes of enhanced feature maps. Step 5): The YOLOv7 head network contains four object detection heads. The four different sizes of enhanced feature maps obtained in Step 4) are input into the four object detection heads respectively, and finally four different sizes of predicted feature maps are obtained. Step 6), based on step 5), the head network outputs the final preselection box through nonmaximum suppression to obtain the detection result of the target pedestrian.

2. The dense pedestrian detection method based on YOLO according to claim 1, characterized in that, Step 1) includes the following steps: Step 11): In the CrowdHuman dataset, four images are randomly selected each time, and they are cropped, stitched, and randomly arranged at random positions to form a new image and added to the CrowdHuman dataset. Step 12): After repeating step 11) multiple times, the enhanced dataset is obtained; Step 13): Divide the enhanced dataset and corresponding image labels obtained in Step 12) into training and validation sets in an 8:2 ratio.

3. The dense pedestrian detection method based on YOLO according to claim 1, characterized in that, Step 2) includes the following steps: Step 21) Input a 640×640 image into the YOLOv7 backbone network CSPDarknet53; Step 22): YOLOv7 uses the backbone network CSPDarknet53 to perform convolution, pooling, and normalization operations on the input image in Step 21. First, the four-layer CBS module enhances the expressive ability of human features. Then, the enhanced image is sequentially input into three sets of ELAN and MP combination modules and one layer of ELAN gradient network to reduce information loss, increase the receptive field, and enable the network to learn more feature information. Step 23) Extract the feature information of the fifth, seventh, ninth and eleventh layers of the backbone network CSPDarknet53 to obtain four feature maps of different sizes.

4. The dense pedestrian detection method based on YOLO according to claim 1, characterized in that, k represents the size of the Conv convolution kernel, which depends on the number of channels and the structure of the neural network. The formula for calculating the relationship between the kernel size k and the number of channels C is as follows: ; Where r represents the depth of the convolutional kernel and b represents the offset of the convolutional network; By modifying the formula, the formula for calculating the convolution kernel size k is obtained as follows: 。 5. The dense pedestrian detection method based on YOLO according to claim 1, characterized in that, YOLOv7 introduces the BiFPN weighted bidirectional pyramid network. BiFPN assigns a weight to each input feature and employs a fast normalization method during feature fusion. The BiFPN calculation formula is as follows: ; in, Indicates the current number The weight factors of each input feature are guaranteed by the ReLU activation function. , The value is 0.0001. Indicates the current number Each input feature This represents the total number of all input features.

6. The dense pedestrian detection method based on YOLO according to claim 1, characterized in that, Step 4) includes the following steps: Step 41): Input the spatial and channel information of the feature map obtained in Step 3) into BiFPN; Step 42): BiFPN performs upsampling and downsampling operations on feature maps of each size to make them have the same size; Step 43): Fuse the feature maps obtained in Step 42) to output four different sizes of enhanced feature maps.

7. The dense pedestrian detection method based on YOLO according to claim 1, characterized in that, Step 5) includes the following steps: Step 51): Add a target detection head to the YOLOv7 head, with an output size of 160×160, so that the model can detect pedestrians larger than 4×4 pixels; Step 52): Input the four different sizes of enhanced feature maps obtained in Step 4) into the four target detection heads for detection; Step 53): The four object detection heads perform multi-size prediction on feature maps from different levels, with each detection head responsible for detecting objects of different sizes; Step 54) Each object detection head outputs bounding box prediction information, including center horizontal and vertical coordinates, width, height offset, bounding box confidence, and class confidence, which are used to predict the location of the bounding box.

8. The dense pedestrian detection method based on YOLO according to claim 1, characterized in that, Step 6) includes the following steps: Step 61): Filter out prediction boxes with confidence scores below the threshold from the four different sizes of prediction feature maps obtained in Step 5); Step 62): Introduce the Soft-NMS non-maximum suppression method to allow the model to retain more bounding boxes, thereby improving the accuracy of dense pedestrian detection; ; in The box representing the highest-scoring prediction box. S represents the current prediction box. i This represents the score of the current predicted bounding box, and D represents the set of target bounding boxes; The penalty factor has a value of ; Step 63): Perform Soft-NMS post-processing on the bounding boxes obtained after the initial filtering in Step 61), sort all the bounding boxes in descending order of their confidence scores, and start traversing from the bounding box with the highest score; Step 64): Calculate the overlap between the currently traversed bounding box and other already traversed bounding boxes, and reduce the confidence of the current bounding box based on the overlap and a specified reduction rate. Step 65): Continue traversing the next bounding box, repeating step 64), until all bounding boxes have been traversed; Step 66): Restore the position information of the bounding box obtained after Soft-NMS processing to the size of the original image to obtain the final detection result.