FastGradientProjection.jl

Author syoshida1983
Popularity
0 Stars
Updated Last
2 Months Ago
Started In
June 2024

FastGradientProjection

Stable Dev Build Status

This package provides the functions for total variation (TV) denoising with gradient projection (GP) and fast gradient projection (FGP). GP/FGP denoises of (volume) image $\mathbf{b}$ based on the following minimization problem

$$\min_{\mathbf{x}\in{C}}\|\mathbf{x} - \mathbf{b}\|^{2}_{F} + 2\lambda\mathrm{TV}(\mathbf{x}),$$

where $C$ is a convex closed set, $\|\cdot\|_{F}$ is the Frobenius norm, $\lambda$ is the regularization parameter, and $\mathrm{TV}$ is the total variation defined by

$$\begin{align} \mathrm{TV}_{I}(\mathbf{x}) &= \begin{cases} \sum_{i}\sum_{j}\sqrt{\left(x_{i,j} - x_{i+1,j}\right)^{2} + \left(x_{i,j} - x_{i,j+1}\right)^{2}} & \text{(2D)}\\ \sum_{i}\sum_{j}\sum_{k}\sqrt{\left(x_{i,j,k} - x_{i+1,j,k}\right)^{2} + \left(x_{i,j,k} - x_{i,j+1,k}\right)^{2} + \left(x_{i,j,k} - x_{i,j,k+1}\right)^{2}} & \text{(3D)} \end{cases},\\ \mathrm{TV}_{l_{1}}(\mathbf{x}) &= \begin{cases} \sum_{i}\sum_{j}\left\{\left|x_{i,j} - x_{i+1,j}\right| + \left|x_{i,j} - x_{i,j+1}\right|\right\} & \text{(2D)}\\ \sum_{i}\sum_{j}\sum_{k}\left\{\left|x_{i,j,k} - x_{i+1,j,k}\right| + \left|x_{i,j,k} - x_{i,j+1,k}\right| + \left|x_{i,j,k} - x_{i,j,k+1}\right|\right\} & \text{(3D)} \end{cases}. \end{align}$$

$\mathrm{TV}_{I}$ and $\mathrm{TV}_{l_{1}}$ express isotropic and $l_{1}$-based anisotropic TV, respectively.

For more information on the algorithm, please refer to the following reference.

Amir Beck and Marc Teboulle, "Fast Gradient-Based Algorithms for Constrained Total Variation Image Denoising and Deblurring Problems," IEEE Trans. Image Process. 18, 2419-2434 (2009)

Installation

To install this package, open the Julia REPL and run

julia> ]add FastGradientProjection

or

julia> using Pkg
julia> Pkg.add("FastGradientProjection")

Usage

Import the package first.

julia> using FastGradientProjection

For example, perform the following to denoise (volume) image $\mathbf{b}$ with FGP.

julia> x = FGP(b, 0.1, 100, lower_bound=0.0, upper_bound=1.0)

The second and third arguments are the regularization parameter $\lambda$ and the number of iterations. The values specified by the keyword arguments lower_bound and upper_bound are the upper and lower bounds of the convex closed set $C$. These default values are lower_bound=-Inf and upper_bound=Inf. If $\mathbf{b}$ is a complex array, projection to $C$ is not performed. The function FGP performs denoising based on isotropic TV by default; to perform denoising based on anisotropic TV, specify the keyword argument TV="aniso". Refer to the documentation for further information.

  
noised image            denoised image