Introduction
In recent years, the rapid development of photovoltaic power generation has been driven by its low cost and environmentally friendly characteristics. The demand for large-scale photovoltaic systems has grown significantly, especially in remote areas where manual inspection is inefficient and hazardous. The long-term exposure of solar panels to harsh environmental conditions such as strong wind, hail, dust, snow, and extreme temperature variations often leads to various types of faults, including cracks, hot spots, dust accumulation, cell string failures, and vegetation occlusion. These faults directly reduce the power generation efficiency and economic benefits of photovoltaic plants. Traditional fault detection methods based on electrical characteristics and image features suffer from low accuracy, slow speed, and poor generalization. With the rise of deep learning, object detection algorithms based on convolutional neural networks have become a promising solution for automated and accurate fault detection of solar panels. In this thesis, I focus on improving the detection performance of photovoltaic panel faults using deep learning methods, specifically targeting small object detection challenges and real-time detection requirements.

Literature Review and Motivation
Existing fault detection approaches for solar panels can be categorized into three groups: electrical characteristic-based methods, image feature-based methods, and deep learning-based methods. Methods relying on electrical parameters require the installation of extensive sensors and often fail to locate the exact fault position. Image-based methods using visible light, electroluminescence, or infrared images have been studied, but they often rely on hand-crafted features and thus lack robustness in complex backgrounds. Deep learning-based methods, especially YOLO family, have shown remarkable success in object detection tasks. However, applying them directly to photovoltaic panel fault detection faces several challenges: small fault regions, imbalanced fault samples, noise in infrared images, and the need for real-time processing. In this work, I first construct a high-quality infrared image dataset of solar panels through preprocessing and data augmentation. Then, I propose two improved detection algorithms based on YOLOv7 and YOLOv8 to achieve a balance between accuracy and speed.
Construction of Solar Panel Fault Dataset
Data Acquisition
I used a DJI M300RT quadrotor equipped with an HT20 thermal imaging camera with a resolution of 640×512 pixels. The flight altitude ranged from 10 m to 30 m. A total of 2035 valid infrared images were selected from 4593 raw images captured from 13 photovoltaic plants in different regions. Images without solar panels or with too small fault areas were discarded.
Image Enhancement
The raw infrared images suffered from noise and blur. I applied both spatial-domain and frequency-domain enhancement techniques. In the spatial domain, histogram equalization was used to improve contrast. In the frequency domain, a high-pass filter was applied to sharpen edges. The enhancement process can be represented as:
$$G(u,v) = H(u,v)F(u,v)$$
where $$F(u,v)$$ is the Fourier transform of the input image $$f(x,y)$$, $$H(u,v)$$ is the filter function, and $$G(u,v)$$ is the enhanced spectrum. The inverse transform produces the enhanced image.
Data Augmentation for Imbalanced Fault Types
The original dataset contained only 2% cracked samples and 5% vegetation occlusion samples. To balance the fault classes, I adopted the following strategies:
- For cracked panels: Each cracked panel image was divided into four equal parts, then randomly reassembled to generate new synthetic cracked samples. The number of new samples generated is proportional to the fourth power of the number of panels.
- For vegetation occlusion: I extracted contour features from existing occlusion samples and pasted them onto normal panels at edges and gaps to simulate realistic occlusion patterns.
After these operations, the total number of images increased from 2035 to 7038. To further improve diversity, I randomly rotated and scaled the images to simulate different drone angles and altitudes. This increased the dataset to 7864 images.
Annotation
All images were annotated using LabelImg in YOLO format. Each annotation file contains the class index and normalized coordinates of the bounding box. Five fault categories were defined: crack, hot spot, dust, vegetation occlusion, and cell string fault.
To verify the necessity of dataset preprocessing, I conducted experiments before and after preprocessing using several baseline detectors. The results are summarized in the following table:
| Model | mAP before preprocessing (%) | mAP after preprocessing (%) | Precision (%) | Recall (%) |
|---|---|---|---|---|
| YOLOv5s | 71.10 | 84.60 | 84.36 | 82.96 |
| YOLOv7 | 75.43 | 88.58 | 80.71 | 88.54 |
| YOLOv8 | 73.59 | 87.56 | 87.51 | 83.79 |
The significant improvement in mAP confirms that the constructed dataset provides a solid foundation for training robust fault detection models for solar panels.
Improved YOLOv7 for Solar Panel Fault Detection
Architecture of YOLOv7
YOLOv7 consists of three main parts: input, backbone, and head. The backbone uses ELAN modules, MP modules, and CBS blocks. The head contains FPN, SPPCSPC, and ELAN-H structures. Although YOLOv7 performs well in general object detection, it suffers from low accuracy and high missed detection rates when applied to small solar panel faults.
Proposed YOLOv7-PV Model
I propose the YOLOv7-PV model with four main improvements. The overall architecture is shown conceptually as follows:
- ResNet-PV module: This module replaces the standard 3×3 convolution in a residual bottleneck with partial convolution (PConv). PConv applies regular convolution to a subset of input channels, reducing FLOPs to roughly 1/16 of regular convolution and memory access to 1/4 when the channel fraction is 1/4. The structure preserves the residual connection to retain information integrity.
- ELAN-PV module: In this module, the 3×3 convolution in the original ELAN is replaced with PConv, and the SiLU activation is replaced with RReLU (Randomized ReLU). This change improves feature extraction and reduces redundant information.
- BiFormer attention mechanism: BiFormer uses a bi-level routing attention mechanism that dynamically selects a small subset of relevant tokens, enabling efficient and flexible computation allocation. It enhances the model’s ability to extract fine-grained features, especially for small faults.
- NWD Loss function: Instead of CIoU, I use the Normalized Gaussian Wasserstein Distance (NWD) loss for bounding box regression. The NWD loss measures similarity between two Gaussian distributions even when boxes do not overlap, which is beneficial for tiny objects. The formula is:
$$\mathrm{NWD}(\mathcal{N}_a,\mathcal{N}_b)=\exp\left(-\frac{W_2^2(\mathcal{N}_a,\mathcal{N}_b)}{C}\right)$$
where $$W_2^2$$ is the second-order Wasserstein distance between the Gaussian models of two bounding boxes, and $$C$$ is a constant related to the dataset.
Experimental Setup
I conducted experiments on the constructed dataset using an NVIDIA GeForce RTX 3050 GPU with 11th Gen Intel Core i5-11400H. The input image size was 640×640. The evaluation metrics were mAP (mean Average Precision) and FPS (frames per second).
Comparison Results
The proposed YOLOv7-PV was compared with YOLOv5s, RetinaNet, T-DINO, YOLOv7, and YOLOv7-tiny. The per-class APs and overall mAP and FPS are shown in the table below.
| Model | Crack (%) | Hot spot (%) | Dust (%) | Vegetation (%) | Cell string (%) | FPS | mAP (%) |
|---|---|---|---|---|---|---|---|
| YOLOv5s | 96.1 | 60.7 | 89.5 | 83.7 | 93.0 | 60 | 84.60 |
| RetinaNet | 95.3 | 61.6 | 88.3 | 84.1 | 92.7 | 57 | 84.03 |
| T-DINO | 94.8 | 56.7 | 83.1 | 80.4 | 90.3 | 49 | 81.13 |
| YOLOv7 | 97.2 | 76.6 | 87.6 | 85.7 | 95.8 | 62 | 88.58 |
| YOLOv7-tiny | 98.1 | 75.4 | 89.3 | 80.3 | 93.1 | 65 | 87.24 |
| YOLOv7-PV | 98.7 | 80.1 | 93.2 | 91.2 | 95.6 | 69 | 91.76 |
From the results, YOLOv7-PV achieved the highest mAP of 91.76%, which is 3.18% higher than YOLOv7 and 7.16% higher than YOLOv5s. The FPS also improved to 69 frames per second, demonstrating a good balance between accuracy and speed.
Ablation Study
To evaluate the contribution of each component, I performed ablation experiments. The results are reported in the following table.
| YOLOv7 | ResNet-PV | ELAN-PV | BiFormer | NWD Loss | FPS | mAP (%) |
|---|---|---|---|---|---|---|
| ✓ | 62 | 88.58 | ||||
| ✓ | ✓ | 60 | 90.71 | |||
| ✓ | ✓ | 75 | 89.65 | |||
| ✓ | ✓ | 67 | 90.34 | |||
| ✓ | ✓ | 62 | 89.27 | |||
| ✓ | ✓ | ✓ | ✓ | ✓ | 69 | 91.76 |
The ablation results indicate that each module contributes positively to the overall performance. Although the ResNet-PV module slightly reduced FPS due to increased parameters, the improvement in mAP justifies its adoption. The ELAN-PV module increased speed by 13 FPS while improving accuracy. BiFormer and NWD loss both provided further gains in accuracy.
Improved YOLOv8 for Fast Solar Panel Fault Detection
Architecture of YOLOv8
YOLOv8 is the latest YOLO model with an anchor-free design, decoupled head, and C2f modules. It offers faster inference speed than YOLOv7, but its detection accuracy on small solar panel faults is not satisfactory. To achieve both high precision and high speed, I introduced three improvements to YOLOv8.
Proposed YOLOv8-ours Model
D_C2f Module
The D_C2f module replaces the Bottleneck modules in the original C2f with D_Bottleneck modules that use deformable convolution (DConv). Deformable convolution adds learnable offsets to the sampling points of the convolution kernel, allowing the network to adaptively adjust the receptive field according to the target shape and size. The output feature map is computed as:
$$y(g_0)=\sum_{n=1}^{N} w(g_n)\cdot x(g_0+g_n+\Delta g_n)$$
where $$\Delta g_n$$ is the learned offset for the n-th sampling point. I used D_C2f in the second, third, and fourth stages of the backbone to enhance multi-scale feature extraction while reducing redundant computations.
WIoU v3 Loss Function
The original CIoU loss in YOLOv8 was replaced by Wise IoU v3 (WIoU v3). WIoU v3 adopts a dynamic non-monotonic focusing mechanism and assigns reasonable gradient gains to balance high- and low-quality samples. The loss is defined as:
$$L_{WIoUv3}=r\cdot L_{WIoUv1}$$
where $$r$$ is a non-monotonic focusing coefficient computed from the outlier degree $$\beta$$:
$$\beta=\frac{L_{IoU}^*}{\overline{L_{IoU}}}$$
with $$L_{IoU}^*$$ being the monotonic focusing coefficient and $$\overline{L_{IoU}}$$ the running average of IoU loss. This mechanism reduces the harmful gradients from low-quality examples and improves the model’s generalization capability.
SE_Conv Module
To suppress irrelevant background information and enhance the extraction of useful features, I added SE attention after the convolution layers in the neck network. The SE_Conv module consists of a standard Conv block followed by a Squeeze-and-Excitation attention block. The SE attention performs global average pooling, fully connected layers, and sigmoid activation to compute channel-wise weights, which are then multiplied with the original feature maps. This adaptive channel recalibration helps the model focus on fault-relevant channels.
Experimental Results
The improved YOLOv8 model was evaluated on the same dataset. The comparison results are shown below.
| Model | Crack (%) | Hot spot (%) | Dust (%) | Vegetation (%) | Cell string (%) | FPS | mAP (%) |
|---|---|---|---|---|---|---|---|
| YOLOv7 | 97.2 | 76.6 | 87.6 | 85.7 | 95.8 | 62 | 88.58 |
| YOLOv7-tiny | 98.1 | 75.4 | 89.3 | 80.3 | 93.1 | 65 | 87.24 |
| YOLOv8 | 97.8 | 77.5 | 86.4 | 85.9 | 94.9 | 73 | 87.56 |
| YOLOv8-ours | 98.5 | 81.2 | 91.2 | 90.5 | 95.0 | 79 | 91.04 |
The improved YOLOv8 achieves an mAP of 91.04%, which is 3.48% higher than the original YOLOv8, and an FPS of 79, which is 6 frames/s faster. Compared to YOLOv7, the proposed model improves mAP by 2.46% and FPS by 17 frames/s. This demonstrates that the improved YOLOv8 is more suitable for real-time fault detection in large photovoltaic plants.
Ablation Study
I further conducted ablation experiments to verify the contribution of each improvement module. The results are listed below.
| YOLOv8 | D_C2f | WIoU v3 | SE_Conv | FPS | mAP (%) |
|---|---|---|---|---|---|
| ✓ | 73 | 87.56 | |||
| ✓ | ✓ | 81 | 87.71 | ||
| ✓ | ✓ | 76 | 88.75 | ||
| ✓ | ✓ | 73 | 89.60 | ||
| ✓ | ✓ | ✓ | ✓ | 79 | 91.04 |
Each module improves the baseline accuracy. The D_C2f module provides a significant speed boost of 8 FPS with a small accuracy gain. WIoU v3 adds 1.19% mAP. SE_Conv contributes the largest improvement of 2.04% mAP, demonstrating the importance of channel attention in reducing background interference.
Conclusion and Future Work
This thesis investigated deep learning-based fault detection algorithms for solar panels using infrared images. I first constructed a well-balanced and high-quality dataset through filtering, image enhancement, and extensive data augmentation. Then, I proposed YOLOv7-PV, which integrates ResNet-PV, ELAN-PV, BiFormer attention, and NWD loss. This model achieved a mAP of 91.76% and an FPS of 69, significantly improving detection accuracy and reducing missed detections. To fulfill real-time requirements, I also proposed an improved YOLOv8 model with D_C2f, WIoU v3 loss, and SE_Conv modules. This model achieved a mAP of 91.04% and an FPS of 79, offering a better balance between speed and accuracy.
In the future, I plan to explore more advanced lightweight architectures, model compression and pruning techniques to further reduce computational cost. Additionally, I aim to deploy the trained model on embedded devices mounted on drones for real-time aerial inspection. The use of semi-supervised learning to reduce annotation effort and improve generalization to unseen environments also remains an important direction.
The experiments demonstrate that the proposed deep learning models provide reliable and efficient solutions for photovoltaic panel fault detection, contributing to the intelligent operation and maintenance of solar power plants.
