A Python library for predicting plant diseases from leaf images using trained deep learning models.
Project description
# ๐ฟ PlantDoc Predictor
๐ฟ PlantDoc-Predictor
A Python library for predicting plant diseases from leaf images using pre-trained or custom deep learning models.
๐ Features
- โ Pretrained models included โ Ready-to-use architectures like InceptionV3, ResNet50, and MobileNetV2, trained on the 38-class PlantVillage dataset.
- ๐ง Unified API โ One interface for both built-in and custom
.h5models. - ๐งฉ Custom model support โ Load your own model and label mapping JSON.
- ๐ฑ Extensible โ Easily add new crops, datasets, or models via
model_registry.json. - ๐งฐ Visualization support โ Displays prediction confidence and leaf images.
- โ๏ธ Cross-platform โ Works seamlessly on Windows, macOS, and Linux.
๐ง Why Use PlantDoc-Predictor
PlantDoc-Predictor was created to reduce repetitive work in plant-disease research.
Researchers and agritech developers often train from scratch โ this tool eliminates that friction by providing:
- Pretrained baselines for benchmarking new models.
- Standardized label sets and metadata for reproducibility.
- Plug-and-play inference for agricultural image datasets.
- A unified interface for rapid experimentation and deployment.
Whether youโre a researcher, startup, or precision-agriculture developer, PlantDoc-Predictor simplifies your workflow and lets you focus on innovation โ not setup.
๐งฌ Supported Models
PlantDoc-Predictor includes a diverse model zoo of pretrained CNN architectures fine-tuned on the PlantVillage 38-class plant disease dataset in 0.2.1 version onwards.
These models are automatically downloaded from the remote registry when first used, making them ready for plug-and-play inference.
| Model Name | Input Size | Accuracy | Preprocessing | Description |
|---|---|---|---|---|
| InceptionV3 v1 | 299ร299 | 98.2% | inception | InceptionV3 model fine-tuned on the PlantVillage 38-class dataset |
| ResNet50 v1 | 224ร224 | 97.8% | resnet50 | Deep residual network enabling powerful feature extraction |
| EfficientNetB50 v1 | 224ร224 | 97.8% | efficientnet | EfficientNet architecture balancing accuracy and computational efficiency |
| MobileNetV2 v1 | 224ร224 | 96.8% | mobilenetv2 | Lightweight model designed for mobile and edge deployment |
| DenseNet121 v1 | 224ร224 | 98.68% | densenet121_v1 | Dense connectivity architecture improving gradient flow and feature reuse |
| DenseNet169 v1 | 224ร224 | 99.68% | densenet169_v1 | High-performance DenseNet variant achieving the best accuracy in the model zoo |
| DenseNet210 v1 | 224ร224 | 97.0% | densenet210_v1 | Very deep DenseNet architecture for advanced feature extraction |
| VGG16 v1 | 224ร224 | 96.8% | vgg16_v1 | Classic deep CNN architecture useful for benchmarking experiments |
| VGG19 v1 | 224ร224 | 98.98% | vgg19_v1 | Deeper VGG architecture providing strong classification performance |
| AlexNet v1 | 224ร224 | 92.8% | alexnet_v1 | Early CNN architecture useful as a historical baseline model |
๐ Upcoming Models
PlantDoc-Predictor is actively expanding its Model Zoo.
Future releases will include modern vision architectures and transformer-based models to further improve performance and research capabilities.
Some of the upcoming models planned for integration include:
- Vision Transformers (ViT) โ e.g.,
vit_base_patch16_224,vit_large_patch16_224 - ConvNeXt architectures โ e.g.,
convnext_tiny,convnext_small,convnext_base - Hybrid CNNโTransformer models
- Swin Transformers โ e.g.,
swin_tiny_patch4_window7_224 - EfficientNetV2 family
Planned release very month and many more features to get added as well.
These additions will allow researchers and developers to experiment with state-of-the-art deep learning architectures for plant disease classification.
Stay tuned for future releases as the PlantDoc Model Zoo continues to grow. ๐ฟ
๐ Community & Contact
PlantDoc-Predictor is growing into a widely used open-source machine learning library for plant disease classification.
Community participation is essential to help expand the PlantDoc Model Zoo and improve the ecosystem.
๐ Current Usage
The library is actively used by researchers, developers, and agritech enthusiasts worldwide.
These downloads reflect the growing interest in AI-powered plant disease detection and encourage further development of the library.
๐ค Contribute to the Project
We warmly welcome contributions from the community to help improve and expand PlantDoc-Predictor.
You can contribute by:
- ๐ง Adding new pretrained models to the PlantDoc Model Zoo
- โ๏ธ Improving preprocessing or inference pipelines
- ๐ Benchmarking new architectures
- ๐งช Adding test cases and improving reproducibility
- ๐ Improving documentation and tutorials
- ๐ Fixing bugs and optimizing performance
If you are interested in contributing to the development of this widely used ML library, feel free to open a pull request or start a discussion.
๐ซ Contact the Author
If you have ideas, questions, research collaboration proposals, or model suggestions, feel free to reach out.
Author: Subham Divakar
๐ง Email: shubham.divakar@gmail.com
๐ GitHub: https://github.com/shubham10divakar
We welcome researchers, ML engineers, and contributors who want to help make PlantDoc-Predictor the largest open-source model zoo for plant disease detection. ๐ฟ
๐ Model Zoo Comparison
The following table compares the pretrained models included in PlantDoc-Predictor .
| Model | Parameters | Input Size | Accuracy | Best Use Case |
|---|---|---|---|---|
| InceptionV3 v1 | ~23M | 299ร299 | 98.2% | High accuracy classification |
| ResNet50 v1 | ~25M | 224ร224 | 97.8% | Deep feature extraction |
| EfficientNetB50 v1 | ~30M | 224ร224 | 97.8% | Balanced accuracy & efficiency |
| MobileNetV2 v1 | ~3.5M | 224ร224 | 96.8% | Edge / mobile deployment |
| DenseNet121 v1 | ~8M | 224ร224 | 98.68% | Efficient deep CNN |
| DenseNet169 v1 | ~14M | 224ร224 | 99.68% | Highest accuracy |
| DenseNet210 v1 | ~20M | 224ร224 | 97.0% | Deep dense feature learning |
| VGG16 v1 | ~138M | 224ร224 | 96.8% | Baseline CNN benchmark |
| VGG19 v1 | ~144M | 224ร224 | 98.98% | Deeper VGG architecture |
| AlexNet v1 | ~60M | 224ร224 | 92.8% | Historical CNN baseline |
๐ Model Performance Leaderboard
Top performing models on the PlantVillage 38-class dataset.
| Rank | Model | Accuracy |
|---|---|---|
| ๐ฅ | DenseNet169 v1 | 99.68% |
| ๐ฅ | VGG19 v1 | 98.98% |
| ๐ฅ | DenseNet121 v1 | 98.68% |
| 4 | InceptionV3 v1 | 98.2% |
| 5 | ResNet50 v1 | 97.8% |
| 6 | EfficientNetB50 v1 | 97.8% |
| 7 | DenseNet210 v1 | 97.0% |
| 8 | MobileNetV2 v1 | 96.8% |
| 9 | VGG16 v1 | 96.8% |
| 10 | AlexNet v1 | 92.8% |
๐ฆ Installation
Install directly via pip:
pip install plantdoc-predictor
## ๐งฉ Quick Start
```python
from plantdoc_predictor import Predictor, list_available_models
# List built-in models
list_available_models()
# Load predictor using InceptionV3
predictor = Predictor(model_name="inceptionv3", verbose=True)
# Predict a sample image
result = predictor.predict("path/to/leaf_image.jpg")
print(result)
๐ Loading InceptionV3 model...
โ
Model loaded successfully!
================= Prediction Result =================
๐ Image Path : path/to/leaf_image.jpg
โ
Predicted Class: Apple___Apple_scab
๐ข Confidence : 98.42%
๐ Top-3 Predictions:
โข Apple___Apple_scab โ 98.42%
โข Apple___Black_rot โ 0.97%
โข Apple___Cedar_apple_rust โ 0.43%
=====================================================
{'model': 'inceptionv3', 'label': 'Apple___Apple_scab', 'confidence': 0.9842}
Using a Custom Model
You can use your own trained TensorFlow/Keras model instead of the built-in ones.
predictor = Predictor(
model_path="models/my_custom_model.h5",
label_path="models/my_labels.json",
verbose=True
)
result = predictor.predict("path/to/custom_leaf.jpg", show_plot=True)
print(result)
โ The library automatically detects input shape and normalizes image data. โ You can store your label mapping in a JSON file with the format:
{
"labels": [
"Apple___Apple_scab",
"Apple___Black_rot",
"Apple___Cedar_apple_rust",
"Apple___healthy"
]
}
## ๐ License
This project is licensed under the **MIT License**.
You are free to:
- โ
Use the library for both commercial and academic purposes
- ๐ง Modify, distribute, or integrate it into your own software
- ๐ Reference and extend it in research or production projects
Just ensure you include the original copyright notice and this license file.
See the full text in the [LICENSE](LICENSE) file.
---
## ๐ Contributing
Contributions are warmly welcomed! ๐ฑ
We value community participation to make **PlantDoc-Predictor** more robust, accurate, and user-friendly.
You can contribute by:
- ๐ง Adding new pretrained or fine-tuned models
- โ๏ธ Improving preprocessing or postprocessing modules
- ๐งฉ Extending model registry or dataset support
- ๐งช Writing new test cases for reproducibility
- ๐ Fixing bugs and optimizing performance
- ๐ Improving documentation and adding usage examples
### ๐ง Steps to Contribute
1. **Fork** this repository
2. **Create** your feature branch
```bash
git checkout -b feature/your-feature
๐ซ Contact
Author: Subham Divakar
Email: shubham.divakar@gmail.com
GitHub: shubham10divakar
PyPI: https://pypi.org/project/plantdoc-predictor/
LinkedIn: linkedin.com/in/subhamdivakar
Project Website: My Site
If you have any questions, collaboration ideas, or model suggestions โ feel free to reach out!
You can also open an issue or submit a pull request in the GitHub repository.
โค๏ธ Acknowledgements
A heartfelt thank you to all the open-source contributors and researchers who made this project possible:
- ๐ฟ PlantVillage Dataset โ for providing an invaluable resource for agricultural disease detection.
- ๐ค TensorFlow/Keras โ for powering deep learning model training and inference.
- ๐งฉ Python Open Source Community โ for libraries that make AI tools easier to build.
- ๐งช Researchers & Reviewers โ for advancing the field of AI in agriculture.
- ๐ป Contributors โ for helping test, improve, and document PlantDoc-Predictor.
Your support continues to make plant disease prediction accessible and impactful across the world.
โEmpowering agriculture with AI โ one leaf at a time.โ ๐พ
โ Subham Divakar, Creator of PlantDoc-Predictor
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file plantdoc_predictor-0.2.1.tar.gz.
File metadata
- Download URL: plantdoc_predictor-0.2.1.tar.gz
- Upload date:
- Size: 85.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95053cd57394f351433c9c70e39fd579384edcb02c15ad0a6a20bf22806164eb
|
|
| MD5 |
8464d1a8baf4c4b95f92c04524b52189
|
|
| BLAKE2b-256 |
5f67c679df499d958423e51fd4193112fed5b8a748a0342c569bd80eb2229720
|
File details
Details for the file plantdoc_predictor-0.2.1-py3-none-any.whl.
File metadata
- Download URL: plantdoc_predictor-0.2.1-py3-none-any.whl
- Upload date:
- Size: 85.9 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b589f8220cfb61df5a5fda59358ccf4975565f87aaff80ec086cbee2418233f
|
|
| MD5 |
ba2c94da0eb93000442ac36d88955d85
|
|
| BLAKE2b-256 |
d8ea2053ed97ced065a60974f6384d484924992ae8c9f1566d5495d94cefa86a
|