Lightweight dense pedestrian detection method and system based on YOLOv8

By introducing lightweight backbone network, spatial information perception module and multi-channel compression decoupling head in YOLOv8, the balance of speed and accuracy in dense pedestrian detection is solved, and more efficient intensive pedestrian detection is achieved, especially in Crowedhuman and Wider The detection accuracy on the person dataset is improved.

CN119229374AInactive Publication Date: 2024-12-31CHONGQING SHUIQI DIGITAL TECH CO LTD

Patent Information

Application Number
CN202411339625.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-25
Publication Date
2024-12-31
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The prior art is difficult to achieve the balance between detection speed and detection accuracy in dense pedestrian images, and the channel cutting method is easy to cut off important channel information, resulting in insufficient detection accuracy.

Method used

Adopting a lightweight object detection model based on YOLOv8, including a lightweight backbone network, a lightweight spatial information perception module and a lightweight multi-channel compression decoupling head, through cascading convolution modules, deep separation convolution modules and fast The spatial pyramid pooling module extracts image features and uses lightweight spatial information perception module and multi-channel compression decoupling head to perform feature fusion and classification.

Benefits of technology

The parameters and calculations of the detection model are significantly reduced, while the accuracy of intensive pedestrian detection is improved, especially the detection accuracy on the Crowedhuman and Wider person data sets is increased by 1.8% and 1.6%, respectively, achieving small-objective detection. Good performance and fast inference time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119229374A_ABST
    Figure CN119229374A_ABST
Patent Text Reader

Abstract

The invention belongs to the field of computer vision, and particularly relates to a YOLOv8-based lightweight dense pedestrian detection method and system, and the method comprises the steps: carrying out the pedestrian detection of a dense pedestrian image shot from a high altitude through employing a YOLOv8-based lightweight target detection model, the lightweight target detection model based on YOLOv8 comprises a lightweight backbone network, a lightweight spatial information sensing module and a lightweight multichannel compression decoupling head. According to the method, the parameter quantity and the calculation quantity of the detection model are reduced, and the detection accuracy rates of the detection model in a Crown human data set and a Widder Person data set are respectively improved by 1.8% and 1.6%.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer vision, and relates to the fields of image recognition and dense pedestrian object detection, and in particular to a lightweight dense pedestrian detection method and system based on YOLOv8. Background Art

[0002] Currently, object detection using pedestrians is being applied in many fields such as industry, security, and transportation. The technology of detecting people using target detection algorithms can be used for rapid rescue, traffic violation detection, security activities, etc. on a large scale. However, dense pedestrian images are different from black box images or general images because dense pedestrian images are viewed from high altitudes and at various angles, so the proportion of small objects is quite high. In particular, the size of people is smaller than other objects. Although small objects can be detected by high-precision object detection models, the weight of edge hardware must be reduced under hardware limitations.

[0003] The patent application with publication number CN115810157A provides a dense pedestrian target detection method based on lightweight feature fusion. Although this method can maintain the lightweight of the target detection network while improving the detection accuracy of the network, this method cannot effectively reduce the number of model parameters and the amount of calculation. In actual dense pedestrian applications, it cannot achieve a good balance between device detection speed and detection accuracy, so this method cannot meet the accuracy requirements of dense pedestrian real-time target detection.

[0004] The patent application with publication number CN112580512A provides a lightweight dense pedestrian target detection method based on channel clipping. This method removes redundant channels in the network through channel clipping, significantly reducing the number of parameters and the amount of calculation of the original model. Although this method can make the model have fewer parameters and less calculation. However, since channel clipping easily clips out important channel information, the detection accuracy of the model cannot meet the requirements of dense pedestrian real-time target detection. Summary of the invention

[0005] In order to achieve lightweight and efficient small target detection, the present invention proposes a lightweight dense pedestrian detection method based on YOLOv8. A lightweight target detection model based on YOLOv8 is used to detect pedestrians in dense pedestrian images taken from high altitudes. The lightweight target detection model based on YOLOv8 includes a lightweight backbone network, a lightweight spatial information perception module, and a lightweight multi-channel compression decoupling head, wherein:

[0006] A lightweight backbone network for extracting image features from dense input pedestrian images;

[0007] The lightweight spatial information perception module is used to extract spatial information from the feature map output by the lightweight backbone network and fuse it into the neck network;

[0008] A lightweight multi-channel compressed decoupling head for classification based on the output of the neck network.

