Fruit Image Recognition with Enhanced CBAM Attention Mechanism Based on Resnet18

Authors

  • Wenyan Huang Department of Computer Science and Technology, Beijing Jiaotong University, Weihai, 264209, China

DOI:

https://doi.org/10.54097/xp6zk920

Keywords:

Fruit image recognition; ResNet18; Attention mechanism.

Abstract

In the field of computer vision today, the accurate recognition of fruit images is of great significance for practical applications such as intelligent agriculture and food quality inspection. Traditional image recognition models encounter a precision bottleneck when processing fruit images, primarily due to the diversity and complexity of fruit features, particularly when different fruit varieties exhibit similar appearances. This paper focuses on improving the performance of fruit image recognition models and proposes an innovative method based on the ResNet18 architecture, which integrates multiple pooling and spatial attention mechanisms. By constructing a dynamic pooling fusion module, the model can adaptively learn the weights of different pooling methods, thereby effectively alleviating feature conflicts among multiple pooling methods. At the same time, the introduction of a channel-spatial attention dynamic balance mechanism optimises the allocation of attention to features in different dimensions, enhancing the pertinence and effectiveness of feature extraction. Experimental results show that, compared to the original ResNet18 model, the average accuracy of the improved model on the fruit30 dataset has increased significantly from 73.933% to 75.108%. The highest accuracy on the fruit360 dataset has also increased, fully demonstrating the excellent effect of this method in enhancing fruit feature recognition ability and improving the model's generalisation performance. It lays a solid foundation for the broad application of fruit image recognition technology in practical scenarios.

Downloads

Download data is not yet available.

References

[1] Jia Weikuan, Tian Yuyu, Luo Rong, Zhang Zhonghua, Lian Jian, Zheng Yuanjie. Detection and segmentation of overlapped fruits using an optimised mask R-CNN application in an apple harvesting robot. Computers and Electronics in Agriculture, 2020, 172: 105380.

[2] Gill Harmandeep Singh, Khalaf Osamah Ibrahim, Alotaibi Youseef, Alghamdi Saleh, Alassery Fawaz. Fruit image classification using deep learning. Computers, Materials & Continua, 2022, 71(3): 4599–4613.

[3] He Kaiming, Zhang Xiangyu, Ren Shaoqing, Sun Jian. Deep residual learning for image recognition. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016: 770–778.

[4] Krizhevsky Alex, Sutskever Ilya, Hinton Geoffrey E. ImageNet classification with deep convolutional neural networks. Advances in Neural Information Processing Systems (NeurIPS), 2012, 25: 1097–1105.

[5] Simonyan Karen, Zisserman Andrew. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.

[6] Sandler Mark, Howard Andrew, Zhu Menglong, Zhmoginov Andrey, Chen Liang-Chieh. Inverted residuals and linear bottlenecks: Mobile networks for classification, detection and segmentation. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018: 4510–4520.

[7] Liu Kai. Comparison of different convolutional neural network models on Fruit 360 dataset. Highlights in Science Engineering and Technology, 2023, 34: 85–94.

[8] Kingma Diederik P, Ba Jimmy. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.

[9] TommyZihao. Train_Custom_Dataset: A repository for dataset annotation, training, evaluation, testing, and deployment of AI algorithms. GitHub, 2024.

[10] Muresan Horea, Oltean Mihai. Fruit recognition from images using deep learning. Acta Universitatis Sapientiae, Informatica, 2018, 10(1): 26–42.

[11] Deng Jia, Dong Wei, Socher Richard, Li Li-Jia, Li Kai, Fei-Fei Li. ImageNet: A large-scale hierarchical image database. 2009 IEEE Conference on Computer Vision and Pattern Recognition, 2009: 248–255.

Downloads

Published

30-12-2025

How to Cite

Huang, W. (2025). Fruit Image Recognition with Enhanced CBAM Attention Mechanism Based on Resnet18. Highlights in Science, Engineering and Technology, 160, 100-106. https://doi.org/10.54097/xp6zk920