Answers.Body: <p>This would likely suffer from the <a href="https://ai.stackexchange.com/questions/8885/why-are-variational-autoencoders-output-is-blurred-while-gans-output-is-crisp-a">blurry image problem</a> that autoencoders are known to suffer from. See also <a href="https://www.reddit.com/r/MachineLearning/comments/9t712f/dwhy_are_images_created_by_gan_sharper_than/" rel="nofollow noreferrer">here</a>.
  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</p>
  
  <p>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.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-05T03:36:44.493Z
Answers.Text: 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.
Answers.UserDisplayName: zooby
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-05T03:14:12.557Z
Answers.LastActivityDate: 2020-02-05T03:14:12.557Z
Answers.UserDisplayName: Anon
Body: <p>Given an input image and an angle I want the output to be the image rotated at the given angle.</p>
  
  <p>So I want to train a neural network to do this from scratch.</p>
  
  <p>What sort of archetecture do you think would work for this if I want it to be lossless?</p>
  
  <p>I'm thinking of this archetecture:</p>
  
  <p>256x256 image </p>
  
  <p>--> convolutions to 64x64 image with 4 channels</p>
  
  <p>--> convolutions to 32x32 image with 16 channels and so on</p>
  
  <p>until a 1 pixel image with 256x256 channels.</p>
  
  <p>And then combine this with the input angle, and then a series of deconvolutions back up to 256x256.</p>
  
  <p>Do you think this would work? Could this be trained as a general rotation machine? Or is there a better archetecture?</p>
  
  <p>I would also like to train the same archetecture to do other transforms.</p>
  
Tags: <convolutional-neural-networks><image-generation>
Title: Best architecture to learn image rotation?
UserDisplayName: zooby
ThreadText: # Best architecture to learn image rotation?
  
  (Asked by: username_0 on 2020-02-04)
  
  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.
  
  **Tags:** convolutional-neural-networks, image-generation
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-02-05. Score: 2
  
  This would likely suffer from the [blurry image problem](https://ai.stackexchange.com/questions/8885/why-are-variational-autoencoders-output-is-blurred-while-gans-output-is-crisp-a) that autoencoders are known to suffer from. See also [here](https://www.reddit.com/r/MachineLearning/comments/9t712f/dwhy_are_images_created_by_gan_sharper_than/).
  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.
  
  > **Comments:**
  > **username_0**: 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.  
  
  ---
  
  