Defect Detection for Solar Panels

Solar panels are a cornerstone of renewable energy systems, yet their long-term reliability is compromised by various defects arising from manufacturing, transportation, and operational stress. Automated inspection of solar panels using imaging techniques is essential for maintaining efficiency and safety. In this article, I present a first-person account of my research on defect detection algorithms for solar panels, focusing on infrared (IR) thermal imagery and electroluminescence (EL) imagery. The work covers dataset construction, small-target analysis, network architecture improvements, and edge-device deployment. Throughout the study, the primary objects of interest are solar panels and their defect patterns, which are often extremely small in the captured images.

The growing deployment of photovoltaic plants demands scalable inspection methods. Traditional manual inspection is impractical for large installations. Deep learning-based object detection has emerged as a powerful tool, but domain-specific challenges remain, particularly the detection of small and tiny defects on solar panels. In this context, I aimed to answer the following questions: How can we construct a reliable benchmark dataset for hot-spot defect detection in IR images? How should we define small targets for convolutional networks? Can architectural changes to YOLOv8 improve small-target detection without extra modules? How can we adapt a lightweight YOLOv8 model for EL defect detection and deploy it on an embedded platform like NVIDIA Jetson Nano?

1. Infrared Image Defect Detection for Solar Panels

Infrared thermography is widely used to detect hot spots on solar panels. However, existing datasets are either not publicly available or not designed for component-level detection. To fill this gap, I constructed a large-scale dataset named PV-HSD-2025. This dataset contains 4,025 IR images of solar panels, with a total of 25,181 annotated hot-spot bounding boxes. The images were captured by a drone-mounted thermal camera (DJI Mavic 3T) and include native 16-bit radiometric data. The original R-JPEG format preserves physical radiation information, allowing flexible color mapping through different palettes. The annotations were performed by three professional labelers under the supervision of an expert. Strict annotation rules were defined to handle adjacent hot spots, connected regions, and ambiguous bright spots. The final dataset is publicly available for research purposes.

A critical issue in solar panel defect detection is the definition of small targets. Many studies loosely refer to small objects, but a quantitative and consistent definition is lacking. I argue that for convolutional neural networks, object scale should be defined in absolute pixel terms, because the theoretical receptive field of a CNN is independent of the input image size. To validate this, I conducted an experiment using a fixed-size cat image (640×640) and its zero-padded versions (1920×1920, 6400×6400). When passed through a YOLOv8n model trained on COCO, the effective feature points always appeared on the P5 detection head at approximately the same relative coordinates and confidence, regardless of the input size. This demonstrates that the network perceives objects based on their absolute pixel dimensions, not their relative size to the image. Therefore, I adopted an absolute-scale definition for the PV-HSD-2025 dataset.

Based on the distribution of the square root of the bounding-box area, I categorized the defects into three classes:

Object Type Square Root of Area Scale Range
Ultra-small (Tiny) (0, 10] pixels
Small (10, 20] pixels
Medium (20, ∞) pixels

The histogram of the dataset shows that about 92% of all annotations have a square root area of less than 20 pixels. This implies that small-object detection is the dominant challenge for solar panel hot-spot recognition.

1.1 Baseline Model Selection

To establish a robust baseline, I evaluated several modern object detectors, including YOLOv5, YOLOv6, YOLOv8, YOLOv9, YOLOv10, YOLO11, RTDETR-l, and EfficientDet. All models were trained from scratch for 300 epochs without pretrained weights on the PV-HSD-2025 dataset, using the iron-red palette for visualization. Every model was trained three times, and the mean metrics were recorded. The following table summarizes the performance of the most competitive models.

Model P R mAP@50 mAP@50-95 mAP@50tiny GFLOPs Params (M)
YOLOv5n 0.676 0.601 0.627 0.256 0.521 5.9 2.2
YOLOv8n 0.665 0.613 0.638 0.265 0.529 6.9 2.7
YOLOv8s 0.703 0.646 0.676 0.294 0.572 23.6 9.8
YOLOv8m 0.704 0.647 0.676 0.297 0.570 67.8 23.2
YOLOv9t 0.670 0.606 0.624 0.259 0.515 6.7 1.8
YOLOv11n 0.668 0.606 0.635 0.263 0.509 6.4 2.6
RTDETR-l 0.576 0.553 0.528 0.191 0.479 108.0 32.8

