Night pedestrian detection method, computer equipment, device and storage medium

By introducing a bidirectional feature pyramid structure and a low-light image enhancement algorithm into the YOLOv8 network, the detection problem of pedestrian detection in low-illumination scenes at night is solved, the detection accuracy and robustness are significantly improved, and the missed detection rate is reduced.

CN118570760APending Publication Date: 2024-08-30WUHAN UNIV OF SCI & TECH
View PDF 0 Cites 8 Cited by

Patent Information

Application Number
CN202410509445.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-25
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

Existing pedestrian detection algorithms perform poorly in low-illumination nighttime scenes, especially due to image contrast changes caused by large noise and uneven illumination, which make it difficult to distinguish pedestrians from the background, resulting in high detection accuracy and missed detection rates.

Method used

The bidirectional feature pyramid structure is used to replace the neck network of the YOLOv8 network, combined with the low-light image enhancement algorithm for preprocessing, and feature fusion is performed through the BiFPN module and the c2f module to enhance the information interaction between feature maps and improve the accuracy and accuracy of pedestrian detection at night. speed.

Benefits of technology

It effectively reduces the missed detection rate, improves detection accuracy and robustness, enhances the model's adaptability to illumination changes and shadow interference, and improves the accuracy and efficiency of pedestrian detection at night.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118570760A
    Figure CN118570760A
Patent Text Reader

Abstract

The invention discloses a night pedestrian detection method. Comprising the steps of obtaining a night pedestrian detection data set, performing illumination enhancement operation preprocessing on image data in the night pedestrian detection data set based on a low-light image enhancement algorithm, building a YOLOv8-source network suitable for pedestrian detection, obtaining optimal weight data for the YOLOv8-source network through the preprocessed image data, loading the optimal weight data into the YOLOv8-source network, and obtaining a pedestrian detection result. And detecting the input image data to be detected. According to the night pedestrian detection method, the bidirectional feature pyramid structure is adopted, multi-scale feature information can be fully extracted and fused, information interaction between feature maps is enhanced, and therefore efficient and accurate detection of night pedestrians is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of target detection, and in particular to a method, computer equipment, device and storage medium for detecting pedestrians at night. Background Art

[0002] 1. Pedestrian Detection Algorithm

[0003] Human-centric computer vision tasks such as pedestrian detection, pedestrian re-identification, pedestrian search, pose estimation, and face detection have attracted much attention in the past decade. Among these tasks, pedestrian detection is undoubtedly the most basic and critical link. Its goal is to accurately locate and classify all pedestrian instances in a given image. Pedestrian detection not only provides a basis for advanced tasks such as autonomous driving, intelligent transportation, and traffic monitoring, but is also particularly important because it is directly related to people's life safety. Therefore, pedestrian detection has extremely strict requirements on detection rate and real-time performance.

[0004] At present, there are many methods for pedestrian detection, including manual methods, deep learning methods, and hybrid applications of the two. These methods usually include three consecutive steps: proposal generation, classification (and regression), and post-processing. However, not all methods follow this fixed process. For example, the method proposed by Liu et al. (2019) omits the proposal generation step. With the continuous advancement of neural network technology, methods based on deep features have far surpassed traditional methods based on manual features in performance. In recent years, pure CNN-based pedestrian detection methods have emerged in an endless stream, such as scale-aware methods, component-based methods, attention-based methods, data enhancement-based methods, loss-based methods, multi-task methods, and post-processing-based methods. The powerful representation learning ability of deep convolutional neural networks (CNNs) has brought significant progress to pedestrian detection. Detectors such as Cascade R-CNN, Faster R-CNN, BGCNet, PedHunter, F2DNet, MAPD, SMPD, etc. have shown excellent performance in existing datasets under good lighting conditions.

[0005] However, pedestrian detection faces many challenges in low-light night scenes. Night images are usually noisy and have poor lighting conditions. The instability of the monitoring light source exacerbates the imbalance of illumination, resulting in drastic changes in image contrast. When detecting pedestrians in such low-contrast areas, color or shape information is often easily lost, making it extremely difficult to distinguish between foreground and background areas. Therefore, even the most advanced pedestrian detectors generally perform worse at night, and detection indicators such as precision mAP and missed detection rate MR are often not as ideal as during the day. However, considering the higher risk of night driving and the loopholes in nighttime safety monitoring, research on nighttime pedestrian detection is particularly important, and more and more researchers are beginning to turn their attention to the problem of pedestrian detection in this low-light scene.

[0006] Research on low-light pedestrian detection can be roughly divided into two directions: one is input enhancement using fusion strategies, and the other is optimization of pedestrian detection model algorithms. Input enhancement can be further divided into fusion solutions based on CNN and fusion solutions based on graph attention networks (GAN). The pedestrian detection model mainly focuses on how to use deep learning methods to detect pedestrians under low-light conditions. This part of the research can be divided into two categories: regional methods and non-regional methods.