[0009] Furthermore, the lightweight backbone network consists of a cascaded convolution module, 8 depth-wise separable convolution modules and a fast spatial pyramid pooling module. Each depth-wise separable convolution module is composed of a cascade of a depth-wise separable convolution unit, a batch normalization layer and a SiLU activation function layer. The feature maps output by the fourth and sixth depth-wise separable convolution modules and the fast spatial pyramid pooling module in the cascade structure are respectively used as the input of the neck network.

[0010] Furthermore, the depthwise separable convolution unit is composed of a cascaded depthwise convolutional layer, a pointwise convolutional layer, a squeeze-excitation layer, and a channel position attention layer, and the outputs of the depthwise convolutional layer and the pointwise convolutional layer are processed with the HSwish activation function and used as the input of the next layer.

[0011] Furthermore, the convolution module consists of cascaded convolutional layers, batch normalization layers, and activation function layers.

[0012] Furthermore, during training, the lightweight spatial information perception module processes the input feature map through a 1×1 deep convolution layer, a batch normalization layer, and a ReLU activation function layer, and then inputs it into four branches for processing. The first branch is processed by a 1×1 deep convolution layer, the second branch is processed by a cascade of 3×1 deep convolution layers and 1×3 deep convolution layers, the third branch is processed by a cascade of n 3×3 deep convolution layers, and the fourth branch is processed by a cascade of 1×3 deep convolution layers and 3×1 deep convolution layers. The outputs of the four branches are processed by a batch normalization layer and then spliced ​​together, and then processed by a ReLU activation function layer, a 1×1 The deep convolution layer and batch normalization layer process the spliced ​​feature maps in turn, and then splice the obtained feature maps with the feature maps of the four input branches as the output of the lightweight spatial information perception module; in the inference stage, structural reparameterization is performed, and the input feature map is processed by the cascaded 1×1 deep convolution layer, batch normalization layer, and ReLU activation function layer, and then input into the 3×3 deep convolution layer for processing, and the feature map of the input 3×3 deep convolution layer is spliced ​​with the feature map output by the 3×3 deep convolution layer, and then processed by the ReLU activation function layer, 1×1 deep convolution layer, and batch normalization layer in turn to obtain the output of the lightweight spatial information perception module. Preferably, n is set to 3.

[0013] Furthermore, the lightweight multi-channel compression decoupling head includes three branches. The first branch is composed of two cascaded 1×1 convolutional layers, which performs classification prediction of feature images; the second branch is composed of three cascaded 3×3 convolutional layers and a 1×1 convolutional layer, which is used to obtain the intersection-over-union ratio during training; the third branch is composed of two cascaded 1×1 convolutional layers, which is used for regression prediction of bounding boxes.

[0014] Furthermore, the loss function used in the training process of the YOLOv8-based lightweight target detection model is expressed as:

[0015] Loss = Loss_cls + Loss_box

[0016] Among them, Loss represents the loss function of the lightweight target detection model based on YOLOv8; Loss_cls represents the classification loss of the lightweight target detection model based on YOLOv8; Loss_box represents the border regression loss of the lightweight target detection model based on YOLOv8.

[0017] The present invention also proposes a lightweight and dense pedestrian detection system based on YOLOv8, which includes a data acquisition device and a data processing device. The data acquisition device takes images of dense pedestrians from a high altitude and transmits the taken images to the data processing device to detect whether there are pedestrians. The data processing device is a lightweight target detection model based on YOLOv8 deployed on a terminal. The lightweight target detection model based on YOLOv8 implements a lightweight and dense pedestrian detection method based on YOLOv8.

[0018] Compared with the prior art, the present invention has the following beneficial effects:

[0019] The present invention not only reduces the number of parameters and the amount of calculation of the detection model, but also improves the detection accuracy of the detection model of the present invention by 1.8% and 1.6% in the Crowedhuman dataset and the Wide person dataset, respectively. The present invention has good detection performance and fast reasoning time for small target detection, and can be applied to a variety of fields such as large-scale rescue activities, traffic violator detection, and safety activities using target detection technology by drones in limited environments. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 It is a structural schematic diagram of a lightweight target detection model based on YOLOv8 in a lightweight dense pedestrian detection method based on YOLOv8 of the present invention;

[0021] Figure 2 It is the PP_LCNet network structure in the prior art;

[0022] Figure 3 The improved PP-LCNet network of the present invention;

