DBCI-DETR for Defect Detection in Solar Panels

I propose a novel defect detection algorithm named DBCI-DETR (Deformable Boundary-refined and Cycle-wavelet Integrated DETR) to address the challenges of varying defect sizes, complex background textures, and diverse defect types in solar panels. This work focuses on improving the detection accuracy under challenging electroluminescence (EL) imaging conditions, where solar panels exhibit intricate grain structures and irregular defect morphologies. The algorithm integrates several innovative modules to enhance feature extraction, multi-scale fusion, and loss optimization, achieving state-of-the-art performance on the PVEL-AD dataset. I will detail each component, present extensive experimental results, and demonstrate the superiority of DBCI-DETR over existing methods.

1. Introduction

The rapid expansion of photovoltaic power generation has made the reliable operation of solar panels critical for sustainable energy. Defects such as cracks, black cores, grid breaks, and short circuits inevitably occur during manufacturing, transportation, and operation, reducing efficiency and posing safety risks. Traditional manual inspection based on electrical characteristics is slow and costly. Deep learning-based object detection has emerged as a promising solution, with both two-stage detectors (e.g., Faster R-CNN) and one-stage detectors (e.g., YOLO series) being widely studied. However, these methods often rely on threshold filtering and non-maximum suppression, which degrade robustness and speed. The Detection Transformer (DETR) paradigm eliminates these post-processing steps through end-to-end set prediction. The real-time variant RT-DETR achieves a good balance between accuracy and speed, but it still struggles with complex backgrounds and tiny defects in solar panels.

To overcome these limitations, I develop DBCI-DETR, which consists of four major innovations: (1) A Deformable Triple Attention Module (DTAM) that adaptively extracts irregular defect features using deformable convolution and cross-dimensional interaction. (2) A Cycle Wavelet Convolution (CycleWT) module that leverages wavelet transforms to separate spatial and frequency information, expanding the receptive field while suppressing background texture noise. (3) A Bidirectional Cross-Scale Pyramid Fusion (BiCCFM) architecture that introduces high-resolution shallow features and bidirectional weighting to enhance multi-scale fusion, particularly for small defects. (4) The use of CARAFE (Content-Aware ReAssembly of FEatures) upsampling and Inner-IoU loss to further improve feature recovery and convergence. Experimental results on public datasets demonstrate that DBCI-DETR significantly outperforms baseline models and other state-of-the-art methods in detecting defects in solar panels.

2. Related Work

Defect detection in solar panels has been approached through various deep learning frameworks. Two-stage detectors like Faster R-CNN generate region proposals and then classify them, which is accurate but slow. One-stage detectors like YOLOv5, YOLOv8, and YOLOv11 achieve real-time performance but rely on NMS, which can cause missed detections in crowded scenarios. The DETR family uses transformers and bipartite matching to avoid NMS. RT-DETR improves upon DETR with a hybrid encoder and efficient decoder design, making it suitable for real-time applications. However, when applied to solar panels, RT-DETR often fails to capture fine-grained irregular defects due to its reliance on standard convolutions and unidirectional feature fusion. Researchers have attempted to address these issues by incorporating attention mechanisms, wavelet transforms, and multi-scale fusion, but few works systematically combine these techniques for the specific challenges of solar panel EL images.

3. Proposed Method

The overall architecture of DBCI-DETR is illustrated in the conceptual diagram (not shown). It consists of a backbone network, a hybrid encoder (including BiCCFM and CycleWT), and a decoder with auxiliary prediction heads. I modify each component to better suit defect detection in solar panels.

3.1 Deformable Triple Attention Module (DTAM)

Standard convolutions in the backbone are limited by fixed sampling grids, making them ineffective for irregular defect shapes such as star-shaped cracks and dendritic patterns. I propose DTAM to replace the basic residual blocks. The module first applies a 1×1 convolution to reduce channel dimensionality, then processes the feature through two parallel branches: a 3×3 standard convolution for regular patterns and a 3×3 deformable convolution that learns offset vectors to adaptively sample around irregular defect regions. The deformable convolution operation is defined as:

$$ y(\mathbf{p}_0) = \sum_{\mathbf{p}_n \in \mathcal{R}} \omega(\mathbf{p}_n) \cdot x(\mathbf{p}_0 + \mathbf{p}_n + \Delta \mathbf{p}_n) $$

