Skip to content

CS-433/ml-project-2-monkeylearning

Repository files navigation

Review Assignment Due Date

Road Segmentation on Satellite Images

This project aims to classify roads on satellite images from Google Maps in suburban areas of the USA. We use a U-Net model to perform road segmentation, assigning each pixel a label: road=1 or background=0.

The dataset is sourced from the AIcrowd EPFL ML Road Segmentation challenge.

The results obtained on the test set can be visualized here


Project Overview

The key steps in the project include:

  1. Data Augmentation: Expanding the training set with rotated and cropped patches of size 256x256, followed by color adjustments.
  2. Model Training: Training a U-Net model with the augmented dataset.
  3. Prediction: Generating prediction masks for test images.
  4. Visualization: Overlaying test images with predicted road masks for evaluation.
  5. Submission: Generating a CSV file from prediction masks for submission.

Project Usage

Clone the Repository

git clone https://github.com/CS-433/ml-project-2-monkeylearning.git
cd ml-project-2-monkeylearning

Create a Python Environment

Set up a virtual environment and install the required dependencies:

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Run the Best Model

Execute the run.py script to perform the full pipeline of the best model:

python3 run.py
usage: python3 run.py [--prediction | -p] [--custom_prediction | -cp] [--show_train_graph | -stg] [--help]

Performs data augmentation, training and prediction

options:
  -h, --help            show this help message and exit
  --prediction, -p      prediction only
  --custom_prediction, -cp
                        prediction only (use the custom test set)
  --show_train_graph, -stg
                        displays the train history graph after training

Code Structure

  • data/
    Contains the training set, test set, augmented images, and prediction masks.

  • saved_models/
    Directory for storing the trained U-Net model (unet.keras).

  • requirements.txt
    Defines all of the requirements to run the code.

  • config.py
    Defines all of the constants used.

  • data_augmentation.py
    Expands the training dataset with rotations, cropping, and color adjustments.

  • model.py
    Defines a 5-layer U-Net model and outputs unet.keras.

  • training.py
    Trains the U-Net model using augmented data.

  • prediction.py
    Creates prediction masks for the test set.

  • viewer.py
    Displays test images overlaid with prediction masks.

  • mask_to_submissions.py
    Converts prediction masks to a submission.csv file.

  • run.py
    Executes the entire pipeline, including training and predictions.

  • report.pdf
    Documents findings and project analysis.

About

ml-project-2-monkeylearning created by GitHub Classroom

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages