We use cookies to ensure our website works properly and to personalise your experience. Cookies policy
Department of MSc. Data Science, Loyola Academy, Secunderabad-500010, India
This project presents an enhanced grapevine leaf classification by extending the CNN-SVM framework from the study “A CNN-SVM Study Based on Selected Deep Features for Grapevine Leaves Classification”. While the original research used basic augmentation and feature fusion from custom CNN top blocks (MobileNetV2 and VGG19), our approach integrates advanced augmentation techniques- Mixup, CutMix, RandAugment, and Augmix- to increase data diversity and reduce overfitting. Features are extracted from MobileNetV2’s intermediate convolutional layers using Global Average Pooling, followed by Chi-Square selection of the top 250 features for classification using a Cubic SVM. The original dataset of 500 images was augmented to over 3,000 samples. Our method achieves a classification accuracy of 98.17% surpassing the original study’s 97%. Both the previous work and present work included detailed metrics like Precision, Recall, F1-score, MCC, and confusion matrix analysis along with Accuracy as the primary report. This work demonstrates the impact of advanced augmentation in improving performance for fine-grained plant classification tasks and offers a practical, scalable pipeline for agricultural AI.
Grapevine cultivation plays a pivotal role in the agriculture economies of many countries, and accurate identification of grapevine leaf species is essential for proper vineyard management, pest control, and cultivar selection. Traditional methods of species classification often rely on expert knowledge and manual inspection, which can be both-consuming and error-prone. In recent years, the fusion of computer vision, and deep learning has opened new avenues for automating this task with high precision.
The advent of Convolution Neural Networks (CNNs) has revolutionized image-based classification tasks, providing robust feature representations for complex datasets. However, combining CNN’s with traditional machine learning models such as Support Vector Machines (SVM’s) has shown promising improvements in classification performance. In particular, the study by Kök and Yıldırım (2021) demonstrated that integrating CNN-based feature extraction with SVM classification using selected deep features significantly enhances grapevine leaf classification accuracy.
Motivated by this approach, our study implements an advanced hybrid framework that builds upon the foundational work presented in their research. Specifically, we leverage a pre-trained MobileNetV2 model to extract deep features from grapevine leaf images, followed by feature selection using the Chi-square (χ²) statistical test. These selected features are then classified using SVMs with various kernel functions, including a polynomial kernel with degree three-referred to as the cubic kernel-known for its higher-order decision boundaries.
To further enhance the robustness and generalization capability of our model, we incorporate a range of modern data augmentation techniques such as RandAugment, AugMix, Mixup and CutMix. These augmentation strategies not only increase the diversity of the training data but also improve model resilience to real-world variations in image quality, lighting, and background conditions.
Our experiment pipeline is designed to evaluate the effectiveness of this CNN-SVM hybrid model using comprehensive evaluation metrics, including accuracy, precision, recall, F1-score, ROC-AUC, and the Matthews Correlation Coefficient. The results validate the synergy between deep learning feature extraction and traditional SVM-classification, offering a scalable and efficient solution for grapevine leaf species identification.
LITERATURE REVIEW
Authors: Hongyi Zhang, Moustapha Cisse, Yann N. Dauphin, David Lopez-Paz
Year:2017
Summary: Proposes a novel data augmentation method called Mixup, which creates new training samples by linearly interpolating pairs of examples and their labels. This simple yet powerful approach improves the generalization of neural networks, reduces memorization of noisy labels, and increases robustness to adversarial attacks. It serves as a strong regularizer by encouraging smoother decision boundaries.
Authors: Ekin D. Cubuk, Barret Zoph, Dandelion Mane, Vijay Vasudevan, Quoc V. Le
Year: 2018
Summary: Introduces AutoAugment, a reinforcement learning-based method that automatically searches for optimal image augmentation policies directly from the training data. It discovers powerful combinations of transformations like rotation, color adjustment, and cropping, significantly boosting model performance across CIFAR, SVHN, and ImageNet without manual tuning.
Authors: Sangdoo Yun, Dongyoon Han, Seong Joon Oh, Sanghyuk Chun, Junsuk Choe,YoungjoonYoo
Year:2019
Summary: Proposes CutMix, an augmentation technique that combines two images by cutting a patch from one and pasting it onto another while also mixing their labels proportionally. This method enriches the image context and object diversity, encouraging the model to pay attention to a broader set of visual cues. CutMix outperforms Mixup on multiple benchmarks and improves both classification and localization.
Authors: Dan Hendrycks, Norman Mu, Ekin D. Cubuk, Barret Zoph, Justin Gilmer,BalajiLakshminarayanan
Year:2019
Summary: Introduces a powerful data augmentation strategy aimed at enhancing the robustness and reliability of deep learning models. AugMix works by mixing multiple augmentation operations—such as contrast adjustments, blurring, and geometric transformations—into a single composite image using a stochastic process. It significantly improves performance under image corruptions and offers better uncertainty estimation.
Authors: David Berthelot, Nicholas Carlini, Ekin D. Cubuk, Alex Kurakin, Kihyuk Sohn, Han Zhang, Colin Raffel
Year:2020
Summary: Extends MixMatch by introducing ReMixMatch, a semi-supervised learning method that integrates augmentation anchoring—a strategy where strongly augmented data must still predict consistently. It combines distribution alignment, entropy minimization, and a rotation-based auxiliary loss to improve generalization on unlabeled data, achieving state-of-the-art performance on multiple SSL benchmarks.
Authors: Tianjun Zhang, Xingyou Song, Yixin Lin, Yang Gao, Jacob Andreas, ChelseaFinn,DawnSong
Year:2020
Summary: Adapts mix-based augmentation concepts to reinforcement learning by introducing MixReg. It regularizes training by mixing states and returns, enabling better generalization to unseen tasks. This work broadens the application of data augmentation beyond supervised learning and is especially impactful in environments with limited data or high variance.
Authors: Ekin D. Cubuk, Barret Zoph, Jonathon Shlens, Quoc V. Le
Year:2020
Summary: Simplifies AutoAugment by introducing RandAugment, which removes the search phase and uses a fixed set of augmentations controlled by just two hyperparameters: the number of transformations and their magnitude. Despite its simplicity, RandAugment achieves performance close to AutoAugment on several benchmarks, making it practical for fast and scalable model training.
Authors: Yawen Xu, Jiayi Ma, and Xueyao Zhang
Year:2022
Summary: Offers a comprehensive taxonomy of image augmentation techniques across domains such as classification, detection, and segmentation. It categorizes augmentations into geometric, photometric, and adversarial types, while also covering automated and mix-based methods like Mixup, CutMix, RandAugment, and AugMix. The paper serves as a one-stop reference for selecting suitable augmentation methods for various tasks.
Authors: Wei Yang, Huan Wang, and Gang Pan
Year:2022
Summary: This survey provides an in-depth comparative analysis of augmentation techniques across multiple computer vision tasks. It explores both traditional (flips, crops) and advanced (GAN-based, learned policies) methods, emphasizing their impact on model generalization, robustness, and fairness. The paper also highlights open challenges and future directions in augmentation research.
Authors: Köklü, Muhammed Fahri Ünlersen, Ilker Ali Özkan, Muhammet Fatih Aslan, andKadirSabanci
Year:2022
Summary: This study focuses on classifying grapevine leaves from five species using deep learning and traditional machine learning techniques. The authors expand a 500-image grapevine leaf dataset to 2,500 via augmentation, extract deep features with a fine-tuned MobileNetV2, select the top 250 features using Chi-square, and apply a cubic-kernel SVM to achieve highest accuracy across five leaf species.
METHODOLOGY
While traditional image classification techniques can provide baseline results, their performance often diminishes when faced with real-world challenges such as duplicate images, noise, blurriness, lighting variations, and limited datasets. To overcome these limitations, this work employs a hybrid approach that synergizes data quality filtering, advanced data augmentation, deep feature extraction using a pretrained CNN backbone, and feature selection techniques, culminating in an interpretable and high-performance classification pipeline.
The process begins with rigorous data validation to ensure the integrity and quality of input images. This involves several filtering steps:
The validated and augmented dataset is split into training and testing subsets, typically using an 80/20 split with a fixed random seed for reproducibility. Labels are encoded as integers based on folder structure or metadata.
Deep Learning: MobileNetV2 for Feature Extraction
Given the high dimensionality of deep features, a Chi-square feature selection method (via SelectKBest with chi2 scoring) is applied to retain only the top 250 most relevant features. This reduces computational complexity and mitigates overfitting, while preserving discriminative information critical for classification.
The selected features serve as inputs to Support Vector Machine classifiers with various kernels (linear, RBF, polynomial). After training and tuning, the polynomial kernel (degree 3) was identified as optimal, providing the best trade-off between accuracy and generalization.
Advantages:
The following modules were created for this grapevine leaf classification project:
IMPLEMENTATION
This section describes the practical implementation of the proposed grapevine leaf classification system, including dataset preparation, deep learning model training using MobileNetV2 with advanced data augmentations, feature extraction, feature selection using Chi-square, and classification using a Support Vector Machine (SVM).
The Grapevine Leaves Image Dataset was obtained for images. It consists of images from five different grapevine varieties: Adakarası (Ak), Buzulu(Bz), Dimnit (Dm), Ala Idris, and Nazli (Nz). The dataset was downloaded and extracted into a local working directory.
Before model training, data quality checks were performed to remove:
This ensured that only high-quality and unique images were used for training.
All valid images were resized to 224×224 pixels and normalized by scaling pixel values to the range [0, 1]. Images were labeled using a folder-based labeling scheme and encoded using integer labels for further processing.
To address class imbalance and improve generalization, multiple advanced data augmentation techniques were applied:
The final dataset (X_final, y_final) was formed by combining original and augmented images.
The full dataset was split into 80% training and 20% testing using train_test_split with a fixed random seed for reproducibility.
A pretrained MobileNetV2 model was used as the base feature extractor, with its convolutional layers frozen. The classification head was added as follows:
The model was compiled using the Adam optimizer and trained for 50 epochs with sparse categorical crossentropy loss.
The convolutional backbone of MobileNetV2 was extracted as a separate feature extractor. It was used to convert both training and testing images into feature vectors by flattening the convolutional outputs. These vectors were further used for classical machine learning classification.
To reduce dimensionality and enhance SVM performance, Chi-square feature selection was applied using SelectKBest with chi2 scoring. The top 250 most relevant features were retained.
A Support Vector Machine (SVM) classifier was trained on the selected features. Multiple kernel options (linear, rbf, poly, cubic) were tested. The polynomial kernel (degree=3) gave the best results and was selected for the final model.
The SVM classifier was evaluated on the test set using various performance metrics:
Visualizations such as heatmaps of confusion matrices were generated using seaborn.
All key components of the system were serialized and saved for integration into the Django web application:
This section describes how the trained models and associated components are integrated into a Django-based web application for real-time inference and deployment. The deployment pipeline includes:
EXPERIMENTAL RESULTS
Fig 1: Graphical User Interface (GUI) Home Screen
Fig 2: OUTPUT Screen
CONCLUSION
This project successfully developed an advanced grapevine leaf classification system by integrating deep learning and traditional machine learning techniques. Beginning with a rigorous data quality filtering process to eliminate corrupt, blurry, and duplicate images, the dataset was significantly refined to ensure high-quality input for model training. To further enhance robustness and generalization, a diverse set of augmentation techniques—including standard transformations, RandAugment, AugMix, Mixup, and CutMix—were applied, creating a significantly enriched training dataset.
A transfer learning approach using MobileNetV2 served as the foundation for feature extraction due to its efficiency and performance on image classification tasks. The trained CNN model achieved reliable results, and its intermediate features were extracted to serve as input for a classical Support Vector Machine (SVM) classifier. Among multiple kernel experiments, the polynomial kernel (degree=3), combined with Chi-square-based feature selection, yielded the best classification performance.
Comprehensive evaluation using metrics such as accuracy, precision, recall, F1 score, Matthews Correlation Coefficient (MCC), and ROC AUC confirmed the robustness and effectiveness of the final pipeline. The model achieved high classification performance across all five grapevine leaf classes, validated through confusion matrix analysis and ROC evaluation.
The finalized models—including the deep learning classifier, SVM with selected features, and the feature extractor—were saved for deployment or further research use. This modular and hybrid approach not only demonstrated improved classification accuracy but also provided flexibility for future enhancements, such as incremental learning or real-time deployment in agricultural field applications.
Overall, this project illustrates the potential of combining deep learning with feature selection and classical ML for solving complex visual classification problems in the agricultural domain.
REFERENCES
D. Banu Kranthi*, Surya Lakshmi Ramabhotla, Grapevine Leaves Classification Using Advanced Data Augmentation Techniques, Int. J. Sci. R. Tech., 2026, 3 (5), 197-205. https://doi.org/10.5281/zenodo.20036123
10.5281/zenodo.20036123