Abstract:
To address the issue of low measurement accuracy of cut tobacco width caused by imprecise detection under dense, overlapping, and disordered cut leaf conditions, a lightweight detection method based on the CM-YOLOv8n model was proposed. Firstly, a C2f-Faster-CGLU network abbreviated as C2f-FC, which processed partial channels of input features using partial convolution and employed a gating mechanism to dynamically screen important feature channels, was designed to effectively reduce number of model parameters and computational complexity. Secondly, a multi-scale convolutional attention (MSCA) module was designed and placed before the spatial pyramid pooling-fast (SPPF) module in the backbone network. By leveraging multi-scale feature aggregation and channel attention mechanisms, the model's perception of cut tobacco features was enhanced. Finally, the WIOU loss function was introduced, which dynamically adjusted the focusing mechanism and balanced sample weights to improve detection pression. Finally, an online detection system for cut tobacco width was developed based on the CM-YOLOv8n model. The results showed that: 1) The CM-YOLOv8n model achieved a precision of 90.7%, a recall rate of 86.6%, an
mAP@0.50 of 92.4%, and an
mAP@ (0.50-0.95) of 73.7%, with a model parameter number of 2.38 M and floating point operation counts of 6.2 G. While maintaining a small number of parameters and low computational complexity, lightweight design was also considered, significantly improving the detection outcome of cut tobacco. 2) Compared with representative mainstream object detection algorithms such as Faster R-CNN, the CM-YOLOv8n model has fewest parameters and significantly reduced floating point operation counts, demonstrating higher detection efficiency and stronger generalization capability. 3) The designed online detection system for cut tobacco width achieved a detection error within ±0.1 mm compared with the results of manual detetion, meeting industrial production standards. This study lays a theoretical foundation for the subsequent application of a real-time online detection system for cut tobacco width.