Titlehhhh commited on
Commit
edb41f7
·
verified ·
1 Parent(s): dab1d48

C7: honest card — 6 epochs/240 of 1230 steps, measured sources, no weights

Browse files
Files changed (1) hide show
  1. README.md +82 -47
README.md CHANGED
@@ -1,39 +1,36 @@
1
  ---
2
  license: apache-2.0
3
- library_name: transformers
4
- base_model: PaddlePaddle/PP-OCRv6_medium_rec_safetensors
5
  tags:
6
  - captcha
7
  - ocr
8
  - minecraft
9
  - anti-bot
10
  - pp-ocr
11
- - image-to-text
12
- - pytorch
13
- pipeline_tag: image-to-text
14
  ---
15
 
16
  # CaptchaOCR PP-OCRv6 — a text recogniser for Minecraft anti-bot captchas
17
 
18
  > ## Status: the weights are **not published yet**. This repository holds the model card only.
19
  >
20
- > The fine-tune on the [CaptchaOCR dataset](https://huggingface.co/datasets/Titlehhhh/captchaocr-dataset)
21
- > has **not been run to completion yet**, so there is **no checkpoint, no `config.json` and no
22
- > measured metric** in this repository. Nothing here is invented and nothing is extrapolated from a
23
- > probe run: the numbers quoted below are the **measured numbers of the base model before
24
- > fine-tuning**, and they are labelled as such.
 
25
  >
26
- > **RU:** репозиторий модели пока **пуст по весам** — здесь только карточка. Обучение на
27
- > датасете `Titlehhhh/captchaocr-dataset` ещё не завершено, поэтому **метрики появятся после
28
- > прогона** (плейслолдер ниже — это не выдуманные числа). Выкладка пробного чекпоинта (2 эпохи)
29
- > сознательно не сделана: он хуже базовой модели.
 
30
 
31
  ## What it reads
32
 
33
- Frames from the [CaptchaOCR dataset](https://huggingface.co/datasets/Titlehhhh/captchaocr-dataset) — the kind of
34
- pictures the model is trained on. The caption gives the type and the **gold answer** from
35
- `labels.jsonl` (what the player has to type). The links are absolute: the pictures live in the
36
- dataset repository, not in this one.
37
 
38
  | | | |
39
  |---|---|---|
@@ -44,11 +41,11 @@ dataset repository, not in this one.
44
 
45
  A fine-tune of **PP-OCRv6 medium** (PaddleOCR's text recogniser) on the CaptchaOCR dataset: the
46
  captchas that open-source Minecraft anti-bot plugins draw, rendered by this project's own Java
47
- generators (46 types, 4600 labelled PNG).
48
 
49
  * **Architecture:** PP-OCRv6 medium recogniser — PP-LCNetV4 backbone + CTC head,
50
  `transformers` class `PPOCRV6SmallRecForTextRecognition`
51
- (`model_type: pp_ocrv6_small_rec`), 19.1 M parameters, hidden size 192.
52
  * **Dictionary:** the base model's own 18 710 classes (index 0 = CTC blank, space at the end).
53
  * **Input:** the captcha **text band** (the strip of pixels that carries the answer), not the whole
54
  frame: resized to height 48, width scaled proportionally and right-padded to 320, BGR channel
@@ -58,49 +55,74 @@ generators (46 types, 4600 labelled PNG).
58
  model has nothing to exploit.
59
 
60
  **The band is the whole game.** On the 29 dataset types that carry a band, the base model scores
61
- `acc_micro = 0.5517` on the band and `acc_micro = 0.0345` on the whole frame — about 16× worse on
62
- the frame. A solver must crop first.
63
 
64
  ## Provenance and licence
65
 
66
- * **Base model:** [`PaddlePaddle/PP-OCRv6_medium_rec_safetensors`](https://huggingface.co/PaddlePaddle/PP-OCRv6_medium_rec_safetensors)
67
- — Apache-2.0, by PaddlePaddle.
68
  * **This model:** that base, fine-tuned on the CaptchaOCR dataset published here:
69
  [`Titlehhhh/captchaocr-dataset`](https://huggingface.co/datasets/Titlehhhh/captchaocr-dataset)
70
  (46 captcha types · 4600 labelled PNG · 23 upstream plugins).
71
  * **Licence of the weights:** Apache-2.0, inherited from the base model. The fine-tuning code and
72
  this card are released under the same terms.
73
  * **Licence of the dataset:** *not* Apache-2.0 — the dataset is split by the licence of the
74
- upstream plugin of each captcha type. The dataset card has the per-type table.
 
75
 
76
  ## Measured results
77
 
78
  ### This repository's weights
79
 
80
- **No metrics yet — the training run has not been completed.** This section will hold exact match
81
- and CER per type and on the type-held-out split when the fine-tune is done. Until then, treat the
82
- numbers below as the **starting point**, not as the result of this repository.
 
83
 
84
- ### The base model, measured before fine-tuning (baseline)
85
 
86
- These are measured numbers of `PaddlePaddle/PP-OCRv6_medium_rec_safetensors` **as it is**, on the
87
- CaptchaOCR dataset — i.e. the point the fine-tune starts from:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
 
89
  | measurement | value | source |
90
  |---|---|---|
91
- | exact match (micro) on the 7 type-held-out types, band crop | 0.5586 | `train/run_ppocr/` zero-step baseline |
92
- | exact match (median over those 7 types) | 0.60 | `train/run_ppocr/` zero-step baseline |
93
- | CER (micro) on the same split | 0.2561 | `train/run_ppocr/` zero-step baseline |
94
  | exact match (micro) on the 29 band-carrying types, band crop | 0.5517 | `reports/bench_models/ppocrv6-medium.json` |
95
  | exact match (micro) on the same 29 types, whole frame | 0.0345 | `reports/bench_models/ppocrv6-medium.json` |
 
96
 
97
- Both sources are files in the **CapthaModel** project repository; nothing above is a projection.
 
98
 
99
- **Why the weights are not here yet.** A short probe run (2 epochs) of the fine-tune was measured
100
- on the same held-out types and it came out **worse than the base model** — median exact match
101
- 0.41 after epoch 1 and 0.24 after epoch 3, against 0.60 for the untouched base model. That
102
- checkpoint is deliberately **not** published: a two-epoch probe is not a model, and shipping it as
103
- one would misrepresent it.
 
 
104
 
105
  ## How to use it
106
 
@@ -169,23 +191,36 @@ the whole frame makes the model read the wrong line.
169
 
170
  ## Reproducing
171
 
172
- The training code lives in the **CapthaModel** repository:
173
 
174
  ```powershell
175
  .venv-gpu\Scripts\python.exe train\finetune_ppocr.py --epochs 30 --batch-size 32
176
  ```
177
 
178
- `train/finetune_ppocr.py` fine-tunes `PaddlePaddle/PP-OCRv6_medium_rec_safetensors` on the
179
- dataset, holds out whole **plugins** (never random splits — a random split leaks the exact gold
180
- answer of 34 % of the test samples), and reports exact match and CER per type plus the median over
181
- types. `train/ppocr_data.py` holds the dataset loader and the preprocessing shown above.
 
 
 
 
 
 
 
 
 
 
 
 
 
182
 
183
  ## Limitations
184
 
185
  * **Only the text band is read.** This is a recogniser, not a solver: it does not reverse strings,
186
  does not turn Russian number words into digits and does not compute arithmetic.
187
- * **No Cyrillic in the dictionary.** The base model's 18 710 classes contain no Cyrillic at all, so
188
- the Cyrillic captcha types of the dataset cannot be expressed in this model's alphabet.
189
  * **The data is synthetic.** Every image is a render of this project's own generators — faithful to
190
  the upstream algorithms, but not a screenshot of a live server.
191
  * **Generalisation is the hard part.** A recogniser can memorise a plugin's style instead of
 
1
  ---
2
  license: apache-2.0
 
 
3
  tags:
4
  - captcha
5
  - ocr
6
  - minecraft
7
  - anti-bot
8
  - pp-ocr
9
+ - base_model:PaddlePaddle/PP-OCRv6_medium_rec_safetensors
 
 
10
  ---
11
 
12
  # CaptchaOCR PP-OCRv6 — a text recogniser for Minecraft anti-bot captchas
13
 
14
  > ## Status: the weights are **not published yet**. This repository holds the model card only.
15
  >
16
+ > The fine-tune on the [CaptchaOCR dataset](https://huggingface.co/datasets/Titlehhhh/captchaocr-dataset) has **not been run to completion**.
17
+ > The main run reached **6 epochs of 30 planned
18
+ > (240 of 1230 steps)** and was stopped by the author, so there is
19
+ > **no checkpoint, no `config.json` and no weight file** in this repository. Nothing here is
20
+ > invented: every number below is a measurement, and the file it was measured in is named
21
+ > next to it.
22
  >
23
+ > **RU:** репозиторий модели пока **пуст по весам** — здесь только карточка. Основной прогон
24
+ > дообучения отработал **6 эпох из 30** (шаг
25
+ > **240 из 1230**) и был остановлен автором; обучение продолжается.
26
+ > Пилотный прогон на 2 эпохи (`train/run_ppocr/smoke/`) — это отдельный прогон, его числа
27
+ > не относятся к основному прогону и в таблицах ниже не подмешаны.
28
 
29
  ## What it reads
30
 
31
+ Frames from the [CaptchaOCR dataset](https://huggingface.co/datasets/Titlehhhh/captchaocr-dataset) — the kind of pictures the model is trained
32
+ on. The caption gives the type and the **gold answer** from `labels.jsonl` (what the player has
33
+ to type). The links are absolute: the pictures live in the dataset repository, not in this one.
 
34
 
35
  | | | |
36
  |---|---|---|
 
41
 
42
  A fine-tune of **PP-OCRv6 medium** (PaddleOCR's text recogniser) on the CaptchaOCR dataset: the
43
  captchas that open-source Minecraft anti-bot plugins draw, rendered by this project's own Java
44
+ generators (46 captcha types, 4600 labelled PNG, 23 upstream plugins).
45
 
46
  * **Architecture:** PP-OCRv6 medium recogniser — PP-LCNetV4 backbone + CTC head,
47
  `transformers` class `PPOCRV6SmallRecForTextRecognition`
48
+ (`model_type: pp_ocrv6_small_rec`), 19 134 326 parameters, hidden size 192.
49
  * **Dictionary:** the base model's own 18 710 classes (index 0 = CTC blank, space at the end).
50
  * **Input:** the captcha **text band** (the strip of pixels that carries the answer), not the whole
51
  frame: resized to height 48, width scaled proportionally and right-padded to 320, BGR channel
 
55
  model has nothing to exploit.
56
 
57
  **The band is the whole game.** On the 29 dataset types that carry a band, the base model scores
58
+ `acc_micro = 0.5517` on the band and `acc_micro = 0.0345` on the whole frame — about
59
+ 16× worse on the frame. A solver must crop first.
60
 
61
  ## Provenance and licence
62
 
63
+ * **Base model:** [`PaddlePaddle/PP-OCRv6_medium_rec_safetensors`](https://huggingface.co/PaddlePaddle/PP-OCRv6_medium_rec_safetensors) — Apache-2.0, by PaddlePaddle.
 
64
  * **This model:** that base, fine-tuned on the CaptchaOCR dataset published here:
65
  [`Titlehhhh/captchaocr-dataset`](https://huggingface.co/datasets/Titlehhhh/captchaocr-dataset)
66
  (46 captcha types · 4600 labelled PNG · 23 upstream plugins).
67
  * **Licence of the weights:** Apache-2.0, inherited from the base model. The fine-tuning code and
68
  this card are released under the same terms.
69
  * **Licence of the dataset:** *not* Apache-2.0 — the dataset is split by the licence of the
70
+ upstream plugin of each captcha type. The dataset card has the per-type table, and the file
71
+ `LICENSE` in the dataset repository spells the same table out in full.
72
 
73
  ## Measured results
74
 
75
  ### This repository's weights
76
 
77
+ **No weights, no metrics — the training run has not been completed.** This section will hold the
78
+ exact match and CER per type and on the type-held-out split when a fine-tune that is actually
79
+ better than the base model is finished. Until then, treat every number below as the **starting
80
+ point**, not as a result of this repository.
81
 
82
+ ### The fine-tuning run that was measured (incomplete, stopped by the author)
83
 
84
+ | | |
85
+ |---|---|
86
+ | command | `.venv-gpu\Scripts\python.exe train\finetune_ppocr.py --out train\run_ppocr\final --epochs 30 --batch-size 32 --lr 1e-4 --head-lr 1e-4 --workers 6 --eval-every 2 --save-every 100 --max-minutes 11` |
87
+ | epochs completed | **6 of 30 planned** — stopped: by the author (the run was killed during epoch 5) |
88
+ | steps completed | **240 of 1230** |
89
+ | train loss | 1.0171 (epoch 0) → 0.0136 (epoch 5) |
90
+ | speed | 101.3–119.2 img/s |
91
+ | checkpoint (not published) | `train/run_ppocr/final/ckpt/step_000200.pt (model + optimiser + scheduler + GradScaler + step), best.pt (epoch 1)` |
92
+ | source | `reports/TRAINING_PPOCR_V6.json` → `training_run` |
93
+
94
+ ### The base model, measured before fine-tuning (the zero step of that run)
95
+
96
+ | held-out type | exact match | CER |
97
+ |---|---|---|
98
+ | `out/JSH32/Minecaptcha/map` | 0.93 | 0.02 |
99
+ | `out/jonesdevelopment/sonar/complex` | 0.45 | 0.278 |
100
+ | `out/jonesdevelopment/sonar/legacy` | 0.23 | 0.435 |
101
+ | `out/jonesdevelopment/sonar/standard` | 0.6 | 0.158 |
102
+ | `out/laforetbrut/are-you-sure/code` | 0.01 | 0.8 |
103
+ | `out_ru/BotFilter/map` | 0.73 | 0.093 |
104
+ | `out_ru/CaptchaVerifyZ/map` | 0.96 | 0.01 |
105
+ | **median over 7 types** | **0.6** | **0.1575** |
106
+ | **micro (700 images)** | **0.5586** | **0.2561** |
107
+
108
+ ### The base model on the whole dataset (archived benchmark)
109
 
110
  | measurement | value | source |
111
  |---|---|---|
 
 
 
112
  | exact match (micro) on the 29 band-carrying types, band crop | 0.5517 | `reports/bench_models/ppocrv6-medium.json` |
113
  | exact match (micro) on the same 29 types, whole frame | 0.0345 | `reports/bench_models/ppocrv6-medium.json` |
114
+ | exact match (micro) on all 46 types, band crop | 0.4043 | `reports/bench_models/ppocrv6-medium.json` |
115
 
116
+ Every number in this card comes from a file of the **CaptchaOCR** project repository — the
117
+ measured results are in `reports/`, they are not typed by hand and nothing is extrapolated.
118
 
119
+ **Why the weights are not here yet.** The measured run did **not** improve on the base model:
120
+ the median exact match over the 7 held-out types fell from 0.6 (untouched base)
121
+ to 0.41 at epoch 1 and to 0.24 at epoch 3, and
122
+ one type out of seven got better while six got worse. A checkpoint like that is deliberately
123
+ **not** published: shipping it as "the model" would misrepresent it. Training continues with a
124
+ changed hypothesis (a much smaller learning rate, a frozen backbone, a larger and more diverse
125
+ training set) — the plan and the measurements are in `reports/TRAINING_PPOCR_V6.md` §8.
126
 
127
  ## How to use it
128
 
 
191
 
192
  ## Reproducing
193
 
194
+ The training code lives in the **CaptchaOCR** project repository:
195
 
196
  ```powershell
197
  .venv-gpu\Scripts\python.exe train\finetune_ppocr.py --epochs 30 --batch-size 32
198
  ```
199
 
200
+ `train/finetune_ppocr.py` fine-tunes `PaddlePaddle/PP-OCRv6_medium_rec_safetensors` on the dataset, holds out whole **plugins**
201
+ (never a random image split: several captcha types have only a few distinct answers, so a random
202
+ split lets the exact gold answer of a test image appear in the training half), and reports exact
203
+ match and CER per type plus the median over types. `train/ppocr_data.py` holds the dataset loader
204
+ and the preprocessing shown above.
205
+
206
+ The measured report of the run quoted above is `reports/TRAINING_PPOCR_V6.json` (numbers) and
207
+ `reports/TRAINING_PPOCR_V6.md` (the analysis), both in the project repository.
208
+
209
+ ## Repository metadata
210
+
211
+ While the weights are absent, this repository declares **only** `license: Apache-2.0` and the
212
+ tags above — there is deliberately **no** `library_name`, **no** `pipeline_tag` and **no**
213
+ `base_model:` field, because those three fields make the Hub list the repository as a loadable
214
+ `transformers` model. There is nothing to load yet. When the weights are published, the
215
+ `library_name: transformers` and `pipeline_tag: image-to-text` fields will be added back together
216
+ with the weight files, in the same commit.
217
 
218
  ## Limitations
219
 
220
  * **Only the text band is read.** This is a recogniser, not a solver: it does not reverse strings,
221
  does not turn Russian number words into digits and does not compute arithmetic.
222
+ * **No Cyrillic in the dictionary.** The base model's 18 710 classes contain no Cyrillic at
223
+ all, so the Cyrillic captcha types of the dataset cannot be expressed in this model's alphabet.
224
  * **The data is synthetic.** Every image is a render of this project's own generators — faithful to
225
  the upstream algorithms, but not a screenshot of a live server.
226
  * **Generalisation is the hard part.** A recogniser can memorise a plugin's style instead of