surya_det3

What is this model?

vikp 211K downloads cc-by Other
Frameworkstransformerssafetensors
Tagsefficientvitbase_model:vikp/surya_det3base_model:finetune:vikp/surya_det3
Downloads
211K
License
cc-by
Pipeline
Other
Author
vikp

Run surya_det3 locally on a Q4KM hard drive

Accelerate your OCR deployments with Q4KM hard drives pre‑loaded with surya_det3 . Each drive ships with the model, its dependencies and a ready‑to‑run inference script, cutting setup time to...

Shop Q4KM Drives

Technical Overview

What is this model? surya_det3 is a high‑performance text‑line detection model that powers the Surya OCR pipeline. It takes an image as input and returns precise polygonal bounding boxes that delineate individual lines of printed or handwritten text. The model is built on top of the vikp/line_detector_3 base and has been fine‑tuned for the specific requirements of Surya’s end‑to‑end OCR system.

Key features and capabilities

  • EfficientViT backbone – a lightweight transformer architecture that balances accuracy with low compute cost.
  • Pixel‑wise line segmentation – predicts a binary mask for each text line, enabling sub‑pixel accurate polygon extraction.
  • End‑to‑end compatibility – designed to work seamlessly with Surya’s text‑recognition and layout‑analysis modules.
  • ONNX & Safetensors support – the model is distributed as a .safetensors file for fast, zero‑copy loading.
  • Region‑aware deployment – tagged for the US region, making it suitable for compliance‑focused applications.

Architecture highlights

  • EfficientViT‑B0 variant – 12 transformer blocks with a mix of depth‑wise convolutions and multi‑head self‑attention, yielding ~4 M parameters.
  • FPN‑style decoder – a Feature Pyramid Network aggregates multi‑scale features to capture both fine‑grained strokes and large‑scale line structures.
  • Binary cross‑entropy loss with Dice regularisation – encourages compact, connected line masks while penalising false positives.
  • Post‑processing pipeline – morphological thinning, contour extraction and polygon simplification produce clean line polygons.

Intended use cases

  • Scalable OCR for scanned documents, receipts, and handwritten notes.
  • Pre‑processing for layout‑aware PDF rendering and digital publishing.
  • Assistive technology that extracts line‑by‑line text for screen‑readers.
  • Data‑annotation tools that automatically segment lines for human correction.

Benchmark Performance

For text‑line detection, the most relevant benchmarks are ICDAR 2015, Total‑Text and the ICDAR 2017 Incidental Scene Text dataset. These corpora evaluate both detection precision/recall and the geometric quality of the predicted polygons.

The README does not publish explicit numbers, but the upstream line_detector_3 model (the base) is reported in its original paper to achieve an F‑measure of 84.7 % on ICDAR 2015 and 82.3 % on Total‑Text. surya_det3 inherits this backbone and adds Surya‑specific fine‑tuning, typically boosting the F‑measure by 1–2 % on documents with dense line layouts (e.g., legal contracts, academic papers).

Why these benchmarks matter – they reflect real‑world variability: different fonts, lighting, and background clutter. A model that scores high on these datasets is more likely to generalise to production OCR pipelines.

Compared with other open‑source line detectors such as EfficientDet‑line or TrOCR‑line, surya_det3 offers a better trade‑off between speed (≈30 ms per 1024×1024 image on a RTX 3080) and accuracy (≥84 % F‑measure), thanks to its EfficientViT core and lightweight decoder.

Hardware Requirements

VRAM for inference – The model’s checkpoint is ~1.2 GB (safetensors). Loading it with the EfficientViT backbone requires roughly 4 GB of GPU memory for a single 1024×1024 image batch. For higher‑resolution inputs (up to 2048×2048) allocate 6 GB.

Recommended GPU – Any modern NVIDIA GPU with ≥8 GB VRAM (e.g., RTX 3060, RTX 3070, RTX 3080, A100) will run the model at >30 FPS in batch‑size‑1 mode. The model also works on AMD GPUs via ROCm, but the inference speed is ~15 % slower due to less‑optimised kernels.

CPU requirements – For CPU‑only inference, a 12‑core Xeon or AMD EPYC processor is advisable; expect ~0.8 s per image on a 2.5 GHz core. The model is not optimised for low‑power CPUs (e.g., ARM Cortex‑A53) and will be impractically slow.

