TorchRadon is a PyTorch extension written in CUDA that implements differentiable routines for solving computed tomography (CT) reconstruction problems.
The library is designed to help researchers working on CT problems to combine deep learning and model-based approaches.
Main features:
- Forward projections, back projections and shearlet transforms are differentiable and
integrated with PyTorch
.backward(). - Up to 125x faster than Astra Toolbox.
- Batch operations: fully exploit the power of modern GPUs by processing multiple images in parallel.
- Transparent API: all operations are seamlessly integrated with PyTorch,
gradients can be computed using
.backward(), half precision can be used with Nvidia AMP. - Half precision: storing data in half precision allows to get sensible speedups when doing Radon forward and backward projections with a very small accuracy loss.
Implemented operations:
- Parallel Beam projections
- Fan Beam projections
- Shearlet transform
You need to have CUDA and PyTorch installed, then run:
git clone https://github.com/J-3TO/torch-radon.git
cd torch-radon
python setup.py installThe library is noticeably faster than the Astra Toolbox, especially when data is already on the GPU. Main disadvantage of Astra is that it only takes inputs which are on the CPU, this makes training end-to-end neural networks very inefficient.
The following benchmark compares the speed of Astra Toolbox and Torch Radon:

If we set clip_to_circle=True (consider only the part of the image that is inside the circle) the speed difference is even larger:

These results hold also on a cheap laptop GPU:

If you are using TorchRadon in your research, please cite the following paper:
@article{torch_radon,
Author = {Matteo Ronchetti},
Title = {TorchRadon: Fast Differentiable Routines for Computed Tomography},
Year = {2020},
Eprint = {arXiv:2009.14788},
journal={arXiv preprint arXiv:2009.14788},
}
Install testing dependencies with pip install -r test_requirements.txt
then test with:
nosetests tests/