Submit manuscript...
eISSN: 2574-9927

Material Science & Engineering International Journal

Research Article Volume 8 Issue 3

Detection and classification of metal surface defects using lite convolutional neural network (LCNN)

Al-Mahmud Al-Mamun,1 Md Rasel Hossain,2 Mst Mahfuza Sharmin3

1Department of Computer Science and Engineering, Islamic University, Bangladesh
2Department of Arts, National University, Bangladesh
3Department of Mathematics, National University, Bangladesh

Correspondence: Al Mahmud Al Mamun, Department of computer science and engineering, Islamic University, Bangladesh

Received: June 20, 2024 | Published: July 3, 2024

Citation: Al-Mamun AM, Hossain MR, Sharmin MM. Detection and classification of metal surface defects using lite convolutional neural network (LCNN). Material Sci & Eng Int J. 2024;8(3):72-76. DOI: 10.15406/mseij.2024.08.00239

Download PDF

Abstract

Quality control in metal product manufacturing relies heavily on accurately detecting and classifying surface defects through visual inspection. Recently, convolutional neural networks (CNNs) have shown promising results in automating this process with high accuracy. This research paper proposes a new (experimental version) Lite Convolutional Neural Network (LCNN) designed to analyze image data to detect and classify surface defects on metallic surfaces. Our model was trained on a metal surface defects dataset comprising 1800 images of six different types of surface defects. Despite using relatively small datasets, the proposed LCNN version achieves a classification accuracy of 91.67%, highlighting its effectiveness in real-world defect detection scenarios.

Keywords: neural network, patches defect, metal surface

Abbreviations

LCNN, lite convolutional neural network; CNNs, convolutional neural networks; IN, inclusion defect; CR, crazing defect; PA, patches defect; PS, pitted surface defect; SC, scratches defect; RS, rolled-in scale defect

Introduction

Ensuring the quality of metal products is crucial in various industries to meet stringent standards and customer expectations. Visual inspection remains a primary method for detecting surface defects, which can affect product integrity and performance. However, manual inspection processes are time-consuming, subjective, and prone to human error. To address these challenges, automated defect detection systems based on deep learning techniques have gained significant attention. Recent studies have demonstrated the capability of Convolutional Neural Networks (CNNs)1 to effectively analyze and classify image data, making them suitable candidates for automating defect detection tasks. This research presents a novel approach using a deep neural network model, a new Lite Convolutional Neural Networks (LCNN) version specifically tailored for inspecting metallic surface defects.2 The model was trained on a widely recognized dataset of 1800 images, each depicting one of six common surface defects.

Our primary objective is to achieve high accuracy in defect detection and classification, which is crucial for enhancing quality control processes in metal manufacturing. Despite the relatively small training dataset, experimental results showcase a promising classification accuracy of 91.67% on the test set. This underscores the efficacy of our proposed method in accurately identifying and categorizing surface defects under realistic manufacturing conditions. In this paper, we detail our deep neural network's architecture and training methodology, provide insights into the dataset used, and discuss the implications of our findings for industrial applications. The results affirm the feasibility and practicality of leveraging LCNNs for automating quality control processes in metal product manufacturing, paving the way for improved efficiency and reliability in defect detection systems.

Related work

The detection and classification of metal surface defects have been extensively studied. Various approaches leverage machine learning and artificial neural network techniques to enhance the accuracy and efficiency of defect detection systems. Early methods for detecting metal surface defects relied on traditional image processing techniques, such as edge detection, thresholding, and morphological operations. For example, Tsai and Hsiao3 proposed an edge detection-based method for identifying surface defects in steel strips, achieving moderate success. However, these techniques often struggled with complex and varied defect patterns, leading to high false positive and false negative rates. Huang et al.4 address the growing demand for high-quality metal workpieces in mechanized industries. They introduced an image processing and machine learning-based automatic defect detection and classification system. By leveraging SVM and KNN classifiers on extracted grayscale, shape, and HOG characteristics, their system achieves an average recognition rate of 92.6%, distinguishing between genuine and false defects.

