1. Introduction
Zero Defect Manufacturing (ZDM) has been described as one of today’s most promising strategies. The goal of this strategy is to reduce and mitigate defects in manufacturing processes, or in other words to eliminate defected parts during production [
1,
2]. Surface defect detection provides a boost to the realization of this strategy. Surface defect detection is widely used in various industrial quality inspection processes and is the key parameter to control product quality [
3,
4,
5]. By detecting surface defects during the production process, the damage caused by the uncontrolled machining process can be remedied in advance to prevent the production of defective parts [
6].
Surface defect detection mainly consists of locating the defect location and identifying the defect type. There are many existing studies on surface defect detection. However, most existing studies do not consider the impact of the complex environment in the actual manufacturing process. For example, in the production cutting environment, there are many disturbances from the manufacturing environment (coolant residues or debris). At this time, under the influence of such interference factors, the accuracy of defect detection on surface images using existing research methods is low. Therefore, the main contribution of this paper is to propose a sustainable surface defect detection method. It can remedy the detection link break caused by the existence of interference factors, which has practical industrial application value.
The method is divided into two steps: one is the identification and removal of interference factors; the other is the detection of surface defects. First, the constructed FPN-DepResUnet model and the RFR-net model are used to identify and remove the interfering factors in the surface images, respectively. Then, the surface defects are detected using the proposed SAM-Mask RCNN model. The FPN-DepResUnet model and the SAM-Mask RCNN model proposed in this paper have novel structures. At the same time, all models are experimentally validated, and the results showed the effectiveness of the proposed method. The research content structure of this paper is shown in
Figure 1.
This paper is organized as follows. In
Section 2, some advanced defect detection methods for cutting surfaces are briefly reviewed. In
Section 3, an identification method based on the FPN-DepResUnet model for interference factors is proposed. In
Section 4, the RFR-net model is used to remove the interference factors in the surface images. In
Section 5, a surface defect detection method based on SAM-Mask RCNN model is proposed. Finally, the conclusions are provided in
Section 6.
2. Related Works
With the continuous in-depth research of artificial intelligence technology, the existing research on surface defect detection methods mainly focuses on deep learning. The deep learning method was proposed by Hinton et al. [
7]. Firstly, it has been successfully applied to the classical image classification task. In the existing defect detection literature, there are three types of detection methods: classification, target detection, and segmentation [
8,
9].
In terms of the defect detection of deep learning-based classification network, Tabernik et al. [
10] designed a segmentation network and used it to achieve the classification of defect images. The designed network consists of two parts, segmentation network and decision network, which are trained separately. The network achieves 99.9% classification accuracy in a training set of only 399 samples (50 of which are defective samples). Zhang et al. [
11] proposed a novel model called cost-sensitive residual convolutional neural network (CS-ResNet). This new model solves the problems caused by unbalanced data sets and misclassification of real and fake defects. The model improves the ResNet network in two ways. One is to give greater weight to a small number of true defects based on class imbalance. The second is to optimize CS-ResNet by minimizing the weighted cross-entropy loss function. Ma et al. [
12] proposed an improved DenseNet network to identify the surface defects of polymerized lithium-ion batteries. The classification accuracy of the method is more than 99%.
In terms of the defect detection of deep learning-based target detection networks, the difference between this method and the classification network is that it is not only necessary to determine whether there are defects and defect categories in the image to be detected, but also to determine the location and size of the defects (external rectangle). The network structure of this method mainly includes Faster R-CNN [
13], YOLO (You Only Look Once, YOLO) [
14], SSD (Single Shot Multibox Detector, SSD) [
15], and so on. Zhao et al. [
16] composed the SE network and the SSD network. The authors proposed a new SE-SSD model. This network solves the problem that large target defects and small target defects cannot be better detected at the same time in fabric defect detection. The model is based on the SSD network with the addition of the SE module after its convolution operation. The SE module increases the weight of the model on the feature channels containing defect information. This increases the accuracy in fabric defect detection. Zheng et al. [
17] focused on the problem that wafer surface defects are easily confused with the background and are difficult to detect. A new method for wafer surface defect detection based on background subtraction and Faster R-CNN is proposed. The interference of background is eliminated using image differencing operation. Experimental results show that the proposed method improves the mAP by 5.2% compared to the original Faster R-CNN. Yin et al. [
18] used YOLO V3 network to detect damage defects in sewage pipelines and obtained 85.37% mAP.
With respect to the defect detection of deep learning-based pixel segmentation networks, this method not only realizes the functions of the above two methods, but also obtains the accurate shape and position information of the defects through the segmentation network, so as to achieve a reliable judgment of the surface quality. Uzen et al. [
19] proposed a novel method based on Depth-wise Squeeze and Excitation Block-based Efficient-Unet (DSEB-EUNet) for automatic surface defect detection. The proposed model includes a Unet network, and a deep extrusion and excitation block added to the skip connection of the Unet. Feng et al. [
20] used an improved Encoder-Decoder network to detect surface defects of hydropower dams. This network combines the features of the Encoder–Decoder (Unet) by the pixel-by-pixel addition of feature maps. This can improve the accuracy of defect segmentation. Han et al. [
21] used Faster R-CNN network to detect images that may contain defects. The defects in these images are segmented using the Unet network.
The above detection method has achieved a good detection effect, but it ignores the adverse effects of interference factors in the actual cutting environment. As is well known, due to the effects of the actual industrial cutting environment, mechanical parts can easily produce stains or cutting surfaces contaminated by interference factors (coolant residue or chips). These interfering factors can cover the defect location and affect the sustainability detection of the surface. The surface defect images covered by interference factors are shown in
Figure 2.
Through the literature review and analysis, there are few studies on the sustainable detection of surface defects. Gyimah et al. [
22] proposed a Robustly Completed Local Binary Pattern (RCLBP) framework for surface defect detection. The framework establishes a denoising technique based on a Non-Local (NL) means filter with wavelet thresholding. This denoising technique filters the noise in the image while preserving the texture and edges. The experimental results show that the proposed framework is noise-resistant and can be applied to the detection of surface defects under changing light. However, the accuracy and robustness of this framework can be improved. Yang et al. [
23] proposed an anti-interference roughness detection method based on deep learning. This method combines the CNN model, CBAM Res Net semantic segmentation model, and PConv Net image painting model. The experimental results show that the surface roughness detection accuracy of the proposed method is 90.0% under the influence of interference factors. The proposed method depends on the regular texture structure and is characterized by poor detection accuracy. Deng et al. [
24] used a Yolo V2 network to detect crack defects on concrete surface. The ability of the network to detect real defects in complex backgrounds is trained by adding coating interference to the acquired images. The mAP of this method is 77%. Sun et al. [
25] proposed a surface defect detection system for printing fabric based on an accelerated robust feature algorithm. The detection system is used to detect the defects of white silk, spots, and wrinkles on fabric products. The two-way unique matching method is used to reduce the interference of mismatch points and realize the precise positioning of defects. The experimental results show that the system has 98% accuracy in detecting surface defects of printed fabrics.
The above defect detection methods still need to be improved in two aspects: first, most of the studies only consider the texture interference or noise interference on the image, which does not meet the needs of practical industrial application scenarios. Second, the use of image processing technology can easily cause the distortion of the processed surface image and weak adaptability. Therefore, in order to promote the realization of the ZDM strategy, it is very necessary to carry out research on sustainable defect detection suitable for actual industrial production. The main idea of this paper is to first identify and remove the interference factors in the surface, and then to detect the surface defects. Through the analysis, the Unet model is selected to identify the interference factors. This is because the Unet model has the advantages of a simple structure, running speed block, and high detection accuracy. At the same time, with the help of the “portrait repair” idea, this paper selects the RFR-net network model to remove the interference factors. This is because the RFR-net network model is one of the existing models with a better repair effect. Finally, the Mask RCNN model is selected for surface defects. This is because the model is simpler and more flexible and has high segmentation accuracy than traditional methods.
In this paper, the authors conduct an in-depth study based on the Unet model and the Mask RCNN model. First, the shortcomings of both models are analyzed in the case of practical industrial applications. On this basis, the paper proposes the corresponding solution to optimize and improve the structure of the two models. Finally, the two newly constructed model structures are tested using the dataset. The test results also show that the two newly constructed model structures have higher detection accuracy and better practical application value. Meanwhile, it also demonstrates the novelty and effectiveness of the newly proposed sustainability detection method.
5. Surface Defect Detection Based on SAM-Mask RCNN Model
Through the above research, the FPN-DepResUnet model can be used to identify and locate different interference regions in the image and obtain the “mask” results of the interference regions. Further, RFR-net is used to remove the interference regions in the image with the “mask” result as the input. The removal process is such that the pixels in the interference regions are filled with high-quality features similar to those in the rest of the image. The continuous filling process eliminates the negative effects of environmental disturbances on the surface defect detection process. Based on the acquired clean surface images, this section conducts defect detection research.
The surface defect detection in the cutting process is not only to accurately detect the type and location of defects, but also to detect the region contour of each defect. According to the region contour of the detected defect, the number of pixels of each defect and the area proportion of the defect regions can be calculated. At the same time, the above calculated information is quickly fed back to the cutting staff. Based on the feedback information (frequency and area ratio of defects) from multiple inspection results, the staff will take appropriate measures in advance to make changes to the current machining process, such as changing the tool. This can prevent greater damage to the surface being machined and achieve predictive maintenance and control of surface machining quality. Through the above analysis, Mask RCNN [
31] is selected as the surface defect detection network in this paper.
5.1. Mask RCNN Model
The model structure of Mask RCNN is shown in
Figure 13. Mask RCNN is a small and flexible general-purpose object instance segmentation framework. It can not only detect the targets in the image, but also provide a high-quality segmentation result for each detected target. The whole network structure consists of two parts; one is Backbone for feature extraction, and the other is Head for classification, image regression prediction, and “mask” prediction for each ROI. In the backbone part, Mask RCNN uses Resnet101 as the backbone feature extraction network. The extracted four effective features are used to construct the Feature Pyramid Network (FPN). FPN can realize multi-scale fusion of feature maps extracted by backbone feature extraction network. Region Proposal Network (RPN) is used to help the network obtain the suggestion box. The suggestion box is to filter whether there is a defect target in which region of the image. RoIAlign is used to deal with the problem that the mask in the detection results is not aligned to the defect region in the original image. The head part classifies the ROI obtained by the network, predicts the image regression, and predicts the “mask”.
5.2. SAM-Mask RCNN Instance Segmentation Module
This section aims at defect segmentation to improve the segmentation structure of the Mask RCNN model. Firstly, the defect of the Mask RCNN instance segmentation model is analyzed. The Mask RCNN instance segmentation model uses a simple deconvolution operation to recover the mask of the defect. This approach can easily lead to the loss of defect edge information features, resulting in the problem of inaccurate defect identification. To address the above problems, this section proposes a Mask RCNN instance segmentation model based on the serial attention mechanism (SAM-Mask RCNN instance segmentation model). The defect feature information is enhanced at the channel level and at the spatial level to reduce the problem of defect information loss in the convolution operation.
5.2.1. Mask RCNN Instance Segmentation Model
The defect segmentation is to separate the defect and the background to better identify the shape and position information of the defect. The running process and the number of layers of the segmentation model of Mask RCNN are shown in
Figure 14. First, the feature map obtained from the RoIAlign layer is convoluted four times, and then the mask is obtained after the deconvolution operation. Finally, the number of channels in the mask is adjusted by convolution to match the number of target species. Although the Mask RCNN can recover the belonging category of pixels, its recognition ability for defect edges is poor. The reason for the detection is the reduced resolution and lost details after the deconvolution operation.
5.2.2. SAM-Mask RCNN Instance Segmentation Model
The attention mechanism can effectively improve the detection performance of deep networks. The purpose of introducing the attention mechanism in the model is to add weight values to each feature point of the feature layer, and to automatically enhance the original feature layer based on the weight of the feature points. Attention mechanisms include the channel attention mechanism [
32] and the spatial attention mechanism [
33]. The channel attention mechanism and the spatial attention mechanism only enhance the feature layer from a single perspective, ignoring several factors in the actual computation process. Therefore, this section proposes a Serial Attention Mechanism (SAM). SAM integrates the channel attention mechanisms and the spatial attention mechanisms to make them work serially together. Specifically, before deconvolution, the feature layer is first fed into the SAM for channel feature enhancement. After deconvolution, the feature layer is fed back into the SAM for feature recovery enhancement. Among them, the channel attention mechanism uses the correlation between the category features of different channels to perform feature reinforcement and improve the classification accuracy. The spatial attention mechanism can simulate the connection between different local features and promote the classification accuracy between features. The structure and operational process of SAM is shown in
Figure 15. The running process and number of layers of the SAM-Mask RCNN instance segmentation model is shown in
Figure 16.
5.3. Model Training and Discussion of Results
5.3.1. Model Training
The training process uses 1000 images selected from the surface defect image without interference dataset. The labelme tool is used to label defects in the images before training. In the training process, in order to increase the robustness of the data, the data enhancement method is used to expand the training data. The total number of extended images is 10,000. Among them, 9000 are the training set and 1000 are the test set. The training process also introduces the pre-training weight with good generalization. The loss curves of the SAM-Mask RCNN instance segmentation model are shown in
Figure 17.
5.3.2. Results and Discussion
The evaluation of the model selects two universal indicators: MIoU and MPA. In order to verify the superiority of the proposed SAM-Mask RCNN instance segmentation model, the common segmentation algorithms such as Mask RCNN, Unet, and DeepLab V3+ are also trained on the same data set, experimental environment, and hyperparameters. These popular segmentation algorithms are used by many researchers as a criterion to evaluate the superiority of the proposed algorithms. After training, two evaluation indexes are calculated for each of the four models. The model evaluation results are shown in
Table 3. Compared with the other three networks, the SAM-Mask RCNN instance segmentation model has maximum improvements of 4.74% and 3.39% in the MIoU index and the MPA index, respectively. The defect detection results of the SAM-Mask RCNN instance segmentation model is shown in
Figure 18. After calculation and testing, the detection speed of the model for a single surface image is 0.94 s. The output of test results includes category, probability, and area proportion of each defect. From the test results, it can be seen that the model can identify the edge part of the defect region well and accurately. At the same time, the detection result can provide the cutting process guidance for the cutting staff. On the one hand, when the proportion of the defect region in the surface image starts to increase, it indicates that the cutting tool has a large amount of wear or damage. At this point, the cutting staff should replace the tool with a new one. On the other hand, if the tool does not show much wear and breakage, this indicates that the current cutting process parameters do not match the material being cut. At this point, the cutting staff should adjust the cutting process parameters, such as cutting speed, feed per tooth, etc.
This paper integrates interference factors removal and defect detection to achieve sustainable detection of surface defects. The identification and removal of the interference factors are achieved using the FPN-DepResUnet model and the RFR-net model, respectively. On this basis, the SAM-Mask RCNN model is used to effectively detect and provide information feedback on the clean defect images. This provides guidance for the predictive maintenance of the surface quality.
6. Conclusions
ZDM is one of the main goals of advanced manufacturing. In the aerospace, railway, automobile, and other vital industries, there is an increasing need to monitor the surface quality of production parts to ensure zero defects. Surface defect detection provides technical support to achieve this goal, which has been studied by many scholars. However, the problem of surface defect detection affected by environmental interference factors (chips or coolant residual) in the cutting process is rarely studied, which is a difficult point in existing research. In addition, these interference factors are complex and variable, with different shapes, which also brings challenges to the research process. Interference factors hinder the sustainable detection of surface defects. To solve this problem, this paper proposes a sustainable detection method for surface defects. The method is divided into two steps: one is the identification and removal of interference factors; the other is the detection of surface defects.
Identification and elimination of interfering factors: The Unet model is used as the research basis to identify the interfering factors. First, the shortcomings of the Unet model are analyzed. Then, the structure of the Unet model is optimized from three aspects of parameter number, training performance, and feature information fusion, and a new FPN-DepResUnet model is constructed. The effectiveness of each optimization aspect of the proposed FPN-DepResUnet model is verified by ablation experiments. Compared with the Unet model, MIoU and MAP of the FPN-DepResUnet model increased by 5.86% and 5.77%, and Params reduced by 29.90%. Accurate identification of the interference factors is achieved by the FPN-DepResUnet model. Furthermore, the interfering factors are removed using the RFR-net model.
Detection of the surface defects: Based on the above research, clean surface images are obtained. SAM-Mask RCNN model is constructed to solve the problem of Mask RCNN model segmentation of the defect edge in the image. Then, the SAM-Mask RCNN model is used to perform effective defect detection on the surface image and feedback the detection information. The proposed SAM-Mask RCNN model has an accuracy of 94.62% for defect detection. Compared with the other traditional segmentation models (such as Mask RCNN, Unet and DeepLab V3+), the SAM-Mask RCNN model has maximum improvements of 4.74% and 3.39% in the MIoU index and the MPA index, respectively. The feedback information includes defect type, number of pixels in the defect regions, and area ratio of the defect regions. At the same time, the feedback information can provide the cutting process guidance for the cutting staff.
The method proposed in this paper solves the problem of detecting defects on surfaces with interference factors and achieves the goal of sustainable detection of surface defects. The method proposed in this paper can maintain a high accuracy of 94.62% for surface defect detection under the influence of complex environmental interference factors. The study in this paper still has some shortcomings. In this paper, the study assumes that there are only two major interfering factors in the environment. However, there will be some other interference factors in the actual production environment, for example, dust. In addition, this paper also assumes that the detection time of a single image within 3 s can meet the application requirements of industrial production. These shortcomings are also problems and challenges to be faced and overcome in the future research process. Further research results based on this paper will provide strong technical support for the active control of machining surface quality, which is conducive to the realization of the ZDM strategy.