百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
T

TopoLoss

> 编程语言
开源

NeurIPS 2019 论文代码: 保持拓扑结构的深度图像分割

186 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

NeurIPS 2019 论文代码: 保持拓扑结构的深度图像分割

TopoLoss

This repository contains the implementation of our work "Topology-Preserving Deep Image Segmentation", accepted to NeurIPS 2019.

Theoretically speaking, the loss function can be incorporated into any suitable framework. The function is used in PyTorch. And there are two ways to incorporate this loss function into your framework:

  1. Update the total gradient (e.g. cross entropy gradient + lambda * topo gradient) when backpropagation;
  2. Our loss function is actually defined on critical pixels, and you can conduct your total loss (e.g. cross entropy loss + lambda * topo loss) based on the repository. And do the else as usual.

Content directory

Data/: data folder

Results/: storing results

Code/TDFPython/TDFMain.py: main python script (run it to start), results are all written in Results folder

Code/TDFPython/PersistencePython.so: persistence code, wrapped as a static library (most likely you would have to recompile this library by yourself)

Code/cPers/: c++ persistence code

Code/cPers/cPers/compile_pers_lib.sh: script to compile the library

Code/cPers/cPers/PersistencePython.cpp: root file for the python library

pybind11-stable.zip: tools used for compiling c++ code into library (python wrapper)

PyTorch example

  1. To be noted that our method is architecture-agnostic, you could incorporate the topological loss into your own framework to deal with your own datasets.

  2. At present, we only provide example for PyTorch framework. And to be honest, I am not quite sure if it's compatible with other libraries. Anyway, if you do want to apply the proposed method to other framework, feel free to have a try and I'm always welcome for discussion.

  3. Here is an example to incorporate the C++ topological loss into deep learning framework based on PyTorch: https://github.com/HuXiaoling/imageSeg-2.5D_topo. The original paper only deals with 2D images, while this repository contains both 2D and 2.5D implementations (backbone may be slightly different). And we also plan to release the code for true 3D implementations (the paper is in preparation).

  4. I apologize for the possible confusion. But stay tuned. All of the related repositories are under construction. You can definitely adopt existing repositories regarding your own data. If there are any questions, please feel easy to post them here.

Update (06/2021)

A more efficient version topoloss is uploaded!!

Now you could simply incorporate the topological loss function into your own backbone (PyTorch).

topoloss.py: offline sample showing how to use topological loss.

topoloss_pytorch.py: function used in pytorch framework (Will be included in pip later)

Post-processing

Be sure to post-process (remove small connected components) as topoloss may create a few isolated points.

Citation

Please consider citing our paper if you find it useful.

@article{hu2019topology,
  title={Topology-preserving deep image segmentation},
  author={Hu, Xiaoling and Li, Fuxin and Samaras, Dimitris and Chen, Chao},
  journal={Advances in neural information processing systems},
  volume={32},
  year={2019}
}

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C++betti-numbersdifferentiableimage-segmentationneurips-2019

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言