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.
Contents:
- dival.config module
- dival.data module
- dival.datasets package
- dival.datasets.angle_subset_dataset module
- dival.datasets.cached_dataset module
- dival.datasets.dataset module
Dataset
Dataset.space
Dataset.shape
Dataset.train_len
Dataset.validation_len
Dataset.test_len
Dataset.random_access
Dataset.num_elements_per_sample
Dataset.standard_dataset_name
Dataset.__init__()
Dataset.generator()
Dataset.get_train_generator()
Dataset.get_validation_generator()
Dataset.get_test_generator()
Dataset.get_len()
Dataset.get_train_len()
Dataset.get_validation_len()
Dataset.get_test_len()
Dataset.get_shape()
Dataset.get_num_elements_per_sample()
Dataset.get_data_pairs()
Dataset.get_data_pairs_per_index()
Dataset.create_torch_dataset()
Dataset.create_keras_generator()
Dataset.get_sample()
Dataset.get_samples()
Dataset.supports_random_access()
ObservationGroundTruthPairDataset
GroundTruthDataset
- dival.datasets.ellipses_dataset module
- dival.datasets.fbp_dataset module
- dival.datasets.lodopab_dataset module
download_lodopab()
LoDoPaBDataset
LoDoPaBDataset.space
LoDoPaBDataset.shape
LoDoPaBDataset.train_len
LoDoPaBDataset.validation_len
LoDoPaBDataset.test_len
LoDoPaBDataset.random_access
LoDoPaBDataset.num_elements_per_sample
LoDoPaBDataset.ray_trafo
LoDoPaBDataset.sorted_by_patient
LoDoPaBDataset.rel_patient_ids
LoDoPaBDataset.__init__()
LoDoPaBDataset.generator()
LoDoPaBDataset.get_ray_trafo()
LoDoPaBDataset.get_sample()
LoDoPaBDataset.get_samples()
LoDoPaBDataset.get_indices_for_patient()
LoDoPaBDataset.check_for_lodopab()
LoDoPaBDataset.get_num_patients()
LoDoPaBDataset.get_patient_ids()
LoDoPaBDataset.get_idx_sorted_by_patient()
- 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
DeepImagePriorCTReconstructor
DeepImagePriorCTReconstructor.HYPER_PARAMS
DeepImagePriorCTReconstructor.__init__()
DeepImagePriorCTReconstructor.get_activation()
DeepImagePriorCTReconstructor.channels
DeepImagePriorCTReconstructor.gamma
DeepImagePriorCTReconstructor.iterations
DeepImagePriorCTReconstructor.loss_function
DeepImagePriorCTReconstructor.lr
DeepImagePriorCTReconstructor.mu_max
DeepImagePriorCTReconstructor.photons_per_pixel
DeepImagePriorCTReconstructor.scales
DeepImagePriorCTReconstructor.skip_channels
- dival.reconstructors.fbpunet_reconstructor module
FBPUNetReconstructor
FBPUNetReconstructor.HYPER_PARAMS
FBPUNetReconstructor.__init__()
FBPUNetReconstructor.train()
FBPUNetReconstructor.init_model()
FBPUNetReconstructor.init_scheduler()
FBPUNetReconstructor.batch_size
FBPUNetReconstructor.channels
FBPUNetReconstructor.epochs
FBPUNetReconstructor.filter_type
FBPUNetReconstructor.frequency_scaling
FBPUNetReconstructor.init_bias_zero
FBPUNetReconstructor.lr
FBPUNetReconstructor.lr_min
FBPUNetReconstructor.normalize_by_opnorm
FBPUNetReconstructor.scales
FBPUNetReconstructor.scheduler
FBPUNetReconstructor.skip_channels
FBPUNetReconstructor.use_sigmoid
- dival.reconstructors.iradonmap_reconstructor module
IRadonMapReconstructor
IRadonMapReconstructor.HYPER_PARAMS
IRadonMapReconstructor.__init__()
IRadonMapReconstructor.init_model()
IRadonMapReconstructor.batch_size
IRadonMapReconstructor.epochs
IRadonMapReconstructor.fully_learned
IRadonMapReconstructor.lr
IRadonMapReconstructor.normalize_by_opnorm
IRadonMapReconstructor.scales
IRadonMapReconstructor.skip_channels
IRadonMapReconstructor.use_sigmoid
- dival.reconstructors.learnedgd_reconstructor module
LearnedGDReconstructor
LearnedGDReconstructor.HYPER_PARAMS
LearnedGDReconstructor.__init__()
LearnedGDReconstructor.init_model()
LearnedGDReconstructor.batch_norm
LearnedGDReconstructor.batch_size
LearnedGDReconstructor.epochs
LearnedGDReconstructor.init_fbp
LearnedGDReconstructor.init_filter_type
LearnedGDReconstructor.init_frequency_scaling
LearnedGDReconstructor.init_weight_gain
LearnedGDReconstructor.init_weight_xavier_normal
LearnedGDReconstructor.internal_ch
LearnedGDReconstructor.kernel_size
LearnedGDReconstructor.lr
LearnedGDReconstructor.lr_time_decay_rate
LearnedGDReconstructor.lrelu_coeff
LearnedGDReconstructor.niter
LearnedGDReconstructor.nlayer
LearnedGDReconstructor.normalize_by_opnorm
LearnedGDReconstructor.prelu
LearnedGDReconstructor.use_sigmoid
- dival.reconstructors.learnedpd_reconstructor module
LearnedPDReconstructor
LearnedPDReconstructor.HYPER_PARAMS
LearnedPDReconstructor.__init__()
LearnedPDReconstructor.init_model()
LearnedPDReconstructor.init_optimizer()
LearnedPDReconstructor.init_scheduler()
LearnedPDReconstructor.batch_norm
LearnedPDReconstructor.batch_size
LearnedPDReconstructor.epochs
LearnedPDReconstructor.init_fbp
LearnedPDReconstructor.init_filter_type
LearnedPDReconstructor.init_frequency_scaling
LearnedPDReconstructor.internal_ch
LearnedPDReconstructor.kernel_size
LearnedPDReconstructor.lr
LearnedPDReconstructor.lr_min
LearnedPDReconstructor.lrelu_coeff
LearnedPDReconstructor.ndual
LearnedPDReconstructor.niter
LearnedPDReconstructor.nlayer
LearnedPDReconstructor.normalize_by_opnorm
LearnedPDReconstructor.nprimal
LearnedPDReconstructor.prelu
LearnedPDReconstructor.use_sigmoid
- dival.reconstructors.networks package
- dival.reconstructors.networks.iradonmap module
- dival.reconstructors.networks.iterative module
- dival.reconstructors.networks.unet module
- dival.reconstructors.odl_reconstructors module
FBPReconstructor
CGReconstructor
GaussNewtonReconstructor
KaczmarzReconstructor
KaczmarzReconstructor.ops
KaczmarzReconstructor.x0
KaczmarzReconstructor.niter
KaczmarzReconstructor.omega
KaczmarzReconstructor.random
KaczmarzReconstructor.projection
KaczmarzReconstructor.callback
KaczmarzReconstructor.callback_loop
KaczmarzReconstructor.__init__()
KaczmarzReconstructor.iterations
LandweberReconstructor
MLEMReconstructor
ISTAReconstructor
PDHGReconstructor
DouglasRachfordReconstructor
ForwardBackwardReconstructor
ADMMReconstructor
BFGSReconstructor
- dival.reconstructors.reconstructor module
Reconstructor
Reconstructor.reco_space
Reconstructor.observation_space
Reconstructor.name
Reconstructor.hyper_params
Reconstructor.HYPER_PARAMS
Reconstructor.__init__()
Reconstructor.reconstruct()
Reconstructor.save_hyper_params()
Reconstructor.load_hyper_params()
Reconstructor.save_params()
Reconstructor.load_params()
LearnedReconstructor
IterativeReconstructor
StandardIterativeReconstructor
FunctionReconstructor
- dival.reconstructors.regression_reconstructors module
- dival.reconstructors.standard_learned_reconstructor module
StandardLearnedReconstructor
StandardLearnedReconstructor.model
StandardLearnedReconstructor.non_normed_op
StandardLearnedReconstructor.HYPER_PARAMS
StandardLearnedReconstructor.__init__()
StandardLearnedReconstructor.opnorm
StandardLearnedReconstructor.op
StandardLearnedReconstructor.eval()
StandardLearnedReconstructor.train()
StandardLearnedReconstructor.init_transform()
StandardLearnedReconstructor.transform
StandardLearnedReconstructor.init_model()
StandardLearnedReconstructor.init_optimizer()
StandardLearnedReconstructor.optimizer
StandardLearnedReconstructor.init_scheduler()
StandardLearnedReconstructor.scheduler
StandardLearnedReconstructor.batch_size
StandardLearnedReconstructor.epochs
StandardLearnedReconstructor.lr
StandardLearnedReconstructor.normalize_by_opnorm
StandardLearnedReconstructor.save_learned_params()
StandardLearnedReconstructor.load_learned_params()
- dival.reconstructors.tvadam_ct_reconstructor module
TVAdamCTReconstructor
TVAdamCTReconstructor.HYPER_PARAMS
TVAdamCTReconstructor.__init__()
TVAdamCTReconstructor.gamma
TVAdamCTReconstructor.init_filter_type
TVAdamCTReconstructor.init_frequency_scaling
TVAdamCTReconstructor.iterations
TVAdamCTReconstructor.loss_function
TVAdamCTReconstructor.lr
TVAdamCTReconstructor.mu_max
TVAdamCTReconstructor.photons_per_pixel
- 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