The problem in brief
Each RGB image shows one filled shape on a white background: a circle, a triangle (not necessarily equilateral) or a rectangle. Each shape has a random position, size, rotation and colour. You get 1 000 training images, of which only the first 200 are labelled, and must classify 300 test images. Pretrained models are forbidden, and so is labelling images by eye. This is Problem 4 of the 2026 USA AI Olympiad Round 2, Day 2. The Hugging Face copy of the data also contains 300 labelled validation images, which is what we report on, because the test labels are private.
One caveat about the data files: train_labels.csv actually contains labels for all 1 000 training images, although the statement says images 200 to 999 are unlabelled. We follow the rules: our models only ever see the first 200 labels. We used the other 800 labels for a single diagnostic, measuring how accurate our pseudo-labels were.
How you are scored
The metric is macro F1 over the 3 classes,
and the mark is relative to the best contestant: , with a baseline of 0 (no prediction). The best contestant's score is not published, so there is no fixed target. The ceiling is , and since this is a relative mark, anything below the best contestant loses points.
First look at the data
- Every image has exactly two colours: white, and the shape's colour (no anti-aliasing, no noise).
- Colour, size and position are pure nuisance variables; only the outline carries the class.
- The classes are roughly balanced (362 / 327 / 311 among the 1 000 training images, 111 / 97 / 92 in validation).
So the first thing to do is throw the colour away: a pixel is "ink" if it is not white. That leaves a binary mask, and the problem becomes classical geometry.
A first baseline
A small CNN trained from scratch on the raw RGB images of the 200 labelled examples, without augmentation, is unstable. Its validation macro F1 is 0.955, 0.778 and 0.339 for three random seeds. With 200 examples, the network can latch onto colour or position, which mean nothing here, and its training can fall apart.
The key idea
Remove what does not matter, then build in what should not matter.
- Ink mask: one binary channel. Colour is gone by construction.
- Invariance by augmentation: during training, every mask is randomly rotated (any angle), rescaled (0.8 to 1.2) and shifted. The network then sees endless variations of the same 200 shapes and has to learn the shape itself, not its pose.
- Semi-supervision by self-training: the trained network labels the 800 unlabelled images, the confident labels (probability above 0.95) are added to the training set, and the network is retrained.
There is also a model-free check, which shows why the task is easy once colour is gone. Seen from its centroid, the boundary of a shape traces a radial signature: a flat line for a circle, 3 peaks for a triangle, 4 for a rectangle. Two numbers already separate the classes:
where is the distance from the centroid to the boundary pixels. A square inscribed in a circle of radius has area , so . An equilateral triangle has , and less if it is elongated.

The full solution
- Masks:
pixel_sum < 3 * 250. - CNN: four blocks of [conv 3x3, batch norm, ReLU, max-pool] with 16, 32, 64 and 64 channels, then global average pooling and a linear layer with 3 outputs. About 60 k parameters, trained from scratch with AdamW (learning rate ) for 1 500 steps of 64 augmented masks, using the 200 labelled images.
- Self-training: 794 of the 800 unlabelled images get a confident pseudo-label; all 794 turned out correct when checked against the file's hidden labels. Retrain for 2 000 steps on 994 images and predict the test set.
- Independent check: 12 geometric features (the two above, the minimum of the radial signature, the eigenvalue ratio of the shape's covariance, and 7 Fourier coefficients of the signature) with logistic regression, also fitted on the 200 labels only.
Results
Macro F1 on the 300 labelled validation images (test labels are private).
| approach | validation macro F1 |
|---|---|
| no prediction (official baseline) | 0 |
| CNN on raw RGB, 200 labels, no augmentation (3 seeds) | 0.339 / 0.778 / 0.955 |
| CNN on ink masks, 200 labels, no augmentation | 0.986 |
| geometric features + logistic regression, 200 labels | 1.000 |
| CNN on masks + augmentation, 200 labels | 1.000 |
| CNN on masks + augmentation + self-training (final) | 1.000 |
The final CNN and the geometric model agree on all 300 test images. Two completely different methods making identical predictions is good evidence that the test predictions are correct too.
What to remember
- Strip nuisance variables at the input (colour here). The cheapest invariance is the one you build into the data representation.
- With few labels, augmentation that encodes the true symmetries (rotation, scale, translation) is worth more than any architecture choice.
- Self-training with a confidence threshold turns unlabelled data into extra labelled data, at almost no risk when the base model is already accurate.
- A tiny hand-crafted geometric model is a powerful sanity check: when two unrelated methods agree on every test sample, you can trust the predictions.
- Read the data files critically: one of them contained more labels than the rules allow you to use.