The problem
Ayurvedic practitioners, herbal product makers and students all face the same problem: many medicinal plants look alike to non-experts, and misidentification has real consequences. This project trains a MobileNetV3-Large classifier on about 2,800 leaf photographs across six medicinal species, with green-hue segmentation isolating the leaf so the model learns leaf morphology instead of backgrounds. MobileNetV3 is chosen deliberately so the model runs offline on a phone in the field. Students learn leaf-image preprocessing, augmentation that respects leaf shape, and mobile deployment via TFLite. The demo identifies sample leaf photos with representative predictions and usage notes — with an explicit educational-use disclaimer.
How it works
- Leaf photographs are collected from herbal gardens and nurseries and labelled by species.
- Green-hue segmentation masks isolate the leaf from the background in each photo.
- Masked leaves are resized to 224×224, normalized and split into stratified train/validation sets.
- MobileNetV3-Large, pre-trained on ImageNet, is fine-tuned with a new classification head.
- Augmentation uses rotation, flip and perspective warp to simulate varied photo angles.
- Training uses AdamW with early stopping; the held-out split gives accuracy and per-species metrics.
- The model is exported to TFLite; the web demo identifies sample leaf photos with representative predictions.
Tech stack:
- Python 3, TensorFlow/Keras
- MobileNetV3-Large
- OpenCV (leaf segmentation)
- NumPy, Matplotlib, scikit-learn
- Jupyter Notebook (training)
- HTML/CSS/JS identification demo
- TFLite export
Dataset & model details
- Dataset: Custom curated medicinal-leaf set — ~2,800 leaf photographs from herbal gardens and nurseries in the Pune region, labelled into 6 species: Tulsi, Neem, Aloe vera, Moringa, Ashwagandha, Giloy; stratified 80/20 split.
- Task: 6-class image classification; input = 224×224×3 segmented leaf, output = species probabilities.
- Model: MobileNetV3-Large backbone (ImageNet pre-trained) → GlobalAveragePooling → Dropout(0.25) → Dense(6, softmax); ~5.4M parameters; green-hue segmentation upstream.
- Metrics: Species accuracy ~94% (design target), top-2 accuracy ~98% (design target), per-species precision/recall. No accuracy is claimed as measured until the training run is executed for the order.
| Parameter | Value |
|---|---|
| Input format | 224 × 224 RGB segmented leaf |
| Classes | 6 medicinal species |
| Dataset size | Approximately 2,800 leaf photos |
| Model parameters | Approximately 5,400,000 |
| Species accuracy | ~94% (design target, not a measured claim) |
| Training time | Approximately 1–2 h on a free GPU (expected) |
| Inference | Approximately 18 ms on phone CPU (expected) |
| Model file | Approximately 3.4 MB TFLite (expected) |
| Demo | Single-file web app, runs offline after download |
Project features
- Six-species leaf classifier Tulsi, Neem, Aloe vera, Moringa, Ashwagandha, Giloy — common Indian medicinal plants, with per-species metrics.
- Leaf segmentation Green-hue masking isolates the leaf from the background before classification, removing background bias.
- Curated leaf dataset About 2,800 leaf photographs from herbal gardens and nurseries, labelled by species.
- Phone-ready model MobileNetV3-Large exported to TFLite (~3.4 MB) for fully offline field identification.
- Traditional-use notes Each prediction shows documented traditional uses — educational reference, clearly disclaimed.
- Interactive identification demo Single-file web app: pick a sample leaf photo and see the predicted species with probability bars.
- Viva kit Report PDF, PPT and Q&A covering leaf preprocessing, MobileNetV3, augmentation and TFLite deployment.
What is included
- Curated, labelled medicinal-leaf dataset with split files
- Segmentation + training Jupyter notebooks
- Trained MobileNetV3 model + TFLite export
- Interactive identification web demo with sample photos
- Confusion matrix and per-species metrics
- Traditional-use reference notes
- Project report PDF, PPT presentation
- Viva Q&A preparation document
Limitations & prerequisites
- Educational and prototype use only — never use predictions for actual medicinal consumption decisions.
- Some species have lookalike non-medicinal relatives; the report documents the confusion pairs.
- 94% is a design target, stated honestly — the report documents the actual achieved figure.
- Damaged, dried or partial leaves degrade accuracy; fresh whole leaves are recommended.
- Only the six covered species are supported; new species need new labelled data.
Frequently Asked Questions
Which dataset is used?
A custom curated set of about 2,800 leaf photographs from herbal gardens and nurseries in the Pune region, labelled Tulsi, Neem, Aloe vera, Moringa, Ashwagandha or Giloy, with a stratified split.
Why MobileNetV3?
The use case is field identification on a phone — MobileNetV3-Large gives strong accuracy at ~18 ms on a phone CPU and exports to a 3.4 MB TFLite model that runs fully offline.
How does leaf segmentation help?
It masks out soil, hands and pots so the classifier learns leaf shape, venation and margin — the actual botanical features — instead of background shortcuts.
Is it safe to use for real herbal medicine?
No — and the project states this clearly. It is an educational prototype; species predictions must be verified by a qualified botanist before any real use.
How does the demo work?
Pick a sample leaf photo and press run; the app shows the predicted species with probability bars and traditional-use notes — representative of the trained model on these samples.
Is this project suitable for a final-year project?
Yes — for AI & Machine Learning programs. It demonstrates domain preprocessing, mobile deployment and responsible AI disclaimers. Suitable for B.E./B.Tech final-year projects in AI & Machine Learning.
Components & software requirements
- Python 3, TensorFlow/Keras
- MobileNetV3-Large
- OpenCV (leaf segmentation)
- NumPy, Matplotlib, scikit-learn
- Jupyter Notebook (training)
- HTML/CSS/JS identification demo
- TFLite export
Dataset & model details
- Dataset: Custom curated medicinal-leaf set — ~2,800 leaf photographs from herbal gardens and nurseries in the Pune region, labelled into 6 species: Tulsi, Neem, Aloe vera, Moringa, Ashwagandha, Giloy; stratified 80/20 split.
- Task: 6-class image classification; input = 224×224×3 segmented leaf, output = species probabilities.
- Model: MobileNetV3-Large backbone (ImageNet pre-trained) → GlobalAveragePooling → Dropout(0.25) → Dense(6, softmax); ~5.4M parameters; green-hue segmentation upstream.
- Metrics: Species accuracy ~94% (design target), top-2 accuracy ~98% (design target), per-species precision/recall. No accuracy is claimed as measured until the training run is executed for the order.
Delivery information
Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.
Support terms
Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.