Liu et al.5 proposed an advanced machine-learning approach using video streams for real-time metal surface defect detection. Their method employs Renyi's entropy to select critical statistical and structural features, outperforming conventional decision-tree classifiers in accuracy and efficiency. Recent advancements in metal surface defect detection highlight the evolution towards more efficient and accurate methodologies. Wang et al.6 emphasize the inefficiencies of traditional methods and have proposed a YOLO-v5-based real-time detection network. Their approach integrates a multi-scale explore block and spatial attention mechanism to effectively capture diverse defect features, achieving approximately 72% mean Average Precision (mAP) while maintaining real-time processing capabilities.

Zhu et al.7 introduced the L Swin Transformer, a novel architecture combining convolutional embedding and attention patch merging modules with a depth multilayer perceptron. Their model, adapted from the Swin Transformer, achieves a mean average precision of 81.2% on a steel-surface defect dataset, demonstrating superior performance in feature extraction and global dependency building compared to existing methods. The evolution of defect detection methods, from traditional image processing to advanced deep learning techniques, has significantly enhanced the accuracy and efficiency of metal surface inspection systems. Convolutional neural networks, particularly when combined with transfer learning, data augmentation, and hybrid models, represent the current state-of-the-art in this domain. This provides a strong foundation for further research and development, aiming to achieve even higher performance and adaptability in defect detection applications.

Methodology

This section introduces the Lite Convolutional Neural Network (LCNN), an experimental variant designed to detect and classify surface defects on metallic surfaces. Traditional approaches to defect detection often face computational efficiency and scalability challenges, particularly in industrial settings where real-time processing is crucial. The LCNN addresses these challenges by offering a streamlined architecture that balances model complexity with performance metrics. The methodology for this research comprises several key steps, including dataset preparation, model design, training, and evaluation. (Figure 1)

Figure 1Workflow diagram.

Dataset preparation

The dataset utilized in this research was sourced from the North Eastern University (NEU) Metal Surface Defects Database, a widely recognized repository for studying surface defects in hot-rolled steel strips. This dataset encompasses six distinct types of typical surface defects, each critical to the integrity and quality of steel products.

Inclusion defect (In):Inclusions are unwanted particles in metal castings that can seriously impact mechanical properties. These defects can vary in size and composition. While some inclusions may be loosely attached and prone to detachment, others are firmly embedded and pressed into the metal plate, affecting surface finish and structural integrity.

Crazing defect (Cr): Crazing refers to fine crack networks that appear on the surface of the metal. These cracks can compromise the material's mechanical properties and lead to further deterioration under stress or environmental exposure.

Patches defect (Pa): Patches are localized areas on the metal surface that exhibit distinct characteristics from the surrounding material. These could be texture, color, or composition variations, often resulting from processing anomalies or material inconsistencies.

Pitted surface defect (PS): Pitting is a form of localized corrosion that manifests as small, deep holes on the metal surface. These pits are typically narrow in diameter but can penetrate deeply into the metal, posing significant risks to the structural integrity and longevity of the product.

Scratches defect (Sc):Scratches are linear abrasions or marks caused by mechanical actions such as scraping or sliding. These defects can vary in depth and length, potentially affecting the metal's aesthetic quality and surface properties.

Rolled-in scale defect (RS): Rolled-in scale defects occur when oxidized layers of mill scale are embedded into the metal surface during the rolling process. This defect can create surface irregularities and impact the visual and functional quality of the finished product. The dataset is comprised of a total of 1,800 grayscale images, with 300 samples for each of the six defect categories. Each image has a 200×200 pixel resolution, providing sufficient detail for defect analysis while maintaining manageable computational requirements. The dataset was divided into three model training and evaluation subsets: training, validation, and test sets. The training set includes 276 images from each defect category, amounting to 1,656. This subset is utilized to learn the patterns and features associated with each defect type. The validation set consists of 24 images per category, totaling 144 images, and is used for tuning hyperparameters and preventing overfitting during the training process. Finally, the test set comprises 24 images from each defect class, totaling 144 images, and assesses the model’s performance and generalization capability on unseen data. (Figure 2)

Figure 2 NEU grayscale images.

Model design

