File size: 2,250 Bytes
388a902
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a819248
388a902
 
7410a1f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a819248
 
 
 
 
 
77afc22
989911a
a819248
 
 
989911a
a9f37ea
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
---
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 model
- `dataset/` — 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