PHDP-YOLO: A Lightweight Algorithm for Solar Panels Electroluminescence Defect Detection

As the third-largest renewable energy source after hydro and wind power, photovoltaic power generation has become a cornerstone of global energy transition. The core component of this technology is the silicon solar cell, whose power conversion efficiency directly determines energy output. Defects in solar panels, such as cracks, finger interruptions, or scratches, can significantly reduce efficiency or even cause complete failure. These defects often lead to hot spots, which not only cause localized power loss but also accelerate module aging, backsheet burnout, and potentially fire hazards. This results in substantial revenue loss, skyrocketing maintenance costs, and severe impacts on overall energy conversion efficiency. Additionally, hot spots pose electrical shock risks to personnel and equipment. With the rapid growth of global installed photovoltaic capacity, the demand for robust operation and maintenance (O&M) capabilities has never been greater.

Currently, defect detection for solar panels falls into two primary categories: traditional manual inspection, which suffers from high error rates and costs, and machine vision-based inspection. The latter leverages the electroluminescence (EL) property of photovoltaic modules. When a forward bias is applied, the injected current causes electron-hole recombination, emitting near-infrared photons captured by a CCD camera. These EL images are then processed for defect identification. Early works using YOLOv3 focused on detecting finger interruptions and cracks, while later improvements with YOLOv4 reduced missed and false detections at the cost of high model parameters. Advanced lightweight modules like MobileOne have been integrated into YOLOv5 for multi-class defect detection, and Transformer mechanisms have been embedded in backbone networks for higher accuracy. Other enhancements included coordinate attention, weighted BiFPN, and adaptive spatial feature fusion to strengthen feature extraction and reduce information loss. Recent studies using YOLOv7-tiny introduced lightweight convolutions like PSDConv, decoupled fully connected attention, and EIoU loss to replace CIoU, achieving high accuracy.

Despite these advances, existing algorithms for solar panels defect detection still face challenges when deployed in large-scale drone-based patrols. The real-time requirements and massive operational workloads demand further lightweight capacity. Conflicts between computational resource consumption and response speed remain significant. Moreover, the ability to identify small, low-contrast, and morphologically diverse defects in complex real-world scenarios requires improvement. For elongated cracks and scratches captured during high-altitude drone flights, limitations imposed by low illumination, flight height, data transmission, and model inference speed often become bottlenecks, hindering near-real-time online monitoring. Improving model robustness for detecting slender defect types is therefore crucial.

To address these issues, we propose an enhanced lightweight model called PHDP-YOLO, based on the YOLOv8 baseline. Our main contributions are as follows: we replace the backbone with the Poly Kernel Inception Network (PKINet), employing multiple parallel convolutions without dilation to extract cross-scale contextual information. The Contextual Anchor Attention (CAA) module with strip convolutions enhances the model’s ability to capture elongated defect features. In the neck network, we upgrade the C2f module using Deformable Convolution v4 (DCNv4) to handle the diverse scales, shapes, and irregularities of defects. We also introduce the High-level Screening-feature Fusion Pyramid Network (HSFPN) to improve feature fusion. This includes a channel attention module for feature screening and a Selective Feature Fusion (SFF) mechanism that uses high-level features as weights to filter semantic information from lower layers, preserving finer details. Finally, we adopt the Powerful IoU (PIoU) loss function, which directly uses the width and height of the ground truth box to guide regression, addresses the issue of bounding box enlargement, and incorporates a non-monotonic focusing attention layer for faster convergence and better generalization.

Proposed Methodology

Backbone Network: Multi-kernel Inception Network (PKINet)

Defects in solar panels, such as cracks, scratches, and finger interruptions, exhibit significant scale variations and low contrast against the background. Small defects contain limited semantic information and are easily lost in low-level feature maps, merging with the background. Sufficient contextual information helps the detector locate these small features, enhancing discrimination. For large defects, rich contextual information provides more semantic cues, aiding classification and precise localization. To model both local and global dependencies effectively, we introduce PKINet as the backbone. It consists of two main modules:

  • PKI Module: Collects local contextual information using multiple parallel inception-style convolutions.
  • CAA Module: Models global context using global average pooling and 1D strip convolutions to capture long-range pixel dependencies and enhance features within central regions.

This design efficiently extracts features from slender defect types prevalent in solar panels.

