Skip to Content
  • Proceeding Paper
  • Open Access

13 April 2026

6 Pages

Detection and Segmentation of Surface Corrosion in Steel-Based Hand Tools Using You Only Look Once Version 8 †

,
and
School of Electrical, Electronics, and Computer Engineering, Mapúa University, Manila 1002, Philippines
*
Author to whom correspondence should be addressed.
†
Presented at the 7th Eurasia Conference on IoT, Communication and Engineering 2025 (ECICE 2025), Yunlin, Taiwan, 14–16 November 2025.

Abstract

A YOLOv8-based instance segmentation model is developed for detecting and segmenting surface corrosion in steel hand tools in this study. The model was trained using a 7000-image custom dataset and deployed on a Raspberry Pi 5-based setup with a controlled lighting environment. The testing results showed an overall segmentation precision of 86.62%, a recall of 82.90%, and an F1-score 84.72%. Corrosion segmentation struggles with a precision of 75.02%, a recall of 17.40%, an F1-score of 28.25% and a Dice coefficient of 72.21%, demonstrating effective tool detection and classification, but it struggles on small corrosion patches, emphasizing the need for architectural and dataset enhancements.

1. Introduction

Steel hand tools, such as screwdrivers, pliers, wrenches, saws, and hammers, are commonly used in industrial and household applications due to their versatility and durability. However, despite the use of high-grade steel alloys, these tools remain susceptible to corrosion, which means that they require regular inspection for corrosion formation [1,2]. Traditional nondestructive testing methods, including Thermography, Ground-penetrating radars, and X-ray, are effective but are limited by costs and potential health concerns, as well as their limited practicality for routine and simple monitoring [3].
Corrosion progressively degrades tool quality when tools are stored in humid or chloride-rich environments, which accelerate the degradation process and lead to uniform, pitting, or crevice corrosion depending on the alloy composition and environmental conditions [4,5,6,7]. Previous studies have employed image processing techniques, such as gray-level co-occurrence matrices and hue–saturation–intensity color thresholds, to identify reddish-brown, rough regions characteristic of rust [8,9]. Although effective, these methods often suffer from limited inference speed and reduced robustness under varying lighting conditions. In contrast, deep learning-based approaches have emerged as efficient, low-cost alternatives, with algorithms such as the Mask Region-Based Convolutional Neural Network demonstrating high accuracy in detecting corrosion on galvanized iron sheets, bridges, and steel plates [10,11,12].
Further advances in deep learning establish the YOLO family model as state-of-the-art for object detection [13] and segmentation due to its speed in real-time applications [14] and high accuracy compared to its CNN counterparts [15]. YOLO models are used in a wide variety of applications, including fruit ripeness detection [16], shell waste detection [17], and defect classification [18], and showcase detection [19] and classification capability [20]. YOLOv8 introduces cross-stage partial with 2f blocks and decoupled detection and classification heads, improving segmentation precision in corrosion assessment tasks [11,21]. Studies using YOLO on corrosion segmentation focused on industrial objects and structures. However, the potential of YOLOv8 has not been widely researched in corrosion detection and segmentation on smaller and widely handled objects like tools.
YOLO models, such as YOLOv8, are well-suited for deployment on edge devices, including the Raspberry Pi 5. This device has enhanced hardware capabilities that provide improved performance in deep learning inference compared to previous iterations [22,23]. Researchers have utilized the Raspberry Pi in conjunction with a camera, input–output hardware such as a touchscreen LCD, and a light source [24,25,26,27]. Such configurations have been applied to tasks including the corrosion detection and segmentation of small objects. These and similar studies evaluated system performance using metrics such as precision, recall, F1-score, and mean average precision (mAP). For example, ref. [28] employed these metrics to assess detection and classification reliability, as each provides a complementary measure of how accurately YOLO-based models identify and localize objects.

2. Materials and Methods

2.1. System Development

Figure 1 presents the system workflow, illustrating the input–process–output sequence. The system input consists of tool images captured using the Raspberry Pi 5 camera. These images are processed by the model to generate bounding boxes identifying the tool type and segmentation masks highlighting corrosion regions.
Figure 1. System workflow.
Figure 2 depicts the hardware configuration employed in this study, which includes the Raspberry Pi 5 as the computing unit, the Raspberry Pi Camera Module 3 as the input device, and a Waveshare 5-inch touchscreen LCD for output display.
Figure 2. Hardware configuration employed in this study.
The program flow begins with the loading of the trained model and proceeds according to the process outlined in Figure 3, producing bounding boxes for tool classification and segmentation masks for corrosion detection.
Figure 3. Software workflow.

