This is similar to image translation, only this time we rotate a given image with random angles. This helps the program to learn the object at different orientations. We also scale the image and make it smaller or bigger before we pass it to our machine learning program.
These simple techniques are a way of artificially expanding the original datasets and go a long way in making the program more robust and invariant. There are other preprocessing techniques such as color averaging that could be used too.
But before diving into machine learning algorithms, let's install a new library that we will use in this chapter—scikit-learn.