Training a simple classifier on extracted features
Machine learning algorithms are not properly equipped to work with tensors, which forbid them from learning directly from images. However, by using pre-trained networks as feature extractors, we close this gap, enabling us to access the power of widely popular, battle-tested algorithms such as Logistic Regression, Decision Trees, and Support Vector Machines.
In this recipe, we'll use the features we generated in the previous recipe (in HDF5 format) to train an image orientation detector to correct the degrees of rotation of a picture, to restore its original state.
Getting ready
As we mentioned in the introduction to this reipce, we'll use the features.hdf5
dataset we generated in the previous recipe, which contains encoded information about rotated images from the Stanford Cars
dataset. We assume the dataset is in the following location: ~/.keras/datasets/car_ims_rotated/features.hdf5
.
Here are some rotated...