The results show that YOLOv8 achieves the best trade-off between accuracy and computational cost among the YOLO family for this task. Notably, even the YOLOv8n model, with only 2.7M parameters, performs competitively. However, the recall and mAP@50 are still limited, especially for tiny defects. Therefore, I selected YOLOv8 as the base architecture for further improvements.

1.2 Proposed YOLOv8-P1

Given the dominance of small and tiny targets in solar panel IR images, the key limitation of standard YOLOv8 is the loss of spatial information caused by multiple downsampling operations. The smallest detection head P3 operates on a feature map that is 8× smaller than the input. For an ultra-small target with a size of, say, 8×8 pixels, the corresponding feature response is only about 1 pixel on the P3 feature map, which is easily overwhelmed by background noise. To mitigate this, I propose a modified architecture named YOLOv8-P1, which adds two additional detection heads at lower downsampling rates: P1 (stride 2) and P2 (stride 4). This design preserves high-resolution spatial details and provides the detector with richer local information for small objects.

The modified network is illustrated conceptually as follows: the original backbone outputs features at different scales; in YOLOv8-P1, the P1 and P2 detection heads are attached to feature maps that have only been downsampled by factors of 2 and 4, respectively. These heads use the same classification and regression branches as the original heads, but they operate on higher-resolution feature maps, thereby reducing the minimum detectable object size. No new attention modules or complex components are introduced; the improvement is purely structural.

I trained YOLOv8-P1 for all standard model sizes (n/s/m/l) with the same training protocol as the baseline. The results are shown below.

Model P R mAP@50 mAP@50-95 mAP@50tiny GFLOPs Params (M)
YOLOv8n-P1 0.715 0.706 0.738 0.314 0.694 23.3 2.9
YOLOv8s-P1 0.729 0.719 0.746 0.325 0.704 50.7 10.2
YOLOv8m-P1 0.718 0.720 0.747 0.327 0.700 123.0 24.2
YOLOv8l-P1 0.734 0.700 0.746 0.329 0.704 252.5 41.6

Compared with the baseline YOLOv8 models (Table above), YOLOv8-P1 brings substantial improvements. For the n-sized model, mAP@50 increases from 0.638 to 0.738 (a 10.0% relative improvement), and the tiny-object mAP@50 rises from 0.529 to 0.694 (a 16.5% relative improvement). Even the large model benefits, with mAP@50 improving from 0.677 to 0.746. These gains come from the increased spatial resolution of the detection heads, which directly counteracts the small-target information loss caused by downsampling. It is worth noting that a standard YOLOv8s model, which has more parameters and FLOPs than YOLOv8n-P1, still performs worse (mAP@50=0.676 vs. 0.738). This confirms that the improvement is not simply due to increased capacity, but rather to the structural change of adding high-resolution detection heads.

To quantify the effect of each added head, I also evaluated YOLOv8-P2 (only adding the P2 head). The results show that YOLOv8-P2 brings a smaller improvement than YOLOv8-P1, underlining the importance of the P1 head with stride 2. For example, YOLOv8n-P2 achieves mAP@50=0.720, while YOLOv8n-P1 achieves 0.738.

1.3 Comparison with Slicing-Aided Hyper Inference (SAHI)

Another common technique for small-object detection is Slicing-Aided Hyper Inference (SAHI), which slices the input image into overlapping patches, upsamples each patch, and runs inference on the patches individually before merging the results. To fairly compare this engineering approach with the architectural modification, I applied both standard training and slicing-aided fine-tuning for YOLOv8n and YOLOv8m. The inference configurations included full-image inference (FI), SAHI-only, and SAHI+FI. The results are summarized in the following table.

Model Training Inference mAP@50 all mAP@50 tiny
YOLOv8n standard FI 0.618 0.531
YOLOv8n standard SAHI 0.182 0.180
YOLOv8n standard SAHI+FI 0.487 0.329
YOLOv8n SF SAHI 0.693 0.665
YOLOv8n SF SAHI+FI 0.693 0.664
YOLOv8m standard FI 0.646 0.570
YOLOv8m standard SAHI 0.249 0.236
YOLOv8m standard SAHI+FI 0.536 0.376
YOLOv8m SF SAHI 0.647 0.605
YOLOv8m SF SAHI+FI 0.671 0.625

