A night road litter detection method, system, electronic device and storage medium
By constructing a detection model based on knowledge distillation and reflectivity learning, and combining it with a lightweight LeYOLO network, the problems of accuracy and real-time performance in detecting road debris under low-light conditions at night were solved, achieving efficient debris detection.
Patent Information
- Application Number
- CN202411714577.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2044-11-27
AI Technical Summary
Existing technologies struggle to accurately identify road debris under low-light conditions at night. Traditional methods suffer from low detection efficiency, poor real-time performance, and susceptibility to environmental factors. Deep learning models are difficult to implement in real-time on resource-constrained devices, and their detection accuracy decreases under low-light conditions.
By combining knowledge distillation, reflectivity learning, and object detection networks, a detection model based on knowledge distillation is constructed. Image contrast and clarity are enhanced through preprocessing. A lightweight LeYOLO network and a reflectivity learning module based on Retinex theory are introduced. The teacher network is used to transfer knowledge to enhance the generalization ability of the student network.
Achieving high-precision detection of projectiles in low-light environments improves the robustness and computational efficiency of the detection model, and adapts to the resource constraints of embedded and mobile devices.
Smart Images

Figure CN119785281B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision target detection technology, specifically to a method, system, electronic device, and storage medium for detecting road debris at night. Background Technology
[0002] Debris on the road may include vehicle parts, goods, accident debris, and other miscellaneous items. These objects can pose a threat to road safety, especially at night when lighting conditions are insufficient and drivers' visibility is limited. The presence of debris on the road increases potential road safety hazards and affects nighttime driving safety.
[0003] Traditional methods for detecting litter at night mainly rely on video surveillance systems and manual patrols. These methods have significant limitations, such as low detection efficiency, poor real-time performance, and susceptibility to environmental factors. With the development of image processing technology and deep learning algorithms, computer vision-based road litter detection technology has gradually become a research hotspot. However, under low-light conditions at night, traditional image processing techniques and detection algorithms often struggle to accurately identify litter on the road.
[0004] In recent years, deep learning technology has achieved remarkable results in the field of object detection, especially the application of convolutional neural networks (CNNs). However, deep learning models typically require a large amount of labeled data for training and have high model complexity, making it difficult to achieve real-time detection on resource-constrained devices. Furthermore, insufficient lighting conditions at night and poor image quality under low-light conditions can also affect the model's detection performance, leading to a decrease in detection accuracy. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this invention provides a method, system, electronic device, and storage medium for detecting road debris at night. By combining technologies such as knowledge distillation, reflectivity learning, and target detection networks, it achieves high-precision detection of road debris under low-light conditions.
[0006] The first objective of this invention is to provide a method for detecting road debris at night, comprising the following steps:
[0007] Obtain labeled nighttime road image A;
[0008] Low-light image processing is performed on image A to obtain weak-light image B;
[0009] Contrast-limited adaptive histogram equalization is applied to images A and B to obtain enhanced nighttime road image C and enhanced low-light image D.
[0010] A detection model based on knowledge distillation is constructed, which consists of a student network and a teacher network;
[0011] Images C and D are input into the student network. The student network performs reflectance learning on images C and D and then performs target detection processing to obtain detection result A, which includes the bounding box of the projectile and the probability distribution of the projectile category.
[0012] Images C and D are input into the teacher network, which performs target detection processing on images C and D to obtain detection results B, including the bounding box of the projectile and the probability distribution of the projectile category.
[0013] The student network is trained based on detection results A and B. A comprehensive loss function is constructed, which is composed of a weighted sum of reflectivity loss, knowledge distillation loss, and target detection loss. The parameters of the student network are continuously adjusted by optimizing the comprehensive loss function. When the detection performance of the student network no longer improves or reaches the preset number of iterations, the training is stopped to obtain the trained student network.
[0014] The trained student network is used to detect litter on nighttime roads based on preprocessed images and outputs an image containing litter bounding boxes and litter category labels, where the litter category label is the litter category with the highest probability.
[0015] As a further improvement of the present invention, the student network includes a reflectivity learning module and a target detection module;
[0016] The reflectance learning module is used to perform Retinex decomposition on images C and D twice to extract and learn reflectance information in the images.
[0017] The target detection module is used to detect the projectiles in the images C, D, and the images after two Retinex decompositions, and output the detection result A, which includes the bounding box of the projectiles and the probability distribution of the projectile category.
[0018] As a further improvement of the present invention, the reflectance learning module includes a Retinex decomposition submodule and a reflectance enhancement submodule;
[0019] The Retinex decomposition submodule is used to perform initial decomposition on image C and image D respectively;
[0020] The reflectivity enhancement submodule is used to perform a secondary decomposition on the image obtained from the initial decomposition by the Retinex decomposition submodule.
[0021] As a further improvement of the present invention, the step of the reflectivity enhancement submodule performing a secondary decomposition on the image obtained by the initial decomposition by the Retinex decomposition submodule includes:
[0022] The Retinex decomposition submodule performs initial decomposition on images C and D respectively, obtaining the reflectance and illuminance of image C and image D after initial decomposition.
[0023] The reflectivity enhancement submodule swaps the reflectivity of image C and image D after the initial decomposition, and then synthesizes image C' and image D' after the reflectivity swap.
[0024] The images C' and D' are decomposed into two values respectively to obtain the reflectance and illuminance of the image C' and the image D'.
[0025] The difference between the reflectance obtained from the first decomposition and the reflectance obtained from the second decomposition is constrained to improve the consistency of image reflectance.
[0026] As a further improvement of the present invention, the target detection module uses a lightweight LeYOLO network model.
[0027] As a further improvement of the present invention, the teacher network adopts a YOLOv8 network pre-trained using road images under sufficient lighting conditions.
[0028] As a further improvement of the present invention, the formula for calculating the reflectivity loss is as follows:
[0029]
[0030] in, For reflectivity loss, Let C be the reflectance of the image after its initial decomposition. The reflectance of image D after its initial decomposition. The reflectance is the result of the second-order decomposition of image C. Let be the reflectance of the second-order decomposition of image D;
[0031] The formula for calculating the knowledge distillation loss is as follows:
[0032]
[0033] in, The loss is the knowledge distillation loss, where α is the weighting parameter. For students' network losses, For teachers' network losses;
[0034] The formula for calculating the target detection loss is as follows:
[0035]
[0036] in, For target detection loss, For classifying losses, λ is the regression loss, and λ is a weighting parameter that adjusts the weight between the classification loss and the regression loss.
[0037] The formula for calculating the comprehensive loss function is as follows:
[0038]
[0039] in, The loss function is defined as β1, β2, and β3, which are the weighting parameters for each loss term.
[0040] The second objective of this invention is to provide a nighttime road litter detection system, comprising:
[0041] The image preprocessing module is used to acquire an labeled nighttime road image A; perform low-light image processing on image A to obtain a weak-light image B; and perform contrast-limited adaptive histogram equalization on images A and B to obtain an enhanced nighttime road image C and an enhanced weak-light image D.
[0042] The detection model construction module is used to construct a detection model based on knowledge distillation, which consists of a student network and a teacher network.
[0043] The detection model training module is used to input images C and D into the student network. The student network performs reflectance training on images C and D and then performs target detection processing to obtain detection result A, which includes the bounding box of the projectile and the probability distribution of the projectile category. Images C and D are then input into the teacher network. The teacher network performs target detection processing on images C and D to obtain detection result B, which includes the bounding box of the projectile and the probability distribution of the projectile category. Based on detection results A and B, the student network is trained to construct a comprehensive loss function composed of a weighted sum of reflectance loss, knowledge distillation loss, and target detection loss. By optimizing the comprehensive loss function, the parameters of the student network are continuously adjusted. When the detection performance of the student network no longer improves or reaches the preset number of iterations, training stops to obtain the trained student network.
[0044] The litter detection module, based on a trained student network, detects litter on roads at night based on preprocessed images and outputs an image containing litter bounding boxes and litter category labels, where the litter category label is the litter category with the highest probability.
[0045] A third objective of this invention is to provide an electronic device comprising at least one processing unit and at least one storage unit, wherein the storage unit stores a computer program that, when executed by the processing unit, causes the processing unit to perform the aforementioned detection method.
[0046] A fourth objective of this invention is to provide a storage medium storing a computer program executable by an electronic device, which, when run on the electronic device, causes the electronic device to perform the aforementioned detection method.
[0047] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0048] A detection model based on knowledge distillation is constructed. The detection results of the teacher network in the detection model are transmitted to the student network through knowledge distillation, so that the student network learns the feature extraction and classification capabilities of the teacher network. This enhances the generalization ability of the student network under complex lighting conditions and improves the high-precision detection capability of the student network.
[0049] By preprocessing nighttime road images, the contrast and clarity of the images are effectively improved, and the interference of noise and shadows is reduced. This provides richer visual information for subsequent debris detection, enabling the detection model to effectively cope with complex lighting conditions in low-light environments and improving the detection capabilities of the model in low-light environments.
[0050] Based on Retinex theory, a reflectance learning method is introduced into the student network, incorporating a reflectance learning module. Combined with reflectance decomposition and enhancement techniques, this effectively improves image contrast and detail, making projectiles more clearly identifiable and significantly enhancing detection accuracy. Simultaneously, the student network employs a lightweight LeYOLO network structure, reducing computational complexity while achieving rapid projectile detection, enabling efficient projectile detection on embedded and mobile devices. Attached Figure Description
[0051] Figure 1 A flowchart for a method of detecting road debris at night;
[0052] Figure 2 A schematic diagram of the overall architecture of a nighttime road debris detection model;
[0053] Figure 3 A flowchart illustrating the process of training a student network;
[0054] Figure 4 This is a flowchart illustrating the process by which the reflectance learning module processes the preprocessed image.
[0055] Figure 5 This is a schematic diagram of a nighttime road debris detection system. Detailed Implementation
[0056] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0057] The present invention will now be described in further detail with reference to the accompanying drawings:
[0058] Please see Figure 1 This embodiment provides a method for detecting road debris at night, including the following steps:
[0059] Acquire labeled nighttime road image A; perform Dark ISP processing on image A to obtain a weak light image B that simulates more extreme low light conditions; perform contrast-limited adaptive histogram equalization (CLAHE) processing on images A and B to obtain enhanced nighttime road image C and enhanced weak light image D.
[0060] To address the challenges posed by low-light environments for detecting litter on highways at night, the aforementioned specific preprocessing is applied to the nighttime images input to the detection model to generate input data more suitable for the detection task. The goal of this preprocessing is to enhance image contrast and detail, thereby improving the model's target detection capabilities in low-light conditions.
[0061] Dark ISP adjusts the light intensity of images, enabling the generated low-light images to more realistically reflect visual features in low-light environments. This processing step provides the detection model with input under various lighting conditions, enhancing the model's lighting adaptability.
[0062] CLAHE technology significantly enhances image detail by performing local contrast enhancement, especially when the brightness difference between the projectile and the background is small, making these objects stand out more. By performing local histogram equalization on the image, it avoids the noise amplification problem that may occur with traditional global equalization, while maintaining the naturalness of the image.
[0063] Each labeled nighttime road image A, after being processed by Dark ISP and CLAHE, yields a set of enhanced images (images C and D). These images serve as input data for the detection model, providing richer visual information for subsequent feature extraction and target detection. This enables the detection model to effectively cope with complex lighting conditions in low-light environments at night, improving the model's target detection capabilities in low-light conditions.
[0064] A detection model based on knowledge distillation is constructed and named MSLAD-Net (Multi-Source LightAdaptation Detection Network). The detection model consists of a student network and a teacher network.
[0065] Images C and D are input into a student network, which includes a reflectance learning module and a target detection module. The reflectance learning module is used to perform Retinex decomposition on images C and D twice to extract and learn the reflectance information in the images. The target detection module is used to detect the projectiles in the images based on images C, D, and the images after the two Retinex decompositions, and output a detection result A containing the bounding boxes of the projectiles and the probability distribution of the projectile categories.
[0066] Images C and D are input into the teacher network, which uses a YOLOv8 network pre-trained with road images under sufficient lighting conditions. The teacher network performs high-precision target detection processing on images C and D to obtain detection results B, including the bounding box of the spilled object and the probability distribution of the spilled object category.
[0067] The student network is trained based on detection results A and B. A comprehensive loss function is constructed, which is composed of a weighted sum of reflectivity loss, knowledge distillation loss, and target detection loss. The parameters of the student network are continuously adjusted by optimizing the comprehensive loss function. When the detection performance of the student network no longer improves or reaches the preset number of iterations, the training is stopped to obtain the trained student network.
[0068] The trained student network is used to detect litter on nighttime roads based on preprocessed images and outputs an image containing litter bounding boxes and litter category labels, where the litter category label is the litter category with the highest probability.
[0069] The detection method combines knowledge distillation, reflectivity learning, and target detection networks to achieve high-precision detection of road debris under low-light conditions. The overall architecture and detection process of the MSLAD-Net detection model are as follows: Figure 2 As shown.
[0070] Specifically, in order to effectively cope with complex lighting conditions in low-light environments at night, a reflectance learning method based on Retinex theory is introduced into the student network. The reflectance learning module performs initial Retinex decomposition on images C and D to extract reflectance information from the images, and performs secondary decomposition based on the initial decomposition to further learn the changes in reflectance under different lighting conditions.
[0071] Retinex theory posits that an image can be decomposed into two components: reflectance and illuminance. The reflectance component is unaffected by changes in illumination, preserving the inherent features of the scene. This property makes reflectance learning crucial in handling illumination variations, especially in low-light conditions at night, where it can enhance the detection model's ability to identify target objects.
[0072] Specifically, the reflectance learning module includes a Retinex decomposition submodule and a reflectance enhancement submodule; the processing flow of the reflectance learning module for image C and image D is as follows: Figure 4 As shown;
[0073] The Retinex decomposition submodule decomposes the image C(I) respectively. n Image D(I) l The initial decomposition yields image C(I). n Reflectivity of the initial decomposition Illumination and image D(I l Reflectivity of the initial decomposition Illumination
[0074] The reflectivity enhancement submodule will enhance the image C(I) n Reflectivity of the initial decomposition and image D(I l Reflectivity of the initial decomposition Perform the exchange, and synthesize images C' and D' after the reflectance exchange;
[0075] For image C'(I') respectively n ) and image D'(I l The image C'(I') is obtained by performing a second decomposition. n Reflectivity of secondary decomposition Illumination and image D'(I l ') Reflectance of secondary decomposition Illumination
[0076] The difference between the reflectance obtained from the first decomposition and the reflectance obtained from the second decomposition Constraints are applied to improve the consistency of image reflectivity.
[0077] The reflectance learning module combines reflectance decomposition and reflectance enhancement techniques to effectively improve image contrast and detail, making the projectiles more clearly identifiable in the image, thereby significantly improving detection accuracy.
[0078] Furthermore, to achieve efficient target detection in resource-constrained environments, the target detection module employs a lightweight LeYOLO network model. This lightweight LeYOLO network comprises an inverted bottleneck module, a fast pyramid architecture network, an efficient backbone network, and a decoupled network head. The inverted bottleneck module forms the foundation of the efficient backbone network. Features extracted by the efficient backbone network are fused at multiple scales through the fast pyramid architecture network, and finally, the decoupled network head outputs an image containing the object's bounding box and object category label.
[0079] LeYOLO is designed to achieve real-time and efficient object detection capabilities on embedded devices and edge computing platforms by minimizing computational cost (FLOPs). LeYOLO's core design philosophy is based on lightweight convolutional operations and efficient multi-scale feature sharing to optimize computational efficiency. Its architecture incorporates an Inverted Bottleneck module and a Fast Pyramid Network (FPANet), which significantly reduce the network's computational complexity while maintaining high detection accuracy.
[0080] Inverted Bottleneck Module: Originally proposed by MobileNetV2, this module has been widely used in various lightweight networks. It reduces computation by decreasing the number of channels and using pointwise convolutions, while increasing the depth of intermediate feature maps through a scaling factor to capture more spatial information. In LeYOLO, the Inverted Bottleneck module is optimized for more efficient channel scaling, ensuring that computational requirements on large feature maps are minimized.
[0081] Fast Pyramid Architecture Network (FPANet): LeYOLO also designed a Fast Pyramid Architecture Network for efficiently sharing feature information across different semantic levels. FPANet achieves rapid sharing of multi-scale features by reducing the number of convolutional layers and channels, thereby further reducing computational overhead.
[0082] Efficient Backbone Feature Extractor: LeYOLO employs an efficient backbone network, using inverted bottleneck modules as basic building blocks. Combined with the Information Bottleneck Characteristic, it minimizes inter-layer information exchange, thereby reducing the overall computational load. The channel expansion strategy, guided by information bottleneck theory, ensures that the number of input / output channels at each level remains within a reasonable range to achieve optimal information transmission efficiency.
[0083] Decoupled Network Head (DNiN Head): LeYOLO's decoupled network head separates the classification and bounding box regression tasks, processing them separately using independent pointwise convolutions. This design not only simplifies the computation process but also further refines spatial relationships through lightweight depthwise convolutions, thereby improving detection accuracy.
[0084] In the MSLAD-Net detection model, LeYOLO, as the core component of the student network, provides a reliable foundation for the reflectivity learning and object detection modules through its efficient feature extraction capabilities. LeYOLO's miniaturized architecture ensures that the model can maintain high detection accuracy while adapting to the resource constraints of embedded devices and edge computing platforms. By incorporating LeYOLO, the MSLAD-Net detection model not only achieves robust object detection in low-light environments but also maintains excellent computational efficiency.
[0085] To improve the detection performance of the MSLAD-Net detection model in low-light environments at night, a knowledge distillation technique was introduced. This technique transfers the knowledge of the pre-trained teacher network (YOLOv8) to the student network, thereby enhancing the student network's generalization ability under complex lighting conditions.
[0086] The core idea of knowledge distillation is to utilize a high-performance and complex teacher network to provide soft labels as additional supervisory signals during the training of the student network, thereby improving the learning performance of the student network. In the design of the MSLAD-Net detection model, the teacher network uses a YOLOv8 network pre-trained on road images under sufficient lighting conditions, enabling the teacher network to generate high-precision object detection results.
[0087] During the training of the student network, it not only learns directly from the hard labels of the labeled data but also refines its feature representation capabilities by learning from the soft labels generated by the teacher network. Specifically, the detection results output by the teacher network (images with soft labels) contain more information about the target classification probability distribution, and the student network, in learning these probability distributions, is better able to capture subtle features of the target, especially in low-light environments. The training process for the student network is as follows: Figure 3 As shown.
[0088] To ensure that the detection model can perform target detection efficiently in low-light environments, a loss function that integrates reflectance learning, knowledge distillation, and multiple requirements of target detection is designed to ensure that the output of the detection model maintains high accuracy and robustness under different lighting conditions.
[0089] During training, reflectance loss is used to ensure the accuracy of reflectance learning and the consistency of image reflectance under different lighting conditions. By constraining the difference between the reflectance obtained from the initial and secondary decompositions, the detection model can better learn illumination-invariant features, thereby improving the detection accuracy of the model in low-light environments.
[0090] Reflectance loss is defined as the difference between the reflectance obtained after two decompositions of the preprocessed image, and the calculation formula is:
[0091]
[0092] in, For reflectivity loss, Let C be the reflectance of the image after its initial decomposition. The reflectance of image D after its initial decomposition. The reflectance is the result of the second-order decomposition of image C. Let be the reflectance of the second-order decomposition of image D.
[0093] During the training of the student network, the student network loss and the teacher network loss are jointly optimized. By using a weighted sum, the weights of these two losses are dynamically adjusted during training, ensuring that the student network learns knowledge from the teacher network without losing its ability to directly learn from labeled data. In the final detection stage, the student network achieves high-precision target detection under complex lighting conditions by combining the feature representation capabilities obtained from knowledge distillation with its light adaptability in low-light environments.
[0094] The formula for calculating knowledge distillation loss is:
[0095]
[0096] in, The loss is the knowledge distillation loss, where α is the weighting parameter. For students' network losses, For teachers' network losses;
[0097] The object detection loss is the core loss of MSLAD-Net, consisting of classification loss and bounding box regression loss, and is used to directly optimize the object detection results.
[0098] The formula for calculating the target detection loss is:
[0099]
[0100] in, For target detection loss, For classifying losses, λ is the regression loss, and λ is a weighting parameter that adjusts the weight between the classification loss and the regression loss.
[0101] The final integrated loss function is composed of a weighted average of reflectivity loss, knowledge distillation loss, and object detection loss, to guide the training of student networks.
[0102] The formula for calculating the comprehensive loss function is as follows:
[0103]
[0104] in, The loss function is defined as β1, β2, and β3, which are the weight parameters of each loss term. By adjusting β1, β2, and β3, the detection model can balance the influence of each loss term during training, thereby achieving optimal detection performance.
[0105] After training, the detection model outputs the target detection result, which is an image containing the bounding box of the spilled material and the category label of the spilled material. Thanks to the optimization of the comprehensive loss function, the detection model can maintain high detection accuracy and robustness under different lighting conditions, thus meeting the actual needs of nighttime highway spill detection.
[0106] Please refer to Figure 5 This embodiment provides a nighttime road litter detection system, including:
[0107] The image preprocessing module is used to acquire an labeled nighttime road image A; perform low-light image processing on image A to obtain a weak-light image B; and perform contrast-limited adaptive histogram equalization on images A and B to obtain an enhanced nighttime road image C and an enhanced weak-light image D.
[0108] The detection model construction module is used to construct a detection model based on knowledge distillation, which consists of a student network and a teacher network.
[0109] The detection model training module is used to input images C and D into the student network. The student network performs reflectance training on images C and D and then performs target detection processing to obtain detection result A, which includes the bounding box of the projectile and the probability distribution of the projectile category. Images C and D are then input into the teacher network. The teacher network performs target detection processing on images C and D to obtain detection result B, which includes the bounding box of the projectile and the probability distribution of the projectile category. Based on detection results A and B, the student network is trained to construct a comprehensive loss function composed of a weighted sum of reflectance loss, knowledge distillation loss, and target detection loss. By optimizing the comprehensive loss function, the parameters of the student network are continuously adjusted. When the detection performance of the student network no longer improves or reaches the preset number of iterations, training stops to obtain the trained student network.
[0110] The litter detection module, based on a trained student network, detects litter on roads at night based on preprocessed images and outputs an image containing litter bounding boxes and litter category labels, where the litter category label is the litter category with the highest probability.
[0111] This embodiment provides an electronic device, including at least one processing unit and at least one storage unit, wherein the storage unit stores a computer program, and when the program is executed by the processing unit, the processing unit performs the above-described detection method.
[0112] This embodiment provides a storage medium storing a computer program executable by an electronic device. When the program is run on the electronic device, it causes the electronic device to perform the above-described detection method.
[0113] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for detecting road debris at night, characterized in that, Including the following steps: Obtain labeled nighttime road image A; Low-light image processing is performed on image A to obtain weak-light image B; Contrast-limited adaptive histogram equalization is applied to images A and B to obtain enhanced nighttime road image C and enhanced low-light image D. A detection model based on knowledge distillation is constructed, which consists of a student network and a teacher network; Images C and D are input into the student network. The student network learns the reflectance of images C and D and then performs target detection processing to obtain detection result A, which includes the bounding box of the projectile and the probability distribution of the projectile category. Images C and D are input into the teacher network, which performs target detection processing on images C and D to obtain detection results B, including the bounding box of the projectile and the probability distribution of the projectile category. The student network is trained based on detection results A and B. A comprehensive loss function is constructed, which is composed of a weighted sum of reflectivity loss, knowledge distillation loss, and target detection loss. The parameters of the student network are continuously adjusted by optimizing the comprehensive loss function. When the detection performance of the student network no longer improves or reaches the preset number of iterations, the training is stopped to obtain the trained student network. The trained student network is used to detect litter on nighttime roads based on preprocessed images and outputs an image containing litter bounding boxes and litter category labels, where the litter category label is the litter category with the highest probability. The student network includes a reflectivity learning module and a target detection module. The reflectance learning module is used to perform Retinex decomposition on images C and D twice to extract and learn reflectance information in the images. The target detection module is used to detect the projectiles in the images C, D, and the images after two Retinex decompositions, and output the detection result A, which includes the bounding box of the projectiles and the probability distribution of the projectile category. The reflectance learning module includes a Retinex decomposition submodule and a reflectance enhancement submodule; The Retinex decomposition submodule is used to perform initial decomposition on image C and image D respectively; The reflectivity enhancement submodule is used to perform a secondary decomposition on the image obtained by the initial decomposition of the Retinex decomposition submodule. The step of the reflectivity enhancement submodule performing a secondary decomposition on the image obtained from the initial decomposition by the Retinex decomposition submodule includes: The Retinex decomposition submodule performs initial decomposition on images C and D respectively, obtaining the reflectance and illuminance of image C and image D after initial decomposition. The reflectivity enhancement submodule swaps the reflectivity of image C and image D after the initial decomposition, and then synthesizes image C' and image D' after the reflectivity swap. The images C' and D' are decomposed into two values respectively to obtain the reflectance and illuminance of the image C' and the image D'. The difference between the reflectance obtained from the first decomposition and the reflectance obtained from the second decomposition is constrained to improve the consistency of image reflectance.
2. The method for detecting road spills at night according to claim 1, characterized in that, The target detection module uses a lightweight LeYOLO network model.
3. The method for detecting road spills at night according to claim 1, characterized in that, The teacher network uses a YOLOv8 network pre-trained with road images under sufficient lighting conditions.
4. The method for detecting road spills at night according to claim 1, characterized in that, The formula for calculating the reflectivity loss is: Among them, L reflectance For reflectivity loss, Let C be the reflectance of the image after its initial decomposition. The reflectance of image D after its initial decomposition. The reflectance is the result of the second-order decomposition of image C. Let be the reflectance of the second-order decomposition of image D; The formula for calculating the knowledge distillation loss is as follows: L KD =α·L student +(1-a)·L teacher Among them, L KD The loss is the knowledge distillation loss, where α is the weighting parameter and L is the weighting parameter. student L teacher For the loss of teachers' network access; The formula for calculating the target detection loss is as follows: L detection =L classification +λ·L regression Among them, L detection For target detection loss, L classification For classification loss, L regression λ is the regression loss, and λ is a weighting parameter that adjusts the weight between the classification loss and the regression loss. The formula for calculating the comprehensive loss function is as follows: L total =β1·L reflectance +β2·L KD +β3·L detection Among them, L total The loss function is defined as β1, β2, and β3, which are the weighting parameters for each loss term.
5. A nighttime road litter detection system, used to implement the detection method as described in any one of claims 1-4, characterized in that, include: The image preprocessing module is used to acquire labeled nighttime road images A; Low-light image processing is performed on image A to obtain weak-light image B; Contrast-limited adaptive histogram equalization is applied to images A and B to obtain enhanced nighttime road image C and enhanced low-light image D. The detection model construction module is used to construct a detection model based on knowledge distillation, which consists of a student network and a teacher network. The detection model training module is used to input images C and D into the student network. The student network performs reflectance training on images C and D and then performs target detection processing to obtain detection result A, which includes the bounding box of the projectile and the probability distribution of the projectile category. Images C and D are then input into the teacher network. The teacher network performs target detection processing on images C and D to obtain detection result B, which includes the bounding box of the projectile and the probability distribution of the projectile category. Based on detection results A and B, the student network is trained to construct a comprehensive loss function composed of a weighted sum of reflectance loss, knowledge distillation loss, and target detection loss. By optimizing the comprehensive loss function, the parameters of the student network are continuously adjusted. When the detection performance of the student network no longer improves or reaches the preset number of iterations, training stops to obtain the trained student network. The litter detection module, based on a trained student network, detects litter on roads at night based on preprocessed images and outputs an image containing litter bounding boxes and litter category labels, where the litter category label is the litter category with the highest probability.
6. An electronic device, characterized in that, It includes at least one processing unit and at least one storage unit, wherein the storage unit stores a computer program that, when executed by the processing unit, causes the processing unit to perform the detection method as described in any one of claims 1-4.
7. A storage medium, characterized in that, It stores a computer program executable by an electronic device, which, when run on the electronic device, causes the electronic device to perform the detection method as described in any one of claims 1-4.
Citation Information
Patent Citations
Low-illumination image enhancement method and system and readable storage medium
CN115170415A