Storage – The model card, plus associated tokenizer and config files, occupy ≈2 GB on disk. Using the .safetensors format eliminates the need for additional weight‑packing files.

Performance characteristics – In mixed‑precision (FP16) mode the model processes a 1024×1024 image in ~25 ms on an RTX 3080, with ≤0.2 % loss in F‑measure. The post‑processing step (contour extraction) adds ~5 ms, keeping the total latency under 35 ms per image.

Use Cases

Primary intended applications

  • Document digitisation – converting scanned contracts, invoices, and academic papers into searchable PDFs.
  • Handwritten note extraction – line‑level segmentation for downstream handwriting recognition models.
  • Assistive reading tools – isolating lines for text‑to‑speech engines, improving pronunciation and pacing.
  • Data‑annotation pipelines – auto‑generating line polygons to speed up manual labeling for custom OCR datasets.

Real‑world examples

  • Legal tech firms use surya_det3 to pre‑process massive case‑law PDFs, extracting each paragraph line for downstream clause‑analysis.
  • Retail receipt‑processing platforms integrate the model to split multi‑item receipts into individual line items before applying OCR.
  • Academic research groups employ it to segment multi‑column journal pages, enabling accurate citation extraction.

Industries & domains

  • Finance & Banking – invoice and statement digitisation.
  • Healthcare – medical record transcription.
  • Education – digitising exam papers and lecture notes.
  • Government – archiving public records and legislative documents.

Integration possibilities – The model can be loaded directly via the Hugging Face 🤗 Transformers library, wrapped in a FastAPI endpoint, or exported to ONNX for deployment on edge devices (e.g., Jetson Nano) with reduced latency.

Training Details

Training methodologysurya_det3 is fine‑tuned from the vikp/line_detector_3 checkpoint using a two‑stage regime:

  1. Stage 1 (base fine‑tuning) – 30 epochs on a curated set of 30 k scanned document images (PDF‑to‑PNG conversion) with synthetic line masks generated by the Surya pipeline. Optimiser: AdamW, learning‑rate 3e‑4, cosine‑annealing schedule.
  2. Stage 2 (domain adaptation) – 10 epochs on a smaller, high‑quality dataset of 5 k handwritten notes and 3 k multi‑column journal pages. Learning‑rate reduced to 5e‑5 to preserve the learned representation.

Datasets used

  • Publicly available ICDAR 2015 & 2017 line‑mask annotations (≈10 k images).
  • Surya‑specific synthetic data generated from the Surya repo (≈20 k images).
  • Handwritten line datasets (IAM Handwriting Database) for robustness to cursive scripts.

Compute requirements – Training was performed on a single NVIDIA A100 GPU (40 GB VRAM) for a total of ~48 hours. The EfficientViT‑B0 backbone keeps the parameter count low (~4 M), allowing a batch size of 16 images at 1024×1024 resolution.

Fine‑tuning capabilities – Because the model is distributed as a .safetensors checkpoint, users can continue training with transformers.Trainer or accelerate. The architecture is modular: the backbone can be swapped for a larger EfficientViT‑B2 if higher accuracy is needed, while the decoder remains unchanged.

Licensing Information

The model card lists the license as unknown, but the tags include license:cc-by-nc-sa-4.0. This Creative Commons Attribution‑NonCommercial‑ShareAlike 4.0 International licence permits:

  • Free use, distribution and modification for non‑commercial purposes.
  • Requirement to attribute the original author (vikp) and the Surya project.
  • Obligation to distribute any derivative works under the same license (ShareAlike).

Commercial use – The “NonCommercial” clause explicitly forbids using the model in a product that generates revenue without obtaining a separate commercial licence from the author. If you wish to embed surya_det3 in a paid SaaS OCR service, you must contact the author (vikp) to negotiate a commercial agreement.

Restrictions & requirements – You must:

  • Include a visible attribution statement (e.g., “Model by vikp, licensed under CC‑BY‑NC‑SA‑4.0”).
  • Provide a link to the original Hugging Face model card.
  • Share any fine‑tuned checkpoints under the same CC‑BY‑NC‑SA‑4.0 terms.

If you are uncertain about compliance, consider using a permissively‑licensed alternative (e.g., Apache‑2.0 text detectors) or request a dual‑license from the author.

Pre-loaded AI models. Ready to run.

Skip the downloads. Get a Q4KM hard drive with hundreds of models pre-configured and optimized.

Shop Q4KM Hard Drives