CIFAR-10, color features, k-NN classification, and softmax temperature
CIFAR-10 is a benchmark dataset of 60,000 tiny 32×32 colour images in 10 classes, with 6,000 images per class. It is split into 50,000 training and 10,000 test images. The small image size makes it a popular sandbox for testing classification algorithms.
A simple idea: count blue vs green pixels in each image. Ships tend to have more blue (sky/water), while deer tend to have more green (grass/forest). We plot these as 2D features and classify with k-NN. Click anywhere on the plot to classify a new query point.
How does the choice of k affect classification accuracy? We generate synthetic train/test data and evaluate k-NN for odd values of k from 1 to 25. The stem plot shows accuracy at each k.
The softmax function converts a vector of raw scores (logits) into a probability distribution. The temperature τ controls the “sharpness” of the output.
Made with ❤️ by Mark Žnidar