Learning experiment
CNN Lab: learning image classification with PyTorch
A readable CNN project for MNIST, Fashion-MNIST, and CIFAR-10, with separate validation and test evaluation and inspectable training records.
CNN Lab turns image classification into a small project that can be read from end to end. Start with pixels, train a convolutional network, then inspect what its predictions and saved metrics actually say.
Choose a visual task and train a model
The project supports handwritten digits with MNIST, clothing with Fashion-MNIST, and everyday object categories with CIFAR-10. Dataset downloads and device selection reduce the setup needed for a first experiment.
A saved model can be evaluated on the official test set, a single test example, or a custom image. Custom inputs are resized and normalized, but still need to resemble the task the model was trained to recognize.
A deliberately readable network
Two convolutional blocks combine learned filters, ReLU, and max pooling. Flattening, a dense layer, dropout, and a ten-class output complete the classifier. Training uses Adam and cross-entropy loss.
The script reserves validation data from the official training split. Validation accuracy chooses the saved checkpoint, which is then evaluated on the separate test set. Each run stores its configuration, metrics, and compatible model information.
A smoke result is not a benchmark
The recorded first Fashion-MNIST check used one epoch and 2,048 training images on Apple MPS. It reached 65.32% validation accuracy and 66.31% test accuracy.
Those numbers verify a small training workflow. They are not a full-dataset benchmark or a promise for other devices and runs. The displayed top-three prediction scores are also not calibrated probabilities of correctness.
Change one part and compare
The source walks through datasets, training, and saved-model evaluation. Its included smoke-run metrics make the initial result inspectable. Longer training, different learning rates, and network edits are natural next experiments, with validation guiding comparison.
Sources and further reading
Based on the linked project documentation, reviewed on 2 November 2026. Capabilities and limitations describe that documented version.
View repository