CoolFace
Modelpublic

vGiacomov/image-classifier-beans

sourceHugging Faceapache-2.0updated 1y agoView on Hugging Face
0likes
Model Card

ResNet18 Fine-tuned on Beans Dataset

This model was trained in Google Colab using a T4 GPU and tracked with MLflow.

Model Details

Dataset: Beans

Classes:

  • Healthy
  • Bean Rust
  • Angular Leaf Spot

Validation Accuracy: 0.9398

Training Configuration

Overfitting Prevention Techniques:

  • Data augmentation (rotation, flip, crop, color jitter)
  • Dropout (30%)
  • L2 regularization (weight decay: 1e-4)
  • Learning rate scheduling (ReduceLROnPlateau)
  • Best model selection based on validation accuracy

Hyperparameters:

  • Learning Rate: 5e-05
  • Epochs: 10
  • Batch Size: 32
  • Weight Decay: 0.0001
  • Dropout: 0.3
  • Optimizer: Adam

Artifacts

  • resnet18_beans.pth - PyTorch model weights
  • per_class_metrics.csv - Detailed per-class metrics
  • confusion_matrix.png - Confusion matrix visualization

Usage

Download and load the model:

from huggingfacehub import hfhub_download import torch from torchvision import models from torch import nn

modelpath = hfhubdownload( repoid="vGiacomov/image-classifier-beans", filename="resnet18_beans.pth" )

model = models.resnet18() model.fc = nn.Sequential( nn.Dropout(0.3), nn.Linear(model.fc.infeatures, 3) ) model.loadstatedict(torch.load(modelpath, map_location="cpu")) model.eval()

Apache 2.0