Image Processing Toolbox™ and Neural Network Toolbox™ provide many options to remove noise from images. The simplest and fastest solution is to use a pretrained denoising neural network. However, the pretrained network does not offer much flexibility in the type of noise recognized. For more flexibility, train your own network using predefined layers, or train a fully custom denoising neural network.
Image Processing Toolbox includes a pretrained denoising neural network that enables you to remove Gaussian noise without the challenges of training a network.Removing noise with the pretrained network has these limitations:
Noise removal works only with 2-D single-channel images. If you have multiple color channels, or if you are working with 3-D images, remove noise by treating each channel or plane separately. For an example, see Remove Noise from Color Image Using Pretrained Neural Network.
The network recognizes only Gaussian noise, with a limited range of variance.
You can train a network to recognize and remove Gaussian noise from grayscale images, starting with predefined layers provided by Image Processing Toolbox. This workflow offers limited additional flexibility from using the pretrained denoising network:
You can specify the range of Gaussian noise variance recognized by the network.
You can provide your own training images. This capability is useful when your images have different visual features than the natural images used to train the pretrained denoising neural network.
To train a denoising network using predefined layers, first get the layers using
dnCNNLayers function. Create your own set of noisy training images
denoisingImageSource function. You can specify your own datastore of
grayscale images, the range of Gaussian noise variance, and other properties of the
image source. Then, pass the layers, denoising image source, and training options to
trainNetwork function. The diagram
depicts the training workflow in the dark gray box.
After you have trained the network, pass the network and a noisy grayscale image
denoiseImage. This step is identical to the process of removing
noise using the pretrained network. The light gray box in the diagram depicts this
To train a denoising neural network with maximum flexibility, you can use the full capabilities provided by Neural Network Toolbox. For example, you can:
Train a network that detects a larger variety of noise, such as non-Gaussian noise distributions, combinations of multiple noise sources, or correlated noise across image channels.
Provide your own training images, including RGB, multichannel, or
multidimensional images. You can specify the images in many formats
denoisingImageSource, such as an
Define custom convolutional neural network architecture.
Modify training options.
Fine-tune a network using transfer learning.
To train a custom denoising network, provide training images, layers, and training
options to the
trainNetwork function. After you train
a custom denoising network, you can use the
function to remove image noise.