[0023] Figure 4 It is a schematic diagram of the average kernel-size matrix of a lightweight neural network in the prior art;

[0024] Figure 5 A schematic diagram of a lightweight spatial information perception module in a lightweight and dense pedestrian detection method based on YOLOv8;

[0025] Figure 6 It is a lightweight multi-channel compressed decoupling head in a lightweight dense pedestrian detection method based on YOLOv8. DETAILED DESCRIPTION

[0026] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0027] The present invention proposes a lightweight dense pedestrian detection method based on YOLOv8, which uses a lightweight target detection model based on YOLOv8 to detect pedestrians in dense pedestrian images taken from high altitudes. The lightweight target detection model based on YOLOv8 includes a lightweight backbone network, a lightweight spatial information perception module, and a lightweight multi-channel compression decoupling head, wherein:

[0028] A lightweight backbone network, which is used to extract image features from dense pedestrian input images. The lightweight backbone network consists of a cascaded convolution module, 8 depth-separated convolution modules, and a fast spatial pyramid pooling (Spatial Pyramid Pooling–Fast, SPPF) module;

[0029] A lightweight spatial information perception module is used to extract spatial information from the feature map output by the fast spatial pyramid pooling module and fuse it into the neck network;

[0030] A lightweight multi-channel compressed decoupling head for classification based on the output of the neck network.

[0031] The invention is based on a lightweight target detection algorithm of YOLOv8 (YOLOv8+PP-LCNet and LightweightSpatial Information Awareness Module and Lightweight Multi-channelCompression Decoupling Header, referred to as YOLOv8-PSH), and the improvements include a lightweight backbone network architecture, a lightweight spatial information perception module and a lightweight multi-channel compression decoupling head. The invention firstly uses an improved PP-LCNet backbone network architecture to solve the problem of large parameters and large calculation amount of the YOLOv8 backbone network, and secondly adds a lightweight spatial information perception module to the neck network architecture to solve the problem of insufficient spatial information perception after the backbone network is lightweight, resulting in the loss of target information of the model extraction feature map, and finally uses a lightweight multi-channel compression decoupling head to solve the problem of the loss of target detection information and position information in the feature map caused by the model due to environmental noise interference and pedestrian occlusion.

[0032] The structure of the lightweight target detection model based on YOLOv8 in the lightweight dense pedestrian detection method based on YOLOv8 of the present invention is as follows: Figure 1 As shown, the YOLOv8 structure includes a backbone network (BackBorn), a neck network (Neck) and a head network (Head). The present invention improves the YOLOv8 network structure, wherein the improvements include:

[0033] (a) Lightweight backbone network.

[0034] The backbone network in the prior art is usually composed of a CBS module, a C2F module and an SPPF module. In the existing YOLOv8, the input feature map is first processed by a CBS module, and then processed by a cascade of CBS modules, C2F modules, CBS modules, and C2F modules to output a feature map of a first size. The feature map of the first size is processed by the cascaded CBS modules and C2F modules to output a feature map of a second size. The feature map of the second size is processed by the cascaded CBS modules, C2F modules, and SPPF modules to output a feature map of a third size.

[0035] like Figure 1The lightweight backbone network proposed in the present invention is composed of a cascaded convolution module (CBS), 8 deep separation convolution modules (DPCBS) and a fast spatial pyramid pooling module. Each deep separation convolution module is composed of a deep separation convolution unit (DPConv), a batch normalization layer and a SiLU nonlinear activation function layer (for example, a SiLU function or a ReLU function can be selected) in cascade. The feature maps output by the fourth and sixth deep separation convolution modules and the fast spatial pyramid pooling module in the cascade structure of the lightweight backbone network are respectively used as the input of the neck network.

[0036] In the present invention, an improved PP-LCNet target detection network is used to establish a backbone network. The PP-LCNet target detection network is a lightweight CPU network based on the MKLDNN acceleration strategy, which improves the performance of lightweight models on multiple tasks. The accuracy of PP-LCNet can greatly exceed the previous network structure at the same reasoning time.

