Transformer-Based Multi-Class Classification of Bangladeshi Rice Varieties Using Image Data
Source abstract
Abstract
Rice (Oryza sativa L.) is a staple food for over half of the global population, with significant economic, agricultural, and cultural importance, particularly in Asia. Thousands of rice varieties exist worldwide, differing in size, shape, color, and texture, making accurate classification essential for quality control, breeding programs, and authenticity verification in trade and research. Traditional manual identification of rice varieties is time-consuming, error-prone, and heavily reliant on expert knowledge. Deep learning provides an efficient alternative by automatically extracting discriminative features from rice grain images for precise classification. While prior studies have primarily employed deep learning models such as CNN, VGG, InceptionV3, MobileNet, and DenseNet201, transformer-based models remain underexplored for rice variety classification. This study addresses this gap by applying two deep learning models such as Swin Transformer and Vision Transformer for multi-class classification of rice varieties using the publicly available PRBD dataset from Bangladesh. Experimental results demonstrate that the ViT model achieved an accuracy of 99.86% with precision, recall, and F1-score all at 0.9986, while the Swin Transformer model obtained an accuracy of 99.44% with a precision of 0.9944, recall of 0.9944, and F1-score of 0.9943. These results highlight the effectiveness of transformer-based models for high-accuracy rice variety classification.
Source: crossref · Quality: baseline
Research context
OpenAlex topics: Smart Agriculture and AI · Spectroscopy and Chemometric Analyses · Advanced Neural Network Applications
SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.
Affiliations
Department of Science and Industry Systems, University of South-Eastern Norway, 3616 Kongsberg, Norway
References (25)
Show source-provided references
1. FAOSTAT (2024). Rice Market Monitor, Food and Agriculture Organization (FAO). Available online: https://www.fao.org/faostat/en/.
2. Artificial Intelligence-based Rice Variety Classification: A State-of-the-art Review and Future Directions10.1016/j.atech.2025.100788 ↗
3. A visual dataset for recognition of rice varieties10.1016/j.dib.2024.110442 ↗
4. Precision in Rice Variety Classification using Stacking-based Ensemble Learning10.1016/j.jcs.2025.104128 ↗
5. Grain by grain: A microscopic image dataset of rice varieties from Bangladeshi rice markets10.1016/j.dib.2025.112058 ↗
6. Exploration of using acoustic vibration technology to non-destructively detect moldy kernels of in-shell hickory nuts (Carya cathayensis Sarg.)10.1016/j.compag.2023.108137 ↗
7. Tabassum, I., and Nunavath, V. (2024). A Hybrid Deep Learning Approach for Multi-Class Cyberbullying Classification Using Multi-Modal Social Media Data. Appl. Sci., 14.10.20944/preprints202411.0392.v1 ↗
8. A deep learning approach for multi-class classification of air quality from image data10.69517/cser.2025.02.01.0003 ↗
9. Tahsin, M., Isat Mahazabin, K., Rabbani Nuha, M.B., Rahman Efad, A., Mariya Rahman Momo, M.R.M., and Niloy, N.T. (2026, January 22). PRBD: Microscopic Image of Different Processed Rice Varieties of Bangladesh. Available online: https://data.mendeley.com/datasets/sfp9s96prh/1.
10. Rice Variety Classification Using Next Generation Convolutional Networks10.1049/tje2.70102 ↗
11. Morphological features for multi-model rice grain classification10.11591/ijece.v15i3.pp3212-3225 ↗
12. Classification of morphologically similar Indian rice variety using machine learning algorithms10.11591/ijece.v15i3.pp3202-3211 ↗
13. Kernel to Computation: Identifying Optimal Feature set for Red Rice Classification10.1016/j.atech.2025.101065 ↗
14. Priya, P.K., Kirupa, P., Thilakaveni, P., Devi, K.N., Mahabooba, M., and Jayachitra, S. (2024, January 23–25). DeepRiceTransfer: Exploiting CNN Transfer Learning for Effective Rice Variety Classification. Proceedings of the 2024 International Conference on Social and Sustainable Innovations in Technology and Engineering (SASI-ITE), Tadepalligudem, India.
15. Rajora, R., Banerjee, D., Upadhyay, D., Dangi, S., and Rajora, A. (2024, January 23–25). Integrated CNN-Random Forest Model for Accurate Rice Variety Classification. Proceedings of the 2024 4th Asian Conference on Innovation in Technology (ASIANCON), Pune, India.10.1109/ASIANCON62057.2024.10837759 ↗
16. Deepika, S., and Arunachalam, V. (2024, January 3–4). Design of Multi-Class Optimized Lightweight Convolution Neural Network for Rice Classification. Proceedings of the 2024 Seventh International Women in Data Science Conference at Prince Sultan University (WiDS PSU), Riyadh, Saudi Arabia.10.1109/WiDS-PSU61003.2024.00017 ↗
17. Rice Category Identification through Deep Transfer Learning Features and Machine Learning Classifiers: An Intelligent Approach
18. RiceNet: Convolutional neural networks-based model to classify Pakistani grown rice seed types10.1007/s00530-021-00760-2 ↗
19. Mamun, M.A.A., Karim, S.R.I., Sarkar, M.I., and Alam, M.Z. (2026, January 22). Evaluating the Efficacy of Hybrid Deep Learning Models in Rice Variety Classification. Available online: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=4749601.
20. Hossain, N., Sabbir Hossain, M., Islam, R., and Rahman, R. (2024, January 17–18). Rice Grain Classification and Automated Quality Control Using Deep Learning Approaches. Proceedings of the 3rd International Conference on Computing Advancements, Dhaka, Bangladesh.10.1145/3723178.3723299 ↗
21. Liu, Z., Lin, Y., Cao, Y., Hu, H., Wei, Y., Zhang, Z., Lin, S., and Guo, B. (2021, January 11–17). Swin transformer: Hierarchical vision transformer using shifted windows. Proceedings of the IEEE/CVF International Conference on Computer Vision, Montreal, QC, Canada.10.1109/ICCV48922.2021.00986 ↗
22. Yuan, L., Chen, Y., Wang, T., Yu, W., Shi, Y., Jiang, Z.H., Tay, F.E., Feng, J., and Yan, S. (2021, January 11–17). Tokens-to-token vit: Training vision transformers from scratch on imagenet. Proceedings of the IEEE/CVF International Conference on Computer Vision, Montreal, QC, Canada.10.1109/ICCV48922.2021.00060 ↗
23. A saliency map in primary visual cortex10.1016/S1364-6613(00)01817-9 ↗
24. EvidentlyAI (2024, December 18). Multi-Class Classification Metrics. Available online: https://www.evidentlyai.com/classification-metrics/multi-class-metrics#accuracy-in-multi-class.
25. Xie, C., Liu, S., Li, C., Cheng, M.M., Zuo, W., Liu, X., Wen, S., and Ding, E. (November, January 27). Image inpainting with learnable bidirectional attention maps. Proceedings of the IEEE/CVF International Conference on Computer Vision, Seoul, Republic of Korea.