An improved YOLOv5 target detection method suitable for low-light environments

By improving the YOLOv5s network and augmenting the dataset, the problem of low target detection accuracy in low-light environments was solved, achieving higher detection accuracy and robustness.

CN115512206BActive Publication Date: 2025-12-02GUILIN UNIV OF ELECTRONIC TECH

Patent Information

Application Number
CN202211278019.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-19
Publication Date
2025-12-02
Estimated Expiration
2042-10-19

AI Technical Summary

Technical Problem

Existing target detection methods have low accuracy in low-light environments and are difficult to effectively handle problems such as poor image quality, unclear target features, strong background interference, and target occlusion, resulting in high false detection and false negative rates.

Method used

The EnlightenGAN image enhancement algorithm is used to perform offline enhancement on the low-light dataset. Image enhancement is performed on the mixed training set. The YOLOv5s network structure is improved by adding a multi-branch global coordinate attention module, a composite receptive field feature enhancement module, and an adaptive feature fusion module. CIOU is used as the regression box loss function. The object detection network model is obtained by training on the mixed dataset.

Benefits of technology

It effectively improves the accuracy of target detection in low-light environments, reduces false detection and false negative rates, enhances the detection performance of small targets and occluded objects, and strengthens the robustness of the network under low-light conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115512206B_ABST
    Figure CN115512206B_ABST
Patent Text Reader

Abstract

This invention relates to the field of object detection technology, specifically to an improved YOLOv5 object detection method suitable for low-light environments. The method includes offline enhancement of the training set of a low-light dataset using an image enhancement algorithm to obtain an enhanced dataset; pairing and mixing the enhanced dataset with the original training set to obtain a mixed dataset; improving the baseline network to obtain an improved network model; training the improved network model using the mixed dataset to obtain an object detection network model; and inputting the image to be detected into the object detection network model for training to obtain the detection result. This invention, through a hybrid enhancement training method, enhances the low-light dataset using a GAN algorithm and then mixes it with the original training set, effectively suppressing the feature destruction problem caused by directly using enhancement algorithms, and solving the problem of low object detection accuracy in low-light environments in existing object detection methods.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of target detection technology, and in particular to an improved YOLOv5 target detection method suitable for low-light environments. Background Technology

[0002] Object detection, a fundamental problem in computer vision, aims to enable computers to simulate human vision, accurately and efficiently locating various objects and identifying their categories within complex backgrounds. It is now applied in fields such as intelligent transportation, industrial production, and video surveillance. However, in practical applications, the complex changes in ambient light during detection, especially in low-light conditions, often result in poor image quality due to insufficient light. These images typically exhibit low signal-to-noise ratios, reduced contrast, unclear target features, and strong background color interference. Furthermore, the large variations in target scale and severe occlusion between targets in real-world images further complicate the task. Therefore, object detection in low-light conditions demands higher capabilities in image enhancement and feature extraction to achieve more accurate detection results.

[0003] Currently, mainstream deep learning-based object detection methods are mainly divided into one-stage and two-stage algorithms. Two-stage algorithms, represented by R-CNN, Fast R-CNN, and Faster R-CNN, first generate candidate boxes, then refine the classification and location of these candidate regions. Two-stage algorithms generally have higher accuracy, but their training and detection speeds are not fast enough. One-stage algorithms, represented by SSD, the YOLO series, and FCOS, directly regress region classification and location using features obtained through convolution. Compared to two-stage detection algorithms, they typically have faster detection speeds and can be used for real-time detection. However, both one-stage and two-stage general-purpose object detection algorithms struggle to address the problem of poor image quality under low-light conditions, leading to high false positive and false negative rates. They also suffer from difficulty in extracting features from small targets and occluded objects in images. Some literature has proposed improvements, such as for nighttime infrared pedestrian detection. Some studies have improved detection performance by adding a spatial pyramid pooling module and a smaller-scale detection head to the YOLOv4 network. However, infrared images are not typical nighttime images from real-world environments, limiting the model's general applicability. Some literature uses the SSD detection network and incorporates low-light image enhancement algorithms into the feature extraction process from a feature retrieval perspective to improve accuracy. Others use the EfficientDet detection network to enhance low-resolution, low-light images through a super-resolution network before detection; however, this method is too computationally expensive. Edge-learning-based methods extract edge features from RGB channels and depth images, using small-target enhancement modules and upsampling to improve target detection in low-light images. Additionally, SSD-based methods use Retinex-based image enhancement algorithms to enhance the original image, then embed a differential feature fusion module to improve the model's extraction of complementary features; however, this ignores the noise interference introduced by directly applying the enhancement algorithm, reducing the accuracy of target detection. Summary of the Invention

