A comprehensive suite of image denoising techniques, from classical statistical methods to state-of-the-art deep learning models. This repository provides implementations and comparisons of Principal Component Analysis (PCA), Non-negative Matrix Factorization (NMF), Singular Value Decomposition (SVD), Spectral Decomposition, Convolutional Neural Networks (CNN), and a Generative Adversarial Denoising Autoencoder (GAN-DAE).
Image denoising is a fundamental problem in computer vision and image processing. This project serves as both a practical toolkit and an educational resource for understanding and comparing various denoising methodologies across traditional and modern approaches.
- Classical Methods: Implementation of foundational techniques including PCA, NMF, SVD, and Spectral Decomposition
- Deep Learning: Custom Convolutional Neural Network designed for effective noise reduction
- State-of-the-Art: Sophisticated Generative Adversarial Network-based Denoising Autoencoder for high-fidelity reconstruction
- Comprehensive Evaluation: Built-in PSNR metrics and visual comparison tools
- Modular Design: Extensible codebase for easy experimentation with new techniques
- Interactive Notebooks: Jupyter notebooks for each method with detailed explanations
- Python 3.6+
- Git
- pip
- virtualenv
-
Clone the repository
git clone https://github.com/your-username/ml-image-denoising.git cd ml-image-denoising
-
Set up environment
chmod +x install.sh ./install.sh
This creates a virtual environment and installs all necessary dependencies.
-
Activate the virtual environment
source bin/activate # On Windows: Scripts\activate
This project uses the CelebA dataset:
-
Download the dataset
- Download
img_align_celeba.zip
from the CelebA project website - Extract to the parent directory:
../img_align_celeba/
- Download
-
Process the data
python dataprocessing.py
This script crops images to the required size and converts them to efficient HDF5 format.
Launch Jupyter to explore the different denoising methods:
jupyter notebook
adversarial_autoencoder_denoising.ipynb
- GAN-based denoising autoencodercnn_denoising.ipynb
- Convolutional Neural Network approachpca_denoising.ipynb
- Principal Component Analysis methodnmf_denoising.ipynb
- Non-negative Matrix Factorization technique
# Load and preprocess data
from helper import cmp_images_psnr
import numpy as np
# Compare denoising methods
psnr_score = cmp_images_psnr(clean_images, denoised_images, num_samples)
print(f"PSNR: {psnr_score:.2f} dB")
ml-image-denoising/
βββ adversarial_autoencoder_denoising.ipynb # GAN-DAE implementation
βββ cnn_denoising.ipynb # CNN-based denoising
βββ pca_denoising.ipynb # PCA method
βββ nmf_denoising.ipynb # NMF technique
βββ dataprocessing.py # Data preprocessing script
βββ helper.py # Utility functions (PSNR, etc.)
βββ install.sh # Environment setup script
βββ requirements.txt # Python dependencies
βββ lib/ # Core library modules
βββ activations.py # Activation functions
βββ updates.py # Optimization algorithms
βββ ops.py # Neural network operations
βββ metrics.py # Evaluation metrics
βββ ...
Method | Description | Notebook |
---|---|---|
PCA | Dimensionality reduction via principal components | pca_denoising.ipynb |
NMF | Non-negative matrix factorization | nmf_denoising.ipynb |
SVD | Singular value decomposition | pca_denoising.ipynb |
Interpolation | Bilinear and bicubic upsampling | pca_denoising.ipynb |
Method | Description | Notebook |
---|---|---|
CNN | Custom convolutional neural network | cnn_denoising.ipynb |
GAN-DAE | Generative adversarial denoising autoencoder | adversarial_autoencoder_denoising.ipynb |
Typical PSNR improvements on CelebA dataset:
- Bilinear Interpolation: ~25.5 dB
- Bicubic Interpolation: ~26.2 dB
- CNN Denoising: ~28-30 dB
- GAN-DAE: ~30-35 dB
Results may vary based on noise levels and training parameters.
Key parameters can be modified in the notebook cells:
# Training configuration
batch_size = 128
learning_rate = 0.0002
num_epochs = 200
l2_regularization = 1e-5
The GAN-DAE uses an encoder-decoder architecture:
- Encoder: Progressively downsamples from 128Γ128 to 8Γ8
- Decoder: Reconstructs high-resolution output
- Discriminator: Ensures realistic image generation
Theano==0.7.0
Pillow>=3.0.0
numpy>=1.10.2
h5py>=2.5.0
tqdm>=3.4.0
ipython>=4.0.0
See requirements.txt
for complete dependency list.
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- Implementation of additional denoising algorithms
- Performance optimizations
- Better evaluation metrics
- Documentation improvements
- Bug fixes and code quality improvements
This project is licensed under the MIT License - see the LICENSE file for details.
- CelebA Dataset for providing the facial image dataset
- Theano deep learning framework
- Original DCGAN implementation inspiration
- The open-source community for various utility functions
For questions, suggestions, or collaboration opportunities:
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Deep Image Prior
- DnCNN: Beyond a Gaussian Denoiser
- Noise2Noise: Learning Image Restoration without Clean Data
β Star this repository if you find it helpful!