Skip to content

newfla/CUDA-K-SVD-Denoising

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

K-SVD CUDA implementation for Image Denoising

The algorithm uses Orthogonal Matching Pursuit (OMP) for sparsecoding and kSVD for dictionary learning.

The code uses the thrust library to simplify the vectors' management on the device, the cuSolver library to implement the SVD and cuBlas for implementing OMP

90% of K-SVD computation runs on GPU

Dependencies

  • Cmake >= 3.0
  • CUDA >= 10.1
  • CImg
  • ImageMagick

Tested on Ubuntu 16.04

Build

cd src  
mkdir build
cd build   
cmake ..    
make     

Setup data

"inputFolder" : "absolute path to images ",
    
"outputFolder" : "absolute path where processed images will be saved",
    
"globalParams" : { //for input files
    "patchWidthDim" : 12, //patch side dimension
    "patchHeightDim" : 12,  //other patch side dimension
    "slidingWidth" : 3, //sliding between patches x-axis
    "slidingHeight" : 3, //sliding between patches y-axis
    "atoms" : 256, //number of dicitonary elements 
    "ksvditer" : 10, //Ksvd iterations
    "ompIter": 5, //OMP phase limit
    "B&W" : true, //gray scale images
    "speckle" : false, //don't use log/exp transform
    "type": "CUDA_K_GESVDJ", //SVD decomposition alghorithm check denoisingLib.h for further details
},
    
"files": [
    {"name" : "barbara.png", //input image file 
     "ref" : "barbaraRef.png", //no noise image file useful for PSNR
     "patchWidthDim": 22 //override globalPatchWidthDim
    }
]

Run

cd src/build
./denoising config.json
In config.json if outputFolder is the same as inputFolder original images will be overwritten

Results

Noise Image Recovered Image
image image
image image
image image

Activity Diagram

Overview Diagram

Class Diagram

History

  • Version 0.1 : First alpha

  • Version 0.2 : Improved performance and removed memory leaks

  • Version 0.3 : Improved performance and accuracy. Sigma is no more required. Added support to rectangular patches

  • Version 0.4 : Faster than CPU version

  • Version 0.5 : Fixed Speckle noise support

  • Version 0.6 : Improved API

  • Version 1.0 : General BugFix & improvements. First public version

Issues

  • I'm sure there are but for now I can't find them

Credits