Towards Efficient Drone-Based Solar Panel Inspection

The growing global energy demand necessitates a decisive shift towards sustainable sources, with solar energy standing out as a pivotal component of the renewable energy transition. The widespread deployment of photovoltaic (PV) systems, however, introduces significant operation and maintenance challenges. Solar panels, as the core energy-harvesting units, are constantly exposed to harsh environmental conditions, leading to various defects such as bird droppings, dust accumulation, glass breakage, cell damage, and shading from vegetation. These issues, if not promptly identified and addressed, can severely degrade the power generation efficiency of the entire PV array and shorten the operational lifespan of the system. Therefore, efficient and reliable solar panel defect detection is critical for ensuring the economic viability and safety of solar installations.

Traditional manual inspection methods are labor-intensive, time-consuming, and often impractical for large-scale solar farms or installations in difficult terrain. The integration of Unmanned Aerial Vehicles (UAVs) with computer vision has emerged as a superior alternative, enabling rapid, large-area inspections. While many studies focus on thermal infrared imaging for hotspot detection, this approach has limitations: low resolution at high drone speeds, difficulty in classifying defect types, and insensitivity to defects that do not cause significant temperature anomalies. Visible-light imaging, which captures surface color, texture, and shape, offers a complementary and often more accessible pathway for identifying common visible defects like soiling and physical damage. However, detecting defects from a UAV perspective using visible light presents unique challenges. Targets are often extremely small, their shapes are highly variable, and complex backgrounds (e.g., sky, ground, mounting structures) introduce considerable noise. Furthermore, models trained on simplified, single-scene datasets often lack robustness in real-world, multi-scene environments. While recent deep learning models, particularly the YOLO family, have shown promise for real-time object detection, their direct application to this specific task yields suboptimal performance due to insufficient feature extraction capability for small, complex defects and the generation of redundant information during feature fusion.

To address these challenges, this work constructs a diverse, multi-scene visible-light defect dataset captured from a UAV perspective and proposes PV-YOLO, a lightweight and efficient defect detection algorithm based on an improved YOLOv10s architecture. The proposed enhancements are designed to improve small-target perception, enhance feature representation, and reduce model complexity for potential edge deployment.

The overall architecture of PV-YOLO is built upon the YOLOv10s baseline, which provides a good balance between speed and accuracy. Our modifications are strategically integrated into the backbone and neck networks, alongside an optimized loss function and a model compression step. The core improvements include: 1) The addition of a P2 detection head for finer-grained small object detection. 2) The design of a Global Perception Module (GPM) to replace the first C2f module in the backbone. 3) The introduction of an Enhanced interlayer Feature Correlation (EFC) fusion strategy in the neck. 4) The adoption of the Focaler-IoU loss function. 5) The application of Layer-adaptive Magnitude-based Pruning (LAMP) for model compression. The synergistic effect of these components enables PV-YOLO to achieve superior detection performance for solar panel defects under challenging conditions.

Core Methodological Innovations

1. Global Perception Module (GPM)

Convolutional Neural Networks (CNNs), while excellent at extracting local features, struggle with modeling long-range dependencies due to their inherently limited receptive fields. For solar panel defect detection, where a defect might be a small stain relative to the entire panel, capturing global context is crucial for distinguishing it from background noise. To address this, we propose the Global Perception Module (GPM). The GPM is designed to perform effective global-local modeling by integrating two complementary branches: an Attentive State Space Module (ASSM) branch for global context modeling and an Adaptive Multi-Scale Convolution (AMSC) branch for enhanced local feature refinement.

Given an input feature map \(X \in \mathbb{R}^{C \times H \times W}\), the GPM produces an output \(Y \in \mathbb{R}^{C \times H \times W}\). Its operation can be mathematically described as follows.

AMSC Branch: This branch focuses on strengthening local dependencies and suppressing channel and spatial redundancies. The input \(X\) first passes through a series of convolutional layers to capture multi-context information.
$$X_0 = \text{ReLU}(\text{BN}(\text{Conv}_{3 \times 3}(X)))$$
$$X_1 = \text{ReLU}(\text{BN}(\text{Conv}_{3 \times 3}(X + X_0)))$$
where \(\text{Conv}_{i\times i}\) denotes a convolution with kernel size \(i\), BN is Batch Normalization, and ReLU is the activation function.

Subsequently, channel attention weights are generated via global average pooling (AvgPool), a 1×1 convolution, and a sigmoid function \(\sigma\).
$$W_0 = \sigma(\text{Conv}_{1 \times 1}(\text{AvgPool}(X_0)))$$
$$W_1 = \sigma(\text{Conv}_{1 \times 1}(\text{AvgPool}(X_1)))$$
A channel-wise Softmax normalization is applied to these weights to obtain the final channel descriptors, which are used to recalibrate the input features, emphasizing important channels.
$$Y_0 = \text{Softmax}(W_0) \odot X_0$$
$$Y_1 = \text{Softmax}(W_1) \odot X_1$$
where \(\odot\) denotes element-wise multiplication.

