In the pursuit of achieving carbon peak by 2030 and carbon neutrality by 2060, solar energy technology has entered a new era of rapid development. As the core component of photovoltaic power generation systems, solar panels directly determine the efficiency and safety of the entire power station. However, during production, transportation, installation, and long-term outdoor operation, solar panels inevitably suffer from foreign object attachments (bird droppings, dust, snow cover) and various defects (electrical damage, physical cracks, hot spots). Even a small amount of dust accumulation can reduce the power generation efficiency of a solar panel by 10% to 20%, leading to significant economic losses for large-scale solar farms. Furthermore, defects such as cracks and hot spots not only degrade performance but also pose fire hazards. Therefore, a highly accurate and real-time detection method for foreign objects and defects on solar panels is crucial for maintaining stable and safe operation of photovoltaic plants.
Traditional approaches, including HSV-space K-means clustering and infrared image processing, have been used for solar panel anomaly detection, but they suffer from high computational resource demands, slow inference, and limited ability to capture spatial details. Deep learning-based object detection methods, particularly single-stage algorithms such as YOLO (You Only Look Once), have demonstrated superior generalization, accuracy, and robustness. YOLOv11n, the latest lightweight version in the YOLO family released in September 2024, offers a good balance between speed and accuracy. However, when applied to the detection of diverse forms and complex textures of foreign objects and defects on solar panels, YOLOv11n still exhibits low detection precision and high computational overhead. To address these issues, we propose an improved algorithm named FESI‑YOLOv11n, which integrates four key enhancements: Faster_Block_EMA, Efficient detection head, SEAttention, and Inner_DIoU loss. The main contributions of this work are as follows:
- We design a novel C3k2_Faster_EMA module that combines Faster_Block_EMA with the C3k2 module. This module expands initial convolutional channels, enabling more efficient multi‑scale feature extraction while reducing parameters and computational cost.
- We embed an SEAttention mechanism after the C2PSA module in the backbone to enhance feature representation, especially for edge‑rich defect patterns, without significantly increasing computational burden.
- We reconstruct the detection head by integrating multi‑branch, multi‑scale, and re‑parameterization concepts, which boosts the feature extraction capability of a single convolution and lowers inference cost.
- We replace the original CIoU loss with Inner_DIoU loss, which dynamically adjusts auxiliary bounding boxes based on IoU values, accelerating convergence and improving bounding box regression accuracy.
Extensive experiments on a comprehensive solar panel dataset show that our FESI‑YOLOv11n outperforms the baseline YOLOv11n by 3.6 percentage points in mAP50 and 3.4 percentage points in mAP50‑95, while reducing model parameters by 21.29% and computational load (GFLOPs) by 25.4%. These improvements demonstrate the superior effectiveness of our algorithm for real‑world solar panel foreign object and defect detection tasks.
1. Methodology
1.1 Overall Architecture of FESI‑YOLOv11n
Our improved network structure is built upon YOLOv11n, which originally consists of a Backbone, Neck, and Detection Head. The Backbone contains 13 convolutional layers with C3k2 modules (optimized information flow via small kernels) and SPPF (multi‑scale pooling), plus a C2PSA module (partial spatial attention). The Neck uses PANet for top‑down path aggregation to enhance small object detection. The original detection head uses depthwise separable convolutions and dynamic head mechanisms.
In FESI‑YOLOv11n, we make the following modifications:
- Replace all C3k2 modules in the Backbone and Neck with our proposed C3k2_Faster_EMA modules.
- Insert an SEAttention module after the C2PSA module in the Backbone.
- Replace the original detection head with our reconstructed EfficientNet‑inspired detection head (Detect_Efficient).
- Adopt Inner_DIoU as the bounding box regression loss.
The complete architecture is illustrated conceptually (the figure link is inserted later).

