Convolutional neural network developed for the Planet: Understanding the Amazon from Space Kaggle Competition
This project is an implementation of a convolutional neural network that classifies satellite imagery of the Amazon Rainforest into 17 categories. Both Keras and Tensorflow versions of the convnet are implemented. Learns to classify images with >90% accuracy.
Python 2.7.1 or above is required, preferably the Anaconda Distribution
Make sure to have the following dependencies installed:
- NumPy (included in Anaconda)
- Pandas (included in Anaconda)
- CV2
- TQDM
- Keras
- Tensorflow
All of these modules can be installed via pip.
For the network to run, training and test data and the correct training labels will be needed. All can be downloaded from the competition website. Look for the files train_v2.csv.zip
, train-jpg.tar.7z
and test-jpg.tar.7z
.
- Extract the train and test datasets to any directory. Ensure the two extracted folders are named
train-jpg
andtest-jpg
respectively.
- In line 12 of
Preprocessing_Keras.py
AND line 18 ofPlanet_Keras.py
, assign the relative path to the train data directory (i.e. the parent directory oftrain-jpg
) topre_filepath
. - Run
Preprocessing_Keras.py
. You should get numpy arrays of saved data in thepre_filepath
directory. - Run
Planet_Keras.py
.
- In line 14 of
Planet_TF.py
, assign the relative path to the train and test dataset to the variablespre_filepath_train
andpre_filepath_test
- Extract the CSV file and place it in the same directory as
Planet_TF.py
. Ensure the CSV file is namedtrain_v2.csv
. - Run the network. Note that it may take a while to train especially on CPU only.
Note: After training, the EPOCHS
constant may need to be adjusted, depending on how many epochs the network takes to converge.