Home

Awesome

Report

<!-- TABLE OF CONTENTS --> <details open="open"> <summary>Table of Contents</summary> <ol> <li> <a href="#about-the-project">About The Project</a> </li> <li> <a href="#getting-started">Getting Started</a> <ul> <li><a href="#prerequisites">Prerequisites</a></li> <li><a href="#installation">Installation</a></li> <li><a href="#set-up-dataset">Set-up datasets</a></li> </ul> </li> <li><a href="#usage">Usage</a> <ul> <li><a href="#training">Training</a></li> <li><a href="#evaluation">Evaluation</a></li> </ul> </li> </ol> </details> <!-- ABOUT THE PROJECT -->

About the project

The marine-anomaly-detection project provides code to apply the state of the art of semi-supervised learning techniques to marine anomaly detection semantic segmentation problems on satellite imagery of marine regions. The considered anomalies are marine-litter (marine debris), ships, clouds, and algae/organic materials.

The code builds on and extends the following two repositories:

<!-- GETTING STARTED -->

Getting Started

Prerequisites

It is recommended to use conda to set-up the environment. conda will take care of all requirements for you. For a detailed list of required packages, please refer to the conda environment file.

Installation

  1. Get micromamba, or Miniconda, or similar. Micromamba is preferred to Miniconda for its greater speed in creating the virtual environment.
  2. Clone the repo.
    git clone https://github.com/lucamarini22/marine-anomaly-detection.git
    
  3. Setup and activate the environment. This will create a conda environment called marine-anomaly-detection.
    micromamba env create -f environment.yml
    
    micromamba activate marine-anomaly-detection
    
  4. [Optional] Install the local package.
    pip install -e .
    

Set up dataset

To launch the training on MARIDA, it is necessary to download the dataset. The dataset can be downloaded here and has the following structure:

The --patches_path and --splits_path arguments in marineanomalydetection/parse_args_train.py file shall be respectively point to the patches and splits folders.

<!-- USAGE EXAMPLES -->

Usage

Training

  1. Create a Weight and Biases account to keep track of the runs.
  2. Set the values of the hyperparameters in this config.yaml file.
  3. Enter the main folder.
    cd /marine-anomaly-detection/
    
  4. Create a Sweep to keep track of your training runs.
    wandb sweep --project <project-name> <config-file.yaml>
    
  5. Specify all the values of the arguments in marineanomalydetection/parse_args_train.py you did not specify in <config-file.yaml>.
  6. Start an agent and execute $NUM training runs.
    wandb agent --count $NUM <your-entity/sweep-demo-cli/sweepID>
    

Evaluation

  1. Evaluate a model.
    python evaluation.py --model_path=<path_to_model>
    
  2. Visualize the predictions of the last evaluated model by running the cells of the notebook Visualize Predictions.ipynb. Specify the variable tile_name to see the predictions for the patches of the specified tile.
<!-- ACKNOWLEDGEMENTS This README was based on https://github.com/othneildrew/Best-README-Template -->