# Knowledge Embedding Relation Network for Small Data Defect Detection
## 4 Experiments
### Small Training Sets  
We paid special attention to the scene, where it is difficult to obtain defect samples in the industrial scene, that is, a small number of positive samples. We used positive samples of 5, 10, 15, 20, and 25 for each dataset. The results are shown in Table 7.  
For the DAGM2007 dataset, originally based on 150 positive samples, EfficientNet and ESDN could have good performance, but when the number of positive samples decreased, the detection performance of all algorithms showed different decline, as shown in the figure. The details of the decline can be seen in Table 7. When the number of positive samples decreased from 150 to 25 and then to 5, the AP value of the baseline was 100%-90.11%-82.39%; the AP value of the KRN 100%-99.11%-82.39%. When the training samples were sufficient, their AP scores were very high. When the number of positive samples decreased to 25, ESDN decreased by 3%, and KRN decreased by 1.47%; when the number of positive samples turned to five, the AP of the baseline decreased significantly (14%), and the KRN performed better, which only decreased by 9%. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Method** & **AP/\%** & **FP + FN** \\ \hline None & 94.79 & 2 + 2 \\ AsinhE & 96.89 & 0 + 2 \\ SigmE & 97.39 & 0 + 1 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: mAP on Two PNs (KSDD, 5 positive samples). \begin{table}
\begin{tabular}{c c c} \hline \hline
**Method** & **AP/\%** & **FP + FN** \\ \hline Add & 95.26 & 2 + 1 \\ Concat & 96.49 & 1 + 1 \\ Mul & 97.26 & 1 + 1 \\ KE & 97.39 & 0 + 1 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: mAP on four variants of KE (KSDD, 5 positive samples). For the KSDD dataset, all three methods achieved good scores. After analysis, we believe that this is because KSDD itself is a small dataset, and the test set is not complex, which makes it possible to obtain a good recognizer with only a small number of samples. However, five positive samples still brought differences to the performance of the various methods. According to Table 7, when the number of positive samples was greater than 20, the AP of each of the three methods was close to 100%. However, with the decrease in the number of positive samples to five, the baseline decreased by 4.18%, while the KRN was the least affected by the standard template KE and relationship mining module, which was only 2.65%  
Regarding the performance for the Steel dataset, like DAGM, all methods were greatly reduced: in the scenario of five positive samples, the AP of the baseline decreased to 58.45%, and there were false detection and missed detection values of 490 + 25; the AP performance of the KRN was the best, which was 63.28%, and the false detection and missing detection came out to only 467 + 34. Although these benefits are lower than the DAGM and KSDD, they are consistent and significant considering that the Steel dataset is more challenging in terms of complexity and dataset size. We visualized the experimental results,as shown in Figure 5. The AP and FP + FN increased by varying degrees with the increase in positive samples. It reveals the generalization fragility of the baseline under the small training sets: without adequate training images, it detected poorly defected from input images. In contrast, for our KRN, the KE and GO demonstrated superior performance on small training sets defect detection.