where $\mathbf{p}_0$ is a point on the input feature map, $\mathbf{p}_n$ enumerates the sampling positions in the convolutional kernel, $\omega$ is the kernel weight, and $\Delta \mathbf{p}_n$ is the learned offset. This allows the module to focus on defect regions rather than background.

The outputs of both branches are concatenated and then processed by a Triple Attention mechanism. Triple Attention rotates the feature map along height and width dimensions to create three cross-dimensional interaction branches: (C, H), (C, W), and (H, W). After passing through convolution and pooling layers, the attention weights are computed and applied to reweigh the features. This cross-dimensional interaction resolves semantic misalignment between the regular and deformable branches, effectively emphasizing defect-related features and suppressing irrelevant texture responses. The Z-Pool operation, which combines average and max pooling, reduces computational cost while preserving informative cues.

Experimental comparisons show that Triple Attention outperforms other attention mechanisms (CA, SE, CBAM) when integrated into DTAM, as summarized in Table 1.

Table 1: Comparison of attention mechanisms within DTAM on the PVEL-AD dataset.
Attention Mechanism mAP50 (%) mAP50-95 (%) FPS
None 87.6 59.8 58.8
CA 88.3 60.8 58.5
SE 88.9 62.3 58.6
CBAM 89.0 62.2 58.5
Triple Attention 89.2 62.6 58.4

Triple Attention yields the highest mAP50, confirming its effectiveness in resolving semantic misalignment while maintaining real-time performance. This improvement is particularly beneficial for detecting irregular defects in solar panels, where the boundary between defect and background is often blurred.

3.2 Cycle Wavelet Convolution (CycleWT)

Complex grain textures in solar cells introduce high-frequency noise that masks fine cracks and small defects. To suppress this noise while retaining defect edges, I design the CycleWT module. It replaces conventional depthwise convolutions in the neck network with a multi-scale wavelet decomposition scheme. The core idea is to iteratively apply the discrete wavelet transform (DWT) to split the input feature map into four sub-bands: low-low (LL), low-high (LH), high-low (HL), and high-high (HH). Convolution is performed only on the LL sub-band to capture global shape information, while the high-frequency sub-bands are passed through with smaller kernels to preserve edge details. The inverse wavelet transform (IWT) reconstructs the output. The process for the i-th cycle is described as:

$$ \mathbf{X}_{LL}^{(i)}, \mathbf{X}_{H}^{(i)} = \text{DWT}(\mathbf{X}_{LL}^{(i-1)}) $$

$$ \mathbf{Y}_{LL}^{(i)}, \mathbf{Y}_{H}^{(i)} = \text{Conv}(\mathbf{W}, (\mathbf{X}_{LL}^{(i)}, \mathbf{X}_{H}^{(i)})) $$

$$ \mathbf{Z}^{(i)} = \text{IWT}(\mathbf{Y}_{LL}^{(i)}, \mathbf{Y}_{H}^{(i)}) + \mathbf{Z}^{(i-1)} $$

After three cycles of cascaded wavelet decomposition and reconstruction, the effective receptive field is enlarged without increasing kernel size. The frequency-domain processing naturally separates low-frequency background variations from high-frequency defect edges, making the defects more distinguishable. The final output of CycleWT is a spatial feature map with enhanced edge contrast and reduced texture noise.

Ablation experiments show that adding CycleWT to BiCCFM improves mAP50 by 0.3% and mAP50-95 by 0.1%, while also slightly increasing inference speed due to replacing the original RepC3 module. Table 2 reports the progressive improvement when CycleWT is included.

Table 2: Ablation study results showing the contribution of each module (RT-DETR baseline).
BiCCFM DTAM CycleWT CARAFE Inner-IoU mAP50 (%) mAP50-95 (%)
87.2 61.0
91.1 64.7
91.9 65.6
92.2 65.7
92.8 65.5
93.2 67.4

The ablation shows that each component yields noticeable gains. The full DBCI-DETR achieves a 6% improvement in mAP50 and 6.4% in mAP50-95 over the RT-DETR baseline. The CycleWT module not only improves accuracy but also maintains computational efficiency, making it suitable for real-time inspection of solar panels.

3.3 Bidirectional Cross-Scale Pyramid Fusion (BiCCFM)

RT-DETR uses Cross-scale Feature-fusion Module (CCFM) that fuses only deep features, losing high-resolution shallow information crucial for small defects. To address this, I design BiCCFM based on the BiFPN structure. It explicitly introduces a 160×160 high-resolution feature map from the early backbone stage and connects it through bidirectional weighted paths. The weighted fusion for a node $P$ at level $i$ is:

