# Yolo Based Defects Detection Algorithm for EL in PV Modules with Focal and Efficient IoU Loss
## 3 Results
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Loss** & **P** & **R** & **F1** & **mAP** \\ \hline DIoU & 0.724 & 0.826 & 0.858 & 0.819 \\ CIoU & 0.758 & 0.844 & 0.857 & 0.847 \\ Focal-EIoU & 0.792 & 0.850 & 0.933 & 0.865 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Comparison of detection performance under the three loss functions. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Defects** & **DIoU** & **CIoU** & **Focal-EIoU** \\ \hline (a) SE offset & 0.714 & 0.721 & 0.837 \\ (b) Dark spots & 0.728 & 0.758 & 0.850 \\ (c) Black spots & 0.745 & 0.824 & 0.830 \\ (d) Broken girds & 0.822 & 0.765 & 0.866 \\ (e) False marks & 0.798 & 0.847 & 0.843 \\ (f) Linear recessive & 0.743 & 0.775 & 0.827 \\ cracks & (g) Branch recessive & 0.703 & 0.752 & 0.858 \\ (h) Fragment & 0.850 & 0.853 & 0.876 \\ (i) Flurry filaments & 0.761 & 0.810 & 0.855 \\ (j) Cleaning traces & 0.755 & 0.768 & 0.823 \\ (k) Current & 0.812 & 0.841 & 0.906 \\ unevenness & (l) Black cell & 0.884 & 0.905 & 0.958 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: mAP for the 12 EL defects under three loss functions. as fragments, filaments, and black spots. This indicates that the proposed method effectively addresses the issue of decreased detection capability caused by sample imbalance. To further validate the effectiveness of our proposed method, we use SVM [22], Faster R-CNN [24], SSD, YOLOv3 [36], YOLOv4 [37], YOLOv6s [46], and YOLOv7s [47]. As listed in Table 4, researchers used to do EL defect detection via SVM, Faster RCNN, and SSD algorithm. In our previous research, Yolov5s without Focal-EIoU loss achieved better performance in terms of both accuracy and speed. The proposed method outperformed the three algorithms used before and achieved better performance than other original Yolo series methods. Furthermore, we conducted experiments to improve the loss function on four distinct versions of the YOLOv5 model: YOLOv5m, YOLOv5l, YOLOv5x, and YOLOv5s, as listed in Table 5.  
In the realm of object detection algorithms, YOLOv5 stands out for its exceptional suitability in detecting defects within PV components. It excels in delivering real-time processing capabilities while maintaining optimal average accuracy in defect recognition tasks. Although YOLOv6s and YOLOv7s marginally outperform YOLOv5s in accuracy metrics, their intricate algorithm architectures and substantial parameter sizes notably impede detection speed. Consequently, YOLOv6s and YOLOv7s are not well-aligned with the real-time demands of defect detection in PV components, in contrast to the efficiency and effectiveness demonstrated by YOLOv5 in this specific application domain. Based on the data presented in Table 5, it is evident that the Focal-EIoU approach yields enhancements in mean Average Precision (mAP) across all iterations of YOLOv5. Notably, among these variations, YOLOv5s emerges as a particularly optimal choice, striking a superior balance between speed and mAP. This equilibrium ensures the efficient and accurate detection of defects in PV modules, underscoring YOLOv5s as a robust solution capable of meeting the real-time demands of PV module defect detection while maintaining high accuracy levels. The enhanced version of the YOLOv5s algorithm model showcases a significant advancement in performance, boasting a notable 7.2% rise in mean Average Precision (mAP), specifically for complex defects found in PV components. This enhancement \begin{table}
\begin{tabular}{c c c} \hline \hline
**Algorithms** & **mAP** & **Speed** \\ \hline SVM [22] & 0.648 & 500 ms \\ Faster RCNN [24] & 0.837 & 50 ms \\ SSD & 0.750 & 90 ms \\ YOLOv3 [36] & 0.671 & 70 ms \\ YOLOv4 [37] & 0.734 & 30 ms \\ YOLOv5s [40] & 0.793 & 20 ms \\ YOLOv6s [46] & 0.782 & 60 ms \\ YOLOv7s [47] & 0.811 & 80 ms \\ Proposed & 0.865 & 20 ms \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Comparison of object detection algorithms.