Lightweight cigarette appearance defect detection based on an enhanced RT-DETR framework
Abstract
In cigarette production lines, defect recognition is easily affected by miniature target areas, highly repetitive end-face texture, small inter-class visual gaps and the limited computing power of on-site devices. To improve detection under these constraints, this paper reconstructs RT-DETR-R18 from two complementary levels. At the backbone level, ResNet is replaced with EfficientViT, whose cascaded group attention divides features into channel groups and then performs progressive attention interaction, so that local texture variations and broader contextual clues can be jointly represented. This is beneficial for identifying flat heads, inverted cigarettes, material loss and fracture-like defects. At the neck level, a GhostConv-CoordAtt fusion block is introduced. GhostConv generates part of the feature maps through low-cost operations, while coordinate attention retains horizontal and vertical positional information for more accurate defect localization. Tests on a self-built cigarette appearance defect dataset show that the improved detector contains 9.53 M parameters, requires 24.3 G FLOPs and occupies 39.1 MB. Compared with the original RT-DETR-R18, these values decrease by 52.6%, 57.4% and 51.5%, respectively. Meanwhile, precision, recall, mAP50 and mAP50-95 reach 99.0%, 98.0%, 99.2% and 82.4%. The experimental evidence suggests that the proposed scheme achieves a favorable balance between lightweight deployment and detection reliability for real-time industrial inspection.