Finally, spatial attention is computed by concatenating \(Y_0\) and \(Y_1\), applying global average pooling, and a spatial Softmax.
$$W_S = \text{Softmax}(\sigma(\text{AvgPool}(\text{Concat}(Y_0, Y_1))))$$
The output of the AMSC branch is the spatially and channel-wise refined feature map:
$$F_{\text{AMSC}} = Y_0 \odot W_S + Y_1 \odot W_S$$

ASSM Branch: This branch is responsible for capturing long-range, global contextual information efficiently. The ASSM utilizes a state-space model framework. The input \(X\) undergoes positional embedding (PE) to retain spatial structure, followed by a Semantic Guided Neighboring (SGN) operation that rearranges the feature sequence to group semantically similar pixels. An Attentive State Evolution (ASE) module then models the global interactions within this organized sequence. The inverse SGN operation restores the original spatial layout.
$$F_{\text{ASSM}} = \text{SGN}^{-1}(\text{ASE}(\text{SGN}(\text{PE}(\text{LN}(X)))))$$
where LN denotes Layer Normalization.

Fusion: The outputs from both branches are combined to achieve a complementary global-local representation, which is then projected via a linear layer to produce the final output of the GPM.
$$Y = \text{LN}(\text{GELU}(\text{LN}(F_{\text{AMSC}} + F_{\text{ASSM}})))$$
By integrating GPM into the backbone network, our model gains a significantly enhanced ability to perceive both the fine-grained details of a small defect and its broader context within the solar panel, leading to more accurate and robust feature extraction.

2. Enhanced Interlayer Feature Correlation (EFC) Fusion

Feature Pyramid Networks (FPN) and Path Aggregation Networks (PAN) are standard for multi-scale feature fusion in object detection. However, traditional fusion methods like simple addition or concatenation often treat features from different layers independently, ignoring their intrinsic correlations. This can lead to the generation of redundant features and cause small target information to be diluted by background noise during fusion. To mitigate this, we introduce the Enhanced interlayer Feature Correlation (EFC) strategy, which consists of two key components: the Grouped Feature Focus Unit (GFF) and the Multilevel Feature Reconstruction Module (MFR).

Given two input feature maps from different levels, \(X_i\) and \(X_{i-1}\), the EFC module produces a fused output \(Y\).

GFF Component: This component aims to enhance inter-channel correlations. It starts by generating a preliminary fused feature \(P = X_i + X_{i-1}\). A spatial attention map \(W_G\) is then created from \(P\) to perform initial spatial refinement: \(Z = P \odot W_G\). The refined feature \(Z\) is split into four groups along the channel dimension: \(Z_1, Z_2, Z_3, Z_4\). Within each group, a channel interaction mechanism is applied to strengthen the correlation between neighboring channel features:
$$P_k = \text{Softmax}(\text{Conv}_{1\times1}(Z_k)) \odot Z_k, \quad k=1,2,3,4$$
The grouped features are then concatenated and aligned with the global context of the preliminary fusion \(P\) through a dedicated normalization operation to produce the GFF output \(F_{\text{GFF}}\).

MFR Component: This component focuses on separating and reconstructing strong and weak spatial information to reduce redundancy. It first generates a channel-wise threshold weight \(W_T = \sigma(\text{AvgPool}(P))\) from the preliminary fusion \(P\). Then, spatial activation maps for each input are computed: \(W_i = \sigma(\text{BN}(X_i))\) and \(W_{i-1} = \sigma(\text{BN}(X_{i-1}))\). By comparing these activation maps with the threshold \(W_T\), strong and weak attention maps (\(W^u_i, W^l_i, W^u_{i-1}, W^l_{i-1}\)) are separated. These maps are used to weight the preliminary fusion \(P\), generating strong and weak feature maps:
$$P^{up} = (W^u_i \odot P) + (W^u_{i-1} \odot P)$$
$$P^{low} = (W^l_i \odot P) + (W^l_{i-1} \odot P)$$
The weak feature map \(P^{low}\) is passed through a gating unit to enhance its semantic expression, while the strong feature map \(P^{up}\) is processed by a 1×1 convolution. Their sum forms the MFR output \(F_{\text{MFR}}\).

The final output of the EFC module is the sum of the two components, yielding features with enhanced correlations and reduced redundancy:
$$Y = F_{\text{GFF}} + F_{\text{MFR}}$$
Integrating EFC into the neck network allows PV-YOLO to more effectively combine semantic information from deep layers with detailed information from shallow layers, which is crucial for detecting the small and varied defects found on solar panels.

