metadata
license: mit
datasets:
- issai/Central_Asian_Food_Dataset
language:
- en
metrics:
- accuracy
base_model:
- microsoft/resnet-50
pipeline_tag: image-classification
tags:
- classification
- image
- resnet
- pytorch
- safetensors
library_name: transformers
ResNet-50 Model for Central Asian Image Classification
Model Description
This is a pre-trained ResNet-50 model fine-tuned on the Central Asian Food Dataset. The model is used for image classification across multiple classes. The data was split into training, validation, and test sets. The model was trained using gradient descent with an SGD optimizer and CrossEntropyLoss as the loss function.
Training Parameters
- Epochs: 25
- Batch Size: 32
- Learning Rate: 0.001
- Optimizer: SGD with momentum of 0.9
- Loss Function: CrossEntropyLoss
Results
Training and Validation
Stage | Loss (train) | Accuracy (train) | Loss (val) | Accuracy (val) |
---|---|---|---|---|
Epoch 1 | 1.2345 | 85.00% | 1.4567 | 82.00% |
Epoch 2 | 1.0456 | 86.00% | 1.2345 | 83.00% |
... | ... | ... | ... | ... |
Epoch 25 | 0.6789 | 90.00% | 0.7890 | 87.00% |
Model was trained on two T4 GPUs in a Kaggle notebook
Best validation accuracy: 87%
Testing
After training, the model was tested on the test set:
- Test accuracy: 87%
Repository Structure
model.py
— Code for training and testing the modeldataset/
— Folder containing the data (train, val, test)trained_model/
— Saved model in SafeTensors format
Usage Instructions
from transformers import AutoModelForImageClassification from huggingface_hub import hf_hub_download from safetensors.torch import load_file
repo_id = "Eraly-ml/centraasia-ResNet-50" filename = "resnet50_central_asian_food.safetensors"
Load model
model_path = hf_hub_download(repo_id=repo_id, filename=filename)
model = AutoModelForImageClassification.from_pretrained(repo_id)
model.load_state_dict(load_file(model_path))
My telegram @eralyf