[0007] The structure of the Yolov8 network is mainly divided into three main parts: Backbone, Neck and Head. This structure is a common model division method in visual deep learning.

[0008] Backbone: This is the backbone network of the model, responsible for extracting features from the input image. In YOLOv8, Backbone uses a series of convolutional and deconvolutional layers to extract features, and uses residual connections and bottleneck structures to optimize the size of the network and improve performance. In addition, Backbone also uses the C2f module as a basic building block, which has fewer parameters and better feature extraction capabilities than the C3 module in YOLOv5.

[0009] Neck: This part is an intermediate layer used to fuse features from Backbone to improve the performance of the model. The Neck part of YOLOv8 uses multi-scale feature fusion technology to fuse feature maps from different stages of Backbone to enhance the representation ability of features. Specifically, the Neck part of YOLOv8 includes an SPPF module, a PAA module, and two PAN modules. However, it is worth noting that in some descriptions of YOLOv8, the Neck part is not clearly divided, but its functions are integrated into the Head part.

[0010] Head: This is the last layer of the model, and its structure varies depending on the task. In object detection tasks, the Head part usually includes a bounding box regressor and a classifier. The Head part of YOLOv8 adopts a decoupled head design, that is, each scale has an independent detector, and each detector consists of a set of convolutional and fully connected layers to predict the bounding box at that scale. This design enables the model to perform object detection at different scales in parallel.

[0011] Although the Yolov8 network achieves a good balance between accuracy and speed in pedestrian detection in general scenarios, it still has certain detection defects in low-light scenarios such as at night, just like other deep learning algorithms, and needs further improvement and optimization.

[0012] 2. Low-light image enhancement algorithm

[0013] Low-light image enhancement (LLIE) technology aims to improve the visibility and interpretability of images captured in poorly illuminated environments. In recent years, this field has made significant progress, mainly due to deep learning-based solutions. These solutions involve a variety of learning strategies, network structures, loss functions, and training data.

[0014] Traditional low-light enhancement methods include methods based on histogram equalization (such as the research of H. Ibrahim et al., 2007) and methods based on the Retinex model (such as the research of X. Guo et al., 2017; X. Ren et al., 2020; M. Li et al., 2018). Among them, methods based on the Retinex model have received more attention. Such methods usually decompose low-light images into reflective components and illumination components through prior knowledge or regularization, and use the estimated reflective component as the enhancement result.

[0015] However, in recent years, deep learning-based LLIE methods have achieved remarkable results. Compared with traditional methods, deep learning-based solutions have shown significant advantages in accuracy, robustness, and speed. The learning strategies used in these solutions are rich and diverse, including supervised learning (SL), reinforcement learning (RL), unsupervised learning (UL), zero-shot learning (ZSL), and semi-supervised learning (SSL). For example, the GSAD research team proposed a diffusion-based framework to solve the problem of low-light image enhancement, which improved the performance of low-light enhancement from the perspective of regularized ODE trajectories. Compared with the most advanced methods, the algorithm has achieved significant improvements in image quality, noise suppression, and contrast amplification. Summary of the invention

[0016] In view of the challenges such as dim light and uneven illumination, pedestrian images captured by night cameras are difficult to distinguish between pedestrians and backgrounds, and insufficient information interaction between output feature maps. The present invention proposes a nighttime pedestrian detection method, which aims to accurately detect pedestrian targets in nighttime scenes and effectively solve the technical defects of existing algorithms in nighttime scenes while ensuring detection speed. By adopting a bidirectional feature pyramid structure, the present invention can fully extract and fuse multi-scale feature information, enhance information interaction between feature maps, and thus achieve efficient and accurate detection of pedestrians at night.

[0017] The present invention discloses a method for detecting pedestrians at night, comprising the following steps:

[0018] Step S1, obtaining a nighttime pedestrian detection data set;

[0019] Step S2, performing a lighting enhancement operation preprocessing on the image data in the nighttime pedestrian detection dataset based on a low-light image enhancement algorithm;

[0020] Step S3, replacing the neck network of the original YOLOv8 network with a bidirectional feature pyramid network consisting of multiple BiFPN modules for bidirectional feature fusion, a conv module for feature extraction, and a c2f module for upper and lower feature integration, to build a YOLOv8-ours network suitable for pedestrian detection;

[0021] Step S4, inputting the image data preprocessed in step S2 into the YOLOv8-ours network for training to obtain optimal weight data;

[0022] Step S5, loading the optimal weight data into the YOLOv8-ours network, and detecting the input image data to be detected.

