Below is the responsive landing page featuring modern gradients, a hero search component, and theme options.
GreenClassify is a production-ready, deep learning-powered image classification system. It combines a state-of-the-art MobileNetV2 Convolutional Neural Network (CNN) backbone with a lightweight Flask web server to classify vegetables in real-time. It features a bilingual output engine, theme toggles, and pre-inference confidence checks to verify if the uploaded image is actually a vegetable.
- Deep Learning Classifier: Backed by a fine-tuned MobileNetV2 model achieving a near-perfect 99.90% test set accuracy.
- 15 Supported Categories: Bean, Bitter Gourd, Bottle Gourd, Brinjal, Broccoli, Cabbage, Capsicum, Carrot, Cauliflower, Cucumber, Papaya, Potato, Pumpkin, Radish, and Tomato.
- Bilingual Translations (English & Hindi): Instantly translates predictions (e.g., Carrot
↔️ गाजर). - Intelligent Validation Guard: Employs a confidence filter (
threshold >= 50%). If the image confidence score drops below 50%, the application warns the user: "This is not a vegetable." - Interactive Frontend Experience:
- Theme Switcher: Seamlessly toggle between Vibrant (glassmorphic styling) and Minimal (clean flat UI) themes.
- Real-time Previews: Instant client-side file reading to display thumbnail previews before predicting.
- Smart Loader: Fluid progress indicator during inference time.
Below is a live classification example predicting a Carrot with 98.3% confidence score in the Minimal theme:
GreenClassify/
├── screenshots/ # Folder for application preview images
│ ├── image.png # Developer workspace screenshot
│ ├── image copy.png # Web UI landing page preview
│ └── image copy 2.png # Web UI prediction output preview
├── static/
│ ├── css/
│ │ └── style.css # Core CSS variables, layout, and theme toggling
│ ├── uploads/ # Holds uploaded images temporarily
│ ├── background.jpg # Hero header background image
│ └── vibrant-green.avif # App logo branding image
├── templates/
│ └── index.html # Responsive Flask UI layout
├── 01_data_analysis_preprocessing.ipynb # Notebook for dataset preprocessing and EDA
├── 02_model_evaluation_testing.ipynb # Notebook for model loading, evaluation, and test summary
├── app.py # Main Flask web application
├── requirements.txt # Package dependencies
└── vegetable_classifier_model.h5 # Trained MobileNetV2 CNN model file
The classification engine relies on a pre-trained MobileNetV2 backbone trained on large-scale datasets, with custom dense output layers tailored for the 15 classes of vegetables.
- Input Dimension:
224 x 224 x 3(RGB normalized images) - Normalization: Normalized pixel values to
[0, 1]range (1./255) - Total Parameters: 2,277,201
- Trainable Parameters: 2,243,087
- Non-trainable Parameters: 34,112
- Optimizer: Adam
Evaluated on a balanced test partition of 3,000 images (200 test images per category):
- Test Accuracy: 99.90% (2,997 / 3,000 correct predictions)
- Test Loss: 0.0051 (Categorical Cross-Entropy)
precision recall f1-score support
Bean 1.00 1.00 1.00 200
Bitter_Gourd 1.00 0.99 0.99 200
Bottle_Gourd 1.00 1.00 1.00 200
Brinjal 1.00 1.00 1.00 200
Broccoli 1.00 1.00 1.00 200
Cabbage 1.00 1.00 1.00 200
Capsicum 1.00 1.00 1.00 200
Carrot 1.00 1.00 1.00 200
Cauliflower 1.00 1.00 1.00 200
Cucumber 1.00 1.00 1.00 200
Papaya 1.00 0.99 1.00 200
Potato 1.00 1.00 1.00 200
Pumpkin 1.00 1.00 1.00 200
Radish 1.00 1.00 1.00 200
Tomato 1.00 1.00 1.00 200
accuracy 1.00 3000
macro avg 1.00 1.00 1.00 3000
weighted avg 1.00 1.00 1.00 3000
Developers can launch and test the deep learning pipeline interactively through the provided Jupyter Notebooks.
01_data_analysis_preprocessing.ipynb: Analyzes directories, checks class-wise image distribution, maps Hindi labels, and pre-renders training dataset profiles.02_model_evaluation_testing.ipynb: Validates the model architecture, parses parameter summaries, generates classification reports, and evaluates loss metrics on the test partition.
Follow these instructions to install dependencies and run the project locally.
- Make sure you have Python 3.11 installed.
- We recommend using a Virtual Environment to avoid library version mismatches.
# Create environment
python -m venv .venv
# Activate (Windows PowerShell)
.\.venv\Scripts\Activate.ps1
# Activate (Windows CMD)
.\.venv\Scripts\activate.bat
# Activate (macOS/Linux)
source .venv/bin/activatepython -m pip install --upgrade pip
python -m pip install -r requirements.txtpython app.pyOpen your browser and navigate to:
http://127.0.0.1:5000/



