Home / Articles / Blog

AI Hair Analysis: The Data Behind a Hair Test Quiz Funnel (and How to Build One in 2026)
AIHair analysisQuiz funnelD2CHonoOpenRouterData privacy

AI Hair Analysis: The Data Behind a Hair Test Quiz Funnel (and How to Build One in 2026)

How a hair test quiz funnel works, why the data behind it matters more than the quiz, where AI helps and where it gets risky, and a Hono + OpenRouter sketch of a hair test API, with funnel metrics and India's DPDP consent rules.

AIShrey Vijayvargiya

In October 2023 I wrote a short post on DEV called Data Behind Solving Hairfall Mystery. It wasn't a case study. It was an idea. I had looked at how Traya sells hair treatment in India, through a free "hair test" quiz on its homepage, and asked one question: what if all the data that quiz collects were used properly?

Three years later, the idea holds up better than I expected. Quiz funnels are now a standard D2C growth channel, vision models can read a photo through a single API call, and India finally has a working data protection law. This post revisits the 2023 idea with 2026 numbers and tools. It covers what the hair test funnel actually is, why the data behind it matters more than the quiz, where AI helps and where it gets dangerous, and how you'd build a version yourself with Hono and OpenRouter.

What a hair test quiz funnel actually is

A hair test is a product recommendation quiz that doubles as a data collection system. The user answers questions and uploads a photo, and gets a result plus a treatment plan in return. The business gets a structured health profile for every person who finishes.

In my 2023 post, I listed what Traya's test asks for:

  • Basics: age, sex, height, weight
  • Lifestyle: sleep, stress, eating habits
  • Health: existing conditions, deficiencies, dandruff
  • A scalp photo

The output is a hair fall stage on Traya's own scale (I described it as 1 to 6 at the time) and a kit of shampoos, serums and supplements.

Clinicians use established scales for this. The Norwood–Hamilton scale, with seven stages, is the usual one for male pattern hair loss, and the Ludwig scale, with three grades, for female pattern hair loss. A brand's own stage scale is simpler to read, but it's a marketing tool layered on top of medical ideas, not a replacement for them.

The funnel itself is short:

text
homepage → "take the hair test" → questions → scalp photo → result + stage → kit offer → order → refills

Every arrow in that line is a place where people drop off. Every answer is a column in a dataset.

Why the data matters more than the quiz

The quiz is the visible part. The data is the asset, for three reasons.

1. Quiz funnels convert, so they're worth optimising. ConvertFlow's product quiz funnel benchmark for September 2026 looked at 2,120 live Shopify quiz campaigns. On average, 44.2% of viewers engaged with the quiz, and 5.2% of quiz viewers placed an order, with an average order value of $264. A normal product page doesn't get anywhere close to that kind of engagement. When a quiz is the front door, small improvements to completion rate turn straight into revenue.

2. The business is big, and acquisition is expensive. According to Inc42's report on Traya's FY25 results, operating revenue grew 43% to ₹338.4 crore, but the company swung to a ₹22.5 crore loss. Sales and marketing alone was ₹137.6 crore, about 38% of total expenses. The founders say they have served over 8 lakh customers, about 70% of them outside metro cities. When marketing is the biggest cost line, the cheapest growth comes from keeping the customers you've already paid to acquire. Retention is a data problem.

3. Repeat data is where the value compounds. A single quiz gives you a snapshot. A customer who uploads a new photo every few weeks gives you a trajectory. That was the core of my 2023 idea: plot each person's hair fall over time and show them where they're heading. A trajectory is what turns "I bought a kit once" into "I can see it working, so I'll reorder."

The three ideas from 2023, revisited

Idea 1: In-between stages

In 2023 I suggested showing half-stages (between stage 1 and 2, say) instead of only whole numbers. My reasoning was that someone told they're at "stage 1" may decide they don't need treatment yet. A finer scale shows progress sooner and is more honest about where someone actually is.

In 2026 I'd frame it differently. Don't invent precision. A model that outputs "stage 2.3" sounds scientific but probably isn't. The better version is a range with confidence: "between stage 2 and 3, moderate confidence. Re-check in 6 weeks." That's still finer than whole stages, and it doesn't pretend to know more than it does.

Idea 2: Hair fall trajectory

I suggested projecting each user's hair fall about three months ahead from a series of photos. The idea is strong. The hard part is the photos.

Two photos taken in different light, at different angles, with hair washed or not, look like different scalps. Before any model can compare them, the capture has to be consistent:

  • Guided capture: an on-screen outline for head position, and a check that rejects blurry or dark photos before upload.
  • Same zones every time: crown, hairline and parting, each as its own photo.
  • A fixed schedule: every 4 to 6 weeks, with a reminder.