2.2. Data Gathering and Processing

In the experimental setup, we use a custom white wooden light box with dimensions of 60 × 40 × 55 cm (L × W × H). The camera module is positioned 45 cm above the floor, directly facing the tools placed at the center of the box surface. The system developed in this study is illustrated in Figure 4. The tool and the LCD are positioned at the front of the system. The Raspberry Pi 5, power supply, and the centrally mounted camera module are included with LED strips installed along the edges of the upper section of the image capture compartment.
Figure 4. System components.
The dataset comprises hammers, saws, wrenches, pliers, and screwdrivers. A total of 1000 images were collected, evenly distributed across tool types, with samples containing both corroded and non-corroded tools. The dataset was partitioned into three subsets: 70% for training, 15% for validation, and 15% for testing. To enhance model robustness, the training set was augmented using Roboflow with transformations such as flipping, rotation, cropping, shear, brightness adjustment, exposure variation, and noise addition, resulting in a total of 7000 training images.

3. Results

A total of 150 test images from the experiment setup were used to test the deployed model at a 50% confidence level. In the test, 30 images from each tool type were used. Based on Table 1, the model correctly identified all the tools, resulting in the high accuracy of tool identification and classification.
Table 1. Confusion matrix for tool detection.
The testing result of the model’s segmentation performance indicates that it performs well overall. However, when focusing on localized regions of corrosion, it does not detect small areas of damage. This limitation results in a low F1-score, as reported in Table 2, which is primarily attributable to the very low recall.
F 1 − s c o r e = 2 × P r e c i s i o n × R e c a l l P r e c i s i o n + R e c a l l
Table 2. Segmentation metrics.
Focusing on the segmentation performance for corrosion, the Dice coefficient was employed to evaluate class-level segmentation accuracy. Table 3 presents the results, indicating that the model achieved a Dice coefficient of 72.21%, which reflects the proportion of correctly segmented corrosion regions relative to the ground truth. This value demonstrates that the model accurately masks approximately 72% of the corroded area.
D i c e   C o e f f i c i e n t = 2 × M a s k   A r e a   I n t e r s e c t i o n M a s k   A r e a   I n t e r s e c t i o n + M a s k   A r e a   U n i o n
Table 3. Dice coefficient of corrosion.
Figure 5 illustrates the model’s predictions on five different tools from the test set. In each case, the model correctly identifies the tool class and detects corrosion patches. The examples demonstrate reliable performance on larger objects; however, smaller corrosion patches are frequently missed. Predictions with confidence scores below 50% are excluded from the output.
Figure 5. Tool detection and corrosion segmentation testing set samples.

4. Conclusions and Recommendations

We developed a YOLOv8s-seg-based detection and segmentation model for surface corrosion in steel hand tools, deployed on a Raspberry Pi 5. The system achieved robust classification and segmentation performance, with an overall precision of 86.62%, a recall of 82.90%, an mAP50 of 83.82%, and an F1-score of 84.72%. Nonetheless, the model struggled with the segmentation of smaller corrosion regions, yielding a Dice coefficient of 72.21% and an F1-score of 28.25%. The reduced F1-score is primarily attributable to the low recall rate of 17.40%, reflecting the model’s difficulty in detecting fine corrosion patches.
To improve system performance, broader and higher-resolution datasets must be used to capture greater variability in corrosion patterns and expand the range of hand tools considered. Modifying the model architecture to enhance small-object segmentation could also mitigate the current limitations. Finally, the system should be evaluated against established nondestructive corrosion testing procedures to benchmark its effectiveness.

Author Contributions

Conceptualization, A.G.B.T., V.A.B.R. and A.N.Y.; methodology, A.G.B.T. and V.A.B.R.; software, A.G.B.T. and V.A.B.R.; validation A.G.B.T. and V.A.B.R.; writing—original draft preparation, A.G.B.T. and V.A.B.R.; writing—review and editing, A.G.B.T., V.A.B.R. and A.N.Y.; visualization, A.G.B.T. and V.A.B.R.; supervision, A.N.Y. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Data Availability Statement

