Night garbage detection method based on improved YOLOv9

By building a night spam dataset and introducing an AB-YOLOv9 network with adaptive PairLIE module, the accuracy and robustness of night spam detection in complex environments are solved, and high-precision garbage target recognition is achieved.

CN120451490APending Publication Date: 2025-08-08GUILIN UNIVERSITY OF TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510485911.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-17
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

The existing night garbage detection methods are insufficient in precision and robustness in complex scenarios, especially in insufficient lighting, shadows and complex backgrounds, and it is difficult to effectively identify garbage.

Method used

The night spam data set is constructed and the object detection method is optimized. The improved adaptive PairLIE module is introduced to denoising, decomposing and lighting correction of the images, generating multi-level enhanced images, and combining with the AB-YOLOv9 network for training and detection.

Benefits of technology

It improves the accuracy and robustness of night waste detection, effectively reduces the impact of light changes, shadows and reflection interference on target recognition, and ensures efficient detection in low-light environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120451490A_ABST
    Figure CN120451490A_ABST
Patent Text Reader

Abstract

The invention discloses a night garbage detection method based on improved YOLOv9. Comprising the following steps: step 1, acquiring a night junk data set which covers different night scenes such as urban streets, campus areas and cities and towns; 2, configuring a model training environment; step 3, an AB-YOLOv9 network model is constructed, the AB-YOLOv9 network model takes a YOLOv9 network as a basic network, the YOLOv9 network comprises a backbone network, a neck network and a head network, and an improved adaptive PairLIE module is introduced into the network; step 4, loading the constructed AB-YOLOv9 model into a configured training environment, and optimizing a parameter configuration file to adapt to experiment requirements; 5, to-be-detected junk image data serve as input, the AB-YOLOv9 network model which completes training is input for detection, and model output comprises the category and position bounding box of junk targets. According to the method, high-precision detection of garbage in a complex environment at night is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision technology, image processing, deep learning, and target detection and recognition technologies, and to a nighttime garbage detection method based on an improved YOLOv9. Background Art

[0002] With the acceleration of urbanization, the problem of urban waste is becoming increasingly prominent. Long-term accumulation of waste not only seriously pollutes the air, soil, and water, but also provides a breeding ground for bacteria, viruses, and pests, posing a significant threat to human health. Once pollutants enter the human body, they can cause a variety of health problems, including respiratory, skin, and digestive diseases. These problems are particularly severe in vulnerable populations, such as children and the elderly. Timely and effective waste management not only significantly reduces the risk of environmental pollution and disease transmission, but also promotes efficient waste sorting and resource recycling, providing a crucial guarantee for the sustainable development of ecosystems. Against this backdrop, waste detection technology has emerged. By accurately identifying the type, location, and quantity of waste, modern waste detection technology plays a vital role in improving waste sorting and processing efficiency. Traditional waste detection methods primarily rely on skilled operators and various sensor devices, such as inductive, capacitive, and weight sensors. While these methods have improved efficiency and reduced labor intensity to some extent, they still suffer from time-consuming and error-prone processes, especially in complex scenarios.

[0003] In recent years, with the rapid development of artificial intelligence and machine learning technologies, automated garbage detection algorithms have become a research hotspot and have achieved remarkable results in daytime scenarios. Deep learning-based object detection algorithms, in particular, have shown great potential. The YOLO (You Only Look Once) model family, with its real-time performance and high accuracy, has become a benchmark technology in the field of garbage detection. The YOLO model achieves object detection and classification with a single forward pass, significantly improving detection speed and efficiency. However, these algorithms are primarily designed for daytime environments with ample illumination, and their performance often degrades significantly in the complex nighttime scenes. Nighttime garbage detection faces unique challenges, including image quality degradation due to insufficient illumination, shadows, blurred object boundaries, and complex backgrounds. These issues are particularly pronounced in environments such as roads, green belts, or garbage dumps at night, limiting the accuracy and robustness of existing detection methods. Therefore, developing a highly accurate and robust nighttime garbage detection technology that can effectively address these challenges in nighttime environments is crucial for advancing nighttime garbage management technologies. Summary of the Invention

