DSS-YOLOv11n: A Solar Panel Defect Detection Algorithm

In the field of renewable energy, solar panel health is critical for power generation efficiency. We address the challenges of detecting defects in electroluminescence (EL) images of solar panels, where complex backgrounds make edge feature extraction difficult and feature fusion often leads to misalignment. Our proposed algorithm, DSS-YOLOv11n, introduces three novel components: a Different-scale Edge Information Select (DEIS) module, a Soft Feature Pyramid Network (SFPN), and a Shared Detail-Enhanced Detection Head (SDED). Extensive experiments on the PVEL-AD dataset show that our method achieves a precision of 88.1%, recall of 83.1%, and mAP50 of 90.8%, while reducing parameters by 14% compared to the baseline YOLOv11n. Generalization tests on an infrared solar panel dataset further confirm its robustness.

1. Introduction

Solar energy is a key driver of the global energy transition, and solar panels are the core components of photovoltaic systems. During manufacturing and installation, defects such as cracks, finger interruptions, and black cores can occur, severely reducing energy output and posing safety risks. Traditional manual inspection is inefficient and error-prone, motivating the development of automated defect detection methods using deep learning.

Recent object detectors, especially YOLO-based models, offer real-time performance with acceptable accuracy. However, in solar panel EL images, defects often exhibit faint edges, low contrast, and irregular shapes. Existing methods struggle with edge information extraction, cross-scale feature fusion, and fine-grained detection. To overcome these limitations, we propose DSS-YOLOv11n, which enhances the backbone, neck, and detection head specifically for solar panel defect detection.

2. Methodology

2.1 Baseline YOLOv11n

YOLOv11n is a lightweight object detector consisting of a backbone for feature extraction, a neck for multi-scale fusion via PANet, and a decoupled detection head. While efficient, it lacks mechanisms to capture subtle defect edges and suffers from feature misalignment during upsampling.

2.2 Different-scale Edge Information Select (DEIS) Module

To improve edge feature extraction, we replace the C3k2 blocks in the backbone with DEIS modules. The DEIS module first applies adaptive average pooling to produce four sub-feature maps at scales of 3×3, 6×6, 9×9, and 12×12. This multi-scale pooling covers defects of varying sizes. The pooling operation for each scale is given by:

$$
O_{c,h,w} = \frac{1}{K_H \times K_W} \sum_{i=0}^{K_H-1} \sum_{j=0}^{K_W-1} X_{c, h’+i, w’+j}
$$

where $K_H$ and $K_W$ are determined adaptively from input size and target output size. Each pooled feature is then passed through a depthwise separable convolution followed by the Edge Enhancer (EE) module. The EE module enhances high-frequency edge information by computing:

$$
Y = X + \sigma\left( C_{3\times3}\left( X – \text{AvgPool}(X) \right) \right)
$$

where $C_{3\times3}$ denotes a 3×3 convolution and $\sigma$ the sigmoid activation. After processing all four scales, the features are concatenated and fused with the original input via convolution. Finally, a Dual Domain Selection Mechanism (DSM) integrates spatial and frequency-domain attention. DSM comprises a spatial selection module (SSM) and a frequency selection module (FSM). SSM uses parallel branches with average and max pooling to highlight salient regions, while FSM computes channel-wise means and broadcasts them. The output is a weighted fusion, enabling the network to focus on critical defect edges while suppressing background noise.

2.3 Soft Feature Pyramid Network (SFPN)

Traditional nearest-neighbor interpolation in upsampling causes feature misalignment, especially between coarse high-level semantics and fine low-level details. We propose SFPN, which integrates Soft Nearest-neighbor Interpolation (SNI) and improved GSConvE convolutions. SNI introduces a soft weight factor $\alpha$ to adjust the influence of high-level features on low-level details:

$$
Y = \alpha \cdot \text{Res}(X), \quad \alpha = \frac{\text{Res}(X)}{\text{Res}(Y)}
$$

