This section will discuss the framework suggested for the classification of diseases in potato plants, especially with imbalanced data. The approach includes data preprocessing, data augmentation, deep learning model training and ensembling, which together constitute an effective process that can handle any real-world issues.
Overall system architecture
The proposed system follows a multi-stage pipeline consisting of:
• Dataset acquisition and preprocessing.
• Data augmentation for imbalance mitigation.
• Model training using CNN and transfer learning.
• Ensemble learning for prediction fusion.
• Performance evaluation using robust metrics.
The proposed ensemble framework as depicted in Fig 1 combines several deep learning classifiers through stacking-based fusion techniques to improve classifier accuracy under imbalanced learning conditions. In the first step, input images of potato leaves go through several preprocessing steps, including resizing and normalization. Then, the augmented training data is used as input to multiple base models, which include a custom convolutional neural network as well as pre-trained transfer learning algorithms like ResNet50, VGG16 and MobileNet. Base models independently extract features and classify each image, resulting in probability vectors through softmax functions. Finally, the outputs are fused and used as input to the meta-learner, which learns how to optimally weight and aggregate results of base model predictions. This hierarchical process allows for the acquisition of various features and minimizes bias and variance of individual models. Consequently, the prediction made by a meta-classifier becomes more robust, generalizable and accurate for minority disease classes than predictions made by each of individual models. The architecture is designed to ensure that both data-level and model-level improvements are incorporated systematically.
After the last stage of classification, the output is sent to a fertilization recommendation unit where the type of disease can be linked with fertilizer application methods. This helps turn the system into an agriculturally useful decision support tool rather than just a disease detector.
Dataset description and preprocessing
PlantVillage data set is an open data set consisting of 54,305 images of plant leaves that have diseases or are healthy and were captured under controlled settings (
Hughes and Salathé, 2015). There are 14 crop species for which there are images in the data set; the 14 crop species include: apple, blueberry, cherry, grape, orange, peach, pepper, potato, raspberry, soy, squash, strawberry and tomato. The data set includes images of 17 basic plant diseases, 4 bacterial plant diseases, 2 oomycete plant diseases, 2 plant viral diseases and 1 mite plant disease. The dataset used in this research is acquired from PlantVillage (
Hughes and Salathé, 2015), which consists of images of plant leaves labeled accurately under well-controlled environments. In particular, images pertaining to potato leaves, classified into three classes, namely, healthy leaves, early blight leaves and late blight leaves shown in Fig 2, have been selected for analysis. With the following counts:
• Healthy (152 images).
• Early Blight (1000 images).
• Late Blight (1000 images).
Image resizing and normalization
All input images are resized to a fixed resolution of 224 × 224 pixels, which is compatible with standard pretrained architectures. Normalization is used for scaling the intensity of pixels within an image before feeding the image to the deep learning networks. Normalization ensures that the dataset is rescaled such that the distribution of pixels has a mean value close to zero and a standard deviation value close to one. By scaling pixel values using the above equation, normalization ensures that the deep learning process is made faster by making the optimization algorithm converge faster and stable since gradients do not change drastically at each update process during the backpropagation process.
Data augmentation for imbalance handling
Data augmentation helps in expanding the dataset by creating new samples out of the original images using various transformations like rotations, flips, scalings and cropping. This helps in increasing diversity within the dataset and helps the model learn about invariant features in different conditions. Thus, data augmentation plays an important role in making the model more robust against changes in features like orientation, illumination and background noises. Additionally, data augmentation also aids in improving the model’s ability to generalize better. However, it should be mentioned here that data augmentation techniques do not help in adding any new semantics to the dataset, as the new samples created by augmentations are created from the existing samples only. Thus, data augmentation alone may fail in addressing issues like inadequate feature representation or class imbalances. Thus, data augmentation is used in conjunction with other methods like transfer learning and ensemble learning to help the model benefit from existing feature representations and ensembled results.
In consideration of the clear disparity of classes in the PlantVillage dataset, owing to the small number of healthy leaf images (n=152), data augmentation was done only for the purpose of training the network. This process was done dynamically using the image data generator from Keras library such that different augmented versions of the same image were seen at every epoch. Images were first resized to 224×224 and then normalized to the range of [0, 1]. Data augmentation techniques utilized in the project involved random rotation, random horizontal and vertical flipping, zooming, width shift, height shift, shear and brightness. These transformations enabled the model to recognize invariant features related to diseases irrespective of the orientation and lighting angle of the image. In Table 1 various augmentation parameters are listed.
Training, validation and test split
In order to achieve reproducibility and reduce sampling bias, the PlantVillage potato dataset of 2,152 images was divided into three sets: training set, validation set and test set using stratified random sampling technique. Stratification ensures that the proportion of the original dataset’s classes, healthy, early blight and late blight, is maintained in each subset. A total of 1,506 images (70%) were assigned to the training set, 323 images (15%) were assigned to the validation set and 323 images (15%) were assigned to the test set. All experiments were carried out using random seed 42 to ensure identical partitioning of the dataset and consistent initialization of the model.
Model development
The study evaluates both custom CNN architecture and transfer learning models.
Custom CNN model
The Custom Convolutional Neural Network (CNN) architecture was developed specifically for multiclass classification of potato leaf diseases. The network has four convolutional blocks and a lightweight classification head. Every convolutional block contains several convolutional layers, ReLU activation, Batch Normalization, Max-pooling and dropout to optimize feature learning while reducing overfitting.
The first block has 32 filters, the second one has 64 filters, the third block has 128 filters and the last block has 256 filters. All convolutional layers use same padding and L2 regularization (λ = 1 × 10
-4) to optimize model generalization. Batch Normalization is applied after each convolutional layer. Max-Pooling layers reduce the spatial dimensions while retaining discriminative features and the increase of Dropout layers’ rates (0.25 to 0.40) helps to minimize overfitting.
Unlike traditional CNNs where Flatten layers are applied, the new model uses the Global Average Pooling (GAP) layer that minimizes the number of trainable parameters while keeping global spatial information. The classification head contains two fully connected layers with 256 and 128 neurons, respectively and uses ReLU activation and L2 regularization. In addition, additional Dropout layers with the rates 0.50 and 0.30 further optimize generalization. The last layer has three neurons, which correspond to the three possible classes of potato diseases and the Softmax activation function. The network is trained with the Adam optimizer with the learning rate of 1 × 10
-4 and the categorical cross-entropy loss function is used.
VGG16 architecture
VGG16 is a deep convolutional neural network created by the Visual Geometry Group (VGG) at the University of Oxford. It consists of 13 convolutional layers and three fully connected layers, totaling 16 weight layers. All convolutional layers use 3 × 3 convolutional kernels, which allow for extracting hierarchical image features with high computational efficiency.
For the purposes of this research, the original classification layers of VGG16 are discarded using include_top=False option, which allows applying the pretrained convolutional backbone as a generic feature extractor. The backbone of the network is initialized with the ImageNet pretrained parameters and all convolutional layers remain frozen during the first training phase.
The feature maps are further processed using the Global Average Pooling layer, then Batch Normalization, dense layer with 512 neurons, Dropout (0.50), dense layer with 256 neurons, Dropout (0.30) and, finally, the Softmax output layer with three neurons. L2 regularization is used in all dense layers to optimize generalization.
Model is trained using the Adam optimizer with the learning rate of 1 × 10
-4 in the feature extraction process and later the upper convolutional layers are fine-tuned using the learning rate of 1 × 10
-5.
ResNet50 architecture
ResNet50 is a 50-layer deep neural network with identity shortcut connections to solve the problem of degradation in very deep architectures. Instead of directly learning the mapping function, residual blocks learn residual functions, which allows for efficient propagation of gradients through the network.
The network has an initial convolutional layer followed by four stages of bottleneck residual blocks in 3-4-6-3 configuration. Every bottleneck block has 1 × 1, 3 × 3 and 1 × 1 convolutional layers connected through identity shortcuts for optimizing deep networks’ stability.
For transfer learning, the original fully connected classification layers are removed (include_top=False) and the backbone of the network is initialized with the pretrained ImageNet parameters. During the first training phase, all layers of the backbone remain frozen and only the classification head is optimized.
The classification head includes a Global Average Pooling layer, Batch Normalization, a fully connected layer with 512 neurons, Dropout (0.50), fully connected layer with 256 neurons, Dropout (0.30) and the Softmax output layer with three neurons. L2 regularization is used in both dense layers to minimize overfitting. After feature extraction, the upper residual blocks are unfrozen and fine-tuned using the reduced learning rate of 1 × 10
-5.
MobileNetV2 architecture
MobileNetV2 is a lightweight deep convolutional neural network designed for computational efficiency in embedded and mobile devices. This network uses depthwise separable convolutions, inverted residual blocks and linear bottlenecks, which substantially reduces the number of trainable parameters without compromising classification performance.
In contrast to the traditional convolutional layers, MobileNetV2 implements convolution as depthwise convolution followed by pointwise (1 × 1) convolution, which reduces computational complexity. The inverted residual structure first expands the feature dimension, performs depthwise convolution and finally projects features to a lower dimensional space using linear bottlenecks.
For transfer learning, the original classification layers are discarded (include_top=False) and the pretrained ImageNet backbone is kept. The convolutional backbone remains frozen during the feature extraction stage.
The classification head contains a global average pooling layer, Batch Normalization, a dense layer with 512 neurons, Dropout (0.50), another dense layer with 256 neurons, Dropout (0.30) and the final Softmax output layer with three neurons. L2 regularization is applied to both dense layers.
Model is trained with the Adam optimizer with the initial learning rate of 1 × 10
-4 in the feature extraction process and then the upper MobileNetV2 layers are fine-tuned with the reduced learning rate of 1 × 10
-5.
The advantages of transferring knowledge through pretrained models lie in significantly reduced training time by skipping the process of learning low-level features, which requires much more time. Transfer learning also needs less data for training since only fine-tuning is performed with respect to the given domain. Another advantage is the ability to effectively extract complex features using well-prepared pretrained deep learning frameworks. Transfer learning models increase computational cost, but MobileNet provides lightweight alternative and Ensemble adds inference overhead. We need to maintain a trade-off between accuracy vs efficiency.
Hyperparameter configuration
All models were trained using identical hyperparameters unless otherwise specified, allowing fair comparison among CNN, ResNet50, VGG16, MobileNet and the ensemble framework. Table 2 reports the total and trainable parameter counts for each architecture, highlighting the substantial reduction in trainable parameters achieved by the transfer learning models relative to the Custom CNN. Reproducibility was guaranteed for all the deep learning architectures through the consistent experimental settings, except where otherwise noted. The transfer learning models made use of the pre-trained ImageNet weights with fixed convolutions in the first stage of training, with only the classification head being fine-tuned on the potato dataset. The Adam optimizer was chosen for all experiments because of its fast convergence and ability to adaptively compute gradients; the initial learning rate for the optimizer was set at 1 × 10
-4. Table 3 display different hyperparameters’ configuration.
The proposed methodology adopts a hierarchical learning approach that involves data augmentation, which is done at the data level to diversify the training dataset and address the problem of imbalanced data classes, thereby allowing the model to generalize more accurately. The feature level involves applying transfer learning on pretrained deep neural networks, which enhances the ability of the model to generate rich features, thus boosting its performance, even when working with small amounts of data. Finally, the decision level incorporates the use of ensemble learning approaches, where predictions made by different models are aggregated to minimize bias and variance.
Ensemble learning framework
Ensemble learning is the core contribution of this study with soft voting as given in eq. (1).
Soft voting