[0004] The purpose of this invention is to provide an improved version of the YOLOv5 target detection method suitable for low-light environments, aiming to solve the problem that existing target detection methods have low accuracy in low-light environments.

[0005] To achieve the above objectives, this invention provides an improved YOLOv5 target detection method suitable for low-light environments, comprising the following steps:

[0006] The training set of the low-light dataset is augmented offline using image augmentation algorithms to obtain the augmented dataset.

[0007] The augmented dataset and the original training set are paired and blended to obtain a hybrid dataset.

[0008] An improved network model is obtained by improving the baseline network.

[0009] The improved network model is trained using the hybrid dataset to obtain an object detection network model;

[0010] The image to be detected is input into the target detection network model for training, and the detection result is obtained.

[0011] The image augmentation algorithm is EnlightenGAN.

[0012] The reference network is the YOLOv5s network.

[0013] The improvements to the YOLOv5s network include:

[0014] Add a multi-branch global coordinate attention module to the C3 module of the last three layers of the YOLOv5s network backbone;

[0015] A composite receptive field feature enhancement module is added before the two C3 modules of the neck network of the YOLOv5s network, and dilated convolutions are introduced;

[0016] An adaptive feature fusion module is added between the neck FPN network and the detection head;

[0017] The YOLOv5s network head uses CIOU as the regression box loss function.

[0018] The step of training the improved network model using the hybrid dataset to obtain the object detection network model includes:

[0019] The hybrid dataset is divided into a training set, a validation set, and a test set in a 6:2:2 ratio.

[0020] The improved network model is trained using the training set to obtain a pre-trained model;

[0021] The pre-trained model is validated using the validation set. If the validation is successful, the object detection network is obtained.

[0022] The step of training the improved network model using the hybrid dataset to obtain the object detection network model further includes:

[0023] The target detection network was tested using the test set, and the test results were obtained.

[0024] The test results were validated using evaluation metrics.

[0025] The evaluation metrics include accuracy, recall, mAP0.5, and mAP0.5:0.95.

[0026] This invention is an improved YOLOv5 object detection method suitable for low-light environments. It uses an image enhancement algorithm to offline enhance the training set of a low-light dataset, obtaining an enhanced dataset. The enhanced dataset and the original training set are then paired and mixed to obtain a hybrid dataset. The baseline network is improved to obtain an improved network model. This improved network model is trained using the hybrid dataset to obtain an object detection network model. The image to be detected is input into the object detection network model for training, yielding the detection result. This invention, through a hybrid enhancement training method, enhances the low-light dataset using the EnlightenGAN algorithm and then mixes it with the original training set, effectively suppressing the feature destruction problem caused by directly using enhancement algorithms. This solves the problem of low object detection accuracy in low-light environments found in existing object detection methods. Attached Figure Description

[0027] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0028] Figure 1 It is a network structure diagram of an improved network model.

[0029] Figure 2 This is the structure diagram of the MCA attention module.

[0030] Figure 3 This is the structure diagram of the C3_MCA module.

[0031] Figure 4 It is the RFAM feature enhancement module.

[0032] Figure 5 This is a schematic diagram of the dilation rate and receptive field of dilated convolution.

[0033] Figure 6 This is the ASFF module structure design diagram.

[0034] Figure 7 This is a schematic diagram showing the original image and the enhancement results of the three algorithms.

[0035] Figure 8 This is a comparison chart of the actual effects of three training methods.

[0036] Figure 9This is a comparison of heatmaps before and after adding the MCA module.

[0037] Figure 10 This is a comparison chart before and after adding the RFAM module.

[0038] Figure 11 This is a visual comparison of mainstream object detection algorithms.

