## 3 Experimental Results
### Model Verification Experiment
#### 3.2.4 Defect Calculation and Analysis  
Deep neural networks have obvious advantages in feature extraction and fine-grained information acquisition, but large models take up significant computing space, and the defect features automatically extracted by neural networks are abstract, which is often not conducive to further analysis. The image moment has the characteristics of translation, rotation, and scale invariance. It is convenient to identify image features subjectively and simply. Among them, the 0-order moment represents the sum of the pixels, and the calculation formula is shown in Formula (22):  
\[M_{00}=\sum_{\mathbf{I}}\sum_{J}V(i,j). \tag{22}\]  
The 1-order moment represents the product of the \(X\)-axis and \(Y\)-axis coordinates and their corresponding pixels in the rectangular coordinate system, and the calculation formula is shown in Formula (23):  
\[M_{10}=\sum_{I}\sum_{J}i\cdot V(i,j);M_{01}=\sum_{I}\sum_{J}j\cdot V(i,j). \tag{23}\]  
The centroid of the region to be studied is determined based on Formula (23) and shown in Formula (24):  
\[x_{c}=\frac{M_{10}}{M_{00}};y_{c}=\frac{M_{01}}{M_{00}}. \tag{24}\]  
In this paper, using image processing technology and combining the characteristics of the 0-order moment (determination of the area of the target area) and the 1-order moment (determining the centroid of the target area), defect analysis is carried out on six kinds of samples with correct prediction output by the classification network, and the image processing results are shown in Figure 18.  
Figure 18: Image processing flow. (**a**) Original images. (**b**) Image preprocessing. (**c**) Boundary tracking algorithm. (**d**) Connected-domain calibration. (**e**) ROI extraction. (**f**) Centroid localization.  
First, the original image (a) is preprocessed (b), the boundary tracing algorithm (c) is executed on the image after threshold segmentation and the perimeter of the defect area is calculated. Then, (b) the connected region is segmented. (d) It is convenient to extract the ROI of the defect feature. (e) The defect area is calculated. All the connected defect areas are marked with the same color, and the defects in each connected region are successfully segmented. Finally, the specific positions of all kinds of defects are determined by the centroid localization algorithm (f). The calculation results of the area and perimeter of various defects are shown in Table 7. We also specifically designed the proportion of defects and the area perimeter ratio (K) of defective parts to analyze the defects of each part.  
In addition, in order to accurately locate the salient region of the defect being focused on by the neural network, we visualize the feature extraction results of the SARSN network by heat map, as shown in the results. Figure 19a is the original input image, and Figure 19b is the visualization result of the salient region, in which the dark color represents the area of focus of the neural network. From the results in the graph, it can be seen that the classification network can capture the distribution of some defects, indicating that our method can accurately identify the defect location through feature extraction.  
According to the analysis in Table 7, the K values of Cr and Ps defects distributed in dense patches are all above 0.2, which indicates that these defects are characterized by small particles with a wide and dense distribution. The K values of In, Rs and Sc defects are distributed at approximately 0.1, which shows that this kind of defect has integrity and connectivity. However, the K value of Pa-type defects is less than 0.05, which indicates that Pa defects have the characteristics of a wide distribution area and high connectivity. Therefore, these characteristics can be used as the evaluation index of the defect grade of strip steel, which is of great significance in quantifying the defects of strip steel.