Lightweight Solar Panel Defect Detection Network Based on Improved YOLOv5s

With the rapid development of photovoltaic technology, efficient and accurate defect detection in solar panels has become crucial for maintaining energy conversion efficiency and system reliability. Traditional manual inspection methods suffer from high labor costs and inconsistent accuracy, while existing deep learning models often face challenges in balancing detection speed and precision. This paper proposes LPv-YOLO, a lightweight network based on YOLOv5s, optimized for real-time solar panel defect detection with enhanced computational efficiency.

1. Methodology

The proposed LPv-YOLO architecture integrates three key innovations:

1.1 GhostMCONV and C3MGhost Modules

To reduce computational complexity, we replace standard convolutions with Ghost modules. For an input feature map with dimensions \(C \times H \times W\), the Ghost operation generates \(m\) intrinsic features through conventional convolution and \(n-m\) ghost features via linear transformations. The total computation is:

$$C_{total} = \frac{n}{s} \cdot h’ \cdot w’ \cdot c \cdot k^2 + (s-1) \cdot \frac{n}{s} \cdot h’ \cdot w’ \cdot d^2$$

where \(s\) represents the compression ratio. Compared to standard convolution, this achieves \(s\times\) reduction in parameters while maintaining feature diversity.

Module Parameters (M) FLOPs (G)
Standard Conv 7.23 16.5
GhostMConv 3.71 8.3

1.2 Attention-Enhanced Spatial Pyramid Pooling

We propose the MSSPPF module integrating SimAM attention with spatial pyramid pooling. The energy function for attention weighting is defined as:

$$e_t = \frac{4(\hat{\sigma}^2 + \lambda)}{(t – \hat{\mu})^2 + 2\hat{\sigma}^2 + 2\lambda}$$

where \(\hat{\mu}\) and \(\hat{\sigma}^2\) represent channel-wise mean and variance. This mechanism enhances defect feature representation without additional parameters.

1.3 SE Channel Attention in Neck Network

Squeeze-and-Excitation blocks are embedded in the feature fusion neck to emphasize critical channels:

$$X_{out} = \sigma(W_U \cdot \delta(W_D \cdot \text{GAP}(X))) \odot X$$

where \(W_D\) and \(W_U\) denote down/up projection matrices, and \(\odot\) represents channel-wise multiplication.

2. Experimental Results

Evaluated on a solar panel defect dataset containing 4,463 EL images with five defect types:

Defect Type Precision (%) Recall (%) mAP@0.5 (%)
Crack 88.7 89.7 93.2
Hotspot 87.6 87.8 92.5
Black Edge 91.1 85.5 97.1

The proposed LPv-YOLO demonstrates superior performance compared to existing models:

$$mAP_{\text{LPv-YOLO}} = 93.8\%\ vs.\ 94.4\%\ (YOLOv5s)$$

while achieving 49% parameter reduction and 50% FLOPs reduction. The model size is compressed to 7.4MB, enabling real-time detection at 70.42 FPS on RTX 2080Ti.

3. Ablation Study

Component-wise analysis reveals the effectiveness of each modification:

Configuration mAP (%) Params (M)
Baseline (YOLOv5s) 94.4 7.23
+ Ghost Modules 92.1 3.70
+ MSSPPF 93.3 3.70
Full Model (LPv-YOLO) 93.8 3.71

The integration of lightweight attention mechanisms compensates for the accuracy loss from network simplification, making LPv-YOLO particularly suitable for solar panel inspection scenarios requiring edge-device deployment.

4. Conclusion

This work presents a lightweight yet effective solution for solar panel defect detection, achieving optimal balance between accuracy and efficiency. The proposed architectural improvements enable practical implementation in resource-constrained environments while maintaining competitive detection performance. Future work will focus on multi-spectral defect analysis and automated repair recommendation systems for photovoltaic farms.

Scroll to Top