[0023] In a preferred embodiment, the YOLOv8-ours network includes:

[0024] The backbone network is built based on the original YOLOv8 backbone network and is used to extract features of different scales of image data, including the starting layer, feature extraction layer 1, feature extraction layer 2, feature extraction layer 3, and feature extraction layer 4 connected in sequence;

[0025] The neck network includes a bidirectional feature pyramid network composed of multiple BiFPN modules, conv modules and c2f modules, which is used to fuse the outputs of feature extraction layer 2, feature extraction layer 3 and feature extraction layer 4 to obtain feature maps of three different scales;

[0026] The head network is built based on the original YOLOv8 head network and is used to detect feature maps of three different scales.

[0027] In a preferred embodiment, step S4 comprises:

[0028] Step S401, setting training parameters, wherein the training parameters include learning rate momentum, initial learning rate, number of iterations and weight decay coefficient;

[0029] Step S402, inputting the image data preprocessed in step S2 into the YOLOv8-ours network built in step S3;

[0030] Step S403, using the stochastic gradient optimization algorithm to train the YOLOv8-ours network, adjusting the learning rate and the number of iterations according to the average accuracy change and the loss change trend, until the accuracy change and the loss change are in a stable state, and determining the final learning rate and the number of iterations;

[0031] Step S404, based on the learning rate and number of iterations determined in step S403, complete the training of the YOLOv8-ours network to obtain the optimal weight data.

[0032] In a preferred embodiment, step S1 comprises:

[0033] Step S101, obtaining the NightOwls data set;

[0034] Step S102, based on the NightOwls data set, the image data is deleted, and a portion of the remaining image data is randomly selected as the original data set;

[0035] Step S103, based on the data enhancement method, performing a data enhancement operation on the original data set of step S102 to obtain a nighttime pedestrian detection data set;

[0036] Step S104, dividing the nighttime pedestrian detection data set into a training set and a validation set.

[0037] In a preferred embodiment, step S102 includes:

[0038] The image data without pedestrian annotations are deleted, and one-third of the remaining image data are randomly selected as the original data set. The targets of the original data set are divided into four categories: pedestrians, cyclists, motorcyclists and ignored. The ignored ones include posters, sculptures and people who are difficult to distinguish in a group.

[0039] In a preferred embodiment, the data enhancement method in step S103 includes one or more of a mosaic data enhancement method, an image flipping method, an image rotation method, an image cropping method, an image adding salt and pepper noise method, or a color transformation method.

[0040] In a preferred embodiment, the low-light image enhancement algorithm in step S2 includes a global structure-aware diffusion process algorithm, a zero-reference depth curve estimation algorithm, or an unsupervised generative adversarial network algorithm.

[0041] A preferred embodiment further includes step S6, performing performance evaluation on the trained YOLOv8-ours network by using the average missed detection rate, specifically including:

[0042] Step S601, performing illumination enhancement operation preprocessing on the image data in the nighttime pedestrian detection dataset based on different low-light image enhancement algorithms;

[0043] Step S602, inputting the image data preprocessed in step S601 into the YOLOv8-ours network for training to obtain corresponding weight data;

[0044] Step S603, loading the corresponding weight data into the YOLOv8-ours network, detecting the input image data to be detected, and calculating the average missed detection rate;

[0045] Step S604, selecting a low-light image enhancement algorithm with the lowest missed detection rate based on the average missed detection rate.

[0046] The present invention also provides a computer device and an apparatus, comprising a memory and a processor, wherein the memory stores a computer program, the computer program is configured to be executed by the processor, and the computer program includes instructions for executing any of the above methods.

[0047] The present invention also provides a storage medium, including a computer program / instruction, which implements any one of the above-mentioned nighttime pedestrian detection methods when executed by a processor.

[0048] The present invention discloses a nighttime pedestrian detection method and storage medium based on a bidirectional feature pyramid, which has the following beneficial effects compared with the prior art:

[0049] (1) Based on the low-light image enhancement algorithm, the image data in the nighttime pedestrian detection dataset was preprocessed and the illumination enhancement operation was performed to make the pedestrian features more prominent, thereby reducing the miss rate (MR), which helps to improve the accuracy and stability of detection. The preprocessed image data is less sensitive to environmental factors such as illumination changes and shadow interference, thereby enhancing robustness.