Get capture right and the trajectory is mostly simple maths over consistent observations. Get it wrong and no model will save you.

Idea 3: Pricing from data

I argued that "more sales, less price" is a myth, and that price should follow demand, product cost, distribution and tax. That still stands. Data adds one more lever: segment-specific kits. If the data shows a large group with mild hair fall and high stress, a smaller, cheaper starter kit for that group may beat a discount on the full kit.

Where AI helps, and where it gets dangerous

AI is good at structured observation. Modern vision models can look at a scalp photo and describe what they see: visible scalp area, hairline shape, density in the crown, whether the photo is usable at all.

AI is bad at being trusted with a diagnosis. Be suspicious of accuracy claims in this area. For example, a 2024 arXiv paper on hair and scalp disease detection reports 99% accuracy. It doesn't state its dataset size, its comparison tables contradict each other, and it shows only four sample predictions. That's typical of the field: impressive numbers, thin evaluation.

So the design rule I'd follow is:

  • The model observes, the rules score, a human decides. The vision model returns observations in a fixed schema. Plain code maps observations plus quiz answers to a stage range. A doctor or trained reviewer signs off anything that leads to medication.
  • Never let the model prescribe. Product recommendations come from a rule table your medical team owns, not from free text the model wrote.
  • Show uncertainty. If the photo is poor or signals conflict, say so and ask for a retake.

This is the same idea as the agent harness post: the model is one component, and the code around it decides what it's allowed to do.

The data model

My 2023 post sketched two objects, one for the input and one for the output. Here's the same idea written as TypeScript types, with the fields a real system needs: consent, photo quality and a history of check-ins.

ts
type QuizAnswers = {
  age: number;
  sex: "male" | "female" | "other";
  heightCm: number;
  weightKg: number;
  sleepHours: number;
  stress: 1 | 2 | 3 | 4 | 5;
  dandruff: boolean;
  dietNotes?: string;
};

type ScalpObservation = {
  zone: "crown" | "hairline" | "parting";
  usable: boolean;              // false = blurry, dark, wrong angle
  visibleScalp: "none" | "low" | "moderate" | "high";
  notes: string;                // short, factual, no diagnosis
};

type CheckIn = {
  at: string;                   // ISO date
  answers: QuizAnswers;
  observations: ScalpObservation[];
  stageRange: [number, number]; // e.g. [2, 3]
  confidence: "low" | "medium" | "high";
  reviewedBy?: string;          // set when a human signs off
};

type Customer = {
  id: string;
  consent: { givenAt: string; purposes: string[]; withdrawnAt?: string };
  checkIns: CheckIn[];          // the trajectory lives here
};

The checkIns array is the trajectory. The consent object isn't optional. More on that below.

Build a hair test API with Hono and OpenRouter

Here's a minimal backend for the funnel. It has one endpoint that takes quiz answers plus a photo URL, asks a vision model for observations only, and scores the result with plain code. I use Hono and OpenRouter for the same reasons as in my other builds: small, fast, and one API key for many models.

bash
npm i hono @hono/node-server
export OPENROUTER_API_KEY=sk-or-...
ts
import { Hono } from "hono";
import { serve } from "@hono/node-server";

const app = new Hono();
const VISION_MODEL = process.env.VISION_MODEL ?? "google/gemini-2.5-flash";

// 1. The model only describes what it sees, in a fixed JSON shape.
async function observe(photoUrl: string, zone: "crown" | "hairline" | "parting") {
  const res = await fetch("https://openrouter.ai/api/v1/chat/completions", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.OPENROUTER_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      model: VISION_MODEL,
      response_format: { type: "json_object" },
      messages: [
        {
          role: "system",
          content:
            "You describe scalp photos for a hair care app. Do not diagnose or recommend treatment. " +
            'Return JSON: {"usable":boolean,"visibleScalp":"none|low|moderate|high","notes":"max 20 words"}. ' +
            "Set usable=false if the photo is blurry, dark, or not a scalp.",
        },
        {
          role: "user",
          content: [
            { type: "text", text: `Zone: ${zone}` },
            { type: "image_url", image_url: { url: photoUrl } },
          ],
        },
      ],
    }),
  });
  if (!res.ok) throw new Error(`OpenRouter ${res.status}`);
  const text = (await res.json()).choices[0].message.content;
  return { zone, ...JSON.parse(text) };
}

// 2. Plain code turns observations + answers into a stage range. Your medical team owns this table.
const SCALP_SCORE = { none: 0, low: 1, moderate: 2, high: 3 } as const;

