Discord

Checklist Bulgaria selection 2026 IOAI Team Selection · Task 4

Hidden Digits

Bulgarian title: Скрити цифри

Cluster 8x8 handwritten-digit images, given as 64 pixel features, into 10 clusters that match the digits.

  • Vision
  • Clustering (unsupervised)
  • Bulgarian original · English translation

The task

Each object is a small image of a handwritten digit described by 64 integer pixel values (0-16) on an 8x8 grid; there are 1,797 objects. The images must be grouped into exactly 10 clusters so that images of the same digit fall into the same cluster; cluster names are arbitrary.

The baseline applies PCA to 30 components followed by k-means with 10 clusters; contestants may tune it or propose other methods. External data and pre-trained models are not allowed.

Abridged and translated by SOTA from the official Bulgarian materials. The official statement has the exact rules, and it wins wherever this summary differs.

In English

This task was published in Bulgarian. SOTA translated its 2 files into English on 17 September 2026. Only the words changed in the notebooks: markdown, code comments, messages and printed output. The code, file names and paths are the original's, so a translated notebook runs with the original data.

Read the task notebook in English 279 words and 2 code cells

Task: Hidden Digits

You are given numerical descriptions of small images of handwritten digits. Each image is represented by 64 features: the pixel values in an 8 × 8 grid. The values are integers from 0 to 16.

The goal is to group the images into 10 clusters so that images of the same digit fall into the same cluster.

Data

The file data/digits_public.csv contains:

  • id — a unique image identifier;
  • pixel_00, ..., pixel_63 — 64 numerical features.

Number of objects: 1797
Number of features: 64
Number of expected clusters: 10

Model input

Participants receive only data/digits_public.csv.

Output / submission format

You must submit a CSV file with the following two columns:

id,cluster
img_0000,0
img_0001,7
img_0002,7
...

Requirements:

  • every id from the input file must appear exactly once;
  • there must be no additional id values;
  • there must be exactly 10 distinct values in the cluster column;
  • the cluster names do not matter - for example, cluster 3 does not have to mean the digit 3.

Automatic evaluation

The official metric is the Adjusted Rand Index between the submitted clusters and the true digit labels.

The ARI score is invariant to the numbering of the clusters. This means that you do not have to guess which cluster name corresponds to which digit.

Baseline solution

The baseline solution loads the public data, applies PCA down to 30 components and clusters with K-Means with 10 clusters. The result is written to submission.csv.

Your task

You may tune the algorithms used or propose other methods in order to improve the baseline solution.

Using external data and pre-trained models IS NOT ALLOWED.

import pandas as pd
from sklearn.cluster import KMeans
from sklearn.decomposition import PCA


df = pd.read_csv("data/digits_public.csv")

feature_cols = [c for c in df.columns if c != "id"]
X = df[feature_cols].to_numpy(dtype=float)

# Dimensionality reduction with PCA
X_pca = PCA(n_components=30, random_state=42).fit_transform(X)

model = KMeans(
        n_clusters=10,
        n_init=20,
        max_iter=300,
        random_state=42,
        algorithm="lloyd",
    )
clusters = model.fit_predict(X_pca)

submission = pd.DataFrame({"id": df["id"], "cluster": clusters.astype(int)})
submission.to_csv("submission.csv", index=False)
print(f"Saved {len(submission)} predictions to submission.csv")
df.head()

Translated by SOTA. The Bulgarian original is the official version and wins wherever the two differ. The data file data/digits_public.csv is in the original folder. The original folder names the solution '04_Best_soultion' and does not name its author; apart from the copied statement, its code was already in English, and it uses the umap package. If you organise this olympiad and would like the translation removed, email [email protected] and we will take it down.

At a glance

You get
data/digits_public.csv with id and pixel_00 ... pixel_63.
You submit
CSV with columns id and cluster; every id exactly once, no extra ids, exactly 10 distinct cluster values.
Scoring
Adjusted Rand Index against the true digit labels (invariant to cluster numbering).
Rules
  • No external data or pre-trained models.
Format
Bulgarian IOAI 2026 team selection (after the National Competition); Day 2, Task 4. Dates are not published in the repository.

Details

Year
2026
Round
IOAI Team Selection · Task 4
Language
Bulgarian; English translation by SOTA
License
Not stated by the source