We propose a lightweight visual detection algorithm named PV-RT-DETR, which is specifically designed for the defect detection of solar panels in complex industrial environments. The algorithm addresses three key challenges: difficulty in detecting small targets, insufficient feature extraction capability, and high model complexity. Our approach first adopts MobileNetV4 as the backbone network, which is optimized for mobile accelerators. It leverages universal inverted bottleneck blocks and a multi-query attention mechanism to significantly reduce the number of parameters and computational cost while maintaining strong multi-scale feature extraction ability. Second, we replace the multi-head self-attention in the multi-scale feature interaction module with single-head self-attention. This modification enhances the model’s ability to capture global contextual information, thereby improving the perception accuracy of small-sized defects on solar panels against complex backgrounds. Third, within the cross-scale feature fusion module, we systematically optimize the upsampling and downsampling operators. Through experimental comparison, we determine an efficient combination strategy that effectively balances detail preservation and computational overhead. Experimental results demonstrate that our algorithm achieves a mAP50 of 96.3% and an F1‑score of 95.4%, compared to 93.6% and 92.0% of the baseline model, representing relative improvements of 2.7% and 3.4%, respectively. Meanwhile, the parameter count of PV-RT-DETR is only 53.8% of the original model. This study provides a high‑precision and cost‑effective solution for defect detection of solar panels in complex industrial scenarios, validating its potential for practical applications.
In the context of the global energy system transitioning toward low carbon and the promotion of the “dual carbon” goals, the solar panel industry continues to expand rapidly. According to the International Energy Agency, global new photovoltaic installed capacity is expected to exceed 500 GW by 2025, with China contributing nearly half of the total. However, solar panels are susceptible to various defects during manufacturing, installation, and operation, such as scratches, broken grid lines, and stains. These defects not only reduce power generation performance and component lifespan but also pose safety risks. Currently, common defect detection methods for solar panels mainly rely on manual visual inspection or basic image processing, which suffer from low efficiency, missed detections, and false positives. Therefore, efficient and accurate detection of surface defects on solar panels is essential.
In deep learning, object detection algorithms can be divided into single‑stage and two‑stage methods. Two‑stage methods first generate candidate regions that may contain objects and then classify and refine the positions of these regions. Typical models include Fast R‑CNN, Faster R‑CNN, and Mask R‑CNN. Single‑stage methods directly accomplish object classification and localization prediction without the candidate region generation step, as represented by SSD and the YOLO series. In recent years, some research has introduced deep learning models of different architectures into the defect recognition task for solar panels, effectively improving detection accuracy and efficiency. For example, one study combined the Faster R‑CNN framework with a ResNet50 backbone and introduced a feature pyramid network and a guided anchor region proposal network to improve the identification of defects on solar cell surfaces. Another study proposed a detection algorithm integrating global and local feature enhancement to strengthen the model’s perception of key regions and detail feature modeling, significantly improving defect classification accuracy, but it did not address the detection of small‑target defects. Another work proposed a cross‑scale enhanced feature pyramid fusion network that uses multiple feature extraction branches to improve cross‑scale detection accuracy, thereby reducing missed and false detection rates in defect detection of solar panels; however, its detection performance still has room for improvement, and it relies on high‑performance hardware, increasing operational costs. A recent method replaced the original backbone with HGNetV2 and introduced RepConv to improve accuracy while significantly reducing parameters and computational complexity. However, the model’s performance in complex industrial environments was not analyzed, leading to insufficient robustness in complex scenarios.
After a comprehensive analysis of existing research, although significant progress has been made in defect detection methods for solar panels based on deep learning, three common challenges remain: (1) models generally have large parameter sizes and high computational complexity, making deployment difficult in resource‑constrained industrial settings; (2) insufficient perception of small‑size, low‑contrast defect features leads to high missed‑detection rates of subtle defects; (3) robustness and generalization ability under interference such as complex lighting and occlusion are still lacking. In response to these challenges, we propose an improved algorithm called PV‑RT‑DETR for defect detection on solar panels. The algorithm uses the new lightweight MobileNetV4 as the backbone to significantly reduce model complexity and memory usage. It replaces the multi‑head self‑attention in the hybrid encoder with single‑head self‑attention to efficiently inject global context and avoid computational redundancy. Additionally, the feature fusion module introduces CARAFE upsampling and WTConv downsampling operators to enhance detail perception and feature extraction efficiency.
The baseline model we choose is RT‑DETR‑R18. The proposed PV‑RT‑DETR algorithm includes three main improvements. First, we replace the original ResNet18 backbone with the more lightweight MobileNetV4 backbone. This substitution drastically reduces the model parameter count while improving the efficiency and accuracy of feature extraction for solar panel defects in complex scenarios. Second, to address the problem of complex feature distributions and blurred detection of small‑target defects in solar panel datasets, we integrate single‑head self‑attention into the original AIFI framework. Third, we adopt a lightweight WTConv downsampling operator and the better‑performing CARAFE upsampling operator to adjust the sampling operators of the algorithm, effectively improving the model’s representation ability and detection accuracy.
The overall network structure of the improved RT‑DETR is shown schematically below. The backbone network MobileNetV4 consists of an input layer, stacked universal inverted bottleneck (UIB) blocks, and a global aggregation and classification output layer. The input image first passes through a standard convolutional layer with a 3×3 kernel, which performs initial feature extraction and spatial downsampling by setting a stride greater than 1. After the input layer, the main body of the network consists of multiple UIB blocks stacked sequentially. After processing through a series of UIB blocks, the resulting feature map is spatially compressed by global average pooling to aggregate into a single vector representing global features. This vector is then transformed by a fully connected layer to map to the target category space and finally outputs classification results or predictions for other tasks.
Traditional inverted residual blocks use a three‑stage design of expansion, depthwise separable convolution, and projection: first pointwise convolution to expand the channel dimension, then depthwise convolution for spatial feature extraction, and finally pointwise convolution to compress channels. The UIB module extends this by introducing two optional depthwise convolutional layers, one before the expansion layer and one between the expansion and projection layers. The UIB module integrates core ideas from several efficient architectures, including the classic inverted residual structure, the layer design of ConvNeXt, and the feed‑forward network of vision transformers. It supports four different instantiation configurations, allowing trade‑offs between spatial and channel mixing, receptive field adjustment, and computational efficiency, thereby enhancing feature perception ability while significantly improving hardware computational utilization.
To further enhance inference efficiency on mobile accelerators, MobileNetV4 integrates a specially optimized multi‑query attention mechanism. This mechanism allows multiple query heads to share the same key and value projections, greatly reducing memory access and memory consumption during inference. This design effectively optimizes operation intensity, especially for mobile hybrid architectures with small batch sizes or high feature dimensions. In addition, the design of MobileNetV4 employs neural architecture search technology to automatically optimize the parameters and structure of each module, ensuring that the entire network maintains high accuracy and good generalization while being lightweight and computationally efficient.
In summary, MobileNetV4 systematically integrates convolution operations, inverted bottleneck structures, attention mechanisms, and automated neural architecture search strategies to construct a new network architecture that can efficiently capture local detail features and effectively fuse global contextual information. In this study, we select the smallest version of MobileNetV4, MobileNetV4ConvSmall, as the backbone to replace the original ResNet18 in RT‑DETR‑R18. This choice significantly reduces model complexity and memory usage while maintaining a high feature representation ability to meet the dual requirements of low latency and high accuracy in real‑time vision applications.
The AIFI module is an attention‑based internal multi‑scale feature interaction module responsible for fusing deep and shallow features extracted by the MobileNetV4 network. The baseline AIFI module uses multi‑head self‑attention to strengthen connections between deep features and obtain richer global features. This makes AIFI focus mainly on deep features while ignoring important details from shallow features, which creates a bottleneck for small‑target detection. Single‑head self‑attention is a mechanism designed to reduce computational complexity and memory usage while maintaining model expressiveness. By optimizing the traditional multi‑head self‑attention design, it focuses on channel and computational redundancy. With fewer parameters and computations, it can still effectively capture global contextual information. SHSA combines the global context captured by the attention mechanism with local details from retained channels through parallel processing, helping the model understand the relationship between small‑target defects and the overall scene, which is particularly important for small‑target detection. Therefore, we replace the multi‑head self‑attention in the AIFI module with single‑head self‑attention.
The attention layer of SHSA can be described by the following formulas:
$$ X_{\text{att}}, X_{\text{res}} = \text{Split}(X, C_p, C – C_p) $$
$$ \tilde{X}_{\text{att}} = \text{Attention}(X_{\text{att}}W_Q,\; X_{\text{att}}W_K,\; X_{\text{att}}W_V) $$
$$ \text{Attention}(Q,K,V) = \text{Softmax}\left(\frac{QK^T}{\sqrt{d_{qk}}}\right)V $$
$$ \text{SHSA}(X) = \text{Concat}\left(\tilde{X}_{\text{att}}, X_{\text{res}}\right) W_O $$
where \(W_Q, W_K, W_V\) and \(W_O\) are projection weights, \(X_{\text{att}}\) is the attention feature, \(X_{\text{res}}\) is the residual feature, \(d_{qk}\) is the dimension of queries and keys, \(Concat\) is concatenation, and \(Split\) is split operation.
In multi‑scale object detection algorithms, feature maps at different levels of the feature pyramid often carry semantic information and spatial details at different abstraction levels. Efficient multi‑scale feature fusion is a key issue in model design. Upsampling and downsampling operations play crucial roles: upsampling enlarges feature map scales (e.g., nearest‑neighbor interpolation and transposed convolution), while downsampling compresses feature map sizes (e.g., adjusting convolution strides). In the cross‑scale feature fusion module of RT‑DETR‑R18, two upsampling and two downsampling operations are used to align the scales of high‑level feature F5, mid‑level feature S4, and low‑level feature S3 for subsequent fusion. The baseline model uses nearest‑neighbor interpolation for upsampling. Although this helps retain original feature information to some extent, it can introduce noise and cause loss of detail features when processing low‑resolution images, making it difficult to effectively restore object edges and textures. The downsampling relies on standard convolution, which, although widely used, still has redundant parameters for lightweight models. To address these issues, we replace the upsampling operator with CARAFE and the downsampling operator with WTConv. Based on the RT‑DETR‑R18 algorithm structure, we design three replacement methods: Method A replaces all two upsampling and two downsampling operators in CCFM; Method B adjusts the upsampling replacement by applying CARAFE only to the upsampling layer that increases the scale of S4; Method C further adjusts the downsampling replacement by applying WTConv only to the downsampling layer that reduces the scale of S3.
CARAFE consists of two core parts: a kernel prediction module and a content‑aware reassembly module. The kernel prediction module does not use a fixed kernel but analyzes the semantic information of each position and its neighborhood in the input feature map to dynamically predict an upsampling kernel for each target position. The reassembly module uses the predicted upsampling kernel to perform a weighted reassembly of the input features, generating the upsampled output feature map. CARAFE is content‑aware, can dynamically predict upsampling kernels, significantly expands the receptive field, and better preserves and reconstructs detail features. The kernel prediction module consists of a channel compressor (a 1×1 convolution to compress channels from C to \(C_m\)), a content encoder (a convolutional layer with kernel size \(k_{\text{encoder}} \times k_{\text{encoder}}\) to encode the input features and generate a set of dynamic reassembly kernels, with output dimensions \(\sigma H \times \sigma W \times k_{\text{up}}^2\), where \(\sigma\) is the upsampling ratio and \(k_{\text{up}}\) is the spatial size of the reassembly kernel), and a kernel normalizer (Softmax function to normalize the predicted upsampling kernels to a non‑negative value sequence with sum 1, ensuring numerical stability and preserving original feature statistics). The feature reassembly module performs a weighted sum of the local neighborhood features in the input feature map for each position \(l = (i,j)\) using the upsampling kernel as weights. Specifically, for each target output position, the corresponding source position \(l\) on the input feature map is determined, and a local region \(\mathcal{N}(X_{\text{up}}, k_{\text{up}})\) centered at that point with size \(k_{\text{up}} \times k_{\text{up}}\) is extracted. The feature values in this region are dot‑producted with the corresponding predicted upsampling kernel to synthesize the response of the output feature map at that position. The output calculation formula is:
$$ X’_{l’} = \sum_{n=-r}^{r} \sum_{m=-r}^{r} W_{l’}(n,m) \cdot X(i+n,\; j+m) $$
where \(r = k_{\text{up}}/2\) determines the boundary of the local neighborhood, and \(W_{l’}\) is the reassembly kernel corresponding to position \(l’\).
WTConv is a novel convolutional neural network layer based on wavelet transform. Compared to traditional methods that increase the convolutional kernel size to expand the receptive field, this module requires very few parameters to achieve the same scale of receptive field while effectively breaking the inherent upper limit of the global receptive field. This property significantly improves the network’s fitting ability and anti‑interference performance while greatly reducing model parameters and structural complexity. The operation process is as follows: first, the input features are filtered and downsampled by wavelet transform to effectively separate low‑frequency and high‑frequency information; then, small‑kernel depthwise convolution is performed on the separated frequency feature maps; finally, the target features are reconstructed and output by inverse wavelet transform. For each input channel, the convolution output is:
$$ (X_{\text{LL}}, X_{\text{LH}}, X_{\text{HL}}, X_{\text{HH}}) = \text{Conv}(f_{\text{LL}}, f_{\text{LH}}, f_{\text{HL}}, f_{\text{HH}},\; X) $$
where \(f_{\text{LL}}\) is a low‑pass filter, and \(f_{\text{LH}}, f_{\text{HL}}, f_{\text{HH}}\) are high‑pass filters defined as:
$$ f_{\text{LL}} = \frac{1}{2}\begin{pmatrix}1 & 1 \\ 1 & 1\end{pmatrix},\; f_{\text{LH}} = \frac{1}{2}\begin{pmatrix}1 & -1 \\ 1 & -1\end{pmatrix},\; f_{\text{HL}} = \frac{1}{2}\begin{pmatrix}1 & 1 \\ -1 & -1\end{pmatrix},\; f_{\text{HH}} = \frac{1}{2}\begin{pmatrix}1 & -1 \\ -1 & 1\end{pmatrix} $$
The system has four channels, each with half the resolution of X in each spatial dimension. \(X_{\text{LL}}\) is the low‑frequency component, while \(X_{\text{LH}}, X_{\text{HL}}, X_{\text{HH}}\) are the horizontal, vertical, and diagonal high‑frequency components, respectively. These four filters form an orthogonal basis. Through the inverse wavelet transform (transposed convolution), we obtain:
$$ X = \text{Conv-transposed}(f_{\text{LL}}, f_{\text{LH}}, f_{\text{HL}}, f_{\text{HH}},\; X_{\text{LL}}, X_{\text{LH}}, X_{\text{HL}}, X_{\text{HH}}) $$
By recursively decomposing the low‑frequency component, a cascaded wavelet decomposition is obtained, with each level decomposed as:
$$ (X_{\text{LL}}^{(i)}, X_{\text{LH}}^{(i)}, X_{\text{HL}}^{(i)}, X_{\text{HH}}^{(i)}) = \text{WT}(X_{\text{LL}}^{(i-1)}) $$
WTConv decomposes convolution operations into different frequency subbands via wavelet transforms, allowing small‑sized convolution kernels to operate on larger spatial extents of the original input in the corresponding frequency domains, achieving exponential expansion of the receptive field without significantly increasing parameters. By effectively separating high‑frequency and low‑frequency information, WTConv improves the computational efficiency of convolution operations on each frequency component, especially enhancing the response to low‑frequency components that represent the overall structure of objects. This property makes the model more robust when facing low‑frequency noise and out‑of‑distribution data disturbances (e.g., blurring, resolution degradation). Therefore, WTConv can effectively suppress texture interference and enhance shape feature perception in scenes with complex textures, multi‑scale objects, and image quality degradation, thereby improving the model’s generalization performance.
We conduct experiments on a dataset originating from the Baidu PaddlePaddle AI Studio platform, containing 600 solar panel defect samples. Through data augmentation methods such as horizontal flipping and random rotation, the dataset is expanded to 2400 images. LabelImg is used for annotation, and the labels include three typical defect types: crack, grid breakage, and stain. The dataset is randomly divided into training, validation, and test sets in a ratio of 7:2:1. Our experimental environment is Windows 10 with NVIDIA RTX 4060 Ti GPU, Intel i5‑12600KF CPU, Python 3.9.21, PyTorch 2.5.1, and CUDA 11.3. The experimental parameters are as follows:
| Parameter | Configuration |
|---|---|
| Image input size | 640×640 |
| Training epochs | 200 |
| Batch size | 4 |
| Number of workers | 4 |
| Optimizer | AdamW |
| Loss function | GIoU |
| Initial learning rate | 0.0001 |
| Final learning rate factor | 1 |
| Learning rate momentum | 0.9 |
| Weight decay coefficient | 0.0001 |
We use multiple metrics from the COCO evaluation standard for comprehensive analysis, including mean Average Precision (mAP), Precision (P), Recall (R), F1 score, FLOPs, Frames Per Second (FPS), and number of Parameters. The formulas are as follows:
$$ P = \frac{TP}{TP+FP},\quad R = \frac{TP}{TP+FN},\quad AP = \int_{0}^{1} P(R)\,dR,\quad mAP = \frac{\sum_{i=1}^{N} AP_i}{N},\quad F1 = 2\cdot\frac{P\cdot R}{P+R},\quad FPS = \frac{N}{\text{Total Time}} $$
where \(TP\) is true positive, \(FP\) false positive, \(FN\) false negative, and \(N\) is the total number of frames. We also use GradCAM++ for visualization to show which regions of the input image contribute most to the model’s predictions. The saliency map for class \(c\) on the last convolutional layer feature maps is generated by:
$$ L_c^{\text{GradCAM++}} = \text{ReLU}\left(\sum_{k} w_k^c A_k\right) $$
where \(A_k\) is the \(k\)-th feature map, and \(w_k^c\) is the weight for class \(c\) calculated as:
$$ w_k^c = \sum_i \sum_j \alpha_{ij}^{kc} \cdot \text{ReLU}\left(\frac{\partial Y^c}{\partial A_{ij}^k}\right) $$
where \(\alpha_{ij}^{kc}\) is a spatial weight coefficient precisely measuring the importance of activation at position \((i,j)\) of feature map \(k\) for class \(c\).
We perform ablation experiments to verify the contribution of each improved module. The results are shown in the following table:
| Method | AP Crack (%) | AP Grid (%) | AP Stain (%) | mAP50 (%) | Parameters (M) | GFLOPs |
|---|---|---|---|---|---|---|
| Baseline (RT-DETR-R18) | 92.2 | 94.4 | 94.3 | 93.6 | 19.9 | 56.9 |
| + Backbone (MobileNetV4) | 90.1 | 94.1 | 97.2 | 93.8 | 11.3 | 39.5 |
| + SHSA in AIFI | 91.1 | 95.1 | 96.6 | 94.3 | 19.7 | 57.0 |
| + Operator optimization | 94.4 | 95.7 | 96.2 | 95.4 | 19.4 | 55.5 |
| + Backbone + SHSA | 92.1 | 94.7 | 96.1 | 94.3 | 11.1 | 39.5 |
| + Backbone + Operators | 95.2 | 96.1 | 97.1 | 96.1 | 10.8 | 38.0 |
| + SHSA + Operators | 96.5 | 94.4 | 96.6 | 95.8 | 19.2 | 55.5 |
| Full Model (PV-RT-DETR) | 97.2 | 94.5 | 97.2 | 96.3 | 10.7 | 38.1 |
From the ablation table, several conclusions can be drawn. First, replacing ResNet18 with MobileNetV4 reduces parameters from 19.9 M to 11.3 M (43.2% reduction) and GFLOPs from 56.9 to 39.5 (30.6% reduction), while mAP50 slightly increases from 93.6% to 93.8%. Notably, the AP for the Stain defect increases to 97.2%, indicating that the lightweight backbone retains strong feature extraction capability while significantly reducing model complexity. Second, introducing single‑head self‑attention increases mAP50 to 94.3% (0.7% improvement over baseline) with almost no increase in parameters (19.7 M). This module enhances global context modeling ability without adding computational burden, effectively improving overall recognition accuracy for multiple defect types. Third, replacing nearest‑neighbor upsampling and standard convolution downsampling with CARAFE and WTConv significantly improves mAP50 to 95.4% (1.8% improvement over baseline) with parameters reduced to 19.4 M and GFLOPs to 55.5. This demonstrates that content‑aware upsampling and wavelet convolution downsampling play significant roles in enhancing detail reconstruction and receptive field expansion, balancing detection accuracy and computational efficiency. Any combination of two improvements further boosts performance. For example, the “Backbone + Operators” combination achieves mAP50 of 96.1% with parameters reduced to 10.8 M. Finally, when all three improvements are applied together (our full model), mAP50 reaches 96.3%, and parameters and GFLOPs are compressed to 10.7 M and 38.1, respectively. This validates the comprehensive advantages of our method in accuracy, lightweight design, and inference efficiency.
We also compare the effect of different backbone networks while keeping other improvements unchanged. The results are as follows:
| Backbone | P (%) | R (%) | F1 (%) | mAP50 (%) | Parameters (M) |
|---|---|---|---|---|---|
| ResNet18 | 94.4 | 93.4 | 93.9 | 95.8 | 19.2 |
| StarNet | 92.1 | 90.4 | 91.2 | 92.6 | 11.3 |
| EfficientViT | 91.8 | 93.0 | 92.3 | 93.5 | 10.1 |
| FasterNet | 92.9 | 94.3 | 93.6 | 94.6 | 10.2 |
| ConvNeXtV2 | 91.5 | 91.9 | 91.6 | 94.3 | 11.7 |
| MobileNetV4 | 95.6 | 95.2 | 95.4 | 96.3 | 10.7 |
The results show that MobileNetV4 achieves the best performance in P, R, F1, and mAP50 among all backbones, confirming its practical value. In terms of computational complexity, EfficientViT is the lightest with 10.1 M parameters, but MobileNetV4 offers a better trade‑off between accuracy and complexity.
We further verify the effectiveness of the three operator replacement strategies (Methods A, B, C). The results are:
| Method | P (%) | R (%) | F1 (%) | mAP50 (%) | Parameters (M) |
|---|---|---|---|---|---|
| Method A (all replaced) | 92.2 | 93.0 | 92.5 | 93.7 | 10.2 |
| Method B (partial upsampling) | 93.0 | 92.8 | 92.8 | 94.1 | 10.1 |
| Method C (proposed) | 95.6 | 95.2 | 95.4 | 96.3 | 10.7 |
Method C achieves the highest P, R, F1, and mAP50, proving its superior detection accuracy and feature extraction ability. Method B has the fewest parameters because it applies WTConv to all downsampling layers, indicating the lower complexity of WTConv. GradCAM++ visualization also confirms that Method C focuses precisely on key defect regions such as cracks, grid breaks, and stains, effectively distinguishing targets from background interference.
Finally, we compare PV‑RT‑DETR with several mainstream object detection algorithms under the same experimental conditions. The results are:
| Model | P (%) | R (%) | F1 (%) | mAP50 (%) | Parameters (M) | FPS |
|---|---|---|---|---|---|---|
| Faster-RCNN | 91.9 | 89.7 | 90.8 | 91.3 | 28.3 | 16.1 |
| YOLOv5-DETR | 88.5 | 89.6 | 89.0 | 90.1 | 5.6 | 183.6 |
| YOLOv8-DETR | 94.9 | 92.8 | 93.8 | 95.2 | 6.1 | 189.9 |
| YOLOv9m | 90.0 | 87.3 | 88.6 | 92.2 | 16.7 | 94.1 |
| YOLOv10m | 79.3 | 83.2 | 81.2 | 88.3 | 15.3 | 108.8 |
| YOLO11m | 93.1 | 90.7 | 91.8 | 95.3 | 20.0 | 90.7 |
| YOLO12m | 88.6 | 92.8 | 90.6 | 95.0 | 19.6 | 63.1 |
| RT-DETR-R18 (Baseline) | 92.5 | 91.5 | 92.0 | 93.6 | 19.9 | 105.8 |
| PV-RT-DETR (Ours) | 95.6 | 95.2 | 95.4 | 96.3 | 10.7 | 88.1 |
Our model reduces parameters to 53.8% of the baseline RT‑DETR‑R18, while improving mAP50 by 2.7% and F1 by 3.4%. Compared to larger YOLO models (YOLOv9m, YOLOv10m, YOLO11m, YOLO12m), PV‑RT‑DETR shows clear advantages in parameter count and superior performance in P, R, F1, and mAP50. Compared to smaller YOLO‑DETR variants, our model achieves higher accuracy metrics, although the parameter count and detection speed are not as competitive as those models. However, with a detection speed of 88.1 FPS, our algorithm still meets real‑time requirements.
In conclusion, we have developed a lightweight detection model for solar panel surface defects based on an improved RT‑DETR‑R18, named PV‑RT‑DETR. By replacing the backbone with MobileNetV4, we significantly reduce model parameters while maintaining feature extraction efficiency. Replacing multi‑head self‑attention with single‑head self‑attention in the AIFI module enhances global context capture for small‑target defects. Optimizing the upsampling and downsampling operators improves semantic continuity and expands the receptive field, thereby boosting multi‑scale feature fusion. Experimental results demonstrate that PV‑RT‑DETR achieves a mAP50 of 96.3% and F1 score of 95.4%, representing improvements of 2.7% and 3.4% over the original RT‑DETR‑R18. The parameter count is compressed to 53.8% of the original, and the detection speed reaches 88.1 FPS, outperforming various mainstream YOLO series algorithms. Although PV‑RT‑DETR performs well in accuracy and lightweight design, some limitations remain. The model is trained and validated on a specific solar panel image dataset with relatively limited defect types, not covering complex defects such as potential‑induced degradation, which restricts its generalization ability to diverse solar panel environments. Future work will focus on constructing a larger dataset covering a more comprehensive range of defect types (e.g., hot spots, PID) to enhance model generalization; deploying the model in practical solar panel operation and maintenance systems; and studying cross‑station domain adaptation methods to improve practicality in complex outdoor environments.

