anthcp / D-AMP_Toolbox

This packages contains the code to run the BM3D, BM3D-SAPCA, BLS-GSM, and NLM variants of the D-AMP, D-VAMP, and D-prGAMP algorithms.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Original release date : 8/7/14
Latest release date   : 11/15/16

Reference #1          : "From Denoising to Compressed Sensing", published in IEEE Trans. Info. Theory, 2016
Authors               : Christopher A. Metzler, Arian Maleki, Richard G. Baraniuk
Download              : http://arxiv.org/abs/1406.4175

Reference #2          : "Denoising-based Vector AMP" 
Authors               : Philip Schniter, Sundeep Rangan, Alyson K. Fletcher
Download              : http://arxiv.org/abs/1611.01376

Reference #3          : "BM3D-PRGAMP: Compressive phase retrieval based on BM3D denoising" 
Authors               : Christopher A. Metzler, Arian Maleki, Richard G. Baraniuk
Download              : http://ieeexplore.ieee.org/abstract/document/7532810/

Questions/suggestions/comments: chris.metzler@rice.edu (D-AMP & D-prGAMP) or schniter.1@osu.edu (D-VAMP)

Contents
---------------------------------------------------------------------------
scripts:
    CS_1D_Demo.m: Recover a compressively sampled 1D signal with Haar wavelet sparsity based (V)AMP and NLM-(V)AMP.
    CS_Imaging_Demo.m: Recover compressively sampled image using D-AMP.
	CS_Imaging_Demo_DVAMP.m: Recover compressively sampled image using D-VAMP.
	CPR_Imaging_Demo.m: Perform compressive phase retrieval with D-prGAMP.
    QQplotGenerator.m: Generate a series of QQplots of the effective noise of D-IT and D-AMP.
    StateEvolutionGenerator.m: Compute the state evolution of a D-AMP algorithm and compare it to the true MSEs of D-AMP and D-IT.

functions:
    AMP.m: Reconstructs sparse, compressively sampled signals using AMP.
    VAMP.m: Reconstructs sparse, compressively sampled signals using VAMP.
    DAMP.m: Performs D-AMP reconstruction of a compressively sampled signal. The string "denoiser" selects which denoiser to use.
    DVAMP.m: Performs D-VAMP reconstruction of a compressively sampled signal. The string "denoiser" selects which denoiser to use.
	DprGAMP: Performs D-prGAMP compressive phase retrieval of a signal. The string "denoiser" selects which denoiser to use.
    DIT.m: Performs D-IT reconstruction of a compressively sampled signal. The string "denoiser" selects which denoiser to use.
    DAMP_oneIter.m: Performs a single iteration of D-AMP.  Used to generate state evolution and qqplots.
    DIT_oneIter.m: Performs a single iteration of D-IT.  Used to generate state evolution and qqplots.
    DAMP_SE_Prediction.m: Computes the next predicted state evolution of a D-AMP algorithm.
    denoise.m: Denoises an incoming signal.  Which denoiser is used depends on the string "denoiser".  Currently supports Gaussian filtering, bilateral filtering, NLM, BLS-GSM, BM3D, and BM3D-SAPCA.  Add your own denoising algorithms here.

auxiliary functions:
    phi_fp.m: Projects a length n signal to m measurements using a Gaussian random matrix. Can handle very large measurement matrices but is very slow.
    phit_fp.m: Projects a length m signal onto the transpose of an mxn Gaussian measurement matrix. Can handle very large measurement matrices but is very slow.
    psi_fp.m: Transforms wavelet coefficients into the pixel domain.
    psit_fp.m: Transforms pixels to their wavelet coefficients.
    PSNR.m: Computes the PSNR of an image x and its estimate x_hat.

Other files:
    OptimumLambdaSigned.mat: Look up table to set the threshold for AMP.
    TestImages: Images are from Javier Portilla's dataset: http://decsai.ugr.es/~javier/denoise/test_images/index.htm

Packages
---------------------------------------------------------------------------
This download includes the BM3D, BLS-GSM, NLM, and Rice Wavelet Toolbox packages.
The latest versions of these packages can be found at:
    BM3D: http://www.cs.tut.fi/~foi/GCF-BM3D/
    BLS-GSM: http://decsai.ugr.es/~javier/denoise/software/index.htm
    NLM: http://www.mathworks.com/matlabcentral/fileexchange/27395-fast-non-local-means-1d--2d-color-and-3d
    Rice Wavelet Toolbox (RWT): https://github.com/ricedsp/rwt

Installation
---------------------------------------------------------------------------
To install this package first setup your compiler with "mex -setup".
Next compile the NLM utilities by typing "mex image2vectors_double.c", "mex image2vectors_single.c", "mex vectors_nlmeans_double.c", and "mex vectors_nlmeans_single.c" from the Packages/NLM/ directory. 
Next compile the Rice Wavelet Toolbox (RWT) by entering "compile" from the Packages/rwt/bin/ directory. Currently the RWT does not compile under Windows 64 bit Matlab.
You will need Matlab's stat toolbox for qqplots.
Finally, for VAMP, make sure you have the latest version of the GAMPmatlab toolbox downloaded via the SVN interface (svn co svn://svn.code.sf.net/p/gampmatlab/code/ GAMPmatlab) and that you have GAMPmatlab/main and GAMPmatlab/VAMP on your path.


Example
---------------------------------------------------------------------------
Use BM3D-AMP to recover a signal a 128x128 image x_0 sampled according to y=M*x_0 where M is an m by n Gaussian measurement matrix with unit norm columns:
    x_hat=DAMP(y,30,128,128,'BM3D',M);
See CS_Imaging_Demo.m for other examples, including D-VAMP.


Modifying Code
---------------------------------------------------------------------------
Our code was designed to make it as easy as possible to test D-(V)AMP with a new denoiser.
To test another denoiser in the D-(V)AMP algorithm, simply add an additional case statement to denoise.m and place your denoising function there.  (Your denoiser will have access to the noisy signal as well as an estimate of the standard deviation of the noise).
Next change the "denoiser" argument in any calls to DAMP, DVAMP, DprGAMP, DIT, DAMP_oneIter, etc., to the name used in your case statement. e.g: x_hat=DAMP(y,30,128,128,'mydenoiser',M);

Issues
---------------------------------------------------------------------------
The latest version of the Rice Wavelet Toolbox (RWT) does not compile under Windows 64 bit Matlab. Older versions of the RWT often crash. 
At this point in time functions and scripts which use the RWT (CS_1D_Demo and the BLS-GSM denoiser) must be run on a Unix machine.  BM3D-AMP and other D-AMP algorithms work with Windows and Unix.

About

This packages contains the code to run the BM3D, BM3D-SAPCA, BLS-GSM, and NLM variants of the D-AMP, D-VAMP, and D-prGAMP algorithms.

License:Other


Languages

Language:MATLAB 64.9%Language:C 19.0%Language:HTML 12.2%Language:Python 3.5%Language:CMake 0.4%Language:M 0.0%