DenseNet169 Potato Leaf Disease Classifier (PlantVillage Dataset)

Model Description

This model is a fine-tuned DenseNet169 CNN trained for potato leaf disease classification on the PlantVillage Potato Dataset. The model is designed to detect and classify 3 different potato plant disease categories using leaf images in controlled environments.

Key Features

  • Architecture: DenseNet169 (pre-trained on ImageNet, fine-tuned on PlantVillage dataset)
  • Framework: TensorFlow/Keras
  • Input: RGB images (224ร—224 pixels)
  • Classes: 3 disease categories
  • Format: .keras (Keras 3 format)

Model Performance

Overall Metrics

  • Accuracy: 100.00%
  • Precision: 100.00%
  • Recall: 100.00%
  • F1-Score: 100.00%
  • Matthews Correlation Coefficient (MCC): 1.0
  • Balanced Accuracy: 100.00%

Per-Class Performance

Class Precision Recall F1-Score Support
Early Blight 1.00 1.00 1.00 200
Late Blight 1.00 1.00 1.00 200
Healthy 1.00 1.00 1.00 31

Test Set Size: 431 images

Dataset Information

PlantVillage Potato Dataset

  • Total Images: ~2,152 images
  • Classes: 3 disease categories
    • Potato Early Blight
    • Potato Late Blight
    • Potato Healthy
  • Data Source: PlantVillage Dataset (Kaggle)
  • Characteristics: Controlled environment images with consistent lighting and clean backgrounds

Usage

Installation

pip install tensorflow keras

Load and Use the Model

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 = ['Early Blight', 'Late Blight', 'Healthy']
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

# 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 PlantVillage 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
  • Epochs: 25 (with early stopping)
  • Training Strategy: Transfer learning with fine-tuning

Training Performance

  • Training Accuracy Range: 93.38% โ†’ 100%
  • Validation Accuracy Range: 95.59% โ†’ 100%
  • Final Training Loss: 0.000678
  • Final Validation Loss: ~0.0005
  • Convergence: Achieved near-perfect performance by epoch 10, maintained through epoch 25

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 PlantVillage dataset (controlled environment); performance may vary significantly on real-world field images
  • Controlled Conditions: Model trained on images with consistent lighting and clean backgrounds; may underperform on field images with varying conditions
  • Class Focus: Only covers 3 potato disease classes (Early Blight, Late Blight, Healthy); cannot detect other potato diseases or crop diseases
  • Perfect Metrics Caution: 100% accuracy on test set may indicate small test set or dataset characteristics; validate on real-world data before deployment
  • Image Requirements: Requires clear, well-lit leaf images; heavily obscured or extremely blurry images may reduce accuracy
  • Environmental Sensitivity: Best performance in controlled or semi-controlled environments similar to PlantVillage dataset conditions

Related Models

  • DenseNet201 PlantVillage: Alternative architecture on same PlantVillage dataset
  • ResNet50 PlantVillage: Baseline comparison model on PlantVillage dataset
  • DenseNet169 Mendeley: Multi-class variant (7 diseases) on Mendeley dataset for comparison

Citation

If you use this model, please cite:

@dataset{plantvillage_potato,
  title = {PlantVillage Dataset - Plant Disease Classification},
  url = {https://www.kaggle.com/datasets/emmarex/plantdisease}
}

Contact & Support

For questions or issues regarding this model:

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+

Downloads last month
2
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Evaluation results