Pedestrian detection method under complex light based on image enhancement and multi-scale learning
By adopting image enhancement and multi-scale learning methods in pedestrian detection, and using LENet and YOLOV7-SFR networks, the problem of insufficient pedestrian detection accuracy and real-time performance under complex light is solved, achieving higher detection accuracy and model robustness. sex.
Patent Information
- Application Number
- CN202410762188.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-13
- Publication Date
- 2024-09-06
AI Technical Summary
The existing technology has insufficient accuracy and real-time performance in pedestrian detection under complex light, and cannot meet the needs of autonomous driving systems for pedestrian detection.
Using methods based on image enhancement and multi-scale learning, by constructing the LENet image enhancement network and YOLOV7-SFR network, using Res2netGenerator for image exposure processing and SFR attention mechanism to enhance feature fusion, the model's pedestrian detection ability under complex light is improved.
It improves the accuracy of pedestrian detection under complex light and the robustness and generalization ability of the model, meeting the real-time requirements of the autonomous driving system.
Smart Images

Figure CN118609089A
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image processing, and relates to image enhancement and target recognition methods, and in particular to a pedestrian detection method under complex light conditions based on image enhancement and multi-scale learning. Background Art
[0002] Intelligent Transportation Systems (ITS) aim to solve traffic problems through information and communication technologies. With the rapid development of ITS, automated driving systems (ADS) as one of them are becoming increasingly mature. To truly implement automated driving into practical applications, the most important factor is the safety of traffic participants. Pedestrians are a vulnerable group among traffic participants, and rapid pedestrian detection is necessary and important for road safety and accident prevention.
[0003] The existing technology for pedestrian detection under normal light is relatively mature, but the research on pedestrian detection under complex light is not yet perfect. The mainstream detection methods include manual feature methods, deep learning methods and hybrid methods. The manual feature method has the advantages of simplicity and good interpretability, but it has limitations in professional fields. The deep learning method is currently the mainstream method for pedestrian detection. It has autonomous learning capabilities, but requires a large amount of data and powerful hardware. The hybrid method combines the manual feature method and the deep learning method, but there is no appropriate trade-off between accuracy and running speed, and it cannot meet the requirements of autonomous driving for real-time pedestrian detection, and its practical value is low. Summary of the invention
[0004] In view of the shortcomings of the existing technology, the present invention proposes a pedestrian detection method under complex light conditions based on image enhancement and multi-scale learning, which can identify pedestrians under complex light conditions such as too dark or too bright. At the same time, the computational cost and memory cost are controlled to ensure the real-time requirements in actual application scenarios.
[0005] The pedestrian detection method under complex light conditions based on image enhancement and multi-scale learning has the following specific steps:
[0006] Step 1: Collect road images under different lighting conditions as training samples, and use pedestrian information in standard images as training labels.
[0007] Step 2: Build the LENet image enhancement network, select Res2netGenerator as the generator, input the training samples obtained in step 1 into the LENet image enhancement network, convert it into a grayscale image, and then normalize the grayscale value to [0,1] to obtain a light attention map, focus on brightening the darker areas in the input image, output a simulated overexposed image, and put it into the training set together with the training samples in step 1.
[0008] The Res2netGenerator includes 1 reflection padding, 4 continuous convolutions, 1 Res2Net layer, 2 continuous convolutions, 1 reflection padding and 1 convolution layer.
[0009] Preferably, the processing method of the Res2netGenerator for the input image is:
[0010] s2.1, performing reflection filling on the input original image;
[0011] s2.2, convert the padded image into a feature map through convolution operation;
[0012] s2.3, perform two downsampling operations on the feature map to obtain a downsampled image;
[0013] s2.4, performing three residual processes on the downsampled image to generate a processed image;
[0014] s2.5, performing upsampling operations twice on the processed image to obtain an upsampled image;
[0015] s2.6, performing reflection filling on the upsampled image to obtain a filled image;
[0016] s2.7. Through convolution and tanh activation function, the padded image is converted into an exposed image.
[0017] Step 3: Build a yolov7 network. The high-dimensional feature map is enlarged through two upsamplings, and then it is spliced with the low-dimensional feature map through the cat module. The SFR attention mechanism is added between the low-dimensional feature map and the cat module to increase the size of the feature map.
[0018] The SFR attention mechanism adds a pyramid pooling before the average pooling of the SE attention mechanism to capture feature information at different scales, which is conducive to the detection of small objects. After pyramid pooling, the feature maps of each scale are globally pooled respectively, with the aim of reducing the dimension of the information of each channel. Then, each scale is weighted through a fully connected structure. Finally, the learned channel weights are mapped to the original feature map for fusion. The SFR attention mechanism can not only provide richer multi-scale features, but also increase the receptive field of the network, further improving the model's ability to identify small objects.
[0019] Step 4: Use the training set data obtained in step 2 to train the network constructed in step 3. Finally, the road image is input into the trained network to identify the position of pedestrians in the image.
[0020] The present invention has the following beneficial effects:
[0021] 1. Use LENet as the data enhancement network to expose the original image, improve the brightness while better retaining the image quality and details, increase the diversity of the data set, and enhance the robustness and generalization ability of the model.
[0022] 2. In view of the complexity of pedestrian detection, the SFR attention mechanism and structural adjustment are added on the basis of yolov7, and multi-level feature fusion is added. By fusing features at different levels, the network's ability to understand complex semantics is improved. By using multi-scale information, the network can better understand features at different scales, achieve tight fusion of features, and make the network better at detecting small objects. Experimental data proves that this method can effectively improve the accuracy of pedestrian recognition under complex light. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 The overall architecture diagram of the pedestrian detection method for image enhancement and multi-scale learning;
[0024] Figure 2 Schematic diagram of the YOLOV7-SFR structure;
[0025] Figure 3 It is a schematic diagram of the SFR module structure;
[0026] Figure 4 This is a schematic diagram of the Res2netGenerator structure;
[0027] Figure 5 The figure shows the pedestrian recognition result in the embodiment. DETAILED DESCRIPTION
[0028] The present invention will be further explained below with reference to the accompanying drawings;
[0029] like Figure 1 As shown in the figure, the pedestrian detection method under complex light conditions based on image enhancement and multi-scale learning has the following specific steps:
[0030] Step 1. This application directly uses traffic images from the public dataset KAIST as training data. The KAIST dataset contains 4 categories. Since this application is a pedestrian detection method, only the person category is used. The KAIST dataset includes traffic images of different time periods. Images taken under poor lighting conditions can be considered as samples with too little light, while images taken during the day can be considered as normal images.
[0031] Step 2: Build the LENet image enhancement network, which focuses on enhancing the light of various images. For RGB images, we convert them into grayscale images and then normalize the grayscale values to between [0,1] to obtain a light attention map. Then, we focus on brightening the darker areas in the image, and can expose normal images. Figure 2 The Res2netGenerator shown in the figure is used as a generator. The person category image in the public dataset KAIST is input into the LENet image enhancement network. The generator performs reflection filling on the input original image, and then converts it into a feature map through convolution operation. After two downsampling operations, three residual processes are performed, followed by two upsampling operations and reflection filling. Finally, through convolution and tanh activation function, the filled image is converted into an exposed image. The pseudo code of the generator part is as follows:
[0032]
[0033]
[0034] Table 1
[0035] Step 3: Build a yolov7 network, such as Figure 3 As shown in the figure, the SFR attention mechanism is added between the low-dimensional feature map and the cat module. This achieves better pedestrian detection under multiple illuminations. Compared with the traditional yolov7, the improved YOLOV7-SFR network adds more low-level features to the fusion process, performs pyramid pooling operations through the SFR module, increases the network's receptive field, and can better understand global information.
[0036] like Figure 4As shown in the figure, the SFR attention mechanism adds a pyramid pooling before the average pooling of the SE attention mechanism to capture feature information at different scales, allowing the network to focus on more detailed features, which is conducive to the detection of small objects. Through pyramid pooling, pooling kernels of different sizes are applied to the input feature map to perform multi-scale pooling. Through these pooling operations, feature information of different scales is captured to enhance the network's detection ability for objects of different sizes. The pooled feature map undergoes global average pooling to adjust the size of the feature map to 1×1, and obtain global statistical information at each scale. The global feature map at each scale is compressed by dimensionality reduction, and the information of each channel is reduced by global average pooling. The output of this stage is the compressed feature representation of each scale for subsequent feature weighting processing. The compressed feature map is input into one or more fully connected layers to learn the channel weights at each scale. The learned channel weights are remapped to the original feature map to weight the features of each scale. Finally, the weighted feature maps at all scales are fused to form the final feature representation. The SFR module captures multi-scale feature information through pyramid pooling. After compression, weighting and fusion steps, it enhances the network's ability to focus on detail features and detection accuracy.
[0037] Step 4: Divide the enhanced images in step 2 and the images from the public dataset KAIST into training and test sets according to a ratio of 7:3. Use the training set to train the YOLOV7-SFR network constructed in step 3. The hardware environment configuration is: CPU (Intel(R) Xeon(R) Silver 4210R CPU@2.40GHz), memory (256GB), graphics card (8×NVIDIA TITANXp) and video memory (8×12GB).
[0038] This embodiment adopts distributed training, and 8 graphics cards are respectively equipped with 48Batch-size data. The hyperparameters of the initial training neural network are set to: Batch-size (8×48) and training rounds Epochs (100).
[0039] Then the test set data is input into the trained model, and the recognition results are as follows Figure 5 As shown in the figure, for both exposed and dim scenes, this method can accurately locate the position of pedestrians in the image and accurately identify them.
[0040] At the same time, the image processed by this method is input into the target detection method commonly used in the prior art and compared with the test results of this method to verify the image enhancement and generalization capabilities of this method for images affected by complex light. The test results are as follows:
[0041] As shown in Table 2:
[0042]
[0043] Table 2
[0044] From the test results in Table 2, it can be seen that in dim and exposed scenes, the detection accuracy can be greatly improved after image enhancement by this method. This method can improve the accurate detection of pedestrians under complex light conditions and has strong generalization ability.
[0045] The above specific implementation modes are used to explain the present invention rather than to limit the present invention. Any modification and change made to the present invention within the spirit of the present invention and the protection scope of the claims shall fall within the protection scope of the present invention.
Claims
1. A pedestrian detection method under complex light conditions based on image enhancement and multi-scale learning, characterized by: The specific steps include: Step 1: Collect road images under different lighting conditions as training samples, and use pedestrian information in standard images as training labels; Step 2: Build the LENet image enhancement network, brighten the training samples obtained in step 1, output the simulated overexposed images, and put them into the training set together with the training samples in step 1; Step 3: Build a yolov7 network and add an SFR attention mechanism between the low-dimensional feature map and the cat module; the SFR attention mechanism adds a pyramid pooling before the average pooling of the SE attention mechanism; Step 4: Use the training set data obtained in step 2 to train the network constructed in step 3; finally, input the road image into the trained network to identify the position of pedestrians in the image.
2. The pedestrian detection method under complex light conditions based on image enhancement and multi-scale learning as claimed in claim 1, characterized in that: Res2netGenerator is selected as the generator in the LENet image enhancement network.
3. The pedestrian detection method under complex light conditions based on image enhancement and multi-scale learning as claimed in claim 2, characterized in that: The Res2netGenerator includes 1 reflection padding, 4 continuous convolutions, 1 Res2Net layer, 2 continuous convolutions, 1 reflection padding and 1 convolution layer.
4. The pedestrian detection method under complex light conditions based on image enhancement and multi-scale learning as claimed in claim 2, characterized in that: The generator performs reflection filling on the input original image, and then converts it into a feature map through a convolution operation, performs two downsampling operations and then three residual processing, then performs two upsampling operations and then performs reflection filling, and finally converts the filled image into an exposed image through convolution and tanh activation function.
5. The pedestrian detection method under complex light conditions based on image enhancement and multi-scale learning as claimed in claim 2, characterized in that: The pseudo code of Res2netGenerator is:
6. The pedestrian detection method under complex light conditions based on image enhancement and multi-scale learning as claimed in claim 1, characterized in that: In the SFR attention mechanism, after the input feature map is pyramid pooled, the feature maps of different scales are globally pooled respectively, and then each scale is weighted through the fully connected structure; finally, the learned channel weights are mapped to the original feature map for fusion.
7. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the method according to any one of claims 1 to 6.
