Chhaya: teaching a 4B model to be the eyes, not the doctor

Community Article
Published June 15, 2026

Field notes from the Hugging Face Build Small Hackathon — Backyard AI track.

Chhaya — shade for those who work in the sun

The people who get the most sun in India are the ones who never get their skin looked at.

There's a man who parks his auto-rickshaw outside my usual chai stall. His right forearm — the one that hangs out the window all day — is a shade darker and rougher than his left, with a patch near the wrist that's been there long enough that he's stopped seeing it. He's in the sun maybe ten hours a day. He has never shown that arm to a doctor and he never will, because it doesn't hurt, and because a dermatologist is for people with the time and money to worry.

He isn't unusual. The delivery rider with a sunburn line under the helmet, the construction worker on a site that doesn't reschedule for a heat warning — same exposure, same blank space where a skin check should be. And every summer is hotter than the last. Put numbers on it and the gap gets absurd: roughly 75% of India's workforce — about 380 million people — work heat-exposed outdoor jobs, against about 9.5 dermatologists per million people, with 80% of the population rural and nowhere near one.

What they all have is the phone in their pocket. So the question was narrow: what can a small model do with one photo and thirty seconds, for someone who will never see a dermatologist?

That's Chhaya (छाया — "shade").

Shade, for people who never get any.

See it in 90 seconds

(Prefer the full story? Here's the 4.5-minute walkthrough.)

What Chhaya does

  1. Skin check. Snap a photo of any spot. MedGemma-1.5-4B describes what it sees — type, colour, borders, symmetry, texture — and flags how concerning it looks: looks ordinary / worth watching / show a doctor.
  2. A plan built around your work day. Tell Chhaya your occupation, hours in direct sun, and water access, and it builds a hydration schedule and protection plan that fits the actual job — window-side UV for drivers, helmet-line burns for riders, NDMA work-hour guidance for construction.
  3. Heat symptom triage. First-aid for heat cramps, exhaustion, and heatstroke, with deliberately zero AI — pure deterministic logic from NDMA and WHO guidance. An emergency is not the place for a model to start sampling.
  4. Read it aloud. Every verdict can be spoken with one tap (Kokoro-82M, on CPU), in English or Hindi, so the plan reaches workers who don't read English easily.

You can try the live app right here:

The one decision everything else hung on

Early on it would have been easy to let the model do everything — look at the photo and tell the person what to drink, when to rest, whether to worry. That version demos beautifully. It also confidently hallucinates a hydration schedule, and someone working in a furnace believes it.

So we drew one line and refused to cross it.

The model is the eyes. The guidelines are the medicine.

MedGemma looks at the photo and does exactly one thing: it returns a structured description — type, colour, borders, symmetry, texture, and a concern level. That's all it's trusted with. Every medical number and action — litres per shift, ORS timing, the 12–3 pm shade window, when to call an ambulance — is curated, deterministic content from NDMA India heat guidance, WHO heat-health advice, and the Cancer Council ABCDE criteria.

So a result reads something like:

"Uneven edge, more than one shade of brown — worth showing a doctor. No panic, but don't leave it. While you're working: stay in the shade between 12 and 3, and keep water on you."

The first half is the model talking. The second half never is. That split is the whole design. When the model is wrong now, it's wrong about what a spot looks like — recoverable — never about what you should do.

Teaching it when to worry

Sunny — the MedGemma skin tracker that inspired this — fine-tuned on Gemini's opinion of each image. That works, but it bothered me that the one medically loaded field, concern, was anchored to another model's guess. We wanted it tied to something harder.

There's also a gap in Sunny worth naming honestly: its creators noted they'd only tested it on themselves, both lighter-skinned. Most dermatology datasets share that blind spot, because dermoscopy data skews white. Our users don't. A tool that quietly works worse on darker skin isn't a neutral limitation when darker skin is most of who you're serving.

So the training set joins two sources:

  1. ISIC-2024 lesion photos, with concern mapped from biopsy ground truth — malignant means see a doctor, full stop.
  2. Google SCIN — real consumer phone photos with dermatologist labels, spanning Monk skin tones 1–7 (dermoscopy datasets skew light-skinned; our users don't).

1,406 examples, with low deliberately downsampled so the model can't learn to default to "safe" — the one mistake a screening tool must never make. A low spot whose description shows the full ABCDE high-risk combo gets bumped to watch regardless of label. Cautious by construction, not by hope.

The headline metric was never accuracy. It's malignant recall: of the spots that truly need a doctor, how few did the model wave through as ordinary? When you're the only person who'll ever look at that spot, that's the only number that means anything.

The numbers (141-image held-out test set)

metric base MedGemma Chhaya-tuned (v2)
Valid JSON 99.3% 100%
Concern accuracy 33.3% 69.5%
Malignant recall 0.94 0.83
Output tokens / answer 770 156

The fine-tune doubled accuracy and cut output to a fifth — the chain-of-thought preamble is gone, which is the 5× speed-up you feel live. One honest caveat: base's 0.94 recall looks higher, but it's hollow. Base reaches it by dumping ~60% of all cases into "watch" (hence the useless 33% accuracy). It's a hedge machine, not a safer tool. The tuned model commits to a real triage; we oversampled the "see-a-doctor" class to lift recall from 0.77 (v1) to 0.83 (v2), and the deterministic ABCDE backstop plus the always-on "see a doctor if…" card carry the residual risk.

(Training: QLoRA on a frozen vision tower, 2 epochs, ~$6 of Modal credits total across v1 + v2.)

Three things that broke, and what they taught us

The model thinks out loud, and it nearly killed the app. First live test on ZeroGPU and Chhaya fell back to demo mode. MedGemma-1.5 is a reasoning model — it emits a long Thought: … trace before the JSON, and our token budget ran out mid-thought. The fix was two-part: raise the budget, then parse the last balanced {…} block carrying a concern key rather than the first. The reasoning trace often contains a draft JSON; you want the conclusion, not the scratch work.

Cold starts time out into demo mode. On ZeroGPU the GPU only exists inside the @spaces.GPU window. The very first inference after the Space wakes from sleep had to download ~8 GB of weights inside that window — it timed out, threw, and silently degraded to a heuristic "demo reading." The fix: prewarm the model and adapter into the local disk cache at startup, on CPU, so the first real inference just loads from disk and finishes in time. Lazy loading is elegant until the lazy path is also the slow path.

Pretty isn't tasteful. The first UI was a generic clinical dashboard. Wrong audience. The rebuild — a warm sand-and-dusk palette, a hand-drawn sun-under-an-umbrella mascot, plain-language result cards, a dawn-to-dusk sun slider — isn't decoration. It's the difference between something a tired worker actually opens and something that feels like a hospital form.

What it is, and isn't

Chhaya is not a medical device and never diagnoses. It looks, it explains in plain words, and it points people toward care earlier than they'd have gone on their own. The temptation to overclaim in this space is enormous, so I'll be blunt about that line.

For the man with the rickshaw and the forearm he stopped noticing, "this is worth showing a doctor" — arriving for free, in thirty seconds, on the phone already in his pocket — is the whole point.


Try it & watch

Build artifacts

References & further reading

The problem

The guidelines (the deterministic "medicine")

Models & data

Chhaya is not a medical device and provides no diagnosis. Built for the Hugging Face Build Small Hackathon — Backyard AI track.

Community

Sign up or log in to comment