Objective As an important crop for both food and energy production, sorghum’s fertility detection is crucial for variety breeding and yield improvement. However,traditional detection methods suffer from low efficiency due to complex field backgrounds,necessitating highly efficient and accurate detection technologies. Method This study proposed Fert-YOLO, a lightweight detection model for sorghum fertility, based on YOLOv8n. First, multiple offline data augmentation methods were used to enhance data diversity and improve the model’s generalization ability. Second,to reduce network complexity while effectively improving detection performance, StarNet was used to replace YOLOv8n's backbone feature extraction network. In the feature fusion stage,the C2F module was redesigned by incorporating mixed local channel attention (MLCA) mechanism, strengthening the network's ability to capture critical features. Finally, a lightweight shared convolution detection (LSCD) head was introduced, which shared convolutional layer parameters to significantly reduce model size and complexity. Results The Fert-YOLO model demonstrated outstanding performance in sorghum fertility detection. Compared to the original YOLOv8n model, it achieved a 1.5% improvement in mean average precision(Map0.5),further enhancing detection accuracy. Additionally, the model’s,floating-point operations per second (FLOPs) and parameters were reduced by 40.0% and 47.8%, respectively, significantly improving inference speed and deployment efficiency. When compared to other common single-stage lightweight detection models, Fert-YOLO showed clear advantages in both detection accuracy and model efficiency. Conclusion This research provided a reliable technical support for efficient sorghum fertility detection in field conditions, contributing significantly to smart sorghum breeding and precision agriculture.
在目标检测模型构建时,空间层面的注意力机制部署存在较高复杂度,受此限制,当前主流的注意力机制多聚焦于通道特征信息提取,这在一定程度上削弱了模型的特征提取能力。为有效平衡性能和计算复杂性,本研究在网络的颈部结构引入MLCA机制[16]。其结构如图6所示,MLCA机制的具体实现过程如下:首先对输入特征向量(C, W, H)采用局部平均池化处理(Local average pooling,LAP),将其转换为1*C*ks*ks的向量,以此实现局部空间信息的有效提取。随后进入分支处理阶段,其中一个分支使用全局平均池化(Global average pooling,GAP)将特征向量转换为1*1*C的向量,从而保留特征的全局信息。另一分支使用局部平均池化(LAP)将特征向量转换为1*1*C的向量,实现局部空间信息的进一步提炼。分支处理后,将2个分支的特征向量经过一维卷积,使其恢复到原始分辨率。最后,将2个分支的特征向量进行融合,生成最终的混合注意力特征图。通过上述操作将局部空间信息融入到通道注意力机制中,同时考虑通道信息、空间信息、局部信息和全局信息,从而提高网络的表达效果。此外,整个处理过程中并无大型卷积的操作,有效降低了模型的复杂度。本研究将MLCA机制嵌入C2F结构形成C2F-MLCA,结构见图7。
本研究采用多维评估指标对模型性能进行全面分析,精度指标选择精确率(Precision, P)、召回率(Recall, R)、F1分数、Map0.5。计算效率参数选择浮点运算量(FLOPs, Floating-point operations per second)、模型参数量(Parameters)、每秒处理帧数(FPS, Frames per second)。各指标计算公式如下:
ZouJ Q. World sorghum industry analysis based on 1961-2020 FAO data[J].Journal of Shanxi Agricultural University(Natural Science Edition), 2023, 43(1): 1-10.
[3]
Zhang R, Lin G, Shang L, et al. Potential, economic and ecological benefits of sweet sorghum bio industry in China [J]. Biotechnology for Biofuels and Bioproducts, 2024, 17(1): 134.
[4]
GirshickR, DonahueJ, DarrellT, et al. Rich feature hierarchies for accurate object detection and semantic segmentation[C]. 2014 IEEE Conference on Computer Vision and Pattern Recognition, Columbus: IEEE, 2014: 580-587.
[5]
RenS Q, HeK M, GirshickR, et al. Faster R-CNN: towards real-time object detection with region proposal networks[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2017, 39(6): 1137-1149.
[6]
HeK M, GkioxariG, DollárP, et al. Mask R-CNN[C]. 2017 IEEE International Conference on Computer Vision (ICCV), Venice: IEEE, 2017:2980-2988.
[7]
LiuW, AnguelovD, ErhanD, et al. SSD: single shot Multibox detector[C]//Leibe B, Matas J, Sebe N, Welling M. Computer Vision-ECCV 2016, PT I, Cham:Springer, 2016: 21-37.
[8]
RedmonJ, FarhadiA. YOLOv3: an incremental improvement [EB/OL]. 2018:1-6(2018-04-08)[2025-06-24].
[9]
BochkovskiyA, WangC Y, LiaoH Y M. YOLOv4: optimal speed and accuracy of object detection[EB/OL]. 2020: 1-17(2020-04-23)[2025-06-24].
[10]
WangC Y, BochkovskiyA, LiaoH M. YOLOv7: trainable bag-of-freebies sets new state-of-the-art for real-time object detectors[C]. 2023 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR),Vancouver: IEEE,2023: 7464-7475.
ZhuX, MaH, JiJ T, et al. Detecting and identifying blueberry canopy fruits based on Faster R-CNN[J].Journal of Southern Agriculture,2020, 51(6): 1493-1501.
LongJ H, ZhaoC J, LinS, et al. Segmentation method of the tomato fruits with different maturities under greenhouse environment based on improved Mask R-CNN[J]. Transactions of the Chinese Society of Agricultural Engineering, 2021, 37(18): 100-108.
TianY W, QinS S, YanY B, et al. Detecting blueberry maturity under complex field conditions using improved YOLOv8[J]. Transactions of the Chinese Society of Agricultural Engineering, 2024, 40(16): 153-162.
DongG G, ChenX K, FanX P, et al. Detecting Xinmei fruit under complex environments using improved YOlOv5s[J]. Transactions of the Chinese Society of Agricultural Engineering, 2024, 40(14): 118-125.
WangJ P, HeM, ZhenQ G, et al. Camellia oleifera fruit harvesting in complex environment based on COF-YOLOv5s[J]. Transactions of the Chinese Society of Agricultural Engineering, 2024, 40(13): 179-188.
[21]
MaX, DaiX Y, BaiY, et al. Rewrite the stars[C]. 2024 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Seattle: IEEE, 2024: 5694-5703.
[22]
WanD H, LuR S, ShenS Y, et al. Mixed local channel attention for object detection [J]. Engineering Applications of Artificial Intelligence, 2023, 123: 106442.
[23]
TianZ, ShenC H, ChenH, et al. FCOS: fully convolutional one-stage object detection[C]. 2019 IEEE/CVF International Conference on Computer Vision (ICCV), Seoul: IEEE, 2019: 9626-9635.
ZhangS H, DongL, PangZ J,et al.Wheat spike target detection model based on improved YOLOv5 [J]. Agricultural Engineering,2023,13(3):50-56.
[26]
YeX Q, PanJ, LiuG S, et al. Exploring the close-range detection of UAV-based images on pine wilt disease by an improved deep learning method[J]. Plant Phenomics, 2023, 5: 0129.
[27]
WuD H, LüS C, JiangM, et al. Using channel pruning-based YOLO v4 deep learning algorithm for the real-time and accurate detection of apple flowers in natural environments [J].Computers and Electronics in Agriculture, 2020, 178: 105742.
[28]
LiJ, LiJ H, ZhaoX, et al. Lightweight detection networks for tea bud on complex agricultural environment via improved YOLO v4 [J]. Computers and Electronics in Agriculture, 2023, 211: 107955.
[29]
ZhaoW Y, LiuS Y, LiX Y, et al. Fast and accurate wheat grain quality detection based on improved YOLOv5 [J]. Computers and Electronics in Agriculture, 2022, 202: 107426.