# Lem-Detector: An Efficient Detector for Photovoltaic Panel Defect Detection
## 1 Introduction  
Defects in photovoltaic panels pose a significant challenge, not only reducing power generation efficiency but also presenting a fire hazard. Early detection of these defects during the manufacturing process is crucial to prevent defective panels from advancing to subsequent production stages [1]. Photovoltaic panel defects appear as non-luminous dark areas in electroluminescence (EL) imaging, making it possible to detect defects through electroluminescence images of photovoltaic panels. These defects exhibit wide variation in scale and diversity, ranging from minute cracks to extensive structural damage. Each type of defect presents unique characteristics, further complicating the detection process. Moreover, manufacturing processes and raw materials often introduce a significant number of randomly distributed, variably shaped grain patterns in photovoltaic panel images. These patterns closely resemble defects, creating complex backgrounds that interfere with defect detection. This interference increases the likelihood of false positives and missed detections, posing substantial challenges to the detection task. Figure 1 illustrates common defects found in photovoltaic panels. Traditional computer vision-based methods have been widely employed for automated defect identification in photovoltaic panel images. These approaches typically extract features from texture, color, shape, and spectral cues using handcrafted feature descriptors, followed by utilizing classifiers for defect detection [2; 3]. However, the feature extraction process heavily relies on handcrafted descriptors, which often involves complex parameter configurations and requires significant domain expertise. Moreover, these techniques are typically developed for specific applications, leading to limited generalization and robustness across diverse defect types and scenarios. Object detection models are broadly categorized into one-stage and two-stage approaches. One-stage models, such as SSD [4] and YOLO [5], prioritize speed and real-time detection. Two-stage models, like R-CNN [6] and Faster R-CNN [7], emphasize accuracy but often come at the cost of computational efficiency. While R-CNN variants excel in precision, they are resource-intensive, requiring significant memory and processing power. SSD, although faster, struggles with detecting smaller objects and lags behind YOLO in real-time performance. The YOLO family of models demonstrates a compelling balance between accuracy and speed. However, their reliance on Non-Maximum Suppression [8] for eliminating redundant detections can negatively impact both speed and accuracy. The DETR series [9], on the other hand, eliminates Non-Maximum Suppression altogether, improving both efficiency and accuracy. However, DETR models necessitate substantial computational resources. RT-DETR [10] addresses these challenges by efficiently processing multi-scale features and introducing IoU-aware query selection, which provides the decoder with more accurate initial object queries. This approach surpasses existing real-time detectors in both accuracy and speed, while eliminating the need for post-processing, leading to a stable and delay-free inference process. This paper presents an efficient end-to-end detector for photovoltaic panel defect detection, the LEM-Detector, drawing inspiration from the advancements of RT-DETR. The proposed approach addresses the challenges of imbalanced training data and effective feature extraction for multi-scale defect detection. To tackle the issue of imbalanced training samples, a novel Linear Feature Augmentation (LFA) module is introduced. LFA utilizes the cosine similarity function as a triggering threshold to augment linear defect samples, thereby enhancing the model's accuracy and robustness. Furthermore, an Efficient Feature Enhancement Module (EFEM) is proposed to effectively capture subtle texture information associated with defects. The EFEM utilizes dynamic convolutional kernels based on feature weight analysis to improve extraction efficiency.