[0050] (2) Based on the deep learning target detection model YOLOv8 network, the neck network is replaced with a bidirectional feature pyramid network consisting of multiple BiFPN modules for bidirectional feature fusion, conv modules for feature extraction, and c2f modules for upper and lower feature integration. The BiFPN module achieves efficient information flow and fusion between features of different scales by establishing top-down and bottom-up bidirectional connections. This bidirectional transmission mechanism allows the model to more comprehensively integrate high-level and low-level features, thereby improving the accuracy of target detection. The BiFPN module introduces learnable weights to determine the importance of different input features, which enables the model to pay more attention to features with more information during the feature fusion process, further improving the effect of feature fusion. The optimized YOLOv8-ours network not only improves the detection accuracy, but also optimizes the complexity and computational efficiency of the model to a certain extent, making the model more suitable for actual pedestrian target detection tasks. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 This is a technical implementation flow chart of Embodiment 1 of a nighttime pedestrian detection method of the present invention;

[0052] Figure 2 The network structure of the YoloV8-ours algorithm of Embodiment 1 of a nighttime pedestrian detection method of the present invention;

[0053] Figure 3 The network structure of the GSAD algorithm of Embodiment 1 of a nighttime pedestrian detection method of the present invention;

[0054] Figure 4 This is a structural schematic diagram of the YoloV8-ours algorithm head network structure and the Bottlenect module of Example 1 of a nighttime pedestrian detection method of the present invention. DETAILED DESCRIPTION

[0055] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0056] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0057] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The term "or / and" used herein includes any and all combinations of one or more related listed items.

[0058] In addition, in the present invention, the descriptions of "first", "second", etc. are only used for descriptive purposes, and do not specifically refer to the order or sequence, nor are they used to limit the present invention. They are only used to distinguish components or operations described with the same technical terms, and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.

[0059] Embodiment 1

[0060] A nighttime pedestrian detection method of this embodiment, such as Figure 1 As shown, it includes the following steps:

[0061] Step S1, obtaining a nighttime pedestrian detection data set;

[0062] Specifically, the following method is used to implement it:

[0063] Step S101, obtaining the NightOwls data set;

[0064] The NightOwls dataset is a comprehensive public nighttime pedestrian detection dataset consisting of 279,000 frames from 40 sequences recorded by industry-standard cameras at night in 3 countries, including different seasons and weather conditions.

[0065] Step S102, based on the NightOwls data set, the image data is deleted, and part of the image data is randomly selected from the remaining image data as the original data set;

[0066] In the NightOwls dataset, since there are fewer pedestrians at night, the number of frames without pedestrians at night is much higher than that during the day. In order to reduce these invalid images, all images without pedestrian annotations are first deleted. Then one-third of the data is randomly selected from the remaining image data as the original dataset. The targets of the original dataset are divided into four categories: pedestrians, cyclists, motorcyclists, and ignored (posters, sculptures, and people who are difficult to distinguish in a group). It should be pointed out that the present invention only analyzes the effect of pedestrian detection.

[0067] Step S103, based on the data enhancement method, performing a data enhancement operation on the original data set of step S102 to obtain a nighttime pedestrian detection data set;

[0068] The data enhancement method includes one or a combination of a Mosaic data enhancement method, an image flipping method, an image rotation method, an image cropping method, an image salt and pepper noise method, or a color transformation method. In this embodiment, the Mosaic data enhancement method is used to combine 4 pictures in a batch to obtain a picture with richer information for detection.

[0069] Step S104, dividing the nighttime pedestrian detection data set into a training set and a validation set.

[0070] In this embodiment, the training set includes 12142 image data, and the validation set includes 3163 image data.

[0071] Step S2, performing a lighting enhancement operation preprocessing on the image data in the nighttime pedestrian detection data set of step S1 based on a low-light image enhancement algorithm;

[0072] The low-light image enhancement algorithms include the global structure-aware diffusion process algorithm (GSAD algorithm), the zero-reference depth curve estimation algorithm (ZERO-DCE algorithm) and the unsupervised generative adversarial network algorithm (EnligtenGAN algorithm).

[0073] Step S3, replacing the neck network of the original YOLOv8 network with a bidirectional feature pyramid network consisting of multiple BiFPN modules for bidirectional feature fusion, a conv module for feature extraction, and a c2f module for upper and lower feature integration, to build a YOLOv8-ours network suitable for pedestrian detection;

[0074] Specifically, Figure 2 As shown, this is achieved using the following method:

[0075] The backbone network is built based on the backbone network of the original YOLOv8 and is used to extract features of different scales of image data, including the stem layer, feature extraction layer 1, feature extraction layer 2, feature extraction layer 3, and feature extraction layer 4.

[0076] The starting layer (Stem Layer), including layer 0, is set as a conv module;

[0077] The feature extraction layer 1 (Stem Layer 1) includes the first layer and the second layer connected in sequence, the first layer is set as a conv module connected to the output end of the starting layer (Stem Layer), and the second layer is set as a c2f module connected to the conv module;

[0078] The feature extraction layer 2 (Stem Layer 2) includes the third layer and the fourth layer connected in sequence, the third layer is set as a conv module connected to the output end of the feature extraction layer 1 (Stem Layer 1), and the fourth layer is set as a c2f module connected to the conv module;

