A Foam Line Position Detection Algorithm for A/O Pool Based on YOLOv5
Abstract
:1. Introduction
2. Related
- (1)
- In the image preprocessing stage, the entire foam line is annotated in segments. For each region formed by the highest and lowest points, the points on the foam line within that region, along with their vertically corresponding points on the A/O pool edge, are annotated using rectangular bounding boxes, and annotations are applied segment by segment. This process enhances the feature information of the foam line, addressing the issue of missed detections in smaller regions, and ultimately improving the accuracy of foam line detection.
- (2)
- In the feature extraction stage, the C3NAM module is proposed, which considers contribution factors to enhance the ability of the model to extract foam line features.
- (3)
- In the spatial pyramid part, the B-SPPCSPC module is proposed to enhance the perception degree of feature information in two branches. Simultaneously, it strengthens the fusion capability of deep and shallow feature information.
- (4)
- By introducing the Focal and Efficient-Intersection over Union Loss (Focal_EIOU Loss), the model could focus on the high-quality anchor boxes during the bounding box regression process, enhancing the precision of bounding box regression predictions. Finally, optimizing the detection layer scales allows the model to pay more attention to smaller target areas, thereby improving the model’s detection capability for foam lines.
3. Proposed Algorithm
3.1. Overall Structure
3.2. C3NAM
3.3. B-SPPCSPC
3.4. Loss Function
3.5. Optimizing Detection Layer
4. Experiments and Results
4.1. Data Source and Preprocessing
4.2. Evaluation Metrics
4.3. Result Analysis
4.3.1. Comparison Experiments
4.3.2. Ablation Experiments
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Zheng, J.F. Research on measures to improve the efficiency of A/O pool process treatment. Man-Made Fibers 2020, 50, 20–25. [Google Scholar]
- Iwahashi, M.; Udomsiri, S. Water Level Detection from Video with Fir Filtering. In Proceedings of the 2007 16th International Conference on Computer Communications and Networks, Honolulu, HI, USA, 13–16 August 2007. [Google Scholar]
- Lin, F.; Chang, W.-Y.; Lee, L.-C.; Hsiao, H.-T.; Tsai, W.-F.; Lai, J.-S. Applications of Image Recognition for Real-Time Water Level and Surface Velocity. In Proceedings of the 2013 IEEE International Symposium on Multimedia, Anaheim, CA, USA, 9–11 December 2013; pp. 259–262. [Google Scholar]
- Chen, C.; Liu, Z.W.; Chen, X.S.; Luo, M.N.; Niu, Z.X.; Ruan, C. Technology of Water Level Automatically Extract based on Image Processing. Water Resour. Informatiz. 2016, 1, 48–55. [Google Scholar]
- Zhou, H.; Zhong, S.D. Research on Water Level Monitoring Based on Image Processing. Semicond. Optoelectron. 2019, 40, 390–394+400. [Google Scholar]
- Bao, J.; Tao, Q.C.; Zhang, P. Image Processing Based Water Level Detection Algorithm. Hydropower Energy Sci. 2015, 33, 96–99+210. [Google Scholar]
- Xu, Z.K.; Feng, J.; Zhang, Z.Z.; Shu, X.C. An automatic water depth measurement method combined with convolutional neural network. Small Microcomput. Syst. 2019, 40, 793–797. [Google Scholar]
- Cheng, S.; Zhao, K.; Zhang, S.; Zhang, D. Water Level Detection Based on U-net. Acta Metrol. 2019, 40, 361–366. [Google Scholar]
- Xiao, Z.; Tao, Q.C.; Shen, J.J. A Video water-level Recognition Based on SSD Object Detect Network. Mod. Comput. 2019, 60–64. [Google Scholar]
- Huang, J.; Miao, H.; Li, L.; Wen, Y.; Xiao, C. Deep Visual Waterline Detection within Inland Marine Environment. arXiv 2019, arXiv:1911.10498. [Google Scholar]
- Wu, T.; Chu, Z.F.; Chen, C.; Zhu, J.Y. Study on image level recodnition based on grayscale stretching. High Technol. Commun. 2021, 31, 327–332. [Google Scholar]
- Liao, Y.; Duan, Q.; Liu, J.; Zhou, H. Water line detection algorithm based on deep learning. Comput. Appl. 2020, 40 (Suppl. S1), 274–278. [Google Scholar]
- Shrestha, A.; Mahmood, A. Review of Deep Learning Algorithms and Architectures. IEEE Access 2019, 7, 53040–53065. [Google Scholar] [CrossRef]
- Bengio, Y. Learning Deep Architectures for AI. Found. Trends Mach. Learn. 2009, 2, 1–127. [Google Scholar] [CrossRef]
- Wong, A.; Shafiee, M.J.; Chwyl, B.; Li, F. GenSyth: A new way to understand deep learning. Electron. Lett. 2019, 55, 970–971. [Google Scholar] [CrossRef]
- Meng, D.Y.; Sun, L. Some New Trends of Deep Learning Research. Chin. J. Electron. 2019, 28, 1087–1091. [Google Scholar] [CrossRef]
- Gheisari, M.; Ebrahimzadeh, F.; Rahimi, M.; Moazzamigodarzi, M.; Liu, Y.; Dutta Pramanik, P.K.; Heravi, M.A.; Mehbodniya, A.; Ghaderzadeh, M.; Feylizadeh, M.R.; et al. Deep learning: Applications, architectures, models, tools, and frameworks: A comprehensive survey. CAAI Trans. Intell. Technol. 2023, 8, 581–606. [Google Scholar] [CrossRef]
- Sit, M.; Demiray, B.Z.; Xiang, Z.; Ewing, G.J.; Sermet, Y.; Demir, I. A Comprehensive Review of Deep Learning Applications in Hydrology and Water Resources. Water Sci. Technol. A J. Int. Assoc. Water Pollut. Res. 2020, 82, 2635–2670. [Google Scholar] [CrossRef] [PubMed]
- Li, K.Q.; Chen, Y.; Liu, J.C.; Mu, X.W. Survey of Deep Learning-Based Object Detection Algorithms. Comput. Eng. 2022, 48, 1–12. [Google Scholar]
- Girshick, R.; Donahue, J.; Darrell, T.; Malik, J. Rich Feature Hierarchies for Accurate Object Detection and Semantic Segmentation. In Proceedings of the 2014 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Columbus, OH, USA, 23–28 June 2014; pp. 580–587. [Google Scholar]
- He, K.; Zhang, X.; Ren, S.; Sun, J. Spatial Pyramid Pooling in Deep Convolutional Networks for Visual Recognition. IEEE Trans. Pattern Anal. Mach. Intell. 2015, 37, 1904–1916. [Google Scholar] [CrossRef]
- 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. 2017, 39, 1137–1149. [Google Scholar] [CrossRef]
- Redmon, J.; Divvala, S.; Girshick, R.; Farhadi, A. You Only Look Once: Unified, Real-Time Object Detection. In Proceedings of the 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Las Vegas, NV, USA, 26 June–1 July 2016; pp. 779–788. [Google Scholar]
- Redmon, J.; Farhadi, A. YOLO9000: Better, Faster, Stronger. In Proceedings of the 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Honolulu, HI, USA, 21–26 July 2017; pp. 6517–6525. [Google Scholar]
- Redmon, J.; Farhadi, A. YOLOv3: An Incremental Improvement. arXiv 2018, arXiv:1804.02767. [Google Scholar]
- Bochkovskiy, A.; Wang, C.Y.; Liao, H.Y. YOLOv4: Optimal Speed and Accuracy of Object Detection. arXiv 2020, arXiv:2004.10934. [Google Scholar]
- Jocher, G.; Stoken, A.; Chaurasia, A.; Borovec, J.; Kwon, Y.; Michael, K.; Changyu, L.; Fang, J.; Skalski, P.; Hogan, A.; et al. Ultralytics/Yolov5: v6.0-YOLOv5n ‘Nano’ Models, Roboflow Integration, TensorFlow Export, OpenCV DNN Support; Zenodo: Geneva, Switzerland, 2021. [Google Scholar]
- Ge, Z.; Liu, S.; Wang, F.; Li, Z.; Sun, J. YOLOX: Exceeding YOLO Series in 2021. arXiv 2021, arXiv:2107.08430. [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, Amsterdam, The Netherlands, 11–14 October 2016; pp. 21–37. [Google Scholar]
- Zhang, Z.; Guo, W.; Yu, W.; Yu, W. Multi-task fully convolutional networks for building segmentation on SAR image. J. Eng. 2019, 2019, 7074–7077. [Google Scholar] [CrossRef]
- Chandran, P.; Zoss, G.; Gotardo, P.; Gross, M.; Bradley, D. Adaptive Convolutions for Structure-Aware Style Transfer. In Proceedings of the 2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Nashville, TN, USA, 20–25 June 2021; pp. 7968–7977. [Google Scholar]
- Liu, S.; Qi, L.; Qin, H.; Shi, J.; Jia, J. Path Aggregation Network for Instance Segmentation. In Proceedings of the 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–23 June 2018; pp. 8759–8768. [Google Scholar]
- Chan, K.H.; Im, S.K.; Ke, W. Multiple classifier for concatenate-designed neural network. Neural Comput. Appl. 2022, 34, 1359–1372. [Google Scholar] [CrossRef]
- Im, S.K.; Chan, K.H. Distributed Spatial Transformer for Object Tracking in Multi-Camera. In Proceedings of the 2023 25th International Conference on Advanced Communication Technology (ICACT), Pyeongchang, Republic of Korea, 19–22 February 2023; pp. 122–125. [Google Scholar] [CrossRef]
- Collins, A.M.; O’dea, A.; Brodie, K.L.; Bak, A.S.; Hesser, T.J.; Spore, N.J.; Farthing, M.W. Automated Extraction of a Depth-Defined Wave Runup Time Series From Lidar Data Using Deep Learning. IEEE Trans. Geosci. Remote Sens. 2023, 61, 5700913. [Google Scholar] [CrossRef]
- Gao, M.; Zou, Y.L.; Cao, X.W. Fabric defect detection based on improved YOLOv5 model. Mod. Text. Technol. 2023, 31, 155–163. [Google Scholar]
- Li, K.; Ou, O.; Liu, G.B.; Yu, Z.F.; Li, L. Target Detection Algorithm of Remote Sensing Image Based on Improved YOLOv5. Comput. Eng. Appl. 2023, 59, 207–214. [Google Scholar]
- Zhao, X.D.; Zhang, X.Y. Optimization Algorithm of Autonomous Target Recognition for Unmanned Vehicles Based on YOLOv5. J. Ordnance Eng. 2023, 44, 2732–2744. [Google Scholar]
- Chen, Y.; Liao, F.; Huany, X.; Yang, J.; Gong, H. Multi-scale YOLOv5 solar cell defect detection. Opt. Precis. Eng. 2023, 31, 1804–1815. [Google Scholar] [CrossRef]
- Li, H.J.; Kong, F.C.; Lin, Y. Infrared ship detection algorithm based on improved YOLOv5s. Syst. Eng. Electron. Technol. 2023, 45, 2415–2422. [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. In Proceedings of the AAAI Conference on Artificial Intelligence, Honolulu, HI, USA, 27 January–1 February 2019; pp. 12993–13000. [Google Scholar]
- Yu, J.; Jiang, Y.; Wang, Z.; Cao, Z.; Huang, T. UnitBox: An Advanced Object Detection Network. In Proceedings of the MM ’16: Proceedings of the 24th ACM International Conference on Multimedia, Amsterdam, The Netherlands, 15–19 October 2016; pp. 516–520. [Google Scholar]
Models | Precison/% | Recall/% | TP/Frame | FN/Frame | Fps | Parameter |
---|---|---|---|---|---|---|
SSD | 68.4 | 66.3 | 21 | 38 | 4.5 | 50,175,361 |
Faster-RCNN | 71.6 | 69.5 | 26 | 33 | 5.1 | 61,223,027 |
YOLOv5n | 85.7 | 73.2 | 47 | 12.0 | 10.2 | 1,872,157 |
YOLOv5s | 95.3 | 82.9 | 50 | 8.0 | 10.7 | 7,025,023 |
YOLOX | 95.9 | 83.7 | 50 | 7.5 | 17.6 | 27,106,654 |
YOLOv5x | 96.2 | 85.1 | 52 | 7.5 | 20.6 | 86,224,543 |
BYOLOv5x | 98.9 | 88.3 | 58 | 2.7 | 26.2 | 126,983,623 |
Num | C3NAM | B-SPPCSPC | Focal_EIOU | Detection Layer Scale | P/% | R/% | mAP | mAP@.5:.0.95 | Parameter |
---|---|---|---|---|---|---|---|---|---|
1 | √ | √ | √ | √ | 98.9 | 88.3 | 90.5 | 87.0 | 126,983,623 |
2 | √ | √ | √ | × | 98.1 | 87.9 | 88.6 | 86.5 | 126,763,623 |
3 | √ | √ | × | × | 97.5 | 87.4 | 87.5 | 85.3 | 126,763,623 |
4 | × | √ | √ | × | 97.3 | 88.0 | 87.8 | 85.6 | 126,596,423 |
5 | × | × | √ | √ | 97.6 | 87.8 | 87.2 | 86.7 | 86,664,543 |
6 | √ | × | × | × | 97.1 | 86.8 | 89.4 | 85.1 | 86,611,743 |
7 | × | √ | × | × | 97.6 | 87.3 | 87.4 | 84.9 | 126,376,423 |
8 | × | × | √ | × | 97.8 | 87.7 | 86.7 | 85.4 | 86,004,543 |
9 | × | × | × | √ | 97.4 | 84.5 | 87.5 | 86.2 | 86,004,543 |
10 | × | × | × | × | 95.3 | 85.1 | 86.7 | 84.5 | 86,224,543 |
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
Xu, Y.; Wu, Y.; Guo, Y. A Foam Line Position Detection Algorithm for A/O Pool Based on YOLOv5. Electronics 2024, 13, 1834. https://doi.org/10.3390/electronics13101834
Xu Y, Wu Y, Guo Y. A Foam Line Position Detection Algorithm for A/O Pool Based on YOLOv5. Electronics. 2024; 13(10):1834. https://doi.org/10.3390/electronics13101834
Chicago/Turabian StyleXu, Yubin, Yihao Wu, and Yinzhang Guo. 2024. "A Foam Line Position Detection Algorithm for A/O Pool Based on YOLOv5" Electronics 13, no. 10: 1834. https://doi.org/10.3390/electronics13101834
APA StyleXu, Y., Wu, Y., & Guo, Y. (2024). A Foam Line Position Detection Algorithm for A/O Pool Based on YOLOv5. Electronics, 13(10), 1834. https://doi.org/10.3390/electronics13101834