In addition, the development of an attention mechanism can be applied in image processing to focus on
the region of interest (ROI). Spatial transformer networks (STN) can locate the region of interest and transform it into an ideal image by affine transformation, and then put it into the neural network for training [1]}.
STN consists of Localisation net, Grid generator and Sampler. The Localisation net can be applied for calculation of affine transformation parameters. The Grid generator can find the mapping between output and input features,
and the corresponding relation of pixel coordinates is obtained. The Sampler can select input features
based on the position mapping and transformation parameters, and output the image with bilinear interpolation.
The architecture of STN is shown in Fig. REF .
<FIGURE>