Lens defect detection based on feature enhancement and improved RT-DETR
Abstract
Factory online inspection scenarios face challenges of limited computing power and unstable detection of minute defects in resin lenses. This study focuses on the synergistic optimization of real-time performance and detection accuracy. Using RT-DETR as the baseline model, conduct improvements in image enhancement and network architecture. The imaging process of resin lenses involves strong reflections and complex noise. Scratches and dust exhibit high similarity in both physical scale and grayscale features. These factors make traditional enhancement algorithms and complex deep learning models difficult to apply directly. This study leverages statistical results from confocal microscopy to establish a mapping relationship between physical scale and pixel domain. Based on this, a two-stage G-side window image enhancement algorithm is proposed. This algorithm effectively suppresses small-scale bright noise while preserving defect structural information, all while controlling computational overhead. The original network suffers from limited receptive fields and gradual degradation of fine defect features across layers. To address this, we introduce reparameterized partial convolutions and attention mechanisms into the backbone network. The FRep-Former module replaces the original residual structure. Additionally, the SIoU loss function is adopted to enhance target localization accuracy. Experimental results demonstrate that this approach meets detection efficiency requirements. Model parameters are reduced by approximately 13.5%, mAP0.5 improves to 79.8%, and inference speed reaches 52.1 FPS. This improvement effectively balances detection accuracy and computational efficiency. Experimental data validate the method's potential for industrial online inspection applications.