[0039] Figure 12 This is a flowchart of an improved YOLOv5 target detection method suitable for low-light environments, provided by the present invention. Detailed Implementation

[0040] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.

[0041] Please see Figures 1 to 12 This invention provides an improved YOLOv5 target detection method suitable for low-light environments, comprising the following steps:

[0042] S1 uses an image enhancement algorithm to perform offline enhancement on the training set of the low-light dataset, resulting in an enhanced dataset;

[0043] Specifically, the image augmentation algorithm is EnlightenGAN.

[0044] Regarding the training strategy for input images, the EnlightenGAN image enhancement algorithm, based on Generative Adversarial Network (GAN), was used to perform offline enhancement on the training set of the ExDark (Exclusively Dark) dataset.

[0045] S2 uses the augmented dataset and the original training set to perform paired mixing to obtain a mixed dataset;

[0046] Specifically, the augmented dataset and the original training set are paired and mixed to reduce noise interference to the network from the dataset directly using the augmentation algorithm, and this mixed augmented dataset is used as the input to the network.

[0047] S3 improves the baseline network to obtain an improved network model;

[0048] Specifically, the reference network is the YOLOv5s network.

[0049] The improvements to the YOLOv5s network include:

[0050] S31 adds a multi-branch global coordinate attention module to the C3 module of the last three layers of the YOLOv5s network backbone;

[0051] Multi-branch Global Coordinate Attention Module (MCA):

[0052] Attention mechanisms are essentially weighting mechanisms that assign weights to raw information based on the importance of the target, thereby highlighting important parts and effectively capturing contextual information. This paper proposes a multi-branch global coordinate attention (MCA) mechanism based on coordinate attention (CA).

[0053] like Figure 3 As shown, the MCA module first performs one-dimensional adaptive average pooling on the input feature map x along both the horizontal and vertical dimensions to extract important feature information in the two spatial directions, thereby generating two perceptual feature maps z in different directions. h and z w The sizes are H×1×C and 1×W×C, respectively. This transformation allows the attention module to establish long-term dependencies along one spatial direction and preserve precise positional information along the other spatial direction. The outputs of the two dimensions are then concatenated, and a 1×1 convolution is used to reduce its dimension to C / r, where r is the downsampling ratio of the channels. After feature transformation using a BN layer and a non-linear activation function, an intermediate feature map f∈R is obtained, f incorporating both horizontal and vertical spatial information. (C / r)×1×(H+W) Next, the feature map f is convolved with 1×1 kernels according to the original H and W dimensions to restore the number of channels of the feature map. Finally, it is passed through the sigmoid activation function to obtain the attention weights g of the feature map in the H and W dimensions. h and g w On the other hand, to compensate for the potential loss of salient region information in the feature map by CA, this paper introduces Global Max Pooling Downsampling (GMP) to obtain a feature map z. m The feature map is initially 1×1×C, then undergoes a 1×1 convolution to reduce the number of channels to the original C / r. Next, a batch normalization (BN) layer and a non-linear activation layer are used to prevent gradient vanishing. Finally, another 1×1 convolution restores the feature map to its original channel count. The attention weights g of the feature map are then obtained using the sigmoid activation function. m Finally, the attention weights of the two branches are multiplied and weighted onto the original feature map to obtain a new feature map y with attention weights.

[0054] like Figure 3As shown, this paper adds the MCA module to the C3 module of the backbone, which enhances the compactness of the network without destroying the original residual structure of C3. This paper chooses to add the MCA module after the output of the CBS module of C3 to form the C3_MCA module, which further enhances the backbone network's ability to capture location information and global saliency information when facing low-light image feature extraction.

[0055] S32 adds a composite receptive field feature enhancement module before the two C3 modules of the neck network of the YOLOv5s network and introduces dilated convolution;

[0056] Composite Receptive Field Feature Enhancement Module (RFAM):

[0057] The FPN structure in YOLOv5s uses a top-down and lateral connection approach to help higher layers fuse information from lower layers, thereby enhancing the detection capability of small objects. However, under low-light conditions, the information fusion capability between layers is weak, and the detection of occluded objects and objects with extreme scales is difficult to improve directly through the FPN network. Therefore, this paper borrows the multi-branch structure of dilated convolution and Inception, as well as the depthwise separable convolution module, to design the RFAM structure to enhance the feature fusion capability of the FPN network's neck. Introducing it into the neck structure improves its detection performance for dense objects and occluded objects under low-light conditions.

