Abstract
With the rapid development of photovoltaic (PV) systems, ensuring the operational efficiency and reliability of solar panels has become critical. Traditional fault detection methods, relying on electrical characteristics or manual inspections, face challenges such as low accuracy, slow speed, and high labor costs. This study proposes two improved deep learning-based algorithms, YOLOv7-PV and YOLOv8-ours, to address these limitations. By optimizing dataset construction, enhancing feature extraction modules, and refining loss functions, our methods achieve significant improvements in both detection accuracy and speed. Experimental results demonstrate that the YOLOv7-PV model achieves a mean Average Precision (mAP) of 91.76%, outperforming baseline models by 3.18–10.63%. The YOLOv8-ours model further balances speed and accuracy, achieving an mAP of 91.04% with a 6 FPS improvement over the original YOLOv8. This research provides robust technical support for intelligent maintenance of large-scale solar power plants.

1. Introduction
Solar energy, as a clean and renewable resource, plays a pivotal role in mitigating climate change and reducing fossil fuel dependence. However, solar panels are prone to faults such as cracks, hotspots, dust accumulation, and plant occlusion due to harsh environmental conditions. These faults degrade power generation efficiency and pose safety risks. Traditional inspection methods, such as electrical parameter analysis or manual checks, are inefficient and error-prone. Recent advancements in deep learning, particularly in object detection, offer promising solutions for automated solar panel fault detection.
This study focuses on three key contributions:
- Dataset Construction: A high-quality infrared image dataset of solar panels is built, addressing challenges like noise, imbalance, and limited samples.
- Algorithm Optimization: Improved YOLOv7 and YOLOv8 models are proposed, incorporating novel modules and loss functions to enhance feature extraction and detection efficiency.
- Practical Validation: Experimental results confirm the superiority of the proposed models in accuracy and speed, making them suitable for industrial applications.
2. Solar Panel Fault Dataset Construction
2.1 Data Collection and Challenges
Infrared images of solar panels were captured using a DJI M300RT drone equipped with an HT20 thermal camera across 13 PV plants in diverse regions (e.g., deserts, mountains). Initial challenges included:
- Noise and blur due to environmental factors.
- Class imbalance, with cracks and plant occlusion representing only 2% and 5% of samples.
- Limited diversity in angles and scales.
2.2 Preprocessing and Augmentation
To address these issues, the following steps were implemented:
- Image Enhancement: Spatial-domain (histogram equalization) and frequency-domain (Fourier filtering) methods improved clarity (Figure 1).
- Data Augmentation:
- Cracks: Random cropping and recombination generated 256n⁴ synthetic samples.
- Plant Occlusion: Contour extraction and overlay simulated diverse遮挡 scenarios.
- Rotation/Scaling: Simulated drone perspectives at varying heights and angles.
The final dataset expanded from 2,035 to 7,864 images, with balanced fault distributions (Table 1).
Table 1: Dataset Statistics After Augmentation
| Fault Type | Original Count | Augmented Count |
|---|---|---|
| Cracks | 41 | 1,024 |
| Hotspots | 512 | 512 |
| Dust | 1,024 | 1,024 |
| Plant Occlusion | 102 | 1,024 |
| Cell String | 512 | 512 |
2.3 Annotation
Images were labeled using the Labeling tool in YOLO format, generating TXT files with bounding box coordinates and class IDs.
3. Improved YOLOv7-PV Algorithm
3.1 Limitations of Original YOLOv7
The original YOLOv7 struggles with small and dense solar panel faults due to:
- Weak feature extraction for subtle defects.
- High missed detection rates for overlapping faults.
- Slow inference speed caused by redundant parameters.
3.2 Key Improvements
The YOLOv7-PV model introduces four enhancements:
3.2.1 ResNet-PV Module
Replacing standard convolutions with Partial Convolutions (PConv) reduces computational costs while preserving spatial features. For an input feature map F∈RH×W×CF∈RH×W×C, PConv processes only C44C channels:FLOPs=H×W×k2×(C4)2,FLOPs=H×W×k2×(4C)2,
where kk is the kernel size. This reduces FLOPs by 93.75% compared to standard convolutions.
3.2.2 ELAN-PV Module
The ELAN structure is optimized by replacing 3×3 convolutions with PConv and using the Randomized ReLU (RReLU) activation function:f(x)=max(αx,x),α∼U(l,u).f(x)=max(αx,x),α∼U(l,u).
This enhances stability and feature representation for small targets.
3.2.3 BiFormer Attention Mechanism
BiFormer employs bidirectional sparse attention to dynamically focus on critical regions, improving detection of dense faults (Figure 2).
3.2.4 NWD Loss Function
The Normalized Wasserstein Distance (NWD) loss replaces CIoU to better handle small targets:NWD=exp(−W22(Na,Nb)C),NWD=exp(−CW22(Na,Nb)),
where W22W22 measures the Wasserstein distance between Gaussian distributions of predicted and ground-truth boxes.
3.3 Experimental Results
YOLOv7-PV achieves an mAP of 91.76%, surpassing YOLOv7 (88.58%) and YOLOv5s (84.60%). Detection speed improves to 69 FPS (Table 2).
Table 2: Performance Comparison of YOLOv7-PV
| Model | mAP (%) | FPS |
|---|---|---|
| YOLOv5s | 84.60 | 60 |
| YOLOv7 | 88.58 | 62 |
| YOLOv7-PV | 91.76 | 69 |
4. Improved YOLOv8 Algorithm for Real-Time Detection
4.1 Limitations of Original YOLOv8
While YOLOv8 offers faster inference, its accuracy for solar panel faults remains suboptimal due to:
- Fixed receptive fields in standard convolutions.
- Sensitivity to background noise.
- Inefficient loss function for small targets.
4.2 Key Improvements in YOLOv8-ours
4.2.1 D_C2f Module
The Deformable C2f module replaces static convolutions with deformable kernels, adapting to irregular fault shapes:y(g0)=∑gn∈Rw(gn)⋅x(g0+gn+Δgn),y(g0)=gn∈R∑w(gn)⋅x(g0+gn+Δgn),
where ΔgnΔgn denotes learnable offsets.
4.2.2 WIoU v3 Loss
The Wise IoU v3 loss dynamically prioritizes high-quality samples:LWIoU=r⋅LWIoUv1,LWIoU=r⋅LWIoUv1,
where r=βδαβ−δr=δαβ−δβ adjusts gradients based on anchor quality.
4.2.3 SE_Conv Module
Integrating Squeeze-and-Excitation (SE) attention into Conv layers enhances focus on fault regions:sc=σ(W2⋅δ(W1⋅GAP(Xc))),sc=σ(W2⋅δ(W1⋅GAP(Xc))),
where GAPGAP is global average pooling, and σσ is the sigmoid function.
4.3 Experimental Results
YOLOv8-ours achieves an mAP of 91.04% at 79 FPS, outperforming YOLOv8 (87.56% mAP, 73 FPS) and balancing speed-accuracy trade-offs (Table 3).
Table 3: Performance Comparison of YOLOv8-ours
| Model | mAP (%) | FPS |
|---|---|---|
| YOLOv7 | 88.58 | 62 |
| YOLOv8 | 87.56 | 73 |
| YOLOv8-ours | 91.04 | 79 |
5. Conclusion and Future Work
This study addresses critical challenges in solar panel fault detection through deep learning innovations. The YOLOv7-PV and YOLOv8-ours models significantly improve detection accuracy and speed, validated on a robust infrared dataset. Future work will focus on:
- Model Compression: Deploying lightweight models on drones for real-time inspections.
- Semi-Automated Labeling: Reducing manual annotation efforts via pre-labeling algorithms.
- Multi-Modal Fusion: Combining infrared, visible-light, and electrical data for holistic fault diagnosis.
By advancing AI-driven maintenance, this research contributes to sustainable and efficient solar energy systems.
