ChenLiu-1996 / CUTS

[MICCAI 2024] CUTS: A Deep Learning and Topological Framework for Multigranular Unsupervised Medical Image Segmentation
https://arxiv.org/abs/2209.11359
31 stars 2 forks source link

Utilizing GPU acceleration for PHATE and k-means calculations #4

Closed wealone1 closed 2 months ago

wealone1 commented 1 year ago

Hello,

First of all, I would like to express my gratitude for creating and sharing this project - it has been immensely helpful in my work.

I've noticed that in the generate_kmeans and generate_diffusion functions, the primary computational load is handled on the CPU, specifically the PHATE and k-means algorithms. In the context of my use cases, these computations can take considerable time.

I'm wondering if it might be possible to shift these computational components to run on a GPU for accelerated processing time? I understand this could potentially involve additional work, like seeking out or implementing GPU-supported versions of the PHATE and k-means algorithms. Any guidance or recommendations would be greatly appreciated.

Additionally, if there were specific considerations or reasons for performing these calculations on the CPU, I'd be interested to learn more about that as well.

Thank you again for your work and assistance.

Best regards, Max

huangjianaa commented 1 year ago

I also have this problem, the speed of generating results is too slow.

ChenLiu-1996 commented 1 year ago

I totally agree that generate_kmeans and generate_diffusion are significantly slow, as they both involve repeated operations over a (H x W) x (H x W) matrix. Even with an image of size 128x128, this means a matrix of size 16834x16834.

GPU-acceleration of these algorithms might be a viable solution. I will see if I can give it a try recently. Meanwhile if you have any luck with them you can submit a PR and let me know.

ChenLiu-1996 commented 6 months ago

I have updated the code for kmeans and diffusion condensation. It shall be faster than before. However, they are not using GPU for acceleration, and they are not super fast either.

If this method is overall appreciated in the field, we will spend more efforts in accelerating it.