A compact vision model for classifying health-app uploads — prescriptions shot at an angle, X-rays, Aadhaar cards, discharge summaries, the occasional accidental selfie. A frozen
SigLIP2-base
tower (
google/siglip2-base-patch16-naflex
) with lightweight heads answers three questions about an image in a single pass:
What it is
— a two-level label: 5 groups (L1) → 27 leaf classes (L2)
Is it medical?
— binary head
Is it handwritten?
— binary head
The model was built by training many specialised models, ensembling them, and distilling the ensemble into this one compact student.
Results
Full internal test = 16,204 images (see
benchmark_results.json
).
Precision
Size
Accuracy (27-class)
Macro-F1
bf16
193 MB
96.45
0.965
int8
103 MB
96.43
0.965
int4
60 MB
95.22
0.955
int8 is effectively lossless; int4 trades about a point of accuracy for a model over 3× smaller that runs comfortably on a plain CPU. It matches or beats models several times its size, including a 428M SigLIP2-SO400M variant (96.24%) and a 256M generative VLM baseline (90.42%).
By default L2 comes from a flat 27-way head and L1 is inferred from it. Other options:
model.classify(img, scope="l1") # L1 group only (no L2)
model.classify(img, scope="hierarchical") # L1 head → that group's leaf L2 head
model.classify(img, l1="Document") # fix L1 → that group's leaf L2 head
model.classify(img, top_k=3) # top-3 candidates for the multi-class heads
medical
and
handwritten
are independent binary heads — disable them with
medical=False
/
handwritten=False
.
Quantized loading (optimum-quanto — CPU & GPU)
Only the vision tower is quantized; the heads stay full precision.
Working from a clone instead?
from modeling_siglip2_hier import load_classifier
inside the repo directory works too, and
load_classifier(".", quantization="int8")
loads straight from the checkout.
Citation
If you use this model, please cite:
@software{med_doc_classifier,
author = {{Eka Care}},
title = {Med Doc Classifier: hierarchical classification of health-app document uploads},
year = {2026},
url = {https://huggingface.co/ekacare/med-doc-classifier}
}
Runs of ekacare med-doc-classifier on huggingface.co
49
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
-163
30-day runs
More Information About med-doc-classifier huggingface.co Model
med-doc-classifier huggingface.co is an AI model on huggingface.co that provides med-doc-classifier's model effect (), which can be used instantly with this ekacare med-doc-classifier model. huggingface.co supports a free trial of the med-doc-classifier model, and also provides paid use of the med-doc-classifier. Support call med-doc-classifier model through api, including Node.js, Python, http.
med-doc-classifier huggingface.co is an online trial and call api platform, which integrates med-doc-classifier's modeling effects, including api services, and provides a free online trial of med-doc-classifier, you can try med-doc-classifier online for free by clicking the link below.
ekacare med-doc-classifier online free url in huggingface.co:
med-doc-classifier is an open source model from GitHub that offers a free installation service, and any user can find med-doc-classifier on GitHub to install. At the same time, huggingface.co provides the effect of med-doc-classifier install, users can directly use med-doc-classifier installed effect in huggingface.co for debugging and trial. It also supports api for free installation.