# Copper Strip Surface Defect Detection Model Based on Deep Convolutional Neural Network
## 4 Experiments and Results
### Experimental Results and Analysis  
The error loss function value and the accuracy of the model training process after 2000 epochs of training are shown in Figure 10. It can be seen from Figure 10g,h that the error loss of the model on the training and validation sets respectively reached 0.25 and 0.34, and the overall training process performed relatively smoothly, indicating the good learning capability of the model. The accuracy of the training and validation sets respectively reached 0.93 and 0.95 after the training process, which indicated that the model had a certain generalisation capability. As shown in Figure 10a-f, compared with the other three models, the training process of the model in this paper is more stable, and there are no problems, such as over fitting or local oscillation. This also shows the effectiveness of the training strategy in this paper. The model was used to predict the defect images of the 'unseen' testing set to further verify the accuracy and generalisation capability. Meanwhile, the performance of three recognition models (VGG16, MobileNetV2, and ResNet50) was compared on the same testing set, and the result is shown in Table 4. Among these results, the recognition accuracies of the VGG16, MobileNetV2, and ResNet50 are 75.27%, 65.83%, and 82.78%, respectively. Figure 8: Training strategy of the model. Figure 9: Recognition models are established by other three CNNs: (**a**) VGG16, (**b**) MobileNetV2, and (**c**) ResNet50. Compared with the three models, the accuracy of the model proposed in this paper is the highest at 93.05%. Compared with traditional methods [9; 36], the accuracy of the model and the ability to recognize the number of defect classifications are improved. The average recognition times of VGG16, MobileNetV2, and ResNet50 for a single defect image are 2412, 165, and 1205 ms, respectively. The model in this paper is 197 ms, which is similar to MobileNetV2. Considering the accuracy and the recognition speed, the model proposed in this paper is the best and can meet the engineering requirements (industrial production generally requires that the detection accuracy of the model should be higher than 90%). Figure 10: _Cont._  
Figure 12 shows the class activation mapping (CAM) of the model for eight defect classifications in this paper. The deep red colour area in the figure places considerable importance for model defect classification. It can be seen from the figure that the model has good overall recognition performance for defect features. The LM and Pe both present linear decision areas, but significant differences are found between the two defects, which are easily distinguished. The decision areas of BS, EC, Ho, and IS present a clustering block range with a certain similarity, which easily makes them susceptible to the influence of the original image feature, causes confusion, and leads to misidentification. The decision area of CP and Sm has a certain degree of dispersibility. The CP and Sm respectively show local and global dispersions. This finding indicates that the proposed model in this paper has indeed learned the key feature information from various defect classifications. Figure 11: Proposed model recognition result probability of each defect image on the testing set: (**a**) LM, (**b**) BS, (**c**) CP, (**d**) EC, (**e**) Ho, (**f**) IS, (**g**) Pe, and (**h**) Sm. A confusion matrix of training and testing sets is established to further analyse the reason for incorrect model recognition, which is shown in Figure 13. Figure 13a,b reveals that the longitudinal and horizontal axes respectively represent the true classification and model prediction classification labels. The value on the diagonal axis represents the accuracy of the recognition result, whilst that deviating from the diagonal represents the error rate of the recognition result. The depth of the colour in this figure corresponds to the value of the correct rate. The diagonal colour reveals that the proposed model in this paper has a good capability of learning and generalisation.