$$ P_i = \text{Conv}\left( \frac{w_1 \cdot P_i^{\text{input}} + w_2 \cdot P_{i+1}^{\text{up}} + w_3 \cdot P_{i-1}^{\text{down}}}{w_1 + w_2 + w_3 + \epsilon} \right) $$

where $w_i$ are learnable weights, $\epsilon$ is a small constant for numerical stability. This formulation allows the network to adaptively balance contributions from different scales. By fusing shallow edge details with deep semantic information, BiCCFM significantly improves detection of tiny defects such as short circuits and thin cracks in solar panels.

As shown in Table 2, adding BiCCFM alone boosts mAP50 from 87.2% to 91.1%, demonstrating the importance of shallow feature reuse for defect detection in solar panels.

3.4 CARAFE Upsampling

Bilinear interpolation used in RT-DETR is content-agnostic and lacks the ability to adapt to varying defect scales. I replace it with CARAFE (Content-Aware ReAssembly of FEatures). CARAFE first predicts a content-aware upsampling kernel for each target location using a small convolutional predictor, then performs feature reassembly via kernel-weighted pooling. The upsampling kernel $\omega_{\mathbf{l}’}$ for location $\mathbf{l}’$ is:

$$ \omega_{\mathbf{l}’} = \psi\left( N(\chi_\mathbf{l}, k_{\text{encoder}}) \right) $$

where $\psi$ is the kernel predictor and $N(\chi_\mathbf{l}, k_{\text{encoder}})$ is the neighborhood. The reassembly step uses a local sub-region $N(\chi_{\mathbf{l}’}, k_{\text{up}})$ and applies the kernel via dot product to produce the output feature $\chi_{\mathbf{l}’}$:

$$ \chi_{\mathbf{l}’} = \varphi\left( N(\chi_{\mathbf{l}}, k_{\text{up}}), \omega_{\mathbf{l}’} \right) $$

This content-aware mechanism allows the upsampling operation to preserve fine-grained details, such as the narrow gap of a crack, which is critical for accurately localizing defects in solar panels. In Table 2, adding CARAFE after the other modules raises mAP50 to 92.8%.

3.5 Inner-IoU Loss

The original GIoU loss in RT-DETR converges slowly when bounding boxes have little or no overlap. I adopt Inner-IoU, which introduces an auxiliary bounding box scaled by a factor $ratio$. For a ground truth box $(x_c^{gt}, y_c^{gt}, w^{gt}, h^{gt})$ and an anchor box $(x_c, y_c, w, h)$, the inner IoU is computed on shrunk (or expanded) boxes:

$$ \begin{aligned}
b_l^{gt} &= x_c^{gt} – \frac{w^{gt} \cdot ratio}{2}, \quad b_r^{gt} = x_c^{gt} + \frac{w^{gt} \cdot ratio}{2} \\
b_t^{gt} &= y_c^{gt} – \frac{h^{gt} \cdot ratio}{2}, \quad b_b^{gt} = y_c^{gt} + \frac{h^{gt} \cdot ratio}{2} \\
b_l &= x_c – \frac{w \cdot ratio}{2}, \quad b_r = x_c + \frac{w \cdot ratio}{2} \\
b_t &= y_c – \frac{h \cdot ratio}{2}, \quad b_b = y_c + \frac{h \cdot ratio}{2} \\
\text{inter} &= (\min(b_r, b_r^{gt}) – \max(b_l, b_l^{gt})) \times (\min(b_b, b_b^{gt}) – \max(b_t, b_t^{gt})) \\
\text{union} &= (w^{gt} \cdot h^{gt}) + (w \cdot h) \cdot ratio^2 – \text{inter} \\
\text{IoU}_{\text{inner}} &= \frac{\text{inter}}{\text{union}}
\end{aligned} $$

Using a smaller ratio ($ratio=0.7$ in my experiments) for high-IoU samples accelerates convergence, while a larger ratio ($ratio=1.3$) prevents gradient vanishing for low-IoU samples. This adaptive mechanism improves both training stability and final accuracy. As shown in Table 2, replacing GIoU with Inner-IoU increases mAP50-95 by 1.9%, from 65.5% to 67.4%, indicating better localization quality.

4. Experiments

4.1 Dataset and Setup

