Comments (8)
@agarcia-ruiz thanks for the answer. I understand that it may be useful to have it to prevent a division by zero, but I am not convinced that it should be there outside the scope of training a DL model (have gone through the discussion you pointed, and even there it seem like for some cases the training does not work unless setting it to 0).
In this context, the case should probably be dealt with in another way when pred_sum
is 0. At the very least, documenting the behavior may be worthwhile, or adding it as a parameter to the method.
from segmentation_metrics.
It seems to do with the smooth parameter, changing it to smooth=0.0 gives a dice of 1.0. Some discussion about that here.
segmentation_metrics/seg_metrics/seg_metrics.py
Lines 81 to 89 in df9a231
from segmentation_metrics.
@jhlegarreta Thank you very much proposing this question. Actually, we have had some discussion on this issue and we decided to use 0.001 as the default smooth. But indeed we found that a lot of users may feel confused about it especially when running our examples. So we will have another deeper discussion on it and see how to solve it. A possible solution, as you mentioned, is to make it as a parameter. Another solution is make it as 0 and raise Exception when division zero error occured.
Anyway, we will solve it soon. And if you have better solution, please let us know.
Best,
Jingnan
from segmentation_metrics.
@jhlegarreta Another solution could be that we have the default smooth value of 0 followed by a try excep function for the metrics calculation. If we met the division zero exception in the try function, we reset the smooth value to 0.001 and recalculate the metrics, (and may show a warning to the users about this case).
What do you think of this solution?
from segmentation_metrics.
@Jingnan-Jia it looks like one possible workaround; I am not sure what the best approach is. Maybe worthwhile looking at what other scientific tools that compute at least the DSC do. In my mind, when giving the ground truth it should clearly provide a perfect score. Providing tests on well-known cases would probably be enlightening.
from segmentation_metrics.
Related Issues (17)
- URGENT: Great package, your myutil.py script not included in pip/git version HOT 1
- Import error HOT 6
- Adding TP TN FP FN HOT 5
- "Scan files are None, please check the data directory" HOT 4
- Open-source collaboration
- Code is not working for different cronology in labels HOT 3
- Unit of Volume Similarity HOT 4
- Type error issue when using this package with Pytest HOT 1
- Logging issues HOT 1
- Add .png suffix HOT 3
- Adding .dcm contour data HOT 1
- Evaluation metric 3D or 2D based segmentation HOT 1
- what will be the input labels for the function of 'get_metrics_dict_all_labels'? HOT 2
- Potential Documentation Optimization HOT 1
- AttributeError: module 'numpy' has no attribute 'Array' HOT 1
- TypeError: 'type' object is not subscriptable, line 144 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from segmentation_metrics.