# Improved Training of CAE-Based Defect Detectors Using Structural Noise
## 4 Experiments
### Experimental Results
#### 4.2.2 Models Trained with Noise
\begin{table}
\begin{tabular}{c c c c c c c c c c c} \hline \hline  & & \multicolumn{8}{c}{**Defect**} \\ \hline  & & \multicolumn{2}{c}{**Spot Size**} & \multicolumn{2}{c}{**Spot Position**} & \multicolumn{2}{c}{**Spot Color**} & \multicolumn{2}{c}{**Spot Count**} \\ \hline  & & **Small** & **Large** & **Up** & **Down** & **Left** & **Right** & **Black** & **Two** & **Three** \\ \hline
**Category** & None & 50.2 & 111.0 & 9.1 & 9.8 & 9.1 & 8.3 & 3.9 & 27.9 & 46.1 \\ \cline{2-11}
**of** & Gaussian & 2.0 & 24.5 & 5.2 & 6.1 & 8.3 & 4.1 & 2.0 & 1.9 & 1.8 \\ \cline{2-11}
**noise** & Structural & 1.4 & 4.6 & 2.0 & 1.9 & 1.7 & 1.8 & 2.0 & 1.9 & 1.7 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Detection error rates [%] for the models trained on spotless parts, according to the type of noisy training. According to these observations, globally, the CAEs were enhanced. The performances are rather mixed in the cases where the positions of the spots are defective, but using structural noise during training impacts positively the restoration process, in any instance. Overall, even though the Gaussian noise increased the precision of the NNs in most cases, it clearly appeared that the noise with a known structure gave better results. The latter has particularly helped reduce the error rate when the color of the spots or their count were faulty, but was not as effective in preventing mistakes when the size of the spots or their position were problematic. It should be noted that over 50% of the defects can be detected, even in the worst situations (such as when the position of the spot is defective). The error rates may not be null, but their values are overall low enough to expose the location of the flaws. In the case of the trainings on spotted dataset, when the position or the size of the spots are flawed, the detections may be rather unreliable due to the presence of \"regular\" spots inherent to the data used for these trainings. Indeed, \"defective\" spots (which have to be detected/removed) may partially (or totally) overlap with \"regular\" spots (which has to be reconstructed). In this way, as the representation in the latent space of a defective piece will be similar to that of a regular spotted piece after compression, a misinterpretation can occur during the decompression process. This confusion may lead to an increase in the error rate. \begin{table}
\begin{tabular}{c c c c c c c c c c} \hline \hline  & \multicolumn{6}{c}{**Defect**} \\ \hline  & \multicolumn{3}{c}{**Spot Size**} & \multicolumn{3}{c}{**Spot Position**} & \multicolumn{3}{c}{**Spot Color**} & \multicolumn{3}{c}{**Spot Count**} \\ \hline  & & **Small** & **Large** & **Up** & **Down** & **Left** & **Right** & **Black** & **Two** & **Three** \\ \hline
**Category** & None & 77.5 & 68.1 & 48.3 & 48.3 & 48.2 & 48.2 & 71.8 & 47.3 & 96.6 \\ \cline{2-10}
**of** & Gaussian & 25.2 & 33.0 & 44.0 & 70.9 & 36.9 & 48.3 & 18.6 & 87.2 & 43.6 \\ \cline{2-10}
**noise** & Structural & 15.9 & 18.5 & 43.1 & 43.0 & 43.7 & 42.5 & 2.3 & 1.7 & 1.7 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Detection error rates [%] for the models trained on spotted parts, according to the type of noisy training. Figure 20: Comparison of detection error rates [%] for the models trained on spotted parts, according to the type of noisy training. Tests on Different Sizes of Structural Noise  
Finally, the effects of the patterns' size of the structural noise on the detection accuracy were investigated. Four additional noisy trainings were performed:  
* spotless triangles (A)(1) noised by a known structure (small)
* spotted triangles (A)(2) noised by a known structure (small)
* spotless triangles (A)(1) noised by a known structure (large)
* spotted triangles (A)(2) noised by a known structure (large)  
The \"small\" structural noise consisted of 20 white ((r, g, b) = (255, 255, 255)) discs of radii r = 3 px, whereas the \"large\" structural noise consisted of 20 white ((r, g, b) = (255, 255, 255)) discs of radii r = 9 px, both set of discs were placed randomly within the injected data.