This work was submitted under the Math Works Challenge Projects Program. This project implements Deep Image Prior in MATLAB. Image denoising, inpainting and super resolution problems have been solved using DIP in MATLAB.
Image denoising, inpainting and super resolution are some of the standard problems in digital image processing. Solutions to these problems have usually been obtained in two ways. One is hand crafting an image prior (e.g Total Variation (TV)) i.e manually defining what an image looks like so as to shrink the subset of possible image solutions from the infinite set of images that can be generated. The other is training a neural network on a large dataset of images so as to learn realistic image priors from data.
Deep Image Prior is a new approach to solving these problems which combines some components of the two outlined methods for obtaining solutions to these problems. With Deep Image Prior the neural network itself acts as an image prior. That is the information contained in the degraded image and the neural network is sufficient to obtain a solution with zero training data, zero validation and test data. There is no need to train the neural network.
Suppose we have the image degradation model:
Where
This can be done by formulating an objective optimization function which consists of a data fidelity term and a Regularization term
The data fidelity term measures how closely the estimated image
The regularization term is usually a mathematical model which rules out uncharacteristic images.
In Deep Image prior the CNN itself acts as an image prior, this is because CNNs offer a high impedance to noise. Low frequency structural components are fitted first then later high frequency components after many iterations. The CNN can easily be regularized through early stopping that is stopping the optimization process as high frequency components are about to be fitted.
The optimization problem for DIP is then formulated as such
where
We insert the random noise tensor
Denoising
For Denoising no spatial degradation occurs so
The problem is formulated as:
Noisy Image
Denoised Image through DIP
Inpainting
For inpainting
The problem is formulated as
In painted Image
Results after passing through DIP
Super Resolution
For super resolution
Low Resolution Image
Super Resolution Image
Download the folder 'Deep Image Prior Project', open the folder either in MATLAB online or MATLAB Desktop
For Denoising, open the .mlx file 'Denoising_Workflow1.mlx' and run the entire program. If you are interested just in the results run the first 2 sections of code using the 'Run Section' button. Scroll down to line 230 and run the last 2 sections of code.
For Inpainting, open the .mlx file 'Inpainting_Workflow.mlx' and run the entire program. If you are interested just in the results run the first 2 sections of code using the 'Run Section' button. Scroll down to line 196 and run the last 2 sections of code.
For Super Resolution, open the .mlx file 'SuperResolution_Workflow.mlx' and run the entire program. If you are interested just in the results run the first 2 sections of code using the 'Run Section' button. Scroll down to line 176 and run the last 2 sections of code