SpatialTransformer
A CNN with a spatial transformer module that learns to warp its input with a predicted transformation.
Image classification · 26 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
At a glance
- Task
- Image classification
- Parameters
- 27.4K
- Operations
- 26
- Framework
- PyTorch
- Recurrent
- No
- Published
- NeurIPS 2015
- Cited by
- 5,137 (as of 23 October 2026)
- Authors
- Max Jaderberg, Karen Simonyan, Andrew Zisserman, Koray Kavukcuoglu
- Source
- GitHub: pytorch/tutorials
- License
- BSD-3-Clause
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m2875
- Graph hash
- 9728edf0c1e6f8729d9a03a85f3ac8f87706809b2649e3ce6c3550f1f541c54c
- Skeleton hash
- ceef75c54ee754ac168f927cc9c578c9b6a1a4987191c4b0ae3cf9f50a4a3188
- Architecture hash
- 9536f5716c5487c7c8f3d69a9365d0f383f66bd3bde94e299c3772606c3cbeed
- Diagram SHA-256
- 38bf014a70a4cab931b759525cf6b68632e632a29453def7109607738de861e5
- TorchLens version
- 2.36.0
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
What it is
The Spatial Transformer is a learnable module that explicitly allows the spatial manipulation of data within a network. The paper starts from a limit of convolutional networks: max-pooling gives some invariance to the position of features, but that invariance is only realized over a deep hierarchy of max-pooling and convolutions. A spatial transformer instead actively transforms an image or a feature map, producing an appropriate transformation for each input sample.
The mechanism is split into three parts. A localization network takes the input feature map and outputs the parameters of the spatial transformation to apply. For an affine transformation that is a 6-dimensional vector. A grid generator uses the predicted parameters to create a sampling grid, the set of points where the input map should be sampled. A sampler then produces the output map, sampled from the input at the grid points. The module can be trained with standard back-propagation, so the models it is placed in train end to end. Dropped into a CNN at any point, and in any number, it gives what the paper calls spatial transformer networks.
On 60 × 60 images of translated MNIST digits with background clutter, the paper reports 13.2% error for a fully-connected network and 3.5% for a CNN, against 2.0% and 1.7% for the same two with a spatial transformer added.
Key idea. The paper introduces the Spatial Transformer, a differentiable module that can be inserted into convolutional architectures to spatially transform feature maps, conditional on the feature map itself.
- Spatial Transformer Network
- STN
- spatial transformer
- SpatialTransformer
- localization network
- grid generator
- differentiable image sampling
- affine transformation
- spatial invariance
- spatial attention
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{jaderberg2016spatialtransformernetworks,
title={Spatial Transformer Networks},
author={Max Jaderberg and Karen Simonyan and Andrew Zisserman and Koray Kavukcuoglu},
year={2016},
eprint={1506.02025},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/1506.02025},
}