ignite icon indicating copy to clipboard operation
ignite copied to clipboard

Add Hausdorff distance in Metrics

Open pldelisle opened this issue 5 years ago • 13 comments

I think it would be nice to add a standard implementation of the Hausdorff distance in Ignite as a Metric.

pldelisle avatar Dec 05 '19 23:12 pldelisle

@pldelisle could you please add some reference for this distance (and some use-cases for my culture :) ). Thanks

If you would like to contribute, you are welcome !

vfdev-5 avatar Dec 05 '19 23:12 vfdev-5

Hi there, I think I may be able to resolve this Issue. Would you be happy to assign me, and accept my contribution as a Hacktoberfest PR should I manage to put in a PR that closes it?

could you please add some reference for this distance (and some use-cases for my culture :)

Since the original poster has not answered this, I can briefly outline some good resources on the Hausdorff Distance (HD subsequently) that I have found whilst looking into this, as below.

References

HD definition & context:
Good references for implementation in Python:

sadielbartholomew avatar Oct 08 '20 01:10 sadielbartholomew

@sadielbartholomew Thank you for this FR. I'm very curious and interested by such metric for detection and segmentation apps. I think that it could be nice to have a good demonstrative example t show how use this wrt others metrics (iou for instance). What do you think ?

IMO, implementation should be distributed because targeted apps are time consuming. The test should be compared to sklearn implementation. Don't forget the doc with references to resources and literature.

@vfdev-5 ok for you ?

sdesrozis avatar Oct 08 '20 06:10 sdesrozis

@sadielbartholomew yes, I can assign it to you. Thanks for the link !

should I manage to put in a PR that closes it?

yes

@sdesrozis OK for me.

vfdev-5 avatar Oct 08 '20 07:10 vfdev-5

Thank you ,@sdesrozis and @vfdev-5.

Thank you for this FR. I'm very curious and interested by such metric for detection and segmentation apps.

Just FYI in case you did not notice, I wasn't the one who made the feature request, so I don't personally have a need for this metric. But it seems more than reasonable that others would benefit from having it, given the numerous applications, as well as the original poster. So I will assume the maintainers would like this feature, still, unless I am told otherwise.

I think that it could be nice to have a good demonstrative example t show how use this wrt others metrics (iou for instance). What do you think ?

Sure, that sounds helpful. I can try to create such an example.

IMO, implementation should be distributed because targeted apps are time consuming. The test should be compared to sklearn implementation. Don't forget the doc with references to resources and literature.

Thanks for the advice, I will take all of it on board when I start work on this. If I have questions I will ask them here.

In terms of timescales, I am quite busy until early next week, but then I can start working on it in some of my spare time and in a week or two after that I will hopefully be able to put up a PR. Otherwise, if for some reason I can't make progress I will let you know. Cheers.

sadielbartholomew avatar Oct 09 '20 02:10 sadielbartholomew

But it seems more than reasonable that others would benefit from having it, given the numerous applications, as well as the original poster. So I will assume the maintainers would like this feature, still, unless I am told otherwise.

@sadielbartholomew yes, let's implement this metric :)

In terms of timescales, I am quite busy until early next week, but then I can start working on it in some of my spare time and in a week or two after that I will hopefully be able to put up a PR.

Sounds good !

vfdev-5 avatar Oct 09 '20 09:10 vfdev-5

Hi @sadielbartholomew any progress on the issue ?

vfdev-5 avatar Nov 04 '20 22:11 vfdev-5

Hey @vfdev-5, can i take this issue up ? I would like to follow the sklearn implementation and further look into making it a distributed implementation ?

codeboy5 avatar Feb 28 '22 10:02 codeboy5

@codeboy5 yes, go ahead, thanks. Please, put here some details on how you would like to implement it and test the implementation.

vfdev-5 avatar Feb 28 '22 10:02 vfdev-5

I was planning to replicate this implementation (https://github.com/scikit-image/scikit-image/blob/main/skimage/metrics/set_metrics.py) in the structure of reset, update and compute which metrics in ignite follow. We can start by this and see further if changes are required. Does this sound good ?

codeboy5 avatar Feb 28 '22 10:02 codeboy5

I'm not quite sure about simply porting scikit-image implementation as they use scipy and cKDTree. In our case we would like to keep less external deps. Another point I'd start by an application and make clear on what kind of data this metric would work on: images, vectors, something else ? Another question to answer is: can we compute it in online way ? What structures we need to accumulate and how to compute it on N inputs ? Can it be an average of distances per object or should be a distance between N preds vs N ground truth objects ?

vfdev-5 avatar Feb 28 '22 10:02 vfdev-5

Okay, let me go through the details of the paper and implementation. I will get back to you on these questions and then we can discuss how to proceed further.

codeboy5 avatar Feb 28 '22 11:02 codeboy5

Hi @sadielbartholomew any progress on the issue ?

Hi, really sorry I didn't respond again - in the end I got given some urgent work that took up most of my time, so couldn't get this done. I'm glad someone else has offered to do it! Good luck :)

sadielbartholomew avatar Feb 28 '22 14:02 sadielbartholomew