An Attention based Vision Transformer for the Detection of Insect Pests in Castor Crop
Abstract
Castor (Ricinus communis L.) is a significant crop valued for its non-edible oil, yet its economic importance is compromised by insect pests causing substantial yield losses of 35-40%. This paper explores the efficiency of utilization of vision transformers for efficient pest classification. We propose CASTIPestViT, a Vision Transformer-based model specifically designed for insect pest detection in castor crops. The model integrates transfer learning and fine-tuning mechanisms, leveraging a pre-trained Vision Transformer (ViT) initially trained on ImageNet1k, and is fine-tuned on a custom dataset of castor insect pests. CASTIPestViT uses the self-attention mechanism of ViTs to capture global and local features of insect pests. The performance of CASTIPestViT is compared with six different pre-trained CNN models. The results obtained by the proposed model achieve a validation accuracy of 97.60% in insect pest detection and outperforming other state-of-the-art models in terms of precision, accuracy, and f1-score. The model offers a robust solution in early-stage insect pest detection to reduce yield losses. The efficiency and accuracy of the model make it suitable in sustainable crop management and smart agriculture systems for yield optimization.
Downloads
References
K. L. Manjunatha, P. C. Ganiger, and C. R. J. Basha, Population dynamics of pests infesting castor and their natural enemies in Southern Karnataka, J. Entomol. Zool. Stud., vol. 7, no. 1, pp. 238–243, 2019.
B. Dan, X. Sun, and L. Liu, Diseases and pests identification of Lycium barbarum using SE-MobileNet V2 algorithm, 12th International Symposium on Computational Intelligence and Design (ISCID), Hangzhou, China, pp. 121–125, 2019. https://doi.org/10.1109/ISCID.2019.00034
T. Stackhouse, S. L. Boggess, D. Hadziabdic, R. N. Trigiano, M. D. Ginzel, and W. E. Klingeman, Conventional gel electrophoresis and TaqMan probes enable rapid confirmation of thousand cankers disease from diagnostic samples, Plant Dis., vol. 105, no. 10, pp. 3171–3180, 2021. https://doi.org/10.1094/PDIS-10-20-2258-RE
A. Fauzi, I. Syarif, and T. Badriyah, Development of a mobile application for plant disease detection using parameter optimization method in convolutional neural networks algorithm, EMITTER International Journal of Engineering Technology, vol. 11, no. 2, pp. 192–213, 2023. https://doi.org/10.24003/emitter.v11i2.808
M. Chithambarathanu and M. K. Jeyakumar, Survey on crop pest detection using deep learning and machine learning approaches, Multimed. Tools Appl., 2023. https://doi.org/10.1007/s11042-023-15221-3
L. M. Tassis, J. E. de-Souza, and R. A. Krohling, A deep learning approach combining instance and semantic segmentation to identify diseases and pests of coffee leaves from in-field images, Comput. Electron. Agric., vol. 186, p. 106191, 2021. https://doi.org/10.1016/j.compag.2021.106191
N. Dong, Q. Feng, J. Chang et al., White blood cell classification based on a novel ensemble convolutional neural network framework, J. Supercomput., 2023. https://doi.org/10.1007/s11227-023-05490-y
F. Deng, W. Mao, Z. Zeng, H. Zeng, and B. Wei, Multiple diseases and pests detection based on federated learning and improved Faster R-CNN, IEEE Trans. Instrum. Meas., vol. 71, pp. 1–11, 2022. https://doi.org/10.1109/TIM.2022.3201937
S. CK, J. CD, and N. Patil, Cardamom plant disease detection approach using EfficientNetV2, IEEE Access, vol. 10, pp. 789–804, 2022. https://doi.org/10.1109/ACCESS.2021.3138920
L. Alzubaidi, J. Zhang, A. J. Humaidi et al., Review of deep learning: Concepts, CNN architectures, challenges, applications, future directions, J. Big Data, vol. 8, p. 53, 2021. https://doi.org/10.1186/s40537-021-00444-8
P. Venkatasaichandrakanth and M. Iyapparaja, Pest detection and classification in peanut crops using CNN, MFO, and EViTA algorithms, IEEE Access, vol. 11, pp. 54045–54057, 2023. https://doi.org/10.1109/ACCESS.2023.3281508
A. Chougui, A. Moussaoui, and A. Moussaoui, Plant-leaf diseases classification using CNN, CBAM and Vision Transformer, 5th International Symposium on Informatics and its Applications (ISIA), M'sila, Algeria, pp. 1–6, 2022. https://doi.org/10.1109/ISIA55826.2022.9993601
Y. Peng and Y. Wang, CNN and transformer framework for insect pest classification, Ecol. Inform., vol. 72, p. 101846, 2022. https://doi.org/10.1016/j.ecoinf.2022.101846
L. Wu, Z. Liu, T. Bera et al., A deep learning model to recognize food contaminating beetle species based on elytra fragments, Comput. Electron. Agric., vol. 166, p. 105002, 2019. https://doi.org/10.1016/j.compag.2019.105002
Y. Qing, F. Jin, T. Jian et al., Development of an automatic monitoring system for rice light-trap pests based on machine vision, J. Integr. Agric., vol. 19, no. 10, pp. 2500–2513, 2020. https://doi.org/10.1016/S2095-3119(20)63168-9
C. Dong, Z. Zhang, J. Yue, and L. Zhou, Automatic recognition of strawberry diseases and pests using convolutional neural network, Smart Agric. Technol., vol. 1, p. 100009, 2021. https://doi.org/10.1016/j.atech.2021.100009
C. Muppala and V. Guruviah, Detection of leaf folder and yellow stemborer moths in the paddy field using deep neural network with search and rescue optimization, Inf. Process. Agric., vol. 8, no. 2, pp. 350–358, 2021. https://doi.org/10.1016/j.inpa.2020.09.002
D. Zhu, L. Z. Xie, B. X. Chen et al., Knowledge graph and deep learning based pest detection and identification system for fruit quality, Internet Things, vol. 21, p. 100649, 2023. https://doi.org/10.1016/j.iot.2022.100649
Z. Dongmei, W. Ke, G. Hongbo et al., Classification and identification of citrus pests based on InceptionV3 convolutional neural network and migration learning, International Conference on Internet of Things and Intelligent Applications (ITIA), Zhenjiang, China, pp. 1–7, 2020. https://doi.org/10.1109/ITIA50152.2020.9312359
S. Li, H. Wang, C. Zhang, and J. Liu, A self-attention feature fusion model for rice pest detection, IEEE Access, vol. 10, pp. 84063–84077, 2022. https://doi.org/10.1109/ACCESS.2022.3194925
Y. Zhang and Y. P. Liu, Identification of navel orange diseases and pests based on the fusion of DenseNet and self-attention mechanism, Comput. Intell. Neurosci., vol. 2021, p. 5436729, 2021. https://doi.org/10.1155/2021/5436729
A. Berka, A. Hafiane, Y. Es-Saady et al., CactiViT: Image-based smartphone application and transformer network for diagnosis of cactus cochineal, Artif. Intell. Agric., vol. 9, pp. 12–21, 2023. https://doi.org/10.1016/j.aiia.2023.07.002
Nitin, S. B. Gupta, R. Yadav, F. Bovand, and P. K. Tyagi, Developing precision agriculture using data augmentation framework for automatic identification of castor insect pests, Front. Plant Sci., vol. 14, p. 1101943, 2023. https://doi.org/10.3389/fpls.2023.1101943
A. Dosovitskiy, L. Beyer, A. Kolesnikov et al., An image is worth 16×16 words: Transformers for image recognition at scale, arXiv preprint arXiv:2010.11929, 2020. https://doi.org/10.48550/arXiv.2010.11929
A. Alnafjan and M. Aldayel, Visual similarity detection for intellectual property using deep transfer learning, EMITTER International Journal of Engineering Technology, vol. 13, no. 2, pp. 173–197, 2025. https://doi.org/10.24003/emitter.v13i2.852
J. Deng, W. Dong, R. Socher, L. J. Li, K. Li, and L. Fei-Fei, ImageNet: A large-scale hierarchical image database, 2009 IEEE Conference on Computer Vision and Pattern Recognition, Miami, FL, USA, pp. 248–255, 2009. https://doi.org/10.1109/CVPR.2009.5206848
S. F. Stefenon, L. O. Seman, A. C. R. Klaar, R. G. Ovejero, and V. R. Q. Leithardt, Hypertuned-YOLO for interpretable distribution power grid fault location based on EigenCAM, Ain Shams Eng. J., vol. 15, no. 6, p. 102722, 2024. https://doi.org/10.1016/j.asej.2024.102722
N. Yadav, S. B. Gupta, and R. K. Yadav, Comparative analysis of first-order optimization algorithms, in Artificial Intelligence and Speech Technology, CRC Press (Boca Raton), pp. 279–289, 2021. https://doi.org/10.1201/9781003150664-32
M. L. Huang, T. C. Chuang, and Y. C. Liao, Application of transfer learning and image augmentation technology for tomato pest identification, Sustain. Comput. Inform. Syst., vol. 33, p. 100646, 2022. https://doi.org/10.1016/j.suscom.2021.100646
K. Simonyan and A. Zisserman, Very deep convolutional networks for large-scale image recognition, 3rd International Conference on Learning Representations (ICLR), pp. 1–14, 2015. https://doi.org/10.48550/arXiv.1409.1556
X. Cheng, Y. Zhang, Y. Chen, Y. Wu, and Y. Yue, Pest identification via deep residual learning in complex background, Comput. Electron. Agric., vol. 141, pp. 351–356, 2017. https://doi.org/10.1016/j.compag.2017.08.005
M. M. Leonardo, T. J. Carvalho, E. Rezende, R. Zucchi, and F. A. Faria, Deep feature-based classifiers for fruit fly identification (Diptera: Tephritidae), 31st Conference on Graphics, Patterns and Images (SIBGRAPI), pp. 41–47, 2018. https://doi.org/10.1109/SIBGRAPI.2018.00012
S. Xing and M. Lee, A study of tangerine pest recognition using advanced deep learning methods, Preprints, 2018. https://doi.org/10.20944/preprints201811.0161.v1
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), pp. 770–778, 2016. https://doi.org/10.1109/CVPR.2016.90
J. Almryad and H. Kutucu, Automatic identification for field butterflies by convolutional neural networks, Eng. Sci. Technol. Int. J., vol. 23, no. 1, pp. 189–195, 2020. https://doi.org/10.1016/j.jestch.2020.01.006
C. Szegedy, V. Vanhoucke, S. Ioffe, J. Shlens, and Z. Wojna, Rethinking the inception architecture for computer vision, 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 2818–2826, 2016. https://doi.org/10.1109/CVPR.2016.308
Y. Li, H. Wang, L. M. Dang, A. Sadeghi-Niaraki, and H. Moon, Crop pest recognition in natural scenes using convolutional neural networks, Comput. Electron. Agric., vol. 169, p. 105174, 2020. https://doi.org/10.1016/j.compag.2019.105174
D. Ozdemir and M. S. Kunduraci, Comparison of deep learning techniques for classification of the insects in order level with mobile software application, IEEE Access, vol. 10, pp. 35675–35684, 2022. https://doi.org/10.1109/ACCESS.2022.3163380
Copyright (c) 2026 EMITTER International Journal of Engineering Technology

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
The copyright to this article is transferred to Politeknik Elektronika Negeri Surabaya(PENS) if and when the article is accepted for publication. The undersigned hereby transfers any and all rights in and to the paper including without limitation all copyrights to PENS. The undersigned hereby represents and warrants that the paper is original and that he/she is the author of the paper, except for material that is clearly identified as to its original source, with permission notices from the copyright owners where required. The undersigned represents that he/she has the power and authority to make and execute this assignment. The copyright transfer form can be downloaded here .
The corresponding author signs for and accepts responsibility for releasing this material on behalf of any and all co-authors. This agreement is to be signed by at least one of the authors who have obtained the assent of the co-author(s) where applicable. After submission of this agreement signed by the corresponding author, changes of authorship or in the order of the authors listed will not be accepted.
Retained Rights/Terms and Conditions
- Authors retain all proprietary rights in any process, procedure, or article of manufacture described in the Work.
- Authors may reproduce or authorize others to reproduce the work or derivative works for the author’s personal use or company use, provided that the source and the copyright notice of Politeknik Elektronika Negeri Surabaya (PENS) publisher are indicated.
- Authors are allowed to use and reuse their articles under the same CC-BY-NC-SA license as third parties.
- Third-parties are allowed to share and adapt the publication work for all non-commercial purposes and if they remix, transform, or build upon the material, they must distribute under the same license as the original.
Plagiarism Check
To avoid plagiarism activities, the manuscript will be checked twice by the Editorial Board of the EMITTER International Journal of Engineering Technology (EMITTER Journal) using iThenticate Plagiarism Checker and the CrossCheck plagiarism screening service. The similarity score of a manuscript has should be less than 25%. The manuscript that plagiarizes another author’s work or author's own will be rejected by EMITTER Journal.
Authors are expected to comply with EMITTER Journal's plagiarism rules by downloading and signing the plagiarism declaration form here and resubmitting the form, along with the copyright transfer form via online submission.
