International Journal of Applied Mathematics and Computing.
Vol. 3 No. 4 (2026): October: International Journal of Applied Mathematics and Computing

Hybrid ResNet-50 and Support Vector Machine Model for Indonesian Spice Image Classification

Renaldi Pratama (Mulawarman University)
Hamdani Hamdani (Mulawarman University)
Addy Suyatno (Mulawarman University)



Article Info

Publish Date
14 Nov 2026

Abstract

Indonesia's culinary, health, and cosmetics industries depend on accurate spice identification, yet many species share similar color, texture, and shape, and manual identification still relies on individual experience that is prone to error. Convolutional neural networks (CNNs) have automated comparable visual recognition tasks, but a prior study on Indonesian spice images reported that ResNet-50 with its built-in softmax classifier reached only 44.7% F1-score, far below Xception's 96.99% on the same data, indicating that the softmax layer underused the depth of ResNet-50's extracted features. This study builds and evaluates a hybrid model that pairs ResNet-50 as a feature extractor with a Support Vector Machine (SVM) as the final classifier for Indonesian spice images. A pretrained ResNet-50 produced 2,048-dimensional feature vectors from its Global Average Pooling layer; Principal Component Analysis (PCA) reduced the vectors while retaining 95% of cumulative variance; and an SVM with a Radial Basis Function kernel, tuned through 5-fold GridSearchCV under a One-vs-Rest strategy, classified 31 classes, 30 spice types plus one rejection class for non-spice images. The dataset, 6,510 images collected from Kaggle, was evaluated under two split ratios, 80:10:10 and 70:15:15, to examine how the training-validation-test proportion affects performance. On the held-out test set, the 80:10:10 split reached 91.55% accuracy, 92.03% precision, 91.55% recall, and a 91.49% F1-score, while the 70:15:15 split reached 90.74% accuracy, 91.36% precision, 90.74% recall, and a 90.75% F1-score, a gap of only 0.81 percentage points. Both scenarios classified a single image in under 4 milliseconds on CPU once features were extracted. Misclassifications concentrated among visually similar rhizomes and small seeds, such as coriander seed-black pepper and ginger-galangal pairs. These results indicate that replacing ResNet-50's softmax layer with an SVM classifier yields an accurate, fast, and scalable approach for large-scale Indonesian spice recognition.

Copyrights © 2026






Journal Info

Abbrev

IJAMC

Publisher

Subject

Computer Science & IT Mathematics

Description

This Journal accepts manuscripts based on empirical research, both quantitative and qualitative. This journal is a peer-reviewed and open access journal of Mathematics and ...