Genereux-akotenou commited on
Commit
aa6e99c
·
verified ·
1 Parent(s): afd5ec4

Upload 9 files

Browse files
README.md ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: microsoft/swin-tiny-patch4-window7-224
4
+ tags:
5
+ - generated_from_trainer
6
+ datasets:
7
+ - imagefolder
8
+ metrics:
9
+ - accuracy
10
+ model-index:
11
+ - name: swin-tiny-patch4-window7-224-finetuned-eurosat
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.9991525423728813
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
+ # Face-Mask-Detection
32
+
33
+ This model is a fine-tuned version of [microsoft/swin-tiny-patch4-window7-224](https://huggingface.co/microsoft/swin-tiny-patch4-window7-224) on the imagefolder dataset.
34
+ It achieves the following results on the evaluation set:
35
+ - Loss: 0.0051
36
+ - Accuracy: 0.9992
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: 3
65
+
66
+ ### Training results
67
+
68
+ | Training Loss | Epoch | Step | Validation Loss | Accuracy |
69
+ |:-------------:|:-----:|:----:|:---------------:|:--------:|
70
+ | 0.0344 | 1.0 | 83 | 0.0051 | 0.9992 |
71
+ | 0.0112 | 2.0 | 166 | 0.0052 | 0.9983 |
72
+ | 0.0146 | 3.0 | 249 | 0.0045 | 0.9992 |
73
+
74
+
75
+ ### Framework versions
76
+
77
+ - Transformers 4.34.0
78
+ - Pytorch 2.0.1+cu118
79
+ - Datasets 2.14.5
80
+ - Tokenizers 0.14.0
all_results.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "epoch": 3.0,
3
+ "eval_accuracy": 0.9991525423728813,
4
+ "eval_loss": 0.005057646427303553,
5
+ "eval_runtime": 7.9885,
6
+ "eval_samples_per_second": 147.712,
7
+ "eval_steps_per_second": 4.632,
8
+ "total_flos": 7.913152653537116e+17,
9
+ "train_loss": 0.04654426268305645,
10
+ "train_runtime": 513.1593,
11
+ "train_samples_per_second": 62.039,
12
+ "train_steps_per_second": 0.485
13
+ }
config.json ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "microsoft/swin-tiny-patch4-window7-224",
3
+ "architectures": [
4
+ "SwinForImageClassification"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.0,
7
+ "depths": [
8
+ 2,
9
+ 2,
10
+ 6,
11
+ 2
12
+ ],
13
+ "drop_path_rate": 0.1,
14
+ "embed_dim": 96,
15
+ "encoder_stride": 32,
16
+ "hidden_act": "gelu",
17
+ "hidden_dropout_prob": 0.0,
18
+ "hidden_size": 768,
19
+ "id2label": {
20
+ "0": "WithMask",
21
+ "1": "WithoutMask"
22
+ },
23
+ "image_size": 224,
24
+ "initializer_range": 0.02,
25
+ "label2id": {
26
+ "WithMask": 0,
27
+ "WithoutMask": 1
28
+ },
29
+ "layer_norm_eps": 1e-05,
30
+ "mlp_ratio": 4.0,
31
+ "model_type": "swin",
32
+ "num_channels": 3,
33
+ "num_heads": [
34
+ 3,
35
+ 6,
36
+ 12,
37
+ 24
38
+ ],
39
+ "num_layers": 4,
40
+ "out_features": [
41
+ "stage4"
42
+ ],
43
+ "out_indices": [
44
+ 4
45
+ ],
46
+ "patch_size": 4,
47
+ "path_norm": true,
48
+ "problem_type": "single_label_classification",
49
+ "qkv_bias": true,
50
+ "stage_names": [
51
+ "stem",
52
+ "stage1",
53
+ "stage2",
54
+ "stage3",
55
+ "stage4"
56
+ ],
57
+ "torch_dtype": "float32",
58
+ "transformers_version": "4.34.0",
59
+ "use_absolute_embeddings": false,
60
+ "window_size": 7
61
+ }
eval_results.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "epoch": 3.0,
3
+ "eval_accuracy": 0.9991525423728813,
4
+ "eval_loss": 0.005057646427303553,
5
+ "eval_runtime": 7.9885,
6
+ "eval_samples_per_second": 147.712,
7
+ "eval_steps_per_second": 4.632
8
+ }
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.485,
7
+ 0.456,
8
+ 0.406
9
+ ],
10
+ "image_processor_type": "ViTImageProcessor",
11
+ "image_std": [
12
+ 0.229,
13
+ 0.224,
14
+ 0.225
15
+ ],
16
+ "resample": 3,
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:c6187b21a4e24e1538bdb67e505224b3a7b7cc3205e02630d170dda0545deeae
3
+ size 110394865
train_results.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "epoch": 3.0,
3
+ "total_flos": 7.913152653537116e+17,
4
+ "train_loss": 0.04654426268305645,
5
+ "train_runtime": 513.1593,
6
+ "train_samples_per_second": 62.039,
7
+ "train_steps_per_second": 0.485
8
+ }
trainer_state.json ADDED
@@ -0,0 +1,199 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_metric": 0.9991525423728813,
3
+ "best_model_checkpoint": "swin-tiny-patch4-window7-224-finetuned-eurosat/checkpoint-83",
4
+ "epoch": 3.0,
5
+ "eval_steps": 500,
6
+ "global_step": 249,
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.12,
13
+ "learning_rate": 2e-05,
14
+ "loss": 0.4995,
15
+ "step": 10
16
+ },
17
+ {
18
+ "epoch": 0.24,
19
+ "learning_rate": 4e-05,
20
+ "loss": 0.1624,
21
+ "step": 20
22
+ },
23
+ {
24
+ "epoch": 0.36,
25
+ "learning_rate": 4.888392857142857e-05,
26
+ "loss": 0.0535,
27
+ "step": 30
28
+ },
29
+ {
30
+ "epoch": 0.48,
31
+ "learning_rate": 4.665178571428572e-05,
32
+ "loss": 0.0346,
33
+ "step": 40
34
+ },
35
+ {
36
+ "epoch": 0.6,
37
+ "learning_rate": 4.4419642857142854e-05,
38
+ "loss": 0.0452,
39
+ "step": 50
40
+ },
41
+ {
42
+ "epoch": 0.72,
43
+ "learning_rate": 4.21875e-05,
44
+ "loss": 0.0238,
45
+ "step": 60
46
+ },
47
+ {
48
+ "epoch": 0.84,
49
+ "learning_rate": 3.9955357142857144e-05,
50
+ "loss": 0.0239,
51
+ "step": 70
52
+ },
53
+ {
54
+ "epoch": 0.96,
55
+ "learning_rate": 3.7723214285714286e-05,
56
+ "loss": 0.0344,
57
+ "step": 80
58
+ },
59
+ {
60
+ "epoch": 1.0,
61
+ "eval_accuracy": 0.9991525423728813,
62
+ "eval_loss": 0.005057646427303553,
63
+ "eval_runtime": 8.2623,
64
+ "eval_samples_per_second": 142.817,
65
+ "eval_steps_per_second": 4.478,
66
+ "step": 83
67
+ },
68
+ {
69
+ "epoch": 1.08,
70
+ "learning_rate": 3.5491071428571435e-05,
71
+ "loss": 0.032,
72
+ "step": 90
73
+ },
74
+ {
75
+ "epoch": 1.2,
76
+ "learning_rate": 3.325892857142857e-05,
77
+ "loss": 0.017,
78
+ "step": 100
79
+ },
80
+ {
81
+ "epoch": 1.33,
82
+ "learning_rate": 3.102678571428572e-05,
83
+ "loss": 0.0119,
84
+ "step": 110
85
+ },
86
+ {
87
+ "epoch": 1.45,
88
+ "learning_rate": 2.8794642857142857e-05,
89
+ "loss": 0.0215,
90
+ "step": 120
91
+ },
92
+ {
93
+ "epoch": 1.57,
94
+ "learning_rate": 2.6562500000000002e-05,
95
+ "loss": 0.0219,
96
+ "step": 130
97
+ },
98
+ {
99
+ "epoch": 1.69,
100
+ "learning_rate": 2.4330357142857144e-05,
101
+ "loss": 0.0293,
102
+ "step": 140
103
+ },
104
+ {
105
+ "epoch": 1.81,
106
+ "learning_rate": 2.2098214285714286e-05,
107
+ "loss": 0.0202,
108
+ "step": 150
109
+ },
110
+ {
111
+ "epoch": 1.93,
112
+ "learning_rate": 1.9866071428571427e-05,
113
+ "loss": 0.0112,
114
+ "step": 160
115
+ },
116
+ {
117
+ "epoch": 2.0,
118
+ "eval_accuracy": 0.9983050847457627,
119
+ "eval_loss": 0.005177544895559549,
120
+ "eval_runtime": 8.4063,
121
+ "eval_samples_per_second": 140.37,
122
+ "eval_steps_per_second": 4.401,
123
+ "step": 166
124
+ },
125
+ {
126
+ "epoch": 2.05,
127
+ "learning_rate": 1.7633928571428573e-05,
128
+ "loss": 0.0088,
129
+ "step": 170
130
+ },
131
+ {
132
+ "epoch": 2.17,
133
+ "learning_rate": 1.5401785714285715e-05,
134
+ "loss": 0.0193,
135
+ "step": 180
136
+ },
137
+ {
138
+ "epoch": 2.29,
139
+ "learning_rate": 1.3169642857142858e-05,
140
+ "loss": 0.0102,
141
+ "step": 190
142
+ },
143
+ {
144
+ "epoch": 2.41,
145
+ "learning_rate": 1.09375e-05,
146
+ "loss": 0.0083,
147
+ "step": 200
148
+ },
149
+ {
150
+ "epoch": 2.53,
151
+ "learning_rate": 8.705357142857143e-06,
152
+ "loss": 0.0077,
153
+ "step": 210
154
+ },
155
+ {
156
+ "epoch": 2.65,
157
+ "learning_rate": 6.473214285714287e-06,
158
+ "loss": 0.0097,
159
+ "step": 220
160
+ },
161
+ {
162
+ "epoch": 2.77,
163
+ "learning_rate": 4.241071428571429e-06,
164
+ "loss": 0.0207,
165
+ "step": 230
166
+ },
167
+ {
168
+ "epoch": 2.89,
169
+ "learning_rate": 2.0089285714285715e-06,
170
+ "loss": 0.0146,
171
+ "step": 240
172
+ },
173
+ {
174
+ "epoch": 3.0,
175
+ "eval_accuracy": 0.9991525423728813,
176
+ "eval_loss": 0.004469145555049181,
177
+ "eval_runtime": 8.3109,
178
+ "eval_samples_per_second": 141.983,
179
+ "eval_steps_per_second": 4.452,
180
+ "step": 249
181
+ },
182
+ {
183
+ "epoch": 3.0,
184
+ "step": 249,
185
+ "total_flos": 7.913152653537116e+17,
186
+ "train_loss": 0.04654426268305645,
187
+ "train_runtime": 513.1593,
188
+ "train_samples_per_second": 62.039,
189
+ "train_steps_per_second": 0.485
190
+ }
191
+ ],
192
+ "logging_steps": 10,
193
+ "max_steps": 249,
194
+ "num_train_epochs": 3,
195
+ "save_steps": 500,
196
+ "total_flos": 7.913152653537116e+17,
197
+ "trial_name": null,
198
+ "trial_params": null
199
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1ff30a20c1c0ab8cfa2214952514c508a9394fca8722e9de0ea7d9ce6fd809b1
3
+ size 4155