How to benefit Data augmentation when it yields to different classes I'm trying to classify rooftop sky images orientations, whether it is horizontal or vertical. Knowing that the most obvious feature here is known: orientation. I can simply augment each class by rotating it 90° so it belongs to the other class. It is like dynamic augmentation to different classes.

Using keras image classification capabilities, obviously defeats the purpose:

datagen = ImageDataGenerator(
        zoom_range=0.2, # randomly zoom into images
#       rotation_range=90,  # mistaken the model
        horizontal_flip=True,  # randomly flip images
        vertical_flip=False)  # randomly flip images


I am using keras for classification but open to other libraries, and techniques other than deep learning.
You could rotate images manually (without using ImageDataGenerator) and save it to disk.
That way you would know which images you have rotated - so you would know which images have changed the class.

After it, when using ImageDataGenerator, you need to set rotation_range to small value in order to be sure that it won't change the classes of images.

Examples how to rotate image manually can be found here: https://stackoverflow.com/a/43864937/5997950