[0058] like Figure 4 As shown, the RFAM module uses three 3×3 convolution branches with different dilation rates r of {1, 2, 3}. According to the theory of dilated convolution, this can be equivalent to the receptive fields of a 3×3 convolution, a 7×7 convolution kernel, and a 9×9 convolution. Figure 5 As shown, this allows for improvement of the receptive field without downsampling. Each branch of the dilated convolution contains a residual structure, with 1×1 pointwise convolutions added before and after to halve the number of channels before restoring them, reducing the number of parameters while preventing gradient explosion and vanishing. To further reduce the computational and parameter count, the original 3×3 dilated convolution is replaced with a depthwise separable convolution module (DWConv), and then, borrowing from the Inception asymmetric convolution operation, it is split into 3×1 and 1×3 depthwise separable dilated convolutions. Finally, the outputs of the three branches are concatenated, and then passed through a BN layer and a SiLu activation function to obtain the final output, improving nonlinearity. By adding a feature enhancement module at the neck of the FPN, channels from different receptive fields are fused together, improving the accuracy of identifying occluded and dense objects under low-light conditions.

[0059] S33 adds an adaptive feature fusion module between the neck FPN network and the detection head;

[0060] Adaptive Feature Fusion Module (ASFF):

[0061] The original neck structure of YOLOv5s was FPN+PAN, which used feature maps {Level3, Level2, Level1} downsampled by 8, 16, and 32 times after semantic fusion of high and low layers as the output of the neck network. However, inconsistencies between different feature scales can lead to increased noise in the fused feature maps. For example, when a large target is detected at a high level, a small target may be treated as background at a high level, even though targets are actually present in these areas. To address this, this paper introduces an ASFF module, or Adaptive Spatial Feature Fusion Module, in the middle of PANET and the detection head. ASFF learns spatial filtering conflict information to suppress consistency, achieving adaptive fusion between different feature layers with almost no inference overhead. The basic idea of ​​ASFF is to incorporate an attention weight mechanism, fusing information from each layer with different weights, effectively improving the network's ability to detect objects at different scales and reducing the false negative rate.

[0062] The overall structure of ASFF is as follows: Figure 6 As shown, Equation (1) illustrates the feature fusion formula for ASFF. This represents the feature vector at position (i,j) after resizing the features from Level n to Level l. The output represents the spatial importance weights of the feature maps at three different levels. That is, ASFF-l in the diagram, which ultimately serves as the input to the header.

[0063]

[0064] Taking ASFF-1 as an example, firstly, the {H, W, C} of the three feature maps need to be unified according to the transformation rules. Upsampling is then applied to Level 2 and Level 3 layers, and the size and channels of the remaining two layers are adjusted to be the same as Level 1, resulting in... Then, the resized Level 1, Level 2, and Level 3 features are concatenated and then subjected to a 1×1 convolution to obtain the corresponding weight parameters. The weight parameters are then concatenated and normalized using Softmax so that their range is mapped to [0,1] and their sum is 1, as shown in equation (2), where equation (3) is... formula.

[0065]

[0066]

[0067] After obtaining the features of the three feature layers and the three weight parameters, ASFF will process the features of these three layers. Multiply by the weight parameters respectively By summing the results, we can obtain the new fusion ASFF-1, i.e., equation (4). The same applies to ASFF-2 and ASFF-3.

[0068]

[0069] The YOLOv5s network described in S34 uses CIOU as the regression box loss function in its head. Finally, it outputs the classification category and regression box parameters on three feature layers with different feature sizes of 20×20, 40×40 and 80×80 respectively. During prediction, non-maximum suppression (NMS) is used to filter the regression boxes to obtain the detection results.

[0070] Loss function:

[0071] The loss function of YOLOv5s consists of a weighted sum of classification loss, object confidence loss, and location loss. Both the classification loss and object confidence loss use binary cross-entropy (BCE). The location loss employs a series of Intersection over Union (IOU) loss functions, from IOU to GIOU to CIOU, each offering an improvement over the previous one. However, the DIOU loss function struggles to distinguish the positions of two bounding boxes when the IOU value and the distance between their center points are equal. Therefore, the authors of CIOU believe that the three important factors for prediction are overlap area, center point distance, and aspect ratio. They further enhance the accuracy of the prediction by adding the aspect ratio as a geometric element to the DIOU function, as shown in the formula below:

[0072]

[0073]

[0074]

[0075] Equation (5) shows the formula for the CIOU loss function, where ρ represents b and b'. gtThe Euclidean distance between the predicted and ground truth boxes is given by equations (6) and (7). Equation (7) shows that the loss function tends to optimize in the direction of increasing overlap, especially when the IOU is 0. Since the default localization loss for YOLOv5 is GIOU, this section compares the default GIOU loss function and the CIOU loss function for YOLOv5 on the ExDark dataset. Table 1 shows the experimental results of the comparison. CIOU has a higher average accuracy than the default GIOU. Therefore, this paper selects CIOU as the default localization loss for YOLOv5 in subsequent experiments.

[0076] Table 1 Performance Comparison of GIOU and CIOU

[0077]

[0078] S4 uses the hybrid dataset to train the improved network model to obtain the object detection network model;

[0079] The specific method is as follows:

[0080] S41 divides the hybrid dataset into a training set, a validation set, and a test set in a 6:2:2 ratio;

[0081] Specifically, to better demonstrate the performance of the improved object detection algorithm in low-light environments, this paper uses the ExDark dataset as the base dataset. This dataset is specifically designed for low-brightness targets and was captured in low-light environments. It contains 7363 low-light images, divided into 10 different illumination conditions and 12 categories. The lighting environments are natural and diverse, exhibiting good generalization and versatility. This paper divides the dataset in a 6:2:2 ratio, resulting in a training set of 4417 images, a validation set of 1473 images, and a test set of 1473 images.

[0082] S42 uses the training set to train the improved network model to obtain a pre-trained model;

[0083] Specifically, the hyperparameter settings were as follows: The SGD optimizer was used during training, with an initial learning rate of 0.01 and a momentum size of 0.937. The number of iterations was 180 epochs, and the batch size was 16. All input images were of a uniform size of 640×640 pixels, and the mosaic data augmentation algorithm was used. The warm-up learning epochs were set to 3. K-means clustering was used to adaptively generate prior bounding box sizes suitable for the dataset, with 3 anchors. The comparison between the generated prior bounding box sizes and the original sizes is shown in Table 2.

[0084] Table 2. Prior box sizes before and after using the K-means clustering algorithm.

[0085]

[0086] S43 uses the validation set to validate the pre-trained model. If the validation is successful, the object detection network is obtained.

[0087] S44 uses the test set to test the target detection network and obtains the test results;

[0088] S45 uses evaluation metrics to verify the test results.

[0089] Specifically, this paper uses the mean average precision (mAP) across all categories to measure the network's object detection performance, employing four evaluation metrics: precision, recall, mAP0.5, and mAP0.5:0.95. Here, mAP0.5 represents the average detection precision with an IOU threshold of 0.5, and mAP0.5:0.95 represents the average detection precision at different IOU thresholds. All evaluation metrics used in this paper are results obtained through validation on the test set.

[0090] S5 inputs the image to be detected into the target detection network model for training and obtains the detection result.

[0091] The selection and impact of image enhancement algorithms:

[0092] Due to the unique characteristics of low-light images, this paper selects three common image enhancement algorithms for performance testing: LIME, RetinexNet, and EnlightenGAN. First, offline image enhancement is performed on the training set portion of the ExDark dataset using these three algorithms. Then, the enhanced training set is used as input to the YOLOv5s benchmark network, and its mAP metric is validated. Taking a single photograph as an example... Figure 7 The original image and the enhancement results of the three algorithms are listed. Figure 7 Comparison of low-light image enhancement algorithms: (a) ExDark; (b) RetinexNet; (c) LIME; (d) EnlightenGAN