[0037] like Figure 2 As shown in the figure, in the prior art, PP-LCNet mainly uses the improved deep separable convolution (DPConv) as the basic convolution module. Different from the conventional deep separable convolution, DPConv adds a squeeze-and-excitation (SE) module after the deep convolution and point convolution. The SE module is a key module for enhancing the performance of convolutional neural networks. It can automatically learn and adjust the importance of different channels in the feature map, thereby improving the performance of the network in tasks such as target recognition and image classification. The SE module learns the weight of each channel by minimizing the target loss function. In this way, the network can automatically select and emphasize feature channels that are more useful for specific tasks, while reducing the reliance on useless feature channels. In this way, the SE module can improve the network's discriminative ability, making it pay more attention to important features, thereby improving the performance of the network. Therefore, the SE module is widely used in lightweight target detection networks, and adding the SE module to the block at the end of the network makes the accuracy and speed better balanced.

[0038] As we all know, the activation function has a great impact on network performance. Recently, some activation functions that surpass ReLU have emerged. For example, EfficientNet uses the Swish activation function and shows better performance. In order to avoid complex exponential operations, the author of MobileNetV3 upgraded the Swish activation function to the HSwish activation function. Many lightweight networks have also begun to use the HSwish activation function. The improved activation function has significantly improved the performance of the network. Therefore, in this embodiment, PP-LCNet uses the HSwish activation function, which greatly improves the network performance, while the inference time is almost unchanged. At the same time, PP-LCNet only uses a large convolution kernel in the case of low latency and high precision to reduce the impact of the large convolution kernel on the model inference speed.

[0039] YOLOv8 uses the C2F feature extraction module in the backbone network to replace the C3 module in the YOLOv5 backbone network. Although this method allows the backbone network to obtain richer feature information while reducing the amount of calculation, it adds more skip-layer connections and additional split operations, which increases the number of model parameters and does not significantly reduce the amount of calculation. Therefore, inspired by PP-LCNet, a lighter backbone network architecture was designed to replace the backbone network of YOLOv8.

[0040] like Figure 3 , the DPConv of the present invention not only adds the SE module but also adds the channel position attention (Coordinate Attention, CA) module on the basis of the depth separable convolution. During the training process, the CA module learns the weight of each channel by minimizing the target loss function, so that the network can automatically select and emphasize the feature channels that are more useful for specific tasks, thereby improving the network's discrimination ability and performance. The advantage of the CA module is that it can help the network learn more representative features while reducing the dependence on irrelevant feature channels. By adjusting the channel weights, the CA module can improve the network's perception and anti-interference capabilities, thereby improving the network's performance in complex scenarios. Therefore, adding a CA module can not only adjust the channel weights to make the model more lightweight, but also enable the model to obtain more channel perception information and enhance the robustness of the model.

[0041] (2) Lightweight spatial information perception module.

[0042] Compared with the prior art, the present invention adds a lightweight spatial information perception module (LSIM) between the output of the SPPF module and the upsampling (Upsample) and concatenation operations (Concat).

[0043] This paper visualizes the average kernel-size matrix of four popular lightweight neural networks: MobileNetv2, MobileNetv3, EfficientNet, and MNASNet. The visualization results are shown in the figure. Figure 4 As shown, the important information weights of the 3×3 convolution kernel are mainly reflected in the center position, horizontal position and vertical position, and the importance of information at the outer positions can be ignored. Therefore, the present invention uses a 3×3 depth-separable convolution kernel as the basis to design a lightweight convolution module, which has fewer parameters and floating-point operations.

[0044] like Figure 4 As shown, compared with these corner positions, the positions in the skeleton pattern of the 3×3 convolution occupy a great deal of importance, so the present invention additionally constructs horizontal 1×3 and vertical 3×1DW-Conv branches. In addition, it is observed that the central position always has the highest importance score (almost 1), so an additional 1×1DW-Conv branch is constructed to further enhance the central position; last but not least, in order to prevent the model from having the problem of gradient explosion, the present invention also adds an Identity branch to the spatial operator layer.

[0045] In view of the above research, the spatial information perception module (LSIM) of the present invention is as follows Figure 5 As shown in the figure, one branch is divided into five branches after processing the channels of the input feature map through 1×1DWConv, where:

[0046] The first branch is processed by a 1×1 deep convolution layer, which mainly strengthens the weight of the intermediate position information;

[0047] In the second branch, the cascaded 3×1 deep convolution layer and 1×3 deep convolution layer are used for processing. In this branch, the 3×1 deep convolution layer mainly strengthens the vertical information weight in the feature map, and the 1×3 deep convolution layer mainly strengthens the horizontal position information weight in the feature map.

[0048] In the third branch, n 3×3 deep convolutional layers are cascaded, and the 3×3 deep convolutional layer is mainly used to extract effective information of the external position in the feature map;

