Skip to content

AlexanderHBerger/multiclass-BettiMatching

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multiclass Betti matching: Extension of topologically faithful loss function to multiclass segmentation

Motivation. The Betti Matching loss is a general loss function to train binary segmentation networks with strict topological guarantees and correct spatial alignment of topological features based on persitence homology [1]. Other approaches, such as clDice [2] or HuTopo [3], also address the challenge of topological correct image segmentations. However, the realm of topology-preserving multi-class segmentation has not been researched. In this work, we use a one-vs-rest strategy to extend existing loss functions to multiclass settings and compare their performance and characteristics.

Multiclass

About the code. We have provided the source code of our extensions for Betti Matching, clDice, and HuTopo along with instructions for the training and evaluation scripts. Please follow the procedure below.

Usage

Installation of required packages in virtual environment

1.) Download venv package virtual environment (venv): python3 -m pip install --user virtualenv

2.) Create a virtual environment: python3 -m venv venv

3.) Activate virtual environment: source venv/bin/activate

4.) Use requests to install required packages: pip install -r requirements.txt

Usage of Betti matching:

We use the optimized c++ BettiMatching implementation [4] to reduce runtime during barcode computation for homolgy-based loss functions. This c++ implementation must be installed and included via PyBind as pip module betti_matching.

Training

1.) To train from scratch using GPU:

python train.py --config configs/platelet_config.yaml

3.) To resume training:

python train.py --config configs/platelet_config.yaml --resume models/platelet/best_model_dict.pth

4.) To use a pretrained model:

python train.py --config configs/platelet_config.yaml --pretrained models/platelet/best_model_dict.pth

References

[1] Betti Matching: [code][paper]

[2] ClDice: [code][paper]

[3] HuTopo: [code][paper]

[4] Efficient Betti Matching: [code][paper]

About

Multiclass generalization for BettiMatching loss (and other topology-aware) loss functions for image segmentation.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages