Improved YOLOv8 Algorithm for Water Surface Object Detection
Abstract
:1. Introduction
- (1)
- Adding a smaller target detection head to the original model improves its ability to detect small targets and addresses missed detection issues.
- (2)
- Adding MLCA to the backbone network to integrate features of different scales enhances the model’s flexibility in detecting small targets at varying distances on the water surface.
- (3)
- Adding the SENetV2 channel attention mechanism to the neck component allows the model to adaptively adjust feature channel importance, enhancing sensitivity and accuracy for small targets, and reducing false and missed detections.
- (4)
- Using the SIoU loss function improves boundary box regression accuracy and reduces background noise interference in small target detection.
2. Method
2.1. Proposed Algorithm
- (1)
- Targets at different distances appear at varying scales, posing difficulties for the model in performing accurate detection.
- (2)
- Partial or complete occlusion of objects by other elements in the scene can result in missed detections.
- (3)
- Reflections, light variations, and water waves introduce noise that can interfere with detection and lead to false positives.
- (4)
- Small objects, especially when distant or clustered, cannot be reliably detected by the model.
2.2. Improvements in the Head Component
Introducing the MLCA Module
2.3. Improvements in the Neck Component
2.3.1. Adding a Smaller Target Detection Head
2.3.2. Introducing the SENetV2 Module
2.4. Loss Function Improvement
3. Experiments and Results Analysis
3.1. Experimental Dataset
3.2. Evaluation Metrics
3.3. Experimental Parameters and Environment Configuration
3.4. Results Analysis
3.4.1. Backbone Network Improvement Experiment
3.4.2. Neck Network Improvement Experiment
3.4.3. Loss Function Improvement Experiments
3.5. Ablation Experiments
3.6. Comparative Experiments of Different Models
3.6.1. Comparison of Common YOLO Series
3.6.2. Comparison of Other Algorithms
3.7. Visualization Analysis
3.8. Generalisation Experiment
4. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Ren, S.; He, K.; Girshick, R.; Sun, J. Faster r-cnn: Towards real-time object detection with region proposal networks. In Proceedings of the Advances in Neural Information Processing Systems, Montreal, QC, Canada, 7–12 December 2015; Volume 28. [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 Computer Vision–ECCV 2016: 14th European Conference, Amsterdam, The Netherlands, 11–14 October 2016; Proceedings, Part I 14. Springer: Berlin/Heidelberg, Germany, 2016; pp. 21–37. [Google Scholar]
- 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, Las Vegas, NV, USA, 27–30 June 2016; pp. 779–788. [Google Scholar]
- Lin, T.Y.; Maire, M.; Belongie, S.; Hays, J.; Perona, P.; Ramanan, D.; Dollár, P.; Zitnick, C.L. Microsoft COCO: Common objects in context. In Proceedings of the Computer Vision—ECCV 13th European Conference, Zurich, Switzerland, 6–12 September 2014; pp. 740–755. [Google Scholar]
- Shetty, S. Application of convolutional neural network for image classification on Pascal VOC challenge 2012 dataset[EB/OL]. arXiv 2016, arXiv:1607.03785. [Google Scholar]
- Zhang, L.; Zhang, Y.; Zhang, Z.; Shen, J.; Wang, H. Real-Time Water Surface Object Detection Based on Improved Faster R-CNN. Sensors 2019, 19, 3523. [Google Scholar] [CrossRef] [PubMed]
- Mu, X.; Lin, Y.; Liu, J.; Cao, Y.; Liu, H. Surface Navigation Target Detection and Recognition based on SSD. In Proceedings of the 2019 3rd International Conference on Electronic Information Technology and Computer Engineering (EITCE), Xiamen, China, 18–20 October 2019; pp. 649–653. [Google Scholar]
- Li, A.; Zhu, X.; He, S.; Xia, J. Water surface object detection using panoramic vision based on improved single-shot multibox detector. EURASIP J. Adv. Signal Process. 2021, 2021, 123. [Google Scholar] [CrossRef]
- Liu, Y.; Feng, J.; Xing, B. Water Surface Target Detection Based on Deep Learning. Prog. Laser Optoelectron. 2020, 57, 287–296. [Google Scholar]
- Zhou, Z.; Sun, J.; Yu, J.; Liu, K.; Duan, J.; Chen, L.; Chen, C.P. An Image-Based Benchmark Dataset and a Novel Object Detector for Water Surface Object Detection. Front. Neurorobot. 2021, 15, 723336. [Google Scholar] [CrossRef]
- Sá, T.R.D.; Figueiredo, C.M.S. Self-driving Vessels: YOLOv5 Approach for Water Surface Object Detection. In Anais do XIV Simpósio Brasileiro de Computação Ubíqua e Pervasiva; Sociedade Brasileira de Computação: Porto Alegre, Brazil, 2022; pp. 31–40. [Google Scholar]
- Qi, L.; Jian, J. Small Object Detection Based on Improved YOLOv7. Comput. Eng. 2023, 49, 41–48. [Google Scholar]
- Wang, C.Y.; Bochkovskiy, A.; Liao, H.Y.M. YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors. arXiv 2022, arXiv:2207.02696. [Google Scholar]
- Cheng, Y.; Zhu, J.; Jiang, M.; Fu, J.; Pang, C.; Wang, P.; Sankaran, K.; Onabola, O.; Liu, Y.; Liu, D.; et al. Flow: A dataset and benchmark for floating waste detection in inland waters. In Proceedings of the IEEE/CVF International Conference on Computer Vision, Montreal, QC, Canada, 11–17 October 2021; pp. 10953–10962. [Google Scholar]
- Wan, D.; Lu, R.; Shen, S.; Xu, T.; Lang, X.; Ren, Z. Mixed local channel attention for object detection. Eng. Appl. Artif. Intell. 2023, 123, 106442. [Google Scholar] [CrossRef]
- Jiao, J.; Zhang, Y.; Sun, H.; Yang, X.; Gao, X.; Hong, W.; Fun, K.; Sun, X. A Densely Connected End-to-End Neural Network for Multiscale and Multiscene SAR Ship Detection. IEEE Access 2018, 6, 20881–20892. [Google Scholar] [CrossRef]
- Wang, Q.; Wu, B.; Zhu, P.; Li, P.; Zuo, W.; Hu, Q. ECA-Net: Efficient channel attention for deep convolutional neural networks. In Proceedings of the IEEE Computer Society Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA, 13–19 June 2020; pp. 11531–11539. [Google Scholar]
- Lin, T.Y.; Dollár, P.; Girshick, R.; He, K.; Hariharan, B.; Belongie, S. Feature Pyramid Networks for Object Detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Honolulu, HI, USA, 21–26 July 2017. [Google Scholar]
- Hu, J.; Li, S.; Gang, S. Squeeze-and-excitation networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–23 June 2018. [Google Scholar]
- Mahendran, N. SENetV2: Aggregated dense layer for channelwise and global representations. arXiv 2023, arXiv:2311.10807. [Google Scholar]
- Rezatofighi, H.; Tsoi, N.; Gwak, J.; Sadeghian, A.; Reid, I.; Savarese, S. Generalized intersection over union: A metric and a loss for bounding box regression. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Long Beach, CA, USA, 15–20 June 2019; pp. 658–666. [Google Scholar]
- Gevorgyan, Z. SIoU loss: More powerful learning for bounding box regression. arXiv 2022, arXiv:2205.12740. [Google Scholar]
- Zheng, Z.; Wang, P.; Liu, W.; Li, J.; Ye, R.; Ren, D. Distance-IoU loss: Faster and better learning for bounding box regression. Proc. AAAI Conf. Artif. Intell. 2020, 34, 12993–13000. [Google Scholar] [CrossRef]
- Cho, Y.J. Weighted intersection over union (wIoU): A new evaluation metric for image segmentation. arXiv 2021, arXiv:2107.09858. [Google Scholar]
- Hao, Z.; Zhang, S. Shape-iou: More accurate metric considering bounding box shape and scale. arXiv 2023, arXiv:2312.17663. [Google Scholar]
- Li, C.; Li, L.; Jiang, H.; Weng, K.; Geng, Y.; Li, L.; Ke, Z.; Li, Q.; Cheng, M.; Nie, W.; et al. YOLOv6: A single-stage object detection framework for industrial applications. arXiv 2022, arXiv:2209.02976. [Google Scholar]
- Wang, C.Y.; Yeh, I.H.; Liao, H.Y.M. Yolov9: Learning what you want to learn using programmable gradient information. arXiv 2024, arXiv:2402.13616. [Google Scholar]
- Si, G.; Zhang, Y.; Sun, Y.; Chen, W. Blockchain-based privacy protection scheme for smart park multi-energy fusion system. In Proceedings of the 2021 IEEE 4th Advanced Information Management, Communicates, Electronic and Automation Control Conference (IMCEC), Chongqing, China, 18–20 June 2021. [Google Scholar]
- Zhao, Y.; Lv, W.; Xu, S.; Wei, J.; Wang, G.; Dang, Q.; Liu, Y.; Chen, J. Detrs beat yolos on real-time object detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA, 17–24 June 2024. [Google Scholar]
- Li, K.; Wang, Y.; Hu, Z. Improved YOLOv7 for Small Object Detection Algorithm Based on Attention and Dynamic Convolution. Appl. Sci. 2023, 13, 9316. [Google Scholar] [CrossRef]
- Li, Y.; Wang, R.; Gao, D.; Liu, Z. A Floating-Waste-Detection Method for Unmanned Surface Vehicle Based on Feature Fusion and Enhancement. J. Mar. Sci. Eng. 2023, 11, 2234. [Google Scholar] [CrossRef]
Training parameters | Optimizer | SGD |
Batch size | 8 | |
Epochs | 200 | |
Pretrain | Closed | |
Learning rate | 0.01 | |
Input images size | 640 × 640 | |
Momentum | 0.937 | |
Weight_decay | 0.0005 | |
Warmup_epochs | 3 | |
Data augmentation | mosaic | |
Experimental environment parameters | CPU | i7-12700F |
GPU | NVIDIA GeForce RTX 3060 Ti | |
GPU memory size | 16 GB | |
Programming language | Python-3.11.5 | |
Operation system | Win 11 | |
Module platform | Pytorch-2.0.0 + cuda11.8 |
Model | [email protected](%) | [email protected]:0.95(%) | GFLOPs |
---|---|---|---|
YOLOv8n | 82.9 | 45 | 8.1 |
YOLOv8n + 1C2f_MLCA | 85.1 | 46.5 | 8.1 |
YOLOv8n + 2C2f_MLCA | 84.2 | 45.7 | 8.1 |
YOLOv8n + 3C2f_MLCA | 84.4 | 46 | 8.1 |
YOLOv8n + 4C2f_MLCA | 84.5 | 46.2 | 8.2 |
Model | [email protected](%) | [email protected]:0.95(%) | GFLOPs |
---|---|---|---|
YOLOv8n | 82.9 | 45 | 8.1 |
YOLOv8n + Smallerhead | 86.5 | 46.9 | 12.2 |
YOLOv8n + Smallerhead + SENetV2 | 87.1 | 47.1 | 12.3 |
Model | [email protected](%) | [email protected]:0.95(%) |
---|---|---|
YOLOv8n + CIoU | 82.9 | 45 |
YOLOv8n + DIoU | 78.3 | 36.4 |
YOLOv8n + WIoU | 83.8 | 45.5 |
YOLOv8n+ WIoUv2 | 79.6 | 37.5 |
YOLOv8n+ WIoUv3 | 79.4 | 36.5 |
YOLOv8n + ShapeIoU | 83.6 | 45.7 |
YOLOv8n + SIoU | 84.1 | 46 |
Experiment | C2f_MLCA | Smallerhead | C2f_SENetV2 | SIoU | [email protected] | [email protected]:0.95 | GFLOPs |
---|---|---|---|---|---|---|---|
1 | - | - | - | - | 82.9 | 45 | 8.1 |
2 | √ | - | - | - | 85.1 | 46.5 | 8.1 |
3 | - | √ | - | - | 86.5 | 46.9 | 12.2 |
4 | - | - | √ | - | 83.7 | 45.6 | 8.1 |
5 | - | - | - | √ | 84.1 | 46 | 8.1 |
6 | √ | √ | - | - | 86.8 | 46.9 | 12.2 |
7 | √ | - | √ | - | 85.3 | 45.6 | 8.1 |
8 | √ | - | - | √ | 84.5 | 45.9 | 8.1 |
9 | - | √ | √ | - | 87.1 | 47.1 | 12.3 |
10 | - | √ | - | √ | 87.0 | 46.9 | 12.2 |
11 | - | - | √ | √ | 84.4 | 46.3 | 8.1 |
12 | √ | √ | √ | - | 87.6 | 47.3 | 12.3 |
13 | √ | √ | - | √ | 87.3 | 47.2 | 12.2 |
14 | √ | - | √ | √ | 85.8 | 45.7 | 8.1 |
15 | - | √ | √ | √ | 87.5 | 47.3 | 12.2 |
16 | √ | √ | √ | √ | 87.9 | 47.6 | 12.3 |
Model | [email protected](%) | [email protected]:0.95(%) | GFLOPs | Size | F1(%) |
---|---|---|---|---|---|
YOLOv5s | 82.5 | 44 | 7.1 | 5 M | 80 |
YOLOv6 | 82.1 | 43.4 | 11.8 | 8.3 M | 81 |
YOLOv7 | 64.2 | 28.4 | 105.1 | 71.3 M | 66 |
YOLOv7-tiny | 76.1 | 34.4 | 13.2 | 11.7 M | 76 |
YOLOv8n | 82.9 | 45 | 8.1 | 6 M | 81 |
YOLOv9c | 87.6 | 47.4 | 102.3 | 49.2 M | 84 |
YOLOv8-MSS | 87.9 | 47.6 | 12.3 | 5.8 M | 85 |
Model | [email protected](%) | [email protected]:0.95(%) | Size |
---|---|---|---|
Faster R-CNN | 56.2 | 31.7 | 314 M |
SSD | 78 | 40.3 | 60.3 M |
Rt-DETR-R50 | 70.6 | 39.8 | 86 M |
YOLO-Float | 83.3 | 42 | 91.8 M |
YOLOv7-CA Dynamic | 81.1 | 38.1 | 51.5 M |
YOLOv8-MSS | 87.9 | 47.6 | 5.8 M |
Method | Mast | Bridge | Tree | Ship | Animal | Boat | Harbor | Platform | Person | Rock | Rubbish | Ball | Buoy | Glass | mAP@50 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Basic | 77.6 | 98.2 | 90.4 | 91 | 89.3 | 89.4 | 93.1 | 77 | 60.5 | 72 | 60 | 62.4 | 71.3 | 53 | 77.5 |
Ours | 79.2 | 97.4 | 92.5 | 91.8 | 97.3 | 90.3 | 92.5 | 78.1 | 71.2 | 72.9 | 63 | 71.1 | 79.9 | 60.8 | 80.6 |
Method | Pedestrian | People | Bicycle | Car | Van | Truck | Tricycle | Awning-t | Bus | Motor Vehicle | mAP@50 |
---|---|---|---|---|---|---|---|---|---|---|---|
YOLOv8n | 35.8 | 27.6 | 24.1 | 76.1 | 38.7 | 29.1 | 22.2 | 11.4 | 47.4 | 37.5 | 35 |
Ours | 44 | 35.5 | 26.5 | 80.6 | 42.1 | 30.5 | 25.6 | 15.3 | 47.7 | 44.1 | 39.2 |
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
Wang, J.; Zhao, H. Improved YOLOv8 Algorithm for Water Surface Object Detection. Sensors 2024, 24, 5059. https://doi.org/10.3390/s24155059
Wang J, Zhao H. Improved YOLOv8 Algorithm for Water Surface Object Detection. Sensors. 2024; 24(15):5059. https://doi.org/10.3390/s24155059
Chicago/Turabian StyleWang, Jie, and Hong Zhao. 2024. "Improved YOLOv8 Algorithm for Water Surface Object Detection" Sensors 24, no. 15: 5059. https://doi.org/10.3390/s24155059