In recent years, solar energy has emerged as a pivotal renewable energy source, with solar panels serving as the core component of photovoltaic systems. However, manufacturing defects in solar panels—such as cracks, scratches, hot spots, black edges, and power loss—significantly impact their efficiency and longevity. Traditional manual inspection methods are labor-intensive, error-prone, and lack scalability. To address these challenges, this study proposes LPV-YOLO, a lightweight defect detection network optimized for solar panels. Based on YOLOv5s, LPV-YOLO achieves a balance between accuracy, speed, and computational efficiency, making it suitable for deployment on resource-constrained devices.

1. Introduction
Solar panels are critical for converting sunlight into electricity, yet defects introduced during manufacturing can degrade performance. Conventional defect detection relies on manual inspection, which is time-consuming, inconsistent, and costly. Deep learning-based approaches, particularly object detection models like YOLO, have shown promise in automating this process. However, existing models often suffer from high computational complexity, large parameter counts, and inadequate real-time performance. This work introduces LPV-YOLO, a lightweight network that integrates novel modules to enhance feature extraction, reduce redundancy, and maintain high detection accuracy for solar panel defects.
2. Related Work
Previous studies have explored various techniques for solar panel defect detection:
- ResNet-based models with attention mechanisms improved geometric feature fusion but lacked efficiency.
- Coordinate attention and decoupled heads enhanced small-defect detection but increased model complexity.
- MobileNetV2 and deformable convolutions optimized for speed but struggled with multi-scale defects.
While these methods achieved moderate success, they failed to balance accuracy, speed, and computational cost effectively. LPV-YOLO addresses these limitations through architectural innovations detailed below.
3. Methodology
3.1 Network Architecture
LPV-YOLO retains the four-stage structure of YOLOv5s (input, backbone, neck, and detection head) but introduces three key modifications:
- GhostMConv and C3MGhost Modules: Replace standard convolutions with lightweight Ghost modules and Mish activation for parameter reduction.
- MSSPPF Module: Integrates SimAM attention with spatial pyramid pooling to enhance multi-scale feature fusion.
- SE Channel Attention: Embedded in the neck to prioritize informative channels.
The overall architecture is summarized in Table 1.
Component | Description |
---|---|
Backbone | GhostMConv and C3MGhost modules reduce parameters by 49%. |
Neck | SE attention improves channel-wise feature interaction. |
Detection Head | Retains YOLOv5s structure with optimized feature maps from MSSPPF. |
3.2 Lightweight Modules
3.2.1 GhostMConv and C3MGhost
Traditional convolutions generate redundant features, increasing computational costs. The Ghost module splits convolution into two steps:
- Primary Convolution: Generates intrinsic features.
- Linear Operations: Cheap transformations (e.g., depthwise convolutions) produce ghost features.
For an input feature map with dimensions C×H×WC×H×W, the computational cost is reduced by a factor of ss (linear operations per channel):FLOPsGhost=1s⋅FLOPsStandard+s−1s⋅FLOPsLinearFLOPsGhost=s1⋅FLOPsStandard+ss−1⋅FLOPsLinear
Combined with the Mish activation function:fMish(x)=x⋅tanh(ln(1+ex))fMish(x)=x⋅tanh(ln(1+ex))
the GhostMConv and C3MGhost modules achieve smoother gradients and better generalization.
3.2.2 MSSPPF Module
The original spatial pyramid pooling (SPP) layer uses parallel max-pooling kernels but loses fine details. LPV-YOLO’s MSSPPF module:
- Replaces parallel pooling with sequential operations to reduce redundancy.
- Incorporates SimAM attention, which assigns weights to neurons based on an energy function:
et=(t−μ)2σ2+ϵ+λet=σ2+ϵ(t−μ)2+λ
where μμ and σ2σ2 are the mean and variance of neuron activations. Lower energy indicates higher importance.
3.2.3 SE Attention
The squeeze-and-excitation (SE) module recalibrates channel-wise features:zc=1H×W∑i=1H∑j=1Wxc(i,j)zc=H×W1i=1∑Hj=1∑Wxc(i,j)sc=σ(W2⋅δ(W1⋅zc))sc=σ(W2⋅δ(W1⋅zc))
where σσ and δδ are sigmoid and ReLU functions. This emphasizes critical channels for defect detection.
4. Dataset and Augmentation
4.1 PV-Multi-Defect Dataset
The dataset contains 1,107 images (600×600 pixels) of solar panels, annotated with five defect types:
- Cracks: Irregular black patterns.
- Scratches: Thin lines resembling backgrounds.
- Hot Spots: Bright white clusters.
- Black Edges: Narrow dark strips at panel edges.
- Power Loss: Large rectangular regions.
4.2 Data Augmentation
To address class imbalance and limited samples, CycleGAN generated 4,463 synthetic images. The total dataset includes 14,444 defects, split into 80% training and 20% validation sets.
5. Experiments and Results
5.1 Implementation Details
- Hardware: NVIDIA RTX 2080Ti, CUDA 11.1.
- Hyperparameters: SGD optimizer, 300 epochs, batch size 16, initial learning rate 0.001.
5.2 Evaluation Metrics
- mAP: Mean average precision at IoU thresholds [0.5, 0.95].
- Parameters, FLOPs, FPS: Model size, computational cost, and inference speed.
5.3 Ablation Study
Table 2 compares LPV-YOLO’s components against the baseline YOLOv5s.
Model | mAP@0.5 (%) | Params (M) | Size (MB) | FLOPs (G) | FPS |
---|---|---|---|---|---|
YOLOv5s (Baseline) | 94.4 | 7.23 | 13.7 | 16.5 | 91.74 |
+ GhostMConv/C3MGhost | 92.1 | 3.70 | 7.42 | 8.2 | 67.11 |
+ MSSPPF | 93.3 | 3.70 | 7.36 | 8.2 | 65.52 |
LPV-YOLO (Full) | 93.8 | 3.71 | 7.40 | 8.3 | 70.42 |
Key findings:
- Ghost modules reduce parameters by 49% with minimal mAP loss (0.6%).
- MSSPPF and SE attention recover 1.7% mAP while maintaining efficiency.
5.4 Comparative Analysis
Table 3 benchmarks LPV-YOLO against state-of-the-art models on solar panel defect detection.
Model | mAP@0.5 (%) | Params (M) | FLOPs (G) | FPS |
---|---|---|---|---|
YOLOv7 | 88.0 | 9.33 | 26.7 | 107.53 |
SSD300 | 77.7 | 34.30 | 51.6 | 71.00 |
RetinaNet | 72.2 | 41.90 | 212.0 | 42.90 |
LPV-YOLO | 93.8 | 3.71 | 8.3 | 70.42 |
LPV-YOLO achieves the highest mAP (93.8%) with the smallest parameter count (3.71M), demonstrating superior efficiency for solar panel inspection.
6. Conclusion
This study presents LPV-YOLO, a lightweight network for solar panel defect detection. By integrating Ghost modules, Mish activation, MSSPPF, and SE attention, the model reduces computational costs by 50% while maintaining 93.8% mAP. Experimental results validate its practicality for real-time deployment on edge devices, offering a robust solution for industrial quality control. Future work will explore federated learning for distributed defect detection across solar farms.