gt-free-ocr-metrics/docsim-lora
014
DocSim LoRA
A LoRA-adapted CLIP+DINOv2 similarity head trained to measure visual similarity between original document page scans and their OCR reconstructions. Released as part of the OmniDocBench Render-and-Compare project.
Architecture
- Backbone A: CLIP ViT-B/32 (pretrained on LAION-2B via open_clip)
- Backbone B: DINOv2 ViT-B/14
- Projection head: two-layer MLP (hidden=512, output=256)
- LoRA adapters: rank 16, alpha 32, dropout 0.05 — applied to both CLIP and DINOv2
Training
Trained on 20,280 triplets (anchor original page, positive OCR reconstruction, negative mis-matched reconstruction) derived from the OmniDocBench Render-and-Compare dataset.
Files
Use lora_adapter_best/ + head_state_best.pt for inference.
Usage
Download via GT-free-ocr-metrics:
bash download_models.shThen run any DocSim-based method:
bash scripts/run_method.sh docsim_loraLicense
Apache-2.0. The companion datasets (OmniDocBench Render-and-Compare) are CC-BY-NC-4.0.
