Deep Inversion Validation Library’s documentation¶
This is the documentation of DIVal, a library for testing and comparing deep learning based methods for inverse problems written in python.
To get started, we recommend having a look at the example scripts.
Below is a list of some fundamental functions and classes.
|
Return a standard dataset by name. |
|
Dataset base class. |
|
Return a reference reconstructor. |
|
Abstract reconstructor base class. |
|
Abstract base class for measures used for evaluation. |
|
Task table containing reconstruction tasks to evaluate. |
Standard datasets¶
One main goal of this library is to provide public standard datasets suitable for deep learning. Currently, the following datasets are included:
'ellipses'
:A typical synthetical CT dataset with ellipse phantoms.
'lodopab'
:The public LoDoPaB-CT dataset, based on real CT reconstructions from the public LIDC-IDRI dataset. See also the
LoDoPaBDataset
class.
These datasets can be accessed by calling dival.get_standard_dataset()
,
e.g.
from dival import get_standard_dataset
dataset = get_standard_dataset('ellipses')
Note on astra and CUDA: The CT datasets come with a ray_trafo
attribute
providing the forward operator.
There are different backend implementations for it, the default is
'astra_cuda'
. This requires both the
astra-toolbox and a CUDA-enabled GPU being
available. In order to use the (slow) scikit-image backend instead, you can
pass impl='skimage'
to get_standard_dataset
. If astra is available but
CUDA is not, impl='astra_cpu'
is preferred.
The latest development version of astra can be installed with
conda install astra-toolbox -c astra-toolbox/label/dev
.
Reference reconstructors¶
For some reconstructor classes on some standard datasets reference
configurations are provided.
These configurations include hyper parameters and pretrained learned parameters
for a LearnedReconstructor
.
A reference reconstructor can be retrieved by calling
dival.get_reference_reconstructor()
, e.g.
from dival import get_reference_reconstructor
reconstructor = get_reference_reconstructor('fbp', 'ellipses')
We are happy to receive your feedback (e.g. via github issues) if you think a reference configuration should be improved or another reconstructor should be included.
Metrics for image reconstruction¶
To evaluate image reconstruction performance on datasets that include ground
truth images, full-reference methods like PSNR
and
SSIM
can be used.
Both PSNR and SSIM depend on the data range, which is the difference between
the maximum and the minimum possible values.
While e.g. scikit-image
uses a global data range of 1.0
for PSNR and 2.0
for SSIM by default
(in case of a floating point data type), an image-dependent default value is
used in dival. If no data range is specified explicitly, it is determined as
np.max(gt)-np.min(gt)
from the respective ground truth image gt
.
While we consider it to be a drawback of this approach that the metric differs
for different ground truth images, it has the benefit to be quite flexible
in absence of a priori knowledge. If known, we recommend specifying the data
range explicitly.
- dival.config module
- dival.data module
- dival.datasets package
- dival.datasets.angle_subset_dataset module
- dival.datasets.cached_dataset module
- dival.datasets.dataset module
- dival.datasets.ellipses_dataset module
- dival.datasets.fbp_dataset module
- dival.datasets.lodopab_dataset module
- dival.datasets.reordered_dataset module
- dival.datasets.standard module
- dival.evaluation module
- dival.hyper_param_search module
- dival.measure module
- dival.reconstructors package
- Subpackages
- Submodules
- dival.reconstructors.dip_ct_reconstructor module
- dival.reconstructors.fbpunet_reconstructor module
- dival.reconstructors.iradonmap_reconstructor module
- dival.reconstructors.learnedgd_reconstructor module
- dival.reconstructors.learnedpd_reconstructor module
- dival.reconstructors.odl_reconstructors module
- dival.reconstructors.reconstructor module
- dival.reconstructors.regression_reconstructors module
- dival.reconstructors.standard_learned_reconstructor module
- dival.reconstructors.tvadam_ct_reconstructor module
- Module contents
- dival.reconstructors.dip_ct_reconstructor module
- dival.reconstructors.fbpunet_reconstructor module
- dival.reconstructors.iradonmap_reconstructor module
- dival.reconstructors.learnedgd_reconstructor module
- dival.reconstructors.learnedpd_reconstructor module
- dival.reconstructors.networks package
- dival.reconstructors.networks.iradonmap module
- dival.reconstructors.networks.iterative module
- dival.reconstructors.networks.unet module
- dival.reconstructors.odl_reconstructors module
- dival.reconstructors.reconstructor module
- dival.reconstructors.regression_reconstructors module
- dival.reconstructors.standard_learned_reconstructor module
- dival.reconstructors.tvadam_ct_reconstructor module
- dival.reference_reconstructors module
- dival.util package
- Submodules
- dival.util.constants module
- dival.util.download module
- dival.util.input module
- dival.util.odl_noise_random_state module
- dival.util.odl_utility module
- dival.util.plot module
- dival.util.std_out_err_redirect_tqdm module
- dival.util.torch_losses module
- dival.util.torch_utility module
- dival.util.zenodo_download module
- Module contents
- Submodules
- dival.util.constants module
- dival.util.download module
- dival.util.input module
- dival.util.odl_noise_random_state module
- dival.util.odl_utility module
- dival.util.plot module
- dival.util.std_out_err_redirect_tqdm module
- dival.util.torch_losses module
- dival.util.torch_utility module
- dival.util.zenodo_download module
- dival.version module