Noise Reduction with AI
Autor: | Moye Nyuysoni Glein Perry |
Art: | Project Work |
Starttermin: | 14.11.2024 |
Abgabetermin: | 31.03.2025 |
Betreuer: | Prof. Dr.-Ing. Schneider |
Abstract
Noise reduction is crucial in image processing to enhance the performance of subsequent computer vision tasks. In this project, we integrate a pretrained DnCNN (Denoising Convolutional Neural Network) to perform noise reduction using artificial intelligence. The system enables users to select an image, optionally inject Gaussian noise if needed, and apply AI-based denoising techniques. Results are then visually compared and automatically saved. This article explains the implementation details in MATLAB, outlines the methodology, and discusses potential improvements.
Introduction
Noise reduction is a core topic in digital signal processing (DSP) where the goal is to enhance the quality of signals (e.g., audio, images, video) that have been corrupted by noise. Traditional DSP methods use filters like low-pass, median, or Wiener filters for noise attenuation. However, these methods often exhibit limitations in preserving crucial signal details.
Recent advances in artificial intelligence (AI), particularly deep learning, provide several approaches for denoising tasks. In this project, a pretrained DnCNN network is used to reduce noise in grayscale images. By treating the image as a two-dimensional signal, the process of noise reduction using AI is directly comparable to classical denoising techniques in DSP, yet it offers a higher degree of feature preservation and flexibility.
Required Toolboxes and Environment
To run the noise reduction tool, ensure that your MATLAB environment includes the following toolboxes:
MATLAB (R2021a or later is recommended for compatibility with newer functions.)
Image Processing Toolbox Provides functions such as imread, im2gray, montage, and imwrite for image reading, conversion, visualization, and saving.
Deep Learning Toolbox Contains the necessary functionality for loading and utilizing deep neural networks. In this project, functions like denoisingNetwork and denoiseImage are part of this toolbox.
Traditional vs. AI-Based Noise Reduction
Traditional Methods:
Common DSP techniques for noise reduction include Fourier transform-based filtering, where noise is separated in the frequency domain, and spatial filters, such as the Gaussian and median filters. These methods aim to remove noise but may also inadvertently remove important signal features.
AI-Based Methods:
AI and deep learning methods for denoising, such as the DnCNN, learn to distinguish between noise and signal features through training on large datasets. This approach can maintain the integrity of critical features while effectively reducing noise—a significant advancement in the signal enhancement field.
Methodology
The denoising process in our project consists of the following key components:
Loading the Pretrained DnCNN Network:
The tool starts by loading the pretrained DnCNN model available in MATLAB, which has been trained on large image datasets for the noise reduction task.
User Interaction for Image Selection:
The user selects an image file, which is then treated as a 2-D signal. Conversion to grayscale simplifies the signal for processing, analogous to reducing a multi-channel signal to one for analysis.
Image Preprocessing:
The input image is converted to grayscale, a common preprocessing step that simplifies denoising while still being representative of the image intensity variations.
Noise Injection (Optional):
If the image is not already noisy, synthetic Gaussian noise is added with controlled variance to simulate a noisy environment.
Denoising Execution:
The noisy image is passed to the DnCNN network using a designated function (denoiseImage), which outputs a denoised version of the image.
Visualization and Output:
The original, noisy, and denoised images are displayed side-by-side using a montage for visual comparison. The denoised image is then saved for further use.
Detailed Code Explanation
The following sections explain key parts of the MATLAB code used in this project:
Loading the Pretrained Network
net = denoisingNetwork("DnCNN");
Explanation: This command initializes the DnCNN network from MATLAB’s built-in library. The network is pretrained, meaning it has learned to reduce noise from a wide range of images without additional training.
Reference: See the MATLAB documentation for the DnCNN denoising network at MathWorks.
3.2 User Interaction for Image Selection
[file, path] = uigetfile({'*.jpg;*.png;*.bmp','Image Files (*.jpg, *.png, *.bmp)'}, 'Select an Image'); ... imgPath = fullfile(path, file);
Explanation: The uigetfile function opens a GUI dialog, allowing the user to select an image file. The file path is then constructed for reading the image.
3.3 Image Preprocessing
I = imread(imgPath); Igray = im2gray(I);
Explanation: The image is read from the disk and converted to grayscale using im2gray(), which simplifies the subsequent noise reduction process by reducing data dimensions.
3.4 Optional Noise Injection
choice = questdlg('Is the selected image already noisy?', 'Noise Check', ' Yes','No','Yes'); switch choice case 'Yes' noisyI = Igray; case 'No' noisyI = imnoise(Igray, 'gaussian', 0, 0.01);
... Explanation: A dialog box asks whether the image is already noisy. If not, Gaussian noise is added using imnoise(), simulating a realistic noisy condition with a specified variance.
Denoising the Image
denoisedI = denoiseImage(noisyI, net);
Explanation: The noisy image is fed into the pretrained DnCNN network through the denoiseImage function. This function applies the denoising algorithm learned by the network and outputs a cleaned version of the image.
Visualization and Saving of Results
montage({Igray, noisyI, denoisedI}, 'Size', [1 3]); title("Original (Left), Noisy (Center), Denoised (Right)"); imwrite(denoisedI, fullfile(path, [name '_denoised.png']));
Explanation: The montage function is used to display the original, noisy, and denoised images side-by-side. Finally, the denoised image is saved to the disk with a modified filename to indicate the denoising process.
Experimental Evaluation and Discussion
Performance Assessment
Visual Quality: The denoised output is visually compared to the original and noisy images. Improvements in clarity and reduction of noise are assessed qualitatively using side-by-side comparisons.
Quantitative Metrics: Metrics such as Peak Signal-to-Noise Ratio (PSNR) and Structural Similarity Index (SSIM) could be computed (if desired) to provide a quantitative evaluation of the noise reduction performance.
Discussion
Strengths: The approach demonstrates the effectiveness of AI-based denoising using a pretrained DnCNN model, providing an easily deployable tool that does not require additional training. It preserves image details while effectively reducing noise.
Limitations: The performance is dependent on the noise characteristics of the input image. For more diverse or higher noise levels, additional model fine-tuning or alternative architectures might be necessary.
Future Work:
Future improvements could include the integration of quantitative metrics for automated evaluation, supporting color images, and incorporating other noise types (e.g., impulse noise).
References
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.
MATLAB Documentation – DnCNN and denoisingNetwork. Available at: MathWorks DnCNN Documentation.
Buades, A., Coll, B., & Morel, J. M. (2005). A non-local algorithm for image denoising. IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR).
Conclusion
In this project, an AI-based noise reduction tool utilizing a pretrained DnCNN model in MATLAB was implemented and evaluated. The system provides an interactive method for users to reduce noise in grayscale images, with results presented via comparative visualization and automatic saving. This method leverages cutting-edge deep learning approaches for effective noise reduction while remaining user-friendly and computationally efficient. Future work will focus on extending this approach to a broader range of noise types and incorporating quantitative performance metrics.
→ zurück zum Hauptartikel: Signalverarbeitung mit MATLAB und Künstlicher_Intelligenz