Attention-Aware CNN for Fruit Image Classification

Authors

  • Wenjia Geng

DOI:

https://doi.org/10.54097/hset.v38i.5806

Keywords:

Convolutional neural network (CNN), attention mechanism, convolutional block attention module (CBAM), Fruit image classification.

Abstract

Fruit image classification has significant potential value in agricultural harvesting and commercial fruit trading. However, the wide variety of fruits and their complex and diverse properties make the fruit image classification using computer vision techniques with high accuracy still challenging. This paper aims to introduce attention mechanism into the convolutional neural networks to improve the models' accuracy for the classification and explore the impact of the convolutional block attention module (CBAM) implementation before and after convolution layers on model performance. Firstly a 16-layer CNN model called BasicCNN was built. Secondly, two models named BasicCNN+CBAM_v1 and BasicCNN+CBAM_v2 were built by adding CBAM layers before the first convolution layer and after the convolution layers of the BasicCNN. Then a test set was created called Real-world, containing more diverse fruit images than another open-source dataset, Fruit360, that was also used in this research. Lastly, the three network models were trained and evaluated using two datasets, Fruits 360 and Real-world. Among the tests on the Real-world test set, the accuracy of BasicCNN(16.67%) was much lower than that of BasicCNN+CBAM_v1(48.89%) and BasicCNN+CBAM_v2(46.73%). Moreover, BasicCNN+CBAM_v1 also achieved the highest accuracy on Fruit360 datasets. The results show that the CNN model obtains a performance improvement when the CBAM is added and that implementing the attention mechanism before the convolution also allows the model to achieve better performance.

Downloads

Download data is not yet available.

References

Marimuthu, S., & Roomi, S. M. M. (2017). Particle swarm optimized fuzzy model for the classification of banana ripeness. IEEE Sensors Journal, 17(15), 4903-4915.

Rocha, A., Hauagge, D. C., Wainer, J., & Goldenstein, S. (2010). Automatic fruit and vegetable classification from images. Computers and Electronics in Agriculture, 70(1), 96-104.

Siddiqi, R. (2020, July). Comparative performance of various deep learning based models in fruit image classification. In Proceedings of the 11th International Conference on Advances in Information Technology (pp. 1-9).

Mureşan, H., & Oltean, M. (2017). Fruit recognition from images using deep learning. arXiv preprint arXiv:1712.00580.

Mnih, V., Heess, N., & Graves, A. (2014). Recurrent models of visual attention. Advances in neural information processing systems, 27.

Yin, W., Schütze, H., Xiang, B., & Zhou, B. (2016). Abcnn: Attention-based convolutional neural network for modeling sentence pairs. Transactions of the Association for Computational Linguistics, 4, 259-272.

Zhong, Z., Zheng, L., Kang, G., Li, S., & Yang, Y. (2020, April). Random erasing data augmentation. In Proceedings of the AAAI conference on artificial intelligence (Vol. 34, No. 07, pp. 13001-13008).

Han, D., Liu, Q., & Fan, W. (2018). A new image classification method using CNN transfer learning and web data augmentation. Expert Systems with Applications, 95, 43-56.

Itti, L., Koch, C., & Niebur, E. (1998). A model of saliency-based visual attention for rapid scene analysis. IEEE Transactions on pattern analysis and machine intelligence, 20(11), 1254-1259.

Woo, S., Park, J., Lee, J. Y., & Kweon, I. S. (2018). Cbam: Convolutional block attention module. In Proceedings of the European conference on computer vision (ECCV) (pp. 3-19).

Park, J., Woo, S., Lee, J. Y., & Kweon, I. S. (2018). Bam: Bottleneck attention module. arXiv preprint arXiv:1807.06514.

Downloads

Published

16-03-2023