[0079] The feature extraction layer 3 (Stem Layer 3) includes the 5th layer and the 6th layer connected in sequence, the 5th layer is set as a conv module connected to the output end of the feature extraction layer 2 (Stem Layer 2), and the 5th layer is set as a c2f module connected to the conv module;

[0080] Feature extraction layer 4 (Stem Layer 4) includes the 7th layer, the 8th layer and the 9th layer connected in sequence, the 7th layer is set as a conv module connected to the output end of feature extraction layer 3 (Stem Layer3), the 8th layer is set as a c2f module connected to the conv module, and the 9th layer is set as an SPPF module connected to the c2f module.

[0081] In this embodiment, the conv module, c2f module and SPPF module all use the existing technology of the YOLOv8 network, which will not be repeated here. The input image data is 640*640*3. After the feature extraction of the backbone network, the feature extraction layer 2 (StemLayer 2) outputs a 80*80*256 feature map, the feature extraction layer 3 (Stem Layer 3) outputs a 40*40*512 feature map, and the feature extraction layer 4 (Stem Layer 4) outputs a 20*20*1024 feature map.

[0082] The neck network includes a bidirectional feature pyramid network composed of multiple BiFPN modules, conv modules and c2f modules, which is used to fuse the outputs of feature extraction layer 2, feature extraction layer 3 and feature extraction layer 4 to obtain feature maps of three different scales;

[0083] In this embodiment, the output ends of feature extraction layer 2 (Stem Layer 2), feature extraction layer 3 (Stem Layer 3), and feature extraction layer 4 (Stem Layer 4) are respectively connected to the 10th layer conv module, the 11th layer conv module, and the 12th layer conv module.

[0084] Preferably, the parameters of the 10th layer conv module, the 11th layer conv module and the 12th layer conv module are set to ch_out=256, kernel=1, stride=1, padding=0. The sizes of the obtained feature maps are 80*80*256, 40*40*256 and 20*20*256 respectively.

[0085] The output end of the 12th layer is connected to the 13th layer, and the 13th layer is set as an upsampling module (Upsample module). The Upsample module is a prior art and will not be described here. In this embodiment, the sampling multiple of the upsampling module is set to 2, and the adjacent interpolation sampling algorithm is used to output a 40*40*256 feature map.

[0086] The outputs of the 13th and 11th layers are connected to the 14th layer, which is set as a BiFPN module. The BiFPN module performs weighted summation according to the weights learned from the feature map to obtain an integrated new feature map output with a size of 40*40*256. The output of the 14th layer is connected to the 15th layer, which is set as a c2f module. The c2f module of the 15th layer is set with 3 Bottleneck modules connected in sequence, such as Figure 4 As shown in the figure, the shortcut in the Bottleneck module is set to false. The output channel of the c2f module in the 15th layer is set to 256, and the output is a 40*40*256 feature map.

[0087] The output end of the 15th layer is connected to the 16th layer. The 16th layer is set as an upsampling module (Upsample module). The sampling multiple of the upsampling module is set to 2. The neighboring interpolation sampling algorithm is used, and the output is a 80*80*256 feature map.

[0088] The output ends of the 16th and 10th layers are connected to the 17th layer. The 17th layer is set as a BiFPN module. The BiFPN module performs weighted summation according to the weights learned from the feature map to obtain an integrated new feature map output with a size of 80*80*256.

[0089] The output of the 17th layer is connected to the 18th layer, which is set as a c2f module with an output of 80*80*256. The output of the 18th layer is connected to the 19th layer, which is set as a conv module with parameters of ch_out=256, kernel=3, stride=2, padding=1, and the size of the feature map is 40*40*256.

[0090] The output ends of the 10th, 18th, and 19th layers are connected to the 20th layer. The 20th layer is set as a BiFPN module. The BiFPN module performs weighted summation according to the weights learned from the feature map to obtain an integrated new feature map output with a size of 80*80*256.

[0091] The output of the 20th layer is connected to the 21st and 22nd layers in sequence. The 21st layer is set as a c2f module, the output channel of the c2f module is set to 256, and the output feature map size is 80*80*256. The 22nd layer is set as a conv module, and the parameters of the conv module are set to ch_out=256, kemel=3, stride=2, and padding=1. The size of the feature map obtained is 40*40*256.

[0092] The output ends of the 22nd, 11th, and 15th layers are connected to the 23rd layer, and the 23rd layer is set as a BiFPN module, correspondingly obtaining a feature map of size 40*40*256.

