Zhang Ning, Chen Yuanqi, Zhang Enxu, Liu Ziyang, Yue Jie
Engineering Research Center of Hydrogen Energy Equipment& Safety Detection, Universities of Shaanxi Province, Xijing University, Xi'an, China.
PLoS One. 2025 Jan 24;20(1):e0312363. doi: 10.1371/journal.pone.0312363. eCollection 2025.
The traditional method of corn quality detection relies heavily on the subjective judgment of inspectors and suffers from a high error rate. To address these issues, this study employs the Swin Transformer as an enhanced base model, integrating machine vision and deep learning techniques for corn quality assessment. Initially, images of high-quality, moldy, and broken corn were collected. After preprocessing, a total of 20,152 valid images were obtained for the experimental samples. The network then extracts both shallow and deep features from these maize images, which are subsequently fused. Concurrently, the extracted features undergo further processing through a specially designed convolutional block. The fused features, combined with those processed by the convolutional module, are fed into an attention layer. This attention layer assigns weights to the features, facilitating accurate final classification. Experimental results demonstrate that the MC-Swin Transformer model proposed in this paper significantly outperforms traditional convolutional neural network models in key metrics such as accuracy, precision, recall, and F1 score, achieving a recognition accuracy rate of 99.89%. Thus, the network effectively and efficiently classifies different corn qualities. This study not only offers a novel perspective and technical approach to corn quality detection but also holds significant implications for the advancement of smart agriculture.
传统的玉米质量检测方法严重依赖检验员的主观判断,且错误率很高。为了解决这些问题,本研究采用Swin Transformer作为增强基础模型,将机器视觉和深度学习技术集成用于玉米质量评估。首先,收集了优质、发霉和破损玉米的图像。经过预处理后,共获得20152张有效图像作为实验样本。然后,该网络从这些玉米图像中提取浅层和深层特征,随后将其融合。同时,提取的特征通过专门设计的卷积块进行进一步处理。融合后的特征与卷积模块处理后的特征一起被输入到注意力层。该注意力层为特征分配权重,便于进行准确的最终分类。实验结果表明,本文提出的MC-Swin Transformer模型在准确率、精确率、召回率和F1分数等关键指标上显著优于传统卷积神经网络模型,识别准确率达到99.89%。因此,该网络能够有效且高效地对不同玉米质量进行分类。本研究不仅为玉米质量检测提供了新的视角和技术方法,也对智慧农业的发展具有重要意义。