[0049] In the fourth branch, it is processed by a cascade of 1×3 depth convolutional layers and 3×1 depth convolutional layers;

[0050] The last branch does not perform any processing, which is the Identity branch.

[0051] In the present invention, the feature maps of the first to fourth branches are integrated together through the Concat module, and after being processed by the ReLU activation function layer, the 1×1 deep convolution layer, and the batch normalization layer, they are merged with the Identity branch as the output of the lightweight spatial information perception module.

[0052] In the inference stage, in order to reduce the number of parameters and computational complexity of the model, according to the additivity and homogeneity of convolution and the method of structural reparameterization, these five branches can be equivalently converted into a single 3×3 deep convolution layer in reasoning. This method can effectively reduce the number of parameters and computational complexity of the model, make the module lighter, and prevent the model from incurring additional inference costs. In the inference stage, the input feature map is processed by a 1×1 deep convolution layer and a ReLU activation function in turn, and then by a 3×3 deep convolution layer. The feature map of the input 3×3 deep convolution layer is concatenated with the feature map output by the 3×3 deep convolution layer, and then processed by the ReLU activation function, a 1×1 deep convolution layer, and a batch normalization layer to obtain the output of the lightweight spatial information perception module.

[0053] like Figure 5 As shown in the figure, the LSIM module makes full use of the center position information, vertical position information and horizontal position information. In order to obtain more spatial perception information, LSIM combines these three position information to obtain a module that is more sensitive to spatial information. Putting the lightweight spatial information perception module into the pyramid feature extraction network can reduce the effective information of FPN that loses occluders, thereby alleviating the problem of FPN losing a small amount of spatial information, thereby improving the detection accuracy of YOLOv8 in dense pedestrian scenes and the robustness in highly occluded pedestrian scenes.

[0054] (iii) Lightweight multi-channel compression decoupling head.

[0055] In the target detection algorithm, the detection head is usually a decoupling head and a coupling head. The coupling head directly connects the feature map output by the convolution layer to the fully connected layer and some convolution layers to generate the location information and category information of the target. The coupling head has a simple design idea, but it requires a large number of parameters and computing resources, and is prone to overfitting. The decoupling head extracts the location information and category information of the target separately, learns them separately through the two branches of the network, and finally fuses them. The decoupling head can effectively reduce the number of parameters and computational complexity of the model, making the model more generalizable and robust. However, when the decoupled head structure is applied to various tasks, due to the difference in the final output dimension, directly compressing the feature channels of the previous layer into the task channels may result in significant feature loss. This in turn has an adverse effect on the overall performance of the model. In addition, directly reducing the number of channels in the final layer to match the output channels may result in feature loss during the forward propagation process, thereby reducing network performance.

[0056] Unlike the YOLOv5 target detection algorithm, the detection head of the YOLOv8 target detection algorithm uses a decoupling head. Although the decoupling head of YOLOv8 can increase the information interaction between different tasks and better capture the rich features of the target. This enables the model to better adapt to different detection tasks and scenarios, and improve the accuracy and robustness of target detection. However, it still has the following disadvantages. First, the model parameters increase. The design of the decoupling head will increase the number of model parameters. Each small convolutional layer requires a certain number of parameters, so as the number of tasks increases, the model parameter scale will also increase. This will lead to an increase in the storage requirements and computational complexity of the model, which may bring certain challenges to limited computing resources. Second, the difficulty of model training increases. The introduction of the decoupling head increases the complexity of the model, making the training process more difficult. Because different tasks require different loss functions and weight adjustments, more detailed adjustments and training strategies are required to ensure the balance and convergence between tasks. Third, the computational efficiency decreases. Since multiple small convolutional layers are used to handle different tasks, the decoupling head may reduce the computational efficiency of the model. Compared with the traditional single convolutional layer, the decoupling head requires more computing resources to handle target detection tasks. This may become a problem in some resource-constrained scenarios. In general, although the decoupled head improves the performance of the object detection model in some aspects, it also brings problems such as increased parameters, increased training difficulty, and decreased computational efficiency.

[0057] Therefore, in order to solve the above problems, the present invention combines the concepts of channel compression and decoupling head to design a lightweight multi-channel compression decoupling head. Figure 6 As shown, this chapter divides the classification and regression tasks into three branches, among which:

[0058] The first branch is the classification task branch, which uses two 1×1 convolutions to determine the type of input feature points;

