Rotation Prediction 2D: A Self-Supervised Pretext Task

Self-supervised learning trains an encoder without any human labels by inventing a pretext task the data can label itself — here, predicting which of four rotations (0°/90°/180°/270°) was applied to an image. This 2D canvas simulator renders every embedded sample as a point in a live feature-space plane and runs a real softmax-cross-entropy gradient descent against four rotation-class prototypes placed at their literal angular positions on a circle: the true-class term pulls each point home while the wrong-class terms push it away in proportion to how confidently the classifier currently mispredicts it. A temperature slider controls how hard the pretext task is, a learning-rate slider controls the optimizer step size, and live readouts track training step, accuracy, cross-entropy loss and cluster separation as the four rotation clusters emerge from an initially scrambled cloud. Drag to pan and scroll to zoom into the embedding plane.