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.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call