Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Train and Apply Denoising Neural Networks

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.

Denoise Images Using Pretrained 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.

To use a pretrained denoising network, first get the network using the denoisingNetwork function. Then, pass the network and a noisy 2-D single-channel image to denoiseImage.

Train a Denoising Network Using Predefined Layers

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 the dnCNNLayers function. Create your own set of noisy training images using the 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 the 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 to denoiseImage. This step is identical to the process of removing noise using the pretrained network. The light gray box in the diagram depicts this step.

Train Fully Customized Denoising Neural Network

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 besides a denoisingImageSource, such as an imageDatastore or augmentedImageSource.

  • 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 predict function to remove image noise.

Related Topics

Was this topic helpful?