# Knowledge Embedding Relation Network for Small Data Defect Detection
## 4 Experiments
### Ablation Study  
Below we analyze the effectiveness of each component of the proposed KRN approach. We designed six groups of experimental variants (except for the ablation experiment of each component), including variants used by all components and variants not used by all components. The following ablation studies were based on the KSDD dataset with the five positive samples setting. For some components, we further designed comparative experiments for in-depth analysis. For example, the Knowledge Embedding part also adopted add, concat, and mat operations. **Knowledge Modeling (KM):** We conducted KM on flawless samples. In this part of the ablation experiment, we changed the KM to predict the conv feature of the image to simulate the effect of no KM. The experimental results show that KM has a great impact on the KRN (97.39% vs 94.88%). For KSDD settings, it shows that without statistical modeling in Table 4, the AP scores of our KRN on fold 0 and fold 1 decreased by 6.2% and 3.28%, respectively. The analysis shows that KM brings additional knowledge and enhances the recognition performance of the model. **Knowledge Embedding (KE):** In the ablation experiment of KE, our KRN performed the variant (97.39% vs. 96.49%), which levers the regular concat fusion in Table 4. concat had the best AP value on fold 0 and fold 2, but fold 1 had only a 91.58% AP. The KE module has the ability to capture knowledge features and predict the relationship between sample features in design, because the module has been significantly enhanced in the defect identification of fold 1 (97.39% vs. 91.58%). We additionally analyzed the impact of concat, add, and mul operations on KE. The experimental results are shown in Table 5. Among them, the add operation was the roughest for feature fusion through simple addition, with the AP score being the lowest, which was 95.26%. The concat operation retained the original features and knowledge features, which was 1.23% higher than add. Mul enlarged the local difference, and the multiplication between the conv feature and knowledge feature was conducive to mining the relationship between the two features; its ap score was close to KE. Our KE not only retains the original features, but also constructs the relationship between the quasi-sample and the predicted sample, deeply excavates the potential differences, and shows the best performance (97.39% vs. 95.26%, 96.49%, and 97.26%). **Gram Operation (GO):** The GO is a supplement to KE, mining the relationship between features after KE. As shown in Table 4, the performance of the GO defect detection algorithm had a 2.27% drop (97.39% vs. 95.12%). GO mines the relationship between features of the final total features. Based on the experimental results of three folds (94.28%, \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Fold 0** & **Fold 1** & **Fold 2** & **Mean** & \begin{tabular}{c} **Knowledge** \\ **Model** \\ \end{tabular} & \begin{tabular}{c} **Knowledge** \\ **Embedding** \\ \end{tabular} & \
\begin{tabular}{c} **Gram** \\ **Operation** \\ \end{tabular} &
\begin{tabular}{c} **Power** \\ **Normalizing** \\ \end{tabular} \\ \hline
94.90 & 90.01 & 98.47 & 94.46 & & & & \\
93.18 & 94.70 & 96.75 & 94.88 & & \(\surd\) & \(\surd\) & \(\surd\) \\
**99.43** & 91.58 & **8.47** & 96.49 & \(\surd\) & & \(\surd\) & \(\surd\) \\
94.28 & 95.00 & 96.08 & 95.12 & \(\surd\) & \(\surd\) & & \(\surd\) \\
96.84 & 91.21 & 96.31 & 94.79 & \(\surd\) & \(\surd\) & \(\surd\) & \\
99.38 & **97.98** & 94.80 & **97.39** & \(\surd\) & \(\surd\) & \(\surd\) & \(\surd\) \\ \hline \hline \end{tabular}
\end{table} 
Table 4: mAP on four methods (ablation study on KSDD Dataset with 5 positive samples). \begin{table}
\begin{tabular}{c c c} \hline \hline
**Method** & **AP/\%** & **FP + FN** \\ \hline EfficientNet & 91.56 & - \\ SDN & 92.35 & - \\ ESDN & 98.45 & 68 + 85 \\ Ours & 99.73 & 40 + 32 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: mAP on four methods (Steel, 1000 positive samples).