[0059] The second branch uses 3 convolutions to expand the receptive field of the detection head; at the same time, the features of each convolution layer are compressed along the channel dimension. This approach not only effectively alleviates the training difficulty associated with the target scoring task and improves the model performance, but also reduces the parameters and GFLOPs of the decoupled head module, thereby significantly improving the inference speed;

[0060] The third branch obtains the regression coefficients of the feature points through two 1×1 convolutions to adjust the predicted frame.

[0061] From the above analysis, it can be seen that the present invention uses point convolution to separate the classification and bounding box tasks. This is because for the matched positive samples, the loss associated with the two tasks is relatively small, thus avoiding over-expansion. This method greatly reduces the parameters and GFLOPs in the decoupling head, thereby improving the inference speed. In summary, the lightweight multi-channel compression decoupling head can effectively reduce the number of parameters and computational complexity in the model detection head, while separating the classification, regression and bounding box tasks and using 3 convolutions to expand the receptive field of the detection head. Therefore, the lightweight multi-channel compression decoupling head can effectively solve the problem of bounding box information error and loss in dense pedestrian detection, and improve the detection performance of the model in dense pedestrian detection.

[0062] The loss function in the present invention uses the YOLOv8 loss function, which mainly includes the classification loss Loss_cls and the regression loss Loss_box. The classification loss uses the binary cross entropy loss and the VFL loss function, and the regression loss uses the CIoU loss function and the DFL loss function. The loss function used in the training process of the lightweight target detection model based on YOLOv8 of the present invention is expressed as:

[0063] Loss = Loss_cls + Loss_box

[0064] Among them, Loss represents the loss function of the lightweight target detection model based on YOLOv8; Loss_cls represents the classification loss of the lightweight target detection model based on YOLOv8; Loss_box represents the border regression loss of the lightweight target detection model based on YOLOv8.

[0065] Based on the lightweight dense pedestrian detection method based on YOLOv8 proposed in the present invention, the method of the present invention and the detection method in the prior art are applied to the Crowedhuman dataset and the Wider person dataset respectively. The comparative experimental results on the Crowedhuman dataset are shown in Table 1. From the experimental results, it can be seen that the improved method Ours proposed in the present invention has achieved good detection performance. In terms of parameter quantity and computational complexity, Ours has reduced the parameter quantity of the basic model YOLOv8s by 3.8M to 6.9M, and reduced the computational complexity by 6.5G to 21.9G. In terms of parameter quantity and computational complexity, it is far superior to classic target detection models such as SSD, YOLOv5s, and YOLOv5n. The improved model has achieved model lightweight in the target detection model. In terms of detection accuracy under dense pedestrian background, Ours has increased the average precision mAP0.5% by 1.8% to 83.6% compared with the basic model YOLOv8s, and mAP0.5:0.95 / % has increased by 1.6% to 55.4%, reaching the mainstream level.

[0066] Table 1: Comparative experimental results on the Crowd Human dataset

[0067]

[0068] The comparative experimental results on the Wider person dataset are shown in Table 2. It can be seen from the experimental results that the improved method Ours proposed in the present invention has fewer parameters and less calculation than the YOLOv5s model. Compared with the basic model YOLOv8n, the parameter amount and calculation amount of Ours are significantly reduced, and the detection accuracy mAP0.5 is improved by 1.6% to 90.6%, and mAP0.5:0.95 is improved by 1.8% to 65.3%. The above experimental results prove that the improved method has better generalization ability.

[0069] Table 2: Comparative experimental results on the Wider Person dataset

[0070]

[0071] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A lightweight and dense pedestrian detection method based on YOLOv8, characterized in that: A lightweight target detection model based on YOLOv8 is used to detect pedestrians in dense pedestrian images taken from high altitudes. The lightweight target detection model based on YOLOv8 includes a lightweight backbone network, a lightweight spatial information perception module, and a lightweight multi-channel compression decoupling head, where: A lightweight backbone network for extracting image features from dense input pedestrian images; The lightweight spatial information perception module is used to extract spatial information from the feature map output by the lightweight backbone network and fuse it into the neck network; A lightweight multi-channel compressed decoupling head for classification based on the output of the neck network.

2. According to the lightweight dense pedestrian detection method based on YOLOv8 according to claim 1, it is characterized in that: The lightweight backbone network consists of cascaded convolution modules, 8 depth-wise separable convolution modules and a fast spatial pyramid pooling module. Each depth-wise separable convolution module is composed of a cascade of depth-wise separable convolution unit, a batch normalization layer and a SiLU activation function layer. The feature maps output by the fourth and sixth depth-wise separable convolution modules and the fast spatial pyramid pooling module in the cascade structure are respectively used as the input of the neck network.

3. According to the lightweight dense pedestrian detection method based on YOLOv8 according to claim 2, it is characterized in that: The depthwise separable convolution unit consists of a cascaded depthwise convolutional layer, a pointwise convolutional layer, a squeeze-excitation layer, and a channel position attention layer. The outputs of the depthwise convolutional layer and the pointwise convolutional layer are processed with the HSwish activation function and used as the input of the next layer.

4. According to the lightweight dense pedestrian detection method based on YOLOv8 according to claim 2, it is characterized in that: The convolution module consists of cascaded convolutional layers, batch normalization layers, and activation function layers.

5. The lightweight and dense pedestrian detection method based on YOLOv8 according to claim 1 is characterized in that: During training, the lightweight spatial information perception module processes the input feature map through a 1×1 deep convolution layer, a batch normalization layer, and a ReLU activation function layer, and then inputs it into four branches for processing. The first branch is processed by a 1×1 deep convolution layer, the second branch is processed by a cascade of 3×1 deep convolution layers and 1×3 deep convolution layers, the third branch is processed by a cascade of n 3×3 deep convolution layers, and the fourth branch is processed by a cascade of 1×3 deep convolution layers and 3×1 deep convolution layers. The outputs of the four branches are processed by a batch normalization layer and then spliced ​​together, and then processed by a ReLU activation function layer, a 1×1 deep convolution layer, and a 1×1 deep convolution layer. The convolution layer and batch normalization layer process the spliced ​​feature maps in turn, and then the obtained feature maps are spliced ​​together with the feature maps of the four input branches as the output of the lightweight spatial information perception module; in the inference stage, structural reparameterization is performed, and the input feature map is processed by the cascaded 1×1 deep convolution layer, batch normalization layer, and ReLU activation function layer, and then input into the 3×3 deep convolution layer for processing. The feature map of the input 3×3 deep convolution layer is spliced ​​with the feature map output by the 3×3 deep convolution layer, and then processed by the ReLU activation function layer, 1×1 deep convolution layer, and batch normalization layer in turn to obtain the output of the lightweight spatial information perception module.

6. The lightweight and dense pedestrian detection method based on YOLOv8 according to claim 5 is characterized in that: n is set to 3.

7. The lightweight and dense pedestrian detection method based on YOLOv8 according to claim 1, characterized in that: The lightweight multi-channel compression decoupling head consists of three branches. The first branch consists of two cascaded 1×1 convolutional layers, which performs classification prediction of feature images; the second branch consists of three cascaded 3×3 convolutional layers and a 1×1 convolutional layer, which is used to obtain the intersection-over-union ratio during training; the third branch consists of two cascaded 1×1 convolutional layers, which is used for regression prediction of bounding boxes.

8. The lightweight and dense pedestrian detection method based on YOLOv8 according to claim 1, characterized in that: The loss function used in the training process of the lightweight target detection model based on YOLOv8 is expressed as: Loss = Loss_cls + Loss_box Among them, Loss represents the loss function of the lightweight target detection model based on YOLOv8; Loss_cls represents the classification loss of the lightweight target detection model based on YOLOv8; Loss_box represents the border regression loss of the lightweight target detection model based on YOLOv8.

9. A lightweight and dense pedestrian detection system based on YOLOv8, characterized in that: The system includes a data acquisition device and a data processing device. The data acquisition device takes dense pedestrian images from high altitude and transmits the taken images to the data processing device to detect whether there are pedestrians. The data processing device is a lightweight target detection model based on YOLOv8 deployed on the terminal. The lightweight target detection model based on YOLOv8 implements a lightweight dense pedestrian detection method based on YOLOv8.

Citation Information

Patent Citations

  • Lightweight unmanned aerial vehicle target detection method based on channel clipping

    CN112580512A

  • Unmanned aerial vehicle target detection method based on lightweight feature fusion

    CN115810157A

Cited By

  • SAR and optical image adaptive adversarial feature fusion target detection method

    CN119478378A

  • Intelligent safety monitoring system based on YOLOv8

    CN119810988A

  • Target detection method and system based on LCSD-YOLO network

    CN120339695A