[0004] To address the challenges of existing technologies, the present invention aims to provide a nighttime garbage detection method based on an improved YOLOv9, aiming to address the current technical issues of insufficient adaptability and weak generalization in nighttime garbage detection. By designing and constructing a nighttime garbage dataset and optimizing the target detection method, high-precision garbage detection in nighttime environments is achieved. The method includes the following steps:

[0005] Step 1: Construct a nighttime garbage dataset. This dataset covers various nighttime scenes in urban streets, campuses, and towns. During data collection, we fully consider illumination variations, shadow interference, light source deviation, strong reflections, and complex nighttime conditions. We carefully annotate all garbage image data to ensure that each object has an accurate bounding box and classification label.

[0006] Step 2: Configure the model training environment;

[0007] Step 3: Build an AB-YOLOv9 network model with improved adaptive brightness. The AB-YOLOv9 network model uses the YOLOv9 network as the basic network. The YOLOv9 network includes a backbone network, a neck network, and a head network. An improved adaptive PairLIE module is introduced into the network.

[0008] Step 4: Load the constructed AB-YOLOv9 model into the configured training environment, optimize the parameter configuration file to adapt to the experimental requirements, and use the NWD dataset to train and optimize the model performance;

[0009] Step 5: The garbage image data to be detected is used as input to the trained AB-YOLOv9 network model for detection. The model output includes the category and location bounding box of the garbage target.

[0010] Preferably, in step 2, the configured training environment is: deep learning framework PyTorch 1.11, Intel core i9-13900KF CPU, 64GB 6000MHz Corsair RAM, and GPU is NVIDIA GeForce RTX 4090.

[0011] Preferably, in step 1, a fixed camera is used to collect garbage images at night.

[0012] Preferably, in step 1, the target categories include bottles, papers, garbage bags, cigarette butts, hazardous materials and cartons, which are coded as 0, 1, 2, 3, 4 and 5 respectively.

[0013] Preferably, in step 3, it is assumed that the input image consists of N×M pixels, where the brightness value of each pixel is I(x,y), the mean of the image brightness is represented by B, and the root mean square value of the brightness relative to the mean is C. The corresponding expression is:

[0014]

[0015]

[0016] In the process of generating enhanced images, different levels of enhanced images are obtained through the brightness mean B and brightness fluctuation C of different images.

[0017] Preferably, in step 4, 70% of the collected images are added to the training set, 10% of the images are added to the validation set, and 20% of the images are added to the test set; each image in the test set is sequentially input into the improved YOLOv9 model obtained in step 3 to obtain the detection results of each target category in each image.

[0018] The present invention has the following characteristics and beneficial effects:

[0019] This paper introduces an improved adaptive PairLIE module into the YOLOv9 network. By decomposing the input image into reflectance and illumination components, the illumination component is corrected and a multi-level enhanced image is generated, effectively distinguishing the inherent characteristics of the target from the influence of the external lighting environment. This method reduces the impact of illumination changes, shadow occlusion, and reflection interference on target recognition. By integrating information from multiple illumination enhancement perspectives, the model overcomes the problem of detail loss that can occur with a single exposure, further improving the accuracy of target detection in low-light environments and garbage detection at night. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 This is a flow chart of a nighttime garbage detection method based on improved YOLOv9 in the present invention;

[0021] Figure 2 for Figure 1 Schematic diagram of the PairLIE module structure;

[0022] Figure 3 for Figure 1 Middle module structure diagram;

[0023] Figure 4 for Figure 2 Final detection results of garbage targets;

[0024] Figure 5 Comparison chart between YOLOv9 and AB-YOLOv9 at mAP@0.5 and mAP@0.5:0.95;

[0025] Figure 6 A comparison chart of the image enhancement effect and detection effect of a target category in the present invention;

[0026] Figure 7 This is a comparison chart of the image enhancement effect and detection effect of another target category in the present invention;

[0027] Figure 8 This is a dynamic change diagram of key parameters during AB-YOLOv9 training. DETAILED DESCRIPTION

[0028] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.

[0029] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, features defined as "first", "second", etc. may explicitly or implicitly include one or more of the features. In the description of the present invention, unless otherwise specified, "multiple" means two or more.

