Abstract:To address the issues of low detection accuracy, high computational load, large parameter size, and complex variable backgrounds in existing distributed photovoltaic panel defect detection, we propose an improved lightweight YOLOv8 defect detection algorithm for distributed photovoltaic panels. We adopt the efficient lightweight StarNet architecture as the feature extraction network to reduce computational costs and parameter size, achieving a balance between high efficiency and high performance. The SPPF-AM module is designed to enhance the model's spatial information perception capability, effectively handling targets of different scales. We incorporate the Triplet attention mechanism to effectively extract multi-scale target features, improving the model's representation ability and task performance. The C2f_DSConv2D, which combines deformable convolution, replaces the original C2f in the network, improving defect detection efficiency with lower storage and higher computation speed. A spatial context-aware module (SCAM) is introduced in the feature fusion network to reduce noise impact and effectively suppress irrelevant background interference. We design ECIoU to replace CIoU, enhancing the fitting ability of the bounding box loss and accelerating the network's convergence speed. Experimental results show that the improved YOLOv8 model reduces parameter size by 35% and computational load by 29.6%, achieving a detection accuracy of 90.1%, with mAP@50 increasing from 85.9% to 89.7%, an improvement of 4.2%. The improved model demonstrates a certain enhancement in detection accuracy while reducing parameter size and computational load. The proposed improved algorithm demonstrated good performance in defect detection tasks, effectively enhancing the detection capability of the photovoltaic panel defect detection model.