Skip to article
Görkem Yıldız, home
Available for October

64,000 Human Observations: How Helmlab Was Trained

Six datasets, STRESS metric, Hessian-based optimization, and Bootstrap CI — how Helmlab was trained on 64K human observations.

· 8 min readEnglishTürkçe oku

Claiming that a color space is "close to human perception" is easy. The hard part is proving it measurably. Helmlab's 72 parameters were not chosen arbitrarily -- they were determined through a systematic optimization process on the most comprehensive experimental data that color science has accumulated over half a century.

In this post, we explain Helmlab's entire training process: which data was used, how the STRESS metric is calculated, how optimization was performed, how overfitting was prevented, and how the results' statistical reliability was validated. This is the final post in the Helmlab blog series -- the conclusion of 16 posts.

6 Datasets: The Experimental Foundation of Color Science

The data used to train Helmlab comes from human color perception experiments collected over decades by different research groups around the world. The primary sources:

1. COMBVD (3,813 Color Pairs)

COMBVD (Combined Visual Data) is a unified collection of 6 major color difference experiments. Each experiment presented pairs of colors to human subjects and asked "how different are these two colors?" in a controlled laboratory setting. The total of 3,813 color pairs serves as the primary data source for STRESS computation.

2. He Ellipses (82 Ellipses)

82 color difference ellipses measured by He and colleagues. These ellipses show how the "just noticeable difference" (JND) around a reference color varies with direction. The long axis of the ellipse indicates the direction of low sensitivity, while the short axis indicates high sensitivity.

3. MacAdam Ellipses (128 Ellipses)

Classic experiments published by David MacAdam in 1942. Difference thresholds measured around 128 reference colors. These data were used as reference even in the design of CIE Lab itself. They remain among color science's oldest and most reliable experimental data.

4. Munsell (3,590 Color Samples)

The Munsell Color System has provided perceptually equidistant color samples since 1905. The dataset of 3,590 samples serves as a "uniformity check" for the color space: equal steps in Helmlab coordinates should produce equal steps in Munsell samples.

Total Coverage

Training Data: 6 Datasets, 64,000+ Observations Dataset Size Measurement Type COMBVD 3,813 color pairs Pair-based color difference He ellipses 82 ellipses JND threshold ellipses MacAdam ellipses 128 ellipses Classic difference thresholds Munsell 3,590 samples Perceptual uniformity Total 64,000+ individual observations 6 sub-datasets All data split with seed=42: 80% training / 20% validation

These data were collected in different countries, under different laboratory conditions, using different experimental protocols. This diversity ensures that Helmlab adapts to the general structure of human vision, not to any single experiment.

The STRESS Metric: How It Is Calculated

STRESS (Standardized Residual Sum of Squares) is the standard metric for measuring how well color difference predictions align with human perception. The formula:

Code
STRESS = sqrt( sum((f(dV_i) - dE_i)^2) / sum(dE_i^2) ) * 100

Where:

  • dV_i: the perceptual difference value from human subjects for color pair i
  • dE_i: the computed distance in the color space for the same pair
  • f(): the best-fit linear scaling (regression)

Interpreting STRESS: 0 = perfect prediction (every distance matches human perception exactly), 100 = completely unrelated. In practice:

  • CIE Lab: ~30.3 (simple cube root + Euclidean distance)
  • CIEDE2000: 29.2 (5 correction terms)
  • Oklab: ~27.5 (optimized 18 parameters)
  • Helmlab: 23.2 (72 parameters, 13-stage pipeline)

A STRESS value around ~20 is considered the theoretical lower bound due to measurement noise and inter-observer variability. Helmlab's 23.2 is quite close to this limit.

Optimization: Hessian-Based Restarts

Optimizing 72 parameters means finding the lowest point on a multi-dimensional surface. This surface is complex -- there are many local minima. Helmlab's optimization strategy involves the following steps:

1. Hessian-Based Optimization

Gradient descent uses only slopes. Hessian-based methods (like L-BFGS-B) also use curvature information, converging much faster. Helmlab uses a second-order optimizer with full Hessian approximation for each optimization run.

2. 8x5000 Restarts

To avoid getting stuck in local minima, optimization is launched from 8 different random starting points, each running for 5,000 iterations. The best result out of a total of 40,000 iterations is selected. This approach largely eliminates cases where a single run gets trapped in a local minimum.

3. Phase Structure

The optimization ran in two phases:

  • Phase A: 8x5000 iterations, optimizing only COMBVD STRESS + achromatic penalty (grays should have a=b=0)
  • Phase B: Hue lambda sweep (lambda_hue = 0, 5, 10, 20). Starting from Phase A's best result, hue alignment was attempted. Result: hue lambda provided no additional benefit -- the Phase A basin had already fully converged.
Optimization Process Iteration STRESS 35 30 25 22 23.2 CIE Lab (~30.3) CIEDE2000 (29.2) 7 restarts (local minima) Best restart (global minimum)

Analytical Form: Natural Regularization

In machine learning, overfitting is the primary danger: the model "memorizes" training data but fails on new data. Helmlab has two lines of defense against this:

1. The Structure of the Analytical Form

Helmlab's 13-stage pipeline is not an arbitrary function but a physically motivated analytical form. Each stage (cube root compression, opponent channels, Helmholtz-Kohlrausch effect) models a known visual system mechanism. This structural constraint limits the model's capacity to learn "meaningless" patterns -- while a neural network with millions of parameters can memorize anything, a 72-parameter analytical form can only capture physically meaningful patterns.

2. Validation Gap: +1.11

The dataset was split with seed=42 into 80% training / 20% validation. Results:

  • Training STRESS: 23.22
  • Validation STRESS: 24.33
  • Validation gap: +1.11