These experiments show that SAHI is only beneficial when the model is fine-tuned with sliced images (SF). For example, YOLOv8n with SF and SAHI+FI improves mAP@50 from 0.618 to 0.693, and tiny mAP@50 from 0.531 to 0.664. However, the improvement remains lower than that of YOLOv8n-P1 (0.738 mAP@50, 0.694 tiny mAP@50). Moreover, SAHI introduces a significant computational overhead: for a 640×640 input, slicing into 160×160 patches with 0.2 overlap yields 24 patches per image. Thus, the total FLOPs for one inference become roughly 25 times that of a single full-image inference. In contrast, YOLOv8n-P1 only increases the baseline FLOPs from 6.9 to 23.3 GFLOPs, which is far less than the SAHI overhead. Therefore, the structural modification of adding high-resolution detection heads is a more effective and efficient solution for small-target detection in solar panel IR imagery.

1.4 Impact of Colormap Representation

Infrared cameras often apply different colormaps to visualize thermal data. Common palettes include iron-red, arctic, white-hot, and rainbow. While these palettes aid human interpretation, their effect on deep learning models is not well studied. I conducted experiments using the YOLOv8n model trained on the PV-HSD-2025 dataset with different visualisations: the original iron-red palette, the arctic palette, the raw 16-bit radiometric image (RAW), and a temperature image (converted to Kelvin × 10). To preserve the physical meaning of the data, I disabled color-related augmentations when training on RAW and temperature images. The results are presented below.

Visualization P R mAP@50 mAP@50-95
Iron-red 0.665 0.613 0.638 0.265
Arctic 0.622 0.542 0.556 0.218
RAW (16-bit) 0.645 0.603 0.626 0.264
Temperature 0.660 0.608 0.632 0.268

The results show that using the arctic palette significantly degrades detection performance (mAP@50 drops from 0.638 to 0.556). The RAW and temperature representations perform slightly worse than the iron-red palette, but the difference is small. This indicates that the widely used iron-red palette is already suitable for CNN-based detection; trying to exploit the raw physical data does not automatically lead to better accuracy, and an arbitrary colormap can harm performance. Therefore, the choice of colormap should be carefully evaluated for a given defect detection task.

1.5 Effect of Pretrained Weights

Transfer learning is known to boost performance in many computer vision tasks. I investigated the influence of COCO-pretrained weights on solar panel defect detection. The YOLO models were initialized with their official pretrained weights, and for YOLOv8-P1, I used the corresponding YOLOv8 pretrained weights (with the added detection heads randomly initialized). The results show consistent improvements across all models.

Model P R mAP@50 mAP@50-95
YOLOv8n + PT 0.686 0.646 0.665 0.282
YOLOv8s + PT 0.706 0.663 0.688 0.304
YOLOv8m + PT 0.716 0.680 0.699 0.312

Compared to the results from scratch (Table earlier), pretrained weights improve mAP@50 by 1.2-3.6 percentage points. This suggests that transfer learning from a large-scale natural image dataset can provide a useful initialization even for the relatively specialized domain of infrared solar panel defect detection.

2. Electroluminescence Image Defect Detection for Solar Panels

Electroluminescence (EL) imaging is a powerful technique for detecting internal defects in solar panels, such as cracks, finger interruptions, and busbar issues. However, publicly available EL datasets have severe class imbalance and a limited number of annotated samples, making it difficult to train robust detectors. In this section, I present my approach to expanding the PVELAD dataset and improving the YOLOv8 model for EL defect detection.

2.1 Dataset Expansion and Handling Class Imbalance

I started with the PVELAD dataset, which contains 36,543 near-infrared images of solar panels, but only 4,500 images are annotated, covering 13 defect categories. My statistical analysis revealed that some categories had very few samples. For example, the ‘finger’ category had only 23 images, while ‘crack’ had 1,506, leading to a severe imbalance. To address this, I removed the five rarest categories and manually annotated additional images from the unlabeled pool to augment the remaining seven categories. The final dataset, named PVELAD-2021-Expanding, contains 5,016 images. The distribution is shown below.

