Enhanced sodium rod detection and distribution using a YOLOv5s-SNet2-CBAM lightweight network
摘要
Accurately detecting and analyzing multi-layer sodium rods in automated production systems is challenging due to variations in rod sizes, layer overlapping, and visual distortions caused by wrinkles in protective bags. To tackle these challenges, we propose a lightweight detection model, namely, YOLOv5s-SNet2-CBAM, for efficient sodium rod identification in real-time industrial environments. Replacing the YOLOv5s backbone with a pruned ShuffleNetv2 and integrating CBAM modules improves detection speed by 25.3% and increases maP@0.5 from 0.966 to 0.981. A pixel area-based filtering strategy eliminates false detections from lower layers, while Gamma correction and OTSU segmentation enhance image quality and rod extraction. Morphological processing is further used to accurately compute the spatial distribution of sodium rods. Experiments demonstrate that the proposed method meets the precision and efficiency requirements for real-time automated sodium rod barreling. The code will be publicly available upon acceptance at: https://github.com/Timmor-walker/YOLOv5s-SNet2-CBAM.