A gap of +1.11 points is very small by color science standards. For comparison: a neural network (3D INN) trained on the same data achieved training STRESS 20.98, validation STRESS 25.70 -- a gap of 4.72 points. The analytical form produces 1/4 the gap of the neural network. This demonstrates that overfitting is nearly zero.

Bootstrap Confidence Intervals

A single STRESS value does not answer the question: "would the result be similar on a different subset of the data?" Bootstrap CI (confidence interval) answers this: by resampling from the dataset (with replacement), we compute the distribution of STRESS values.

Bootstrap 95% Confidence Intervals 10,000 bootstrap samples on the COMBVD dataset 20 22 24 26 28 STRESS Helmlab 22.50 23.2 23.93 CIEDE2000 27.64 29.2 30.84 3.71-point gap

From 10,000 bootstrap samples:

  • Helmlab 95% CI: [22.50, 23.93]
  • CIEDE2000 95% CI: [27.64, 30.84]
  • A 3.71-point gap between the intervals -- the distributions do not overlap in any way

This represents statistical significance at the p < 0.001 level. Helmlab's superiority cannot be explained by random variation; it is structural.

The Two-Basin Discovery: SL/SC

One of the most interesting discoveries during the optimization process was the existence of two distinct basins in parameter space.

Basin 1: Classic (v12-like)

COMBVD STRESS = 23.18, SL/SC weights at zero. The distance formula is simple Minkowski distance. Munsell CV = 19% (good uniformity).

Basin 2: SL/SC (v14c-like)

COMBVD STRESS = 22.75 (the lowest STRESS achieved), SL and SC weights active (sl=0.18, sc=0.80). However, Munsell CV = 77% (poor uniformity).

The critical finding: there is no smooth Pareto frontier between these two basins. The optimizer stays in one or the other -- it cannot transition between them. This demonstrates that the SL/SC parameters do not merely improve metrics but represent a fundamentally different solution family.

  • Starting from the v12 basin and enabling SL/SC: the optimizer cannot find SL/SC > 0, the basin is too deep
  • Starting from the v14c basin and adding a CV penalty: even lambda=2.0 cannot escape the basin
  • In v17, hue lambda sweeps: yet another basin was discovered (strict vs relaxed)

This multi-basin structure illustrates why color space optimization is a hard problem and why restarts are critical.

The Final Model: v19 NC (Production Version)

After all these experiments and discoveries, v19 was selected as the production version. Key characteristics of v19:

  • COMBVD STRESS: 23.22 (Basin 1 based)
  • Achromatic chroma: 0.000001 (structurally guaranteed via NC)
  • Hue RMS: 16.1 degrees (via rigid rotation)
  • Validation gap: +1.11 (minimal overfitting)
  • Munsell CV: 17.6% (good uniformity)
  • 72 parameters: 13-stage pipeline + SL/SC distance formula

While v14c's 22.75 STRESS is lower, its 77% Munsell CV was unacceptable for production. v19 represents the most balanced point in the STRESS-uniformity-achromatic quality triangle.

Code Example: Using the Trained Model

Terminal
npm install helmlab
Code
import { Helmlab } from 'helmlab';

const hl = new Helmlab();

// 72 parameters, 64,000+ observations, 8x5000 restarts --
// the entire training process distilled into this single line:
const d = hl.deltaE('#e74c3c', '#3498db');
console.log(`Delta E: ${d.toFixed(4)}`);
// This value correlates 20.5% better with 64,000+ human observations
// from 6 datasets (vs CIEDE2000)

// Color information: 13-stage pipeline
const info = hl.info('#e74c3c');
console.log(`L: ${info.L.toFixed(3)}`);  // Perceptual lightness
console.log(`C: ${info.C.toFixed(3)}`);  // Perceptual chroma
console.log(`H: ${info.H.toFixed(1)}`);  // Hue angle

// Palette generation: perceptually equal steps
const scale = hl.semanticScale('#3B82F6');
// Every step is computed through the pipeline
// trained on 64,000+ observations

// Semantic scale
const description = hl.semanticScale('#e74c3c');
console.log(description);
// Tailwind CSS-style 50-950 scale

Conclusion: Perception Learned from Data

Helmlab is a color space that unifies half a century of color science experiments into a single coherent model. Over 64,000 human observations from 6 datasets shaped its 72 parameters. Hessian-based optimization with 8x5000 restarts escaped local minima, the analytical form prevented overfitting, and bootstrap CI confirmed the statistical reliability of the results.

The result: STRESS 23.2 -- 23.4% better than CIE Lab, 20.5% better than CIEDE2000. Bootstrap confidence intervals do not overlap. The validation gap is only +1.11. And all this accuracy is accessible in a 10.3 KB npm package.

Terminal
npm install helmlab

Source code: GitHub | Package: npm

This is the final post in the 16-part Helmlab blog series. Throughout the series, we covered everything from the fundamentals of color science to practical applications. Thank you for reading.

Görkem Yıldız

Helmlab, a family of perceptual color spaces for UI design systems (arXiv:2602.23010)

I'm Görkem, a UI/UX designer and engineer based in Ankara, leading the design team at [PushBrands](https://pushbrands.app/en), a Saudi UGC marketplace. I've spent over eight years designing and building digital products, and lately the systems underneath them: Helmlab, a color space trained on 64,000 human color judgments that now ships in Color.js; open-source tools for icons, sound and the terminal; and, as Orbit Design, Figma plugins with more than 100,000 users.

Book a call

Talk about color, design systems or Helmlab.

Saturdays 19:00–21:00 Istanbul time, on Google Meet.

Book a call