Spice Image Classification Based on Content-Based Image Retrieval - Meidy Fajar Wahyu; Lely Panca Andriyanto; Amin Hidayat; Achmad Sehan; Eko Sutono (Komunitas Dosen Indonesia, 2026)
Indonesia possesses exceptional spice biodiversity, yet public familiarity with the original visual characteristics of many spices is declining because of packaged processing, reduced direct exposure, and changing food-consumption patterns. This study develops RempahID, a web-based spice identification system that integrates Content-Based Image Retrieval (CBIR) with machine-learning classification. The study addresses the limited availability of Indonesian spice recognition systems that simultaneously provide class predictions and visually similar reference images for user verification. The system uses a dataset comprising ten major spice categories, including ginger, turmeric, galangal, aromatic ginger, cinnamon, cloves, nutmeg, coriander, candlenut, and star anise. Each image is preprocessed through resizing, normalization, noise reduction, and Otsu-based segmentation. Visual representation combines 24 Hue-Saturation-Value color histogram features, four Gray-Level Co-occurrence Matrix texture descriptors, and seven Hu Moment shape features, producing a 35-dimensional feature vector. Euclidean Distance is employed to rank visually similar database images, while K-Nearest Neighbors, Support Vector Machine, and Random Forest are compared for classification. Performance is evaluated using accuracy, precision, recall, and F1-score. The Support Vector Machine with a radial basis function kernel achieved the best result, with 92.1% accuracy, 0.91 precision, 0.92 recall, and a 0.91 F1-score. Retrieved reference images also supported transparent visual comparison rather than presenting an isolated predicted label alone. These findings demonstrate that integrating complementary color, texture, and shape descriptors within a CBIR framework provides an effective and interpretable approach for Indonesian spice identification.