Rice is the primary staple food and a source of carbohydrates for most people in Indonesia. Various types of rice available on the market have differences in shape, size, color, and texture. However, some rice varieties have similar characteristics, making the identification process through visual observation still quite difficult. This study was aimed at developing a rice classification program using the Convolutional Neural Network (CNN) method with the ResNet18 architecture based on digital images. The dataset used consisted of 3,120 images divided into six classes, namely Gentong, Naga Mas, Raja Merah, Setra Ramos Alfamart, SPHP, and Wong Tani rice. Before the training process, the images underwent preprocessing, including resizing to 256 × 256 pixels and data normalization. The model was trained using a transfer learning approach with a data split of 80% and 20% for testing. The results showed that the ResNet18 model achieved a training accuracy of 95.81% and a testing accuracy of 84.55%. Evaluation using a confusion matrix showed that the model was able to classify most rice varieties successfully, although several misclassifications were still found among rice varieties with similar shapes and textures. Based on these results, the Convolutional Neural Network (CNN) method with the ResNet18 architecture can be used to support the automatic recognition and classification of rice varieties.
Copyrights © 2026