The proposed model architecture for defect detection and classification on metallic surfaces uses the Keras Sequential API. It comprises convolutional and fully connected layers tailored for image classification tasks. The model's architecture is below. (Table 1) The model includes two convolutional layers, each with 128 filters of size 2×2 and ReLU activation functions. These layers detect features in the input images. Following each convolutional layer, max-pooling layers with pool size 2×2 are employed to reduce the spatial dimensions of the feature maps, thereby reducing the computational load of the model and the risk of overfitting. Flatten layer converts the 2D feature maps into a 1D vector, preparing the data for the fully connected layers. We use two dense layers with 256 and 128 neurons, respectively, using ReLU activation, and they are included to learn complex data representations. A dropout rate 0.2 is applied to prevent overfitting by randomly setting 20% of the input units to zero during training. The final dense layer consists of six neurons with softmax activation, corresponding to the six defect classes, to output the class probabilities.

Layer (type)               

Output shape             

Parameters

Conv2D

(None, 199, 199, 128)

1664

MaxPooling2D

(None, 99, 99, 128)     

0

Conv2D

(None, 98, 98, 128)      

65664

MaxPooling2D

(None, 49, 49, 128)     

0

Flatten

(None, 307328)           

0

Dense

(None, 256)              

78676224

Dense

(None, 128)           

32896

Dropout

(None, 128)              

0

Dense

(None, 6)                

774

Table 1 Model – sequential

Training and evaluation

The LCNN model was compiled using the Adam optimizer, which is known for its efficiency and adaptability in training deep learning models. The categorical cross-entropy loss function was used, as it is suitable for multi-class classification tasks. The model was trained for 24 epochs with a batch size of 24. The trained LCNN model was evaluated on the test set comprising 144 images, with 24 images from each defect class. The evaluation metrics included accuracy, precision, recall, and F1-score, comprehensively assessing the model’s performance. The training and testing results demonstrated a classification accuracy of 91.61% and 91.67%, respectively, indicating the model's effectiveness in detecting and classifying metal surface defects.

Result analysis

The training and testing results of the experimental version of Lite Convolutional Neural Network (LCNN) on the Metal Surface Defects Database unequivocally demonstrate the model's robustness, establishing it as a reliable and effective classifier. (Figure 3) The model's training loss of 0.2536 and an accuracy of 91.67% are clear indicators of its effective learning from the training data, with minimal error. The high accuracy further confirms the model's ability to correctly classify most training samples. Upon evaluation of the test set, the model reported a loss of 0.2536 and an accuracy of 91.67%. These metrics closely mirror those obtained during training, implying that the model generalizes well to unseen data. This consistency between training and testing performance suggests that the model has not overfitted to the training data and retains its predictive power on new data.

Figure 3 Train results.

A more granular analysis of the test results shows that out of 16 test images, 14 were classified correctly, and two were classified incorrectly. This demonstrates an accuracy rate of 87.5% for the specific batch of test images evaluated. (Figure 4) The model's overall performance, as evidenced by the training and testing metrics, is commendable. The training and the test accuracy highlight the model's capacity to learn and generalize effectively. The detailed evaluation of the batch of test images further substantiates this with an accuracy rate. These results underscore the model's efficacy in the given task, demonstrating its strong capability to accurately classify metal surface defect images. Future work will focus on further reducing the test loss and improving the accuracy through additional training, data augmentation, or model optimization techniques.

Figure 4 Generalized test results.

Conclusion

The proposed experimental version of the Lite Convolutional Neural Network (LCNN) model demonstrates robust performance in detecting and classifying surface defects on the Metal Surface Defects Database, achieving an accuracy of 91.67%. The comprehensive analysis of losses and accuracies confirms the model's effectiveness and reliability for practical applications in quality control within the metal manufacturing industry. Future work will expand the dataset and refine the model to achieve even higher accuracy and address the minor misclassifications observed.

Acknowledgments

None.

Conflicts of interest

The authors declare that there is no conflicts of interest.

References

Creative Commons Attribution License

©2024 Al-Mamun, et al. This is an open access article distributed under the terms of the, which permits unrestricted use, distribution, and build upon your work non-commercially.