generated_from_trainer

Fine-Tuned ViT for Beans Leaf Disease Classification

Model Information

Problem Statement

The goal of this model is to classify leaf images into three categories:

{
  "angular_leaf_spot": 0,
  "bean_rust": 1,
  "healthy": 2,
}

image/png

Training results

Training Loss Epoch Step Validation Loss Accuracy
0.1495 1.54 100 0.0910 0.9774
0.0121 3.08 200 0.0155 1.0

Framework versions

Get Started With The Model:

! pip -q  install datasets transformers[torch]

from transformers import pipeline
from PIL import Image

# Use a pipeline as a high-level helper

pipe = pipeline("image-classification", model="ayoubkirouane/VIT_Beans_Leaf_Disease_Classifier")

# Load the image

image_path = "Your image_path "
image = Image.open(image_path)

# Run inference using the pipeline
result = pipe(image)

# The result contains the predicted label and the corresponding score
predicted_label = result[0]['label']
confidence_score = result[0]['score']

print(f"Predicted Label: {predicted_label}")
print(f"Confidence Score: {confidence_score}")