The raw data supporting the conclusions of this article will be made available by the authors on request.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Adaskin, A.M.; Sapronov, I.Y. Corrosion-resistant steel for metal-shop tools. Russ. Eng. Res. 2012, 32, 301–304. [Google Scholar] [CrossRef] [Scilit]
  2. Han, Q.; Zhao, N.; Xu, J. Recognition and location of steel structure surface corrosion based on unmanned aerial vehicle images. J. Civ. Struct. 2021, 11, 1375–1392. [Google Scholar] [CrossRef] [Scilit]
  3. Ali, A.A.I.M.; Jamaludin, S.; Imran, M.M.H.; Ayob, A.F.M.; Ahmad, S.Z.A.S.; Akhbar, M.F.A.; Suhrab, M.I.R.; Ramli, M.R. Computer vision and image processing approaches for corrosion detection. J. Mar. Sci. Eng. 2023, 11, 1954. [Google Scholar] [CrossRef] [Scilit]
  4. Alcántara, J.; de la Fuente, D.; Chico, B.; Simancas, J.; Díaz, I.; Morcillo, M. Marine atmospheric corrosion of carbon steel: A review. Materials 2017, 10, 406. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  5. Permsuwan, P.; Sancharoen, P.; Tangtermsirikul, S.; Sreearunothai, P.; Viyanit, E. Corrosion of different types of steel in atmospheric and tidal marine environment of Thailand. Eng. J. Res. Dev. 2011, 22, 17–24. [Google Scholar]
  6. Roberge, P.R. Corrosion Engineering: Principles and Practice, 1st ed.; McGraw-Hill: New York, NY, USA, 2008; pp. 147–164. [Google Scholar]
  7. Hilti Corporation. Corrosion Handbook, 1st ed.; Hilti: Schaan, Liechtenstein, 2015; pp. 5–9. [Google Scholar]
  8. Bo, X.; Yijun, W. Corrosion recognition of transmission line armour clamp based on computer vision. In Proceedings of the 2nd International Conference on Intelligent Perception and Computer Vision (CIPCV 2024), Xiamen, China, 17–19 May 2024. [Google Scholar]
  9. Khayatazad, M.; De Pue, L.; De Waele, W. Detection of corrosion on steel structures using automated image processing. Dev. Built Environ. 2020, 3, 100022. [Google Scholar] [CrossRef] [Scilit]
  10. Elamparo, P.; Telan, E.; Ibarra, J. Rust detection on galvanized iron sheets using convolutional neural network and Mask R-CNN. In Proceedings of the IEEE 14th Control and System Graduate Research Colloquium (ICSGRC 2023), Shah Alam, Malaysia, 5 August 2023. [Google Scholar]
  11. Ameli, Z.; Nesheli, S.J.; Landis, E.N. Deep learning-based steel bridge corrosion segmentation and condition rating using Mask R-CNN and YOLOv8. Infrastructures 2024, 9, 3. [Google Scholar] [CrossRef] [Scilit]
  12. Son, E.Y.; Jeong, D.Y.; Oh, M.J. Corrosion area detection and depth prediction using machine learning. Int. J. Nav. Archit. Ocean Eng. 2024, 16, 100617. [Google Scholar] [CrossRef] [Scilit]
  13. Diwan, T.; Anirudh, G.; Tembhurne, J.V. Object detection using YOLO: Challenges, architectural successors, datasets and applications. Multimed. Tools Appl. 2023, 82, 9243–9275. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  14. Terven, J.; Córdova-Esparza, D.M.; Romero-González, J.A. A comprehensive review of YOLO architectures in computer vision: From YOLOv1 to YOLOv8 and YOLO-NAS. Mach. Learn. Knowl. Extr. 2023, 5, 83. [Google Scholar] [CrossRef] [Scilit]
  15. Du, J. Understanding of object detection based on CNN family and YOLO. J. Phys. Conf. Ser. 2018, 1004, 012029. [Google Scholar] [CrossRef] [Scilit]
  16. Yumang, A.N.; Rubia, D.C.; Yu, K.P.G. Determining the ripeness of edible fruits using YOLO and the OVA heuristic model. In Proceedings of the IEEE 14th International Conference on Humanoid, Nanotechnology, Information Technology, Communication and Control, Environment, and Management (HNICEM 2022), Boracay Island, Philippines, 1–4 December 2022. [Google Scholar]
  17. Padilla, D.A.; Mariano, E.J.; Caysido, C.N.A. Detection of shell waste on sea sand using YOLOv5 model. In Proceedings of the 7th International Conference on Information and Computer Technologies (ICICT 2024), Honolulu, HI, USA, 15–17 March 2024. [Google Scholar]
  18. Luis, V.; Quinones, M.; Yumang, A.N. Classification of defects in robusta green coffee beans using YOLO. In Proceedings of the IEEE International Conference on Artificial Intelligence in Engineering and Technology (IICAIET 2022), Kota Kinabalu, Malaysia, 13–15 September 2022. [Google Scholar]
  19. Suarez, G.I.; Cubilla, N.I.; Hortinela, C.C. Defect classification of green coffee beans using YOLOv8. In Proceedings of the 6th IEEE International Conference on Artificial Intelligence in Engineering and Technology (IICAIET 2024), Kota Kinabalu, Malaysia, 26–28 August 2024. [Google Scholar]
  20. Medina, J.K.; Tribiana, P.J.; Villaverde, J.F. Disease classification of Oranda goldfish using YOLO object detection algorithm. In Proceedings of the 15th International Conference on Computer and Automation Engineering (ICCAE 2023), Sydney, Australia, 3–5 March 2023; IEEE: Piscataway, NJ, USA, 2023; pp. 249–254. [Google Scholar]
  21. Casas, E.; Ramos, L.; Romero, C.; Rivas-Echeverría, F. A comparative study of YOLOv5 and YOLOv8 for corrosion segmentation tasks in metal surfaces. Array 2024, 22, 100351. [Google Scholar] [CrossRef] [Scilit]
  22. Ahmad, B.; Noon, S.K.; Ahmad, T.; Mannan, A.; Khan, N.I.; Ismail, M.; Awan, T. Efficient real-time detection of plant leaf diseases using YOLOv8 and Raspberry Pi. VFAST Trans. Softw. Eng. 2024, 12, 250–259. [Google Scholar] [CrossRef] [Scilit]
  23. Tarsia, E. Installation and Machine Learning of Artificial Intelligence on Raspberry Pi Platforms. 2024. Available online: https://www.theseus.fi/bitstream/handle/10024/852852/Tarsia_Elias.pdf?sequence=2 (accessed on 21 October 2024).
  24. Javierto, D.P.; Martin, J.D.; Villaverde, J.F. Robusta coffee leaf detection based on YOLOv3-MobileNetv2 model. In Proceedings of the IEEE 13th International Conference on Humanoid, Nanotechnology, Information Technology, Communication and Control, Environment, and Management (HNICEM 2021), Manila, Philippines, 28–30 November 2021. [Google Scholar]
  25. Yadao, G.G.; Julkipli, O.M.; Manlises, C.O. Performance analysis of EfficientNet for rice grain quality control—An evaluation against YOLOv7 and YOLOv8. In Proceedings of the 7th International Conference on Information and Computer Technologies (ICICT 2024), Honolulu, HI, USA, 15–17 March 2024; IEEE: Piscataway, NJ, USA, 2024; pp. 93–98. [Google Scholar]
  26. Tuason, T.D.; Garcia, J.D.; Manlises, C.O. Cat eye disease classifier using YOLOv5. In Proceedings of the 7th International Conference on Information and Computer Technologies (ICICT 2024), Honolulu, HI, USA, 15–17 March 2024; IEEE: Piscataway, NJ, USA, 2024; pp. 199–203. [Google Scholar]
  27. Asenci, A.G.; Bulawan, J.E.; Padilla, D.A. Canned food surface defect classification using YOLOv4. In Proceedings of the 5th International Seminar on Research of Information Technology and Intelligent Systems (ISRITI 2022), Yogyakarta, Indonesia, 8–9 December 2022. [Google Scholar]
  28. Imperial, S.; Lucas, A.; Caya, M.V. Vehicle type classification and counting using YOLOv4 algorithm. In Proceedings of the 4th IEEE International Conference on Artificial Intelligence in Engineering and Technology (IICAIET 2022), Kota Kinabalu, Malaysia, 13–15 September 2022. [Google Scholar]
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.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.