Model reference · open weights

txtcaptcha-crnn

Available as managed deployment LLMs jtrecenti · community Image→text 1 variants 551 dl/mo

txtcaptcha-crnn is an open-weight language model from jtrecenti. AxForge deploys and operates it for you on dedicated EU-owned hardware — with the licence handled where one is required.

Available as managed deployment — configured and operated for you on dedicated EU hardware, quoted per deployment.

What it is

Released byjtrecenti
TypeLanguage models
TaskImage→text
Parameters (lead)5M
Runs withpytorch
Released2026-04-11
Popularity551 downloads / month
LicenceOpen weights

About

What txtcaptcha-crnn is

A Convolutional Recurrent Neural Network (ResNet-style CNN → BiLSTM → CTC) trained jointly on ten labeled captcha datasets from Brazilian courts and tax authorities, published originally by the R captcha package. It replaces ten per-site CNN classifiers with a single model that reads variable-length alphanumeric strings from arbitrarily-sized input images.

Read the full model card

Usage

from txtcaptcha import decrypt, read_captcha

cap = read_captcha("captcha.png")
# First call downloads the weights from this repo into ~/.cache/huggingface;
# subsequent calls are free.
print(decrypt(cap))                  # greedy CTC decoding
print(decrypt(cap, length=5))        # force exactly 5 output chars
print(decrypt(cap, mask="[0-9]"))    # restrict to digits

Explicit download (useful for notebooks or CI warmup):

from txtcaptcha import from_pretrained
model = from_pretrained("jtrecenti/txtcaptcha-crnn")

Install txtcaptcha:

pip install git+https://github.com/jtrecenti/txtcaptcha

Training data

Merged union of these datasets (published at https://github.com/decryptr/captcha/releases):

cadesp, esaj, jucesp, rfb, sei, tjmg, tjpe, tjrs, trf5, trt

Labels follow the filename convention _.. Vocabulary is the full alphanumeric range 0-9a-zA-Z (62 classes + CTC blank).

Architecture

StageDetails
BackboneResNet-style CNN, channels 64 → 128 → 256 → 256, H/8 × W/4 downsample
Sequence head2-layer bidirectional LSTM, hidden 256
ClassifierLinear 512 → 63 (62 chars + blank)
LossCTC, handles variable output length
InputAny dimensions; height resized to 32 at inference, width preserved

The full config is in config.json.

Validation accuracy

~89% captcha-level exact match on a held-out 20% split of the training corpus. Per-dataset breakdown available in notebooks/eval_per_dataset.ipynb.

Limitations

  • Trained exclusively on Brazilian court captcha fonts/distortions. Generalization to US/European OCR captchas is untested.
  • The sei dataset is a math captcha; the model learned to transcribe the (already-solved) label as if it were a plain 4-char sequence.
  • Label length distribution is concentrated on 4–5 chars; longer sequences may degrade. Use decrypt(..., length=N) to enforce an exact length.

Versioning

Pin to a specific release with revision=:

from_pretrained("jtrecenti/txtcaptcha-crnn", revision="v0.1.0")

License

MIT. The original training data from the R captcha package is redistributed under its own terms.

From the published model card. Full card on the HuggingFace links in the sidebar.

How it works

How language models work

Your prompttext / messagesTransformerattention over tokensNext-token loopgenerate + streamResponsetext · tool callsA language model reads your tokens and predicts the next one, again and again, streaming the reply back.

Using it via the API

Call it like any OpenAI endpoint

Once AxForge deploys txtcaptcha-crnn for you, it answers on the OpenAI-compatible API — the same base URL and keys as every other model. (txtcaptcha-crnn below is illustrative; you get the exact model name on deployment.)

$ curl -sS https://api.axforge.ai/v1/chat/completions \
  -H "Authorization: Bearer $AXFORGE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"txtcaptcha-crnn","messages":[{"role":"user","content":"Hello"}]}'

Create an account — your API key is available in the console. 3M free tokens every 30 days with every new account.

© 2026 AxForge · EU-hosted AI infrastructure Pricing Docs Trust Privacy Terms