jona
Browse files- README.md +64 -0
- all_results.json +13 -0
- config.json +34 -0
- eval_results.json +8 -0
- model.safetensors +3 -0
- preprocessor_config.json +36 -0
- runs/Jul04_01-50-23_042afe4fc77d/events.out.tfevents.1720059218.042afe4fc77d.1289.0 +3 -0
- runs/Jul04_01-50-23_042afe4fc77d/events.out.tfevents.1720060034.042afe4fc77d.1289.1 +3 -0
- train_results.json +8 -0
- trainer_state.json +242 -0
- training_args.bin +3 -0
README.md
ADDED
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
base_model: google/vit-base-patch16-224-in21k
|
4 |
+
tags:
|
5 |
+
- image-classification
|
6 |
+
- ViT
|
7 |
+
- generated_from_trainer
|
8 |
+
metrics:
|
9 |
+
- accuracy
|
10 |
+
model-index:
|
11 |
+
- name: vit-base-beans-demo-v5
|
12 |
+
results: []
|
13 |
+
---
|
14 |
+
|
15 |
+
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
16 |
+
should probably proofread and complete it, then remove this comment. -->
|
17 |
+
|
18 |
+
# vit-base-beans-demo-v5
|
19 |
+
|
20 |
+
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 beans dataset.
|
21 |
+
It achieves the following results on the evaluation set:
|
22 |
+
- Loss: 0.0956
|
23 |
+
- Accuracy: 0.9766
|
24 |
+
|
25 |
+
## Model description
|
26 |
+
|
27 |
+
More information needed
|
28 |
+
|
29 |
+
## Intended uses & limitations
|
30 |
+
|
31 |
+
More information needed
|
32 |
+
|
33 |
+
## Training and evaluation data
|
34 |
+
|
35 |
+
More information needed
|
36 |
+
|
37 |
+
## Training procedure
|
38 |
+
|
39 |
+
### Training hyperparameters
|
40 |
+
|
41 |
+
The following hyperparameters were used during training:
|
42 |
+
- learning_rate: 0.0002
|
43 |
+
- train_batch_size: 16
|
44 |
+
- eval_batch_size: 8
|
45 |
+
- seed: 42
|
46 |
+
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
47 |
+
- lr_scheduler_type: linear
|
48 |
+
- num_epochs: 4
|
49 |
+
- mixed_precision_training: Native AMP
|
50 |
+
|
51 |
+
### Training results
|
52 |
+
|
53 |
+
| Training Loss | Epoch | Step | Validation Loss | Accuracy |
|
54 |
+
|:-------------:|:------:|:----:|:---------------:|:--------:|
|
55 |
+
| 0.0997 | 1.5385 | 100 | 0.0864 | 0.9774 |
|
56 |
+
| 0.0125 | 3.0769 | 200 | 0.0663 | 0.9774 |
|
57 |
+
|
58 |
+
|
59 |
+
### Framework versions
|
60 |
+
|
61 |
+
- Transformers 4.41.2
|
62 |
+
- Pytorch 2.3.0+cu121
|
63 |
+
- Datasets 2.20.0
|
64 |
+
- Tokenizers 0.19.1
|
all_results.json
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"epoch": 4.0,
|
3 |
+
"eval_accuracy": 0.9765625,
|
4 |
+
"eval_loss": 0.09561598300933838,
|
5 |
+
"eval_runtime": 3.09,
|
6 |
+
"eval_samples_per_second": 41.424,
|
7 |
+
"eval_steps_per_second": 5.178,
|
8 |
+
"total_flos": 3.205097416476426e+17,
|
9 |
+
"train_loss": 0.11540300791653303,
|
10 |
+
"train_runtime": 92.7413,
|
11 |
+
"train_samples_per_second": 44.597,
|
12 |
+
"train_steps_per_second": 2.803
|
13 |
+
}
|
config.json
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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": "angular_leaf_spot",
|
13 |
+
"1": "bean_rust",
|
14 |
+
"2": "healthy"
|
15 |
+
},
|
16 |
+
"image_size": 224,
|
17 |
+
"initializer_range": 0.02,
|
18 |
+
"intermediate_size": 3072,
|
19 |
+
"label2id": {
|
20 |
+
"angular_leaf_spot": "0",
|
21 |
+
"bean_rust": "1",
|
22 |
+
"healthy": "2"
|
23 |
+
},
|
24 |
+
"layer_norm_eps": 1e-12,
|
25 |
+
"model_type": "vit",
|
26 |
+
"num_attention_heads": 12,
|
27 |
+
"num_channels": 3,
|
28 |
+
"num_hidden_layers": 12,
|
29 |
+
"patch_size": 16,
|
30 |
+
"problem_type": "single_label_classification",
|
31 |
+
"qkv_bias": true,
|
32 |
+
"torch_dtype": "float32",
|
33 |
+
"transformers_version": "4.41.2"
|
34 |
+
}
|
eval_results.json
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"epoch": 4.0,
|
3 |
+
"eval_accuracy": 0.9765625,
|
4 |
+
"eval_loss": 0.09561598300933838,
|
5 |
+
"eval_runtime": 3.09,
|
6 |
+
"eval_samples_per_second": 41.424,
|
7 |
+
"eval_steps_per_second": 5.178
|
8 |
+
}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f69e6045676c8279eb11af0774c8716441bb9dbba7d959e757b359eb82a0bfe2
|
3 |
+
size 343227052
|
preprocessor_config.json
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_valid_processor_keys": [
|
3 |
+
"images",
|
4 |
+
"do_resize",
|
5 |
+
"size",
|
6 |
+
"resample",
|
7 |
+
"do_rescale",
|
8 |
+
"rescale_factor",
|
9 |
+
"do_normalize",
|
10 |
+
"image_mean",
|
11 |
+
"image_std",
|
12 |
+
"return_tensors",
|
13 |
+
"data_format",
|
14 |
+
"input_data_format"
|
15 |
+
],
|
16 |
+
"do_normalize": true,
|
17 |
+
"do_rescale": true,
|
18 |
+
"do_resize": true,
|
19 |
+
"image_mean": [
|
20 |
+
0.5,
|
21 |
+
0.5,
|
22 |
+
0.5
|
23 |
+
],
|
24 |
+
"image_processor_type": "ViTFeatureExtractor",
|
25 |
+
"image_std": [
|
26 |
+
0.5,
|
27 |
+
0.5,
|
28 |
+
0.5
|
29 |
+
],
|
30 |
+
"resample": 2,
|
31 |
+
"rescale_factor": 0.00392156862745098,
|
32 |
+
"size": {
|
33 |
+
"height": 224,
|
34 |
+
"width": 224
|
35 |
+
}
|
36 |
+
}
|
runs/Jul04_01-50-23_042afe4fc77d/events.out.tfevents.1720059218.042afe4fc77d.1289.0
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4578c05cf2d441e66f95cc0d6534ac5783c184ef71c94d5e2539d97ebcb4762d
|
3 |
+
size 11323
|
runs/Jul04_01-50-23_042afe4fc77d/events.out.tfevents.1720060034.042afe4fc77d.1289.1
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:81f007abc1da1085240a011280b565929acb359a78ec1114e17df8437b04ffc3
|
3 |
+
size 411
|
train_results.json
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"epoch": 4.0,
|
3 |
+
"total_flos": 3.205097416476426e+17,
|
4 |
+
"train_loss": 0.11540300791653303,
|
5 |
+
"train_runtime": 92.7413,
|
6 |
+
"train_samples_per_second": 44.597,
|
7 |
+
"train_steps_per_second": 2.803
|
8 |
+
}
|
trainer_state.json
ADDED
@@ -0,0 +1,242 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"best_metric": 0.06634166091680527,
|
3 |
+
"best_model_checkpoint": "./vit-base-beans-demo-v5/checkpoint-200",
|
4 |
+
"epoch": 4.0,
|
5 |
+
"eval_steps": 100,
|
6 |
+
"global_step": 260,
|
7 |
+
"is_hyper_param_search": false,
|
8 |
+
"is_local_process_zero": true,
|
9 |
+
"is_world_process_zero": true,
|
10 |
+
"log_history": [
|
11 |
+
{
|
12 |
+
"epoch": 0.15384615384615385,
|
13 |
+
"grad_norm": 1.5509302616119385,
|
14 |
+
"learning_rate": 0.00019230769230769233,
|
15 |
+
"loss": 0.7749,
|
16 |
+
"step": 10
|
17 |
+
},
|
18 |
+
{
|
19 |
+
"epoch": 0.3076923076923077,
|
20 |
+
"grad_norm": 3.293163299560547,
|
21 |
+
"learning_rate": 0.00018461538461538463,
|
22 |
+
"loss": 0.2869,
|
23 |
+
"step": 20
|
24 |
+
},
|
25 |
+
{
|
26 |
+
"epoch": 0.46153846153846156,
|
27 |
+
"grad_norm": 0.553378701210022,
|
28 |
+
"learning_rate": 0.00017692307692307693,
|
29 |
+
"loss": 0.2031,
|
30 |
+
"step": 30
|
31 |
+
},
|
32 |
+
{
|
33 |
+
"epoch": 0.6153846153846154,
|
34 |
+
"grad_norm": 1.476561427116394,
|
35 |
+
"learning_rate": 0.00016923076923076923,
|
36 |
+
"loss": 0.2127,
|
37 |
+
"step": 40
|
38 |
+
},
|
39 |
+
{
|
40 |
+
"epoch": 0.7692307692307693,
|
41 |
+
"grad_norm": 1.6264675855636597,
|
42 |
+
"learning_rate": 0.00016153846153846155,
|
43 |
+
"loss": 0.1767,
|
44 |
+
"step": 50
|
45 |
+
},
|
46 |
+
{
|
47 |
+
"epoch": 0.9230769230769231,
|
48 |
+
"grad_norm": 3.1017961502075195,
|
49 |
+
"learning_rate": 0.00015384615384615385,
|
50 |
+
"loss": 0.2664,
|
51 |
+
"step": 60
|
52 |
+
},
|
53 |
+
{
|
54 |
+
"epoch": 1.0769230769230769,
|
55 |
+
"grad_norm": 0.2297724187374115,
|
56 |
+
"learning_rate": 0.00014615384615384615,
|
57 |
+
"loss": 0.095,
|
58 |
+
"step": 70
|
59 |
+
},
|
60 |
+
{
|
61 |
+
"epoch": 1.2307692307692308,
|
62 |
+
"grad_norm": 0.13144992291927338,
|
63 |
+
"learning_rate": 0.00013846153846153847,
|
64 |
+
"loss": 0.1187,
|
65 |
+
"step": 80
|
66 |
+
},
|
67 |
+
{
|
68 |
+
"epoch": 1.3846153846153846,
|
69 |
+
"grad_norm": 0.14720702171325684,
|
70 |
+
"learning_rate": 0.00013076923076923077,
|
71 |
+
"loss": 0.0459,
|
72 |
+
"step": 90
|
73 |
+
},
|
74 |
+
{
|
75 |
+
"epoch": 1.5384615384615383,
|
76 |
+
"grad_norm": 2.3203179836273193,
|
77 |
+
"learning_rate": 0.0001230769230769231,
|
78 |
+
"loss": 0.0997,
|
79 |
+
"step": 100
|
80 |
+
},
|
81 |
+
{
|
82 |
+
"epoch": 1.5384615384615383,
|
83 |
+
"eval_accuracy": 0.9774436090225563,
|
84 |
+
"eval_loss": 0.08642897754907608,
|
85 |
+
"eval_runtime": 1.3472,
|
86 |
+
"eval_samples_per_second": 98.724,
|
87 |
+
"eval_steps_per_second": 12.619,
|
88 |
+
"step": 100
|
89 |
+
},
|
90 |
+
{
|
91 |
+
"epoch": 1.6923076923076923,
|
92 |
+
"grad_norm": 1.8982298374176025,
|
93 |
+
"learning_rate": 0.00011538461538461538,
|
94 |
+
"loss": 0.1221,
|
95 |
+
"step": 110
|
96 |
+
},
|
97 |
+
{
|
98 |
+
"epoch": 1.8461538461538463,
|
99 |
+
"grad_norm": 1.9391183853149414,
|
100 |
+
"learning_rate": 0.0001076923076923077,
|
101 |
+
"loss": 0.1486,
|
102 |
+
"step": 120
|
103 |
+
},
|
104 |
+
{
|
105 |
+
"epoch": 2.0,
|
106 |
+
"grad_norm": 0.1778109073638916,
|
107 |
+
"learning_rate": 0.0001,
|
108 |
+
"loss": 0.0905,
|
109 |
+
"step": 130
|
110 |
+
},
|
111 |
+
{
|
112 |
+
"epoch": 2.1538461538461537,
|
113 |
+
"grad_norm": 0.08789520710706711,
|
114 |
+
"learning_rate": 9.230769230769232e-05,
|
115 |
+
"loss": 0.0415,
|
116 |
+
"step": 140
|
117 |
+
},
|
118 |
+
{
|
119 |
+
"epoch": 2.3076923076923075,
|
120 |
+
"grad_norm": 0.12370666861534119,
|
121 |
+
"learning_rate": 8.461538461538461e-05,
|
122 |
+
"loss": 0.054,
|
123 |
+
"step": 150
|
124 |
+
},
|
125 |
+
{
|
126 |
+
"epoch": 2.4615384615384617,
|
127 |
+
"grad_norm": 0.4401356875896454,
|
128 |
+
"learning_rate": 7.692307692307693e-05,
|
129 |
+
"loss": 0.033,
|
130 |
+
"step": 160
|
131 |
+
},
|
132 |
+
{
|
133 |
+
"epoch": 2.6153846153846154,
|
134 |
+
"grad_norm": 0.0808761939406395,
|
135 |
+
"learning_rate": 6.923076923076924e-05,
|
136 |
+
"loss": 0.0299,
|
137 |
+
"step": 170
|
138 |
+
},
|
139 |
+
{
|
140 |
+
"epoch": 2.769230769230769,
|
141 |
+
"grad_norm": 10.307175636291504,
|
142 |
+
"learning_rate": 6.153846153846155e-05,
|
143 |
+
"loss": 0.0259,
|
144 |
+
"step": 180
|
145 |
+
},
|
146 |
+
{
|
147 |
+
"epoch": 2.9230769230769234,
|
148 |
+
"grad_norm": 1.5089224576950073,
|
149 |
+
"learning_rate": 5.384615384615385e-05,
|
150 |
+
"loss": 0.069,
|
151 |
+
"step": 190
|
152 |
+
},
|
153 |
+
{
|
154 |
+
"epoch": 3.076923076923077,
|
155 |
+
"grad_norm": 0.06397894024848938,
|
156 |
+
"learning_rate": 4.615384615384616e-05,
|
157 |
+
"loss": 0.0125,
|
158 |
+
"step": 200
|
159 |
+
},
|
160 |
+
{
|
161 |
+
"epoch": 3.076923076923077,
|
162 |
+
"eval_accuracy": 0.9774436090225563,
|
163 |
+
"eval_loss": 0.06634166091680527,
|
164 |
+
"eval_runtime": 1.2786,
|
165 |
+
"eval_samples_per_second": 104.016,
|
166 |
+
"eval_steps_per_second": 13.295,
|
167 |
+
"step": 200
|
168 |
+
},
|
169 |
+
{
|
170 |
+
"epoch": 3.230769230769231,
|
171 |
+
"grad_norm": 0.06174139305949211,
|
172 |
+
"learning_rate": 3.846153846153846e-05,
|
173 |
+
"loss": 0.0122,
|
174 |
+
"step": 210
|
175 |
+
},
|
176 |
+
{
|
177 |
+
"epoch": 3.3846153846153846,
|
178 |
+
"grad_norm": 0.0587957464158535,
|
179 |
+
"learning_rate": 3.0769230769230774e-05,
|
180 |
+
"loss": 0.0123,
|
181 |
+
"step": 220
|
182 |
+
},
|
183 |
+
{
|
184 |
+
"epoch": 3.5384615384615383,
|
185 |
+
"grad_norm": 0.06546800583600998,
|
186 |
+
"learning_rate": 2.307692307692308e-05,
|
187 |
+
"loss": 0.0111,
|
188 |
+
"step": 230
|
189 |
+
},
|
190 |
+
{
|
191 |
+
"epoch": 3.6923076923076925,
|
192 |
+
"grad_norm": 0.0588623583316803,
|
193 |
+
"learning_rate": 1.5384615384615387e-05,
|
194 |
+
"loss": 0.0112,
|
195 |
+
"step": 240
|
196 |
+
},
|
197 |
+
{
|
198 |
+
"epoch": 3.8461538461538463,
|
199 |
+
"grad_norm": 0.05679621547460556,
|
200 |
+
"learning_rate": 7.692307692307694e-06,
|
201 |
+
"loss": 0.0109,
|
202 |
+
"step": 250
|
203 |
+
},
|
204 |
+
{
|
205 |
+
"epoch": 4.0,
|
206 |
+
"grad_norm": 0.05850306525826454,
|
207 |
+
"learning_rate": 0.0,
|
208 |
+
"loss": 0.0358,
|
209 |
+
"step": 260
|
210 |
+
},
|
211 |
+
{
|
212 |
+
"epoch": 4.0,
|
213 |
+
"step": 260,
|
214 |
+
"total_flos": 3.205097416476426e+17,
|
215 |
+
"train_loss": 0.11540300791653303,
|
216 |
+
"train_runtime": 92.7413,
|
217 |
+
"train_samples_per_second": 44.597,
|
218 |
+
"train_steps_per_second": 2.803
|
219 |
+
}
|
220 |
+
],
|
221 |
+
"logging_steps": 10,
|
222 |
+
"max_steps": 260,
|
223 |
+
"num_input_tokens_seen": 0,
|
224 |
+
"num_train_epochs": 4,
|
225 |
+
"save_steps": 100,
|
226 |
+
"stateful_callbacks": {
|
227 |
+
"TrainerControl": {
|
228 |
+
"args": {
|
229 |
+
"should_epoch_stop": false,
|
230 |
+
"should_evaluate": false,
|
231 |
+
"should_log": false,
|
232 |
+
"should_save": true,
|
233 |
+
"should_training_stop": false
|
234 |
+
},
|
235 |
+
"attributes": {}
|
236 |
+
}
|
237 |
+
},
|
238 |
+
"total_flos": 3.205097416476426e+17,
|
239 |
+
"train_batch_size": 16,
|
240 |
+
"trial_name": null,
|
241 |
+
"trial_params": null
|
242 |
+
}
|
training_args.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6b6edece8866ec3d22ac639ec850afe5a2c70c578ce68c892e05b8cb76521a92
|
3 |
+
size 5112
|