├── images ├── im1.PNG ├── table.PNG ├── dncnres.PNG ├── dnnarc.PNG ├── redres.PNG ├── simres.PNG └── rednet30_arc.PNG └── README.md /images/im1.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anushkayadav/Denoising_cifar10/HEAD/images/im1.PNG -------------------------------------------------------------------------------- /images/table.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anushkayadav/Denoising_cifar10/HEAD/images/table.PNG -------------------------------------------------------------------------------- /images/dncnres.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anushkayadav/Denoising_cifar10/HEAD/images/dncnres.PNG -------------------------------------------------------------------------------- /images/dnnarc.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anushkayadav/Denoising_cifar10/HEAD/images/dnnarc.PNG -------------------------------------------------------------------------------- /images/redres.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anushkayadav/Denoising_cifar10/HEAD/images/redres.PNG -------------------------------------------------------------------------------- /images/simres.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anushkayadav/Denoising_cifar10/HEAD/images/simres.PNG -------------------------------------------------------------------------------- /images/rednet30_arc.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anushkayadav/Denoising_cifar10/HEAD/images/rednet30_arc.PNG -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Implementation of Denoising Algorithms on CIFAR-10 Dataset 2 | 3 | - Applied Various Unsupervised Machine Learning algorithms on ciar-10 data to denoise the images. 4 | - Focused on CNN based approaches which do unsupervised pre-training and can learn good representations via reconstruction 5 | - To prevent the auto-encoders from merely copying inputs during training, denoising auto-encoders were proposed to learn representations from corrupted data 6 | 7 |

8 | Framework Used : 9 | 10 |

11 | 12 | ## Algorithms Used : 13 | There are broadly two types of deep learning algorithms which may be used for denoising : 14 | 15 | - Discriminative Learning-Based using CNNs 16 | - Generative Learning-Based using GANs 17 | 18 | For the denoising problem of known noise like **Gaussian noise**, using **CNNs based approaches** it is possible to form paired training data and leverage these methods to achieve state-of-the-art performance. They could fully exploit the great capability of the network architecture to learn from data, which breaks through the limitations of prior based methods and further improves the performance whereas **GANs** are used where there are more **complex real noises** and dataset is small.[[1]](#1) 19 | 20 | Since, in our experiment we used **simple Gaussian noise** and CIFAR-10 dataset has **considerable amount of data**(60000 examples), I preferred to use Discriminative Learning-Based such as: 21 | 1. Simple Denoising Autoencoders (DAE)[Reference Paper](https://www.researchgate.net/publication/330382260_Image_Denoising_with_Color_Scheme_by_Using_Autoencoders)[[2]](#2) 22 | 2. Convolutional Auto-encoders with Symmetric Skip Connections[Reference Paper](https://arxiv.org/pdf/1611.09119.pdf)[[3]](#3) 23 | 3. Feed-forward denoising convolutional neural networks (DnCNNs)[Reference Paper](https://arxiv.org/pdf/1608.03981.pdf)[[4]](#4) 24 | 25 | ## Dataset and Noise 26 | The dataset used comprises of 60000 color pictures in 10 classes with 6000 picture per class. 27 | Dimension of each image is 32 x 32. 28 | 29 | I have introduced External Noise i.e. **Pixel-level Gaussian noise** to all the input images which would be fed into our models. 30 | 31 | We add Gaussian noise matrix on both training and testing with noise factor 0.1 and clip images between 0 and 1. 32 | ``` 33 | noisy_imgs = images + noise_factor * torch.randn(*images.shape) 34 | noisy_imgs = np.clip(noisy_imgs, 0., 1.) 35 | ``` 36 | ![im1.png](/images/im1.PNG) 37 | ## Simple Denoising Autoencoder (DAE) 38 | 39 | ### **MODEL ARCHITECTURE** 40 | - Encoder : 3x3 convolutional layers and downsamping done using 2x2 maxpooling layers 41 | - Decoder : Upsampling done and layers are symmetric to the encoder. 42 | 43 | Each convolutional/deconvolutional layer is followed by a **ReLU** non-linearity layer 44 | 45 | ``` 46 | ConvDenoiser( 47 | (conv1): Conv2d(3, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1)) 48 | (conv2): Conv2d(32, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1)) 49 | (pool): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False) 50 | (t_conv1): ConvTranspose2d(32, 32, kernel_size=(2, 2), stride=(2, 2)) 51 | (t_conv2): ConvTranspose2d(32, 32, kernel_size=(2, 2), stride=(2, 2)) 52 | (convout): Conv2d(32, 3, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1)) 53 | ) 54 | ``` 55 | **Hyperparameters** : 56 | Batch Size = 20 **.** 57 | no. of epochs = 40 **.** 58 | Learning rate =0.001 **.** 59 | 60 | ### **RESULTS** 61 | ![simres.png](/images/simres.PNG) 62 | 63 | ### **EVALUATION** 64 | On Test data of 10000 examples: 65 | - Average **PSNR**:24.830 66 | - Average **SSIM**: 0.868 67 | 68 | ## Convolutional Auto-encoders with Symmetric Skip Connections 69 | 70 | ### **MODEL ARCHITECTURE** 71 | - Encoder : 3x3 convolutional layers and downsamping done using stride of 2 instead of pooling, which can be harmful to image restoration tasks 72 | - Decoder : Upsampling done and layers are symmetric to the encoder. 73 | - The corresponding encoder and decoder layers are connected by **shortcut connections**. 74 | - Each convolutional/deconvolutional layer is followed by a **Batch Normalization** layer and a 75 | **ReLU non-linearity** layer 76 | - Number of encoder/decoder layers : 15 77 |