where $\text{Res}(\cdot)$ denotes the resolution. A larger $\alpha$ reduces interference. For downsampling, we design GSConvE, shown below, which divides the feature into two paths: one with minimal loss (1×1 conv) and another with richer representation (3×3 conv followed by 3×3 depthwise conv and GELU activation). The two paths are concatenated and shuffled. We remove batch normalization from the depthwise branch to reduce redundancy while maintaining training stability. The GSConvE architecture is:

GSConvE Structure Comparison
Component Description
Input Feature from previous layer
1×1 Conv Channel alignment and transformation
Split Divide into two paths (half channels each)
Path1 Identity (or 1×1 conv) – preserves information
Path2 3×3 Conv → 3×3 DW Conv → GELU
Concat Channel-wise concatenation
Shuffle Channel shuffle for information mixing

2.4 Shared Detail-Enhanced Detection Head (SDED)

The original YOLOv11n detection head uses separate branches per scale, lacking cross-scale interaction. We design SDED to share convolutional layers and incorporate detail enhancement. Features from P3, P4, and P5 are input to the head. First, a group normalization 1×1 convolution (GN_Conv) aligns channels and enhances consistency. Then, a shared detail-enhanced convolution (GN_DEConv) is applied. DEConv combines five operators: central difference convolution, angle difference convolution, horizontal difference convolution, vertical difference convolution, and standard convolution. Their outputs are fused with learnable weights:

$$
\omega_i = \frac{\exp(w_i)}{\sum_{k=1}^5 \exp(w_k)}, \quad Y = \sum_{i=1}^5 \omega_i K_i(X)
$$

where $w_i$ are learnable parameters initialized equally. This adaptive fusion allows the head to focus on spatial structures most relevant to defect edges. Finally, a Scale layer with learnable factor $\lambda$ adjusts the output logits per detection layer to handle scale variations. The overall head is lightweight and improves both recall and precision for solar panel defects.

Figure: Example of a well-functioning solar panel (our algorithm aims to detect defects that degrade such panels).

3. Experiments

3.1 Dataset and Settings

We use the PVEL-AD public dataset containing 3957 EL images of solar panels with six defect classes: crack, finger, black_core, thick_line, star_crack, and horizontal_dislocation. The dataset is split 7:2:1 into training, test, and validation sets. We train for 300 epochs with batch size 16, initial learning rate 0.01, momentum 0.937, and image size 640×640. All experiments are conducted on an NVIDIA GeForce RTX 5060 GPU using PyTorch 2.9.0.

3.2 Ablation Studies

We evaluate the contribution of each proposed module by adding them incrementally to the baseline YOLOv11n. The results are summarized in the following table.

Ablation study results (P=precision, R=recall, mAP50=mean average precision at IoU=0.5, Params=parameters in millions, GFLOPs=giga floating point operations). Checks indicate module usage.
Model DEIS SFPN SDED P (%) R (%) mAP50 (%) Params (M) GFLOPs
YOLOv11n × × × 85.4 79.3 87.6 2.58 6.3
Model1 × × 87.1 79.9 87.9 2.57 6.6
Model2 × × 86.6 80.4 88.7 2.53 6.3
Model3 × × 84.7 82.5 89.0 2.26 6.0
Model4 × 88.1 82.6 88.9 2.55 6.4
Model5 × 87.1 83.4 89.4 2.25 6.3
Model6 × 87.5 82.8 90.3 2.22 6.1
Ours (full) 88.1 83.1 90.8 2.21 6.2

Each module contributes positively. The full model achieves the best mAP50 (90.8%) while reducing parameters to 2.21M, confirming that our improvements jointly enhance solar panel defect detection without excessive computational cost.

3.3 Comparison of Downsampling Convolutions

We compare GSConvE against SPDConv, CGD, ADown, and HWD with SNI fixed. Results are shown below.

