Nuanmeesri Sumitra
Faculty of Science and Technology, Suan Sunandha Rajabhat University, Bangkok, 10300, Thailand.
Sci Rep. 2025 Jan 29;15(1):3719. doi: 10.1038/s41598-025-87173-7.
Attention mechanisms such as the Convolutional Block Attention Module (CBAM) can help emphasize and refine the most relevant feature maps such as color, texture, spots, and wrinkle variations for the avocado ripeness classification. However, the CBAM lacks global context awareness, which may prevent it from capturing long-range dependencies or global patterns such as relationships between distant regions in the image. Further, more complex neural networks can improve model performance but at the cost of increasing the number of layers and train parameters, which may not be suitable for resource constrained devices. This paper presents the Hybrid Attention Convolutional Neural Network (HACNN) model for classifying avocado ripeness on resource constrained devices. It aims to perform local feature enhancement and capture global relationships, leading to a more comprehensive feature extraction by combining attention modules for the Convolutional Neural Network models. The proposed HACNN model combines transfer learning in the Convolutional Neural Network with hybrid attention mechanisms, including Spatial, Channel, and Self-Attention Modules, to effectively capture the intricate features of avocado ripeness from fourteen thousand images. Extensive experiments demonstrate that the transfer learning HACNN with the EfficienctNet-B3 model significantly outperforms conventional models regarding the performance and accuracy of 96.18%, 92.64%, and 91.25% for train, validation, and test models, respectively. In addition, this model consumed 59.81 MB of memory and an average inference time of 280.67 ms with TensorFlow Lite on a smartphone. Although the transfer learning HACNN with the ShuffleNetV1 (1.0x) model consumes the least resources, its testing accuracy is only 82.89%, which is insufficient for practical applications. Thus, the transfer learning HACNN with the MobileNetV3 Large model is an exciting option for resource constrained devices. It has a test accuracy of 91.04%, an average memory usage of 26.52 MB, and an average inference time of 86.94 ms on the smartphone. These findings indicated that the proposed method enhances avocado ripeness classification accuracy and ensures feasibility for practical implementation in low-resource environments.
诸如卷积块注意力模块(CBAM)之类的注意力机制有助于强调和细化与鳄梨成熟度分类最相关的特征图,如颜色、纹理、斑点和皱纹变化。然而,CBAM缺乏全局上下文感知能力,这可能会阻碍它捕获长距离依赖关系或全局模式,如图像中远距离区域之间的关系。此外,更复杂的神经网络可以提高模型性能,但代价是增加层数和训练参数数量,这可能不适用于资源受限的设备。本文提出了用于在资源受限设备上对鳄梨成熟度进行分类的混合注意力卷积神经网络(HACNN)模型。它旨在进行局部特征增强并捕获全局关系,通过为卷积神经网络模型组合注意力模块来实现更全面的特征提取。所提出的HACNN模型将卷积神经网络中的迁移学习与混合注意力机制相结合,包括空间、通道和自注意力模块,以有效地从一万四千张图像中捕获鳄梨成熟度的复杂特征。大量实验表明,采用EfficienctNet-B3模型的迁移学习HACNN在训练、验证和测试模型的性能和准确率方面分别显著优于传统模型,达到了96.18%、92.64%和91.25%。此外,该模型在智能手机上使用TensorFlow Lite时消耗59.81MB内存,平均推理时间为280.67毫秒。虽然采用ShuffleNetV1(1.0x)模型的迁移学习HACNN消耗的资源最少,但其测试准确率仅为82.89%,不足以用于实际应用。因此,采用MobileNetV3 Large模型的迁移学习HACNN对于资源受限设备来说是一个令人兴奋的选择。它在智能手机上的测试准确率为91.04%,平均内存使用量为26.52MB,平均推理时间为86.94毫秒。这些发现表明,所提出的方法提高了鳄梨成熟度分类的准确率,并确保了在低资源环境中实际实施的可行性。