加载中…
加载中…
TextVerifier is a target-conditioned verifier for structural Chinese glyph rendering errors. Given a character crop and the character it is supposed to depict, it decides whether the glyph is structurally correct, catching missing, extra, broken, merged, split, distorted, or misplaced strokes and components.
Text-to-image models increasingly produce Chinese text that is perfectly readable yet locally wrong. OCR and general vision-language models are trained to be invariant to exactly those deviations, so they read the intended character and report success. TextVerifier instead conditions on the target character and asks whether the rendering matches it, which makes it usable for quality inspection of generated images and as a per-character reward signal for post-training.
This repository holds the released model weights. Inference and evaluation code live in the GitHub repository below.
| Resource | Location |
|---|---|
| Code (inference, evaluation, benchmark converter) | github.com/ATH-MaaS/TextVerifier |
| Model weights | ATH-MaaS/TextVerifier-CJK-CLIP (this repository) |
| Benchmark dataset | ATH-MaaS/TextRenderBench-ZH |
| Paper | arXiv:2610.19551 |
The model is a dual encoder that maps a glyph crop and its target character into a shared embedding space.
Comparing against prototypes of normal renderings, rather than against an anomaly model, is what keeps the verifier sensitive to structural deviation while staying insensitive to font, style, color, and background variation.
| File | Description |
|---|---|
textverifier_stage3.pth |
Verifier checkpoint (final training stage). |
textverifier_k10_q90.pt |
Per-character visual prototypes, character-to-index mapping, decision threshold. |
prototype_metadata.json |
Architecture, prototype shape, threshold, and scoring rule. |
manifest.sha256 |
SHA-256 checksums for the three files above. |
Download all four at the same immutable revision:
huggingface-cli download ATH-MaaS/TextVerifier-CJK-CLIP \
textverifier_stage3.pth \
textverifier_k10_q90.pt \
prototype_metadata.json \
manifest.sha256 \
--local-dir assets
Place them in an assets/ directory at the root of the cloned code repository, then verify the checksums and assets with:
python -m textverifier.verify_release --root . --check-checkpoint
Full installation and evaluation instructions are in the code repository README. The short version:
from textverifier.inference import TextVerifier
verifier = TextVerifier(device="cuda", dtype="bfloat16")
result = verifier.score_image("crop.png", "北")
# {"char": "北", "scored": True, "error_score": ..., "threshold": ..., "pred_render_error": False}
Batch inference and benchmark evaluation are available through python -m textverifier.inference and python -m textverifier.evaluate.
Prototypes exist for the set of characters the model was trained on, which covers the common Han characters used in generated Chinese text. A character outside that set cannot be scored: the verifier reports it as unscored rather than guessing, and treats it as normal by default. Coverage over a given input is reported alongside evaluation results, so unsupported characters are visible rather than silently absorbed.
The model judges structural correctness of a glyph against a target character. It is not an OCR system and does not return recognized text; it must be told what the character should be. Stylistic variation such as font choice, calligraphy, color, and background is deliberately not treated as an error.
Training proceeds in three stages: large-scale crop-to-IDS contrastive alignment over real-world Chinese text images, absolute discrimination of correct versus structurally corrupted glyphs built from font rendering and stroke-vector manipulation, and relative quality ordering learned from early-versus-late samples of the same character and position taken from a text-region inpainting model's training trajectory. Training images, third-party fonts, and third-party source data are not part of this release; only code, weights, and the independent TextRenderBench-ZH benchmark are released.
@article{chen2026textverifier,
title = {TextVerifier: Seeing Beyond Recognition to Verify Chinese Text Rendering},
author = {Chen, Yiyang and Wang, Guo-Hua and Liu, Yaoli and Chen, Qing-Guo and Xu, Zhao and Luo, Weihua and Ma, Xiujun},
journal = {arXiv preprint arXiv:2610.19551},
year = {2026},
url = {https://arxiv.org/abs/2610.19551}
}
Apache License 2.0. See LICENSE.