Research on Improved Lightweight Fish Detection Algorithm Based on Yolov8n
Abstract
:1. Introduction
2. Analysis of YOLOv8 Basic Model
3. Improved Model-CUIB-YOLO
3.1. Improved C2f Module
3.2. Introducing the EMA Mechanism
4. Results
4.1. Data Sets and Evaluation Indicators
4.2. Test Configuration and Parameter Setting
4.3. Analysis of Lightweight Network Structure Ablation Test
4.4. Comparative Experiment of Different Models
4.5. Visualization of Test Results
5. Discussion
6. Conclusions
- Model Optimization: The BottleNeck component of the C2f module is replaced with the UIB module as the primary gradient flow branch. This new combined module substitutes the C2f module in the original model’s backbone network, resulting in an 80% reduction in model parameters and achieving lightweight processing. Additionally, the incorporation of the EMA mechanism enhances the model’s feature processing performance and improves detection accuracy.
- Performance Comparison: Compared to YOLOv3-tiny and YOLOv5s, the improved lightweight network model demonstrates parameter reductions of 79%, 72%, and 16%, respectively. When compared with the YOLOv8n model, the parameter count is reduced by 16%, with only a 1% decrease in accuracy.
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Girshick, R.; Donahue, J.; Darrell, T.; Malik, J. Region-based convolutional networks for accurate objectdetection and segmentation]. IEEE Trans. Pattern Anal. Mach. Intell. 2015, 38, 142–158. [Google Scholar] [CrossRef] [PubMed]
- Choi, J.Y.; Han, J.M. Deep learning (Fast R-CNN)-basedevaluation of rail surface defects. Appl. Sci. 2024, 14, 1874. [Google Scholar] [CrossRef]
- Mu, X.; He, L.; Heinemann, P.; Schupp, J.; Karkee, M. Mask R-CNN basedapple flower detection and king lower identification forprecision pollination. Smart Agric. Technol. 2023, 4, 100151. [Google Scholar] [CrossRef]
- 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; pp. 21–37. [Google Scholar]
- Lin, T.Y.; Goyal, P.; Girshick, R.; He, K.; Dollár, P. Focal loss for dense object detection. In Proceedings of the IEEE International Conference on Computer Vision, Venice, Italy, 22–29 October 2017; pp. 2980–2988. [Google Scholar]
- Redmon, J.; Divvala, S.; Girshick, R.; Farhadi, A. You only lookonce: 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]
- Zhang, X.Y.; Hu, G.R.; Li, P.H.; Cao, X.Y.; Zhang, H.; Chen, J.; Zhang, L.L. Lightweight Safflower Recognition Method Based on Improved YOLOv8n. Acta Agric. Eng. 2024, 40, 163–170. [Google Scholar]
- Sun, D.; Zhang, K.; Zhong, H.; Xie, J.; Xue, X.; Yan, M.; Wu, W.; Li, J. Efficient Tobacco Pest Detection in Complex Environments Using an Enhanced YOLOv8 Model. Agriculture 2024, 14, 353. [Google Scholar] [CrossRef]
- Yang, G.; Lei, J.; Zhu, Z.; Cheng, S.; Feng, Z.; Liang, R. AFPN: Asymptotic Feature Pyramid Network for Object Detection. arXiv 2023, arXiv:2306.15988v2. [Google Scholar]
- Zhang, M.; Wang, Z.; Song, W.; Zhao, D.; Zhao, H. Efficient Small-Object Detection in Underwater Images Using the Enhanced YOLOv8 Network. Appl. Sci. 2024, 14, 1095. [Google Scholar] [CrossRef]
- Zhang, S.; Wang, K.; Zhang, H.; Wang, T.; Gao, X.; Song, Y.; Wang, F. An improved YOLOv8 for fiber bundle segmentation in X-ray computed tomography images of 2.5D composites to build the finite element model. Compos. Part A 2024, 185, 108337. [Google Scholar] [CrossRef]
- Li, H.; Li, J.; Wei, H.; Liu, Z.; Zhan, Z.; Ren, Q. Slim-neck by GSConv: A lightweight-design for real-time detector architectures. arXiv 2022, arXiv:2206.02424v3. [Google Scholar] [CrossRef]
- Chen, H.; Wang, Y.; Guo, J.; Tao, D. VanillaNet: The Power of Minimalism in Deep Learning. arXiv 2023, arXiv:2305.12972v2. [Google Scholar]
- Ouyang, Z.; Fu, X.; Zhong, Z.; Bai, R.; Cheng, Q.; Gao, G.; Li, M.; Zhang, H.; Zhang, Y. An exploration of the influence of ZnO NPs treatment on germination of radish seeds under salt stress based on the YOLOv8-R lightweight model. Plant Methods 2024, 20, 110. [Google Scholar] [CrossRef] [PubMed]
- Yan, Z.; Hao, L.; Yang, J.; Zhou, J. Real-Time Underwater Fish Detection and Recognition Based on CBAM-YOLO Network with Lightweight Design. J. Mar. Sci. Eng. 2024, 12, 1302. [Google Scholar] [CrossRef]
- Zhao, H.; Jin, J.; Liu, Y.; Guo, Y.; Shen, Y. FSDF: A high-performance fire detection framework. Expert Syst. Appl. 2024, 238, 121665. [Google Scholar] [CrossRef]
- Liu, P.Z.; Qian, W.B.; Wang, Y.L. YWnet: A convolutional block attention-based fusion deep learning method for complex underwater small target detection. Ecol. Inform. 2024, 79, 102401. [Google Scholar] [CrossRef]
- Ji, W.; Peng, J.Q.; Xu, B.; Zhang, T. Real-time detection of underwater river crab based on multi-scale pyramid fusion image enhancement and Mobile CenterNet model. Comput. Electron. Agric. 2023, 204, 107522. [Google Scholar] [CrossRef]
- Xu, X.C.; Liu, Y.; Lyu, L.; Yan, P.; Zhang, J.Y. MAD-YOLO: A quantitative detection algorithm for dense small-scale marine benthos. Ecol. Inform. 2023, 75, 102022. [Google Scholar] [CrossRef]
- Fan, Y.; Mao, S.; Li, M.; Wu, Z.; Kang, J. CM-YOLOv8: Lightweight YOLO for Coal Mine Fully Mechanized Mining Face. Sensors 2024, 24, 1866. [Google Scholar] [CrossRef] [PubMed]
- Wang, X.; Hao, X.; Kang, K. MC-YOLO-Based Lightweight Detection Method for Nighttime Vehicle Images in a Semantic Web-Based Video Surveillance System. Int. J. Semant. Web Inf. Syst. (IJSWIS) 2023, 19, 1–18. [Google Scholar] [CrossRef]
- Liang, H.; Gong, H.; Gong, L.; Zhang, M. Automated detection of airfield pavement damages: An efficient light-weight algorithm. Int. J. Pavement Eng. 2023, 24. [Google Scholar] [CrossRef]
- Qin, D.; Leichner, C.; Delakis, M.; Fornoni, M.; Luo, S.; Yang, F.; Wang, W.; Banbury, C.; Ye, C.; Akin, B.; et al. MobileNetV4—Universal Models for the Mobile Ecosystem. arXiv 2024, arXiv:2404.10518. [Google Scholar]
- Ouyang, D.; He, S.; Zhang, G.; Luo, M.; Guo, H.; Zhan, J.; Huang, Z. Efficient Multi-Scale Attention Module with Cross-Spatial Learning. arXiv 2023, arXiv:2305.13563v2. [Google Scholar]
- Zhang, J.; Li, X.; Li, J.; Liu, L.; Xue, Z.; Zhang, B.; Jiang, Z.; Huang, T.; Wang, Y.; Wang, C. Rethinking Mobile Block for Efficient Attention-based Models. arXiv 2023, arXiv:2301.01146v4. [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]
- Pan, X.; Ge, C.; Lu, R.; Song, S.; Chen, G.; Huang, Z.; Huang, G. On the integration of self-attention and convolution. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, New Orleans, LA, USA, 18–24 June 2022; pp. 815–825. [Google Scholar]
Data Set | Number of Images | Proportion (%) |
---|---|---|
train | 4062 | 80 |
test | 370 | 5 |
val | 740 | 15 |
YOLOv8n Model | C2f_UIB | EMA | mAP@0.5/% | mAP@0.5–0.95/% | FLOPs/G | Params/M |
---|---|---|---|---|---|---|
√ | × | × | 95.4 | 76.5 | 8.1 | 3.0 |
√ | √ | × | 94.9 | 72.7 | 6.1 | 2.2 |
√ | × | √ | 96.5 | 77.1 | 8.1 | 3.1 |
√ | √ | √ | 95.7 | 76.4 | 7.5 | 2.5 |
Name | Configuration |
---|---|
Operating System | Windows 11 |
CPU | AMD EPYC 7642 48-Core (AMD, Santa Clara, CA, USA) |
GPU | RTX 3090 (NVIDIA, Santa Clara, CA, USA) |
Memory | 24 GB |
Python | 3.10 |
CUDA | 11.8 |
PyTorch Frame | 2.1.2 |
Model | mAP@0.5/% | mAP@0.5–0.95/% | FLOPs/G | Params/M |
---|---|---|---|---|
YOLOv3-tiny | 88.8 | 62 | 18.9 | 12.1 |
YOLOv5n | 88.1 | 64.1 | 7.1 | 2.5 |
YOLOv5s | 92.2 | 69.7 | 23.8 | 9.1 |
YOLOv8n | 95.4 | 76.5 | 8.1 | 3.0 |
YOLOv9 | 96.8 | 79.4 | 264.9 | 60 |
YOLOv9c | 93.3 | 75.1 | 102.3 | 25 |
YOLOv10n | 92.6 | 72.9 | 7.2 | 2.7 |
CUIB-YOLO | 95.7 | 76.4 | 7.5 | 2.5 |
Model | mAP@0.5/% | mAP@0.5–0.95/% | FLOPs/G | Params/M |
---|---|---|---|---|
iRMB | 94.1 | 72.1 | 7.0 | 2.4 |
MLCA | 94.4 | 72.8 | 6.3 | 2.1 |
ACmix | 94.1 | 72.3 | 6.9 | 2.4 |
CUIB-YOLO | 95.7 | 76.4 | 7.5 | 2.5 |
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
Zhang, Q.; Chen, S. Research on Improved Lightweight Fish Detection Algorithm Based on Yolov8n. J. Mar. Sci. Eng. 2024, 12, 1726. https://doi.org/10.3390/jmse12101726
Zhang Q, Chen S. Research on Improved Lightweight Fish Detection Algorithm Based on Yolov8n. Journal of Marine Science and Engineering. 2024; 12(10):1726. https://doi.org/10.3390/jmse12101726
Chicago/Turabian StyleZhang, Qingyang, and Shizhe Chen. 2024. "Research on Improved Lightweight Fish Detection Algorithm Based on Yolov8n" Journal of Marine Science and Engineering 12, no. 10: 1726. https://doi.org/10.3390/jmse12101726
APA StyleZhang, Q., & Chen, S. (2024). Research on Improved Lightweight Fish Detection Algorithm Based on Yolov8n. Journal of Marine Science and Engineering, 12(10), 1726. https://doi.org/10.3390/jmse12101726