78 | 79 | 80 | **Hyperparameters** : 81 | Batch Size = 32 **.** 82 | no. of epochs = 40 **.** 83 | Learning rate =0.001 **.** 84 | 85 | ### **RESULTS** 86 | ![simres.png](/images/redres.PNG) 87 | 88 | ### **EVALUATION** 89 | On Test data of 10000 examples: 90 | - Average PSNR:28.254 91 | - Average SSIM: 0.938 92 | 93 | ## Feed-forward denoising convolutional neural networks (DnCNNs) 94 | ### **MODEL ARCHITECTURE** 95 | - VGG modeified network 96 | - Integration of Residual Learning and Batch Normalization 97 | - Size of convolutional filters to be 3 × 3 but remove all pooling layers. 98 | 3 Types of layers used : 99 | 1. **Conv+ReLU** : generate feature maps 100 | 2. **Conv+BN+ReLU** : batch normalization incorporated to speed up training as well as boost the denoising performance 101 | 3. **Conv** : To reconstruct the output 102 |

103 | 104 | **Hyperparameters** : 105 | Batch Size = 32 **.** 106 | no. of epochs = 40 **.** 107 | Learning rate =0.001 **.** 108 | 109 | ### **RESULTS** 110 | ![simres.png](/images/dncnres.PNG) 111 | 112 | ### **EVALUATION** 113 | On Test data of 10000 examples: 114 | - Average PSNR:28.992 115 | - Average SSIM: 0.947 116 | ## Conclusion 117 | **SSIM** (Structural Similarity Image Metric), which estimates the degradation of structural similarity based on the statistical properties of local information between a reference and a distorted image.It combines three local similarity measures based on luminance, contrast, and structure. 118 | 119 | **PSNR**, the term peak signal-to-noise ratio is an expression for the ratio between the maximum possible value (power) of a signal and the power of distorting noise that affects the quality of its representation 120 | The main limitation of this metric is that it relies strictly on numeric comparison and does not actually take into account any level of biological factors of the human vision system such as the structural similarity index. (SSIM) 121 |

122 | 123 | 124 | ## References 125 | - [[1] J. Chen, J. Chen, H. Chao and M. Yang, "Image Blind Denoising with Generative Adversarial Network Based Noise Modeling," 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, 2018, pp. 3155-3164, doi: 10.1109/CVPR.2018.00333.](https://ieeexplore.ieee.org/document/8578431) 126 | 127 | - [[2] Ali, Irfan & Lashari, Haque & Hassan, Syed & Maitlo, Abdullah & Qureshi, Basit. (2018). Image Denoising with Color Scheme by Using Autoencoders. 18. 158-161.](https://www.researchgate.net/publication/330382260_Image_Denoising_with_Color_Scheme_by_Using_Autoencoders) 128 | 129 | - [[3] Mao, Xiaojiao, Chunhua Shen, and Yu-Bin Yang. "Image restoration using very deep convolutional encoder-decoder networks with symmetric skip connections." Advances in neural information processing systems. 2016.](http://papers.nips.cc/paper/6172-image-restoration-using-very-deep-convolutional-encoder-decoder-networks-with-symmetric-skip-connections) 130 | 131 | - [[4] Zhang, K., Zuo, W., Chen, Y., Meng, D., & Zhang, L. (2017). Beyond a gaussian denoiser: Residual learning of deep cnn for image denoising. IEEE Transactions on Image Processing, 26(7), 3142-3155.](https://ieeexplore.ieee.org/abstract/document/7839189) 132 | 133 | ## Other References 134 | 135 | - [Fan, L., Zhang, F., Fan, H. et al. Brief review of image denoising techniques. Vis. Comput. Ind. Biomed. Art 2, 7 (2019). https://doi.org/10.1186/s42492-019-0016-7](https://link.springer.com/article/10.1186/s42492-019-0016-7) 136 | - [Gu, Shuhang, and Radu Timofte. "A brief review of image denoising algorithms and beyond." Inpainting and Denoising Challenges. Springer, Cham, 2019. 1-21.](https://link.springer.com/chapter/10.1007/978-3-030-25614-2_1) 137 | 138 | 139 | 140 | 141 | 142 | 143 | --------------------------------------------------------------------------------