[0093] The output of the 23rd layer is connected to the 24th and 25th layers in sequence. The 24th layer is set as a c2f module, the output channel of the c2f module is set to 512, and the output feature map size is 40*40*512. The 25th layer is set as a conv module, and the parameters of the conv module are set to ch_out=256, kernel=3, stride=2, and padding=1. The feature map size of the 25th layer output is 20*20*256.

[0094] The outputs of the 25th and 12th layers are connected to the 26th layer, which is set as the BiFPN module. The BiFPN module performs weighted summation according to the weights learned from the feature map to obtain an integrated new feature map output with a size of 20*20*256. The output of the 26th layer is connected to the 27th layer, which is set as the c2f module. The output channel of the c2f module is set to 1024, and the output feature map size is 20*20*1024.

[0095] The head network is built based on the original YOLOv8 head network and is used to detect feature maps of three different scales.

[0096] like Figure 4 As shown, the Head network adopts a decoupled head structure to separate the classification and detection heads, and also changes from Anchor-Based to Anchor-Free. The outputs of the 21st, 24th, and 27th layers 80*80*256, 40*40*512, and 20*20*1024 are respectively sent to three detection heads for detection. During detection, the positive and negative sample allocation strategy adopts a dynamic distribution strategy, that is, the weights are dynamically adjusted according to the progress of training and the characteristics of the samples. The matching strategy of TaskAlignedAssigner can be simply summarized as: select positive samples based on the weighted scores of classification and regression. The core formula of TAL is as follows:

[0097] t=s α +u β

[0098] Among them, s and u are classification scores and IoU values, respectively, and α and β are weight hyperparameters (in this example, α=0.5 and β=6.0). Through training, t can achieve task alignment by optimizing both classification scores and IoU at the same time, and describe the prediction quality of anchors with the weighted product of classification quality and regression quality, which can guide the network to dynamically focus on high-quality anchor prediction boxes.

[0099] In this embodiment, the loss function includes classification and regression branches, and the classification branch adopts a binary cross entropy loss function (BCEWithLogitsLoss) combined with a Sigmoid function.

[0100]

[0101] is the Sigmoid function, log is the natural logarithm. pi represents the probability that sample xi is predicted as a positive example, y i Represents sample x i The true label of , in the binary classification problem, y i Usually 0 or 1, p(yi) is the probability that the output belongs to the label, and N represents the number of groups of objects predicted by the model.

[0102] The regression branch includes the Distribution Focal Loss and the Complete Intersection-over-Union Loss (CIoU Loss).

[0103] Distribution Focal Loss(S i , S i+1 )=-((y i +1-y)log(S i )+(yy i)log(S i+1 ))

[0104] y = the distance from the center to a certain edge / the current downsampling multiple, rounded to get the predicted value y i , the near-predicted value y i +1.

[0105]

[0106] Among them, d is the distance between the center point of the predicted box and the real box, and c is the diagonal distance of the minimum enclosing rectangle. γ is a correction factor used to further adjust the loss function to take into account the shape and orientation of the target box. The specific calculation method is: (w G ,h G ), (w p ,h p ) are the width and height of the target box and the predicted box respectively.

[0107] CIoU Loss = 1-CIoU

[0108] The ratio of classification loss, distribution focus loss and complete intersection-over-union loss is 0.5:1.5:7.5.

[0109] Step S4, inputting the image data preprocessed in step S2 into the YOLOv8-ours network for training to obtain the optimal weight data;

[0110] Specifically, the following method is used to implement it:

[0111] Step S401, set the training parameters, the learning rate momentum is set to 0.937, the initial learning rate and the final learning rate are both set to 0.01, the number of iterations is set to 300, the weight decay coefficient is set to 0.0005, close_mosaic is set to 10, and the mosaic data enhancement method is disabled in each epoch in the last 10 training cycles. Mask_ratio: 4 means that the mask is downsampled by 4 times; iou: 0.7 means that only when the intersection of two boxes is greater than 0.7, they are considered to overlap.

[0112] Step S402, inputting the image data preprocessed in step S2 into the YOLOv8-ours network built in step S3;

[0113] Step S403 uses the stochastic gradient optimization algorithm (SGD algorithm) to train the YOLOv8-ours network, adjusts the learning rate and the number of iterations according to the average accuracy change and the loss change trend, until the accuracy change and the loss change are in a stable state, and determines the final learning rate and the number of iterations;

[0114] Step S404 completes the training of the YOLOv8-ours network based on the learning rate and number of iterations determined in step S403 to obtain the optimal weight data.

[0115] Step S5, loading the optimal weight data into YOLOv8-ours, and detecting the input image data to be detected.

[0116] This embodiment also includes step S6, which performs a performance evaluation on the trained YOLOv8-ours network by using the average missed detection rate, specifically including:

