Skip to content
This repository has been archived by the owner on Jun 22, 2022. It is now read-only.

Improved Multioutput UNet

kamil-kaczmarek edited this page Feb 19, 2018 · 2 revisions

Overview

Third solution is build on top of the previous one. We use Multi-output U-Net. Nevertheless, our focus was on pre- and post-processing.

Augmentations

We add more image augmentations, especially color augmentations. You can check the code: augmentations.py.

Validation

We have introduced better validation which can be parametrized in the neptune.yaml:L40. Here, we use pretrained VGG as feature extractor. On these features, we run k-means clustering with k=10. Thanks to this we can manipulate the validation difficulty and validation split size (clusters does not have equal number of members). Check the code: preparations.py:L94

Final segmentation

Finally, we do following segmentation that leads to final preds:

  1. Subtract contours from segmentation. As a result, you have "eroded mask", which is binary.
  2. The non-zero elements in the eroded mask are used as watershed markers. Check markers for watershed transform for intuition about it.
  3. Calculate distances in the eroded mask -> this transformation yields distances matrix that we take with negative sign. Since eroded mask just 2D array, we calculate minimal distance of the given non-zero entry to the nearest zero.
  4. Use markers and distances matrix to run watershed.

Run default experiment

Parameters that are set as default will give you approximately 0.421 on the leaderboard (top 4% as of Feb 19th).

Run command:

$ neptune login
$ neptune send main.py --worker gcp-gpu-large --environment pytorch-0.2.0-gpu-py3 -- train_evaluate_predict_pipeline --pipeline_name unet_multitask

When training is completed, collect Kaggle submit from: /output/dsb/experiments/submission.csv.