[0093] The detection results of a single image show that all enhancement algorithms improve the contrast and saturation of the original image to some extent, but they all affect the original image and introduce varying degrees of signal-to-noise ratio (SNR) issues. Taking people in the image as an example, relatively speaking, (d) uses GAN as the enhancement network, which improves brightness while reducing noise compared to the other two enhancement methods. Therefore, this paper chooses EnlightenGAN as the image enhancement algorithm for offline image enhancement. Table 3 shows the mAP values ​​of the original dataset and the dataset enhanced by the three enhancement algorithms after training on YOLOv5s. It can be seen that the mAP index of the EnlightenGAN image enhancement algorithm is the best among the three algorithms.

[0094] Table 3 Performance Comparison of Different Image Enhancement Algorithms

[0095]

[0096] However, the table above also shows that regardless of which enhancement algorithm is used directly, there is still a certain gap in accuracy compared to the model trained on the original dataset. Even the best-performing EnlightenGAN saw a 0.6% decrease in mAP0.5, with only a 0.5% improvement in mAP0.5:0.95. This indicates that directly using low-light image enhancement algorithms can easily lead to a decrease in the network's feature extraction ability due to increased noise and unnatural color changes.

[0097] To address the aforementioned issues, this paper employs a hybrid augmentation training method as the input for our experiments. The EnlightenGAN-enhanced training set is mixed with the original training set to form one-to-one matching image pairs, which serve as the input to the YOLOv5s network. This offline data augmentation method not only preserves the feature extraction capabilities of the original images but also enhances the network's feature extraction capabilities specific to low-light images. As shown in Table 4, "Mix" represents the training results using the mixed dataset obtained by matching the original training set and the GAN-enhanced training set. It can be seen that P, R, and mAP are significantly improved compared to directly using the augmentation algorithm and the original dataset. Specifically, mAP0.5 is improved by 1.5%, and mAP0.5:0.95 is improved by 1.9%, demonstrating the feasibility of this hybrid training method for object detection in low-light images. Figure 8 A comparison chart of the actual effects of the three training methods ( Figure 8 Comparison of different training strategies. (a) Exdark; (b) EnlightenGAN; (c) Mix) It can be seen that the mixed augmentation algorithm successfully identified cats under low light conditions, while the algorithm that directly used the augmentation algorithm and the original dataset as input misidentified the target as a dog.

[0098] Table 4 Performance Comparison of Different Training Strategies

[0099]

[0100] In addition, to verify the versatility of the hybrid augmentation training method, this paper also conducted verification on two versions of YOLOv5n and YOLOv5l with different network sizes. Table 5 shows that by using this method, the network performance degradation caused by directly using augmentation algorithms can be effectively avoided, and the robustness of the network can be effectively improved.

[0101] Table 5 Performance comparison of YOLOv5l and YOLOv5n before and after using hybrid training.

[0102]

[0103] Ablation experiment:

[0104] To verify the effectiveness of each module in the network, the same hyperparameters were used throughout the experiments, and the input image size was 640×640. The training set used in this section was the Mix augmentation training set used in Section 3.2. YOLOv5s was used as the baseline network for the ablation experiments. MCA, RFAM, and ASFF were used as the main algorithm modules to test the detection performance on the ExDark dataset. The experimental results are shown in Table 6.

[0105] Table 6 Comparison of ablation experimental performance of different modules

[0106]

[0107] Multi-branch Global Coordinate Attention Module (MCA):

[0108] This paper addresses the weakness in feature extraction for low-light images by adding an MCA attention module. This module enhances contextual information acquisition across channels and improves focus on salient regions. The M1 network, consisting of the YOLOv5s backbone C3 with MCA added only, shows a slight decrease in accuracy after the attention mechanism is added, but improvements in the other three metrics. Specifically, mAP0.5 improved by 2%, and mAP0.5:0.95 improved by 2.3%. This is primarily due to MCA's cross-channel context acquisition and focus on salient regions, which enabled the network to detect targets that were previously more easily overlooked, significantly improving both recall and mean precision. Figure 9The heatmap visually demonstrates the comparison between the MCA attention mechanism and the baseline. It shows that, due to the addition of the attention mechanism, the two chairs in the distance were also detected by MCA through cross-channel capture, and there were no false positives for the animal in the middle, which clearly demonstrates the effectiveness of the module.

[0109] Composite Receptive Field Feature Enhancement Module (RFAM):

