Skip to content

:octocat::octocat:A tensorflow implement of the paper "Beyond a Gaussian Denoiser: Residual Learning of Deep CNN for Image Denoising"

License

Notifications You must be signed in to change notification settings

AlgnersYJW/DnCNN-tensorflow

 
 

Repository files navigation

DnCNN-tensorflow

AUR Docker Automated build Contributions welcome

A tensorflow implement of the TIP2017 paper Beyond a Gaussian Denoiser: Residual Learning of Deep CNN for Image Denoising

Model Architecture

graph

Results

compare

  • BSD68 Average Result

The average PSNR(dB) results of different methods on the BSD68 dataset.

Noise Level BM3D WNNM EPLL MLP CSF TNRD DnCNN-S DnCNN-B DnCNN-tensorflow
25 28.57 28.83 28.68 28.96 28.74 28.92 29.23 29.16 29.17
  • Set12 Average Result
Noise Level DnCNN-S DnCNN-tensorflow
25 30.44 30.38

For the dataset and denoised images, please download here

Environment

🐳 With docker (recommended):

  • Install docker support

You may do it like this(ubuntu):

$ sudo apt-get install -y curl
$ curl -sSL https://get.docker.com/ | sh
$ sudo usermod -aG docker ${USER}
  • Install nvidia-docker support(to make your GPU available to docker containers)

You may do it like this(ubuntu):

$ wget -P /tmp https://github.com/NVIDIA/nvidia-docker/releases/download/v1.0.1/nvidia-docker_1.0.1-1_amd64.deb
$ sudo dpkg -i /tmp/nvidia-docker*.deb && rm /tmp/nvidia-docker*.deb
  • Pull dncnn image and start a container
$ docker pull wenbodut/dncnn
$ ./rundocker.sh

Then you could train the model.

Without docker:

You should make sure the following environment is contented

tensorflow == 1.4.1
numpy

One-Key-To-Denoise

$ ./oneKeyToDenoise.sh
(need docker support)

Then you could find the noisy Set12 images and denoised images in test folder. Have fun!

Train

$ python generate_patches.py
$ python main.py
(note: You can add command line arguments according to the source code, for example
    $ python main.py --batch_size 64 )

For the provided model, it took about 4 hours in GTX 1080TI.

Here is my training loss:

Note: This loss figure isn't suitable for this trained model any more, but I don't want to update the figure 🌚

loss

Test

$ python main.py --phase test

TODO

  • Fix bug #13. (bug #13 fixed, thanks to @sdlpkxd)
  • Clean source code. For instance, merge similar functions(e.g., 'load_images 'and 'load_image' in utils.py).
  • Add one-key denoising, with the help of docker.
  • Compare with original DnCNN.
  • Replace tf.nn with tf.layer.
  • Replace PIL with OpenCV.
  • Try tf.dataset API to speed up training process.
  • Train a noise level blind model.

Thanks for their contributions

  • @lizhiyuanUSTC
  • @husqin
  • @sdlpkxd
  • and so on ...

About

:octocat::octocat:A tensorflow implement of the paper "Beyond a Gaussian Denoiser: Residual Learning of Deep CNN for Image Denoising"

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 97.9%
  • Shell 1.1%
  • Dockerfile 1.0%