[0117] Step S601, performing illumination enhancement operation preprocessing on the image data in the nighttime pedestrian detection dataset based on different low-light image enhancement algorithms;

[0118] Step S602, inputting the image data preprocessed in step S601 into the YOLOv8-ours network for training to obtain corresponding weight data;

[0119] Step S603, loading the corresponding weight data into the YOLOv8-ours network, detecting the input image data to be detected, and calculating the average missed detection rate;

[0120] Step S604, selecting a low-light image enhancement algorithm with the lowest missed detection rate based on the average missed detection rate.

[0121] The average missed detection rate is used as the evaluation index, which is obtained by -2 , 100] is calculated by the average missing rate of false positive per image (FPPI) points uniformly sampled within [ , ] (denoted as MR). The smaller the value of MR, the better the performance of the pedestrian detector.

[0122] The present invention uses the global structure-aware diffusion process algorithm (GSAD algorithm), the zero-reference depth curve estimation algorithm (ZERO-DCE algorithm) and the unsupervised generative adversarial network algorithm (EnligtenGAN algorithm) to preprocess pedestrian images at night. The low-light enhanced images in the yolov8-ours network with the global structure-aware diffusion process algorithm (GSAD algorithm) have a nearly two-point drop in MR missed detection rate compared to the baseline.

[0123] In this embodiment, a global structure-aware diffusion process algorithm (GSAD algorithm) is used to preprocess the nighttime pedestrian detection data set in step S2.

[0124] like Figure 3 As shown, the GSAD algorithm consists of the following parts:

[0125] 1. Learning low-curvature trajectories via global structure-aware regularization

[0126] Cultivating a diffusion process that can adeptly capture such global structures is crucial for the success of low-light image reconstruction. By integrating matrix rank-based regularization into a diffusion-based framework, GSAD cleverly exploits the intrinsic structure of image data, thus facilitating the preservation of subtle details and contrast enhancement.

[0127] First, construct a learnable closed form X t-1 sample.

[0128] (a) Constructing learnable closed samples

[0129]

[0130] Training starts with a closed-form sample Xt at any time step t using a learnable function To estimate the potential noise ∈. Throughout the training phase, regularization is strategically applied to the learnable samples X t-1 , rather than the closed form sample X t .

[0131] (b) Matrix rank modeling based on non-local blocks

[0132]

[0133] In order to regularize X t-1 and X0, applying the same aggregation to the learnable samples X t-1 , and regularized. represents the regularization function, is a matrix The output of the singular value decomposition, diag(·), returns the vector of the main diagonal of the matrix.

[0134] (c) Gradually injecting structure-aware regularization

[0135] This sensible approach not only preserves the heterogeneity of the reconstructed samples, but also optimizes the noise suppression process. Specifically, the modified regularization function can be written as:

[0136]

[0137] where k t represents the regularization term The adaptive factor.

[0138] 2. Regularization with uncertainty guidance

[0139] Uncertainty-guided regularization is introduced in the diffusion process to further improve the recovery learning in challenging areas. These strategic integrations ensure accurate and resilient recovery of image details in low-light areas while adapting to scene-specific illumination changes. An additional convolutional branch is introduced after the last layer of the U-Net of the diffusion model to generate an uncertainty map that optimizes the following objectives:

[0140]

[0141] in Represents the pixel-by-pixel uncertainty map, i.e., P t ∈E H×W×3 ,∈ θ (·) represents the corresponding function with the weight of the denoising diffusion model. After completing the pre-training phase of the uncertainty estimation model, we obtain and ∈ θ^ ,fixed The uncertainty map P is generated by t This map acts as a flexible weight that calibrates the importance of each pixel so that pixels with higher uncertainty are assigned greater weight.

[0142] The algorithm designs a progressively adaptive regularization scheme. It ensures a nuanced and gradual injection of structure-aware regularization, thereby preserving the inherent structural integrity of the reconstructed sample. It has made outstanding progress in the field of low-light image enhancement, effectively suppressing artifacts and revealing image details while brightening.

[0143] Embodiment 2

[0144] This embodiment also provides a computer device or apparatus, including a memory and a processor, wherein the memory stores a computer program, the computer program is configured to be executed by the processor, and the computer program includes instructions for executing any one of the above methods.

[0145] This embodiment also provides a storage medium, including a computer program / instruction, which, when executed by a processor, implements any of the above-mentioned methods for detecting pedestrians at night.