[0030] like Figure 1-8 As shown, the present invention provides a nighttime garbage detection method based on improved YOLOv9, comprising the following steps:

[0031] Step 1: Construct a nighttime garbage dataset. This dataset contains over 6,000 images, with object categories including bottles, paper, garbage bags, cigarette butts, hazardous materials, and cardboard boxes. The dataset covers various nighttime scenes, including city streets, campuses, and towns. The data collection process fully considers complex nighttime conditions such as lighting changes, shadow interference, and reflections to ensure data diversity and representativeness. All garbage images are manually annotated to ensure that each object has an accurate bounding box and classification label.

[0032] Step 2: Configure the model training environment.

[0033] After the dataset is preprocessed, the next step is to build a configuration file for the dataset. This configuration file should contain the paths to the training and validation sets, as well as information about each category in the dataset. Next, modify the YOLOv9 yolov9.yaml file and adjust the network structure configuration based on the experimental requirements. Specifically, the deep learning framework used is PyTorch 1.11, and the hardware configuration is an Intel Core i9-13900KF CPU, 64GB 6000MHz Corsair RAM, and an NVIDIA GeForce RTX 4090 GPU. The training setting for this model is 300 epochs, with a batch size of 8, an initial learning rate of 0.01, and 6 target detection categories.

[0034] Step 3. Construct the AB-YOLOv9 network model. The AB-YOLOv9 network model uses the YOLOv9 network as the basic network. The YOLOv9 network includes a backbone network, a neck network, and a head network. An improved adaptive PairLIE module is introduced into the network to obtain enhanced images at different levels. This module takes the original image I as input, first denoises the image, and then decomposes the denoised image S into a reflective component R and an illumination component L. Among them, the reflective component R represents the inherent characteristics of the object, while the illumination component L describes the impact of the external lighting environment on the image. This processing process can more accurately express the visual characteristics of the image and effectively improve the feature extraction capability under complex lighting conditions. The mathematical expression of its decomposition process is as follows:

[0035]

[0036] In the above technical solution, Denotes element-wise multiplication. By analyzing the brightness and contrast characteristics of the original image, the illumination component L is corrected to generate a reasonable illumination component L. Specifically, the illumination component L is then optimized using an enhancement function and multiplied pixel by pixel with the reflectance component R to generate the enhanced image S′. Next, based on the corrected illumination component, a conditional generation method is used to generate multiple images with different illumination enhancement levels, thereby compensating for information loss in low-light environments.

[0037] This processing enables more accurate capture of image visual features, effectively improving feature extraction capabilities under complex nighttime lighting conditions. The three detection branches in the original YOLOv9 head network are replaced with an enhanced image detection head. The head network is responsible for object classification and bounding box regression, and further processes the feature maps transmitted by the neck network, ultimately outputting target object category and location predictions.

[0038] Step 4: Load the constructed AB-YOLOv9 model into the configured training environment and use the nightly garbage dataset to train and optimize the model.

[0039] During the training process, this embodiment uses 70% of the collected and annotated images for the training set, 10% for the validation set, and 20% for the test set. In a pre-configured deep learning environment, the improved AB-YOLOv9 network model is imported, and the parameter configuration file in the network model is adjusted according to the actual environment requirements. Subsequently, the model is trained using the processed dataset, with the training rounds set to 300 rounds, and 8 images are input per round. The learning rate is 0.01, the weight decay coefficient is 0.0005, and the momentum coefficient is 0.937. The learning rate is dynamically adjusted during the training process, and the cosine annealing learning rate decay strategy is used to improve training stability and efficiency. In the intermediate stage of training, the validation set is used to evaluate the model performance, and the hyperparameters are adjusted based on the verification results.

[0040] After training is complete, the model weights are saved for use in the subsequent inference phase. Next, all images in the test set are fed into the modified YOLOv9 model for inference. The model processes each image, identifies each object category, and generates a corresponding bounding box and its classification prediction for each object. This process outputs the location, category, and confidence score of each object in each image. By analyzing these images, we can assess whether the experimental results meet our expectations.

