Project Motivation

This project focused on creating an accurate image classification model for the EUROSAT satellite image dataset, which contains 27k, 64x64p images of the Sentinel-2 Satellite. Within this dataset, images are organized into 10 different land cover classes.

Class distributions of EUROSAT dataset

An accurate model will be achieved with the use of **transfer learning, **which involves using models that have been pre-trained in one domain as a starting point for a related application. In this project, the VGG16 convolutional neural network is downloaded using Keras, and it’s layers are frozen from training while being exposed to the EUROSAT satellite images. The outputs of passing these images through VGG’s convolutional layers are passed into a new classifier, different from the original VGG fully-connected layers.

With transfer learning, training an accurate image classification model is made easier thanks to the adoption of an already trained model’s architecture.


Preprocessing the Image Data

The dataset of 27,000 images was split into a training and testing directory. The testing set size makes up 30% of the entire dataset, and class size proportions were mainted with the help of Scikit-Learn’s StratifiedShuffleSplit.

In order to pass images to a Keras model, the files can be opened and converted to numpy arrays for fitting and prediction. However with a dataset of 27,000 images this isn’t exactly ideal. Keras supports the loading of image data in more than one way. The ImageDataGenerator class supports the loading of image data batches, with the ability to apply real-time image augmentations. Image augmentation is a useful technique to improve a model’s ability to generalize data. It duplicates existing images and applies transformations in order to increase the variability of the dataset.

Fig 2. Creating data generators for loading batch image tensors

Training and Fine-tuning a Keras CNN

Transfer learning can involve the freezing of all, or a portion of, the existing convolutional layers obtained from the original pre-trained model. The approach taken in this project was to create a new model that utilizes the VGG16’s architecture, train this model, and fine-tune the model by unfreezing a small set of convolutional layers.

To create a new model from VGG16’s pre-trained weights, the model is downloaded using the Keras API. For every layer present in the model’s architecture, the ‘trainable’ flag is set to False to indicate that the model’s original weights should be maintained in their original state — i.e not updated according to the new data we are passing it.

#keras #python #deep-learning

Land Cover Classification Using Keras
15.05 GEEK