inverse design

Discrimination Test Designer

Optimizes vanishing-design reflectance pairs for color-vision testing directly from spectra.

figure generated by the instrument itself. hover to let the light in.

The problem

Pseudoisochromatic plates, the Ishihara-style tests used to screen color vision, are still constructed by trial and error, a point the review literature on color-vision testing makes plainly. A vanishing design needs a color pair that a normal trichromat separates easily but the target deficiency cannot tell apart. This tool searches for that pair directly in the space of physical reflectance spectra instead of hand-tuning pigments.

The method

Both spectra are parametrized as low-order shifted Chebyshev coefficients, synthesized onto the canonical 380 to 750 nm grid and clamped to [0,1], so the results are smooth, physically valid, manufacturable reflectances. The objective maximizes Oklab separation (Delta E OK) under normal trichromacy while penalizing any separation above a confusion ceiling for the deficient observer, default 0.02, roughly one just-noticeable difference. The deficiency is modeled with the Machado 2009 CVD simulation, the same model used everywhere else in the engine. A seeded (1+1) evolution strategy with step-size adaptation runs the search, chosen over gradient methods because the objective routes through clamping and CVD simulation and because determinism matters here.

What it promises

  • Deterministic: the same seed, order, and iteration count reproduce the same stimulus pair exactly.
  • Output spectra are physically valid reflectances on the canonical 38-sample grid; low Chebyshev order keeps them smooth enough to manufacture.
  • Reports the achieved Delta E OK under normal vision, under the target deficiency, and their ratio, so you judge the stimulus on numbers rather than trust.
  • Stated limit, kept in the response itself: this is a research stimulus designer, not a validated clinical screening test. Diagnostic use requires its own trial.

Calling it

{
  "tool": "design_discrimination_test",
  "arguments": {
    "target": {
      "type": "deutan",
      "severity": 1
    },
    "illuminant": "D65",
    "max_target_delta_e_ok": 0.02,
    "order": 6,
    "iterations": 3000,
    "seed": 42
  }
}

Clone the repo, build the server (cd mcp && npm install && npm run build), then register: claude mcp add maryslab -- node <repo>/mcp/dist/server.js

Known limits

  • Research stimulus design only. It has never been validated against human observers, and diagnostic use requires its own clinical trial.
  • Confusion for the deficient observer is judged by the Machado 2009 simulation applied to displayed sRGB, not by measured human responses.
  • The optimizer is a stochastic search: it returns a good stimulus with honestly reported Delta E values, not a certified global optimum.