EfficientNet-B3 for Rice Disease Classification

This model is fine-tuned on the Rice Disease Augmented dataset to classify different rice diseases.

Classes

[0, 1, 2, 3]

Metrices

After training the model achieved

  • an overall accuracy of: 94.30 %
  • precision: 94.3403
  • recall: 94.3001
  • f1_score: 94.2545

Usage

from transformers import AutoFeatureExtractor, AutoModelForImageClassification
import torch
from PIL import Image

# Load the model and feature extractor
model = AutoModelForImageClassification.from_pretrained("Subh775/Rice-Disease-Classification-ENet_B3")
feature_extractor = AutoFeatureExtractor.from_pretrained("Subh775/Rice-Disease-Classification-ENet_B3")

# Load an image
image = Image.open("path/to/image.jpg")

# Preprocess the image
inputs = feature_extractor(images=image, return_tensors="pt")

# Get predictions
with torch.no_grad():
    logits = model(**inputs).logits
    predicted_class_idx = logits.argmax(-1).item()

# Convert to class name
class_names = [0, 1, 2, 3]
print(f"Predicted class: {class_names[predicted_class_idx]}")
Downloads last month
36
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Dataset used to train Subh775/Rice-Disease-Classification-ENet_B3