End of training
Browse files- README.md +87 -0
- config.json +73 -0
- model.safetensors +3 -0
- preprocessor_config.json +36 -0
- training_args.bin +3 -0
README.md
ADDED
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
base_model: microsoft/swinv2-base-patch4-window16-256
|
4 |
+
tags:
|
5 |
+
- generated_from_trainer
|
6 |
+
metrics:
|
7 |
+
- accuracy
|
8 |
+
- f1
|
9 |
+
- precision
|
10 |
+
- recall
|
11 |
+
model-index:
|
12 |
+
- name: SwinV2-Base-Document-Classifier
|
13 |
+
results: []
|
14 |
+
---
|
15 |
+
|
16 |
+
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
17 |
+
should probably proofread and complete it, then remove this comment. -->
|
18 |
+
|
19 |
+
# SwinV2-Base-Document-Classifier
|
20 |
+
|
21 |
+
This model is a fine-tuned version of [microsoft/swinv2-base-patch4-window16-256](https://huggingface.co/microsoft/swinv2-base-patch4-window16-256) on the None dataset.
|
22 |
+
It achieves the following results on the evaluation set:
|
23 |
+
- Loss: 0.0573
|
24 |
+
- Accuracy: 0.9810
|
25 |
+
- F1: 0.9810
|
26 |
+
- Precision: 0.9813
|
27 |
+
- Recall: 0.9810
|
28 |
+
|
29 |
+
## Model description
|
30 |
+
|
31 |
+
More information needed
|
32 |
+
|
33 |
+
## Intended uses & limitations
|
34 |
+
|
35 |
+
More information needed
|
36 |
+
|
37 |
+
## Training and evaluation data
|
38 |
+
|
39 |
+
More information needed
|
40 |
+
|
41 |
+
## Training procedure
|
42 |
+
|
43 |
+
### Training hyperparameters
|
44 |
+
|
45 |
+
The following hyperparameters were used during training:
|
46 |
+
- learning_rate: 5e-05
|
47 |
+
- train_batch_size: 32
|
48 |
+
- eval_batch_size: 32
|
49 |
+
- seed: 42
|
50 |
+
- gradient_accumulation_steps: 4
|
51 |
+
- total_train_batch_size: 128
|
52 |
+
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
53 |
+
- lr_scheduler_type: linear
|
54 |
+
- training_steps: 400
|
55 |
+
|
56 |
+
### Training results
|
57 |
+
|
58 |
+
| Training Loss | Epoch | Step | Validation Loss | Accuracy | F1 | Precision | Recall |
|
59 |
+
|:-------------:|:-----:|:----:|:---------------:|:--------:|:------:|:---------:|:------:|
|
60 |
+
| 0.0814 | 0.12 | 50 | 0.0876 | 0.9740 | 0.9741 | 0.9749 | 0.9740 |
|
61 |
+
| 0.078 | 0.13 | 51 | 0.0658 | 0.9797 | 0.9797 | 0.9799 | 0.9797 |
|
62 |
+
| 0.143 | 0.13 | 52 | 0.0609 | 0.9831 | 0.9831 | 0.9832 | 0.9831 |
|
63 |
+
| 0.0863 | 0.13 | 53 | 0.0595 | 0.9832 | 0.9832 | 0.9834 | 0.9832 |
|
64 |
+
| 0.0561 | 0.14 | 54 | 0.0650 | 0.9825 | 0.9825 | 0.9826 | 0.9825 |
|
65 |
+
| 0.1118 | 0.14 | 55 | 0.0697 | 0.9804 | 0.9804 | 0.9806 | 0.9804 |
|
66 |
+
| 0.1258 | 0.14 | 56 | 0.1053 | 0.9678 | 0.9678 | 0.9697 | 0.9678 |
|
67 |
+
| 0.132 | 0.14 | 57 | 0.0672 | 0.9781 | 0.9781 | 0.9785 | 0.9781 |
|
68 |
+
| 0.1564 | 0.14 | 58 | 0.0582 | 0.9827 | 0.9827 | 0.9829 | 0.9827 |
|
69 |
+
| 0.1085 | 0.15 | 59 | 0.0557 | 0.9849 | 0.9848 | 0.9849 | 0.9848 |
|
70 |
+
| 0.0506 | 0.15 | 60 | 0.0548 | 0.9845 | 0.9845 | 0.9845 | 0.9845 |
|
71 |
+
| 0.0787 | 0.15 | 61 | 0.1049 | 0.9660 | 0.9661 | 0.9681 | 0.9660 |
|
72 |
+
| 0.1211 | 0.15 | 62 | 0.0792 | 0.9741 | 0.9741 | 0.9746 | 0.9741 |
|
73 |
+
| 0.0907 | 0.16 | 63 | 0.0608 | 0.9826 | 0.9825 | 0.9826 | 0.9826 |
|
74 |
+
| 0.0419 | 0.16 | 64 | 0.0577 | 0.9832 | 0.9832 | 0.9833 | 0.9832 |
|
75 |
+
| 0.1659 | 0.16 | 65 | 0.0548 | 0.9843 | 0.9843 | 0.9844 | 0.9843 |
|
76 |
+
| 0.0983 | 0.17 | 66 | 0.0657 | 0.9805 | 0.9805 | 0.9814 | 0.9804 |
|
77 |
+
| 0.0535 | 0.17 | 67 | 0.0493 | 0.9851 | 0.9851 | 0.9851 | 0.9851 |
|
78 |
+
| 0.0936 | 0.17 | 68 | 0.0588 | 0.9827 | 0.9827 | 0.9830 | 0.9827 |
|
79 |
+
| 0.0933 | 0.17 | 69 | 0.0573 | 0.9810 | 0.9810 | 0.9813 | 0.9810 |
|
80 |
+
|
81 |
+
|
82 |
+
### Framework versions
|
83 |
+
|
84 |
+
- Transformers 4.39.3
|
85 |
+
- Pytorch 2.2.2
|
86 |
+
- Datasets 2.18.0
|
87 |
+
- Tokenizers 0.15.2
|
config.json
ADDED
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "microsoft/swinv2-base-patch4-window16-256",
|
3 |
+
"architectures": [
|
4 |
+
"Swinv2ForImageClassification"
|
5 |
+
],
|
6 |
+
"attention_probs_dropout_prob": 0.0,
|
7 |
+
"depths": [
|
8 |
+
2,
|
9 |
+
2,
|
10 |
+
18,
|
11 |
+
2
|
12 |
+
],
|
13 |
+
"drop_path_rate": 0.1,
|
14 |
+
"embed_dim": 128,
|
15 |
+
"encoder_stride": 32,
|
16 |
+
"hidden_act": "gelu",
|
17 |
+
"hidden_dropout_prob": 0.0,
|
18 |
+
"hidden_size": 1024,
|
19 |
+
"id2label": {
|
20 |
+
"0": "Barcode",
|
21 |
+
"1": "Invoice",
|
22 |
+
"2": "Object",
|
23 |
+
"3": "Receipt",
|
24 |
+
"4": "Non-Object"
|
25 |
+
},
|
26 |
+
"image_size": 256,
|
27 |
+
"initializer_range": 0.02,
|
28 |
+
"label2id": {
|
29 |
+
"Barcode": 0,
|
30 |
+
"Invoice": 1,
|
31 |
+
"Non-Object": 4,
|
32 |
+
"Object": 2,
|
33 |
+
"Receipt": 3
|
34 |
+
},
|
35 |
+
"layer_norm_eps": 1e-05,
|
36 |
+
"mlp_ratio": 4.0,
|
37 |
+
"model_type": "swinv2",
|
38 |
+
"num_channels": 3,
|
39 |
+
"num_heads": [
|
40 |
+
4,
|
41 |
+
8,
|
42 |
+
16,
|
43 |
+
32
|
44 |
+
],
|
45 |
+
"num_layers": 4,
|
46 |
+
"out_features": [
|
47 |
+
"stage4"
|
48 |
+
],
|
49 |
+
"out_indices": [
|
50 |
+
4
|
51 |
+
],
|
52 |
+
"patch_size": 4,
|
53 |
+
"path_norm": true,
|
54 |
+
"pretrained_window_sizes": [
|
55 |
+
0,
|
56 |
+
0,
|
57 |
+
0,
|
58 |
+
0
|
59 |
+
],
|
60 |
+
"problem_type": "single_label_classification",
|
61 |
+
"qkv_bias": true,
|
62 |
+
"stage_names": [
|
63 |
+
"stem",
|
64 |
+
"stage1",
|
65 |
+
"stage2",
|
66 |
+
"stage3",
|
67 |
+
"stage4"
|
68 |
+
],
|
69 |
+
"torch_dtype": "float32",
|
70 |
+
"transformers_version": "4.39.3",
|
71 |
+
"use_absolute_embeddings": false,
|
72 |
+
"window_size": 16
|
73 |
+
}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b02ae140cf170025a29d1da8a8a89ab609c28f413b32d879da6c5e2719f58c73
|
3 |
+
size 347657788
|
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.485,
|
21 |
+
0.456,
|
22 |
+
0.406
|
23 |
+
],
|
24 |
+
"image_processor_type": "ViTImageProcessor",
|
25 |
+
"image_std": [
|
26 |
+
0.229,
|
27 |
+
0.224,
|
28 |
+
0.225
|
29 |
+
],
|
30 |
+
"resample": 3,
|
31 |
+
"rescale_factor": 0.00392156862745098,
|
32 |
+
"size": {
|
33 |
+
"height": 256,
|
34 |
+
"width": 256
|
35 |
+
}
|
36 |
+
}
|
training_args.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:bbad5e6245ccb866e7534052af0264654cb89ff2bf68be8ee832fac009403f25
|
3 |
+
size 4984
|