# Detection of Defects in Warp Knitted Fabrics Based on Local Feature Scale Adaptive Comparison
## 3 Experiment and Result Analysis
### Comparison of Different Defect Detection Methods  
In order to prove the superiority of the scale adaptive local contrast method proposed above, the local binary patterns (LBPs) in the literature [18] and the local contrast deviation method (LCD) in the literature [19] are used to compare the experimental results on Tilda datasets with the algorithm proposed in this chapter. The results are shown in Figure 10.  
Figure 10: Detection results of different algorithms. (**a**) Holes, (**b**) yarn breakage, (**c**) fold, (**d**) hole-scale image, (**e**) yarn-break scale image, (**f**) fold-scale image, (**g**) the test results of the algorithm, (**h**) the test results of the algorithm, (**i**) the test results of the algorithm, (**j**) LCD test results, (**k**) LCD test results, (**l**) LCD test results, (**m**) LBPs test results, (**n**) LBPs test results, (**o**) LBPs test results.  
The above literature, respectively, detects defects on the Tilda dataset based on LCD and LBPs methods. In the figure, (a), (b), and (c), respectively, represent three different types of fabric defect images in the Tilda dataset, (d), (e), and (f), respectively, represent the scale images of three kinds of defect image, (g), (h), and (i), respectively, represent the detection results of the algorithms in this chapter for three kinds of defect, (j), (k), and (l), respectively, represent the detection results of three kinds of defect detected by local contrast deviation (LCD), and (m), (n), and (o), respectively, represent the detection results of three kinds of defect detected by local binary pattern (LBPs).  
As shown in Figure 10 above, the comparison between the proposed algorithm and the experimental results of LCD and LBPs show that the proposed scale adaptive local comparison method has better detection results than the other two methods, and clearer target contour recognition. In the above experimental process, we used homomorphic filtering to preprocess the algorithm, reducing the impact of noise on the detection results, making target recognition more accurate.  
The network is trained with this set of parameters, and the training results are shown in Figure 11. From Figure 11a, it is found that the accuracy of the validation set of LBPs after the 75 th round of training is close to that of the proposed method, and the overall network accuracy is higher than that of LCD. From Figure 11b, it can be seen that the training loss curve is constantly converging, the loss is close to the method in the 10 th round, and the LBPs' training loss converges significantly earlier than the LCD training loss. The experimental results show that the proposed method is feasible.  
The spatial complexity of the model can be reflected by the number of parameters. When a model is deployed on an edge computing platform, in addition to the number of model parameters, the model inference speed is also an important indicator to measure the network model. The time class is usually used to measure model inference time, but there is a warm-up start when the GPU runs, so this approach is not very objective. In this paper, the TILDA dataset is tested by preheating and synchronization, the average time is obtained, and the results are shown in Table 1. The test accuracy of the model in this paper is 99.89%, the accuracy of the LCD model is 97.06%, and the test accuracy of the LBPs model is very close to that of the model in this paper, namely 97.06%. It can be seen from Table 1 that the proposed method is less than the current model in terms of the number of parameters and the amount of calculation, which indirectly improves the forward inference time of the model.  
Figure 11: Accuracy and training loss of validation set under knowledge distillation. (**a**) Verification accuracy; (**b**) training loss.