# Automated Surface Defect Inspection Based on Autoencoders and Fully Convolutional Neural Networks
## 3 Experimental Results
### Numerical Evaluation  
In addition to the visualization, the numerical evaluation of the proposed algorithm is also included in this study. For the gold finger images, the evaluation is based on the receiver operating characteristic (ROC) curve [28] of a test set containing 64 images of normal or defective samples. The ROC curve is acquired by plotting the true positive rate (TPR) against false positive rate (FPR) at various threshold settings. Let \(A\) and \(B\) be  
Figure 15: Examples of the input samples, their ground truth, and inspection results for the backplate of a display card: (**a**) input samples; (**b**) ground truth; (**c**) inspection results. the total number of normal and defective samples in the test set, respectively. Among \(A\) normal samples, let \(C\) be the number of samples which are incorrectly found to be defective. In addition, let \(D\) be the number of samples correctly found to be defective among the \(B\) defective samples. We then define TPR=\(D/B\), and FPR=\(A/C\), respectively. Figure 16 shows the resulting ROC for the proposed algorithm and the AE algorithms in [14; 24]. To achieve fair comparisons, the AEs of all the algorithms are based on the architecture shown in Figure 4. The training set for the AE in [14] contains only images from normal samples. By contrast, the AE in [24] is a denoiser trained by images corrupted by Gaussian noises with noise-free images as ground truth. Based on the ROC curves, the area under ROC (AUROC) of each algorithm is also measured. As shown in Table 4, the AUROC for the proposed algorithm and algorithms in [14; 24] are 0.978, 0.690, and 0.859, respectively. The study in [14] does not perform well because the AE is trained by only normal images. It may not be able to effectively remove defective parts of test images for template matching. Based on the denoiser AE and the FCN-based template matching, the proposed algorithm has better AUROC performance over the algorithms in [14; 24]. Because the diversities for the region outside gold finger area may be large even for the normal samples, the same AE may then have different capacities for the reconstructions of the regions inside and outside the gold finger area. A unified treatment for all the regions may then introduce higher FPRs and/or lower TPRs. As a result, although the algorithms in [14; 24] are also based on AEs, the algorithms inspect all the regions by the same threshold. They may then have inferior AUROC performance. On the contrary, the proposed algorithm leverages the results of the FCN so that the template matching can be carried out only for the gold finger area. An accurate detection with a superior ROC curve can then be attained. The ROC curve for the inspection of the backplate surface for various techniques is revealed in Figure 17. The numerical evaluation is based on a test set containing 64 normal or defective backplate surface images. We can see from Figure 17 that the proposed algorithm has superior performance. Without the employment of FCN, it would be difficult to find a threshold well-suited for all regions on the surface of the backplate for the defect detection. Consequently, we can see from Table 4 that the AUROCs of the algorithms in [14; 24] are only 0.674 and 0.886, respectively. By contrast, the proposed algorithm is still able to achieve a high AUROC of 0.983 even for the inspection of the backplate surface. It can then be concluded that the proposed algorithm offers reliable inspection results for complex surfaces. Figure 16: The ROC curve for the inspection of gold finger area for various algorithms: (**a**) ROC curve of the proposed algorithm, (**b**) ROC curve for algorithm in [14], (**c**) ROC curve for algorithm in [24]. In addition to the AUROC, the latency for the inference operations for the algorithms is also included in Table 4. In the experiments, the inference operations are carried out by the NVIDIA RTX 2070 GPU platform.