Tutorial: UAV land cover classification with fastai

Source: Deep Learning on Medium

Colab is Google’s variant of “Jupyter notebook in the cloud”, it offers free GPU access to every user. To train the model open this prepared Google Colab notebook, click “Open in playground mode” on the top left and follow the instructions below.

1. First activate GPU access: In the top Colaboratory main menu, go to “Runtime”, “Change runtime type”, and under “Hardware accelerator” select “GPU”.

2. Select the first notebook cell and run it via the “Run Cell” button (or press Shift + Enter). This will download the Dronedeploy github repository.

3. Continue with the next cells to change the working directory to the downloaded folder and install the required libraries.

4. This step is optional: The Dronedeploy implementation uses wandb.com to track the training progress. If you you want to use it, run the cell and follow the instructions (create an account and copy your APIkey), otherwise just skip this cell and go to step 5.

wandb is a platform that visualizes and keeps track of all your experiment data in one place. It’s free for individuals. I discovered it through this Dronedeploy repo and am very impressed. wandb integrates with a few lines of code in your deep learning framework of choice and saves training progress & logs, network & system parameters, uploads the best model etc.

5. Finally, prepare the data and train the model via:

This will download the “dataset-sample” (direct download link), a subset containing images for 3 of the 51 areas of interest. The images and labels are cut to image chips of 256×256 pixels. The process then downloads a resnet18 base model and start the training process for semantic segmentation via a U-Net model. After the training is finished, the model accuracy is evaluated on a set of hold-out validation chips. The whole process will take a couple of minutes. The evaluation metrics are printed to the notebook and are discoverable in more detail in wandb. To see the predicted validation images, in Colaboratory, go to “View”, “Table of contents”. In the sidebar, under the “Files” tab go to “content/dd-ml-segmentation-benchmark/predictions”.