# Yolo Based Defects Detection Algorithm for EL in PV Modules with Focal and Efficient IoU Loss
## 1 Introduction
In 2019, [PERSON] built a deep convolutional neural network based on GoogLeNet [15] to detect four types of defects with an accuracy exceeding 85% and improved stability [16]. Subsequently, the VGG19 [17] model was also employed to predict the probability of defects in EL images. Additionally, VGG16 [18], ResNet50 [19], and BAF-CNN [20] have been used for defect detection and classification in EL images. Despite the continuous improvement in classification accuracy, challenges still exist, including limited recognition of defect types, lack of defect localization, large model parameters, and slow detection speed. In 2018, [PERSON] [21] constructed a deep neural network using support vector machine sequences to achieve high-precision detection of color defects in continuous casting slabs [22]. From 2018 to 2020, many researchers developed Faster R-CNN [23; 24] networks for detecting transmission line defects [25; 26] and surface defects in industrial components [27; 28; 29; 30], including defects in PV modules [28]. In 2019, [PERSON] [31] and [PERSON] et al. [32] improved the accuracy of PV module defect detection by building a solid-state drive architecture. In 2020, researchers began constructing retina networks [33] to detect small objects and subtle defects, aiming to strike a balance between speed and accuracy. Therefore, from a technical perspective, deep learning can be widely applied in product quality inspection. From 2015 to 2023, the YOLO (You Only Look Once) series of algorithms underwent significant advancements, introducing YOLO [34], YOLOv2 [35], YOLOv3 [36], YOLOv4 [37], and the latest YOLOv5 models. These iterations propelled the field of target detection to unprecedented heights. YOLOv5 stands out as the fifth-generation one-stage object detection algorithm, renowned for its compact model size and exceptional performance. It strikes a delicate balance between detection accuracy and speed across various real-world applications. Recent reports [38] indicate that YOLOv5 achieves mask detection in populations with an impressive accuracy exceeding 97%. Within the realm of photovoltaics, YOLOv5 has found utility in segmenting visible light images and pinpointing faults in infrared images [39]. Moreover, in fabric defect detection applications, the integration of attention mechanism modules has proven instrumental in enhancing the detection precision of YOLOv5 [40]. To address the constraints observed in existing research works, including shortcomings in defect type recognition, defect localization, large model parameters, and sluggish detection speeds, this study integrates the YOLOv5 algorithm with a cascaded detection model. The cascaded detection network is structured with both upstream and downstream components. A better-designed loss function can better extract defect characteristics. Combining the strengths of EIoU loss and Focal-F1 loss [26], an enhanced Focal-EIoU loss function is proposed and incorporated within the detection network, facilitating adaptive adjustments in the attention balance among various defect types during training, guided by sample distribution. The test outcomes showcase the superior detection capabilities of this novel approach, affirming its efficacy in overcoming the limitations highlighted in prior research.