1.2 C3k2_Faster_EMA Module
The C3k2_Faster_EMA module is a fusion of the Faster_Block_EMA and the original C3k2 structure. Faster_Block_EMA combines two powerful components: the FasterNet Block and the Efficient Multi‑Scale Attention (EMA). The FasterNet Block uses Partial Convolution (PConv) to reduce redundant computation: only a fraction of input channels undergo regular convolution, drastically lowering FLOPs and memory access. Specifically, PConv performs convolution on only one‑quarter of the channels, achieving a theoretical FLOPs reduction of 16× compared to standard convolution and a 4× reduction in memory access. Subsequently, two 1×1 convolution layers are applied: the first reduces channel number, the second restores it for residual connection. This design efficiently extracts spatial features while minimizing computational cost.
The EMA module is a multi‑scale attention mechanism that groups channels and applies global average pooling along with convolution operations to capture both global and local dependencies. It recalibrates channel weights and captures pixel‑level relationships at a low computational cost. By integrating EMA into the FasterNet Block, the resulting Faster_Block_EMA retains multi‑scale feature extraction ability while further lowering computational complexity.
In the original C3k2 (derived from C3), the Bottleneck uses two 3×3 convolutions (instead of the original 1×3 and 3×3), which approximates a 5×5 receptive field while reducing parameters. In C3k2_Faster_EMA, we replace the standard convolution inside the Bottleneck with the Faster_Block_EMA. The module structure is mathematically defined as follows:
Let the input feature map be $$X \in \mathbb{R}^{C \times H \times W}$$. The module first splits the channels into two branches. One branch passes through a series of Bottleneck blocks (each using Faster_Block_EMA), and the other branch remains as a shortcut. Finally, the two branches are concatenated and passed through a 1×1 convolution to produce the output. Formally,
$$
\begin{aligned}
X_1, X_2 &= \text{Split}(X) \\
X_1′ &= \text{Faster\_Block\_EMA}(X_1) \quad (\text{repeated } N \text{ times}) \\
Y &= \text{Conv}_{1\times1}(\text{Concat}(X_1′, X_2))
\end{aligned}
$$
This design significantly enhances residual feature extraction for the diverse shapes and textures of solar panel foreign objects and defects, while lowering both parameter count and GFLOPs.
1.3 SEAttention Module
To further improve the network’s ability to focus on discriminative features, we introduce the Squeeze‑and‑Excitation (SE) attention module. The SE module learns channel‑wise importance weights through two operations: squeeze and excitation.
- Squeeze: Global average pooling is applied to each channel, producing a channel descriptor vector $$z \in \mathbb{R}^{C}$$ where $$z_c = \frac{1}{H \times W}\sum_{i=1}^{H}\sum_{j=1}^{W} X_c(i,j)$$.
- Excitation: Two fully connected (FC) layers followed by non‑linearities generate a weight vector: $$s = \sigma( W_2 \cdot \delta (W_1 \cdot z) )$$, where $$W_1 \in \mathbb{R}^{\frac{C}{r} \times C}$$ (reduction ratio $$r$$), $$W_2 \in \mathbb{R}^{C \times \frac{C}{r}}$$, $$\delta$$ is ReLU, and $$\sigma$$ is sigmoid. The output weight vector $$s$$ is then element‑wise multiplied with the original feature map: $$\tilde{X}_c = s_c \cdot X_c$$.
We embed the SEAttention module after the C2PSA layer in the backbone. This placement allows the model to recalibrate channel responses before feature fusion, effectively suppressing irrelevant background and enhancing defect‑related features such as cracks and hot spots on solar panels. The computational overhead is minimal (only a few fully connected layers), making it suitable for real‑time deployment.
1.4 Reconstructed Detection Head (Detect_Efficient)
Inspired by EfficientDet’s weighted bidirectional feature pyramid network (BiFPN) and its detection head design, we reconstruct the original YOLOv11n detection head to improve both efficiency and accuracy. The original YOLOv11n detection head uses separate convolutional branches for classification and regression. However, it treats all scale features equally during fusion, which may not optimally leverage multi‑scale information for detecting tiny foreign objects (e.g., bird droppings) and large defects (e.g., large cracks) on solar panels.
Our proposed Detect_Efficient head consists of the following components:
- First, the input multi‑scale feature maps (from P3 to P7) are processed by a stem that applies two 3×3 group convolutions for initial fusion. Group convolution reduces computational cost by factorizing filters.
- Then, two parallel branches are used: a classification branch (Class predict) and a bounding box regression branch (Box predict). Each branch uses an ordinary convolution to produce the final outputs.
- Finally, the outputs are concatenated to generate detection results.
The key innovation is that we apply multi‑branch re‑parameterization during training: we use a double‑convolution structure (two 3×3 convolutions) that can be merged into a single 3×3 convolution during inference via re‑parameterization. This technique improves the capacity of a single convolution without increasing inference latency. The mathematical formulation for re‑parameterization is:
Given two consecutive convolutional layers with weights $$W_1$$ (no bias) and $$W_2$$ (bias $$b_2$$), the combined equivalent convolution kernel is $$W_{\text{eq}} = W_2 * W_1$$ (where $$*$$ denotes convolution), and the equivalent bias is $$b_{\text{eq}} = b_2$$. During inference, we replace the two‑layer branch with a single convolutional layer of the same kernel size, thus reducing computation.
The overall detection head structure drastically reduces parameters and GFLOPs while maintaining or even improving detection accuracy on solar panel images.
1.5 Inner_DIoU Loss Function
The original YOLOv11n uses CIoU loss, which considers overlap area, center distance, and aspect ratio. However, CIoU sometimes suffers from slow convergence and inaccurate regression for small or elongated targets common in solar panel defects. We replace it with Inner_DIoU, which introduces auxiliary bounding boxes to accelerate regression.
Inner_DIoU is defined as:
$$
L_{\text{Inner\_DIoU}} = 1 – \text{IoU} + \frac{d^2}{c^2}
$$
where $$d$$ is the Euclidean distance between the centers of the predicted box and the ground‑truth box:
$$d = \sqrt{(x_p – x_{gt})^2 + (y_p – y_{gt})^2}$$,
and $$c$$ is the diagonal length of the smallest enclosing box covering both boxes:
$$c = \sqrt{(x_{\max} – x_{\min})^2 + (y_{\max} – y_{\min})^2}$$.
The auxiliary bounding boxes are generated by scaling the original boxes with a ratio $$\alpha$$. For small IoU samples, a larger auxiliary box is used to accelerate regression; for large IoU samples, a smaller auxiliary box helps refine the result. This dynamic adjustment improves convergence speed and final localization accuracy without adding any parameters or computational cost during inference.
2. Experiments and Results
2.1 Dataset
We compiled a dataset from public sources (PaddleX, OpenML, Roboflow) containing 12,887 images of solar panels with six categories: bird‑drop, clean, dusty, snow‑covered, electrical‑damage, and physical‑damage. All images are resized to 640×640 pixels. The dataset is split into training (10,309), validation (1,289), and test (1,289) sets at an 8:1:1 ratio.
2.2 Implementation Details
Experiments were conducted on Windows 11 with PyTorch 2.3.0, Python 3.10.15, an Intel i5‑12490F CPU, and an NVIDIA RTX 4060 Ti GPU. Training used SGD optimizer for 300 epochs with a batch size of 16 and 4 workers. Input resolution is 640×640. Default hyperparameters were used for baseline comparisons.
2.3 Evaluation Metrics
We report:
- mAP50: mean Average Precision at IoU threshold 0.5.
- mAP50‑95: mean Average Precision averaged over IoU thresholds 0.5 to 0.95 (step 0.05).
- Parameters: total number of trainable parameters.
- GFLOPs: giga floating point operations (input size 640×640).
2.4 Ablation Studies
We performed ablation experiments to verify the contribution of each component. The results are summarized in Table 1.
| Baseline | C3k2_Faster_EMA | SEAttention | Detect_Efficient | Inner_DIoU | mAP50 (%) | mAP50‑95 (%) | Parameters | GFLOPs |
|---|---|---|---|---|---|---|---|---|
| ✓ | — | — | — | — | 68.0 | 65.7 | 2,583,322 | 6.3 |
| ✓ | ✓ | — | — | — | 70.4 | 68.1 | 2,301,746 | 6.0 |
| ✓ | ✓ | ✓ | — | — | 71.2 | 68.7 | 2,302,146 | 5.9 |
| ✓ | ✓ | ✓ | ✓ | — | 71.1 | 68.5 | 2,033,218 | 4.7 |
| ✓ | ✓ | ✓ | ✓ | ✓ | 71.6 | 69.1 | 2,033,218 | 4.7 |
Table 1: Ablation experiment results. The baseline is YOLOv11n. Each row adds one component sequentially. The final model (all components) achieves the best mAP (71.6% / 69.1%) with significantly lower parameters (21.29% reduction) and GFLOPs (25.4% reduction). Note that adding Detect_Efficient slightly drops mAP compared to the previous row (71.2%→71.1%) but greatly reduces parameters and GFLOPs, making it worthwhile. Inner_DIoU then recovers and surpasses the previous mAP.
2.5 Comparison of Different Modules
To further validate the effectiveness of our specific module choices, we conducted comparative experiments on convolution blocks, attention mechanisms, detection heads, and loss functions.
2.5.1 Convolution Module Comparison
We replaced the C3k2 modules with various state‑of‑the‑art convolutional blocks: C3k2‑RVB, iRMB‑Cascaded, ContextGuided, RFAConv, C3k2‑DRB, and our proposed Faster‑EMA (the core of C3k2_Faster_EMA). Results are shown in Table 2.
| Model | mAP50 (%) | mAP50‑95 (%) | Parameters | GFLOPs |
|---|---|---|---|---|
| YOLOv11n | 68.0 | 65.7 | 2,583,322 | 6.3 |
| + C3k2‑RVB | 66.3 | 62.3 | 2,289,650 | 5.9 |
| + iRMB‑Cascaded | 67.4 | 63.7 | 2,445,242 | 6.3 |
| + ContextGuided | 69.2 | 66.2 | 2,188,355 | 5.6 |
| + RFAConv | 69.5 | 66.9 | 2,636,786 | 6.6 |
| + C3k2‑DRB | 70.1 | 67.5 | 2,443,410 | 6.3 |
| + Faster‑EMA (Ours) | 70.4 | 68.1 | 2,301,746 | 6.0 |
Table 2: Convolution module comparison. Our proposed Faster‑EMA module achieves the highest mAP50 (70.4%) and mAP50‑95 (68.1%) while maintaining low parameters and GFLOPs.
2.5.2 Attention Mechanism Comparison
We compared SEAttention with other attention modules: AFGCAttention, MLCA, Dattention, SegNext_Attention, CAFM, and TripletAttention. Results are shown in Table 3.
| Attention | mAP50 (%) | mAP50‑95 (%) | Parameters | GFLOPs |
|---|---|---|---|---|
| AFGCAttention | 69.9 | 67.3 | 2,359,752 | 5.9 |
| MLCA | 70.4 | 68.0 | 2,301,756 | 5.9 |
| Dattention | 70.5 | 67.8 | 2,560,578 | 6.1 |
| SegNext_Attention | 70.7 | 68.4 | 2,387,906 | 6.0 |
| CAFM | 70.8 | 67.9 | 2,639,531 | 6.2 |
| TripletAttention | 70.9 | 68.5 | 2,294,154 | 5.9 |
| SEAttention (Ours) | 71.2 | 68.7 | 2,302,146 | 5.9 |
Table 3: Attention mechanism comparison. SEAttention yields the best mAP50 (71.2%) and mAP50‑95 (68.7%) with competitive parameters and FLOPs.
2.5.3 Detection Head Comparison
We compared our Detect_Efficient head with YOLOv10Detect, Detect_RSCD, MultiSEAMHead, and Detect_SEAM. Results are in Table 4.
| Detection Head | mAP50 (%) | mAP50‑95 (%) | Parameters | GFLOPs |
|---|---|---|---|---|
| YOLOv10Detect | 65.8 | 63.4 | 2,302,146 | 5.9 |
| Detect_RSCD | 69.4 | 66.5 | 2,551,657 | 6.2 |
| MultiSEAMHead | 70.8 | 68.1 | 4,314,306 | 5.6 |
| Detect_SEAM | 70.9 | 68.4 | 2,210,370 | 5.3 |
| Detect_Efficient (Ours) | 71.1 | 68.5 | 2,033,218 | 4.7 |
Table 4: Detection head comparison. Our Detect_Efficient achieves the highest mAP50 (71.1%) and mAP50‑95 (68.5%) with the lowest parameters and GFLOPs.
2.5.4 Loss Function Comparison
We tested several loss functions: focaler_GIoU, EIoU, focaler_DIoU, mpdIoU, SIoU, DIoU, and our chosen Inner_DIoU. All experiments used the full improved model (with C3k2_Faster_EMA, SEAttention, and Detect_Efficient). Results are in Table 5.
| Loss Function | mAP50 (%) | mAP50‑95 (%) | Parameters | GFLOPs |
|---|---|---|---|---|
| focaler_GIoU | 68.9 | 66.1 | 2,033,218 | 4.7 |
| EIoU | 69.4 | 66.9 | 2,033,218 | 4.7 |
| focaler_DIoU | 70.3 | 67.9 | 2,033,218 | 4.7 |
| mpdIoU | 70.7 | 68.1 | 2,033,218 | 4.7 |
| SIoU | 70.8 | 68.4 | 2,033,218 | 4.7 |
| DIoU | 71.2 | 68.7 | 2,033,218 | 4.7 |
| Inner_DIoU (Ours) | 71.6 | 69.1 | 2,033,218 | 4.7 |
Table 5: Loss function comparison. Inner_DIoU achieves the highest mAP50 (71.6%) and mAP50‑95 (69.1%) without any increase in parameters or FLOPs.
2.6 Comparison with State‑of‑the‑Art Models
We compared our final model (FESI‑YOLOv11n) with other popular YOLO variants: YOLOv6n, YOLOv8n, YOLOv9s, YOLOv10n, and the baseline YOLOv11n. All models were trained and evaluated on the same dataset under identical settings. Results are in Table 6.
| Model | mAP50 (%) | mAP50‑95 (%) | Parameters | GFLOPs |
|---|---|---|---|---|
| YOLOv6n | 69.3 | 67.1 | 4,155,618 | 11.5 |
| YOLOv8n | 70.9 | 68.4 | 2,685,538 | 6.9 |
| YOLOv9s | 71.5 | 69.0 | 21,362,066 | 84.1 |
| YOLOv10n | 67.2 | 63.0 | 2,696,756 | 8.2 |
| YOLOv11n | 68.0 | 65.7 | 2,583,322 | 6.3 |
| FESI‑YOLOv11n (Ours) | 71.6 | 69.1 | 2,033,218 | 4.7 |
Table 6: Comparison with state‑of‑the‑art models. Our FESI‑YOLOv11n achieves the highest mAP50 (71.6%) and mAP50‑95 (69.1%) while using the fewest parameters (2.03M) and lowest GFLOPs (4.7). YOLOv9s obtains similar mAP but with 21.4M parameters and 84.1 GFLOPs, making it impractical for real‑time deployment.
2.7 Qualitative Results
We visually compared detection outputs across models for six typical solar panel scenarios: bird‑drop, clean, dusty, snow‑covered, electrical‑damage, and physical‑damage. Our model consistently produced higher confidence scores and more accurate bounding boxes. For example, in the bird‑drop category, our model achieved confidences of 0.87 and 0.73, significantly higher than YOLOv11n (0.74, 0.67) and YOLOv8n (0.71, 0.57). In the physical‑damage scenario, our model achieved 0.80 confidence vs. YOLOv8n’s 0.67, YOLOv9s 0.55, YOLOv10n 0.59, and YOLOv11n 0.67. In the dusty category, our model reached 0.99 confidence, matching YOLOv10n but outperforming others.
Furthermore, the training curves show that our model converges faster than YOLOv11n in terms of classification loss and validation loss, and the mAP50 and mAP50‑95 curves are consistently higher throughout the training process.
3. Conclusion
In this work, we proposed FESI‑YOLOv11n, an enhanced object detection algorithm tailored for detecting foreign objects and defects on solar panels. By incorporating C3k2_Faster_EMA modules, SEAttention, a reconstructed detection head (Detect_Efficient), and Inner_DIoU loss, we achieved substantial improvements over the baseline YOLOv11n. The algorithm improves mAP50 by 3.6 percentage points (from 68.0% to 71.6%) and mAP50‑95 by 3.4 percentage points (from 65.7% to 69.1%), while simultaneously reducing model parameters by 21.29% and computational cost by 25.4%. These gains are attributed to more efficient multi‑scale feature extraction, better feature recalibration, lightweight detection head design, and improved bounding box regression.
Compared with other state‑of‑the‑art YOLO models, our approach strikes an excellent balance between accuracy and efficiency, making it suitable for real‑time deployment in photovoltaic power station inspection systems. The ability to accurately detect bird droppings, dust, snow, electrical damage, and physical cracks on solar panels can significantly enhance the operational reliability and energy yield of solar farms.
Future work may explore deploying the model on edge devices (e.g., drones or inspection robots) and extending the dataset to include more rare defect types. Furthermore, we plan to investigate integration with anomaly detection frameworks to handle novel foreign objects that do not belong to predefined categories.
