Humigy Tiny v1
An 8.9M-parameter (35 MB fp32, ~9 MB int8) encoder-decoder that turns a short clinical note (2-10 words, Indian English / Hinglish in Roman script) into a ranked list of suggestions: diagnoses, lab tests, or generic medicines. Built to run offline on a phone inside a prescription tool. A licensed clinician picks every item. The model never decides anything.
Not a medical device and not clinically validated. All training labels are synthetic (written by an AI) and have never been reviewed by a doctor. ICD-10 codes, lab names and medicine lists are unverified against official sources. Do not use it for real patient decisions. Doctors: please help fix the data (see the data repo).
Use it
pip install torch sentencepiece safetensors
python humigy_infer.py "[dx][icd10] bukhar aur khansi 3 din se" -> viral_fever B34.9 ; cough R05
python humigy_infer.py "[labs] fever with chills" -> mp_smear ; malaria_rapid_antigen ; cbc
python humigy_infer.py "[med-comp] knee pain" -> aceclofenac+paracetamol ; diclofenac_gel ; ...
Tags (pick exactly one): [dx] [labs] [med-comp]; optional [icd10] with [dx]. Output is plain text: names separated by ;,
each followed by its ICD-10 code if requested. Answers come only from a closed list of 1,201 terms (526 diagnoses, 239 labs,
436 generic medicines/combinations; no brand names) for general-physician, dental and arthritis clinics. The decoding in
humigy_infer.py forces valid terms of the requested kind only (it never emits an unknown term or a wrong code).
What the model does and does not do (by design)
One note = one problem. The model is deliberately tiny and handles a single short problem well. It does not understand negation ("fever but no cough") and it does not reliably find every problem in a note that names several ("diabetes and hypertension, routine review"). If you want that, engineer it with code in front of the model. That is intentional: it keeps the model small enough for a phone.
The recipe we used, and what it bought (same model, same benchmark):
- remove negated findings with rules (e.g. cut "no X", "X nahi", "without X" phrases),
- split the note into separate problems at "and", commas, "with", "+",
- run the model on the whole note and on each part, then interleave the lists so every problem gets its best suggestion first. The rule code is not shipped here; it is about 100 lines of text matching and easy to rewrite.
Results (independent benchmark of 486 notes, in the data repo; labels written by an AI, not a clinician)
| model only (this repo) | with the 2 rule layers above | |
|---|---|---|
| Single complaints: right diagnosis first / within top 3 | 81% / 90% | 81% / 89% |
| Notes naming 2-3 problems: every problem found (strict / relaxed*) | 31% / 56% | 87% / 95% |
| Negation notes: negated condition wrongly suggested | 26% | 14% |
| Irrelevant notes ("hello doctor") correctly answered with nothing | 87% | 80% |
| *relaxed: a closely related diagnosis counts. The pass marks, the relaxed score and the rules were chosen by the authors after seeing | ||
| failures, so treat the right-hand column as optimistic. Weaker areas (model only): Hinglish singles (75% / 85%, English 87% / 95%) and doctor shorthand (60% / 76%). | ||
| Held-out test set (unseen wordings of the training conditions): F1 0.76 overall; this set is easier than the benchmark. |
Training
8.9M-parameter encoder-decoder (4+4 layers, 256-dim, tied output layer), trained from scratch (no base model) for 6 epochs on ~443k synthetic input-to-answer pairs (110k notes) built from per-condition phrase banks and label lists in the data repo. Labels were written by Claude (Anthropic) and validated only against the closed vocabulary. No real patient data was used. Before reuse, check the terms that apply to models trained on AI-generated data.
Limits
Primary-care conditions only. No dosing, interaction, allergy or contraindication logic. Controlled sedatives/opioids are in the vocabulary but rare in suggestions. English / Roman-script Hinglish only. Software that suggests diagnoses may count as a medical device in some jurisdictions (e.g. India's Medical Device Rules 2017); that depends on how you deploy it. ICD-10 is copyright of the World Health Organization; codes are included for interoperability.
Contribute
Data, labels and benchmark: the humigy-tiny-data dataset repo (use its Community tab: discussions and pull requests). Doctors and developers are welcome.
- Downloads last month
- 17