# A Feature-Oriented Reconstruction Method for Surface-Defect Detection on Aluminum Profiles
## 4 Experimental Results and Discussion
### Comparative Experiments
#### 4.4.2 Model Comparison Experiment  
In order to evaluate the performance of the surface-defect detection method for aluminum profiles described in this paper, in this section, the detection method is compared with three unsupervised detection methods, namely, Masked Auto-Encoders (MAE), Variational Auto-Encoders (VAE) incorporating feature-optimization methods (VAE + ROF), and the Generative Adversarial Network (GAN) incorporating feature-optimization methods (GAN + ROF). In this paper, measures of recall (RC), precision (PR), accuracy (Acc), the \(F1\) value, and the ROC curve are used as indicators to evaluate the performance of aluminum profile surface-defect detection. \(RC\), \(PR\), and \(F1\) are defined as follows:  
\[RC=\frac{TP}{TP+FN} \tag{34}\]  
\[PR=\frac{TP}{TP+FP} \tag{35}\]  
\[F1=\frac{2 PR\times RC}{PR+RC} \tag{36}\]  
where \(TP\) denotes the number of non-defective samples detected correctly, \(FN\) denotes the number of defective samples detected incorrectly, and \(FP\) denotes the number of non-defective samples detected incorrectly. \(PR\) and \(RC\) are used to evaluate the quality of the model's detection results, and the \(F1\) value is an index used to reflect the overall detection results of the model. The ROC curve is called the Subject Operating Characteristic curve, in which the horizontal axis is the false-positive rate (\(FPR\)) and the vertical axis is the true-positive rate (\(TPR\)). Scholars often use the ROC curve to evaluate the effectiveness of a model, and the closer the curve is to the upper left corner, the more accurate the work of the subject, that is, the better the detection effect. \(FPR\), \(TPR\) are defined as follows:  
\[FPR=\frac{FP}{FP+TN} \tag{37}\]  
\[TPR=\frac{TP}{TP+FN} \tag{38}\]  
where \(TN\) denotes the number of pixels that successfully detected a non-defective region. The three algorithms were experimented with in terms of detection accuracy and ROC curves, and their reconstruction-comparison diagrams are shown in Figure 18, with the experimental results shown in Figure 19 (The black dashed line in the figure is the reference line.) and Tables 1 and 2. Figure 17: Partial feature-optimization image binarization results. Figure 19: Comparison of ROC curves for the four assays. \begin{tabular}{c c c c} \hline \hline
**Model** & **PR** & **RC** & **F1** \\ \hline VAE + ROF & 0.686 & 0.603 & 0.642 \\ GAN + ROF & 0.624 & 0.584 & 0.598 \\ MAE & 0.850 & 0.751 & 0.798 \\ Ours & 0.974 & 0.931 & 0.952 \\ \hline \hline \end{tabular}   
As can be seen from Table 1, the precision of this aluminum profile dataset on MAE, VAE incorporating feature-optimization methods, and the Generative Adversarial Network are 0.850, 0.686 and 0.624, respectively. The recall is 0.751, 0.603 and 0.584, respectively, while the \(F1\) values are 0.798, 0.642, and 0.598, respectively. Compared with other classical models, the precision rate, recall rate, and \(F1\) value of this paper's model are improved by at least 12.4%, 18%, and 15.4%, respectively. The experiments show that the model in this paper can effectively eliminate the interference of complex textures on the surface of aluminum profiles and improve the detection accuracy. The results of comparison with Models from the literature [41] are shown in Table 3:  
Figure 18: Comparison of the effects of different model reconstructions. The DPAE method is the unsupervised detection method for aluminum profiles proposed in this literature. As can be seen from Table 2, the _PR_, _TPR_, _TNR_, _F1_, and _AUC_ of the aluminum profile dataset of the Aliyun Tianchi Competition from this method are 98.2%, 97.6%, 97.9%, 97.9%, and 97.7%, respectively; all of these values are significantly higher than those detected using the methods of AE(L2), AE(SSIM), VAE, AnoGAN, GANomaly, and DPAE Results.