chanelcolgate
commited on
Commit
•
92209ee
1
Parent(s):
9efe206
🍻 cheers
Browse files- README.md +60 -0
- all_results.json +8 -0
- config.json +177 -0
- eval_results.json +8 -0
- generation_config.json +13 -0
- preprocessor_config.json +22 -0
- pytorch_model.bin +3 -0
- trainer_state.json +85 -0
- training_args.bin +3 -0
README.md
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model: microsoft/trocr-base-printed
|
3 |
+
tags:
|
4 |
+
- image-to-text
|
5 |
+
- generated_from_trainer
|
6 |
+
model-index:
|
7 |
+
- name: trocr-base-printed_captcha_ocr
|
8 |
+
results: []
|
9 |
+
---
|
10 |
+
|
11 |
+
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
12 |
+
should probably proofread and complete it, then remove this comment. -->
|
13 |
+
|
14 |
+
# trocr-base-printed_captcha_ocr
|
15 |
+
|
16 |
+
This model is a fine-tuned version of [microsoft/trocr-base-printed](https://huggingface.co/microsoft/trocr-base-printed) on an unknown dataset.
|
17 |
+
It achieves the following results on the evaluation set:
|
18 |
+
- Loss: 0.0888
|
19 |
+
- Cer: 0.0034
|
20 |
+
|
21 |
+
## Model description
|
22 |
+
|
23 |
+
More information needed
|
24 |
+
|
25 |
+
## Intended uses & limitations
|
26 |
+
|
27 |
+
More information needed
|
28 |
+
|
29 |
+
## Training and evaluation data
|
30 |
+
|
31 |
+
More information needed
|
32 |
+
|
33 |
+
## Training procedure
|
34 |
+
|
35 |
+
### Training hyperparameters
|
36 |
+
|
37 |
+
The following hyperparameters were used during training:
|
38 |
+
- learning_rate: 5e-05
|
39 |
+
- train_batch_size: 8
|
40 |
+
- eval_batch_size: 8
|
41 |
+
- seed: 42
|
42 |
+
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
43 |
+
- lr_scheduler_type: linear
|
44 |
+
- num_epochs: 3
|
45 |
+
|
46 |
+
### Training results
|
47 |
+
|
48 |
+
| Training Loss | Epoch | Step | Validation Loss | Cer |
|
49 |
+
|:-------------:|:-----:|:----:|:---------------:|:------:|
|
50 |
+
| 0.6822 | 1.0 | 750 | 0.2687 | 0.0418 |
|
51 |
+
| 0.1595 | 2.0 | 1500 | 0.1413 | 0.0094 |
|
52 |
+
| 0.0481 | 3.0 | 2250 | 0.0717 | 0.0029 |
|
53 |
+
|
54 |
+
|
55 |
+
### Framework versions
|
56 |
+
|
57 |
+
- Transformers 4.34.1
|
58 |
+
- Pytorch 2.1.0+cu118
|
59 |
+
- Datasets 2.14.6
|
60 |
+
- Tokenizers 0.14.1
|
all_results.json
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"epoch": 3.0,
|
3 |
+
"eval_cer": 0.0034,
|
4 |
+
"eval_loss": 0.08878355473279953,
|
5 |
+
"eval_runtime": 362.3912,
|
6 |
+
"eval_samples_per_second": 5.519,
|
7 |
+
"eval_steps_per_second": 0.69
|
8 |
+
}
|
config.json
ADDED
@@ -0,0 +1,177 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "microsoft/trocr-base-printed",
|
3 |
+
"architectures": [
|
4 |
+
"VisionEncoderDecoderModel"
|
5 |
+
],
|
6 |
+
"decoder": {
|
7 |
+
"_name_or_path": "",
|
8 |
+
"activation_dropout": 0.0,
|
9 |
+
"activation_function": "gelu",
|
10 |
+
"add_cross_attention": true,
|
11 |
+
"architectures": null,
|
12 |
+
"attention_dropout": 0.0,
|
13 |
+
"bad_words_ids": null,
|
14 |
+
"begin_suppress_tokens": null,
|
15 |
+
"bos_token_id": 0,
|
16 |
+
"chunk_size_feed_forward": 0,
|
17 |
+
"classifier_dropout": 0.0,
|
18 |
+
"cross_attention_hidden_size": 768,
|
19 |
+
"d_model": 1024,
|
20 |
+
"decoder_attention_heads": 16,
|
21 |
+
"decoder_ffn_dim": 4096,
|
22 |
+
"decoder_layerdrop": 0.0,
|
23 |
+
"decoder_layers": 12,
|
24 |
+
"decoder_start_token_id": 2,
|
25 |
+
"diversity_penalty": 0.0,
|
26 |
+
"do_sample": false,
|
27 |
+
"dropout": 0.1,
|
28 |
+
"early_stopping": false,
|
29 |
+
"encoder_no_repeat_ngram_size": 0,
|
30 |
+
"eos_token_id": 2,
|
31 |
+
"exponential_decay_length_penalty": null,
|
32 |
+
"finetuning_task": null,
|
33 |
+
"forced_bos_token_id": null,
|
34 |
+
"forced_eos_token_id": null,
|
35 |
+
"id2label": {
|
36 |
+
"0": "LABEL_0",
|
37 |
+
"1": "LABEL_1"
|
38 |
+
},
|
39 |
+
"init_std": 0.02,
|
40 |
+
"is_decoder": true,
|
41 |
+
"is_encoder_decoder": false,
|
42 |
+
"label2id": {
|
43 |
+
"LABEL_0": 0,
|
44 |
+
"LABEL_1": 1
|
45 |
+
},
|
46 |
+
"layernorm_embedding": true,
|
47 |
+
"length_penalty": 1.0,
|
48 |
+
"max_length": 20,
|
49 |
+
"max_position_embeddings": 512,
|
50 |
+
"min_length": 0,
|
51 |
+
"model_type": "trocr",
|
52 |
+
"no_repeat_ngram_size": 0,
|
53 |
+
"num_beam_groups": 1,
|
54 |
+
"num_beams": 1,
|
55 |
+
"num_return_sequences": 1,
|
56 |
+
"output_attentions": false,
|
57 |
+
"output_hidden_states": false,
|
58 |
+
"output_scores": false,
|
59 |
+
"pad_token_id": 1,
|
60 |
+
"prefix": null,
|
61 |
+
"problem_type": null,
|
62 |
+
"pruned_heads": {},
|
63 |
+
"remove_invalid_values": false,
|
64 |
+
"repetition_penalty": 1.0,
|
65 |
+
"return_dict": true,
|
66 |
+
"return_dict_in_generate": false,
|
67 |
+
"scale_embedding": false,
|
68 |
+
"sep_token_id": null,
|
69 |
+
"suppress_tokens": null,
|
70 |
+
"task_specific_params": null,
|
71 |
+
"temperature": 1.0,
|
72 |
+
"tf_legacy_loss": false,
|
73 |
+
"tie_encoder_decoder": false,
|
74 |
+
"tie_word_embeddings": true,
|
75 |
+
"tokenizer_class": null,
|
76 |
+
"top_k": 50,
|
77 |
+
"top_p": 1.0,
|
78 |
+
"torch_dtype": null,
|
79 |
+
"torchscript": false,
|
80 |
+
"typical_p": 1.0,
|
81 |
+
"use_bfloat16": false,
|
82 |
+
"use_cache": false,
|
83 |
+
"use_learned_position_embeddings": true,
|
84 |
+
"vocab_size": 50265
|
85 |
+
},
|
86 |
+
"decoder_start_token_id": 0,
|
87 |
+
"early_stopping": true,
|
88 |
+
"encoder": {
|
89 |
+
"_name_or_path": "",
|
90 |
+
"add_cross_attention": false,
|
91 |
+
"architectures": null,
|
92 |
+
"attention_probs_dropout_prob": 0.0,
|
93 |
+
"bad_words_ids": null,
|
94 |
+
"begin_suppress_tokens": null,
|
95 |
+
"bos_token_id": null,
|
96 |
+
"chunk_size_feed_forward": 0,
|
97 |
+
"cross_attention_hidden_size": null,
|
98 |
+
"decoder_start_token_id": null,
|
99 |
+
"diversity_penalty": 0.0,
|
100 |
+
"do_sample": false,
|
101 |
+
"early_stopping": false,
|
102 |
+
"encoder_no_repeat_ngram_size": 0,
|
103 |
+
"encoder_stride": 16,
|
104 |
+
"eos_token_id": null,
|
105 |
+
"exponential_decay_length_penalty": null,
|
106 |
+
"finetuning_task": null,
|
107 |
+
"forced_bos_token_id": null,
|
108 |
+
"forced_eos_token_id": null,
|
109 |
+
"hidden_act": "gelu",
|
110 |
+
"hidden_dropout_prob": 0.0,
|
111 |
+
"hidden_size": 768,
|
112 |
+
"id2label": {
|
113 |
+
"0": "LABEL_0",
|
114 |
+
"1": "LABEL_1"
|
115 |
+
},
|
116 |
+
"image_size": 384,
|
117 |
+
"initializer_range": 0.02,
|
118 |
+
"intermediate_size": 3072,
|
119 |
+
"is_decoder": false,
|
120 |
+
"is_encoder_decoder": false,
|
121 |
+
"label2id": {
|
122 |
+
"LABEL_0": 0,
|
123 |
+
"LABEL_1": 1
|
124 |
+
},
|
125 |
+
"layer_norm_eps": 1e-12,
|
126 |
+
"length_penalty": 1.0,
|
127 |
+
"max_length": 20,
|
128 |
+
"min_length": 0,
|
129 |
+
"model_type": "vit",
|
130 |
+
"no_repeat_ngram_size": 0,
|
131 |
+
"num_attention_heads": 12,
|
132 |
+
"num_beam_groups": 1,
|
133 |
+
"num_beams": 1,
|
134 |
+
"num_channels": 3,
|
135 |
+
"num_hidden_layers": 12,
|
136 |
+
"num_return_sequences": 1,
|
137 |
+
"output_attentions": false,
|
138 |
+
"output_hidden_states": false,
|
139 |
+
"output_scores": false,
|
140 |
+
"pad_token_id": null,
|
141 |
+
"patch_size": 16,
|
142 |
+
"prefix": null,
|
143 |
+
"problem_type": null,
|
144 |
+
"pruned_heads": {},
|
145 |
+
"qkv_bias": false,
|
146 |
+
"remove_invalid_values": false,
|
147 |
+
"repetition_penalty": 1.0,
|
148 |
+
"return_dict": true,
|
149 |
+
"return_dict_in_generate": false,
|
150 |
+
"sep_token_id": null,
|
151 |
+
"suppress_tokens": null,
|
152 |
+
"task_specific_params": null,
|
153 |
+
"temperature": 1.0,
|
154 |
+
"tf_legacy_loss": false,
|
155 |
+
"tie_encoder_decoder": false,
|
156 |
+
"tie_word_embeddings": true,
|
157 |
+
"tokenizer_class": null,
|
158 |
+
"top_k": 50,
|
159 |
+
"top_p": 1.0,
|
160 |
+
"torch_dtype": null,
|
161 |
+
"torchscript": false,
|
162 |
+
"typical_p": 1.0,
|
163 |
+
"use_bfloat16": false
|
164 |
+
},
|
165 |
+
"eos_token_id": 2,
|
166 |
+
"is_encoder_decoder": true,
|
167 |
+
"length_penalty": 2.0,
|
168 |
+
"max_length": 64,
|
169 |
+
"model_type": "vision-encoder-decoder",
|
170 |
+
"no_repeat_ngram_size": 3,
|
171 |
+
"num_beams": 4,
|
172 |
+
"pad_token_id": 1,
|
173 |
+
"tie_word_embeddings": false,
|
174 |
+
"torch_dtype": "float32",
|
175 |
+
"transformers_version": "4.34.1",
|
176 |
+
"vocab_size": 50265
|
177 |
+
}
|
eval_results.json
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"epoch": 3.0,
|
3 |
+
"eval_cer": 0.0034,
|
4 |
+
"eval_loss": 0.08878355473279953,
|
5 |
+
"eval_runtime": 362.3912,
|
6 |
+
"eval_samples_per_second": 5.519,
|
7 |
+
"eval_steps_per_second": 0.69
|
8 |
+
}
|
generation_config.json
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token_id": 0,
|
3 |
+
"decoder_start_token_id": 0,
|
4 |
+
"early_stopping": true,
|
5 |
+
"eos_token_id": 2,
|
6 |
+
"length_penalty": 2.0,
|
7 |
+
"max_length": 64,
|
8 |
+
"no_repeat_ngram_size": 3,
|
9 |
+
"num_beams": 4,
|
10 |
+
"pad_token_id": 1,
|
11 |
+
"transformers_version": "4.34.1",
|
12 |
+
"use_cache": false
|
13 |
+
}
|
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": 384,
|
20 |
+
"width": 384
|
21 |
+
}
|
22 |
+
}
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7625b82b3dfe079ff53bd58b7c14607826343b2203a73f6ed66481cb717bc4c5
|
3 |
+
size 1335854666
|
trainer_state.json
ADDED
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"best_metric": null,
|
3 |
+
"best_model_checkpoint": null,
|
4 |
+
"epoch": 3.0,
|
5 |
+
"eval_steps": 500,
|
6 |
+
"global_step": 2250,
|
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.0,
|
13 |
+
"learning_rate": 5e-05,
|
14 |
+
"loss": 11.1,
|
15 |
+
"step": 1
|
16 |
+
},
|
17 |
+
{
|
18 |
+
"epoch": 0.67,
|
19 |
+
"learning_rate": 3.8933333333333336e-05,
|
20 |
+
"loss": 0.6822,
|
21 |
+
"step": 500
|
22 |
+
},
|
23 |
+
{
|
24 |
+
"epoch": 1.0,
|
25 |
+
"eval_cer": 0.0418,
|
26 |
+
"eval_loss": 0.26874810457229614,
|
27 |
+
"eval_runtime": 341.3378,
|
28 |
+
"eval_samples_per_second": 5.859,
|
29 |
+
"eval_steps_per_second": 0.732,
|
30 |
+
"step": 750
|
31 |
+
},
|
32 |
+
{
|
33 |
+
"epoch": 1.33,
|
34 |
+
"learning_rate": 2.782222222222222e-05,
|
35 |
+
"loss": 0.2781,
|
36 |
+
"step": 1000
|
37 |
+
},
|
38 |
+
{
|
39 |
+
"epoch": 2.0,
|
40 |
+
"learning_rate": 1.6733333333333335e-05,
|
41 |
+
"loss": 0.1595,
|
42 |
+
"step": 1500
|
43 |
+
},
|
44 |
+
{
|
45 |
+
"epoch": 2.0,
|
46 |
+
"eval_cer": 0.0094,
|
47 |
+
"eval_loss": 0.14129523932933807,
|
48 |
+
"eval_runtime": 339.7395,
|
49 |
+
"eval_samples_per_second": 5.887,
|
50 |
+
"eval_steps_per_second": 0.736,
|
51 |
+
"step": 1500
|
52 |
+
},
|
53 |
+
{
|
54 |
+
"epoch": 2.67,
|
55 |
+
"learning_rate": 5.6444444444444445e-06,
|
56 |
+
"loss": 0.0481,
|
57 |
+
"step": 2000
|
58 |
+
},
|
59 |
+
{
|
60 |
+
"epoch": 3.0,
|
61 |
+
"eval_cer": 0.0029,
|
62 |
+
"eval_loss": 0.07172464579343796,
|
63 |
+
"eval_runtime": 338.5668,
|
64 |
+
"eval_samples_per_second": 5.907,
|
65 |
+
"eval_steps_per_second": 0.738,
|
66 |
+
"step": 2250
|
67 |
+
},
|
68 |
+
{
|
69 |
+
"epoch": 3.0,
|
70 |
+
"step": 2250,
|
71 |
+
"total_flos": 1.3469133437927424e+19,
|
72 |
+
"train_loss": 0.2679765387641059,
|
73 |
+
"train_runtime": 3403.503,
|
74 |
+
"train_samples_per_second": 5.289,
|
75 |
+
"train_steps_per_second": 0.661
|
76 |
+
}
|
77 |
+
],
|
78 |
+
"logging_steps": 500,
|
79 |
+
"max_steps": 2250,
|
80 |
+
"num_train_epochs": 3,
|
81 |
+
"save_steps": 500,
|
82 |
+
"total_flos": 1.3469133437927424e+19,
|
83 |
+
"trial_name": null,
|
84 |
+
"trial_params": null
|
85 |
+
}
|
training_args.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1b3a9670178ce9027e1e4ac0c423e995d300764f5d54344b0756defa1d742ae6
|
3 |
+
size 4664
|