# Detection of Transmission Line Insulator Defects Based on an Improved Lightweight YOLOv4 Model
## 4 Case Study of Transmission Line Insulator Defect Detection
### Generalization Ability and Robustness Verification  
Due to the influence of time, weather, and angle during shooting, the UAV aerial images are prone to uneven illumination and blur. In consideration of the possible influence in practical applications, several preprocessing methods such as contrast and brightness adjustment and image atomization were adopted to simulate the conditions of extreme darkness, exposure, and foggy environment, so as to verify the generalization ability and robustness of the model.  
The improved YOLOv4 model was used to detect images under the above three simulated conditions and the results were compared with Faster RCNN, SSD, YOLOv3, and YOLOv4 models, which are shown in Figure 12. The red bounding boxes in YOLOv3, YOLOv4, and the improved YOLOv4 represent the insulator, and the blue bounding boxes represent the defect class. However, the blue bounding boxes in SSD and Faster RCNN represent the insulator. According to the detection results, the YOLO models have superior accuracy in transmission line insulator location and defect detection, while the SSD and Faster RCNN have missed detections and poor detection effect on defect targets, which may be caused by small sizes of defect targets. Among YOLO models, YOLOv4 has the highest accuracy and can achieve accurate detection in the above three conditions. The improved YOLOv4 model, with lightweight feature extraction network MobileNet and optimized SPP and PANet network structures to reduce the number of parameters, can also achieve accurate detection in the three conditions. As for the detection speed (_FPS_), the proposed method increases the _FPS_ to 53 pictures/s, which takes only 0.019 s to detect one image.  
\begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline \multirow{2}{*}{**Sharpening Method**} & \multicolumn{3}{c}{**Insulator Location**} & \multicolumn{3}{c}{**Insulator Defect Location**} & \multirow{2}{*}{_mAP (\%)_} \\ \cline{2-2} \cline{4-7}  & \(AP\) **(\%)** & \(P\) **(\%)** & \(R\) **(\%)** & \(AP\) **(\%)** & \(P\) **(\%)** & \(R\) **(\%)** & \\ \hline Non-sharpening & 94.53 & 95.96 & 91.63 & 93.09 & 96.97 & 94.12 & 93.81 \\ prewitt & 94.04 & 93.91 & 89.27 & 93.56 & 93.94 & 91.18 & 93.80 \\ sobel & 94.76 & 93.42 & 91.42 & 95.57 & 98.44 & 92.65 & 95.17 \\ log & 94.32 & 95.22 & 89.70 & 93.62 & 96.97 & 94.12 & 93.97 \\ laplacian & 96.15 & 96.69 & 93.99 & 98.40 & 95.59 & 95.59 & 97.26 \\ \hline \hline \end{tabular}
\end{table}
Table 4: Performance indexes of detection model with different sharpening methods.  
According to the above result analysis and model robustness verifications, it can be seen that the _mAP_ and _FPS_ of the improved YOLOv4 model can reach 93.81% and 53 pictures/s, respectively. In addition, Laplace sharpening can be applied to compensate for the loss of accuracy caused by lightweight model and improve the _mAP_ to 97.26%. The case studies validate that the proposed method is able to realize accurate, fast, and automatic detection of transmission line insulator defects.