[0041] Step 5: The garbage image data to be detected is fed into the trained AB-YOLOv9 network model for detection. The model output includes the category and location bounding box of the garbage object. Model Testing and Performance Evaluation: The trained AB-YOLOv9 model is evaluated using the test set. The model is tested for each of the six garbage categories (bottles, paper, garbage bags, cigarette butts, hazardous materials, and cartons) to analyze its adaptability and robustness in complex nighttime environments.

[0042] In this architecture, the original image input is first passed into the model and processed by the improved adaptive PairLIE module, which includes denoising, image decomposition, illumination enhancement, element-level multiplication, and dynamic adjustment techniques. The image is enhanced to three levels of different exposure (I1, I2, I3). Next, the original image and the enhanced images I1, I2, and I3 are input into the backbone network of YOLOv9, which uses its powerful feature extraction capabilities to extract key features. The neck network then further processes these features for feature conversion and fusion. The prediction head of AB-YOLOv9 replaces the three branch detection heads of the original YOLOv9 with the enhanced image detection head, and inputs the feature vectors of I1, I2, I3 and the original image input into the enhanced image detection head and the original image detection head respectively, and finally outputs the predicted bounding box and target category, and uses the bounding box to visually mark the detected target.

[0043] In this architecture, taking the nighttime garbage detection in real scenes as an example, first, garbage images (such as Figure 2 The original image in the image is usually low in contrast, blurred in details and high in noise due to uneven ambient lighting, noise interference and shadow occlusion, which limits the effectiveness of direct target detection. To solve these problems, the original image is first input into the improved adaptive PairLIE module for preprocessing. Specifically, the PairLIE module will Figure 2 The original image in the image is denoised to reduce the impact of environmental noise and obtain clearer image information (such as Figure 2 Subsequently, the image decomposition module decomposes the image into reflection component and illumination component, and performs adaptive correction on the illumination component to generate three enhanced images (I1, I2, I3) with different exposure levels (e.g. Figure 2 Assume that the input image consists of N×M pixels, where the brightness value of each pixel is I(x,y), the mean brightness of the image is represented by B, and the root mean square value of the brightness relative to the mean is C. The corresponding expression is:

[0044]

[0045] In the process of generating enhanced images, different levels of enhanced images are obtained by measuring the brightness mean B and brightness fluctuation C of different images. This process converts low-light images into more recognizable images. Next, the original image and the enhanced I1, I2, and I3 are input into the backbone network of YOLOv9. The convolution module and RepNCSpelan4 module in the backbone network perform deep feature extraction on the input images (including the original image and the enhanced image), respectively. Among them, the convolution module focuses on extracting structural information and edge features, while RepNCSpelan4 uses an improved CSP structure to enhance feature learning capabilities and improve feature reuse rate. Then, after further processing by the YOLOv9 neck network, the splicing and upsampling modules in the neck network effectively fuse features at different levels, improve the spatial resolution of the target through upsampling, and enrich the feature expression by combining the splicing operation, thereby enhancing the model's ability to capture target details. The SPPELAN module further optimizes the feature pyramid structure and enhances the expression capability of multi-scale features. Finally, in the AB-YOLOv9 prediction stage, the three branch detection heads of the original YOLOv9 are replaced with enhanced image detection heads, which process the feature vectors of I1, I2, I3 and the original image input respectively. In this way, the model can integrate information from multiple illumination enhancement perspectives, avoid the loss of target details that may be caused by a single exposure, and thus improve the accuracy and stability of garbage target detection. Finally, the prediction head outputs the target category and bounding box information, and uses the bounding box to visually mark the detected garbage targets in the detection results (such as Figure 4 This method allows the model to accurately identify garbage targets even in complex and changing low-light environments, ensuring the efficiency and stability of nighttime garbage detection and significantly improving detection accuracy and adaptability.

[0046] in, Figure 5 The graphs of AB-YOLOv9 and YOLOv9 at mAP@0.5 and mAP@0.5:0.95 are shown. Figure 5 In (a), the orange curve represents the mAP@0.5 curve of AB-YOLOv9, and the blue curve represents the mAP@0.5 curve of YOLOv9. As can be seen from the figure, with the increase in epochs, the curves tend to stabilize between 150 and 300, indicating that the model has converged. The proposed AB-YOLOv9 model outperforms the baseline model YOLOv9 in both mAP@0.5 and mAP@0.5:0.95.

[0047] in, Figure 6 and Figure 7 The left side shows the initial image and the original detector's recognition effect on the garbage in the image, and the right side shows the effect after image enhancement. AB-YOLOv9 successfully recognizes the garbage in the image. Figure 2It can be seen that the adaptive PairLIE module can effectively adjust image exposure, restore details in the image, and reduce lighting interference, thereby more comprehensively capturing the characteristics of garbage and improving the accuracy of target detection.

[0048] in, Figure 8 This article demonstrates the dynamic evolution of key parameters during AB-YOLOv9 training. During training, bounding box loss (box_loss), object confidence loss (obj_loss), and classification loss (cls_loss) all decreased significantly, while precision and recall increased significantly. This demonstrates the model's continued optimization and performance improvement in both object localization and classification tasks.

[0049] The above are only embodiments of the present invention, and common knowledge such as the specific structure and / or characteristics of the scheme are not described in detail here. It should be pointed out that for those skilled in the art, without departing from the structure of the present invention, several variations and improvements can be made, which should also be regarded as the scope of protection of the present invention, and these will not affect the effect of the implementation of the present invention and the practicality of the patent. The scope of protection required by this application shall be based on the content of its claims, and the specific implementation methods and other records in the specification can be used to interpret the content of the claims.

Claims

1. A nighttime garbage detection method based on improved YOLOv9, characterized in that: The following steps are involved: Step 1: Construct a nighttime garbage dataset. This dataset covers various nighttime scenes in urban streets, campuses, and towns. During data collection, we fully consider illumination variations, shadow interference, light source deviation, strong reflections, and complex nighttime conditions. We carefully annotate all garbage image data to ensure that each object has an accurate bounding box and classification label. Step 2: Configure the model training environment; Step 3: Build an AB-YOLOv9 network model with improved adaptive brightness. The AB-YOLOv9 network model uses the YOLOv9 network as the basic network. The YOLOv9 network includes a backbone network, a neck network, and a head network. An improved adaptive PairLIE module is introduced into the network. Step 4: Load the constructed AB-YOLOv9 model into the configured training environment, optimize the parameter configuration file to adapt to the experimental requirements, and use the NWD dataset to train and optimize the model performance; Step 5: The garbage image data to be detected is used as input to the trained AB-YOLOv9 network model for detection. The model output includes the category and location bounding box of the garbage target.

2. The nighttime garbage detection method based on improved YOLOv9 according to claim 1 is characterized in that: In step 2, the training environment configured is: deep learning framework PyTorch 1.11, Intel core i9-13900KF CPU, 64GB 6000MHz Corsair RAM, and GPU NVIDIA GeForce RTX 4090.

3. The nighttime garbage detection method based on improved YOLOv9 according to claim 1 is characterized in that: Step 1: Use a fixed camera to collect garbage images at night.

4. The nighttime garbage detection method based on improved YOLOv9 according to claim 1 is characterized in that: In step 1, the target categories include bottles, papers, garbage bags, cigarette butts, hazardous materials, and cartons, which are coded as 0, 1, 2, 3, 4, and 5, respectively.

5. The nighttime garbage detection method based on improved YOLOv9 according to claim 1 is characterized in that: In step 3, assume that the input image consists of N×M pixels, where the brightness value of each pixel is I(x,y), the mean brightness of the image is represented by B, and the root mean square value of the brightness relative to the mean is C. The corresponding expression is: In the process of generating enhanced images, different levels of enhanced images are obtained through the brightness mean B and brightness fluctuation C of different images.

6. The nighttime garbage detection method based on improved YOLOv9 according to claim 1, characterized in that: In step 4, 70% of the collected images are added to the training set, 10% of the images are added to the validation set, and 20% of the images are added to the test set; each image in the test set is input into the improved YOLOv9 model obtained in step 3 in turn to obtain the detection results of each target category in each image.