Category Number of Images
finger 233
crack 1,209
black_core 1,563
thick_line 988
horizontal_dislocation 1,049
short_circuit 1,287
star_crack 1,888

The dataset was split into training, validation, and test sets with a ratio of 7:1:2. I applied data augmentation such as random rotation, Gaussian blur, and salt-and-pepper noise to the training set. The expanded dataset has been made publicly available for further research.

2.2 Improved YOLOv8 Architecture

For EL image defect detection, the goal is to maintain or improve detection accuracy while reducing computation and memory usage, enabling deployment on embedded devices. I selected YOLOv8n as the baseline and introduced three architectural modifications:

VoVGSCSP Module: The C2f modules in the Neck are partially replaced with VoVGSCSP modules, which combine Ghost convolution and cross-stage partial connections. This module reduces computational cost while preserving feature extraction capability. The computational complexity of GSConv can be expressed as:

$$T_{GSConv} \sim O\left(W \times H \times K_1 \times K_2 \times \frac{C_2}{2} (C_1 + 1)\right)$$

where \(W,H\) are the output feature map dimensions, \(K_1 \times K_2\) is the kernel size, and \(C_1, C_2\) are the input and output channels. Compared to standard convolution, this complexity is significantly lower.

WTConv Module: The downsampling convolutions in the Neck are replaced with wavelet transform convolutions. WTConv applies a Haar wavelet transform to decompose the input feature map into low-frequency and high-frequency sub-bands, then performs depthwise convolution on each sub-band, and finally reconstructs the output via inverse wavelet transform. The two-dimensional Haar transform is defined as:

$$X_{LL} = \frac{1}{2} \begin{bmatrix} 1 & 1 \\ 1 & 1 \end{bmatrix} * X, \quad X_{LH} = \frac{1}{2} \begin{bmatrix} 1 & -1 \\ 1 & -1 \end{bmatrix} * X$$

$$X_{HL} = \frac{1}{2} \begin{bmatrix} 1 & 1 \\ -1 & -1 \end{bmatrix} * X, \quad X_{HH} = \frac{1}{2} \begin{bmatrix} 1 & -1 \\ -1 & 1 \end{bmatrix} * X$$

The operation is analogous to \(Y = IWT(Conv(WT(X)))\), which enlarges the receptive field without a proportional increase in parameters. This improves the detection of elongated defects such as long cracks.

SCDown and C2fCIB Modules: In the Backbone, the traditional downsampling convolution is replaced with SCDown (spatial-channel decoupled downsampling), and the first C2f module is replaced with C2fCIB. SCDown first adjusts the channel count with a 1×1 pointwise convolution, then performs spatial downsampling with a 3×3 depthwise convolution, reducing computation while retaining more information.

2.3 Experimental Results and Ablation Study

All experiments were conducted with the same hyperparameters as before, training for 300 epochs without pretrained weights. The mAP@50 of the improved model reached 91.2%, an increase of 1.0% over YOLOv8n, while the parameter count decreased by 0.63M and FLOPs decreased by 1.33 GFLOPs. These results confirm that the combined modifications achieve both higher accuracy and lower computational complexity.

To isolate the contribution of each module, I performed an ablation study. The table below gives the mAP@50 for each configuration.

Neck VoVGSCSP Neck WTConv Backbone SCDown+C2fCIB GFLOPs Params (M) mAP@50
✗ ✗ ✗ 8.20 3.01 0.902
✓ ✗ ✗ 7.49 2.89 0.909
✗ ✓ ✗ 7.98 2.84 0.911
✗ ✗ ✓ 7.79 2.67 0.904
✓ ✓ ✗ 7.28 2.72 0.916
✓ ✓ ✓ 6.87 2.38 0.912

From the ablation, adding both VoVGSCSP and WTConv to the Neck gives the highest mAP@50 (0.916) while reducing FLOPs to 7.28 GFLOPs. Further simplifying the Backbone (SCDown+C2fCIB) reduces FLOPs to 6.87 and parameters to 2.38M, with a slight accuracy drop to 0.912. This final model is both more accurate and lighter than the original YOLOv8n, making it suitable for real-time embedded deployment.

