Given an input image and an angle I want the output to be the image rotated at the given angle.

So I want to train a neural network to do this from scratch.

What sort of archetecture do you think would work for this if I want it to be lossless?

I'm thinking of this archetecture:

256x256 image

--> convolutions to 64x64 image with 4 channels

--> convolutions to 32x32 image with 16 channels and so on

until a 1 pixel image with 256x256 channels.

And then combine this with the input angle, and then a series of deconvolutions back up to 256x256.

Do you think this would work? Could this be trained as a general rotation machine? Or is there a better archetecture?

I would also like to train the same archetecture to do other transforms.


1 Answer 1


This would likely suffer from the blurry image problem that autoencoders are known to suffer from. See also here. On the other hand, using GAN's to sharpen your images doesn't seem particularly helpful since you seem to be lookng for a way to rotate general images, not ones of a specific domain. Moreover, there's almost certainly going to be some loss

It seems unreasonable/overkill to use neural networks to do this transformation. I suggest treating the rotation as a linear transformation, mapping certain pixel locations to other pixel locations (in fact, you can make this transformation differentiable with respect to its inputs using some deep learning library's autodifferentiation tools, if that's what you're looking for). Since rotations are just linear maps that send pixels to other pixels, this will be much more computationally efficient.

  • $\begingroup$ True, there's better ways of doing this than neural networks. It's more of a challenge to see if I could implement such a thing using neural networks. e.g. how perhaps a brain might rotate an image in it's mind. $\endgroup$
    – zooby
    Commented Feb 5, 2020 at 3:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .