Personnel detection and counting method based on complex background
Through the combination of image preprocessing and EfficientNet-YOLO network, the problem of low precision and accuracy in people detection and counting under complex backgrounds is solved, and efficient person detection and counting is achieved. It is suitable for complex environments and low-resolution images, and meets the requirements needs in the field of smart public security.
Patent Information
- Application Number
- CN202410803301.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-20
- Publication Date
- 2024-10-01
AI Technical Summary
The existing technology has low detection accuracy and accuracy in detecting and counting people in complex backgrounds, and it is especially difficult to effectively identify and count people in low-resolution images and complex environments.
Using pre-processing steps such as image cropping, data amplification, super-resolution reconstruction and image annotation, combined with the EfficientNet-YOLO network, the channel space attention module and feature pyramid FPN ideas are introduced, and an adaptive non-maximum suppression algorithm is adopted. Build models for people detection and counting in complex contexts.
It improves the detection accuracy and counting accuracy of people in complex backgrounds, realizes the lightweight of the model, is suitable for monitoring equipment and portable collection equipment, and meets the needs of the smart public security field.
Smart Images

Figure CN118736623A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of target detection and counting, and in particular to a method for detecting and counting people under complex backgrounds. Background Art
[0002] Pedestrian detection (personnel detection) is a real-time image recognition task based on specific target categories. It is also one of the classic research topics in the field of computer vision, and its research results have practical applications in many fields. At present, most personnel detection methods are performed on videos or images with simple backgrounds. In real life, the performance of the detector is reduced due to the complex background of pedestrians, target occlusion, and many small targets. In addition, the images collected in the pedestrian dataset have many targets and blurred images. There is less feature information in the original image and the features are difficult to reflect, resulting in the feature extraction network extracting very few target features. These are also the reasons why personnel target detection is difficult to achieve.
[0003] Traditional pedestrian detection methods mainly use feature extractors such as Haar, HOG, ACF, etc. to extract the features of the target, then extract the features of the local part of the image by using sliding window measures, and finally use classifiers such as SVM and Adaboost to determine whether there is a pedestrian target in the area. In recent years, CNN has shown its advantages in the fields of target recognition and feature extraction, and has been fruitful in many studies. Among them, target recognition based on deep convolutional neural networks provides a new research direction for pedestrian detection. There are roughly two types of target detection. The first type is based on the region proposal method. The core idea is to locate the region first and then classify it in the proposed region. The second type is based on regression methods. The core idea is to locate the target and classify it at the same time. Redmon J et al. proposed the YOLOv3 model, which introduced improvements such as multi-scale prediction and modified loss function. It can be seen that YOLO itself is also constantly being optimized and explored. In the same year, a modified YOLOv3 method for detecting occluded pedestrians was proposed. By introducing the residual dense network (RDN), the model fully utilized the feature information of all convolutional layers and completed the fast and accurate detection of occluded pedestrians. However, it still had shortcomings in the detection of dense pedestrian overlap and small target pedestrians. The above research shows that deep learning has achieved good research results in various aspects of target detection. However, the target detection model is easily affected by the shooting angle, the image blur caused by the movement of the device itself, and the low resolution of the image, which also limits the final performance of the detection model.
[0004] Image reconstruction technology is one of the hot topics in the field of computer vision. Its goal is to obtain image information through existing hardware conditions and only use software processing technology to enhance the image. This is a method of using image processing technology to enhance the original image to obtain high-quality images. Image super-resolution reconstruction plays a big role in the field of computer vision. For example, in target recognition, edge detection, etc., if the input image resolution is low, the super-resolution task can be used as an operation in its preprocessing stage, that is, as a means of image enhancement. After the low-resolution data set is processed by the super-resolution model, it can significantly improve the final performance of other task models. Summary of the invention
[0005] The technical problem solved by the present invention is to provide a method for detecting and counting people in a complex background, which has low requirements on the input image, can improve the precision of people detection and counting accuracy in specific scenes, and is suitable for monitoring equipment and portable acquisition equipment.
[0006] The technical solution to achieve the purpose of the present invention is:
[0007] A method for detecting and counting people in a complex background comprises the following steps:
[0008] Step 1: Use monitoring equipment and portable acquisition equipment to collect images of people in complex background environments. Collect images of people in different postures, multiple angles, and different heights. Due to the limitations of installing monitoring equipment, most of the images of people obtained are overhead images. During the capture process, the overlapping area of people in the image is minimized as much as possible to ensure that the image contains a large number of complete images of people. At the same time, considering the impact of light and angle on detection and counting results, try to capture as many frames of people images in the video stream as possible each time.
[0009] Step 2: Preprocessing of personnel image data is mainly carried out in four steps (including image cropping, data amplification, super-resolution reconstruction, and image annotation) to obtain clear and high-resolution personnel image data;
[0010] Step 2-1: Image cropping: add xy plane coordinates based on the original image of the person, perform cutting on the image coordinate axis, and extract the sub-image based on the cutting under the coordinates.
[0011] Step 2-2: Data augmentation, (1) performing different levels of brightness transformation on the personnel cut-out image; (2) adjusting the contrast of the personnel cut-out image; (3) performing random multi-angle rotation on the personnel cut-out image.
[0012] Step 2-3: Super-resolution reconstruction processing, in order to improve the quality of blurry and low-resolution images in the personnel image dataset, the super-resolution reconstruction processing step is implemented using image reconstruction technology. Image reconstruction is widely used and of great significance in the field of target detection. If the input image is blurry and has a low resolution, the super-resolution task is used as a means of image enhancement.
[0013] Step 2-4: Image annotation, use annotation software to annotate the person target class. When annotating the person image, the various appearances and forms of the person should be fully considered. When the person's blocked area is greater than 80% or the person is at the edge of the image with an exposed area less than 20%, they will not be labeled.
[0014] Step 3: Reconstruct the blurred person image data in four steps to obtain clear and high-resolution person image data. The high-resolution reconstructed image and the clear image together form the final data set of this article.
[0015] Step 3-1: Reconstruction using traditional interpolation algorithms: construct multiple traditional interpolation algorithms (Nearest, Bilinear, Bicubic) to compare and evaluate the image reconstruction quality from a quantitative perspective. The Peak Signal to Noise Ratio (PSNR) is used as the image reconstruction evaluation index.
[0016] Step 3-2: Deep learning algorithm reconstruction, build a variety of deep learning reconstruction algorithms, and use a variety of different networks (SRCNN, ESPCNN, FSRCNN and NSFSRCNN) to reconstruct and compare blurry low-resolution personnel images to provide more clear and high-resolution images for subsequent data labeling, target detection, and target counting.
[0017] Step 3-3: Perform super-resolution reconstruction on the blurred low-resolution personnel images, compare and analyze the reconstruction results of the traditional interpolation algorithm and the deep learning algorithm, evaluate the quality of the reconstructed images using the peak signal-to-noise ratio indicator, select the reconstruction results with a high peak signal-to-noise ratio as the super-resolution image basis for the subsequent personnel detection and counting model, and process all blurred personnel images.
[0018] Step 3-4: After data augmentation, it is found that there are some blurred images of people in the augmented data set. In order to improve the quality of blurred images in the data set, the image super-resolution reconstruction technology is used to process the blurred images. The specific process is: first, the data set is divided into a clear image data set and a blurred image data set, and the clear image is input into the image reconstruction model for training to obtain the training weight file; then the blurred image is input into the reconstruction model for super-resolution reconstruction processing; then the deblurred high-resolution reconstructed image is obtained. Finally, the high-resolution reconstructed image and the clear image together constitute the final data set of this article (personnel data set).
[0019] The final data set is divided into a personnel data set according to the standard format of public data sets. The data set is split into training set, validation set, and test set in a ratio of 16:4:5, and there is no overlap or crossover of images between the data sets.
[0020] Step 4: Detection and counting model construction:
[0021] A person detection and counting model based on the EfficientNet-YOLO network was constructed. This model basically achieved the lightweight of the person detection model while meeting the high detection accuracy. Taking EfficientNet_B0 as the basic backbone network, the Convolutional Block Attention Module (CBAM) was introduced, the idea of the feature pyramid FPN was borrowed, multiple scale feature maps were fused, and the adaptive non-maximum suppression (Adaptive NMS) algorithm was used to finally form the EfficientNet-YOLO detection and counting model.
[0022] Step 4-1: EfficientNet network: It is mainly composed of multiple MBConv modules, and the SENet attention mechanism is also introduced in this module. SENet performs attention operations on the channel dimension, allowing the network to pay more attention to key information and suppress less important channel features.
[0023] Step 4-2: Attention mechanism: Use the Convolutional Block Attention Module (CBAM). The Convolutional Block Attention Module (CBAM) is an attention mechanism module that combines spatial and channel. It consists of two sub-modules: channel attention and spatial attention. This module aims to learn meaningful features from two dimensions: channel dimension and global spatial dimension, and learns target features and position features in the two dimensions respectively.
[0024] Step 4-3: EfficientNet-YOLO model: The EfficientNet-YOLO network structure consists of two parts: the backbone network and the detection network, which are used for feature extraction and multi-scale prediction respectively. Since the semantic feature information of the low-level feature map is relatively scarce, but the target position information is accurate, and the semantic feature information of the high-level feature map is relatively rich, but the target position information is rough, EfficientNet-YOLO borrows the idea of the feature pyramid FPN and fuses multiple scale feature maps, but only detects in the fused feature map of 2 scales (26×26pixel, 13×13pixel).
[0025] Step 5: Compare the performance of common target detection models under self-built datasets and public datasets. A detection and counting model based on the EfficientNet-YOLO network was built to compare the evaluation indicators with Faster RCNN, R-FCN, SSD, and YOLOv3 detection algorithms. A new method for personnel detection and technology in the field of smart public safety is achieved by achieving lightweight detection models and high detection accuracy in special scenarios.
[0026] Compared with the prior art, the present invention adopts the above technical solution and has the following technical effects:
[0027] 1. The method for detecting and counting people in complex backgrounds of the present invention has low requirements on input image data and strong model robustness;
[0028] 2. A method of detecting people in complex backgrounds combined with image super-resolution reconstruction technology is used to detect and count people in an environment, providing ideas for subsequent research;
[0029] 3. The personnel detection and counting method based on complex background of the present invention successfully realizes the lightweight of the detection model in a special scenario, meets the new method of personnel detection and counting in the field of smart public safety, and can maintain the lightweight model and high counting accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] The present invention will be further described below in conjunction with the accompanying drawings.
[0031] Figure 1 It is an overall flow chart of a method for detecting and counting people in a complex background according to the present invention;
[0032] Figure 2 This is a diagram of the MBConv network structure used in the present invention;
[0033] Figure 3 The flow chart of introducing the CBAM channel spatial attention module of the present invention;
[0034] Figure 4 The EfficientNet-YOLO network structure of the present invention is constructed;
[0035] Figure 5 A detection diagram of a detection and counting model based on the EfficientNet-YOLO network under a public data set is proposed for the present invention;
[0036] Figure 6 A counting result diagram of a detection and counting model based on the EfficientNet-YOLO network under a public data set is proposed for the present invention; DETAILED DESCRIPTION
[0037] The embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be interpreted as limiting the present invention.
[0038] A method for detecting and counting people in a complex background has the following specific steps: Figure 1 The overall flow chart is as follows:
[0039] Step 1: Data collection:
[0040] By using monitoring equipment and portable acquisition equipment, images of people in complex background environments are collected, with an image size of 3456×4608 pixels and a resolution of 96dpi. Images of people in different postures, multiple angles, and different heights are collected. Due to the limitations of installing monitoring equipment, most of the images of people obtained are overhead images. During the capture process, the overlapping area of people in the image is minimized as much as possible to ensure that the image contains a large number of complete images of people. At the same time, considering the impact of light and angle on detection and counting results, as many frames of people images in the video stream as possible are captured each time.
[0041] Step 2: Image data preprocessing is mainly divided into four steps (including image cropping, data amplification, super-resolution reconstruction, and image annotation) to obtain clear and high-resolution personnel image data:
[0042] 2-1. Step 1: Image cropping. First, the size of the input image is 3456×4608×3. Based on the original image of the person, the xy plane coordinates are added, and the image coordinate axis is cut. After cutting based on the coordinates, the sub-image is extracted. After the cutting operation, multiple 1024×1024 pixel cut images of the person are obtained.
[0043] 2-2. The second step: data augmentation, (1) perform different levels of brightness transformation on the person cutting image so that the person target detection and counting model is not affected by the diversity of light in the environment; (2) adjust the contrast of the person cutting image to better express the clarity, grayscale level and texture detail features of the person image; (3) perform random multi-angle rotation on the person cutting image, such as 90°, 270°, horizontal flip, mirror flip, etc.
[0044] 2-3. Step 3: In order to improve the quality of blurry and low-resolution images in the personnel image dataset, the image reconstruction technology is used to implement the super-resolution reconstruction processing step. Image reconstruction is widely used and of great significance in the field of target detection. If the input image is blurry and has a low resolution, the super-resolution task is used as a means of image enhancement.
[0045] 2-4. Step 4: Image annotation. Use annotation software to annotate personnel targets. When annotating personnel through personnel images, the various appearances and forms of personnel should be fully considered. When the obscured area of the personnel is greater than 80% or the personnel is at the edge of the image with an exposed area of less than 20%, the personnel will not be annotated.
[0046] Step 3: Image reconstruction processing includes four steps to obtain clear and high-resolution personnel image data. The high-resolution reconstructed image and the clear image together form the final data set of this article:
[0047] 3-1. Step 1: Reconstruction using traditional interpolation algorithms. Use a variety of traditional interpolation algorithms such as nearest neighbor, bilinear, and bicubic to compare and evaluate the image reconstruction quality from a quantitative perspective.
[0048] The image reconstruction evaluation index uses the Peak Signal to Noise Ratio (PSNR), which is usually used to compare the difference between the original image and the processed image, so as to measure the advantages and disadvantages of different processing methods.
[0049]
[0050] Where MSE is the mean square error between the original image X and the processed image Y; H and W represent the height and width; n is the number of image pixels. The unit of PSNR is dB, and the larger the value, the better the reconstruction result.
[0051] 3-2. The second step: deep learning algorithm reconstruction, using a variety of different networks (SRCNN, ESPCNN, FSRCNN and NSFSRCNN) to reconstruct and compare blurry low-resolution personnel images, providing more clear and high-resolution images for subsequent data labeling, target detection, and target counting.
[0052] 3-3. The third step: perform super-resolution reconstruction on the blurred low-resolution personnel images, analyze the results of the traditional reconstruction algorithm and the deep learning algorithm, evaluate the peak signal-to-noise ratio of the reconstructed image quality, and select the reconstruction results with a high peak signal-to-noise ratio as the super-resolution image data basis for the subsequent personnel detection and counting models.
[0053] 3-4. Step 4: After data augmentation, it is found that there are some blurred images of people in the augmented data set. In order to improve the quality of blurred images in the data set, the image super-resolution reconstruction technology is used to process the blurred images. The specific process is: first, the data set is divided into a clear image data set and a blurred image data set, and the clear image is input into the image reconstruction model for training to obtain the training weight file; then the blurred image is input into the reconstruction model for super-resolution reconstruction processing; then the deblurred high-resolution reconstructed image is obtained. Finally, the high-resolution reconstructed image and the clear image together constitute the final data set of this article (personnel data set).
[0054] 3-5. Divide the final data set, and make a personnel data set according to the standard format of the public data set. Split the data set into training set, validation set, and test set in a ratio of 16:4:5. There is no overlap between the images of each data set. The data set folder constructed for target detection is specifically divided into a JPEGImages folder: used to store image samples; Annotations folder: used to store label xml files; ImageSets folder: stores data set partition txt files, including training files: divided into (train.txt) and (trainval.txt), validation files (val.txt), and test files (test.txt).
[0055] Step 4: Detection and counting model construction:
[0056] A person detection and counting model based on the EfficientNet-YOLO network was constructed. This model basically achieves the lightweight of the person detection model while meeting the high detection accuracy. Drawing on the accelerated lightweight YOLOv3-tiny model, using EfficientNet_B0 as the basic backbone network, introducing the channel space attention module (Convolutional BlockAttention Module, CBAM), drawing on the idea of feature pyramid FPN, fusing multiple scale feature maps, and using the adaptive non-maximum suppression (Adaptive NMS) algorithm, the EfficientNet-YOLO detection and counting model was finally formed.
[0057] The F1 value (F1 score), average precision AP (Average Precision), R 2 , RMSE is used as an evaluation index to verify the detection and counting performance of the model. The intersection over union (IOU) is the degree of overlap between the predicted candidate box and the original labeled box. The value is between 0 and 1, and the IOU threshold is set to 0.5. AP refers to the area under the PR curve. The PR curve reflects the relationship between different recall rates and the maximum accuracy under the corresponding recall rate.
[0058]
[0059] Among them, TP represents the number of correct detections by the model; FP represents the number of correct detections by the model that are actually incorrect; FN represents the number of incorrect detections by the model that are actually correct; P and R represent precision and recall, respectively.
[0060] 4-1. EfficientNet network:
[0061] EfficientNet is a lightweight neural network. EfficientNet_B0 is mainly composed of multiple MBConv modules ( Figure 2 This is the MBConv network structure diagram. Figure 2 The MBConv module also introduces the SENet attention mechanism module.
[0062] The specific operation of the mobile flip bottleneck convolution module (MBConv) is as follows: first, perform a 1×1 point-by-point convolution on the input to change the output channel dimension, then perform a k×k depthwise convolution, then introduce a compression and excitation operation (SENet), and then restore the original channel dimension with a 1×1 point-by-point convolution, and finally perform a drop connection and a skip connection of the input (in EfficientNets-B0, only when the same mobile flip bottleneck convolution appears repeatedly will the connection be dropped and the input skip connection be performed, and the depth convolution step size will also be changed to 1).
[0063] SENet performs attention operations on the channel dimension, allowing the network to pay more attention to key information and suppress less important channel features. The SE module consists of Squeeze, Excitation, and Scale operation steps, and is calculated as follows.
[0064]
[0065] s=Fex (z,W)=σ(g(z,W))=σ(W2*δ(W1*z))
[0066]
[0067] Where Z c ,s, They are Excitation, Squeeze, and scale operations, respectively. sq (U c ) represents the result of the global average pooling operation, X(C×H×W) is F tr Input, F tr The output is U = [u1,u2,···,u c ],u c represents the two-dimensional matrix; F ex (z,W) is the operation result of the fully connected layer, δ is the ReLU function, σ is the sigmoid function, which is used to map the channel weight value to between 0 and 1; F scale (u c ,s c ) is the result of the channel multiplication operation, u c is a two-dimensional matrix, s c is a weight (the value of s at the cth layer), and represents a matrix multiplication operation.
[0068] 4-2. Attention Mechanism
[0069] The attention mechanism specifically uses the channel space attention module (Convolutional Block Attention Module, CBAM), such as Figure 3 (A) As shown. The channel spatial attention module CBAM is an attention mechanism module that combines spatial and channel. It consists of two sub-modules: channel attention and spatial attention. Figure 3 (B) is the channel attention module (CAM), Figure 3 (C) is the Spatial Attention Model (SAM). This module aims to learn meaningful features from two dimensions: channel dimension and global spatial dimension, and learns target features and position features in two dimensions respectively. CBAM first connects the feature map in the channel dimension to obtain the input feature map F∈β H×W×C , then input F into the channel attention module and the spatial attention module in turn to infer the corresponding attention weights, and then multiply it with the original feature map to adaptively adjust the features, and finally output the adaptively adjusted feature map F"∈β H×W×C .
[0070] Channel attention module: For the input feature map F, firstly obtain the global information of each feature channel through global average pooling and maximum pooling operations, and form channel descriptors respectively and Then, the feature channel attention vector Ω is obtained through two fully connected layers FC1 and FC2 chn ∈β 1×1×C , and finally use Ω chn The input feature F is weighted channel by channel to obtain F'. The specific steps are expressed as follows.
[0071]
[0072] Among them, σ represents the sigmoid function, δ represents the ReLU function, and W1∈β C / r×C and W2∈β C×C / r They represent the parameters of the two fully connected layers, r is the dimensionality reduction ratio, Represents channel-by-channel multiplication.
[0073] Spatial attention module: First, perform global maximum pooling and global average pooling operations on the input feature map F' in the channel dimension to obtain the feature map F' max ,F' min , which is used to count the spatial information of the feature map; then the feature map is input into a convolutional layer CONV and the spatial attention feature map M is obtained through the activation function σ output sp ; Finally, use the spatial attention feature map M sp Reactivate the input F' to obtain the final feature map F". The specific steps are expressed as follows.
[0074] M sp =σ(CONV(F' max +F' min ))
[0075]
[0076] Among them, F',F"∈β H×W×C Represents input feature map and output feature map; F' max ,F' min ∈β H×W×1 They represent the global maximum pooling feature map and the global average pooling feature map respectively; σ represents the sigmoid activation function; CONV represents the convolution operation with a convolution kernel size of 7×7 and a convolution kernel number of 1; M sp ∈β H×W×1 represents the spatial attention feature map, Represents element-wise multiplication of feature maps.
[0077] 4-3. EfficientNet-YOLO model:
[0078] The constructed EfficientNet-YOLO network model focuses on optimizing the performance of model size, detection speed and accuracy. The model retains the two-scale detection characteristics of YOLOv3-tiny and introduces the EfficientNet network, which can improve the learning ability of CNN while reducing the memory occupancy of the model, showing the obvious advantages of lower computational complexity and higher accuracy.
[0079] The EfficientNet-YOLO network structure consists of two parts: the backbone network and the detection network, which are used for feature extraction and multi-scale prediction respectively.
[0080] Since the semantic feature information of low-level feature maps is scarce, but the target position information is accurate, and the semantic feature information of high-level feature maps is rich, but the target position information is rough, EfficientNet-YOLO borrows the idea of feature pyramid FPN and fuses multiple scale feature maps, but only performs detection in the fused feature maps of 2 scales (26×26pixel, 13×13pixel).
[0081] In practice, 416×416 pixels are used as an example. First, after passing through the 132-layer EfficientNet feature extraction network, a 13×13 pixel feature map is obtained through convolution and residual skip connection modules, which is the first scale detection layer. To achieve small-scale target detection, the feature map of the 133th layer of the convolution layer is upsampled to obtain a feature map with the same resolution as the 90th layer. After multiple residual skip connection modules, the feature map of the 142th layer of the convolution layer is obtained. The 142th to 149th layers are the attention modules constructed separately in this chapter, and then residual skip connections are performed with the 90th layer feature map. Finally, a 26×26 pixel feature map is obtained through multiple convolutions, which is the second scale detection layer. The EfficientNet-YOLO network structure is as follows: Figure 4 shown.
[0082] 4-3. Adaptive non-maximum suppression:
[0083] An adaptive non-maximum suppression (Adaptive NMS) algorithm is used to count people. This algorithm is an optimization of soft-NMS. In order to solve the problem of too dense targets in pedestrian detection tasks, the density and sparseness of the target's surroundings are predicted through the network, and different deduplication strategies are adopted.
[0084] Step 5: Compare the performance of common target detection models under self-built datasets and public datasets. Construct a detection and counting model based on the EfficientNet-YOLO network and compare the evaluation indicators with Faster RCNN, R-FCN, SSD, and YOLOv3 detection algorithms. Achieve lightweight detection models in special scenarios with high detection accuracy and high real-time performance; meet the new methods of personnel detection and technology in the field of smart public safety. Figure 5 and Figure 6 The following is a graph showing the detection and counting results of the detection and counting model based on the EfficientNet-YOLO network on public datasets (MS COCO, CityPersons).
[0085] Public datasets: This paper extracts target pedestrians (person class) from the CityPersons public dataset and from the MSCOCO public dataset. There are pedestrians of various sizes in the CityPersons dataset. The background of the picture is complex, the pedestrians occlude each other, and most of the pedestrians are very small, which brings great challenges to detection. There are a total of 2975 pictures in this dataset. According to the VOC dataset division format, 1904 pictures are randomly selected as training sets, 595 pictures are randomly selected as test sets, and 476 pictures are randomly selected as validation sets. There is no overlap between the pictures of each dataset. There are many small targets in the MS COCO dataset (in the field of target detection, small target objects are usually considered to be smaller than 32*32 pixels in area), accounting for about 41%. In order to verify the effectiveness of this method in the experiment, the test data is verified on small target pedestrians in the MS COCO dataset. Using the COCO API code provided by COCO itself, the person class was extracted from the COCO-2017 training set. A total of 64,115 images and corresponding XML files were extracted. 10,000 images were randomly selected as the final dataset for the verification algorithm. The MS COCO dataset was divided according to the above-mentioned CityPersons public dataset format.
[0086] The above descriptions are only some embodiments of the present invention. It should be pointed out that a person skilled in the art can make several improvements without departing from the principles of the present invention. These improvements should be regarded as within the protection scope of the present invention.
Claims
1. A method for detecting and counting people in a complex background, characterized in that: The following steps are involved: Step 1: Use monitoring equipment and portable acquisition equipment to collect images of people in different postures, multiple angles, and different heights in a complex background environment, and intercept the image of the person with the smallest overlapping area as the original image of the person; Step 2: Preprocess the original image of the person by cropping, amplifying, super-resolution reconstruction, and labeling; Step 3: After super-resolution reconstruction, the high-resolution reconstructed image and the clear image are combined to form the final data set; Step 4: Take EfficientNet_B0 as the basic backbone network, introduce the channel space attention module CBAM, fuse multiple scale feature maps, and use the adaptive non-maximum suppression Adaptive NMS algorithm to form the EfficientNet-YOLO detection and counting model based on the person image.
2. According to claim 1, a method for detecting and counting people in a complex background is characterized in that: Step 2: Preprocess the original image of the person by cropping, amplifying, super-resolution reconstruction, and labeling, including: Step 2-1: Image cropping: add xy plane coordinates based on the original image of the person, perform cutting on the image coordinate axis, and extract sub-images based on the cutting under the coordinates; Step 2-2: Data augmentation, S1 performs different levels of brightness transformation on the personnel cut-out image; S2 adjusts the contrast of the personnel cut-out image; S3 performs random multi-angle rotation on the personnel cutting graph; Step 2-3: Using image reconstruction technology, super-resolution reconstruction is performed on the blurred low-resolution image data, and reconstructed in the target detection field; Step 2-4: Image annotation: Use annotation software to annotate the person target class. When the person's blocked area is greater than 80% or the person is at the edge of the image with an exposed area less than 20%, the person will not be labeled.
3. The method for detecting and counting people in a complex background according to claim 1, characterized in that: Step 3: After super-resolution reconstruction, the high-resolution reconstructed image and the clear image are combined to form the final data set, including: Step 3-1: Reconstruction of traditional interpolation algorithms: construct a variety of traditional interpolation algorithms to compare and evaluate the image reconstruction quality from a quantitative perspective; use the peak signal-to-noise ratio (PSNR) as the image reconstruction evaluation index; Step 3-2: Deep learning algorithm reconstruction, build a variety of deep learning reconstruction algorithms, and use a variety of networks to reconstruct and compare fuzzy low-resolution personnel images to provide more clear and high-resolution images for subsequent data annotation and target detection; Step 3-3: Perform super-resolution reconstruction on the blurred low-resolution personnel image, analyze the results of the traditional reconstruction algorithm and the deep learning algorithm, and select the reconstruction result with a high peak signal-to-noise ratio as the super-resolution image data basis for the subsequent personnel detection and counting model; Step 3-4: After data augmentation, if there are some blurred images of people in the augmented data set, super-resolution reconstruction is used for the blurred images, and the high-resolution reconstructed images and clear images are combined to form the final data set.
4. The method for detecting and counting people in a complex background according to claim 1, characterized in that: In step 4, an EfficientNet-YOLO detection and counting model is formed based on the person image, including: Step 4-1: EfficientNet_B0 consists of multiple MBConv modules, and the MBConv module introduces the SENet attention mechanism; SENet performs attention operations on the channel dimension, making the network pay more attention to key information and suppress it; Step 4-2: Attention Mechanism: Channel Spatial Attention Module CBAM combines the spatial and channel attention mechanism modules, which consists of two sub-modules: channel attention and spatial attention; The two submodules learn the target features and position features in the channel dimension and global space dimension respectively; Step 4-3: The EfficientNet-YOLO model retains the two-scale detection characteristics of YOLOv3-tiny and introduces the EfficientNet network; The EfficientNet-YOLO network structure consists of two parts: the backbone network and the detection network, which are used for feature extraction and multi-scale prediction respectively.
5. The method for detecting and counting people under complex background according to claim 4, characterized in that: EfficientNet-YOLO fuses feature maps of multiple scales and performs detection in fused feature maps of two scales.
6. The method for detecting and counting people in a complex background according to claim 1, characterized in that: In step 3-1, the traditional interpolation algorithm reconstruction includes: nearest neighbor, bilinear, and bicubic interpolation.
7. The method for detecting and counting people under complex background according to claim 3, characterized in that: In step 3-2, the multiple networks are SRCNN, ESPCNN, FSRCNN and NSFSRCNN.
8. The method for detecting and counting people under complex background according to claim 3, characterized in that: In step 3-4, the final data set is divided, and a personnel data set is produced according to the standard format of the public data set. The data set is split into a training set, a validation set, and a test set in a ratio of 16:4:5, and there is no overlap or crossover of images between the data sets.
9. The method for detecting and counting people in a complex background according to claim 1, characterized in that: By building a detection and counting model based on the EfficientNet-YOLO network, the evaluation indicators are compared with the Faster RCNN, R-FCN, SSD, and YOLOv3 detection algorithms.
