Image Classification
Keras
English
potato-disease-classification
plant-disease
computer-vision
agriculture
densenet169
Eval Results (legacy)
Instructions to use Adi2912/DenseNet169_Mendeley with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use Adi2912/DenseNet169_Mendeley with Keras:
# Available backend options are: "jax", "torch", "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" import keras model = keras.saving.load_model("hf://Adi2912/DenseNet169_Mendeley") - Notebooks
- Google Colab
- Kaggle
| library_name: keras | |
| license: apache-2.0 | |
| tags: | |
| - potato-disease-classification | |
| - plant-disease | |
| - computer-vision | |
| - agriculture | |
| - densenet169 | |
| - image-classification | |
| datasets: | |
| - mendeley | |
| model-index: | |
| - name: densenet169_mendeley | |
| results: | |
| - task: | |
| type: image-classification | |
| metrics: | |
| - type: accuracy | |
| value: 0.9156 | |
| - type: f1-score | |
| value: 0.9162 | |
| - type: precision | |
| value: 0.9198 | |
| - type: recall | |
| value: 0.9156 | |
| language: | |
| - en | |
| # DenseNet169 Potato Leaf Disease Classifier (Mendeley Dataset) | |
| ## Model Description | |
| This model is a fine-tuned **DenseNet169** CNN trained for potato leaf disease classification on the **Mendeley Potato Disease Dataset**. The model is designed to detect and classify 7 different potato plant disease categories using leaf images. | |
| ### Key Features | |
| - **Architecture**: DenseNet169 (pre-trained on ImageNet, fine-tuned on Mendeley dataset) | |
| - **Framework**: TensorFlow/Keras | |
| - **Input**: RGB images (224×224 pixels) | |
| - **Classes**: 7 disease categories | |
| - **Format**: `.keras` (Keras 3 format) | |
| ## Model Performance | |
| ### Overall Metrics | |
| - **Accuracy**: 91.56% | |
| - **Precision**: 91.98% | |
| - **Recall**: 91.58% | |
| - **F1-Score**: 91.62% | |
| - **Matthews Correlation Coefficient (MCC)**: 0.8976 | |
| - **Balanced Accuracy**: 90.47% | |
| ### Per-Class Performance | |
| | Class | Precision | Recall | F1-Score | Support | | |
| |-------|-----------|--------|----------|---------| | |
| | Bacteria | 0.97 | 0.98 | 0.98 | 114 | | |
| | Fungi | 0.90 | 0.92 | 0.91 | 150 | | |
| | Healthy | 0.75 | 0.97 | 0.85 | 40 | | |
| | Nematode | 0.92 | 0.79 | 0.85 | 14 | | |
| | Pest | 0.88 | 0.87 | 0.88 | 122 | | |
| | Phytophthora | 0.94 | 0.91 | 0.93 | 69 | | |
| | Virus | 0.98 | 0.89 | 0.93 | 107 | | |
| **Test Set Size**: 616 images | |
| ## Dataset Information | |
| ### Mendeley Potato Disease Dataset | |
| - **Total Images**: ~3,076 images | |
| - **Classes**: 7 disease categories | |
| - Bacteria | |
| - Fungi | |
| - Healthy | |
| - Nematode | |
| - Pest | |
| - Phytophthora | |
| - Virus | |
| - **Data Source**: [Mendeley Data - Potato Leaf Diseases (ptz377bwb8)](https://data.mendeley.com/datasets/ptz377bwb8/1) | |
| - **Characteristics**: Real-world field images with varying lighting, angles, and natural conditions | |
| ## Usage | |
| ### Installation | |
| ```bash | |
| pip install tensorflow keras | |
| ``` | |
| ### Load and Use the Model | |
| ```python | |
| import tensorflow as tf | |
| from tensorflow import keras | |
| from PIL import Image | |
| import numpy as np | |
| # Load the model | |
| model = keras.models.load_model('best.keras') | |
| # Prepare image | |
| image = Image.open('path/to/potato_leaf.jpg') | |
| image = image.resize((224, 224)) | |
| image_array = np.array(image) / 255.0 | |
| image_array = np.expand_dims(image_array, axis=0) | |
| # Make prediction | |
| predictions = model.predict(image_array) | |
| class_names = ['Bacteria', 'Fungi', 'Healthy', 'Nematode', 'Pest', 'Phytophthora', 'Virus'] | |
| predicted_class = class_names[np.argmax(predictions)] | |
| confidence = np.max(predictions) | |
| print(f"Predicted Disease: {predicted_class}") | |
| print(f"Confidence: {confidence:.2%}") | |
| ``` | |
| ### Using Hugging Face Transformers | |
| ```python | |
| # Coming soon - optimized inference pipeline | |
| ``` | |
| ## Training Details | |
| ### Architecture | |
| - **Base Model**: DenseNet169 (ImageNet pre-trained weights) | |
| - **Input Size**: 224×224×3 | |
| - **Total Parameters**: ~14M | |
| - **Custom Head**: Fine-tuned on Mendeley dataset | |
| ### Data Preprocessing | |
| - Image resizing: 224×224 | |
| - Normalization: ImageNet normalization | |
| - Augmentation: Random rotations, flips, brightness adjustments | |
| ### Training Configuration | |
| - **Optimizer**: Adam | |
| - **Loss Function**: Categorical Cross-Entropy | |
| - **Metrics**: Accuracy, Precision, Recall, F1-Score | |
| - **Early Stopping**: Enabled to prevent overfitting | |
| ## Model Card Information | |
| - **Model Name**: DenseNet169 Potato Leaf Disease Classifier | |
| - **Created**: 2026 | |
| - **Framework**: Keras/TensorFlow | |
| - **Model Type**: Image Classification (CNN) | |
| - **License**: Apache 2.0 | |
| ## Intended Use | |
| This model is intended for: | |
| - **Primary Use**: Classification of potato leaf diseases in agricultural applications | |
| - **Supported Use Cases**: | |
| - Automated disease detection systems | |
| - Agricultural advisory systems | |
| - Precision farming applications | |
| - Research and baseline comparisons | |
| ## Limitations | |
| - **Dataset Scope**: Trained exclusively on Mendeley dataset; performance may vary on other potato disease datasets | |
| - **Class Imbalance**: Some classes (Nematode: 14 samples) have limited training data | |
| - **Environmental Factors**: Model trained on field conditions; controlled environment images may perform differently | |
| - **Image Quality**: Requires clear leaf images; heavily obscured or blurry images may reduce accuracy | |
| - **Biological Variation**: Limited to potato plant diseases; not suitable for other crop diseases | |
| ## Related Models | |
| - **DenseNet201 Mendeley**: Alternative architecture with similar performance | |
| - **ResNet50 Mendeley**: Baseline comparison model | |
| - **Models on PlantVillage Dataset**: 3-class variant (Early Blight, Late Blight, Healthy) | |
| ## Citation | |
| If you use this model, please cite: | |
| ```bibtex | |
| @dataset{mendeley_potato_disease, | |
| title = {Potato Leaf Diseases Dataset}, | |
| url = {https://data.mendeley.com/datasets/ptz377bwb8/1} | |
| } | |
| ``` | |
| ## Contact & Support | |
| For questions or issues regarding this model: | |
| - Repository: [Potato-leaf-disease-prediction](https://github.com/krishna/Potato-leaf-disease-prediction) | |
| - Dataset Issues: Reference the Mendeley dataset documentation | |
| ## Disclaimer | |
| This model should be used as a reference tool and not as the sole basis for agricultural decisions. Always consult with agricultural experts for accurate disease diagnosis and treatment recommendations. | |
| --- | |
| **Model Version**: 1.0 | |
| **Last Updated**: May 2026 | |
| **Framework**: TensorFlow 2.x / Keras 3 | |
| **Python Version**: 3.8+ |