# Glass Defect Detection with Improved Data Augmentation under Total Reflection Lighting
## 4 Test Results and Evaluation
### Experiment and Result Analysis  
Firstly, the network model parameters are initialized. During the training process, adjustments are made to hyperparameters such as the learning rate, training batch size, and weight magnitudes to optimize the experimental outcomes. The evaluation of the final experimental results is conducted on both the training and validation datasets. Four models are employed for ablation contrast experiments: the original YOLOv5 algorithm (denoted as YOLOv5), YOLOv5 algorithm with an attention mechanism (denoted as YOLOv5c), YOLOv5 algorithm with enhanced data augmentation methods (denoted as YOLOv5z), and YOLOv5 algorithm incorporating both enhanced data augmentation methods and an attention mechanism (denoted as YOLOv5_zc). The visual analysis of the training processes for these four models is presented in Figures 18 and 19.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Evaluation Indicators** & **Definition** \\ \hline (Precision) & Proportion of samples accurately predicted within the positive sample size \\ (Recall) & Proportion of sample size predicted to be true to all \\ samples with a positive true picture \\ (False Rejection Rate, FRR) & Number of positive samples predicted to be negative as a \\ proportion of actual positive samples \\ (False Acceptance Rate, FAR) & Number of unpredicted negative samples as a percentage \\  & of total negative samples \\ (Average Precision, & Average of the accuracy rates with different recall rates \\ AP) & Mean of AP values for different categories \\ (MAP) & \\ \hline \hline \end{tabular}
\end{table}
Table 1: Evaluation indicators.  
Figure 19: Training MAP value graph.  
Figure 18: Training loss value graph.  
As shown in Figure 18, the loss functions of the YOLOv5c and YOLOv5z converge faster and to smaller values compared to the YOLOv5 as the number of epochs increases. This indicates that both improvement methods yield better training results than the original model. Furthermore, with the combination of both improvement methods in the YOLOv5 zc, the loss function converges even faster and to smaller values compared to the YOLOv5c and YOLOv5c alone. This suggests that the combined approach of the two methods enhances the training effectiveness of the model. Figure 19 illustrates the curve of the mean average precision (MAP), varying with the increase in epochs for all four models during training. By comparison, it is evident that the YOLOv5 zc achieves the highest MAP value and the most stable curve as the number of iterations increases.  
The test results of the four optimal models on the validation set are presented in Table 2. According to the data, the improved YOLOv5_zc witnesses a significant improvement in its detection performance compared with the original yolo v5 and the unilaterally improved YOLOv5_z and yolo v5_c, with an increase in its precision rate of 2.67%, a recall rate improvement of 2.74%, a MAP improvement of 2.62%, and a decreased missed detection rate as low as 5%, which means that it meets the requirements for industrial detection.