Portfolio project by @pkim02.
Implementation proof: see IMPLEMENTATION.md for the STN localization network, affine grid generation, differentiable sampling, baseline comparison, and visualization evidence.
An implementation of a Spatial Transformer Network that learns affine transformations to improve classification on distorted MNIST inputs.
spatial_transformer_network.ipynb: Spatial Transformer Network for Distorted MNIST
- Localization network that predicts affine transformation parameters.
- Grid generation and differentiable sampling with PyTorch.
- STN-augmented CNN and baseline CNN comparison.
- Visualization of transformed inputs and model behavior.
The notebook keeps visual outputs and accuracy comparisons showing how the STN module improves robustness to spatial distortions.
The notebooks keep most executed outputs so reviewers can inspect the results directly on GitHub. Full reproduction may require downloading the referenced public datasets or pretrained weights.
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
jupyter notebookOpen the notebook listed above and run cells in order. GPU is optional for review, but recommended for rerunning training-heavy experiments.
- Spatial Transformer Networks: https://arxiv.org/abs/1506.02025
- PyTorch affine_grid documentation: https://pytorch.org/docs/stable/generated/torch.nn.functional.affine_grid.html
- PyTorch grid_sample documentation: https://pytorch.org/docs/stable/generated/torch.nn.functional.grid_sample.html
This repository contains a cleaned portfolio version of my own implementation work. Assignment prompts, submission metadata, personal identifiers, and course-provided local figures were removed. The MIT license applies only to the code and documentation in this repository. Papers, datasets, pretrained weights, and any third-party libraries or assets keep their original licenses and terms.