Latency-Aware Cross-Domain Rice Variety Classification
Main Article Content
Abstract
Accurate rice variety classification is essential for quality control, seed authentication, and agricultural supply chain management. Although deep learning methods have achieved high classification accuracy, most existing studies overlook domain shifts, deployment efficiency, and model interpretability. This paper proposes a latency-aware cross-domain rice variety classification framework that integrates proxy-domain grouping, GroupK-Fold evaluation, pretrained CNN feature extractors, PCA-based dimensionality reduction, classical machine learning classiers, and explainability analysis. A sensitivity analysis was conducted to determine the optimal proxy-domain configuration and feature dimensionality. Experimental results across four publicly available rice datasets showed that K = 5 provided the most suitable proxy-domain structure for domain-aware validation, while PCA with 150 components retained approximately 99.08% of the original variance and achieved the best cross-domain performance. Among the evaluated backbones, ResNet50 with partial fine-tuning consistently produced the strongest robustness under domain shifts, whereas EfficientNetB0 frequently achieved the highest official test performance. The proposed framework attained weighted F1-scores of up to 0.999 on the official test sets, with 95% bootstrap confidence intervals confirming result reliability. Latency benchmarking across CPU, GPU, and TensorFlow Lite environments revealed that TensorFlow Lite reduced inference latency from approximately 150280 ms to 58 ms per image, supporting efficient edge deployment. Furthermore, Pareto frontier analysis identified MobileNetV3Small as a highly competitive deployment-oriented backbone, while Grad-CAM analysis indicated that most remaining classification errors were associated with visually similar rice varieties. Overall, the proposed framework provides a robust, efficient, and interpretable solution for rice variety classification under realistic domain-shift conditions.
Article Details

