π Tomato Leaf Disease Detection Model (v1)
This model is designed to detect and classify tomato leaf diseases using deep learning (TensorFlow/Keras). It is trained on a curated dataset of tomato leaves, including healthy samples and various common diseases.
π§ Model Details
- Framework: TensorFlow / Keras
- Format:
.h5
(HDF5) - Model Type: CNN-based image classifier
- Input: RGB image (resized to
256x256
or the model's expected input shape) - Output: Predicted class label (e.g., Healthy, Early Blight, Late Blight, etc.)
π·οΈ Classes / Labels
Labels used during training are mapped using the class_indices.json
file.
Example:
{
"0": "Tomato_Bacterial_spot",
"1": "Tomato_Early_blight",
"2": "Tomato_Late_blight",
"3": "Tomato_Leaf_Mold",
"4": "Tomato_Septoria_leaf_spot",
"5": "Tomato_Spider_mites_Two_spotted_spider_mite",
"6": "Tomato__Target_Spot",
"7": "Tomato__Tomato_YellowLeaf__Curl_Virus",
"8": "Tomato__Tomato_mosaic_virus",
"9": "Tomato_healthy"
}
π Files in This Repository
File | Description |
---|---|
best_model.h5 |
Final trained model |
tomato_disease_model_v1.h5 |
Backup or alternate trained model |
class_indices.json |
Mapping of class names to label indices |
π How to Use
Load the Model and Predict
from tensorflow.keras.models import load_model
import json
import numpy as np
from tensorflow.keras.preprocessing import image
# Load model
model = load_model("best_model.h5")
# Load class indices
with open("class_indices.json", "r") as f:
class_indices = json.load(f)
# Reverse class mapping
class_labels = {v: k for k, v in class_indices.items()}
# Load and preprocess image
img = image.load_img("path_to_image.jpg", target_size=(224, 224))
img_array = image.img_to_array(img)
img_array = np.expand_dims(img_array, axis=0) / 255.0
# Make prediction
prediction = model.predict(img_array)
predicted_class = class_labels[np.argmax(prediction)]
print(f"Predicted Disease: {predicted_class}")
π¦ Intended Use
This model is intended for:
- Research and prototyping
- Agricultural assistance applications
- Academic projects related to plant disease detection
Note: This model is not intended for medical or commercial agricultural decision-making without expert supervision.
π Training Details
- Dataset: Custom dataset including images of tomato leaves with various diseases
- Model: Custom CNN
- Optimizer: Adam
- Loss Function: Categorical Crossentropy
- Accuracy Achieved: Approximately 94%
π License
This model is licensed under the Apache 2.0 License.
πββοΈ Author
Abdullah Zunorain Email: [[email protected]] GitHub: https://github.com/abdullahzunorain
π Citation
@misc{abdullahzunorain2025tomato,
title={Tomato Leaf Disease Detection Model (v1)},
author={Abdullah Zunorain},
year={2025},
url={https://huggingface.co/abdullahzunorain/tomato_leaf_disease_det_model_v1},
note={Hugging Face}
}
π DOI
DOI: 10.57967/hf/5733
- Downloads last month
- 0
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
π
Ask for provider support