Abstract:Aiming to address the challenges of missed detection, low recognition accuracy caused by complex field conditions such as varying lighting and occlusion by overlapping branches and filaments, as well as the difficulty in deploying large models on edge devices, lightweight network for safflower recognition ( LNSR), an improved lightweight network structure was proposed based on YOLO 12. Specifically, the heterogeneous edge-pooling dual-stream fusion module (HEP-DSF) was designed to enhance the network’s ability to extract edge and texture information in the early stage, thereby improving recognition accuracy. The triple cooperative adaptive fusion module (TriCAFusion) was constructed to strengthen the model??s representation of key target features and reduce the probability of missed detection. The adaptive neighborhood pooling for down sampling module (AdaPool) was introduced to improve the model’s robustness to lighting variations and occluded scenes. Furthermore, the lightweight shared-BN network (LSBNet) detection head was developed to reduce model complexity and improve deployment efficiency. Experimental results on the safflower dataset showed that LNSR achieved only 1. 72 × 106 parameters, a reduction of 31. 5% compared with that of YOLO 12, with a model size of 4. 4 MB (1. 1 MB smaller). It also reached an mAP50 of 98. 9% and a recall rate of 98. 3%, representing improvements of 1. 4 and 1. 0 percentage points, respectively. When generalized to the chrysanthemum dataset, LNSR achieved 1. 63 × 106 parameters, a model size of 4. 4 MB, and an mAP50 of 97. 0%, which was 5. 9 percentage points higher than that of YOLO 12. Heatmap validation confirmed its precise focus and characterization ability on petal edges and stamen textures. Deployed on the Jetson edge device, it achieved a real-time frame rate of 30 f/ s. It demonstrated that through the collaborative innovation of the four modules, LNSR achieved an optimal balance between accuracy and lightweight design, providing an efficient and reliable visual recognition solution for selective harvesting of safflower.