3. Focaler-IoU Loss Function

The original YOLOv10 uses the Complete-IoU (CIoU) loss for bounding box regression, which considers overlap area, center distance, and aspect ratio. Its formula is:
$$L_{\text{CIoU}} = 1 – \text{IoU} + \frac{\rho^2(b, b^{gt})}{c^2} + \alpha \nu$$
where \(\rho\) is the Euclidean distance, \(c\) is the diagonal length of the smallest enclosing box, and \(\alpha \nu\) is the aspect ratio penalty term.

However, loss functions like CIoU treat all samples equally, ignoring the significant foreground-background imbalance prevalent in small object detection. This can lead to suboptimal performance for the small defects on solar panels. To direct more focus towards challenging samples, we employ the Focaler-IoU loss. It dynamically adjusts the IoU loss based on sample difficulty by remapping the IoU value through a linear interval mapping function:
$$L_{\text{FIoU}} =
\begin{cases}
0, & \text{IoU} < d \\
\frac{\text{IoU} – d}{u – d}, & d \le \text{IoU} \le u \\
1, & \text{IoU} > u
\end{cases}$$
Here, \(d\) and \(u\) are tunable thresholds defining the lower bound for hard samples and the upper bound for easy samples, respectively (\(0 \le d \le u \le 1\)). By setting appropriate values for \(d\) and \(u\), the model can be instructed to pay more attention to medium/hard samples (e.g., small, partially occluded defects). The final regression loss used in PV-YOLO is a combination designed to maintain geometric accuracy while adding focal weighting:
$$L_{\text{FCIoU}} = L_{\text{CIoU}} + \text{IoU} – L_{\text{FIoU}}$$
This modification helps the model prioritize the localization of difficult small defect instances on the solar panel surface.

4. Model Compression via LAMP Pruning

While the aforementioned improvements boost accuracy, they may increase model parameters and computational cost. For practical deployment on drones or edge devices with limited resources, model lightweighting is essential. We adopt the Layer-adaptive Magnitude-based Pruning (LAMP) algorithm to compress the trained PV-YOLO model. Unlike naive magnitude pruning, LAMP evaluates the importance of a weight relative to others in the same layer. The LAMP score for a weight \(W(u)\) is calculated as:
$$\text{score}(u; W) = \frac{(W^{(u)})^2}{\sum_{v \ge u} (W^{(v)})^2}$$
where the denominator sums the squared magnitudes of all weights in the same layer with magnitude greater than or equal to \(|W^{(u)}|\). This score provides a layer-adaptive importance metric. Weights across all layers are sorted by their LAMP scores, and those with the lowest scores are pruned iteratively until a target global sparsity ratio is achieved. This method allows for aggressive pruning while preserving the most critical connections for solar panel defect detection, effectively reducing the model’s parameter count and memory footprint without a substantial drop in performance.

Experiments and Discussion

Dataset and Implementation

To ensure model robustness, we curated a diverse dataset comprising images from multiple real-world outdoor scenarios. Approximately 80% of the data was collected using a DJI Mavic 3T drone. To enrich the dataset with complex, multi-defect samples, we artificially created mixed-defect scenarios (12% of data) involving bird droppings, dust, and simulated vegetation shading (using scattered leaves). An additional 8% consisted of rare defect samples gathered from public sources. The final annotated dataset includes five defect categories: Bird Dropping, Dust Cover, Glass Breakage, Cell Damage, and Vegetation Shading, totaling 750 original images. We applied standard data augmentation techniques (mirroring, rotation, brightness adjustment) via the Roboflow platform, expanding the dataset to 2,250 images for training. The dataset was split into training, validation, and test sets in an 8:1:1 ratio.

All experiments were conducted on a server with an NVIDIA vGPU-32GB, using PyTorch framework. The models were trained for 300 epochs with a batch size of 16, an input image size of 640×640, and the AdamW optimizer with an initial learning rate of 0.01.

For performance evaluation, we use standard metrics: Precision (P), Recall (R), and mean Average Precision at IoU thresholds of 0.5 (mAP@50) and 0.5:0.95 (mAP@50:95). Model complexity is measured by the number of parameters and memory usage (in MB).

Ablation Study

We conducted a comprehensive ablation study to validate the contribution of each proposed component, with results summarized in the table below. The baseline is the standard YOLOv10s model.

