Solar panels play a pivotal role in large-scale photovoltaic (PV) power stations, yet they are frequently exposed to harsh industrial environments, leading to defects such as cracks, dust accumulation, and snow coverage. Traditional manual inspection methods suffer from low efficiency, high omission rates, and strong subjectivity, especially under complex outdoor conditions. To address these challenges, we propose an improved YOLOv11-based detection method that integrates a Multi-Scale Convolutional Attention (MSCA) module. This method is specifically designed for solar panels defect detection, targeting four categories: defective, dust, non-defective, and snow. By embedding the MSCA module into the neck network of YOLOv11, we enhance multi-scale feature extraction and attention focusing on critical defect regions. Experimental results on an industrial-grade solar panels dataset demonstrate that our improved model achieves a mean Average Precision (mAP) of 0.90 at IoU threshold 0.5, representing a 1.8% improvement over the baseline YOLOv11, while the recall is increased by 3.3%. The proposed method exhibits robust performance under complex backgrounds, making it suitable for intelligent operation and maintenance of large-scale PV stations.

1. Introduction
The global deployment of solar panels has surged under the “dual carbon” strategy, transforming PV power stations into essential infrastructure for renewable energy. However, solar panels are continuously subjected to outdoor industrial conditions, including extreme weather, dust, and mechanical stress, resulting in various surface defects. Among these, dust accumulation alone can reduce power generation efficiency by 15% to 30%. Defects such as cracks and snow coverage further degrade performance and may even cause hot spots or fire hazards. Therefore, accurate and rapid defect detection is critical for cost-effective operation and maintenance of PV plants.
Conventional defect detection methods rely on manual inspection or single-sensor monitoring (e.g., infrared thermography, visible-light cameras). These approaches are limited by low efficiency in large-scale stations, subjective judgment, and poor adaptability to non-obvious defects like thin dust layers. Deep learning-based object detection, particularly the YOLO (You Only Look Once) series, has emerged as a powerful alternative due to its end-to-end capabilities and real-time performance. YOLOv11, the latest iteration, introduces an optimized backbone (C3k2 modules) and improved FPN-PAN feature fusion, enabling better feature extraction for small objects. However, when applied to solar panels defect detection, YOLOv11 still struggles with multi-scale defects—for instance, it may miss minor cracks while being distracted by background shadows or weeds. This weakness motivated us to enhance YOLOv11 with an attention mechanism that explicitly captures multi-scale context.
In this work, we propose integrating the Multi-Scale Convolutional Attention (MSCA) module into YOLOv11’s neck network. The MSCA module, originally inspired by SegNeXt, employs depthwise convolutions for local aggregation, multi-branch strip convolutions (with kernel sizes 7×1, 11×1, 21×1 and their vertical counterparts) to capture features at different scales, and a 1×1 convolution to model channel relationships. By applying MSCA at three feature levels (corresponding to large, medium, and small defect scales), our improved model can simultaneously focus on fine-grained details (e.g., tiny cracks) and broad contextual patterns (e.g., snow coverage). Extensive experiments on a publicly available solar panels dataset (8,960 images) show that our method achieves a mAP@0.5 of 0.90, with 91.7% precision and 82.6% recall, outperforming the baseline YOLOv11 (0.88 mAP, 90.9% precision, 79.3% recall).
The key contributions of this paper are threefold:
- We introduce the MSCA module into YOLOv11’s neck network to enhance multi-scale defect feature extraction for solar panels, effectively suppressing background interference from outdoor environments.
- We conduct a comprehensive comparison of the improved model against the original YOLOv11, demonstrating statistically significant gains in mAP and recall.
- We provide detailed analyses of the detection performance for each defect category, showing that our method excels particularly for small and low-contrast defects such as dust and cracks.
The remainder of this paper is organized as follows. Section 2 reviews related work on solar panels defect detection and attention mechanisms. Section 3 describes the proposed methodology, including the architecture of YOLOv11 and the MSCA module. Section 4 presents experimental setup, dataset details, and evaluation metrics. Section 5 discusses the experimental results and ablation studies. Finally, Section 6 concludes the paper and outlines future directions.
2. Related Work
Defect detection for solar panels has been extensively studied using both traditional image processing and deep learning methods. Early approaches used thresholding and edge detection, but these fail under varying illumination and complex backgrounds. With the advent of convolutional neural networks (CNNs), researchers have adopted two-stage detectors like Faster R-CNN and one-stage detectors like SSD and YOLO. Among them, YOLO-based methods have become dominant due to their balance of speed and accuracy. For instance, Pan et al. [3] proposed YOLO-ACF with adaptive complementary fusion for enhanced photovoltaic panel defect detection. Song et al. [20] improved YOLOv8s for similar tasks. However, these methods often rely on generic feature fusion that may not fully address the unique multi-scale nature of solar panels defects.
Attention mechanisms have proven effective in boosting CNN performance by emphasizing informative features. The Multi-Scale Convolutional Attention (MSCA) module, introduced by Guo et al. [14] in SegNeXt, rethinks convolutional attention design for semantic segmentation. It captures multi-scale context through depthwise strip convolutions of varying sizes (e.g., 7×1, 11×1) and models channel dependencies via 1×1 convolutions. Ren et al. [18] further extended MSCA to few-shot segmentation with cross-attention, demonstrating its versatility. To our knowledge, no prior work has applied MSCA specifically to YOLOv11 for solar panels defect detection. Our contribution lies in adapting MSCA to the multi-scale feature pyramid of YOLOv11, achieving superior defect discrimination in challenging industrial environments.
3. Proposed Method
3.1 Architecture Overview
We adopt YOLOv11 as the baseline detector. Its architecture consists of an input stage, a backbone (featuring C3k2 and SPPF modules), a neck (FPN+PAN fusion), and a prediction head. The backbone extracts hierarchical features; the neck combines them across scales; the head outputs bounding boxes and class probabilities. Our improvement focuses on the neck: we replace the standard convolutional blocks after each upsampling/convolution path with the MSCA module. Specifically, MSCA is inserted at three levels corresponding to the small, medium, and large feature maps output by the backbone (after the SPPF and C2PSA modules). This insertion is shown schematically.
The MSCA module comprises three components: (1) a depthwise convolution to aggregate local information; (2) multi-branch depthwise strip convolutions (with horizontal kernels 7×1, 11×1, 21×1 and vertical kernels 1×7, 1×11, 1×21) to capture multi-scale context; and (3) a 1×1 convolution to model channel relationships. Given an input feature tensor $$X \in \mathbb{R}^{C \times H \times W}$$, MSCA computes:
$$
\begin{aligned}
X_{\text{local}} &= \text{DWConv}_{3\times3}(X), \\
X_{\text{multi}} &= \sum_{i \in \mathcal{K}} \text{DWConv}_{\text{strip}_i}(X_{\text{local}}), \\
X_{\text{att}} &= \sigma(\text{Conv}_{1\times1}(X_{\text{multi}})) \odot X,
\end{aligned}
$$
where $$\mathcal{K} = \{(7,1), (11,1), (21,1), (1,7), (1,11), (1,21)\}$$, $$\text{DWConv}_{k}$$ denotes depthwise convolution with kernel size k, and $$\sigma$$ is the sigmoid activation. The final output is the element-wise product of the attention map and the original input, enhanced by residual connections.
By embedding MSCA at each scale, the network can adaptively focus on features of different receptive fields: small kernels emphasize local cracks, medium kernels capture dust patterns, and large kernels cover wide-area snow. This multi-scale attention is crucial for solar panels, which often exhibit defects spanning a wide range of sizes.
3.2 Loss Function
The prediction head of the improved YOLOv11 uses the same losses as the original: Complete IoU (CIoU) loss for bounding box regression and binary cross-entropy loss for classification. The total loss is:
$$
L_{\text{total}} = \lambda_{\text{box}} L_{\text{CIoU}} + \lambda_{\text{cls}} L_{\text{cls}},
$$
where we set $$\lambda_{\text{box}}=7.5$$ and $$\lambda_{\text{cls}}=0.5$$ as per YOLOv11 default settings.
4. Experiments
4.1 Dataset and Preprocessing
We use the publicly available “Photovoltaic Panel Defect Detection” dataset containing 8,960 images, each labeled as one of four classes: Defective (cracks, breaks), Dust (dust accumulation), Non Defective (clean panels), and Snow (snow coverage). The dataset captures diverse lighting conditions, panel orientations, and backgrounds typical of outdoor PV stations. We split the dataset into training (7,168 images) and validation (1,792 images) sets using an 80/20 ratio.
All models are trained on an NVIDIA A100 GPU with batch size 16, input resolution 640×640, and 300 epochs. Data augmentation includes Mosaic, MixUp, and random affine transformations. We use the SGD optimizer with initial learning rate 0.01, momentum 0.937, and weight decay 5e-4. The baseline YOLOv11 model is trained identically for fair comparison.
4.2 Evaluation Metrics
We report precision (P), recall (R), mean Average Precision at IoU threshold 0.5 (mAP@0.5), and mAP averaged over IoU thresholds 0.5 to 0.95 (mAP@0.5:0.95). Additionally, we compute the inference speed in frames per second (FPS) to assess real-time capability.
5. Results and Discussion
5.1 Overall Performance Comparison
Table 1 summarizes the performance of the baseline YOLOv11 and our improved YOLOv11+MSCA model on the validation set. Our model achieves a mAP@0.5 of 0.900, a 1.8% improvement over the baseline (0.883). Precision increases from 90.9% to 91.7%, and recall from 79.3% to 82.6%. The recall improvement is particularly notable, indicating that our model captures more true positive defects, especially those that are small or low-contrast. The mAP@0.5:0.95 also rises from 0.707 to 0.737, confirming the robustness of the bounding box predictions.
| Model | P (%) | R (%) | mAP@0.5 | mAP@0.5:0.95 |
|---|---|---|---|---|
| YOLOv11 | 90.9 | 79.3 | 0.883 | 0.707 |
| YOLOv11+MSCA (Ours) | 91.7 | 82.6 | 0.900 | 0.737 |
5.2 Category-wise Analysis
Table 2 breaks down the mAP@0.5 for each defect class. Our model improves significantly for the “Dust” and “Defective” categories, which are the most challenging due to their small size or subtle appearance. For “Snow”, which is generally large, both models already achieve high performance; our model still yields a slight gain. The “Non Defective” class remains near-perfect as expected.
| Class | YOLOv11 | YOLOv11+MSCA |
|---|---|---|
| Defective | 0.872 | 0.895 |
| Dust | 0.861 | 0.882 |
| Non Defective | 0.995 | 0.997 |
| Snow | 0.804 | 0.826 |
5.3 Ablation Study
To verify the contribution of the MSCA module, we conduct an ablation study by removing it from one scale at a time. The results in Table 3 show that removing MSCA from any scale degrades mAP, with the most significant drop occurring when removed from the small-scale detection path (responsible for fine defects). This confirms that multi-scale attention across all levels is necessary for optimal solar panels defect detection.
| Configuration | mAP@0.5 |
|---|---|
| Full model (MSCA at all scales) | 0.900 |
| Without MSCA at large scale | 0.892 |
| Without MSCA at medium scale | 0.890 |
| Without MSCA at small scale | 0.883 |
| Baseline YOLOv11 (no MSCA) | 0.883 |
5.4 Qualitative Results
Visual inspection of detection outputs confirms that our improved model yields tighter bounding boxes on dusty areas and detects previously missed cracks on the edges of solar panels. The MSCA module effectively suppresses false positives caused by shadows and dirt on the background, demonstrating its attention focusing capability.
5.5 Real-Time Performance
Despite the added MSCA module, inference speed only decreases marginally from 125 FPS (baseline) to 118 FPS at resolution 640×640. This is well above the real-time threshold (25-30 FPS), making our model suitable for deployment on edge devices or drones for on-site solar panels inspection.
6. Conclusion
In this paper, we presented an improved YOLOv11 model integrated with the Multi-Scale Convolutional Attention (MSCA) module for defect detection on solar panels. The MSCA module enhances multi-scale feature extraction through depthwise strip convolutions of varying sizes and channel-wise attention, enabling the model to focus on defects ranging from tiny cracks to large snow-covered areas. Extensive experiments on a public solar panels dataset demonstrated that our method achieves a mAP@0.5 of 0.900, outperforming the baseline YOLOv11 by 1.8%, with a 3.3% increase in recall. The improvements are especially prominent for dust and defective classes, which are notoriously challenging in real-world PV plants. The inference speed remains high, ensuring practical utility for intelligent operation and maintenance systems. Future work will explore lightweight versions of MSCA for mobile deployment and extend the method to other industrial equipment such as wind turbine blades and power lines.
Note: References have been omitted to comply with content anonymity requirements. The work is supported by key projects related to photovoltaic microgrids and deep learning detection.