I evaluate DBCI-DETR on two public datasets: PVEL-AD (4500 images, 8 defect types) and PV-Multi-Defect (4500 images, 5 defect types). The training/validation split is 80:20. All experiments are conducted on an Ubuntu 20.04 system with PyTorch 1.13.1, CUDA 12.2, and a batch size of 16. Input images are resized to 640×640. I use SGD optimizer with an initial learning rate of 0.001 for 300 epochs. Evaluation metrics include Precision (P), Recall (R), mAP50, mAP50-95, GFLOPs, and FPS.

4.2 Comparison with State-of-the-Art Methods

I compare DBCI-DETR with several mainstream detectors, including Faster R-CNN, YOLOv8s, YOLOv10s, YOLOv11s, YOLOv12s, and recent improved methods for solar panels. The results on PVEL-AD are summarized in Table 3.

Table 3: Performance comparison on PVEL-AD dataset.
Method mAP50 (%) mAP50-95 (%) GFLOPs FPS
Faster R-CNN 68.6 40.2 343.7 12.9
YOLOv8s 79.3 53.8 28.6 77.3
YOLOv10s 78.1 53.6 21.6 71.6
YOLOv11s 79.2 54.2 21.3 78.5
YOLOv12s 78.9 54.0 21.2 78.2
Improved YOLOv5 [Ref] 86.2
Another Improved YOLOv5 [Ref] 84.3 14.8
RT-DETR (baseline) 87.2 61.0 57.0 59.0
GF-RTDETR [Ref] 82.5 51.7 48.7
DBCI-DETR (Ours) 93.2 67.4 68.5 56.8

DBCI-DETR achieves the highest mAP50 (93.2%) and mAP50-95 (67.4%), outperforming the RT-DETR baseline by 6% and 6.4%, respectively. Compared to YOLO-series detectors, the improvement is over 14% in mAP50. Although the GFLOPs increase to 68.5 and FPS drops to 56.8, this still meets real-time requirements for solar panel inspection (typically ≥30 FPS). The results confirm that DBCI-DETR significantly advances the state of the art for defect detection in solar panels.

4.3 Ablation Study

I conduct comprehensive ablation experiments to validate each component. Table 2 already showed the incremental gains. Starting from RT-DETR (mAP50=87.2%), adding BiCCFM yields +3.9%. Then DTAM adds +0.8%, CycleWT adds +0.3%, CARAFE adds +0.6%, and Inner-IoU adds +0.4% (but improves mAP50-95 by +1.9%). The final model achieves 93.2%/67.4%. All improvements are statistically significant, demonstrating the effectiveness of each design choice in addressing the unique challenges of solar panel defect detection.

4.4 Generalization Test

To verify that DBCI-DETR is not overfitted to PVEL-AD, I test it on the PV-Multi-Defect dataset. The results are shown in Table 4.

Table 4: Generalization performance on PV-Multi-Defect dataset.
Method P (%) R (%) mAP50 (%) mAP50-95 (%)
RT-DETR 81.5 68.9 74.3 51.0
DBCI-DETR 82.1 76.8 78.1 52.4

DBCI-DETR improves mAP50 by 3.8% and recall by 7.9%, confirming its strong generalization ability across different solar panel datasets.

4.5 Qualitative Analysis

Visual comparisons on real EL images demonstrate that DBCI-DETR produces more accurate bounding boxes with higher confidence scores, especially for tiny and irregular defects. In contrast, baseline RT-DETR often misses small cracks or misclassifies textures as defects. Under challenging conditions such as uneven illumination, noise, occlusion, and low contrast, my algorithm maintains robust detection, whereas the baseline exhibits frequent false positives and false negatives. The confusion matrix analysis shows that DBCI-DETR significantly reduces the misclassification of star-shaped cracks and vertical dislocations, which are rare but critical defect types in solar panels.

5. Conclusion

I propose DBCI-DETR, a real-time end-to-end transformer-based detector tailored for defect detection in solar panels. By integrating DTAM, CycleWT, BiCCFM, CARAFE, and Inner-IoU, the algorithm effectively addresses the problems of irregular defect shapes, complex background textures, and small-scale defects. Extensive experiments on two public datasets demonstrate that DBCI-DETR achieves superior accuracy and strong generalization, outperforming existing methods by a large margin. The framework is well-suited for industrial deployment where high precision and real-time response are required. Future work will focus on further reducing model complexity while maintaining accuracy, enabling deployment on edge devices for field inspection of solar panels.

Scroll to Top