[0146] In short, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for detecting pedestrians at night. It is characterized in that The following steps are included: Step S1, obtaining a nighttime pedestrian detection data set; Step S2, performing a lighting enhancement operation preprocessing on the image data in the nighttime pedestrian detection dataset based on a low-light image enhancement algorithm; Step S3, replacing the neck network of the original YOLOv8 network with a bidirectional feature pyramid network consisting of multiple BiFPN modules for bidirectional feature fusion, a conv module for feature extraction, and a c2f module for upper and lower feature integration, to build a YOLOv8-ours network suitable for pedestrian detection; Step S4, inputting the image data preprocessed in step S2 into the YOLOv8-ours network for training to obtain optimal weight data; Step S5, loading the optimal weight data into the YOLOv8-ours network, and detecting the input image data to be detected.

2. A method for detecting pedestrians at night according to claim 1, It is characterized in that The YOLOv8-ours network includes: The backbone network is built based on the original YOLOv8 backbone network and is used to extract features of different scales of image data, including the starting layer, feature extraction layer 1, feature extraction layer 2, feature extraction layer 3, and feature extraction layer 4 connected in sequence; The neck network includes a bidirectional feature pyramid network composed of multiple BiFPN modules, conv modules and c2f modules, which is used to fuse the outputs of feature extraction layer 2, feature extraction layer 3 and feature extraction layer 4 to obtain feature maps of three different scales; The head network is built based on the original YOLOv8 head network and is used to detect feature maps of three different scales.

3. A method for detecting pedestrians at night according to any one of claims 1-2, It is characterized in that Step S4 includes: Step S401, setting training parameters, wherein the training parameters include learning rate momentum, initial learning rate, number of iterations and weight decay coefficient; Step S402, inputting the image data preprocessed in step S2 into the YOLOv8-ours network built in step S3; Step S403, using the stochastic gradient optimization algorithm to train the YOLOv8-ours network, adjusting the learning rate and the number of iterations according to the average accuracy change and the loss change trend, until the accuracy change and the loss change are in a stable state, and determining the final learning rate and the number of iterations; Step S404, based on the learning rate and number of iterations determined in step S403, complete the training of the YOLOv8-ours network to obtain the optimal weight data.

4. A method for detecting pedestrians at night according to claim 1, It is characterized in that Step S1 includes: Step S101, obtaining the NightOwls data set; Step S102, based on the NightOwls data set, the image data is deleted, and a portion of the remaining image data is randomly selected as the original data set; Step S103, based on the data enhancement method, performing a data enhancement operation on the original data set of step S102 to obtain a nighttime pedestrian detection data set; Step S104, dividing the nighttime pedestrian detection data set into a training set and a validation set.

5. A method for detecting pedestrians at night according to claim 4, Features: Step S102 includes: The image data without pedestrian annotations are deleted, and one-third of the remaining image data are randomly selected as the original data set. The targets of the original data set are divided into four categories: pedestrians, cyclists, motorcyclists and ignored. The ignored ones include posters, sculptures and people who are difficult to distinguish in a group.

6. A method for detecting pedestrians at night according to claim 5, Features: The data enhancement method in step S103 includes one or more of a mosaic data enhancement method, an image flipping method, an image rotation method, an image cropping method, an image adding salt and pepper noise method, or a color transformation method.

7. A method for detecting pedestrians at night according to any one of claims 1-2 or 5-6, Features: The low-light image enhancement algorithm in step S2 includes a global structure-aware diffusion process algorithm, a zero-reference depth curve estimation algorithm, or an unsupervised generative adversarial network algorithm.

8. A method for detecting pedestrians at night according to claim 7, It is characterized in that The step S6 is also included, in which the performance of the trained YOLOv8-ours network is evaluated by the average missed detection rate, specifically including: Step S601, performing illumination enhancement operation preprocessing on the image data in the nighttime pedestrian detection dataset based on different low-light image enhancement algorithms; Step S602, inputting the image data preprocessed in step S601 into the YOLOv8-ours network for training to obtain corresponding weight data; Step S603, loading the corresponding weight data into the YOLOv8-ours network, detecting the input image data to be detected, and calculating the average missed detection rate; Step S604, selecting a low-light image enhancement algorithm with the lowest missed detection rate based on the average missed detection rate.

9. A computer device or apparatus, It is characterized in that The method comprises a memory and a processor, wherein the memory stores a computer program, the computer program is configured to be executed by the processor, and the computer program comprises instructions for executing the method according to any one of claims 1 to 8.

10. A storage medium comprising a computer program / instructions, It is characterized in that When the computer program / instruction is executed by a processor, a nighttime pedestrian detection method as described in any one of claims 1-8 is implemented.

Citation Information

Cited By

  • Roof dynamic monitoring method and system based on machine learning algorithm

    CN119169297A

  • Steel structure bridge corrosion detection and segmentation method and device

    CN119445109A

  • A steel structure bridge corrosion detection segmentation method and device

    CN119445109B

  • Plant growth condition monitoring method, system and equipment and storage medium

    CN119478708A

  • A plant growth status monitoring method, system, device and storage medium

    CN119478708B