Handling imbalance and few-sample size in ML based Onion disease classification
Abhijeet Manoj Pal 1 , Rajbabu Velmurugan 2 · 2025
Read Handling imbalance and few-sample size in ML based Onion disease classification by Abhijeet Manoj Pal 1 , Rajbabu Velmurugan 2 (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2509-05341.txt.
Introduction
Onion crops suffer several diseases and pests that look alike, and Abhijeet Manoj Pal with Rajbabu Velmurugan build a classifier that can tell them apart in a 2025 agriculture paper. Most earlier methods only answer healthy or sick, which limits what a farmer can do next.
Their model upgrades a pre-trained image network with attention modules that stress the most telling regions. A broad augmentation pipeline, which varies training images many ways, fights the imbalance between common and rare classes. On a real field image dataset the model reached high overall accuracy and a strong balance of precision and recall. It outperformed other approaches tested on the same data.
Catalog record
| CREATOR | Abhijeet Manoj Pal 1 , Rajbabu Velmurugan 2 |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 18 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2509-05341
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Handling imbalance and few-sample size in ML based Onion disease classification Abhijeet Manoj Pal 1 , Rajbabu Velmurugan 2 Abstract Accurate classification of pests and diseases plays a vital role in precision agriculture, enabling efficient identification, targeted interventions, and preventing their further spread. However, current methods primarily focus on binary classification, which limits their practical applications, especially in scenarios where accurately identifying the specific type of disease or pest is essential. We propose a robust deep learning based model for multi-class classification of onion crop diseases and pests. We enhance a pre-trained Convolutional Neural Network (CNN) model by integrating attention based modules and employing comprehensive data augmentation pipeline to mitigate class imbalance. We propose a model which gives 96.90% overall accuracy and 0.96 F1 score on real-world field image dataset. This model gives better results than other approaches using the same datasets. I Introduction India is the largest onion producer in the world, accounting for approximately 28.66% of the total production in the world [ 1 ] . Onion pests and diseases lead to significant crop losses in India. Onion has seven main types of pests and diseases. By identifying pests and diseases accurately, targeted treatments can be implemented to treat and prevent further spread of diseases and pests. Different onion diseases and pests need separate focused treatments, hence it is extremely necessary to classify onion diseases and pests separately rather than classification as healthy or non-healthy. Previous work such as Gbadebo et al. [ 2 ] focused on binary classification of onion leaves into healthy and unhealthy categories. The data collected were from internet-sites and a handful from actual farm. However, this level of classification is limited for practical agricultural use, where identifying the exact type of disease or pest is crucial for targeted treatment. In this work, we address this gap by classifying seven specific onion diseases and pests and healthy crop using deep learning techniques. Raj et al. [ 3 ] proposed an improved model based on YOLOv8s for the detection of onion foliar disease. It does identify specific diseased regions before classification. However, this adds an additional complexity and overhead of bounding-box before classification. Moreover, it requires region-level annotations. It is a two-step pipleline involving localization and classification, and is susceptible to errors due to annotation inaccuracies, which is exacerbated due to the use of approximately 279 images per class for training. Also, they focus on only five image classes. In image augmentation. Our approach of using Convolutional Neural Network based models work on full leaf images eliminating the need of such annotations and bounding box overhead in inference time. We also use dataset balancing techniques to mitigate the imbalance among the eight classes. To address these gaps, this paper compares different CNN based architectures, loss functions, and data imbalance techniques to develop a robust onion pest and disease classification model. II Related Work Very little research work was found to be in the area of Onion leaf disease and pest classification. Gbadebo et al. [ 2 ] have used healthy and non-healthy classification on images mostly obtained from internet-sites and handful from farms. Raj et al. [ 3 ] have used Yolo-v8 model for classification, it increases overhead and due to the less number of images approximately 279 images per class in training for fine-tuning, the model is prone to not classify the data properly, which is observed in the class-wise accuracies not exceeding 0.784. Lokhande et. al. [ 4 ] conducted a comparative analysis of AlexNet and ResNet-50 models for soyabean and maize crops disease on a dataset which is a combination of Plant Village Dataset and images from agricultural plots and has observed that ResNet-50 model gives better classification results compared to AlexNet model in both cases. For soybean disease classification, ResNet-50 achieved an accuracy of 97.41%, compared to 96.40% with AlexNet. Similarly, for maize disease classification, ResNet-50 achieved 96.74% accuracy, while AlexNet reached 95.99%. Zhang et. al. [ 5 ] used CNN models for classification of nine types of maize leaves, obtaining high accuracies of 98.9% using GoogLeNet model. This motivates us to use Convolutional Neural Networks (CNNs) for the classification of Onion Disease and Pest Images. III Materials and Methodology III-A Dataset The dataset used is obtained from the Indian Council of Agricultural Research (ICAR)-Directorate of Onion and Garlic Research, Pune, through the TIH Foundation for Technology Innovation Hub, IIT Bombay, Internet of Things and Internet of Everything (IoT & IoE), Mumbai. The images consist of both those taken via a DSLR camera and a smartphone. The dataset consists of nine classes, Healthy, Basal Rot, IYSV (Iris Yellow Spot Virus), Bulb Rot, Anthracnose, Twister, Thrips, Stemphylium, Purple Blotch. The dataset is imbalanced, as shown in Figure 1 . The total number of images are 5330, with maximum for Healthy class, 1072 and minimum for Basal Rot, 140 images. Thus imbalance ratio of 7.6 : 1. A few images of the dataset are as shown in Figure 2 . Fig. 1: Number of images in each class in the dataset Fig. 2: Sammple Images from Each Class III-B Data Pre-Processing and Augmentation We employed different data pre-processing pipelines tailored for each model setup: III-B 1 Pipeline A: Normal Augmentation This pipeline includes resizing images to 224×224, normalization, and basic augmentations such as horizontal flip and rotation. III-B 2 Pipeline B : Imbalanced Sampler As the classes in the dataset are highly imbalanced, an imbalanced dataset sampler was used as proposed by Yang et. al. [ 6 ] . Here, the majority class are undersampled and the minority class are oversampled. After using the Imbalanced Dataset Sampler the class wise distribution obtained is as shown in Figure 3 Fig. 3: Dataset Distribution after Imbalanced Dataset Sampler III-B 3 Pipeline C : Albumentations-Based Augmentation The image was randomly subjected to one of the following augmentations, as proposed by Buslaev et al. [ 7 ] . A combination of general transformations and class-specific augmentations based on the type of disease were applied. For each image, one of the following augmentations was randomly applied such as, horizontal flip, vertical flip, motion blur, median blur, guassian blur, Hue variations, grid shuffle and coarse dropout. The images were all resized to 224×224. The augmentations were a combination of these. Each transformation was applied with a specific probability to enhance the diversity of the dataset and improve model generalization. III-B 4 Pipeline D : Cut-Mix Augmentation CutMix was used to enhance the model’s generalization as proposed by [ 8 ] . It involves combining two images and adjusting the labels based on the overlapping region. It generates a new training sample by combining two input samples. Let x_{A}\in\mathbb{R}^{W\times H\times C} and x_{B}\in\mathbb{R}^{W\times H\times C} be two training images, with corresponding labels y_{A} and y_{B} . The goal of CutMix is to create a new image \tilde{x} and label \tilde{y} by combining (x_{A},y_{A}) and (x_{B},y_{B}) , as described below. The combination operation is defined as: \tilde{x}=M\odot x_{A}+(1-M)\odot x_{B} (1) \tilde{y}=\lambda y_{A}+(1-\lambda)y_{B} (2) where M\in\{0,1\}^{W\times H} is a binary mask indicating where to drop out and fill in from the two images. M is 1 in the region taken from image x_{A} and 0 in the region taken from image x_{B}