# Improved Training of CAE-Based Defect Detectors Using Structural Noise
## 4 Experiments
### Experimental Results
#### 4.2.2 Models Trained with Noise  
In addition to the two CAE models prepared without noise, four new models were needed to investigate the possible benefits of noisy trainings. Therefore, these NNs were trained on four distinct datasets:  
* spotless triangles (A)(1) noised by a Gaussian distribution
* spotted triangles (A)(2) noised by a Gaussian distribution
* spotless triangles (A)(1) noised by a known structure (medium)
* spotted triangles (A)(2) noised by a known structure (medium)  
The Gaussian noise had a mean of 0 and a standard deviation of 0.1 (the resulting values of the pixels were clamped to fit between 0 and 1). The \"medium\" structural noise consisted of 20 white ((r, g, b) = (255, 255, 255)) discs of radii r = 6 px, placed randomly within the injected data. The Figures 16 and 17 illustrate the noisy trainings of CAEs, on the spotless and spotted dataset, respectively. The fact that noise is injected to the data before they reach the network is clearly emphasized (Gaussian noise is added, in these instances). Figure 16: Noisy CAE training on spotless pieces. Figure 15: Reconstruction of samples after training. Tests on \"Regular\" Pictures  
In the first place, the six models were tested on a sample of 200 \"regular\" images of the remaining dataset, i.e., the other \"regular\" set of images on which they were not trained. Table 2 and its corresponding Figure 18 show the outcome of these tests. The detection accuracy clearly improved for the models trained on spotless data: while the error rate without noise was equal to 27.2%, it dropped to 5.4% with the addition of Gaussian noise and even decreased to 1.9% when structural noise was used. The results were mixed for the models trained on spotted data: originally, without noise, the error rate was equal to 1.9% but drastically rose to 33.7% when Gaussian noise was injected, while the structural noise slightly increased the error rate to 5.7%. Even though the results involving noise are mixed for the models trained on spotted data, the sharp gain in precision for the models trained on spotless data motivated us to \begin{table}
\begin{tabular}{c c c c c} \hline \hline  & & \multicolumn{3}{c}{**Additive Noise**} \\ \hline  & & **None** & **Gaussian** & **Structural** \\ \hline
**Training** & Without spots & 27.2 & 5.4 & 1.9 \\ \cline{2-5}
**dataset** & With spots & 1.9 & 33.7 & 5.7 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Detection error rates [%] obtained by the six models during the tests, according to the type of noisy training. Figure 17: Noisy CAE training on spotted pieces. Figure 18: Comparison of detection error rates [%] obtained by the six models during the tests, according to the type of noisy training. further explore the path of the structural noise. At the same time, we attempted to address the small increment of the error rate for the models trained on data with spots. Tests on the Full Set of Data  
Then, tests were conducted on a larger collection of data containing a mix of 2000 \"defective\" pieces, representing all of the 10 \"defective\" classes. The Table 3, and its corresponding Figure 19, summarize the outcomes of the tests carried out on the models trained on the spotless dataset:  
In the case of noisy training on spotless data, the restoration abilities of the CAEs definitely improved by a great margin. Using structural noise, the error rate even dropped below 5%, all tested classes combined. The Table 4, and its corresponding Figure 20, summarize the outcomes of the tests carried out on the models trained on the spotted dataset:  
Figure 19: Comparison of detection error rates [%] for the models trained on spotless parts, according to the type of noisy training.