Deep Learning-Based Automated Industrial Surface Defect Classification
Abstract
1. Introduction
2. Background and Literature Review
2.1. Surface Defect Detection and Classification
2.2. Corrosion Detection Using Deep Learning
2.3. Deep Learning for Surface Defect Classification
2.4. Summary and Research Gaps
3. Materials and Methods
3.1. Dataset Description
3.1.1. Phase5_Capstone Corrosion Dataset
3.1.2. NEU Surface Defect Database
3.1.3. Merged Dataset Preparation and Preprocessing
3.2. Data Preprocessing and Data Augmentation
3.2.1. Data Preprocessing
- Resizing: All images were resized to 224 × 224 pixels to align with the input requirements of the VGG16 model and to ensure consistency across both datasets.
- Normalization: Each pixel value was adjusted to fit within the [0, 1] range by dividing it by 255. This normalization speeds up convergence during training and ensures a more stable learning process.
- Data Cleaning: An automated Python 3.11 script was used to remove corrupted, incomplete, or hidden image files, ensuring that the dataset remains consistent and minimizing the risk of training errors.
- Split: The dataset was split into training (80%), validation (10%), and test (10%) sets to guarantee a balanced representation of all eight categories in each subset.
- Stratified k-fold cross-validation: To ensure the fairness of the model, stratified k-fold cross-validation was used to preserve class balance.
3.2.2. Data Augmentation
3.3. Deep Learning Models
3.3.1. YOLOv8 Model
3.3.2. VGG16 Convolutional Neural Network
3.4. Model Training and Experimental Setup
- Dimensions: 224 × 224 pixels;
- Batch size: 32;
- Optimizer: Adam;
- Epochs: 30 for YOLOv8; 50 for VGG16 experiments;
- Early stop: to prevent overfitting and learning rate scheduling.
3.5. Performance Evaluation
- Accuracy noisy = performance under noisy input;
- Accuracy clean = baseline performance under clean conditions.
4. Results and Discussion
4.1. Hyperparameter Tuning (VGG16)
Exp1 (Baseline): Learning rate 0.001, dropout 0.5, only fully connected layers trained; convolutional layers frozen. Serves as the reference for comparison.Exp2 (Tuned): Learning rate 0.0005, dropout 0.4, last four convolutional layers unfrozen. Tests sensitivity to smaller learning steps and slightly less regularization.Exp3 (Tuned Advanced): Learning rate 0.0001, dropout 0.5, last four convolutional layers fine-tuned for improved stability and performance.
4.2. YOLOv8 Model Performance
4.3. VGG16 (CNN) Model Performance
4.4. 10-Fold Cross-Validation
4.5. Stratified K-Fold Cross Validation
4.6. Comparative Analysis with State-of-the-Art
4.7. Discussion and Implications for Industry
4.7.1. Evaluation of Model Performance
4.7.2. Inference Efficiency and Deployment Considerations
4.7.3. Robustness and Sensitivity to Environmental Factors
4.7.4. Evaluation of Model Generalization and Robustness
5. Conclusions and Recommendations
- Deployment in Real Industrial Settings: The advanced capabilities of YOLOv8 inference speed and accuracy make it feasible for real-time utilization in industrial manufacturing applications. The model is applicable in camera surveillance systems that offer surface inspection and real-time defect detection [39].
- Hybrid Model Techniques: Further investigations might include incorporating the benefits of both approaches, using YOLOv8 for quick detection and VGG16 (or other CNN models) for further verification. Such approaches are likely to provide enhanced performance in highly complex industrial settings.
- Improvement of Model Robustness: To improve model performance under difficult conditions (such as dim light, occlusions, or surface contamination), further procedures should include data augmentation, domain adaptation, and noise injection during training.
- Adoption of Transformer-Based Architectures: It would also be interesting to investigate recent vision transformer (ViT)-based CNN approaches that could enhance global feature extraction and improve robustness, particularly for detecting corrosion under varying conditions [40].
- Optimization of Edge: Creating a more efficient version of YOLO, such as YOLOv8n or YOLOv8s-tiny, enables deployment on embedded systems and provides energy-efficient, prompt responses for field-based monitoring tasks.
- Dataset Expansion and Diversity: Using more practical images from industries with diverse surface types and environmental conditions would help the model better handle new defect patterns.
- Integration into Predictive Maintenance Frameworks: The output of the classification system can be effectively integrated into maintenance planning systems and digital twin technology, enabling an informed, data-driven maintenance approach for vital infrastructure in the oil and gas industry in the Kingdom. Graphical user interfaces can significantly increase system utilization across various smartphone platforms [41].
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Malashin, I.; Tynchenko, V.; Nelyub, V.; Borodulin, A.; Gantimurov, A.; Krysko, N.V.; Shchipakov, N.A.; Kozlov, D.M.; Kusyy, A.G.; Martysyuk, D.; et al. Deep Learning Approach for Pitting Corrosion Detection in Gas Pipelines. Sensors 2024, 24, 3563. [Google Scholar] [CrossRef] [PubMed]
- Casas, E.; Liu, H.; Kim, S. A comparative study of YOLOv5 and YOLOv8 for corrosion segmentation in industrial applications. Array 2024, 22, 100351. [Google Scholar] [CrossRef]
- Sun, P. Deep Learning for Automated Corrosion Detection. 2012. Available online: https://github.com/pjsun2012/Phase5_Capstone-Project (accessed on 30 January 2024).
- Cohn, K.S. NEU-Cluster: A Dataset for Surface Defect Classification. GitHub Repository. 2025. Available online: https://github.com/rccohn/NEU-Cluster (accessed on 29 October 2025).
- LeCun, Y.; Bengio, Y.; Hinton, G. Deep learning. Nature 2015, 521, 436–444. [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, Nevada, 27–30 June 2016; pp. 779–788. [Google Scholar]
- Katsamenis, I.; Protopapadakis, E.; Doulamis, A.; Doulamis, N.; Voulodimos, A. Pixel-level corrosion detection on metal constructions by fusion of deep learning semantic and contour segmentation. In Lecture Notes in Computer Science; Springer: San Diego, CA, USA, 2020; Volume 12509, pp. 160–169. [Google Scholar]
- Matthaiou, A.; Papalambrou, G.; Samuelides, M.S. Corrosion detection with computer vision and deep learning. In Developments in the Analysis and Design of Marine Structures, 1st ed.; CRC Press: Boca Raton, FL, USA, 2021; pp. 289–296. [Google Scholar]
- Brandoli, B.; de Geus, A.R.; Souza, J.R.; Spadon, G.; Soares, A.; Rodrigues, J.F.; Komorowski, J.; Matwin, S. Aircraft fuselage corrosion detection using Artificial Intelligence. Sensors 2021, 21, 4026. [Google Scholar] [CrossRef] [PubMed]
- Forkan, A.R.M.; Kang, Y.-B.; Jayaraman, P.P.; Liao, K.; Kaul, R.; Morgan, G.; Ranjan, R.; Sinha, S. CorrDetector: A framework for structural corrosion detection from drone images using ensemble deep learning. Expert. Syst. Appl. 2021, 193, 116461. [Google Scholar] [CrossRef]
- Munawar, H.; Ullah, F.; Shahzad, D.; Heravi, A.; Qayyum, S.; Akram, J. Civil infrastructure damage and corrosion detection: An application of machine learning. Buildings 2022, 12, 156. [Google Scholar] [CrossRef]
- Burton, B.; Nash, W.T.; Birbilis, N. RustSEG-Automated segmentation of corrosion using deep learning. arXiv 2022. [Google Scholar] [CrossRef]
- Tasnim, Z.; Saha, S.; Wazih, A.T.; Mahmud, S.N.; Paul, S.; Aonty, S.S. A Comprehensive Deep Learning based Approach for Corrosion Detection of Industrial Machinery and Tools. In 2025 International Conference on Electrical, Computer and Communication Engineering (ECCE); IEEE: Chittagong, Bangladesh, 2025; pp. 1–6. [Google Scholar] [CrossRef]
- Yu, L.; Yang, E.; Luo, C.; Ren, P. AMCD: An accurate deep learning-based metallic corrosion detector for MAV-based real-time visual inspection. J. Ambient. Intell. Humaniz. Comput. 2023, 14, 8087–8098. [Google Scholar] [CrossRef]
- Lemos, R.; Cabral, R.; Ribeiro, D.; Santos, R.; Alves, V.; Dias, A. Automatic detection of corrosion in large-scale industrial buildings based on artificial intelligence and unmanned aerial vehicles. Appl. Sci. 2023, 13, 1386. [Google Scholar] [CrossRef]
- Guzmán-Torres, J.J.A.; Domínguez-Mota, F.J.; Martínez-Molina, W.; Naser, M.Z.; Tinoco-Guerrero, G.; Tinoco-Ruíz, J.G. Damage detection on steel-reinforced concrete produced by corrosion via YOLOv3: A detailed guide. Front. Built Environ. 2023, 9, 1144606. [Google Scholar] [CrossRef]
- Effendi, M.K.; Atmaja, B.; Wahjudi, A.; Purwanto, D.B. Automated corrosion detection on steel structures using convolutional neural network. Int. J. Mech. Eng. Sci. 2023, 7, 36. [Google Scholar] [CrossRef]
- Rosati, R.; Romeo, L.; Cecchini, G.; Tonetto, F.; Viti, P.; Mancini, A.; Frontoni, E. From knowledge-based to big data analytic model: A novel IoT and machine learning based decision support system for predictive maintenance in Industry 4.0. J. Intell. Manuf. 2023, 34, 107–121. [Google Scholar]
- Farooqui, M.; Rahman, A.; Alsuliman, L.; Alsaif, Z.; Albaik, F.; Alshammari, C.; Sharaf, R.; Olatunji, S.; Althubaiti, S.W.; Gull, H. A Deep Learning Approach to Industrial Corrosion Detection. Comput. Mater. Contin. 2024, 81, 2587–2605. [Google Scholar] [CrossRef]
- Cohn, R.; Holm, E. Unsupervised machine learning via transfer learning and k-means clustering to classify materials image data. Integr. Mater. Manuf. Innov. 2021, 10, 231–244. [Google Scholar] [CrossRef]
- Dubey, P. Deep Learning-Powered Visual Inspection for Metal Surfaces: A Systemic Image-Centric Approach for Small Size Defect Detection. Ph.D. Dissertation, Iowa State University, Ames, IA, USA, 2023. [Google Scholar]
- Yang, J.; Majeed, A.P.P.A.; Ateeq, M.; Omar, Z.; Jailani, R.; Musa, R.M.; Luo, Y.; Yahya, N.M. Surface defect classification: Leveraging transformer and transfer learning models for enhanced precision in industrial applications. Int. J. Adv. Manuf. Technol. 2025, 139, 4141–4152. [Google Scholar] [CrossRef]
- Yang, S.; Xie, Y.; Wu, J.; Huang, W.; Yan, H.; Wang, J.; Wang, B.; Yu, X.; Wu, Q.; Xie, F. CFE-YOLOv8s: Improved YOLOv8s for Steel Surface Defect Detection. Electronics 2024, 13, 2771. [Google Scholar] [CrossRef]
- Lema, D.G.; Sánchez-González, L.; Usamentiaga, R.; Delacalle, F.J. Benchmarking deep learning models for surface defect detection: A reproducible and statistically-rigorous approach. J. Intell. Manuf. 2025, 37, 3001–3018. [Google Scholar] [CrossRef]
- Li, R.; Jin, M.; Paquit, V.C. Geometrical defect detection for additive manufacturing with machine learning models. Mater. Des. 2021, 206, 109726. [Google Scholar] [CrossRef]
- Westphal, E.; Seitz, H. A machine learning method for defect detection and visualization in selective laser sintering based on convolutional neural networks. Addit. Manuf. 2021, 41, 101965. [Google Scholar] [CrossRef]
- Jain, S.; Seth, G.; Paruthi, A.; Soni, U.; Kumar, G. Synthetic data augmentation for surface defect detection and classification using deep learning. J. Intell. Manuf. 2022, 33, 1007–1020. [Google Scholar]
- Singh, S.A.; Desai, K.A. Automated surface defect detection framework using machine vision and convolutional neural networks. J. Intell. Manuf. 2023, 34, 1995–2011. [Google Scholar]
- Zheng, X.; Zheng, S.; Kong, Y.; Chen, J. Recent advances in surface defect inspection of industrial products using deep learning techniques. Int. J. Adv. Manuf. Technol. 2021, 113, 35–58. [Google Scholar] [CrossRef]
- Wan, G.; Fang, H.; Wang, D.; Yan, J.; Xie, B. Ceramic tile surface defect detection based on deep learning. Ceram. Int. 2022, 48, 11085–11093. [Google Scholar] [CrossRef]
- Dey, B.; Goswami, D.; Halder, S.; Khalil, K.; Leray, P.; Bayoumi, M.A. Deep learning-based defect classification and detection in SEM images. In Metrology, Inspection, and Process Control XXXVI; SPIE: Washington, DA, USA, 2022; p. PC120530Y. [Google Scholar]
- Souza, R.M.; Nascimento, E.G.; Miranda, U.A.; Silva, W.J.; Lepikson, H.A. Deep learning for diagnosis and classification of faults in industrial rotating machinery. Comput. Ind. Eng. 2021, 153, 107060. [Google Scholar] [CrossRef]
- Stephen, O.; Madanian, S.; Nguyen, M. A hard voting policy-driven deep learning architectural ensemble strategy for industrial products defect recognition and classification. Sensors 2022, 22, 7846. [Google Scholar] [CrossRef] [PubMed]
- Torres, J. YOLOv8 Architecture: A Deep Dive into Its Architecture. YOLOv8. Available online: https://yolov8.org/yolov8-architecture/ (accessed on 8 December 2025).
- Goodfellow, I.; Bengio, Y.; Courville, A. Deep Learning; MIT Press: Cambridge, MA, USA, 2016. [Google Scholar]
- Simonyan, K.; Zisserman, A. Very deep convolutional networks for large-scale image recognition. arXiv 2015, arXiv:1409.1556. [Google Scholar]
- VGGNet-16 Architecture: A Complete Guide. Kaggle. Available online: https://www.kaggle.com/code/blurredmachine/vggnet-16-architecture-a-complete-guide (accessed on 8 December 2025).
- Kunkel, N. Deep learning-based automated defect classification for steel surface defects. Int. J. Adv. Manuf. Technol. 2024, 4, 2427401. [Google Scholar] [CrossRef]
- Rahman, A. Solar Panel Surface Defect and Dust Detection: Deep Learning Approach. J. Imaging 2025, 11, 287. [Google Scholar] [CrossRef] [PubMed]
- Rahman, A.; Ahmed, M.S.; AlBugami, K.N.; Alabbad, A.Y.; AlFantoukh, A.A.; Alshaikhahmed, Y.H.; Alzahrani, Z.S.; Khan, M.A.A.; Youldash, M.; Alshahrani, S.M. PPE-EYE: A Deep Learning Approach to Personal Protective Equipment Compliance Detection. Computers 2026, 15, 45. [Google Scholar] [CrossRef]
- Imran, M.H.; Jamaludin, S.; Khan, M.I.; Rahman, A.-U.; Ayob, A.F.M.; Bin Daud, M.Z.; Bin Ahmad, M.F.; Alqahtani, A.; Ahmad, S.Z.A.B.S.; Afrizal, N.B. Ship structure corrosion detection using advanced image processing, active contour algorithm, and parallel processing. Ocean. Eng. 2025, 341, 122351. [Google Scholar] [CrossRef]
















| Ref. | Year | Methodology | Dataset | Key Findings |
|---|---|---|---|---|
| [7] | 2020 | FCN, U-Net, Mask R-CNN | 116 images | Higher accuracy and efficiency than traditional methods |
| [8] | 2021 | CNN (texture), color-based, SSD (TL) | Real images | SSD performed best for real applications |
| [9] | 2021 | DenseNet (pre-trained) | 210 images | Accuracy 92.2% |
| [10] | 2021 | CNN | 573 images | Accuracy 92.5%, F1 98% |
| [11] | 2022 | Deep CNN + CycleGAN + U-Net | 1300 images | Acc 98.9%, mIoU 87.8%, Prec 84.9%, Rec 81.8%, F1 83.3% |
| [12] | 2022 | CNN (RustSEG) | 1200 + 1600 images | Acc 86.81%, AUC 94.82%, Prec 89.38%, Rec 83.86%, F1 86.53% |
| [13] | 2025 | Yolov5 up to Yolov9 | CORROD dataset | (mAP) of 96.4% with 4 ms inference time |
| [14] | 2023 | AMCD vs. YOLO/SSD/RetinaNet | 5625 images | mAP 84.96%, best performance |
| [15] | 2023 | Mask R-CNN | 8400 images | Prec 85.8%, Rec 84.0% |
| [16] | 2023 | YOLOv3 (Darknet-53) | 159 → 790 images | Precision 82.12% |
| [17] | 2023 | CNN (MobileNetV1 SSD) | 200 images | Loss 1.673, Acc 84.66% |
| [18] | 2023 | ML (DT, RF, SVM, LR) | 1848 instances | DT accuracy 99.9% |
| [19] | 2024 | CNN, YOLOv8, EfficientNetB0 | 1000 images | CNN and EfficientNetB0: 100%; YOLOv8: 95%, 100%, 90%, 94.47% |
| Ref. | Year | Methodology | Dataset | Key Findings |
|---|---|---|---|---|
| [20] | 2021 | VGG16 (pre-trained CNN) | NEU-DET, 1800 images | 99.4 ± 0.16% accuracy |
| [17] | 2023 | CNN (MobileNetV1 SSD) | 200 images | Loss 1.673, accuracy 84.66% |
| [21] | 2023 | YOLOv5 + bootstrapping | GC10-DET, 2300 images | ~95% recall and mAP; +10–30% improvement |
| [22] | 2025 | Transfer learning models | NEU-DET, 1800 images | DenseNet201 and ViT 100% accuracy, VGG16 and VGG19 79.6% and 83.3% accuracy |
| [23] | 2024 | CFE-YOLOv8 | NEU-DET (1800), GC10-DET (2300) | mAP@0.5: 77.8%/69.5% |
| [25] | 2021 | ML (Bagging, RF, GB, KNN, SVM) + 3D patches | 50 synthetic point clouds (100k points) | F-measure > 90%; Bagging and RF best; patch = 20; SVM fastest |
| [26] | 2021 | CNN + TL (VGG16, Xception) | Small datasets | VGG16 best: Acc 95.8%, Prec 93.9%, Rec 98%, F1 95.9%, AUC 0.982 |
| [27] | 2022 | GAN + CNN augmentation | NEU, 1800 images | Sensitivity 90.28→95.33%, Specificity 98.06→99.16% |
| [28] | 2022 | ResNet-101 + SVM | Roller defect images | 100% precision (Good class); low data and compute |
| [29] | 2023 | ResNet50 + Faster R-CNN | Production data | 98.2% accuracy; reduced runtime |
| [30] | 2022 | Improved YOLOv5s | Tianchi dataset | Acc 94.27%, F1 89.95%, mAP 92.8%, FPS 83.3 |
| [31] | 2023 | Ensemble DL (RetinaNet + ResNet/VGG) | SEM images | Improved mAP; robust classification |
| YOLOv8 | Accuracy | Precision | Recall | F1-Score | FPS | Robustness |
| 96% | 98% | 98% | 98% | 2143.2 | 75.20% |
| CNN (VGG16) | Accuracy | Precision | Recall | F1-Score | FPS | Robustness |
| 100% | 100% | 100% | 100% | 82.6 | 61.2% |
| Fold | VGG16 Accuracy | YOLOv8 Accuracy |
|---|---|---|
| 1 | 0.9253 | 0.982 |
| 2 | 0.9339 | 0.985 |
| 3 | 0.9395 | 0.987 |
| 4 | 0.9395 | 0.986 |
| 5 | 0.9452 | 0.984 |
| 6 | 0.9481 | 0.989 |
| 7 | 0.9568 | 0.988 |
| 8 | 0.9193 | 0.987 |
| 9 | 0.8674 | 0.985 |
| 10 | 0.8703 | 0.986 |
| Mean Accuracy | 0.9245 | 0.9859 |
| Model | Avg Accuracy | Avg F1-Score |
|---|---|---|
| YOLOv8 | 0.9857 ± 0.0037 | 0.9857 ± 0.0037 |
| VGG16 | 0.9255 ± 0.0146 | 0.9254 ± 0.0147 |
| Method | Accuracy (%) | Precision (%) | Recall (%) | F1-Score (%) |
|---|---|---|---|---|
| Proposed VGG16 | 100 | 100 | 100 | 100 |
| Proposed YOLOv8 | 96 | 98 | 98 | 98 |
| [22] ViT and ResNet201 | 100 | N/A | N/A | N/A |
| [22] VGG16 and VGG19 | 79.6% and 83.3% | N/A | N/A | N/A |
| [38] YOLOv8 | 95.0 | 100 | 90 | 94.7 |
| [38] CNN | 100 | 100 | 100 | 100 |
| [3] CNN + YOLOv8 | 88.0 | 85 | 87 | 86 |
| [20] CNN (VGG16) | 99.4 | N/A | N/A | N/A |
| Model | A Stratified 10-Fold Cross-Validation | Train/Validation/Test Split |
|---|---|---|
| VGG16 | 92.5% | 100% |
| YOLOv8 | 98.5% | 96% |
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. |
© 2026 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.
Share and Cite
Alrayes, R.; Rahman, A. Deep Learning-Based Automated Industrial Surface Defect Classification. Computers 2026, 15, 417. https://doi.org/10.3390/computers15070417
Alrayes R, Rahman A. Deep Learning-Based Automated Industrial Surface Defect Classification. Computers. 2026; 15(7):417. https://doi.org/10.3390/computers15070417
Chicago/Turabian StyleAlrayes, Rana, and Atta Rahman. 2026. "Deep Learning-Based Automated Industrial Surface Defect Classification" Computers 15, no. 7: 417. https://doi.org/10.3390/computers15070417
APA StyleAlrayes, R., & Rahman, A. (2026). Deep Learning-Based Automated Industrial Surface Defect Classification. Computers, 15(7), 417. https://doi.org/10.3390/computers15070417

