Object Detection in Hazy Environments, Based on an All-in-One Dehazing Network and the YOLOv5 Algorithm
Abstract
:1. Introduction
- (1)
- Enhanced Image Defogging Algorithm: We propose an improved AOD-Net algorithm that incorporates a hybrid convolutional module (HDC) to broaden the receptive field for feature extraction and refine the details of defogged images. Additionally, we refine the loss function to expedite model convergence and improve generalization. These enhancements significantly upgrade the defogging performance of the AOD-Net neural network.
- (2)
- Optimized YOLOv5s Detection Algorithm: An enhanced YOLOv5s target detection algorithm is introduced, featuring the ShuffleNetv2 lightweight network module to reduce complexity and improve efficiency. We also refine the feature pyramid network (FPN) and introduce global shuffle convolution (GSconv) to balance accuracy with the parameter count. The convolutional block attention module (CBAM) is incorporated to heighten target attention without compromising network accuracy, making it suitable for in-vehicle mobile devices.
2. Image Defogging Algorithm and Model
2.1. AOD-Net Network
2.1.1. Atmospheric Scattering Model
2.1.2. Principle of the AOD-Net Architecture
2.2. Improved AOD-Net’s Defogging Algorithm
2.2.1. Improvement of Convolution Module
2.2.2. Selection of the Loss Function
3. Improved YOLOv5s Target Detection Model
3.1. YOLOv5s Network
3.2. Lightweighting of Backbone Network
3.3. Improvements to Neck
3.4. Attention Mechanism
4. Experimental Results and Analysis
4.1. Improved AOD-Net Image Defogging Comparison Experimental Analysis
4.1.1. Datasets and Experimental Platforms
4.1.2. Defogging Quality Evaluation Index
- (1)
- Peak Signal-to-Noise Ratio
- (2)
- Structural similarity
4.1.3. Analysis of Defogging Results
4.2. Improved YOLOv5s Target Detection Algorithm
4.2.1. Datasets and Experimental Platforms
4.2.2. Analysis of Test Results
4.3. Analysis of Fog Target Detection Results
5. Conclusions
- (1)
- Improved AOD-Net Defogging Technique: To mitigate the challenge of poor image quality in hazy environments, we have developed an enhanced AOD-Net neural network defogging technique. The incorporation of the hybrid convolutional module (HDC) extends the perceptual field within the image feature extraction process, thereby enhancing the capability to extract detailed image feature information. By employing a hybrid loss function, we address the issues of low contrast between dehazed and original images and the significant discrepancies in detail that arise from utilizing a single mean squared error (MSE) loss function.
- (2)
- Optimized YOLOv5s for Mobile Devices: To cater to the stringent requirements of target detection tasks on mobile devices used as vehicular terminals, we have developed an enhanced YOLOv5s target identification algorithm. The model parameters have been optimized to reduce complexity and the number of parameters minimized with negligible loss in accuracy. We have made targeted improvements to three key components of the YOLOv5s model: the backbone, the neck, and the detection layer. These enhancements provide significant advantages for application within in-vehicle mobile devices.
- (3)
- Validation and Analysis: Through rigorous validation and analysis, we have drawn conclusions on the performance of our enhanced AOD-Net + YOLOv5s-based target detection system for hazy environments. The enhanced YOLOv5s algorithm is characterized by a lightweight model architecture, a reduced number of parameters, and improved migration and applicability, all while maintaining equivalent accuracy. Furthermore, our enhanced AOD-Net + YOLOv5s defogging algorithm demonstrates superior performance in enhancing the contrast, color recovery, and overall brightness of dehazed images. The improved target detection approach, which integrates AOD-Net with YOLOv5s, effectively meets the objectives of this research and significantly boosts detection accuracy in hazy conditions.
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Shang, H.; Sun, L.; Qin, W. Pedestrian Detection at Night Based on the Fusion of Infrared Camera and Millimeter-Wave Radar. Chin. J. Sens. Actuators 2021, 34, 1137–1145. [Google Scholar]
- Wang, H.; Liu, M.; Cai, Y.; Chen, L. Vehicle target detection algorithm based on fusion of lidar and millimeter wave radar. J. Jiangsu Univ. Nat. Sci. Ed. 2021, 42, 389–394. [Google Scholar]
- Chen, Q.; Ji, J.; Chong, Y.; Gong, M. Vehicle and Pedestrian Detection Based on AOD-Net and SSD Algorithm in Hazy Environment. J. Chongqing Univ. Technol. Nat. Sci. 2021, 35, 108–117. [Google Scholar]
- Wang, K.; Yang, Y.; Fei, S. Review of hazy image sharpening methods. CAAI Trans. Intell. Syst. 2023, 18, 217–230. [Google Scholar]
- Zhang, H.; Patel, V.M. Densely Connected Pyramid Dehazing Network. In Proceedings of the 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–23 June 2018; pp. 3194–3203. [Google Scholar]
- Zhao, Q.; Zhang, H.; Cui, J.; Sun, Y.; Duan, S.; Xia, C.; Gao, X. A hybrid of local and global atmospheric scattering model for depth prediction via cross Bayesian model. Int. J. Comput. Sci. Eng. 2022, 25, 448–459. [Google Scholar] [CrossRef]
- Land, E.H. The retinex. Am. Sci. 1964, 52, 247–264. [Google Scholar]
- Petro, A.B.; Sbert, C.; Morel, J.M. Multiscale retinex. Lmage Process. Line 2014, 4, 71–88. [Google Scholar] [CrossRef]
- Li, B.; Peng, X.; Wang, Z.; Xu, J.; Feng, D. AOD-net: All-in-one dehazing network. In Proceedings of the 2017 IEEE International Conference on Computer Vision, Venice, Italy, 22–29 October 2017; pp. 4780–4788. [Google Scholar]
- Zhang, Q.; Chen, Z.; Jiang, H.; Zhao, J. Lightweight Image Defogging Algorithm Based on Improved AOD-Net. Res. Explor. Lab. 2022, 41, 18–22. [Google Scholar]
- Wang, K.; Yang, Y.; Li, B.; Li, X.; Cui, L. Uneven Image Dehazing by Heterogeneous Twin Network. IEEE Access 2020, 8, 118485–118496. [Google Scholar] [CrossRef]
- Raj, N.B.; Venketeswaran, N. Single image haze removal using a generative adversarial network. In Proceedings of the 2020 International Conference on Wireless Communications Signal Processing and Networking (WiSPNET), Chennai, India, 4–6 August 2020; pp. 37–42. [Google Scholar]
- Sun, G.; Li, C.; Zhang, H. Safety Helmet Wearing Detection Method Fused with Self-Attention Mechanism. Comput. Eng. Appl. 2022, 58, 300–304. [Google Scholar]
- Girshick, R.; Donahue, J.; Darrell, T.; Malik, J. Rich feature hierarchies for accurate object detection and semantic segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition(CVPR), Columbus, OH, USA, 23–28 June 2014; pp. 580–587. [Google Scholar]
- Girshick, R. Fast R-CNN. In Proceedings of the IEEE International Conference on Computer Vision(ICCV), Santiago, Chile, 7–13 December 2015; pp. 1440–1448. [Google Scholar]
- Ren, S.; He, K.; Girshick, R.; Sun, J. Faster r-cnn: Towards real-time object detection with region proposal networks. IEEE Trans. Pattern Anal. Mach. Intell. TPAMI 2016, 36, 1137–1149. [Google Scholar] [CrossRef] [PubMed]
- Redmon, J.; Divvala, S.; Girshick, R.; Farhadi, A. You only look once: Unified, real-time object detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition(CVPR), Las Vegas, NV, USA, 27–30 June 2016; pp. 779–788. [Google Scholar]
- Redmon, J.; Farhadi, A. YOLO9000: Better, faster, stronger. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition(CVPR), Honolulu, HI, USA, 21–26 July 2017; pp. 7263–7271. [Google Scholar]
- Redmon, J.; Farhadi, A. YOLOv3: An incremental improvement. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition(CVPR), Salt Lake City, UT, USA, 18–23 June 2018; pp. 1981–1990. [Google Scholar]
- Liu, W.; Anguelov, D.; Erhan, D.; Szegedy, C.; Reed, S.; Fu, C.Y.; Berg, A.C. SSD: Single shot multibox detector. In Proceedings of the European Conference on Computer Vision(ECCV), Amsterdam, The Netherlands, 8–16 October 2016; pp. 21–37. [Google Scholar]
- Nayar, S.K.; Narasimhan, S.G. Vision in bad weather. In Proceedings of the seventh IEEE International Conference on Computer Vision, Kerkyra, Greece, 20–27 September 1999; Volume 2, pp. 820–827. [Google Scholar]
- Wang, P.; Chen, P.; Yuan, Y.; Liu, D.; Huang, Z.; Hou, X.; Cottrell, G. Understanding convolution for semantic segmentation. In Proceedings of the 2018 IEEE Winter Conference on Applications of Computer Vision (WACV), Lake Tahoe, NV, USA, 12–15 March 2018; pp. 1451–1460. [Google Scholar]
- Liu, Y.; Zhao, G. Pad-net: A perception-aided single image dehazing network. arXiv 2018, arXiv:1805.03146. [Google Scholar]
- Li, H.; Li, J.; Wei, H.; Liu, Z.; Zhan, Z.; Ren, Q. Slim-neck by GSConv: A better design paradigm of detector architectures for autonomous vehicles. arXiv 2022, arXiv:2206.02424. [Google Scholar]
- Niu, Z.; Zhong, G.; Yu, H. A Review on the Attention Mechanism of Deep Learning. Neurocomputing 2021, 452, 48–62. [Google Scholar] [CrossRef]
- Woo, S.; Park, J.; Lee, J.-Y.; Kweon, I.S. CBAM: Convolutional Block Attention Module. In Proceedings of the European Conference on Computer Vision (ECCV), Munich, Germany, 8–14 September 2018; pp. 3–19. [Google Scholar]
- Cho, Y.; Jeong, J.; Kim, A. Model-assisted multiband fusion for single image enhancement and applications to robot vision. IEEE Robot. Autom. Lett. 2018, 3, 2822–2829. [Google Scholar]
Convolutional Layer | 1 | 2 | 3 | 4 | 5 |
---|---|---|---|---|---|
convolution kernel | 1 × 1 | 3 × 3 | 5 × 5 | 7 × 7 | 3 × 3 |
void rate | 1 | 1 | 1 | 1 | 1 |
receptive field size | 1 | 3 | 7 | 13 | 15 |
number of output channels | 3 | 3 | 3 | 3 | 3 |
Evaluation Indicators | DCP | MbE | AOD-Net | Improved AOD-Net |
---|---|---|---|---|
PNSR | 15.22 | 18.44 | 20.28 | 21.02 |
SSIM | 0.79 | 0.67 | 0.82 | 0.85 |
Parameter | Configuration |
---|---|
CPU | Intel(R) Xeon(R) Platinum 8358P CPU @ 2.60 GHz |
RAM | 40 |
GPU | RTX 3080 (10 GB) |
Operating System | Ubuntu18.04 |
Parameter Type | Configuration |
---|---|
Epoch | 100 |
Batch size | 32 |
Learning rate | 0.0001 |
Image size | 640 × 640 |
Models | Parameters (M) | GFLOPS | Model Size (Mb) | [email protected](%) | FPS |
---|---|---|---|---|---|
YOLOv3-tiny | 8.7 | 5.6 | 33.4 | 76.9 | 94.3 |
YOLOv4-tiny | 6.1 | 6.9 | 23.1 | 81.4 | 97.2 |
YOLOv5s | 7.2 | 16.5 | 14.2 | 91.2 | 87.6 |
YOLOv5n | 1.8 | 4.2 | 3.7 | 77.7 | 86.3 |
YOLOv7-tiny | 6.1 | 13.1 | 12.6 | 79.8 | 98.1 |
YOLOv8s | 11.2 | 28.8 | 13.8 | 83.4 | 90.0 |
YOLOv5s-MobileNet | 2.8 | 5.6 | 7.4 | 80.2 | 82.1 |
YOLOv5s-ShuffleNet | 3.8 | 8.1 | 7.6 | 81.4 | 82.7 |
v5s-ShuffleNet-GSConv | 3.4 | 7.5 | 6.8 | 80.7 | 81.2 |
v5s-v2-GSConv + BiFPN | 3.9 | 8.1 | 7.1 | 83.1 | 80.7 |
Ours | 4.5 | 9.4 | 7.3 | 87.3 | 80.4 |
Algorithm | Bicycle | Car | Motorbike | Person | [email protected](%) |
---|---|---|---|---|---|
YOLOv5s | 39.3 | 82.9 | 73.7 | 81.5 | 69.4 |
AOD-Net + YOLOv5s | 52.0 | 86.4 | 78.7 | 85.0 | 75.5 |
Improved AOD-Net + YOLOv5s | 56.4 | 84.7 | 79.8 | 86.2 | 77.4 |
Algorithm in this paper | 59.0 | 86.1 | 79.7 | 85.0 | 76.8 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Li, A.; Xu, G.; Yue, W.; Xu, C.; Gong, C.; Cao, J. Object Detection in Hazy Environments, Based on an All-in-One Dehazing Network and the YOLOv5 Algorithm. Electronics 2024, 13, 1862. https://doi.org/10.3390/electronics13101862
Li A, Xu G, Yue W, Xu C, Gong C, Cao J. Object Detection in Hazy Environments, Based on an All-in-One Dehazing Network and the YOLOv5 Algorithm. Electronics. 2024; 13(10):1862. https://doi.org/10.3390/electronics13101862
Chicago/Turabian StyleLi, Aijuan, Guangpeng Xu, Wenpeng Yue, Chuanyan Xu, Chunpeng Gong, and Jiaping Cao. 2024. "Object Detection in Hazy Environments, Based on an All-in-One Dehazing Network and the YOLOv5 Algorithm" Electronics 13, no. 10: 1862. https://doi.org/10.3390/electronics13101862
APA StyleLi, A., Xu, G., Yue, W., Xu, C., Gong, C., & Cao, J. (2024). Object Detection in Hazy Environments, Based on an All-in-One Dehazing Network and the YOLOv5 Algorithm. Electronics, 13(10), 1862. https://doi.org/10.3390/electronics13101862