This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
References
M. M. Islam, M. S. Islam, M. G. Moazzam and M. S. Uddin, “A comprehensive deep learning framework for rice variety classification with real-time deployment,” Smart Agricultural Technology, vol. 13, p. 101710, 2026.
P. Saxena, K. Priya, S. Goel, P. K. Aggarwal, A. Sinha and P. Jain, “Rice varieties classification using machine learning algorithms,” Journal of Pharmaceutical Negative Results , vol. 13, no. 7, pp. 3762–3772, 2022.
M. J. Iqbal et al., “On application of lightweight models for rice variety classification and their potential in edge computing,” Foods, vol. 12, no. 21, pp. 1–16, 2023.
M. J. Asif et al., “Exploring Convolutional Neural Networks for Rice Grain Classification: An Explainable AI Approach,” 2025 International Conference on Frontiers of Information Technology (FIT), Islamabad, Pakistan, pp. 1-6, 2025.
A. Rahman and S. Lee, “Rice seed varieties classified using diffusion convolutional neural networks,” 2024. [Online]. Available:https://sensors.myu-group.co. jp/sm_pdf/SM4066.pdf.
S. Hazra, S. Karforma, A. Bandyopadhyay, A. Banerjee and D. Chakraborty, “Deep learning-based classification of rice varieties: A comprehensive study,” Journal of Survey in Fisheries Sciences, vol. 10, no. 3, pp. 411–419, 2023. [Online]. Available: https://www.researchgate. net/publication/385142789.
M. Koklu, I. Cinar and Y. S. Taspinar, “Classification of rice varieties with deep learning methods,” Computers and Electronics in Agriculture, 2021.
M. Tasci, A. Istanbullu, S. Kosunalp, T. Iliev, I. Stoyanov and I. Beloev, “An efficient classification of rice variety with quantized neural networks,” Electronics, vol. 12, no. 10, pp. 1–16, 2023.
I. Gulrajani and D. Lopez-Paz, “In search of lost domain generalization,” in Proc. Int. Conf. Learning Representations (ICLR), pp. 1– 29, 2020.
P. W. Koh et al., “WILDS: A benchmark of in-the-wild distribution shifts,” in Proc. 38th Int. Conf. Machine Learning (ICML), 2021, pp. 5637–5664. [Online]. Available:https:// proceedings.mlr.press/v139/koh21a.html.
R. R. Selvaraju, M. Cogswell, A. Das, R. Vedantam, D. Parikh and D. Batra, “Grad-CAM: Visual explanations from deep networks via gradient-based localization,” International Journal of Computer Vision, 2020.
M. Ryo, “Explainable artificial intelligence and interpretable machine learning for agricultural data analysis,” Artificial Intelligence in Agriculture, vol. 6, pp. 257–265, 2022.
V. T. Hoang, D. P. Van Hoai, T. Surinwarangkoon, H.-T. Duong and K. Meethongjan, “A comparative study of rice variety classification based on deep learning and hand-crafted features,” ECTI Transactions on Computer and Information Technology (ECTI-CIT), vol. 14, no. 1, pp. 1–10, 2020.
G. M. S. Islam, M. M. Himel, M. G. Moazzam and M. S. Uddin, “An image dataset of rice varieties,” Mendeley Data. [Online]. Available:https://data.mendeley.com/ datasets/3mn9843tz2/3.
M. Tahsin et al., “An extensive image dataset for classifying rice varieties in Bangladesh,” Mendeley Data, ver. 1, 2024.
N. Rathnayake, A. Miyazaki, T. L. Dang, and Y. Hoshino, “Age classification of rice seeds in Japan using gradient-boosting and ANFIS algorithms,” Sensors, vol. 23, Art. no. 2828, 2023.
I. Cinar and M. Koklu, “Identification of rice varieties using machine learning algorithms,” Journal of Agricultural Science, vol. 28, no. 2, pp. 307–325, 2022.
S. Sagawa, T. B. Hashimoto, P. W. Koh and P. Liang, “Distributionally robust neural networks for group shifts: On the importance of regularization for worst-case generalization,” in Proc. Int. Conf. Learning Representations (ICLR), 2020, pp. 1–19. [Online]. Available:https:// arxiv.org/abs/1911.08731.
J. G. A. Barbedo, “Factors influencing the use of deep learning for plant disease recognition,” Biosystems Engineering, 2018.
S. Gururangan et al., “Scaling expert language models with unsupervised domain discovery,” arXiv preprint arXiv:2303.14177, 2023.
M. M. Islam, G. M. S. Himel, M. G. Moazzam and M. S. Uddin, “Artificial intelligence-based rice variety classification: A state-of-the-art review and future directions,” Smart Agricultural Technology, vol. 10, Art. no. 100788, 2025.
M. Wang, B. Zheng, G. Wang, J. Yang, J. Lu and W. Zhang, “A principal component analysisbased feature optimization network for few-shot fine-grained image classification,” Mathematics, vol. 13, no. 7, Art. no. 1098, 2025.
W. Jia, M. Sun, J. Lian, and S. Hou, “Feature dimensionality reduction: A review,” Complex & Intelligent Systems, vol. 8, no. 3, pp. 2663–2693, 2022.
I. T. Jolliffe and J. Cadima, “Principal component analysis: A review and recent developments,” Philosophical Transactions of the Royal Society A, vol. 374, no. 2065, Art. no. 20150202, 2016.
K. Simonyan and A. Zisserman, “Very deep convolutional networks for large-scale image recognition,” in Proc. 3rd Int. Conf. Learning Representations (ICLR), pp. 1–14, 2015.
S. Raschka, “Model evaluation, model selection, and algorithm selection in machine learning,” arXiv preprint arXiv:1811.12808, 2020.
T. Gill, S. K. Gill, D. K. Saini, Y. Chopra, J. P. de Koff and K. S. Sandhu, “A comprehensive review of high throughput phenotyping and machine learning for plant stress phenotyping,” Phenomics, vol. 2, no. 3, pp. 156–183, 2022.
Y. Bengio, A. Courville and P. Vincent, “Representation Learning: A Review and New Perspectives,” in IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 35, no. 8, pp. 1798-1828, Aug. 2013.
M. Tan and Q. V. Le, “EfficientNet: Rethinking model scaling for convolutional neural networks,” in Proc. 36th Int. Conf. Machine Learning (ICML), 2019.
K. He, X. Zhang, S. Ren and J. Sun, “Deep Residual Learning for Image Recognition,” 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Las Vegas, NV, USA, pp. 770-778, 2016.
D. Hendrycks and K. Gimpel, “Gaussian error linear units (GELUs),” arXiv preprint arXiv:1606.08415, 2016.
G. H. Martono and N. Sulistianingsih, “Finetuning transformer models for emotion detection in Indonesian tweets indicating depression,” Vietnam Journal of Computer Science, pp. 1–22, 2025.
E. Njor, C. Banbury and X. Fafoutis, “Fast data aware neural architecture search via supernet accelerated evaluation,” arXiv preprint arXiv:2502.12690, 2025.
A. Kamilaris and F. X. Prenafeta-Bold´u, “Deep learning in agriculture: A survey,” Computers and Electronics in Agriculture, vol. 147, pp. 70– 90, 2018.
R. Linero-Ramos, C. Parra-Rodr´ıguez and M. Gongora, “SVMobileNetV2: A hybrid and hierarchical CNN-SVM network architecture utilising UAV-based multispectral images and IoT nodes for the precise classification of crop diseases,” AgriEngineering, vol. 7, no. 10, Art. no. 341, 2025.
H. Jalil, A. Qazi, and A. Iqbal, “NeuRN: Neuroinspired domain generalization for image classification,” in Proc. AAAI Conf. Artificial Intelligence, pp. 1–14, 2025.
I. H. Rather, S. Kumar and A. H. Gandomi, “Breaking the data barrier: A review of deep learning techniques for democratizing AI with small datasets,” Artificial Intelligence Review, vol. 57, no. 9, 2024.
S. Zhao, M. Gong, T. Liu, H. Fu and D. Tao, “Domain generalization via entropy regularization,” in Advances in Neural Information Processing Systems, vol. 33, 2020, pp. 16096–16107.
T. Matsuura and T. Harada, “Domain generalization using a mixture of multiple latent domains,” in Proc. AAAI Conf. Artificial Intelligence, vol. 34, no. 7, 2020, pp. 11749–11756.
Z. Cheng, M. Liu, D. Yang, Z. Zhao, C. Yan and S. Wang, “Domain generalization for image classification with dynamic decision boundary,” Pattern Recognition, 2025.
B. Efron and R. Tibshirani, “The bootstrap method for assessing statistical accuracy,” Behaviometrika, vol. 17, pp. 1–35, 1985.
J. Demˇsar, “Statistical comparisons of classifiers over multiple data sets,” Journal of Machine Learning Research, vol. 7, pp. 1–30, 2006.
A. Howard et al., “Searching for MobileNetV3,” in Proc. IEEE/CVF Int. Conf. Computer Vision (ICCV), 2019, pp. 1314–1324.
A. Bailly et al., “Effects of dataset size and interactions on the prediction performance of logistic regression and deep learning models,” Computer Methods and Programs in Biomedicine, vol. 213, Art. no. 106504, 2022.
M. U. I. Tamim, S. A. Hamim, S. Malik, M. F. Mridha and S. Mahmood, “InsightNet: A deep learning framework for enhanced plant disease detection and explainable insights,” Plant Direct, vol. 9, no. 7, pp. 1–18, 2025.