Heliyon (Dec 2024)

EA-CNN: Enhanced attention-CNN with explainable AI for fruit and vegetable classification

  • Zeshan Aslam Khan,
  • Muhammad Waqar,
  • Khalid Mehmood Cheema,
  • Ali Abu Bakar Mahmood,
  • Quratul Ain,
  • Naveed Ishtiaq Chaudhary,
  • Abdullah Alshehri,
  • Sultan S. Alshamrani,
  • Muhammad Asif Zahoor Raja

Journal volume & issue
Vol. 10, no. 23
p. e40820

Abstract

Read online

The quality of vegetables and fruits are judged by their visual features. Misclassification of fruits and vegetables lead to a financial loss. To prevent the loss, superstores need to classify fruits and vegetables in terms of size, color and shape. To improve the accuracy of models for classifying fruits and vegetables, researchers have introduced various CNN architectures like VGG16, AlexNet, DenseNet-121 and different attention-based variants by compromising models' complexity leading to high computational cost and overlooking feature's contribution for interpretable predictions. Additionally, the major drawback in most of the existing works is the utilization of the limited dataset and number of classes for fruit and vegetable classification task instead of the benchmark dataset like Fruit-360 which comprises of 141 distinct fruit and vegetable classes. In this study, an explainable artificial intelligence (XAI) driven enhanced attention-CNN (EA-CNN) is proposed for accomplishing the fruit and vegetable classification task accurately and efficiently. The proposed EA-CNN model (a) detects the class of fruits and vegetable accurately through visual features by manipulating undiscover customized pooling technique and enhanced attention feature extraction mechanism, (b) classifies the fruits and vegetables efficiently through a simplified architecture, (c) provides interpretable predictions through XAI approach. By utilizing entire fruit-360 database, this research noteworthily enhances the model's capability to classify wide range of fruits and vegetables, thus providing an effective and reliable solution for practical applications. The proposed study outclasses baseline models with regard to accuracy and computational cost on fruit-360 benchmark dataset. EA-CNN achieves better accuracy of 98.1 % in smaller number of iterations as compared to benchmark models. Moreover, to further prove the efficiency, generalization ability, robustness, scalability and adaptability of this research, the architecture of proposed EA-CNN model is validated on another real-world dataset named as ‘Fruit Recognition’. The experimental outcomes display that the proposed EA-CNN model produces substantial performance on Fruit-Recognition dataset as well by attaining a generalized accuracy of 96 %.

Keywords