Abstract:
Objective Photovoltaic modules convert solar energy into electrical energy, and their operating condition directly affects the power generation efficiency, reliability, and service life of photovoltaic power systems. During long-term outdoor operation, modules are exposed to dust, sand, bird droppings, stains, changing illumination, temperature variation, and mechanical impact, which may lead to surface pollution or local breakage. Surface dirt blocks incident sunlight and reduces output power. Accumulated contaminants may also absorb moisture, accelerate corrosion, induce local heat accumulation, and shorten module lifetime. Manual inspection, sensor-based monitoring, and traditional image processing have been applied to photovoltaic module condition assessment, but these methods still suffer from low efficiency, limited robustness, environmental sensitivity, or high maintenance cost. Deep learning methods have improved detection automation and accuracy. However, many existing approaches focus on coarse classification, pixel-level segmentation, or limited defect categories. Some models also require large computational resources, which restricts deployment in resource-constrained inspection scenarios. This study developed a lightweight and accurate object detection method for identifying surface dirt and breakage on photovoltaic modules under complex visual conditions.
Methods A lightweight detection model, DMSG-DETR, was developed based on the RT-DETR framework. RT-DETR was adopted because its Transformer-based detection structure can model global contextual relationships while maintaining real-time detection capability. To reduce redundant parameters and computational cost in the original ResNet-18 backbone, a CSP-DNMC backbone was designed. The CSP structure divided feature maps into different paths to improve information flow and reduce unnecessary computation, while the DNMC module introduced dynamic convolution kernel selection and multi-scale feature fusion. Depthwise separable convolution and dynamic kernel weighting enabled adaptive feature extraction at different scales and improved feature representation flexibility. To enhance local texture modeling and fine-grained defect recognition, an MFCGLU module replaced the original RepC3 structure. This module integrated multi-level feature fusion, efficient channel separation, partial convolution, and a convolutional gated linear unit. It strengthened nonlinear channel interaction and local structural perception while reducing redundant convolutional operations. This design improved the recognition of subtle dirt, stains, bird droppings, cracks, and breakage regions on photovoltaic surfaces. An SHSA-GEPO mechanism was also introduced to optimize self-attention computation. Instead of applying multi-head self-attention to all channels, this mechanism performed single-head self-attention on selected feature channels and retained the remaining channels as residual information. The guided efficient prompt operator dynamically adjusted attention sparsity, which helped preserve important contextual information and suppress redundant responses. This mechanism improved computational efficiency and robustness in complex scenes. A dedicated dataset was constructed to improve model generalization. More than 400 high-resolution photovoltaic module images were collected under different illumination angles, dirt types, and damage levels. Six categories were annotated: slightly dirty, severely dirty, broken, bird droppings, stained, and clean. Rotation, scaling, translation, flipping, cropping, brightness adjustment, and contrast adjustment were used to enlarge the dataset and improve sample diversity. The dataset was expanded from 409 to 2456 images and divided into training, validation, and testing sets at a ratio of 8:1:1. All comparison models were trained under the same hardware environment, software environment, dataset partition, and hyperparameter settings to ensure fair evaluation.
Results and Discussions Comparative experiments showed that DMSG-DETR achieved the best overall performance among RT-DETR and YOLO-series models. Compared with baseline RT-DETR, DMSG-DETR increased precision from 90.7% to 93.3%, mAP50 from 92.8% to 94.6%, and mAP50-95 from 78.1% to 79.8%. Meanwhile, computational cost decreased from 57 GFLOPs to 38 GFLOPs, and the number of parameters decreased from 19.88 M to 12.85 M. These results demonstrate that DMSG-DETR improves detection accuracy while significantly reducing model complexity. Backbone comparison and ablation experiments further verified the effectiveness of the proposed modules. CSP-DNMC reduced computation and parameters while maintaining strong detection performance. MFCGLU enhanced local feature extraction and improved fine-grained defect recognition. SHSA-GEPO optimized attention computation and improved model robustness. The integration of all three modules achieved the best balance between accuracy and efficiency. Visual detection results also showed that DMSG-DETR accurately identified surface dirt and breakage in complex scenes and reduced false detections compared with other models.
Conclusions DMSG-DETR provides an efficient and accurate solution for detecting dirt and breakage on photovoltaic module surfaces. By using CSP-DNMC, MFCGLU, and SHSA-GEPO, the model achieves a favorable balance among detection accuracy, computational efficiency, and parameter scale. The experimental results confirm that DMSG-DETR outperforms several mainstream detection models and is suitable for large-scale photovoltaic inspection and maintenance. Future work will focus on real-time hardware deployment, further optimization for high-resolution image detection, and robustness improvement under more diverse outdoor conditions.