P2 Head GPM EFC Focaler-CIoU LAMP P (%) R (%) AP50 (%) AP50:95 (%) Params (M) Memory (MB)
80.7 76.7 81.9 54.3 8.04 16.6
85.3 81.7 86.8 57.2 8.22 17.2
89.2 81.1 87.0 53.7 8.44 17.6
85.6 83.7 87.9 57.3 8.92 18.6
83.8 84.7 87.6 55.7 8.22 17.2
84.4 82.9 88.1 57.3 9.14 19.1
86.0 83.8 88.8 56.4 9.14 19.1
85.0 88.5 89.4 57.1 6.73 14.5

The results clearly demonstrate the effectiveness of each component. Adding the P2 detection head provides a substantial boost across all metrics, confirming its value for small solar panel defect detection. Individually, the GPM module improves precision significantly, the EFC strategy boosts recall and AP50, and the Focaler-IoU loss further enhances recall. When combined, these modules (GPM, EFC, Focaler-IoU) achieve the highest AP50 of 88.8% on the full model. Finally, applying LAMP pruning at a 30% sparsity ratio successfully reduces the parameter count by approximately 26.4% and memory usage by 24.1%, while surprisingly improving the final AP50 to 89.4%. This indicates that pruning effectively removed redundant parameters without harming, and even slightly enhancing, the model’s discriminative power for solar panel defects.

Comparison with State-of-the-Art Models

We compare PV-YOLO with several popular one-stage and two-stage object detectors under identical experimental settings. The results are presented in the following table.

Model P (%) R (%) AP50 (%) AP50:95 (%) Params (M) Memory (MB)
SSD 63.0 53.8 64.4 46.7 26.30 101.3
Faster R-CNN 60.7 62.8 61.5 45.7 137.10 327.1
YOLOv8s 80.7 81.5 85.3 60.0 11.12 21.5
YOLOv9s 82.1 81.2 84.4 56.8 7.12 15.3
YOLO11s 82.8 80.3 83.9 56.9 9.41 19.2
YOLO12s 79.8 77.9 80.9 53.4 9.23 18.1
YOLOv13s 82.2 76.6 83.5 58.9 9.00 18.6
PV-YOLO (Ours) 85.0 88.5 89.4 57.1 6.73 14.5

PV-YOLO achieves the best performance in terms of Recall, AP50, and model lightweightness (lowest Parameters and Memory). It outperforms the strong baseline YOLOv8s by 4.1% in AP50 while being significantly smaller. Compared to its direct predecessor YOLOv10s (first row of the ablation study), PV-YOLO shows improvements of +4.3% in Precision, +11.8% in Recall, +7.5% in AP50, and +2.8% in AP50:95, alongside a 16.3% reduction in parameters and a 12.7% reduction in memory usage. This demonstrates that our proposed method successfully addresses the specific challenges of drone-based solar panel defect inspection, offering a superior balance of accuracy and efficiency.

Qualitative Analysis

Visual comparisons between the baseline YOLOv10s and our PV-YOLO provide intuitive evidence of its superiority. In complex scenes containing multiple small and irregularly shaped defects like bird droppings, PV-YOLO demonstrates significantly fewer missed detections and higher confidence scores. For subtle defects like faint cracks or discolorations on the solar panel glass, PV-YOLO can more reliably localize and identify them based on limited visual cues. In mixed-defect scenarios, PV-YOLO maintains robust detection across different defect types and scales, whereas the baseline model often fails on smaller or less distinct targets. These observations align with the quantitative metrics, confirming that the GPM’s global-local modeling and the EFC’s enhanced feature fusion enable the model to extract and utilize more discriminative features for challenging solar panel defects.

Conclusion and Future Work

This paper presents PV-YOLO, a novel lightweight detection algorithm tailored for identifying defects in solar panels from UAV-captured visible-light imagery. To tackle the core challenges of small target size, complex backgrounds, and varied defect morphology, we introduced several key innovations: a Global Perception Module for enhanced context modeling, an Enhanced interlayer Feature Correlation fusion strategy to reduce redundancy and improve feature correlation, and the Focaler-IoU loss to focus training on harder samples. Furthermore, we applied LAMP pruning to achieve a compact model suitable for edge deployment. Trained and evaluated on a purpose-built, multi-scene dataset, PV-YOLO achieves state-of-the-art detection accuracy while maintaining a lightweight footprint. It provides a practical and effective technical solution for the automated, efficient monitoring and maintenance of photovoltaic power plants, contributing to the sustainability and reliability of solar energy systems.

Future work will focus on several directions. First, we aim to explore more advanced and efficient architectures for small object detection to further push the performance boundary. Second, we will investigate knowledge distillation or neural architecture search techniques to automate the design of an even more lightweight model without compromising accuracy. Finally, extending the system to perform real-time, onboard processing on UAVs or other edge devices represents a critical step towards fully autonomous solar panel inspection systems.

Scroll to Top