Downloads · 30 days
36
21% of all-time downloads
Cronosteak/ocr-corrector-flan-t5-base
ocr-corrector-flan-t5-base is a machine learning model from Cronosteak. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as mit.
Fine-tuned google/flan-t5-base (250M parameters) that corrects OCR errors in electrical engineering academic text.
Downloads · 30 days
36
21% of all-time downloads
All-time downloads
171
Public
Parameters
248M
5.3 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors990 MB · 100%
From the Hugging Face model README
Fine-tuned google/flan-t5-base (250M
parameters) that corrects OCR errors in electrical engineering academic text.
This is the model released with the paper "Automatic OCR Error Correction in Electrical Engineering Academic Papers Using Sequence-to-Sequence Models" (IEEE LA-CCI 2026).
The model expects the prefix correct OCR: on every input.
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
model_id = "Cronosteak/ocr-corrector-flan-t5-base"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSeq2SeqLM.from_pretrained(model_id)
text = "correct OCR: Thc powcr systcm opcrates at 60 Hz"
inputs = tokenizer(text, return_tensors="pt", max_length=512, truncation=True)
outputs = model.generate(**inputs, max_new_tokens=256, num_beams=4)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
6,440 synthetic OCR–ground-truth pairs built without manual annotation: open-access electrical engineering abstracts were collected from the OpenAlex API, then corrupted with synthetic OCR noise (character confusions, spurious spaces/hyphens, deleted spaces, duplicated characters) at four rates: r ∈ {0.02, 0.04, 0.06, 0.08}.
Splits are per-document (80/10/10) to avoid leakage between train and test.
Held-out test set of 676 pairs:
| Method | CER (%) ↓ | WER (%) ↓ | BLEU ↑ | EM (%) ↑ |
|---|---|---|---|---|
| Noisy input (no correction) | 3.28 | 21.99 | 63.95 | 0.00 |
| Spellchecker baseline | 3.35 | 15.87 | 73.80 | 5.47 |
| This model | 2.05 | 4.21 | 91.94 | 44.23 |
A 37.5% relative CER reduction and an 80.9% relative WER reduction over the
uncorrected input. Per-noise-rate metrics are in eval_results.json.
Ablations showed that multi-level noise diversity is an important contributor to generalization: restricting training to r=0.04 alone drops exact match from 44.23% to 35.21% (that variant also trains on fewer pairs, so diversity and dataset size are not fully disentangled).
| Hyperparameter | Value |
|---|---|
| Base model | google/flan-t5-base |
| Optimizer | Adafactor |
| Learning rate | 1e-4 |
| Batch size | 8 (grad. accumulation 2) |
| Epochs | 15 (early stopping, patience 3) |
| Warmup steps | 200 |
| Weight decay | 0.01 |
| Max input/output length | 256 / 256 |
| Seed | 42 |
@inproceedings{espinosa2026ocr,
title = {Automatic OCR Error Correction in Electrical Engineering
Academic Papers Using Sequence-to-Sequence Models},
author = {Espinosa Ortiz, Breinner Farid and
Forero Mendoza, Leonardo Alfredo and
Pacheco, Marco Aur{\'e}lio C. and
Batista, Evelyn C. S.},
booktitle = {2026 IEEE Latin American Conference on Computational
Intelligence (LA-CCI)},
year = {2026},
publisher = {IEEE}
}