Chen Siwei, Dai Dan, Zheng Jian, Kang Haoyu, Wang Dongdong, Zheng Xinyu, Gu Xiaobo, Mo Jiali, Luo Zhuohui
School of Mathematics and Computer Science, Zhejiang Agriculture and Forestry University, Hangzhou, China.
Zhejiang Key Laboratory of Forestry Intelligent Monitoring and Information Technology Research, Hangzhou, China.
Front Nutr. 2023 Jan 5;9:1075781. doi: 10.3389/fnut.2022.1075781. eCollection 2022.
Walnut grading is an important step before the product enters the market. However, traditional walnut grading primarily relies on manual assessment of physiological features, which is difficult to implement efficiently. Furthermore, walnut kernel grading is, at present, relatively unsophisticated. Therefore, this study proposes a novel deep-learning model based on a spatial attention mechanism and SE-network structure to grade walnut kernels using machine vision to ensure accuracy and improve assessment efficiency. In this experiment, we found through the literature that both the lightness (* value) and malondialdehyde (MDA) contens of walnut kernels were correlated with the oxidation phenomenon in walnuts. Subsequently, we clustered four partitionings using the * values. We then used the MDA values to verify the rationality of these partitionings. Finally, four network models were used for comparison and training: VGG19, EfficientNetB7, ResNet152V2, and spatial attention and spatial enhancement network combined with ResNet152V2 (ResNet152V2-SA-SE). We found that the ResNet152V2-SA-SE model exhibited the best performance, with a maximum test set accuracy of 92.2%. The test set accuracy was improved by 6.2, 63.2, and 74.1% compared with that of ResNet152V2, EfficientNetB7, and VGG19, respectively. Our testing demonstrated that combining spatial attention and spatial enhancement methods improved the recognition of target locations and intrinsic information, while decreasing the attention given to non-target regions. Experiments have demonstrated that combining spatial attention mechanisms with SE networks increases focus on recognizing target locations and intrinsic information, while decreasing focus on non-target regions. Finally, by comparing different learning rates, regularization methods, and batch sizes of the model, we found that the training performance of the model was optimal with a learning rate of 0.001, a batch size of 128, and no regularization methods. In conclusion, this study demonstrated that the ResNet152V2-SA-SE network model was effective in the detection and evaluation of the walnut kernels.
核桃分级是产品进入市场前的重要环节。然而,传统的核桃分级主要依靠对生理特征的人工评估,难以高效实施。此外,目前核桃仁分级相对不够精细。因此,本研究提出一种基于空间注意力机制和SE网络结构的新型深度学习模型,利用机器视觉对核桃仁进行分级,以确保准确性并提高评估效率。在本实验中,我们通过文献发现核桃仁的亮度(值)和丙二醛(MDA)含量均与核桃的氧化现象相关。随后,我们使用值对四个分区进行聚类。然后,我们用MDA值验证这些分区的合理性。最后,使用四个网络模型进行比较和训练:VGG19、EfficientNetB7、ResNet152V2以及结合了ResNet152V2的空间注意力和空间增强网络(ResNet152V2-SA-SE)。我们发现ResNet152V2-SA-SE模型表现最佳,测试集最大准确率为92.2%。与ResNet152V2、EfficientNetB7和VGG19相比,测试集准确率分别提高了6.2%、63.2%和74.1%。我们的测试表明,结合空间注意力和空间增强方法提高了对目标位置和内在信息的识别,同时减少了对非目标区域的关注。实验表明,将空间注意力机制与SE网络相结合,增加了对目标位置和内在信息识别的关注,同时减少了对非目标区域的关注。最后,通过比较模型的不同学习率、正则化方法和批量大小,我们发现当学习率为0.001、批量大小为128且不使用正则化方法时,模型的训练性能最佳。总之,本研究表明ResNet152V2-SA-SE网络模型在核桃仁的检测和评估中是有效的。