phuong-tk-nguyen
commited on
Commit
•
1434fb2
1
Parent(s):
c99ad7f
Model save
Browse files- README.md +84 -0
- config.json +77 -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: 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: None
|
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.866
|
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 |
+
# None
|
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.4987
|
36 |
+
- Accuracy: 0.866
|
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.1773 | 0.14 | 10 | 1.8121 | 0.521 |
|
71 |
+
| 1.6444 | 0.28 | 20 | 1.1345 | 0.695 |
|
72 |
+
| 1.2437 | 0.43 | 30 | 0.8262 | 0.762 |
|
73 |
+
| 1.0201 | 0.57 | 40 | 0.6576 | 0.804 |
|
74 |
+
| 0.9683 | 0.71 | 50 | 0.5604 | 0.838 |
|
75 |
+
| 0.8936 | 0.85 | 60 | 0.5137 | 0.853 |
|
76 |
+
| 0.8535 | 0.99 | 70 | 0.4987 | 0.866 |
|
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,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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": "Airplane",
|
21 |
+
"1": "Automobile",
|
22 |
+
"2": "Bird",
|
23 |
+
"3": "Cat",
|
24 |
+
"4": "Deer",
|
25 |
+
"5": "Dog",
|
26 |
+
"6": "Frog",
|
27 |
+
"7": "Horse",
|
28 |
+
"8": "Ship",
|
29 |
+
"9": "Truck"
|
30 |
+
},
|
31 |
+
"image_size": 224,
|
32 |
+
"initializer_range": 0.02,
|
33 |
+
"label2id": {
|
34 |
+
"Airplane": 0,
|
35 |
+
"Automobile": 1,
|
36 |
+
"Bird": 2,
|
37 |
+
"Cat": 3,
|
38 |
+
"Deer": 4,
|
39 |
+
"Dog": 5,
|
40 |
+
"Frog": 6,
|
41 |
+
"Horse": 7,
|
42 |
+
"Ship": 8,
|
43 |
+
"Truck": 9
|
44 |
+
},
|
45 |
+
"layer_norm_eps": 1e-05,
|
46 |
+
"mlp_ratio": 4.0,
|
47 |
+
"model_type": "swin",
|
48 |
+
"num_channels": 3,
|
49 |
+
"num_heads": [
|
50 |
+
3,
|
51 |
+
6,
|
52 |
+
12,
|
53 |
+
24
|
54 |
+
],
|
55 |
+
"num_layers": 4,
|
56 |
+
"out_features": [
|
57 |
+
"stage4"
|
58 |
+
],
|
59 |
+
"out_indices": [
|
60 |
+
4
|
61 |
+
],
|
62 |
+
"patch_size": 4,
|
63 |
+
"path_norm": true,
|
64 |
+
"problem_type": "single_label_classification",
|
65 |
+
"qkv_bias": true,
|
66 |
+
"stage_names": [
|
67 |
+
"stem",
|
68 |
+
"stage1",
|
69 |
+
"stage2",
|
70 |
+
"stage3",
|
71 |
+
"stage4"
|
72 |
+
],
|
73 |
+
"torch_dtype": "float32",
|
74 |
+
"transformers_version": "4.35.0",
|
75 |
+
"use_absolute_embeddings": false,
|
76 |
+
"window_size": 7
|
77 |
+
}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5a33d4f821ec963686bc87310ef78a2d56496408b7486b3d79583b59ad78637d
|
3 |
+
size 110367448
|
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 |
+
}
|
training_args.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5ca3f53b40177a273ee925588dda2402236d2f43aff4d2c5788902e4b7ec51cb
|
3 |
+
size 4536
|