Use deep Convolutional Neural Networks (CNNs) with PyTorch, including investigating DnCNN and U-net architectures. More details in tutorial.ipynb
.
- DnCNN
Each convolution placed after k
pooling and l
unpooling in the network, should be replaced by a dilated filter with 2^(k−l) − 1 holes. This can be achieved with the dilation optional argument of nn.Conv2d
. Make sure set up the argument padding accordingly to maintain tensors with the same spatial dimension during the forward propagation.
Images from Berkeley Segmentation Dataset and Benchmark.
It contains two sub-directories: train
and test
, which consist of 200 and 100 images, respectively, of either size 321 × 481
or 481 × 321
. While we saw that thousand to millions of images were required for image classification, we can use a much smaller training set for image denoising. This is because denoising each pixel of an image can be seen as one regression problem. Hence, our training is in fact composed of 200 × 321 × 481
≈ 31 million samples.
- Pytorch version:
1.0.0
- CUDA version:
9.0.176
- Python version:
3.6.8
- CPU: Intel(R) Xeon(R) CPU E5-2630 v4 @ 2.20GHz
- GPU: GeForce GTX 1080 Ti (11172MB GRAM)
- RAM: 32GB
- Clone this repository
git clone https://github.com/lychengr3x/Image-Denoising-with-Deep-CNNs.git
- Download dataset
cd Image-Denoising-with-Deep-CNNs/dataset
wget https://www2.eecs.berkeley.edu/Research/Projects/CS/vision/bsds/BSDS300-images.tgz
tar xvzf BSDS300-images.tgz
rm BSDS300-images.tgz
- Train the model
cd ../src
python main.py
PS: Read argument.py
to see what parameters that you can change.
Please see demo.ipynb
for demonstration, and tutorial.ipynb
for tutorial.