Cuda_Spatial_Deform
本文推出一套使用CUDA加速图像空间形变计算,使用GPU并行计算加速计算,尤其在弹性形变上表现非常突出,在图像增广中帮助很大,尤其在医疗图像领域比较常用,代码地址https://github.com/qsyao/cuda_spatial_defrom
A fast tool to do image augmentation by CUDA on GPU(especially elastic deform), can be helpful to research on Medical Image.
Motivation
- When the size of image is too large, it will take a lot of time(much more than forward and backward computation like U_Net), especially for 3D image(like CT).
- Elastic deformation on CPU is too slow.
- Doing Sptial_Deform by muti-processing consumes of too much CPU resources, whitch most GPU servers(like 32 cores with 4 gpus) can not afford.
Implementation Overview
- Doing Spation_Deform on GPU instead of CPU, greatly saving CPU resources.
- Very Fast, speed up 25x at rotation, 45x at elastic_deform.
- Support many types of spatial deform: flip, rotate, scale, translate, elastic_deform.
- Support many rules of map_coordinates: mirror, constant, reflect, wrap, nearest.
- Doing Spatial_Deform by doing calculates on coordinates, all transformations get combined before they are applied to the image
- Implement map_coordinates by linear interpolation.
- U