Spatial Transformer Networks (STN) have been there since 2015 but I haven’t found an easy-to-follow example of it for #Keras.
On the other hand, Kevin Zakka’s implementation of STN 28 is by far one of the cleanest ones but it’s purely in TensorFlow 1. So, I decided to take the utility functions from his implementation and prepare an end-to-end example in #Keras out of it. You can find it here:

  
      
      github.com
  
  
    

sayakpaul/Spatial-Transformer-Networks-with-Keras 56


  This repository provides a Colab Notebook that shows how to use Spatial Transformer Networks inside CNNs build in Keras.

  
  
    
    
  
  


Comes with a Colab Notebook and also a TensorBoard callback that helps visualize the progressions of the transformations learned by STN during training.
Notice how the STN module is able to figure out transformations for the dataset that may be helpful to boost its performance -
          
            
              
              https://user-images.githubusercontent.com/22957388/115120399-e8084b80-9fca-11eb-97e1-c72228c3edc4.mov