Qualitatively, the improved model produces more coherent detections for long cracks, which the baseline often splits into multiple fragments. The confidence scores for several defect types (e.g., thick_line, star_crack) also improve. Thus, the proposed modifications are effective for the EL domain.

3. Deployment on NVIDIA Jetson Nano

For real-world inspection, the defect detection algorithm must run on edge devices installed on drones or portable platforms. I selected the NVIDIA Jetson Nano as the target hardware because it offers a good balance between power consumption and GPU performance. The Jetson Nano features 128 CUDA cores and 4GB shared memory, with a maximum power draw of 10W. To optimize the trained YOLOv8-P1 models, I used TensorRT, NVIDIA’s deep learning inference SDK. TensorRT applies layer fusion, precision calibration (FP16 and INT8), and automatic kernel tuning to speed up inference.

The deployment pipeline is as follows:

1. Train the YOLOv8-P1 model in PyTorch and export it to ONNX.
2. Convert the ONNX model to a TensorRT engine with desired precision (FP32, FP16, or INT8).
3. Load the engine on Jetson Nano and run inference on captured IR images.

I benchmarked YOLOv8n-P1 and YOLOv8s-P1 under different optimization levels. The table below presents the average inference speed (FPS) and the resulting mAP@50 on the PV-HSD-2025 validation set.

Model Optimization Weight File (MB) FPS mAP@50
YOLOv8n-P1 PyTorch 6.4 5.4 0.738
YOLOv8n-P1 ONNX 13.5 5.8 0.738
YOLOv8n-P1 TensorRT FP32 20.5 6.2 0.738
YOLOv8n-P1 TensorRT FP16 9.9 11.2 0.736
YOLOv8n-P1 TensorRT INT8 9.8 16.0 0.729
YOLOv8s-P1 TensorRT FP16 25.4 3.2 0.744
YOLOv8s-P1 TensorRT INT8 17.6 6.4 0.741

The results demonstrate that TensorRT FP16 significantly boosts the frame rate (from 5.4 to 11.2 FPS for YOLOv8n-P1) with nearly no loss in mAP@50. INT8 quantization further increases speed to 16.0 FPS, but the mAP@50 drops by about 1%. For the s-size model, INT8 gives 6.4 FPS, still under real-time, but the accuracy remains high. This benchmark helps practitioners choose the right optimization level depending on their speed and accuracy requirements.

The deployment on Jetson Nano confirms that the proposed detection algorithms for solar panels can operate on low-power embedded hardware, enabling autonomous aerial inspections. A PyQt-based visualization application was developed to display the detection results in real time.

4. Conclusion and Future Directions

In this research, I systematically addressed several challenges in solar panel defect detection. For infrared hot-spot detection, I constructed and released the PV-HSD-2025 dataset, which provides 4,025 annotated IR images with 16-bit radiometric data. I demonstrated that an absolute pixel-scale definition of small objects aligns with CNN behavior, and I used this definition to categorize defects into tiny, small, and medium sizes. The proposed YOLOv8-P1 architecture, which adds high-resolution detection heads, considerably improves small-target detection performance without introducing extra modules. I also compared this structural modification against the SAHI slicing method and showed that YOLOv8-P1 is both more accurate and more computationally efficient. Additionally, I found that colormap selection has a non-negligible impact on detection accuracy, and that pretrained weights provide consistent gains.

For EL image defect detection, I expanded the PVELAD dataset to mitigate class imbalance and introduced a lightweight improved YOLOv8 model integrating VoVGSCSP, WTConv, SCDown, and C2fCIB modules. The final model achieves 91.2% mAP@50 while reducing parameters and FLOPs, making it suitable for real-time applications. Finally, I deployed the infrared detection model on Jetson Nano and evaluated several TensorRT optimizations, demonstrating practical feasibility for edge-based inspection of solar panels.

Future work may include annotating additional defect types (e.g., diode failures) and exploring automatic dataset quality assessment algorithms. Moreover, the lightweight EL detector could be combined with the infrared detector in a multi-modal system for comprehensive solar panel health monitoring. The ultimate goal is to create a fully automated, real-time inspection system that can be deployed on drones or mobile robots for large-scale solar farms.

Scroll to Top