Home/Models/Baberu OCR
Image → Text · 115M

Baberu OCR

Hand it one manga speech bubble and it returns the line inside as text. A 115M model that handles Japanese, Chinese and English. The goal was to run inside a phone or a browser without sending anything to a server — for jobs like translation or line search, where you process bubbles by the thousand.

Apache-2.0 115M params JA · ZH · EN On-device DINOv2 + GQA decoder
115M
Parameters — 86M of them a frozen DINOv2
3.5%
Japanese bubble CER, beating the teacher
Competitive with models this much larger
14,630
Character vocabulary, JA+ZH+EN in one table
Baberu OCR vs. other models: bubble CER on Japanese, English, Chinese
Bubble-level lenient CER (%, lower is better). Pink is Baberu. Across all three languages it keeps pace with far larger models.
Why

Why build it small

Reading manga lines usually means processing a page at a time, in bulk. The cost per image starts to matter. So instead of stacking a huge general-purpose model, I built a small one aimed at the narrow input of a single bubble. The seeing is handled by a pre-trained DINOv2, reused as-is; only the decoder that writes the characters is trained from scratch. Borrow the eyes, grow just the hands. With that split, 115M is enough to hit the accuracy I needed.

The result: on the Japanese benchmark it beats the teacher model it was distilled from, and on English and Chinese it stays even with models 8× its size at the bubble level. Training took about three days on a single A100. Evaluation was on labels the model never saw during training.

Architecture

How it works

Baberu OCR architecture: frozen DINOv2 encoder → MLP → 6-layer GQA decoder (from scratch) → character logits
Blue is reused (frozen); orange is trained from scratch.

A bubble is cropped to 224×224 and run through the frozen DINOv2-ViT-B/14. The 256 vision tokens that come out are projected to 512 dimensions by a small MLP and handed to a 6-layer decoder, which predicts one character at a time. The vocabulary is character-level, 14,630 entries — kanji, kana and the Latin alphabet for all three languages folded into one table. Training happens in two stages: first the decoder alone, then the whole thing is unfrozen for fine-tuning.

Vision encoder
DINOv2-ViT-B/14 (86M, frozen, reused)
Decoder
6-layer GQA (8q / 2kv) · ~26M · trained from scratch
Decoder details
hidden 512 · FFN 1536 · RoPE · SwiGLU · tied embeddings
Vocabulary
14,630 (character-level)
Languages
Japanese / Chinese / English
Formats
PyTorch / ONNX (121MB · 242MB)
Quantization
fp16 / int8 / int4
License
Apache-2.0
Benchmark

Accuracy

LanguageBaberu 115MPaddleOCR-VL 0.9BFor-Manga 0.9Bmanga-ocr 110M
Japanese3.53.74.2
English6.28.119.239.2
Chinese5.27.78.837.1

Bubble-level lenient CER (%, lower is better). Evaluated on Manga109-v2026 (JA, n=2000) and a hand-annotated hold-out (EN n=237, ZH n=246). Note that on char-weighted CER for long sentences, PaddleOCR-VL leads on English and Chinese. For-Manga is excluded from the Japanese comparison because it was trained on Manga109.

Limitations

Where it struggles

  • It expects a single bubble as input. It isn't meant for handing over a whole page (do the detection in a separate step).
  • It occasionally confuses dakuten and handakuten.
  • It's weak on fonts outside its training data, like older Western comics.
Related

Related

← Back to Models & Datasets