# FFDNet
![visitors](https://visitor-badge.glitch.me/badge?page_id=cszn/FFDNet)
# [FFDNet: Toward a Fast and Flexible Solution for CNN based Image Denoising](https://arxiv.org/pdf/1710.04026.pdf)
# New training and testing codes ([PyTorch](https://github.com/cszn/KAIR)) - 18/12/2019
- [main_train_ffdnet.py](https://github.com/cszn/KAIR/blob/master/main_train_ffdnet.py)
- [main_test_ffdnet.py](https://github.com/cszn/KAIR/blob/master/main_test_ffdnet.py)
# Training and Testing Codes ([PyTorch](http://www.ipol.im/pub/pre/231/))
## [FFDNet-pytorch](http://www.ipol.im/pub/pre/231/)
### [An Analysis and Implementation of the FFDNet Image Denoising Method](http://www.ipol.im/pub/pre/231/)
# PixelUnshuffle layer (PyTorch)
``` python
from torch.nn import Module
def pixel_unshuffle(input, upscale_factor):
r"""Rearranges elements in a Tensor of shape :math:`(C, rH, rW)` to a
tensor of shape :math:`(*, r^2C, H, W)`.
written by: Zhaoyi Yan, https://github.com/Zhaoyi-Yan
and Kai Zhang, https://github.com/cszn/FFDNet
01/01/2019
"""
batch_size, channels, in_height, in_width = input.size()
out_height = in_height // upscale_factor
out_width = in_width // upscale_factor
input_view = input.contiguous().view(
batch_size, channels, out_height, upscale_factor,
out_width, upscale_factor)
channels *= upscale_factor ** 2
unshuffle_out = input_view.permute(0, 1, 3, 5, 2, 4).contiguous()
return unshuffle_out.view(batch_size, channels, out_height, out_width)
class PixelUnShuffle(Module):
r"""Rearranges elements in a Tensor of shape :math:`(C, rH, rW)` to a
tensor of shape :math:`(*, r^2C, H, W)`.
written by: Zhaoyi Yan, https://github.com/Zhaoyi-Yan
and Kai Zhang, https://github.com/cszn/FFDNet
01/01/2019
"""
def __init__(self, upscale_factor):
super(PixelUnShuffle, self).__init__()
self.upscale_factor = upscale_factor
def forward(self, input):
return pixel_unshuffle(input, self.upscale_factor)
def extra_repr(self):
return 'upscale_factor={}'.format(self.upscale_factor)
```
# Abstract
Due to the fast inference and good performance, discriminative learning methods have been widely studied in image denoising. However, these methods mostly learn a specific model for each noise level, and require multiple models for denoising images with different noise levels. They also lack flexibility to deal with spatially variant noise, limiting their applications in practical denoising.
To address these issues, we present a fast and flexible denoising convolutional neural network, namely FFDNet, with a tunable noise level map as the input.
The proposed FFDNet works on downsampled subimages,achieving a good trade-off between inference speed and
denoising performance. In contrast to the existing discriminative denoisers, FFDNet enjoys several desirable properties, including
- the ability to handle a wide range of noise levels (i.e., [0, 75]) effectively with a single network,
- the ability to remove spatially variant noise by specifying a non-uniform noise level map, and
- faster speed than benchmark BM3D even on CPU without sacrificing denoising performance.
Extensive experiments on synthetic and real noisy images are conducted to evaluate FFDNet in comparison with state-of-the-art denoisers. The results show that FFDNet is effective and efficient, making it highly attractive for practical denoising applications.
# Network Architecture
![architecture](https://github.com/cszn/FFDNet/blob/master/figs/ffdnet.png)
The input image is reshaped to four sub-images, which are then input to the CNN together with a noise level map. The final output is reconstructed by the four denoised sub-images
# Test FFDNet Models
- [Demo_AWGN_Gray.m](Demo_AWGN_Gray.m) is the testing demo of FFDNet for denoising grayscale images corrupted by AWGN.
- [Demo_AWGN_Color.m](Demo_AWGN_Color.m) is the testing demo of FFDNet for denoising color images corrupted by AWGN.
- [Demo_AWGN_Gray_Clip.m](Demo_AWGN_Gray_Clip.m) is the testing demo of FFDNet for denoising grayscale images corrupted by AWGN with clipping setting.
- [Demo_AWGN_Color_Clip.m](Demo_AWGN_Color_Clip.m) is the testing demo of FFDNet for denoising color images corrupted by AWGN with clipping setting.
- [Demo_REAL_Gray.m](Demo_REAL_Gray.m) is the testing demo of FFDNet for denoising real noisy (grayscale) images.
- [Demo_REAL_Color.m](Demo_REAL_Color.m) is the testing demo of FFDNet for denoising real noisy (color) images.
- [Demo_multivariate_Gaussian_noise.m](Demo_multivariate_Gaussian_noise.m) is the testing demo of FFDNet for denoising noisy images corrupted by multivariate (3D) Gaussian noise model `N([0,0,0]; Sigma)` with zero mean and covariance matrix `Sigma` in the RGB color space.
# Results on Real Noisy Images from [The Darmstadt Noise Dataset](https://noise.visinf.tu-darmstadt.de/benchmark/#results_srgb)
## PSNR: 37.61dB
The left is the noisy image from [The Darmstadt Noise Dataset](https://noise.visinf.tu-darmstadt.de/benchmark/#results_srgb). The right is the denoised image by FFDNet+.
<img src="figs/0001_18.png" width="400px"/> <img src="figs/0001_18_ffdnet.png" width="400px"/>
<img src="figs/0033_05.png" width="400px"/> <img src="figs/0033_05_ffdnet.png" width="400px"/>
<img src="figs/0009_15.png" width="400px"/> <img src="figs/0009_15_ffdnet.png" width="400px"/>
<img src="figs/0037_12.png" width="400px"/> <img src="figs/0037_12_ffdnet.png" width="400px"/>
# Image Denoising for AWGN
Grayscale Image Denoising
<img src="figs/table1.png" width="500px"/>
Color Image Denoising
<img src="figs/table2.png" width="500px"/>
The left is the noisy image corrupted by AWGN with noise level 75. The right is the denoised image by FFDNet.
<img src="utilities/figs/102061_75_75.png" width="321px"/> <img src="utilities/figs/102061_75_75_PSNR_2698.png" width="321px"/>
# Real Image Denoising
The left is the real noisy image. The right is the denoised image by FFDNet.
<img src="utilities/figs/David_Hilbert.jpg" width="321px"/> <img src="utilities/figs/David_Hilbert_15.png" width="321px"/>
![example](https://github.com/cszn/FFDNet/blob/master/utilities/figs/Frog.gif)
# Extension
<img src="models/multivariate Gaussian noise .png" width="500px"/>
- [Demo_multivariate_Gaussian_noise.m](Demo_multivariate_Gaussian_noise.m) is the testing demo of FFDNet for denoising noisy images corrupted by multivariate (3D) Gaussian noise model `N([0,0,0]; Sigma)` with zero mean and covariance matrix `Sigma` in the RGB color space.
# Requirements and Dependencies
To run the code, you should install Matconvnet first.
Alternatively, you can use function [vl_ffdnet_matlab](utilities/vl_ffdnet_matlab.m) to perform denoising without Matconvnet.
- MATLAB R2015b
- [Cuda](https://developer.nvidia.com/cuda-toolkit-archive)-8.0 & [cuDNN](https://developer.nvidia.com/cudnn) v-5.1
- [MatConvNet](http://www.vlfeat.org/matconvnet/)
# Citation
```
@article{zhang2018ffdnet,
title={FFDNet: Toward a Fast and Flexible Solution for {CNN} based Image Denoising},
author={Zhang, Kai and Zuo, Wangmeng and Zhang, Lei},
journal={IEEE Transactions on Image Processing},
year={2018},
}
```
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
FFDNet-matlab.zip (347个子文件)
Frog.gif 1.23MB
David_Hilbert.jpg 38KB
Audrey_Hepburn.jpg 30KB
vl_simplenn.m 11KB
model_train.m 9KB
Cal_PSNRSSIM.m 6KB
Cal_PSNRSSIM.m 6KB
Demo_multivariate_Gaussian_noise.m 6KB
vl_simplenn.m 4KB
Demo_AWGN_Color_Clip.m 4KB
Demo_AWGN_Color.m 4KB
Demo_REAL_Color.m 4KB
Demo_AWGN_Gray.m 4KB
Demo_Test_FFDNet_gray.m 4KB
Demo_AWGN_Gray_Clip.m 4KB
vl_simplenn_tidy.m 4KB
Demo_AWGN_spatially_variant_noise.m 4KB
Demo_REAL_Gray.m 4KB
generatepatches.m 3KB
model_init_FFDNet_gray.m 3KB
vl_nnSubP.m 3KB
vl_nnSubP.m 3KB
Demo_Train_FFDNet_gray.m 3KB
vl_ffdnet_matlab.m 1KB
vl_ffdnet_matlab.m 1KB
vl_nnloss.m 1KB
vl_ffdnet_concise.m 1KB
vl_ffdnet_concise.m 1KB
vl_simplenn_mergebnorm.m 1018B
data_augmentation.m 769B
data_augmentation.m 613B
data_augmentation.m 613B
modcrop.m 279B
modcrop.m 279B
vl_randnm.m 271B
vl_randnm.m 271B
shave.m 110B
shave.m 110B
Merge_Bnorm_Demo.m 105B
FFDNet_3D_RGB.mat 3.23MB
FFDNet_color.mat 3.22MB
FFDNet_Clip_color.mat 3.22MB
model_color.mat 2.59MB
model_gray.mat 1.93MB
FFDNet_gray.mat 1.93MB
FFDNet_Clip_gray.mat 1.93MB
FFDNet_grayscale_retrained.mat 1.73MB
README.md 7KB
Postcards.png 940KB
Boy.png 932KB
Glass.png 790KB
Stars.png 732KB
0001_18.png 592KB
kodim13.png 560KB
0009_15.png 543KB
0033_05.png 525KB
kodim05.png 525KB
Pattern3.png 524KB
kodim01.png 505KB
kodim08.png 498KB
kodim18.png 487KB
kodim14.png 477KB
Flowers.png 463KB
Frog.png 448KB
Pattern1.png 447KB
102061_75_75.png 435KB
kodim21.png 431KB
kodim06.png 428KB
kodim24.png 427KB
kodim19.png 426KB
kodim22.png 426KB
kodim11.png 425KB
kodim17.png 423KB
kodim15.png 423KB
0037_12.png 400KB
kodim02.png 399KB
kodim04.png 396KB
Dog.png 394KB
175032.png 380KB
291000.png 376KB
kodim10.png 374KB
kodim09.png 374KB
kodim12.png 373KB
kodim23.png 370KB
kodim16.png 369KB
33039.png 364KB
kodim07.png 357KB
167083.png 344KB
Bears.png 344KB
108070.png 334KB
kodim03.png 334KB
229036.png 331KB
101085.png 331KB
148026.png 328KB
175043.png 323KB
236037.png 321KB
304034.png 319KB
304074.png 318KB
Window.png 318KB
148089.png 314KB
共 347 条
- 1
- 2
- 3
- 4
资源评论
- EMXlight5062024-01-24资源很不错,内容和描述一致,值得借鉴,赶紧学起来!
- m0_701792282024-04-05这个资源对我启发很大,受益匪浅,学到了很多,谢谢分享~
假技术po主
- 粉丝: 517
- 资源: 4323
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 数据库课程设计:长途汽车信息管理数据库设计
- 高分项目,基于Unity3D开发实现的2D游戏开发专用插件,内含完整源码+资源+unitypackage
- 高分项目,基于Unity3D开发实现的手指足球Finger Soccer Game,内含完整源码+资源+unitypackage
- 中草药识别项目-5类中药材识别数据集902张(当参、金银花、槐花、枸杞、百合).zip
- 基于Scratch在线教学平台设计与实现
- 高分项目,基于Unity3D开发实现的卡通赛车赛艇游戏,内含完整源码+资源+unitypackage
- M2M开发套件程序 2024-6-12
- の2(⊙o⊙)…2343214231423432
- 高分项目,基于Unity3D开发实现的二维游戏开发模板,内含完整源码+资源+unitypackage
- btstack协议栈实战篇-GATT Battery Service Client
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功