[0110] This paper improves the feature capture capability for targets of different sizes by adding a composite receptive field feature enhancement module (RFAM) to the network neck, and also alleviates the high false detection rate for dense small objects and occluded objects. M2, the network with only the RFAM module added, shows a slight decrease in recall but a significant improvement in accuracy, increasing by 1.9% compared to the baseline, and mAP0.5 by 1.4%. Table 7 shows that the RFAM module improves the mAP0.5 values ​​for dense targets and easily occluded objects in the scene. For example, the mAP0.5 for "Bus" increases from 0.881 to 0.901, "Bottle" from 0.709 to 0.720, and "Cup" from 0.688 to 0.708, demonstrating the improved detection performance of dense and occluded objects at night through composite receptive field channel mixing. Figure 10 It can also be seen that the M2 network successfully identified the car that was obscured on the left.

[0111] Table 7 shows the mAP0.5 performance of various categories before and after adding the RFAM module.

[0112] Category Bicycle Boat Bottle Bus Car Cat Baseline 0.844 0.647 0.709 0.881 0.792 0.678 M2 0.841 0.629 0.720 0.907 0.804 0.709 Category Chair Cup Dog Motorbike People Table Baseline 0.645 0.688 0.709 0.759 0.753 0.596 M2 0.641 0.708 0.743 0.768 0.779 0.613

[0113] Adaptive Feature Fusion Module (ASFF):

[0114] This paper improves the network's detection performance for targets of different scales under low-light conditions by adding the Adaptive Feature Fusion (ASFF) module. M3 represents the network with only ASFF added. While there is an improvement, it's not significant; mAP0.5 only increases by 0.4%. This is mainly because without attention mechanisms or feature enhancement modules, the network's feature extraction capability under low-light conditions is inherently limited, and even adaptive feature fusion doesn't yield noticeable results. Therefore, combining ASFF with MCA improves the accuracy to 80.6%, the highest in this experiment, and mAP0.5 is also improved by 2.4% compared to adding ASFF alone. On the other hand, combining ASFF with RFAM improves mAP0.5 by 1.7%, demonstrating the complementary capabilities of ASFF with the other two modules in this paper.

[0115] Ultimately, this paper combines the three modules to form the final network model, enhancing the complementary capabilities of the modules. Compared to the baseline, all four metrics are improved, with recall, mAP0.5, and mAP0.5:0.95 being the highest in this experiment. Specifically, mAP0.5 and mAP0.5:0.95 are improved by 4.3% and 6% respectively, demonstrating the effectiveness of the modules.

[0116] Performance comparison of mainstream detection algorithms:

[0117] To verify the advantages of our improved object detection method in low-light images, this section selects several mainstream object detection algorithms, including Faster-RCNN, SSD300, YOLOv3, YOLOv4, YOLOv4-tiny, YOLOX, and the original YOLOv5s, for comparison with our improved algorithm. The comparison dataset uses the original ExDark dataset, with an input size of 640×640 for all algorithms.

[0118] Table 8 shows that the two-stage Faster-RCNN performs poorly on low-light datasets, while YOLOv4-tiny, with only two detector heads, suffers from a high number of missed detections, resulting in the lowest recall and consequently the lowest average precision. Among the remaining algorithms, SSD, YOLOv3, and YOLOv4 perform similarly. YOLOX is the best performing algorithm compared to the original YOLOv5s model, achieving the highest precision of 81.1% and a higher mAP than the original YOLOv5s model. Our improved algorithm, using a GAN hybrid augmentation method, achieves an mAP of 76.8% for 0.5 and 50% for mAP 0.5:0.95. These represent improvements of 5.6% and 7.9% respectively compared to the original YOLOv5. Specifically, the accuracy improvement compared to YOLOX, the best performing algorithm among the comparison algorithms, is 3.7% and 5.2% respectively.

[0119] Table 8 Performance comparison of mainstream object detection algorithms on the ExDark dataset

[0120]

