ellisdg / 3DUnetCNN

Pytorch 3D U-Net Convolution Neural Network (CNN) designed for medical image segmentation
MIT License
1.89k stars 652 forks source link

Question about Displaying Dice and HD Metrics in 3DUnetCNN during Training/Testing #346

Open harrymagic098 opened 3 days ago

harrymagic098 commented 3 days ago

Hello, I am using your 3DUnetCNN project for medical image segmentation training and testing. I would like to ask whether the project supports calculating and displaying some common metrics during training or testing, such as the Dice coefficient and Hausdorff Distance (HD)? If it's not currently supported, do you have any suggestions on how to implement these? Thank you for your help!

ellisdg commented 1 day ago

Here is some example for how to compute Dice and Hausdorff using MONAI: https://gist.github.com/ellisdg/df06194d902e0fe70ba8d9ecbb1d0cb5

You will have to modify these based on what the output predictions are (logits vs activaitons). If you are using the configuration from the example, I believe the output files are logits, so you will have to apply a sigmoid activation and then thresholding to visualize the results. I hope this helps!