Work

Performance Analysis of CNN and Transformers Models with Weighted Ensemble for Agricultural Pest Image Classification

Year: 2026
Type: article
Abstract: Insect pests cause large and recurring crop losses, and manual identification in the field is slow and needs entomological expertise.This paper compares a convolutional network (ResNet50) with two vision transformers (ViT-B/16 and Swin-B) for fine-grained pest recognition on IP102, a public benchmark of 75,222 images in 102 classes with a strongly long-tailed class distribution.All three models are fine-tuned from ImageNet-pretrained weights under one shared, short (six-epoch) training protocol and evaluated once on the official 22,619-image test split.We then combine them by weighted soft voting, with the weights tuned only on the validation split.Swin-B is the best single model, with 76.29% top 1 accuracy and 0.684 macro F1, narrowly ahead of ViT-B/16 (75.90%,McNemar 𝑝 = 0.046) and well ahead of ResNet50 (70.67%).The ensemble reaches 77.09% top 1 accuracy (95% bootstrap CI 76.57-77.65%),94.77% top 5 accuracy and 0.694 macro F1, a significant gain over Swin-B (McNemar 𝑝 < 10 -12 ).Validation-based weight tuning assigned ResNet50 a weight of zero, so the final ensemble combines the two transformers.All three models fail on the same 18.0% of test images, per-class F1 rises with the number of training images (Spearman 𝜌 ≈ 0.30-0.33),and the most frequent errors are between closely related species and between life stages of the same pest.Code, configurations and all predictions are released for reproducibility.
Source: IJARCCE
Language: English
Subfield: Plant Science
Open Access status: diamond
OpenAlex ID: W7225586910
FWCI:
Cites: 33
Cited by:
Related to: 10