Deformable Convolution v4 (DCNv4) Enhanced C2f Module

To address the irregular, multi-scale nature of defects in solar panels, we incorporate DCNv4 to adaptively learn receptive fields. Standard 2D convolution samples at regular grid points:

$$y(p) = \sum_{k \in R} w(p_k) \cdot x(p + p_k)$$

DCN introduces learnable offsets and modulation scalars:

$$y(p) = \sum_{k \in R} w(p_k) \cdot x(p + p_k + \Delta p_k) \cdot \Delta m_k$$

DCNv4 further separates the weight into depth-wise and point-wise parts and introduces a multi-group mechanism, where spatial sampling is divided into G groups, each with independent offsets and modulations:

$$y(p) = \sum_{g=1}^{G} \sum_{k=1}^{K} w(p_k)_g \cdot \Delta m_{gk} \cdot x_g(p + p_k + \Delta p_{gk})$$

This allows the model to focus on defect shapes and extents rather than background noise, improving detection of diverse, irregular defects in solar panels.

High-level Screening-feature Fusion Pyramid Network (HSFPN)

Because the luminescence intensity of crystalline silicon is much lower than sunlight, EL images must be captured in dark environments. High-altitude drone photography under low-light conditions can produce low-resolution images. Moreover, defects like cracks and scratches exhibit clear scale disparities, necessitating effective feature fusion to inject robust shallow and deep features. HSFPN uses parallel multi-branch networks with different convolutions, followed by concatenation for fusion. It consists of:

  • Feature Selection Module: A channel attention (CA) module processes input feature maps through global average pooling and global max pooling to extract the most relevant information per channel and aggregate global context. Sigmoid activation determines channel weights.
  • Selective Feature Fusion (SFF) Module: High-level features are processed via transposed convolution and bilinear interpolation, then converted into attention weights by a CA module. These weights are applied to low-level features via element-wise multiplication and residual connection, enabling effective semantic fusion:

$$f_{ATT} = BL(T-Conv(f_{HIGH}))$$
$$f_{OUT} = f_{LOW} \odot CA(f_{ATT}) + f_{ATT}$$

This approach strengthens the model’s ability to handle fine, slender defect features while streamlining network complexity.

Powerful IoU (PIoU) Loss Function

YOLOv8 uses CIoU loss, which introduces a penalty term to minimize normalized central point distance:

$$L_{CIoU} = L_{IoU} + \frac{d^2}{c^2} + \alpha \cdot v$$

where:

$$\alpha = \frac{v}{(1 – v_{IoU}) + v}, \quad v = \frac{4}{\pi^2} \left( \arctan\frac{w_{gt}}{h_{gt}} – \arctan\frac{w_{pred}}{h_{pred}} \right)^2$$

However, during early training, low-quality predictions with low IoU can trigger gradient vanishing when no overlap occurs, leading to prediction box enlargement due to inappropriate use of the diagonal distance \(c\) of the minimum enclosing box:

$$\frac{\partial L_{CIoU}}{\partial d} = \frac{2d}{c^2}$$

Enlarging \(c\) reduces CIoU but increases the prediction box, degrading regression efficiency. To solve this, we introduce PIoU, which uses a penalty factor \(P\) based on distances between four sides of the predicted and ground truth boxes, directly guided by the ground truth width and height:

$$P = \frac{\frac{dw_1}{w_{gt}} + \frac{dw_2}{w_{gt}} + \frac{dh_1}{h_{gt}} + \frac{dh_2}{h_{gt}}}{4}$$

The PIoU formulation is:

$$f(x) = 1 – e^{-x^2}, \quad v_{PIoU} = v_{IoU} – f(P), \quad L_{PIoU} = 1 – v_{PIoU} = L_{IoU} + f(P)$$

We further add a non-monotonic focusing attention layer, controlled by a single hyperparameter \(\lambda\), to increase focus on medium-quality predictions and suppress harmful gradients from low-quality ones:

$$u(x) = 3x \cdot e^{-x^2}$$
$$L_{PIoUv2} = 3\lambda e^{-(P + \lambda^2 e^{-2P})} \cdot L_{PIoU}$$

This design accelerates convergence and enhances generalization for the defect detection tasks of solar panels.

Experiments and Analysis

Dataset and Defect Types

