/denoising

Research to replace the Wavelet approach in the denoising task of the MCCD method by a Machine Learning solution

Primary LanguageJupyter Notebook

Deep denoising for the MCCD PSF model

Research aimed at integrating Deep Learning denoising into PSF modelling packages.


Main contributors: Aziz Ayed - Tobias Liaudat
Email: aziz.ayed@hec.edu - tobias.liaudat@cea.fr
Documentation:
Article: ... Current release: 06/07/2021


The motivation behind Point Spread Function modelling is to build a model to correct telescopes' observations. We use some stars observations as samples of the PSF field to infer the PSF at galaxy positions.
However, Point Spread Function modelling usually does not include a denoising step, as this often induces some bias in shape reconstruction. In fact, in the weak lensing regime, we would rather have noisy but errorless shapewise reconstructions than noiseless reconstructions with some error in shape measurement, no matter how small.
In this repository, we record our research aimed at introducing Deep denoising into the non-parametric MCCD PSF modelling (paper) with the goal of increasing the precision of the algorithm without introducing error in shape reconstruction.

Our version of the MCCD algorithm with the integrated neural networks can be found here.

  1. Packages Used

  2. Datasets

  3. Models

  4. Results

Packages Used

Optimization problem

The optimization problem we try to tackle through the MCCD algorithm can be written as follows:

optimization_equation

The first sum represents the data fidelity term. The first indicator function is a positivity constraint. The rest of the indicator functions over the sigma sets are spatial constraint terms to ensure the smoothness of the PSF model over the field of view.
The two remaining sums represent Starlets (Wavelets) transforms and can be seen as proximal operators in the optimization algorithms we use. Thus, our research aimed to replace these with neural networks to ensure better denoising results while maintaining good shape reconstruction.

Datasets

We started by training our algorithm with simulated stars catalogs created with the GalSim package. For the sake of storage space, we did not upload our datasets in this repository, but the code used to generate them can be found in the dataset generation notebook.
Stars are parametrized by 2 ellipticity components e1 e2 and one size component R2.
The datasets used can thus be reproduced using the notebook above and the parameters catalogs specified in the Issues section of this repository, for each step of the project.
To generate our datasets, we preprocess clean simulated images with Gaussian noise. Thus, we produced a study of CFIS data to estimate the real-life noise levels - expressed in terms of Signal to Noise ratio - than can be found in the SNR study folder.

However, the MCCD algorithm operates on eigenPSFs and not simple stars, which led us to designing a more complex training dataset. Our methodology and notebooks are respectively detailled in the dedicated README and the datasets folder.

star_vs_eigenpsf

Models

For our project, we decided to work with two types of neural networks. Both models are implemented in TensorFlow and the code can be found in the unets and learnlets folders. The trained models with best performances when implemented in the MCCD algorithm can be found in the best models folder.

U-Nets

U-Nets are Deep Neural Networks widely used in vision tasks, and are considered to be state-of-the-art when it comes to image denoising. Primarly designed for Biomedical Image Segmentation, they have an architecture that consists of a contracting path to capture context and a symmetric expanding path that enables precise localization, giving it its characteristical U shape (paper).
Throughout the project, we worked with different architectures that are detailled in the Issues section of this repository, and the final network is composed of 16 base filters, and the training is done in the unets_training.ipynb notebook.

star_vs_eigenpsf

Learnlets

Learnlets are based on a network architecture that conserves the properties of sparsity based methods such as exact reconstruction and good generalization properties, while fostering the power of neural networks for learning and fast calculation (paper).
Our idea is to leverage the properties of sparsity based methods to ensure solid shape reconstruction and reduce the mismeasurement introduced by our denoising algorithm.
Throughout the project, we worked with different architectures that are detailled in the Issues section of this repository, and the final network is composed of 256 filters. We started with a simple version of the Learnlets that can be found in the learnlets_original_training.ipynb notebook. However, our final network uses dynamic thresholding with an estimation of the noise level of the image as an input, which can be found in the learnlets_dynamic_training.ipynb notebook.

Results

The progressive results of the standalone denoising at each step of our project can be found in the Issues section of this repository.
The following table presents the final results of the different methods trained on the complex dataset (60% of eigenPSFs and 40% of simulated stars) when integrated into MCCD.

More detailled results can be found in the dedicated folder and README.
Some complementary results are also presented in the Issues section of our fork of MCCD.