Deep Learning Models for Defect Identification in Oryza sativa Rice Grains: A Comparative Study
Yasiel Pérez Vera, Melissa Kristel Chambi Flores, Santiago Alonso Avilés Córdova, Irvin Estuardo Cazorla Macedo, Percy Aarón Luján Biamonte, Edgardo Alfredo Rivero CallohuancaManual classification of rice grain defects remains a persistent challenge in the Peruvian rice industry, as it relies heavily on human inspection, leading to variability, inconsistency, and reduced efficiency when processing large volumes of product. This study evaluates the effectiveness of transfer learning and convolutional neural networks (CNNs) for the automatic classification of four rice grain categories relevant to quality assessment: Whole, Stained, Broken, and Chalky. A dataset comprising 6599 RGB images was employed. To ensure a reliable evaluation protocol, the dataset was first partitioned into training (70%), validation (15%), and test (15%) subsets, after which data augmentation was independently applied within each partition to balance class distributions. Five pretrained CNN architectures were evaluated: MobileNetV2, EfficientNetB0, ResNet50, DenseNet121, and InceptionV3, all of which share a common classification head. Models were trained using transfer learning and early stopping based on validation loss. Performance was assessed using accuracy, precision, recall, F1-score, confusion matrices, 95% confidence intervals, and pairwise McNemar statistical tests. The results showed that ResNet50 achieved the highest classification accuracy (84.71%), followed by EfficientNetB0 (83.60%) and DenseNet121 (83.20%). Statistical analysis indicated that performance differences among the top-performing architectures were relatively small, with significant differences observed only for selected model pairs. Across all evaluated models, the discrimination between Whole and Chalky grains remained the most challenging classification task due to their high visual similarity. Overall, the findings demonstrate that transfer learning-based CNNs provide an effective and scalable approach for automated rice grain defect identification and quality assessment in agricultural environments.