phuong-tk-nguyen
commited on
Commit
•
75f5515
1
Parent(s):
46e2470
Model save
Browse files- README.md +84 -0
- config.json +48 -0
- model.safetensors +3 -0
- preprocessor_config.json +22 -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
|
4 |
+
tags:
|
5 |
+
- generated_from_trainer
|
6 |
+
datasets:
|
7 |
+
- imagefolder
|
8 |
+
metrics:
|
9 |
+
- accuracy
|
10 |
+
model-index:
|
11 |
+
- name: vit-base-patch16-224-newly-trained
|
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.961
|
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 |
+
# vit-base-patch16-224-newly-trained
|
32 |
+
|
33 |
+
This model is a fine-tuned version of [google/vit-base-patch16-224](https://huggingface.co/google/vit-base-patch16-224) on the imagefolder dataset.
|
34 |
+
It achieves the following results on the evaluation set:
|
35 |
+
- Loss: 0.2294
|
36 |
+
- Accuracy: 0.961
|
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: 5e-05
|
56 |
+
- train_batch_size: 32
|
57 |
+
- eval_batch_size: 32
|
58 |
+
- seed: 42
|
59 |
+
- gradient_accumulation_steps: 4
|
60 |
+
- total_train_batch_size: 128
|
61 |
+
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
62 |
+
- lr_scheduler_type: linear
|
63 |
+
- lr_scheduler_warmup_ratio: 0.1
|
64 |
+
- num_epochs: 1
|
65 |
+
|
66 |
+
### Training results
|
67 |
+
|
68 |
+
| Training Loss | Epoch | Step | Validation Loss | Accuracy |
|
69 |
+
|:-------------:|:-----:|:----:|:---------------:|:--------:|
|
70 |
+
| 2.1404 | 0.14 | 10 | 1.6121 | 0.629 |
|
71 |
+
| 1.3709 | 0.28 | 20 | 0.8628 | 0.882 |
|
72 |
+
| 0.8772 | 0.43 | 30 | 0.5010 | 0.933 |
|
73 |
+
| 0.6335 | 0.57 | 40 | 0.3399 | 0.941 |
|
74 |
+
| 0.5387 | 0.71 | 50 | 0.2673 | 0.957 |
|
75 |
+
| 0.4319 | 0.85 | 60 | 0.2386 | 0.958 |
|
76 |
+
| 0.4591 | 0.99 | 70 | 0.2294 | 0.961 |
|
77 |
+
|
78 |
+
|
79 |
+
### Framework versions
|
80 |
+
|
81 |
+
- Transformers 4.35.0
|
82 |
+
- Pytorch 2.1.1
|
83 |
+
- Datasets 2.14.6
|
84 |
+
- Tokenizers 0.14.1
|
config.json
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "google/vit-base-patch16-224",
|
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": "Airplane",
|
13 |
+
"1": "Automobile",
|
14 |
+
"2": "Bird",
|
15 |
+
"3": "Cat",
|
16 |
+
"4": "Deer",
|
17 |
+
"5": "Dog",
|
18 |
+
"6": "Frog",
|
19 |
+
"7": "Horse",
|
20 |
+
"8": "Ship",
|
21 |
+
"9": "Truck"
|
22 |
+
},
|
23 |
+
"image_size": 224,
|
24 |
+
"initializer_range": 0.02,
|
25 |
+
"intermediate_size": 3072,
|
26 |
+
"label2id": {
|
27 |
+
"Airplane": 0,
|
28 |
+
"Automobile": 1,
|
29 |
+
"Bird": 2,
|
30 |
+
"Cat": 3,
|
31 |
+
"Deer": 4,
|
32 |
+
"Dog": 5,
|
33 |
+
"Frog": 6,
|
34 |
+
"Horse": 7,
|
35 |
+
"Ship": 8,
|
36 |
+
"Truck": 9
|
37 |
+
},
|
38 |
+
"layer_norm_eps": 1e-12,
|
39 |
+
"model_type": "vit",
|
40 |
+
"num_attention_heads": 12,
|
41 |
+
"num_channels": 3,
|
42 |
+
"num_hidden_layers": 12,
|
43 |
+
"patch_size": 16,
|
44 |
+
"problem_type": "single_label_classification",
|
45 |
+
"qkv_bias": true,
|
46 |
+
"torch_dtype": "float32",
|
47 |
+
"transformers_version": "4.35.0"
|
48 |
+
}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3c1d3344cb6f688bef2005b840122991e6eb416c3aed97011c88c32db46c6d00
|
3 |
+
size 343248584
|
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": "ViTImageProcessor",
|
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 |
+
}
|
training_args.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a3c6f908a9393c1e422f41765454f24fe07b5c1592f2eb96db894ddcead448b9
|
3 |
+
size 4600
|