Amar Merabti · notebook FR
← Back to the notebook

Exp. 07 · 2026 · personal project

What is one label worth?

When a human can only annotate two hundred of them, which ones should they get?

99 %
of the final accuracy reached with 16% of the labels
+7,0
points gained over random sampling from 20 labels on (p = 0.002)
−11,2
points lost by entropy against random at 50 labels (p = 0.0002)
20
independent draws per strategy, paired comparisons
01 · The protocol

Measuring what an annotation really costs

Labelling is expensive: that was the everyday reality of my internship at Nricher, where an account manager reviews a sample of a thousand products in one to two days. The question here is the same one, isolated and measured: at a fixed annotation budget, which selection strategy makes the model improve fastest?

The protocol is deliberately strict. We start from ten randomly labelled examples, add batches of ten chosen by the strategy under test, retrain, and measure accuracy on a test set that is never touched. Every curve is the average of twenty independent draws — train/test split and seed set included — and every comparison is paired: the same seed gives random sampling and the tested strategy exactly the same starting point, which makes a Wilcoxon test meaningful.

Five strategies: random sampling; margin (the gap between the two most likely classes — the smaller it is, the more ambiguous the example); entropy of the predicted distribution; diversity (k-centres: the example farthest from everything already labelled); and margin then diversity, which shortlists ambiguous examples before picking ones far apart from each other.

Fig. 1 — Your turn to annotate: the strategy picks the image, you give the digit (the keyboard works too), and the model is retrained in your browser after every label. Your curve is compared with the averages measured in Python. Mislabel something and the model suffers — as it would in real life.
02 · The results

Two hundred labels are almost enough

With 200 labels out of 1,257, that is 16% of the training set, the “margin then diversity” strategy reaches 0.960 accuracy, while training on all the labels tops out at 0.967. Random sampling stays at 0.926 on the same budget: that is thirty-four percentage points of error removed, for the same human work.

Accuracy curves of the five strategies against the number of labels
Fig. 2 — Average of twenty draws, standard deviation as a band. The dashed line is the accuracy obtained with all 1,257 available labels.
Accuracy by label budget2050100200
margin + diversity0,6410,8710,9270,960
margin0,5730,8550,9190,958
diversity0,5920,8340,9070,942
random0,5710,7990,8870,926
entropy0,4990,6870,8660,936

The gaps are significant at every budget for “margin then diversity” (p = 0.002 at twenty labels, p < 0.001 after that), and the conclusion survives a change of classifier: with a random forest, margin reaches 0.971 against 0.924 for random sampling at two hundred labels.

03 · What did not work

Entropy, and problems that are too easy

Entropy does worse than random sampling at the start. At twenty labels it falls to 0.499 against 0.571 (p = 0.012); at fifty, 0.687 against 0.799 (p = 0.0002). The reason lies in the task: with ten classes and a barely trained model, the predicted distribution is flat almost everywhere, and entropy then selects the most confusing examples — often the most atypical ones, those you learn the least from. Margin, which only looks at the two best classes, aims far better.

A second limit, even more useful to know: on an easy problem, every strategy is equivalent. On the binary breast cancer diagnosis dataset, at one hundred and twenty labels, “margin then diversity” gives 0.974 and random sampling 0.967, while full training reaches 0.975. In other words, active learning only pays off when the task is hard or the classes are many. That is exactly the question to ask before offering it to a client.

04 · In the browser

Is the model you are training the right one?

The sandbox calls no server: the multinomial logistic regression is rewritten in JavaScript, trained by gradient descent after each label, and evaluated on three hundred held-out images. It remained to check that it matches the reference implementation.

Over five games played automatically with the true labels, the browser model reaches 86.2% ± 1.3 at fifty labels and 89.1% ± 1.4 at seventy, against 85.5% ± 2.0 and 88.9% ± 1.7 for scikit-learn under the same conditions: less than one point apart from forty labels on. Below that, the browser model is even slightly better — its regularisation and limited number of iterations protect it when examples can be counted on one hand.