CosmoStat / ShapeDeconv

Repo for Machine Learning-based deconvolution
MIT License
7 stars 1 forks source link

Analyse Shape Constraint Outputs #16

Closed fadinammour closed 3 years ago

fadinammour commented 3 years ago
fadinammour commented 3 years ago

The optimal value of gamma is 2 after testing the values in [0.1 0.5 1 2 10] in this notebook.

However when measuring the ellipticity error, we notice that it decreases when the magnitude increase. The magnitude plot has the opposite behavior than the SNR plot. Which means that the ellipticity error behavior is counter intuitive.

Screenshot 2021-02-24 at 15 15 42

Note : Adapative moments are measured using a window (see section 2.1 of Hirata & Seljak 2003) so this measure is biased and this could be the reason why its error behavior is not correlated with the ellipticity one.

Test to better understand the ellipticity error behavior:

fadinammour commented 3 years ago

By replacing the mean by the median in the plots this notebook. The general trend remains the same which means that it is most likely not caused by outliers. median_ell_err2 median_ell_err

fadinammour commented 3 years ago

After checking the galaxy images per bin at the end of this notebook, two effects has been noticed that seem to explain the behavior of the ellipticity error curve. The first effect is having elongated galaxies having reconstruction that are more punctual as seen in the example below. This is probably due to the prevalence of smaller galaxies in the dataset distribution. smaller_example The second effect is having smaller objects for lower magnitudes and also having observation that contain mostly noise. This seems to lead the network to guess a galaxy which would most likely have a punctual shape that corresponds to the target most of the time, like in the example below: almost_pure_noise

fadinammour commented 3 years ago

When the trade-off parameter of the shape constraint, γ, is set to 2. The reconstruction of elongated galaxies seem to be more successful in comparison to the absence of constraint, see example below: gamma2_image And behavior of the ellipticity error for this value decreases when the magnitude increases which corresponds better to the expected behavior. gamma2_e1 gamma2_e2

fadinammour commented 3 years ago

The unwindowed ellipticity measurement on the Unet reconstructions contain a considerable proportion of outliers which values are outside [-1, 1]. This is due to the residual noise in the reconstructions. Even though the intensity of the residual noise in the reconstruction is very low (see plot below), it is still enough to drastically deteriorate the unwindowed ellipticity measure. image

This leads us to only consider the windowed shape measurement.

For further details, the problem was investigated in: https://github.com/CosmoStat/ShapeDeconv/blob/master/notebooks/UNET_Evaluation/unet_window_investigation.ipynb