Final Project for M2 MVA course: Deformable models and geodesic methods for image analysis. In this project, we implement and analyse the method proposed in Beyond the Pixel-Wise Loss for Topology-Aware Delineation using PyTorch. It aims to improve the performance for the problem of delineation of curvilinear structures using deep learning methods.
Figure 1: Training Pipeline Reprinted from Article- PyTorch 1.0
- >= Python 3
- Visdom
We test our algorithm on Massachusetts Roads Dataset. A Python script is provided in the Data folder to download the whole dataset. We then resize all images to 256 in order to reduce memory usage.
First we train a UNet-based model with topology-aware loss using K=1.
python -m visdom.server
python train.py
Then the model is finetuned using K=3 on the same dataset.
python train.py --K 3 --model ../log/pretrained/model.t7
python test.py --model path_to_model --image path_to_image --label path_to_groundtruth
We provide three pretrained models in the log folder, namely the UNet model without topology-aware loss (pure UNet), the UNet model with topology-aware loss using K=1 (Topological UNet), and the finetuned UNet model with topology-aware loss using K=3 (Iterative UNet).
Here we show the results for two images in test dataset.
Figure 2: Input and Groundtruth for the First Example Figure 3: pure UNet, topological UNet and iterative UNet (from left to right) Figure 4: Input and Groundtruth for the Second Example Figure 5: pure UNet, topological UNet and iterative UNet (from left to right)We use three criteria: Completeness, Correctness and Quality. The definitions can be found here.
The results on test dataset are shown as below:
Model | Completeness | Correctness | Quality |
---|---|---|---|
U-Net | 0.67584426 | 0.59423022 | 0.43436453 |
K=1 | 0.58282891 | 0.7042716 | 0.44924965 |
K=3 | 0.61157189 | 0.70223687 | 0.46712003 |