[0121] To more intuitively demonstrate the monitoring performance, this section selects five low-light images from different scenarios, including images of multi-scale targets, dense targets with multiple occlusions, and images with indistinct feature imaging. Figure 11The table shows a visual comparison of the algorithms, with the last row displaying the output of the improved algorithm proposed in this paper, and the rest being the comparison algorithms listed in Table 8. It can be seen that Faster-RCNN has a high false positive rate in the two cat images, mistaking a shelf for a person or a railway track for a table. SSD300 failed to recognize the person on the right side of the second image. YOLOv3 and YOLOv4 are similar, exhibiting both false positives and false negatives for images with colors similar to the background and for black cats. YOLOv4-tiny has poor sensitivity to multi-scale targets, failing to detect a bus in the third image. YOLOX performs relatively well, but misidentifies a guitar as a motorcycle in the first image and a cat as a dog in the fifth image. In comparison, the algorithm presented in this paper reduces the false detection rate, and due to the multi-scale fusion effect of the feature enhancement module, it also performs well in detecting occluded objects and objects at extreme scales. In the first image, the number of people in the back row was increased. In the second image, people and boats in the middle were successfully detected. In the third image, people in the bus and cars behind the bus that were occluded were detected. In the fourth and fifth images, there were no missed detections or false detections, which demonstrates the effectiveness of the algorithm presented in low-light image detection tasks under various conditions.

[0122] The above-disclosed embodiments are merely preferred embodiments of the improved YOLOv5 target detection method applicable to low-light environments, and should not be construed as limiting the scope of the invention. Those skilled in the art will understand that implementing all or part of the above embodiments and making equivalent changes in accordance with the claims of the invention are still within the scope of the invention.

Claims

1. An improved YOLOv5 target detection method suitable for low-light environments, characterized in that, Includes the following steps: The training set of the low-light dataset is augmented offline using an image augmentation algorithm to obtain an augmented dataset, wherein the image augmentation algorithm is EnlightenGAN; The augmented dataset and the original training set are paired and blended to obtain a hybrid dataset. An improved network model is obtained by improving the baseline network, wherein the baseline network is the YOLOv5s network. The improvement of the YOLOv5s network includes: adding a multi-branch global coordinate attention module to the C3 module of the last three layers of the YOLOv5s network backbone; adding a composite receptive field feature enhancement module (RFAM) before the two C3 modules of the neck network of the YOLOv5s network, and introducing dilated convolution. The composite receptive field feature enhancement module RFAM uses three 3×3 convolution branches with different dilation rates r of {1, 2, 3}, which, according to the theory of dilated convolution, are equivalent to the receptive fields of 3×3 convolution, 7×7 convolution kernel, and 9×9 convolution. This improves the receptive field without downsampling. The branches of the dilated convolution all contain residual structures. A 1×1 pointwise convolution is added before and after each branch to halve the number of channels before restoring them, reducing the number of parameters while preventing gradient explosion and vanishing. To further reduce the computational and parameter count, the original 3×3 dilated convolution is replaced with a depthwise separable convolution module (DWConv). Then, borrowing from the Inception asymmetric convolution operation, it is split into 3×1 and 1×3 depthwise separable dilated convolutions. Finally, the outputs of the three branches are concatenated, and then passed through a BN layer and a SiLu activation function to obtain the final output, improving nonlinearity. An adaptive feature fusion module is added between the neck FPN network and the detection head. The YOLOv5s network head uses CIOU as the bounding box loss function. Training the improved network model using the hybrid dataset to obtain an object detection network model includes: dividing the hybrid dataset into a training set, a validation set, and a test set in a 6:2:2 ratio; training the improved network model using the training set to obtain a pre-trained model; validating the pre-trained model using the validation set, and obtaining an object detection network upon successful validation; testing the object detection network using the test set to obtain test results; and validating the test results using evaluation metrics, wherein the evaluation metrics include accuracy, recall, mAP0.5, and mAP0.5:0.

95. The image to be detected is input into the target detection network model for training, and the detection result is obtained.

Citation Information

Patent Citations

  • Human body detection method in low-illumination environment based on image enhancement, electronic equipment and storage medium

    CN114708615A

Cited By

  • Moving object three-dimensional model reconstruction system and method based on cooperation of multiple unmanned aerial vehicles

    CN121414977A

  • Multi-uav cooperation-based moving object three-dimensional model reconstruction system and method

    CN121414977B