Parallel CNN–Transformer Hybrid with Learnable Logit Fusion for Cocoa Pod Disease Classification
Main Article Content
Abstract
Black pod rot and cocoa pod borer reduce cocoa yield, yet field diagnosis relies on scarce expertise. This study designs a parallel hybrid that couples a ResNet50 branch with a transformer branch on ResNet50 feature maps and fuses their class scores through a learnable weight. It was compared with ResNet50 and ViT-B/16 for three-class pod classification (healthy, black pod rot, pod borer) on 2,500 public images, split 70:15:15 before augmenting the training set only. Test accuracy was 97.60% (hybrid), 97.33% (ResNet50), and 97.07% (ViT-B/16; n = 375). The gaps equal one or two images, the 95% Wilson intervals overlap almost completely, and no paired exact test could reach significance, so no model can be declared superior. The hybrid made the fewest errors that labeled a diseased pod healthy (2, against 3 and 7) but needed 2.4 times the parameters of ResNet50. Grad-CAM on the convolutional branch gave broad, sometimes off-target maps, whereas attention rollout on the transformer branch focused on small spots; both were inspected qualitatively only. The hybrid is a competitive design with a clear computational cost; choosing between architectures needs repeated runs and field validation.
Downloads
Article Details
Section

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
How to Cite
References
[1] V. S. Dewi et al., “The presence of beneficial insects and damage intensity of cocoa pod borer (Conopomorpha cramerella Snellen) in plantations with and without insectary plants,” J. Trop. Plant Pests Dis., vol. 25, no. 2, pp. 179–189, 2025, doi: 10.23960/j.hptt.225179-189.
[2] J. Liu and X. Wang, “Plant diseases and pests detection based on deep learning: A review,” Plant Methods, vol. 17, no. 1, Art. no. 22, Feb. 2021, doi: 10.1186/s13007-021-00722-9.
[3] S. P. Mohanty, D. P. Hughes, and M. Salathé, “Using deep learning for image-based plant disease detection,” Front. Plant Sci., vol. 7, Art. no. 1419, Sep. 2016, doi: 10.3389/fpls.2016.01419.
[4] K. S. Soh, E. G. Moung, K. J. J. Danker, J. A. Dargham, and A. Farzamnia, “Cocoa diseases classification using deep learning algorithm,” ITM Web Conf., vol. 63, Art. no. 01014, 2024, doi: 10.1051/itmconf/20246301014.
[5] N. P. Maylianti, I. G. N. L. Wijayakusuma, and I. P. C. A. Wiguna, “Comparison of EfficientNet-B0 and ResNet-50 for detecting diseases in cocoa fruit,” J. Appl. Informatics Comput., vol. 9, no. 1, 2025, doi: 10.30871/jaic.v9i1.8868.
[6] A. G. Pradana, D. R. I. M. Setiadi, and A. R. Muslikh, “Fine tuning model convolutional neural network EfficientNet-B4 dengan augmentasi data untuk klasifikasi penyakit kakao,” J. Inf. Syst. Appl. Dev., vol. 2, no. 1, pp. 1–11, Mar. 2024, doi: 10.26905/jisad.v2i1.11899.
[7] D. Anduyan, N. Cabillo, N. Gultiano, and M. P. Pacot, “Enhancing cocoa pod disease classification via transfer learning and ensemble methods: Toward robust predictive modeling,” arXiv:2504.12992, Apr. 2025.
[8] S. Kumar, A. K. Sharma, S. Srivastava, V. Tiwari, P. K. Patidar, and S. Rai, “Automated cocoa disease detection using convolutional neural networks: A case study of VSD and other pathogens,” in Proc. Int. Conf. Recent Adv. Modernization Sustain. Intell. Technol. Appl. (RAMSITA-2025), Adv. Intell. Syst. Res., vol. 192, 2025, doi: 10.2991/978-94-6463-716-8_29.
[9] A. Jesse, N. Y.-R. Douha, and P. Lenka, “Image classification for CSSVD detection in cacao plants,” arXiv:2405.04535, 2024.
[10] K. S. Kouassi, M. Diarra, K. H. Edi, and K. B. Jean-Claude, “Detection of cocoa pod diseases using a hybrid feature extractor combining CNN and vision transformer with dual classifier,” Edelweiss Appl. Sci. Technol., vol. 9, no. 1, pp. 668–681, 2025, doi: 10.55214/25768484.v9i1.4209.
[11] A. Dosovitskiy et al., “An image is worth 16×16 words: Transformers for image recognition at scale,” in Proc. Int. Conf. Learn. Represent. (ICLR), 2021, arXiv:2010.11929.
[12] H. Yunusa, S. Qin, A. H. A. Chukkol, A. A. Yusuf, I. Bello, and A. Lawan, “Exploring the synergies of hybrid CNNs and ViTs architectures for computer vision: A survey,” Eng. Appl. Artif. Intell., Art. no. 110057, 2025, doi: 10.1016/j.engappai.2025.110057.
[13] R. Azad et al., “Advances in medical image analysis with vision Transformers: A comprehensive review,” Med. Image Anal., vol. 91, Art. no. 103000, Jan. 2024, doi: 10.1016/j.media.2023.103000.
[14] G. Shandilya, S. Gupta, H. G. Mohamed, S. Bharany, A. U. Rehman, and S. Hussen, “Enhanced maize leaf disease detection and classification using an integrated CNN-ViT model,” Food Sci. Nutr., vol. 13, no. 7, Art. no. e70513, Jul. 2025, doi: 10.1002/fsn3.70513.
[15] P. S. Basnet and R. Chitrakar, “CNN-ViT hybrid for pneumonia detection: Theory and empiric on limited data without pretraining,” arXiv:2509.08586, Sep. 2025.
[16] Z. Cheng, Y. Wu, Y. Li, L. Cai, and B. Ihnaini, “A comprehensive review of explainable artificial intelligence (XAI) in computer vision,” Sensors, vol. 25, no. 13, Art. no. 4166, Jul. 2025, doi: 10.3390/s25134166.
[17] S. Stassin, V. Corduant, S. A. Mahmoudi, and X. Siebert, “Explainability and evaluation of vision transformers: An in-depth experimental study,” Electronics, vol. 13, no. 1, Art. no. 175, Jan. 2024, doi: 10.3390/electronics13010175.
[18] E. F. Muniroh, G. Safitri, S. D. Fadilah, and S. Sa’diyah, “Pemberdayaan kelompok tani melalui penyuluhan budidaya tanaman kakao dan pengendalian hama penyakit kakao,” Lembaran Masyarakat, vol. 6, no. 1, Jun. 2020, doi: 10.32678/lbrmasy.v6i1.3711.
[19] T. G. Dietterich, “Approximate statistical tests for comparing supervised classification learning algorithms,” Neural Comput., vol. 10, no. 7, pp. 1895–1923, Oct. 1998, doi: 10.1162/089976698300017197.
[20] K. He, X. Zhang, S. Ren, and J. Sun, “Deep residual learning for image recognition,” in Proc. IEEE Conf. Comput. Vis. Pattern Recognit. (CVPR), Las Vegas, NV, USA, 2016, pp. 770–778, doi: 10.1109/CVPR.2016.90.
[21] I. Loshchilov and F. Hutter, “Decoupled weight decay regularization,” in Proc. Int. Conf. Learn. Represent. (ICLR), 2019, arXiv:1711.05101.
[22] L. D. Brown, T. T. Cai, and A. DasGupta, “Interval estimation for a binomial proportion,” Stat. Sci., vol. 16, no. 2, pp. 101–133, May 2001, doi: 10.1214/ss/1009213286.
[23] 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,” Int. J. Comput. Vis., vol. 128, no. 2, pp. 336–359, Feb. 2020, doi: 10.1007/s11263-019-01228-7.
[24] S. Abnar and W. Zuidema, “Quantifying attention flow in transformers,” in Proc. 58th Annu. Meeting Assoc. Comput. Linguist. (ACL), 2020, pp. 4190–4197, doi: 10.18653/v1/2020.acl-main.385.