Fruit and Vegetable Image Recognition Based on Multiple Tree Models: Applications of Random Forest, XGBoost and Decision Tree

Authors

  • Zihao Wang Author

DOI:

https://doi.org/10.61173/fvzhe382

Keywords:

Machine Learning Algorithms, Image Recognition, Ensemble Learning

Abstract

The primary objective of this study is to evaluate and compare the performance of three machine learning models— Random Forest, XGBoost, and Decision Tree—in the context of fruit and vegetable image classification. This research aims to identify which model best handles the challenges associated with imbalanced datasets and complex data structures. The ultimate goal is to contribute to the development of more efficient and accurate automated systems for agricultural applications, thereby improving productivity and reducing operational costs in the industry. This study utilized a dataset of 3,825 images covering 36 fruit and vegetable classes. Images were resized, normalized, and augmented to enhance diversity. Three models—Random Forest, XGBoost, and Decision Tree—were trained on this dataset. Performance was evaluated using accuracy, precision, recall, and F1-score to assess classification effectiveness and handling of class imbalances. The evaluation revealed that XGBoost outperformed Random Forest and Decision Tree in fruit and vegetable image classification, achieving the highest accuracy of 96.66%. XGBoost demonstrated superior handling of class imbalances and complex data structures, reflected in its precision and recall scores across various classes. Random Forest also performed well, closely following XGBoost, while Decision Tree exhibited more variability in results, indicating potential overfitting in certain classes. In conclusion, this study highlights the effectiveness of ensemble methods, particularly XGBoost, in agricultural image classification tasks. These findings suggest that XGBoost is a robust model for similar applications, offering improved accuracy and reliability

Downloads

Published

2024-10-29

Issue

Section

Articles