This study aims to develop an automatic classification model using digital images to assess the quality of cocoa fruit more accurately and efficiently compared to manual methods: The methodology includes image preprocessing, feature extraction of color (mean R, G, B converted to H, S, V) and shape (area, perimeter, aspect ratio, and circularity), followed by splitting the dataset into training, validation, and testing sets with a proportion of 70:15:15. Two machine learning algorithms, namely Support Vector Machine (SVM) and Random Forest (RF), are used to classify cocoa fruit into three quality classes: ripe, unripe, and rotten. The training process is conducted using optimal hyperparameter tuning through Grid Search, specifically with 3-fold cross-validation. The results show that the combination of color and shape features provides the best accuracy of 96%. Therefore, the Random Forest model demonstrates better performance in the developed classification system. The resulting model has the potential to be applied as a decision-support system for automatics and consistent cocoa fruit quality assessment in agricultural or industrial settings.
Copyrights © 2026