GithubHelp home page GithubHelp logo

hilab-git / aceloss Goto Github PK

View Code? Open in Web Editor NEW
67.0 3.0 11.0 2.55 MB

Implementations of "Learning Euler's Elastica Model for Medical Image Segmentation"

License: MIT License

Python 100.00%
active-contour-model medical-image-segmentation loss-functions

aceloss's Introduction

Active Contour Euler Elastica Loss Functions

Official implementations of paper: Learning Euler's Elastica Model for Medical Image Segmentation, and a short version was accepted by ISBI 2021 .

  • Implemented a novel active contour-based loss function, a combination of region term, length term, and elastica term (mean curvature).
  • Reimplemented some popular active contour-based loss functions in different ways, such as 3D Active-Contour-Loss based on Sobel filter and max-and min-pool.

Introduction and Some Results

  • Pipeline of ACE loss.

  • 2D results and visualization.

  • 3D results and visualization.

  • If you want to use these methods just as constrains (combining with dice loss or ce loss), you can use torch.mean() to replace torch.sum().

Requirements

Some important required packages include:

  • Pytorch version >= 0.4.1.
  • Python >= 3.6.

Follow official guidance to install. Pytorch.

Citation

If you find Active Contour Based Loss Functions are useful in your research, please consider to cite:

@inproceedings{chen2020aceloss,
  title={Learning Euler's Elastica Model for Medical Image Segmentation},
  author={Chen, Xu and Luo, Xiangde and Zhao, Yitian and Zhang, Shaoting and Wang, Guotai and Zheng, Yalin},
  journal={arXiv preprint arXiv:2011.00526},
  year={2020}
}

@inproceedings{chen2019learning,
  title={Learning Active Contour Models for Medical Image Segmentation},
  author={Chen, Xu and Williams, Bryan M and Vallabhaneni, Srinivasa R and Czanner, Gabriela and Williams, Rachel and Zheng, Yalin},
  booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},
  pages={11632--11640},
  year={2019}
}

Other Active Contour Based Loss Functions

  • Active Contour Loss (ACLoss).
  • Geodesic Active Contour Loss (GAC).
  • Elastic-Interaction-based Loss (EILoss)

Acknowledgement

  • We thank Dr. Jun Ma for instructive discussion of curvature implementation and also thank Mr. Yechong Huang for instructive help during the implementation processing of 3D curvature, Sobel, and Laplace operators.

aceloss's People

Contributors

luoxd1996 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

aceloss's Issues

How run project?

How simple run project? I want pass image as params and return contour

What's the meaning of each input dimention?

Hello, I want to test the performance of this loss function on other dataset. Coud you explain the meaning of each input dimention in the demo?

x2 = torch.rand((2, 3, 97, 80))
x3 = torch.rand((2, 4, 112, 97, 80))

Question for use aceloss

Hi, I use the FastACELoss3DV2 as loss function for liver segmentation in nnUNet. Training about 140 epochs but the global dice for validation data set always below 0.04. Is there any wrong with me in using the loss function?
aceloss

how to use AC loss or ACE loss

Hello,

I tried to use AC or ACE losses instead of CE loss for the binary segmentation. Though I have used a certain network for the CE loss many times, the network does not work for AC/ACE losses.

In the meantime, I used a label array whose shape is equal to the prediction. Also, its channels have zero or one values like the code below.

from aceloss import ACLossV2
criterion = ACLossV2(classes=2)
outputs = model(inputs)
masks2 = torch.zeros_like(outputs)
masks2[:, 0, :, :] = (masks == 0).squeeze(1) # shape: [batch size, channel size, width, height]
masks2[:, 1, :, :] = (masks == 1).squeeze(1)
loss = criterion(outputs, masks2)

The loss value is larger than 1e4, and the output for the prediction looks meaningless. Did I miss something? I didn't change any code for the ACELoss class. Thank you.

Thanks for your contribution

Good Jod! I tried to use the 3D ACE loss in my project, focusing on 3D vessel segmentation!
Also great job and thanks for PyMIC Repo!
You can also ensemble 3D ACE loss in PyMIC, just my advice!

Do you need to use a ratio coefficient

dear author
This is a very good job. I added ACE loss loss=torch. mean (CEloss+ACEloss) to the already trained model (DICE: 0.90),

but I found that ACEloss has a scale of 100,000, while CEloss has only a decimal scale.

Do I need to multiply a ratio coefficient before ACElos.

Unable to converge

Hi, thanks for the repo.

When I try to use the ACELoss, the HD Loss is very high for hundreds epochs (approx. 1e+4) while the DSC is around 0.005 or so. I am wondering if I use this repo right.

What I am trying to do is multi-label segmentation, that inputting B1HW and outputting BCHW (where C is the number of classes). Previously, I used Dice loss for my task and it worked well (approx. 0.95 DSC). Currently, I simply switched from dice loss to 0.8 * dice + 0.2 * ACE.

I am wondering if I am using ACE correctly or not?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.