You need to agree to share your contact information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this model content.

πŸ… 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