Comparison of different downsampling convolutions in the SFPN neck. Best values are bold.
Method P (%) R (%) mAP50 (%) Params (M) GFLOPs
SPDConv 78.0 76.5 79.8 2.56 7.0
CGD 86.2 79.3 88.1 2.99 6.8
ADown 82.1 78.5 78.5 2.67 6.1
HWD 77.1 73.4 78.6 2.68 6.2
GSConvE 86.6 80.4 88.7 2.53 6.3

GSConvE achieves the highest precision, recall, and mAP50 with the lowest parameters, demonstrating its effectiveness in multi-scale fusion for solar panel defects.

3.4 Detection Head Comparison

We compare SDED with SEAMHead, EfficientHead, and DyHead. Results are tabulated below.

Performance of different detection heads.
Head P (%) R (%) mAP50 (%) Params (M) GFLOPs
SEAMHead 79.4 81.2 87.6 2.49 6.5
EfficientHead 83.6 84.1 88.7 2.31 6.2
DyHead 81.7 80.4 86.5 2.29 6.1
SDED 84.7 82.5 89.0 2.26 6.0

SDED provides the best balance: highest mAP50 and lowest parameter count, with competitive recall and precision, proving its suitability for detecting fine defects in solar panel images.

3.5 Comparison with State-of-the-Art Models

We compare DSS-YOLOv11n with YOLOv5n, YOLOv8n, YOLOv10n, AE-YOLO, YOLO-PV, YOLO-ACF, Hyper-YOLOn, and the baseline YOLOv11n. All models are trained under identical conditions on the solar panel dataset.

Performance comparison of different detection algorithms on solar panel EL images.
Model P (%) R (%) mAP50 (%) Params (M)
YOLOv5n 83.7 79.2 83.6 2.23
YOLOv8n 81.3 79.7 85.4 2.68
YOLOv10n 84.1 78.5 82.3 2.73
AE-YOLO 82.9 79.7 85.1 2.32
YOLO-PV 87.6 82.8 87.1 2.52
YOLO-ACF 84.8 81.2 88.5 2.93
Hyper-YOLOn 85.2 82.4 89.3 3.63
YOLOv11n (baseline) 85.4 79.3 87.6 2.58
DSS-YOLOv11n (ours) 88.1 83.1 90.8 2.21

Our method outperforms all competing models in mAP50, precision, and recall while having the smallest parameter count among models that achieve over 88% mAP. The improvement over YOLOv11n is +2.7% P, +3.8% R, and +3.2% mAP50, with a 14% reduction in parameters.

3.6 Generalization Experiment

To test cross-dataset generalization, we evaluate our model on an infrared solar panel dataset containing 1287 training images and 143 validation images with defect classes: hotspot, PID effect, diode failure, shading, and glass breakage. Results are shown below.

Generalization performance on infrared solar panel dataset.
Model P (%) R (%) mAP50 (%) Params (M)
YOLOv11n 78.0 78.4 82.1 2.58
DSS-YOLOv11n 79.3 80.7 83.5 2.20

DSS-YOLOv11n maintains an advantage over the baseline, achieving higher precision and recall with fewer parameters, confirming its robustness across imaging modalities.

4. Conclusion

We have presented DSS-YOLOv11n, an enhanced object detector tailored for solar panel defect detection. The DEIS module strengthens edge feature extraction through multi-scale pooling and dual-domain attention. The SFPN improves feature fusion via soft nearest-neighbor interpolation and a novel GSConvE convolution that balances efficiency and representation. The SDED detection head shares weights and incorporates detail-enhanced convolutions to capture fine-grained defects. Extensive experiments on both EL and infrared solar panel datasets demonstrate significant improvements in accuracy and efficiency, with a 14% reduction in parameters and mAP50 reaching 90.8%. Our algorithm provides a reliable solution for automated solar panel inspection, contributing to the maintenance of photovoltaic systems and the advancement of renewable energy.

Scroll to Top