Our self-built dataset comprises EL images of photovoltaic panels obtained via CCD camera. Each original image contains 60 solar cells. After segmentation, we have 2,862 valid images split 8:2 into training (2,289) and validation (573) sets. Defect categories and label counts are as follows:

Dataset Defect Distribution
Defect Type Training Set Labels Validation Set Labels
Crack 786 249
Finger Interruption 1,380 378
Scratch 1,455 279

Additionally, we evaluate on the public PVEL-AD dataset released by Hebei University of Technology and Beihang University, which includes 12 defect categories. We select four representative slender defects: Crack, Finger Interruption, Star Crack, and Thick Line, totalling 2,146 images (1,496 training, 420 validation, 230 test).

Experimental Setup

The deep learning environment is as follows:

Hardware and Software Configuration
Configuration Item Detail
System Ubuntu 20.04
CPU 18 vCPU AMD EPYC 9754 128-Core Processor
GPU RTX 4090D (24 GB)
Python Version 3.8.10
Deep Learning Framework PyTorch 1.10.0
CUDA Version 11.3

Training hyperparameters are set as:

Training Hyperparameters
Parameter Value
Image Size 640
Batch Size 32
Epochs 200
Learning Rate 0.01
Momentum 0.937
Weight Decay 0.0005

Evaluation Metrics

We adopt the following standard object detection metrics:

  • Precision: \( P = \frac{TP}{TP+FP} \)
  • Recall: \( R = \frac{TP}{TP+FN} \)
  • Average Precision (AP) for each class
  • Mean Average Precision (mAP)

where TP, FP, TN, FN denote true positive, false positive, true negative, and false negative, respectively.

Ablation Study

Ablation experiments on our self-built dataset validate the contribution of each proposed module. Results are summarized below (Model 1 = baseline YOLOv8n). Symbols “√” and “×” indicate whether the module is applied.

Ablation Study Results on Self-built Dataset
Model PKI Module CAA Module HSFPN DCNv4 PIoU AP50 Crack AP50 FingerInterruption AP50 Scratch mAP@50 (%) mAP@50-95 (%) Params (M) GFLOPs (G)
Model 1 × × × × × 0.803 0.826 0.813 0.814 0.522 3.006 8.1
Model 2 × × × × 0.816 0.832 0.805 0.818 0.509 2.701 7.5
Model 3 × × × × 0.788 0.849 0.822 0.820 0.516 1.934 6.8
Model 4 × × × × 0.805 0.832 0.824 0.820 0.520 3.006 8.1
Model 5 × × × 0.816 0.849 0.810 0.825 0.515 1.922 6.8
Model 6 × × × 0.801 0.854 0.812 0.822 0.524 2.763 7.7
Model 7 × × 0.818 0.846 0.806 0.823 0.526 1.691 6.5
Model 8 × 0.799 0.860 0.814 0.824 0.527 1.679 6.4
Model 9 (PHDP) 0.825 0.837 0.829 0.830 0.525 1.679 6.4

Key observations from the ablation study:

  • Replacing the backbone with PKINet (Model 2) improves mAP@50 by 0.4% while reducing parameters by 0.3M and computation to 7.5 GFLOPs.
  • Adding the CAA module (Model 6) further boosts mAP@50 by 0.4% through effective long-range dependency modeling.
  • HSFPN (Model 3, 5, 7, 8) drastically reduces parameters and computation while maintaining or slightly improving mAP@50. However, a minor drop in mAP@50-95 occurs in some configurations due to the focus on high-level semantics at the expense of precise localization under strict IoU thresholds.
  • DCNv4 (Model 5, 8) enhances multi-scale feature extraction, further improving both mAP@50 and mAP@50-95 by 0.1% each without adding computational burden.
  • PIoU (Model 4, 9) accelerates convergence and improves detection scores. In the final model (Model 9), mAP@50 reaches 0.830%, a 1.6% improvement over baseline. Parameters drop by 44.2% (from 3.006M to 1.679M) and computation by 21% (from 8.1 G to 6.4 G).

Comparison with State-of-the-Art Methods

We compare our PHDP-YOLO against mainstream detectors on our self-built dataset. Results are summarized below.

