# Real-Time Detection of Insulator Defects with Channel Pruning and Channel Distillation
## 4 Experiment and Results
### Experiment  
1. Ablation experiment  
To verify the effectiveness of the proposed models, each was tested on the established dataset and compared with the original YOLOv7-tiny. The comparative results are presented in Table 1.  
From Table 1, it is evident that replacing the backbone of the original YOLOv7-tiny network with FasterNet does not significantly alter the accuracy of insulator defect detection, yet it substantially reduces the model's parameter count. Through multiple experiments, adding the OD-SlimNeck neck structure to the YOLOv7-tiny model using FasterNet as its backbone increased the accuracy of insulator defect detection from 71.6% to 74.5%. \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline  & **Algorithm** & **P** & **R** & **[EMAIL_ADDRESS]** & **[EMAIL_ADDRESS]:0.95** & \
\begin{tabular}{c} **Parameter** \\ **Size (M)** \\ \end{tabular} &
\begin{tabular}{c} **GFLOPs** \\ **(Batch Size 32)** \\ \end{tabular} \\ \hline A & YOLOv7-tiny & 71.6\% & 56.0\% & 62.4\% & 28.1\% & 6.1 & 13.0 & 1.25 ms \\ B & A+FasterNet & 71.1\% & 60.5\% & 63.4\% & 28.4\% & 4.1 & 8.5 & 1.16 ms \\ C & B+OD-Slimneck & 74.5\% & 63.1\% & 68.2\% & 30.3\% & 3.9 & 7.7 & 1.14 ms \\ D & C+Decoupled\_detect & 78.4\% & 65.4\% & 71.2\% & 32.8\% & 5.5 & 10.7 & 1.31 ms \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Results of ablation experiments. Figure 14: Examples of two different types of defects in the dataset: (**a**) insulator damage and the (**b**) insulator flashover. This represents a 2.9% improvement over the original YOLOv7-tiny network and a 7.1% increase in recall rate compared to the YOLOv7-tiny network, with [EMAIL_ADDRESS] also rising by 5.8%. The addition of a decoupled detection structure significantly enhanced the detection outcomes, achieving a precision of 78.4%, a recall rate of 65.4%, and an mAP@50 of 71.2%. Compared to the original network structure, the model parameter count has increased and the inference time slightly increased to 1.31 ms but still meets the requirements for real-time detection, confirming the effectiveness of the algorithm improvements made in this study. 2. Channel pruning  
We conducted channel pruning on the improved models described above. Table 2 presents the main parameters and results obtained from channel pruning, model fine-tune training, and sparse training. Among these, 'Speed_up' is defined as the ratio of the computational load before channel pruning to that after pruning. The number of parameters in a model reflects its complexity. More parameters allow the model to learn more complex features and patterns, theoretically enabling higher detection accuracies. However, this also implies that the model requires more computational resources and time for inference to achieve an optimal balance between performance and efficiency. To balance model detection accuracy and rate, we set 'Speed_up' to 2.0 and 3.0, effectively reducing the number of parameters to one-half and one-third of the original, respectively. The 'Sparsity rate' is the proportion of weights in the model that are set to zero. A higher sparsity rate means more weights are zeroed, thus making the model more sparse. From Table 2, we discovered that when the Speed_up ratio is set to 3.0, the detection accuracy of the pruned model significantly declines, failing to effectively balance the relationship between detection accuracy and speed. However, when the speed-up ratio is set to 2.0, the pruned model maintains a relatively stable detection accuracy despite a 50% reduction in the number of parameters. Therefore, we employed a speed-up ratio of 2.0 for channel pruning. Furthermore, We compared the differences between the random pruning method and our channel pruning method. The comparative results of model performance before and after two pruning methods are shown in Table 3.  
The comparison results are presented in Table 3, indicating that the model parameters are reduced by 49.79%, decreasing the size by 2.7 MB after channel pruning.