AkshilShah21
commited on
Commit
•
28761ea
1
Parent(s):
86a3224
Model save
Browse files- README.md +84 -0
- config.json +96 -0
- preprocessor_config.json +22 -0
- pytorch_model.bin +3 -0
- training_args.bin +3 -0
README.md
ADDED
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
base_model: google/vit-base-patch16-224-in21k
|
4 |
+
tags:
|
5 |
+
- generated_from_trainer
|
6 |
+
datasets:
|
7 |
+
- imagefolder
|
8 |
+
metrics:
|
9 |
+
- accuracy
|
10 |
+
model-index:
|
11 |
+
- name: finetuned-food
|
12 |
+
results:
|
13 |
+
- task:
|
14 |
+
name: Image Classification
|
15 |
+
type: image-classification
|
16 |
+
dataset:
|
17 |
+
name: imagefolder
|
18 |
+
type: imagefolder
|
19 |
+
config: default
|
20 |
+
split: train
|
21 |
+
args: default
|
22 |
+
metrics:
|
23 |
+
- name: Accuracy
|
24 |
+
type: accuracy
|
25 |
+
value: 0.9281675392670157
|
26 |
+
---
|
27 |
+
|
28 |
+
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
29 |
+
should probably proofread and complete it, then remove this comment. -->
|
30 |
+
|
31 |
+
# finetuned-food
|
32 |
+
|
33 |
+
This model is a fine-tuned version of [google/vit-base-patch16-224-in21k](https://huggingface.co/google/vit-base-patch16-224-in21k) on the imagefolder dataset.
|
34 |
+
It achieves the following results on the evaluation set:
|
35 |
+
- Loss: 0.2816
|
36 |
+
- Accuracy: 0.9282
|
37 |
+
|
38 |
+
## Model description
|
39 |
+
|
40 |
+
More information needed
|
41 |
+
|
42 |
+
## Intended uses & limitations
|
43 |
+
|
44 |
+
More information needed
|
45 |
+
|
46 |
+
## Training and evaluation data
|
47 |
+
|
48 |
+
More information needed
|
49 |
+
|
50 |
+
## Training procedure
|
51 |
+
|
52 |
+
### Training hyperparameters
|
53 |
+
|
54 |
+
The following hyperparameters were used during training:
|
55 |
+
- learning_rate: 0.0002
|
56 |
+
- train_batch_size: 15
|
57 |
+
- eval_batch_size: 8
|
58 |
+
- seed: 42
|
59 |
+
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
60 |
+
- lr_scheduler_type: linear
|
61 |
+
- num_epochs: 4
|
62 |
+
|
63 |
+
### Training results
|
64 |
+
|
65 |
+
| Training Loss | Epoch | Step | Validation Loss | Accuracy |
|
66 |
+
|:-------------:|:-----:|:----:|:---------------:|:--------:|
|
67 |
+
| 0.8456 | 0.39 | 500 | 0.8593 | 0.7634 |
|
68 |
+
| 0.7824 | 0.78 | 1000 | 0.6625 | 0.8172 |
|
69 |
+
| 0.4806 | 1.18 | 1500 | 0.4951 | 0.8618 |
|
70 |
+
| 0.6206 | 1.57 | 2000 | 0.4434 | 0.88 |
|
71 |
+
| 0.5096 | 1.96 | 2500 | 0.4937 | 0.8683 |
|
72 |
+
| 0.4576 | 2.35 | 3000 | 0.4060 | 0.8907 |
|
73 |
+
| 0.3284 | 2.75 | 3500 | 0.3414 | 0.9081 |
|
74 |
+
| 0.2022 | 3.14 | 4000 | 0.3330 | 0.9118 |
|
75 |
+
| 0.1332 | 3.53 | 4500 | 0.3043 | 0.9208 |
|
76 |
+
| 0.1821 | 3.92 | 5000 | 0.2816 | 0.9282 |
|
77 |
+
|
78 |
+
|
79 |
+
### Framework versions
|
80 |
+
|
81 |
+
- Transformers 4.32.1
|
82 |
+
- Pytorch 2.2.0.post100
|
83 |
+
- Datasets 2.12.0
|
84 |
+
- Tokenizers 0.13.2
|
config.json
ADDED
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "google/vit-base-patch16-224-in21k",
|
3 |
+
"architectures": [
|
4 |
+
"ViTForImageClassification"
|
5 |
+
],
|
6 |
+
"attention_probs_dropout_prob": 0.0,
|
7 |
+
"encoder_stride": 16,
|
8 |
+
"hidden_act": "gelu",
|
9 |
+
"hidden_dropout_prob": 0.0,
|
10 |
+
"hidden_size": 768,
|
11 |
+
"id2label": {
|
12 |
+
"0": "Baked Potato",
|
13 |
+
"1": "Crispy Chicken",
|
14 |
+
"10": "butter_naan",
|
15 |
+
"11": "chai",
|
16 |
+
"12": "chapati",
|
17 |
+
"13": "cheesecake",
|
18 |
+
"14": "chicken_curry",
|
19 |
+
"15": "chole_bhature",
|
20 |
+
"16": "dal_makhani",
|
21 |
+
"17": "dhokla",
|
22 |
+
"18": "fried_rice",
|
23 |
+
"19": "ice_cream",
|
24 |
+
"2": "Donut",
|
25 |
+
"20": "idli",
|
26 |
+
"21": "jalebi",
|
27 |
+
"22": "kaathi_rolls",
|
28 |
+
"23": "kadai_paneer",
|
29 |
+
"24": "kulfi",
|
30 |
+
"25": "masala_dosa",
|
31 |
+
"26": "momos",
|
32 |
+
"27": "omelette",
|
33 |
+
"28": "paani_puri",
|
34 |
+
"29": "pakode",
|
35 |
+
"3": "Fries",
|
36 |
+
"30": "pav_bhaji",
|
37 |
+
"31": "pizza",
|
38 |
+
"32": "samosa",
|
39 |
+
"33": "sushi",
|
40 |
+
"4": "Hot Dog",
|
41 |
+
"5": "Sandwich",
|
42 |
+
"6": "Taco",
|
43 |
+
"7": "Taquito",
|
44 |
+
"8": "apple_pie",
|
45 |
+
"9": "burger"
|
46 |
+
},
|
47 |
+
"image_size": 224,
|
48 |
+
"initializer_range": 0.02,
|
49 |
+
"intermediate_size": 3072,
|
50 |
+
"label2id": {
|
51 |
+
"Baked Potato": "0",
|
52 |
+
"Crispy Chicken": "1",
|
53 |
+
"Donut": "2",
|
54 |
+
"Fries": "3",
|
55 |
+
"Hot Dog": "4",
|
56 |
+
"Sandwich": "5",
|
57 |
+
"Taco": "6",
|
58 |
+
"Taquito": "7",
|
59 |
+
"apple_pie": "8",
|
60 |
+
"burger": "9",
|
61 |
+
"butter_naan": "10",
|
62 |
+
"chai": "11",
|
63 |
+
"chapati": "12",
|
64 |
+
"cheesecake": "13",
|
65 |
+
"chicken_curry": "14",
|
66 |
+
"chole_bhature": "15",
|
67 |
+
"dal_makhani": "16",
|
68 |
+
"dhokla": "17",
|
69 |
+
"fried_rice": "18",
|
70 |
+
"ice_cream": "19",
|
71 |
+
"idli": "20",
|
72 |
+
"jalebi": "21",
|
73 |
+
"kaathi_rolls": "22",
|
74 |
+
"kadai_paneer": "23",
|
75 |
+
"kulfi": "24",
|
76 |
+
"masala_dosa": "25",
|
77 |
+
"momos": "26",
|
78 |
+
"omelette": "27",
|
79 |
+
"paani_puri": "28",
|
80 |
+
"pakode": "29",
|
81 |
+
"pav_bhaji": "30",
|
82 |
+
"pizza": "31",
|
83 |
+
"samosa": "32",
|
84 |
+
"sushi": "33"
|
85 |
+
},
|
86 |
+
"layer_norm_eps": 1e-12,
|
87 |
+
"model_type": "vit",
|
88 |
+
"num_attention_heads": 12,
|
89 |
+
"num_channels": 3,
|
90 |
+
"num_hidden_layers": 12,
|
91 |
+
"patch_size": 16,
|
92 |
+
"problem_type": "single_label_classification",
|
93 |
+
"qkv_bias": true,
|
94 |
+
"torch_dtype": "float32",
|
95 |
+
"transformers_version": "4.32.1"
|
96 |
+
}
|
preprocessor_config.json
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"do_normalize": true,
|
3 |
+
"do_rescale": true,
|
4 |
+
"do_resize": true,
|
5 |
+
"image_mean": [
|
6 |
+
0.5,
|
7 |
+
0.5,
|
8 |
+
0.5
|
9 |
+
],
|
10 |
+
"image_processor_type": "ViTFeatureExtractor",
|
11 |
+
"image_std": [
|
12 |
+
0.5,
|
13 |
+
0.5,
|
14 |
+
0.5
|
15 |
+
],
|
16 |
+
"resample": 2,
|
17 |
+
"rescale_factor": 0.00392156862745098,
|
18 |
+
"size": {
|
19 |
+
"height": 224,
|
20 |
+
"width": 224
|
21 |
+
}
|
22 |
+
}
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a4dc6800f50952498967f69270051be96255280ed7c69bd7c82d90f87daa3d1c
|
3 |
+
size 343364842
|
training_args.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3f8b98fd9e7016f48ca63d587c99400075c39807cbe862d5fcb25ae4e48e69df
|
3 |
+
size 4472
|