function score(obs: { usable: boolean; visibleScalp: keyof typeof SCALP_SCORE }[], stress: number) {
  const usable = obs.filter((o) => o.usable);
  if (usable.length === 0) return { stageRange: null, confidence: "low", retake: true };
  const avg = usable.reduce((s, o) => s + SCALP_SCORE[o.visibleScalp], 0) / usable.length;
  const base = Math.round(avg * 2); // 0..6, the brand's own scale
  const stageRange: [number, number] = [Math.max(1, base), Math.min(6, base + 1)];
  const confidence = usable.length === obs.length && stress <= 3 ? "medium" : "low";
  return { stageRange, confidence, retake: usable.length < obs.length };
}

// 3. One endpoint for the funnel.
app.post("/hair-test", async (c) => {
  const { consent, answers, photos } = await c.req.json<{
    consent: boolean;
    answers: { stress: number };
    photos: { zone: "crown" | "hairline" | "parting"; url: string }[];
  }>();
  if (!consent) return c.json({ error: "Consent is required before we can analyse photos." }, 400);

  const observations = await Promise.all(photos.map((p) => observe(p.url, p.zone)));
  const result = score(observations, answers.stress);

  return c.json({
    observations,
    ...result,
    nextStep: result.retake ? "Retake the unclear photos" : "A specialist will review your result",
  });
});

serve({ fetch: app.fetch, port: 8787 });

What this does and doesn't do:

  • The model never sees the quiz answers. It only describes the photo. That keeps its job narrow and its output auditable.
  • Scoring is deterministic. The same observations always give the same stage range, so you can test it, explain it, and change it under medical review.
  • Low-quality photos trigger a retake, not a guess.
  • Products aren't in this code. Map stageRange plus quiz answers to a kit with a rule table, and route anything involving medication through a human.

This is a sketch, not a medical device. Before real users see it, you need a clinician, a proper evaluation set, and legal advice on whether your result counts as a diagnosis where you operate.

The funnel metrics that matter

Once data flows in, track the funnel step by step, not just the final sale:

StepMetricWhat it tells you
Homepage → quizQuiz start rateIs the hook working?
Quiz → photoPhoto step drop-offThe photo step is usually the biggest drop. Is the ask clear and the privacy promise believable?
Photo → resultRetake rateIs your capture guidance good enough?
Result → orderOrder rateDoes the result feel personal and credible?
Order → refill60/90-day repeat rateIs the trajectory convincing people it's working?
Check-in cadence% of customers with 2+ check-insIs the trajectory feature actually used?

Read these as cohorts: everyone who took the test in a given week, followed over time. Averages across all time hide whether things are getting better.

If you're building content or dashboards around a funnel like this, the AI agent system that researches 100 blogs a day uses the same collect, clean, summarise pattern on a different kind of data.

A hair test collects health information and photos of people's bodies. In India, that now sits under the Digital Personal Data Protection Act, 2023. According to Hogan Lovells' summary, the DPDP Rules were notified on 13 November 2025, with obligations phased in:

  • From 13 November 2026: the notice, consent, security safeguard, breach intimation and retention rules apply.
  • By 13 May 2027: data principal rights, grievance redressal and the remaining obligations follow.

What that means for a quiz funnel, in practice:

  • Consent must be specific and separate. No consent hidden in the Terms. Say exactly what you collect and why, before the photo step.
  • No bundling. "Analyse my photo" and "send me marketing" are separate permissions.
  • Withdrawal must be as easy as consent, and withdrawn data must be deleted unless the law requires you to keep it.
  • Children need verifiable parental consent. If minors can take your quiz, you need an age gate and a parental consent flow.

I'm not a lawyer. Treat this as the checklist you take to one. The post on AI agent auditing and compliance covers logging and audit trails, which you'll want for every model call in a system like this.

What I'd do differently from my 2023 post

Re-reading my old post, three things stand out:

  • I was too excited about the model and too quiet about capture. The photo pipeline matters more than the classifier.
  • I talked about accuracy without talking about evaluation. "Use AI image recognition" is the easy sentence. Building a labelled test set reviewed by dermatologists is the actual work.
  • I didn't mention consent at all. In 2026 that would be the first section, not the last.

The core idea still holds, though. The quiz is a data product, and the trajectory is what makes customers stay. Most D2C brands treat the quiz as a lead form. The ones that treat it as the start of a long-running dataset, collected with care and consent, are the ones that compound.

More builder breakdowns like this go out in the monthly ihatereading magazine, and the full archive is on the blog.

This post is about product and data design. It isn't medical advice. If you're worried about hair loss, see a dermatologist.

External Links (6)

Explore topics

More in

Weekly letter

Subscribe to iHateReading

Our once-a-week newsletter on programming, jobs, AI, and building products online.

Our once a week newsletter on Programming, Jobs, AI, and Business