Comparison with State-of-the-Art Detectors
Model Size AP50 Crack AP50 FingerInterruption AP50 Scratch mAP@50 (%) mAP@50-95 (%) Params (M) GFLOPs (G)
Faster R-CNN 0.743 0.742 0.805 0.764 0.422 41.130 206.670
SSD 300 0.622 0.717 0.779 0.706 0.396 24.010 343.850
YOLOv3 0.678 0.718 0.727 0.708 0.368 61.530 193.890
YOLOv5n n 0.809 0.804 0.819 0.811 0.494 1.833 4.301
YOLOv5s s 0.843 0.791 0.824 0.819 0.504 7.016 17.188
YOLOv8n n 0.803 0.826 0.813 0.814 0.522 3.006 8.100
YOLOv8s s 0.802 0.834 0.828 0.821 0.518 11.127 28.400
YOLOv8m m 0.829 0.843 0.815 0.829 0.533 43.609 164.800
RTM-DETR s 0.806 0.815 0.806 0.811 0.504 4.869 8.089
PHDP-YOLO 0.825 0.837 0.829 0.830 0.525 1.679 6.400

PHDP-YOLO achieves the highest mAP@50 (0.830%) among all compared models, with the lowest parameters (1.679M) and computation (6.4 GFLOPs). It outperforms larger models like YOLOv8m (43.6M parameters, 164.8 GFLOPs) while being more accurate than lightweight counterparts like YOLOv5n. This demonstrates its suitability for real-time, resource-constrained drone-based solar panels inspection.

Qualitative Analysis

The qualitative comparison between baseline YOLOv8n and our PHDP-YOLO reveals clear improvements, especially for slender defects. For example, a single crack that was mistakenly detected as two separate fragments by YOLOv8n is correctly identified as one continuous defect by our model. Small finger interruptions missed or partially detected by the baseline are successfully captured with higher recall and precision. Scratches, which often appear as thin, low-contrast lines, are more consistently localized. Overall, PHDP-YOLO demonstrates superior capability in detecting elongated, narrow, and irregular defect types in solar panels.

Generalization on PVEL-AD Dataset

To validate cross-dataset generalization, we compare YOLOv8n and PHDP-YOLO on the PVEL-AD dataset using four defect categories: Crack, Finger Interruption, Star Crack, and Thick Line. Results are shown below.

Generalization Evaluation on PVEL-AD
Model AP50 Crack AP50 FingerInterruption AP50 Star Crack AP50 Thick Line mAP@50 (%) AP50-95 Crack AP50-95 FingerInterruption AP50-95 Star Crack AP50-95 Thick Line mAP@50-95 (%) Params (M) GFLOPs (G)
YOLOv8n 0.699 0.900 0.801 0.825 0.806 0.428 0.497 0.489 0.436 0.463 3.006 8.1
PHDP-YOLO 0.704 0.905 0.838 0.831 0.820 0.432 0.495 0.504 0.433 0.466 1.679 6.4

PHDP-YOLO improves mAP@50 by 1.4% on PVEL-AD, with gains of 0.5%, 0.5%, 3.7%, and 0.6% for Crack, Finger Interruption, Star Crack, and Thick Line, respectively. These results confirm the model’s strong generalization ability and efficacy in detecting diverse slender defect types across different datasets and imaging conditions.

Conclusion

In this work, we constructed a dataset containing three representative slender defect types (crack, finger interruption, scratch) for solar panels and proposed PHDP-YOLO, an improved lightweight model based on the YOLOv8 architecture. Our model integrates several key innovations: a multi-kernel inception backbone (PKINet) with contextual anchor attention (CAA) for enhanced elongated feature extraction, a deformable convolution v4 (DCNv4) enhanced C2f module for handling irregular defect scales, a high-level screening feature fusion pyramid (HSFPN) for efficient and precise multi-scale feature fusion, and a Powerful IoU (PIoU) loss function with a non-monotonic focusing mechanism for faster convergence and improved regression. The experimental results on our self-built dataset demonstrate that PHDP-YOLO reduces parameters by 44.2% and computation by 21% compared to the YOLOv8n baseline, while improving mAP@50 by 1.6%. Qualitative analysis confirms superior detection of slender, continuous defects. Cross-dataset validation on the PVEL-AD public dataset shows a 1.4% increase in mAP@50, with significant improvements for star cracks. The lightweight nature and robust performance of PHDP-YOLO make it highly suitable for real-time, large-scale drone-based patrol inspection of solar panels, offering promising deployment possibilities on edge computing platforms.

Scroll to Top