scieee AI-readable full text Open interactive document viewer

Denoising wavefront sensor image with deep neural networks

Pou Mulet, Bartomeu,Quiñones Moreno, Eduardo,Gratadour, Damien,Martín Muñoz, Mario

Abstract

A classical closed-loop adaptive optics system with a Shack-Hartmann wavefront sensor (WFS) relies on a center of gravity approach to process the WFS information and an integrator with gain to produce the commands to a Deformable Mirror (DM) to compensate wavefront perturbations. In this kind of systems, noise in the WFS images can propagate to errors in centroids computation, and thus, lead the AO system to perform poorly in closed-loop operations. In this work, we present a deep supervised learning method to denoise the WFS images based on convolutional denoising autoencoders. Our method is able to denoise the images up to a high noise level and improve the integrator performance almost to the level of a noise-free situation.

Full text

Denoising wavefront sensor images with deep neural networks Pou B.a,b, Qui˜nones E.a, Gratadour D.c, d, and Martin M.b aBarcelona Supercomputing Center, Nexus II Building, C. Jordi Girona, 29, 08034, Barcelona, Spain bPolytechnic University of Catalonia, C. Jordi Girona, 31, 08034, Barcelona, Spain cResearch School of Astronomy and Astrophysics, Australian National University, Canberra, ACT 2611, Australia dLESIA, Observatoire de Paris, Universite PSL, CNRS, Sorbonne Universite, Univ. Paris Diderot, Sorbonne Paris Cite, 5 place Jules Janssen, 92195 Meudon, France ABSTRACT A classical closed-loop adaptive optics system with a Shack-Hartmann wavefront sensor (WFS) relies on a center of gravity approach to process the WFS information and an integrator with gain to produce the commands to a Deformable Mirror (DM) to compensate wavefront perturbations. In this kind of systems, noise in the WFS images can propagate to errors in centroids computation, and thus, lead the AO system to perform poorly in closed-loop operations. In this work, we present a deep supervised learning method to denoise the WFS images based on convolutional denoising autoencoders. Our method is able to denoise the images up to a high noise level and improve the integrator performance almost to the level of a noise-free situation. Keywords: Autoencoder, Machine Learning in AO, Noise 1. INTRODUCTION Adaptive Optics (AO) refers to the suite of methods that try to correct refraction-based disturbances inducing perturbations in the image quality at the output of a telescope. AO systems are usually composed of a set of wavefront sensors (WFS), a set of deformable mirrors (DM) and a real time controller (RTC) that issues the commands to the DM to compensate these perturbations. Closed-loop AO systems are set up so that the WFS observes the guide source after being corrected by the DM. At each iteration the RTC attempts to correct the residual error leading to a feedback loop situation. Classical closed-loop control methods with a Shack-Hartmann (SH) WFS rely on the center of gravity approach to process each SH-WFS subaperture information. A measurements vector is obtained out of this process and is transformed, through linear reconstruction, into wavefront errors which are used to feed an integrator to produce commands to the DM. In this case, adapting the integrator gain can help to reduce the effect of reconstruction errors induced e.g. by noise in the WFS images. However, such approach has its limits as, since lowering the gain reduces the AO system bandwidth, thus leading to limited turbulence compensation performance. In this work, we propose to use current deep learning techniques to preprocess WFS images for denoising purposes. For that, we propose an architecture similar to the denoising autoencoder1which learns a map from noisy input to noise-free output. The proposed architecture will consist of convolutional layers together with maxpool operations (current state-of-the-art in image processing tasks since the breakthrough of Alexnet2) as in the original work with the convolutional autoencoder.3While the initial work on the denoising autoencoder and convolutional autoencoder consisted on learning more robust representations in the hidden layers and use those as a initialisation point for other networks in tasks such as image classification, it can be applied for denoising purposes. Similar methods based on denoising/convolutional autoencoders has been used in various noise reduction proposals such as medical image noise reduction4or speech reconstruction from noise corrupted data.5 Further author information: (Send correspondence to Pou B.) Pou B.: E-mail: bartomeu.poum[email protected] Pou, B. [et al.]. Denoising wavefront sensor image with deep neural networks. A: SPIE Astronomical Telescopes + Instrumentation. "Adaptive Optics Systems VII: SPIE Astronomical Telescopes + Instrumentation: 14-18 December 2020". Washington: International Society for Photo- Optical Instrumentation Engineers (SPIE), 2020, p. 1-8. Copyright 2020 Society of Photo Optical Instrumentation Engineers. One print or electronic copy may be made for personal use only. Systematic electronic or print reproduction and distribution, duplication of any material in this paper for a fee or for commercial purposes, or modification of the content of the paper are prohibited. http://dx.doi.org/10.1117/12.2576242. The proposed approach differs from other existing ways to address noise beyond the integrator mentioned above, such as Kalman filters6or more efficient ways to compute the measurement vector such as selecting brightest pixels7,8in the fact that its purpose is to provide an almost noise-free version of the WFS data, at each iteration, which can then be processed using any kind of reduction and reconstruction methods. It is a universal tool that can, in theory, be applied to any AO system configuration (e.g. Laser guide stars, multiple WFS or pyramid WFS) without significant redesign. In section 2we explain the basics of the center of gravity method, the integrator with gain and the problems of noise in the measurements, in section 3we explain how we have built the denoising autoencoder, in section 4we explain the different experiments and present the corresponding results and finally in section 5we discuss the results and propose future work. 2. CENTER OF GRAVITY, INTEGRATOR WITH GAIN AND NOISE In this work, we focus on a system composed of a SH-WFS with a single DM. The SH-WFS lenslet array splits the incoming wavefront into different subapertures. The intensity distribution in each subaperture provides information on the local state of the wavefront. A common way to interpret the intensity distribution in each subaperture is via computing the center of gravity, CoG = (Sx, Sy) of the corresponding spot and comparing it to a reference position (e.g. the optical axis of the corresponding lenslet). On a 2D subaperture, in which a pair of (x, y) coordinates can be attached to each pixel with an intensity I(x, y), the CoG is calculated as: Sx=PxPyI(x, y)x PxPyI(x, y);Sy=PyPxI(x, y)y PxPyI(x, y)(1) Once processed for each subaperture a vector of size (2 xnumber of valid subapertures) is produced, called the measurements vector, m. The measurements vector is used as the input of a linear reconstructor to calculate the wavefront error vector, c, with c=Rm , (2) where R is the command matrix, usually obtained from the so-called interaction matrix through the least squares method; and cis a representation of the wavefront error projected on a basis (e.g. a set of Zernike modes or more practically the DM actuators influence functions). At iteration k, once the desired errors, ck, have been obtained for the current measurements the result is fed to an integrator integrator: Ck=Ck−1−gck,(3) where gis the gain, a scalar value used to weight the contribution of the newly computed errors in the next commands to be applied on the DM, and Ck−1are the commands from the previous iteration. The performance of this classical approach can be affected by to various sources of error. In this work, we have decided to tackle errors produced by to presence of noise. Noise in the SH-WFS subapertures can be present in two forms: shot noise from the photons detection process which follows a Poisson distribution and detector readout noise which usually follows a stationary Gaussian distribution. As the magnitude (M) of the guide star (GS) used by the SH-WFS gets higher, the number of photons decrease and the signal to noise ratio is reduced leading to an increased CoG estimation errors which then propagates onto wavefront reconstruction errors. To solve this issue we propose to use a denoising process based on deep neural networks in the following section. 3. DENOISING AUTOENCODER As mentioned in the introduction, the original denoising autoencoder1proposal was to learn more robust autoencoder latent representations by corrupting inputs with noise. Once learned, the representations were used as an initialisation point for feedforward neural networks in classification tasks. In this work, we propose to use a denoising autoencoder architecture to learn a map from noisy WFS input to noise-free WFS output and frame it as Supervised Learning problem. This can be achieved in a purely simulated setting, since the WFS images can be obtained both with and without noise. In a more operational setting, one could use the calibration unit on the AO bench to train the autoencoder in a similar fashion, by tuning the brightness of the calibration source to reproduce various observational scenario. Our model will consist of stacked hidden layers one after another to create what is called a deep or stacked autoencoder. Moreover, the autoencoder will use the effective, so-called, convolutional neural networks (CNN), similarly as used in the convolutional autoencoder work3for the encoding and decoding process. The stacked convolutional denoising autoencoder architecture can be seen in figure 1. For simplicity purposes, we will use the term autoencoder to describe the model in the remaining parts of the paper. The autoencoder will take as input a noisy image of a single WFS subaperture and will output a noise-corrected subaperture image. In the case of a real life implementation, this process will be repeated for each subaperture to denoise the full WFS image. Figure 1: Stacked convolutional denoising autoencoder architecture for WFS Image denoising. The input will consist of a single subaperture image with shape (1,16,16). Each layer of the autoencoder will have a different output shape that is represented below its graphic representation. The final output will be the noise-corrected subaperture with the same shape as the original input. Convolutional layers and max-pooling operations will encode the image and transpose convolutions will upscale the image to its original size. The activation functions will be linear rectified units,9which avoid the vanishing gradient problem, except on the final layer, where no activation function will be used. The optimisation process will use ADAM10 which uses the concept of momentum to adapt the learning rates to speed up the process. Finally, the loss function will be the mean squared error (MSE) between the output of the autoencoder and noise-free WFS subaperture image as: L(θ) = 1 N N X i=1 (fθ(xi)−GTi)2,(4) where GT is the ground truth, i.e. noise-free subaperture images, fθis the learned function by the autoencoder with weights θ,xiis the input noisy subaperture image and N is the number of elements the metric is used to compute the loss for. In other autoencoder applications, binary cross entropy (BCE) loss function is used, but it expects the output to be between 0 and 1 which is not our case. One could argue the use normalisation to set the image values between 0 and 1 and be able to use BCE as a loss function, but, as the number of photons seen by the WFS has no limit, we have decided not to use normalisation as an unexpected high value outside of the training set range would not be correctly interpreted by the network. For reproducibility purposes we have added additional parameter information in table 1. Deep learning framework Pytorch11 Adam lr 0.001 Batch size 128 Layer Conv Maxpool Conv Maxpool Conv ConvTr. ConvTr. ConvTr. Kernel size 3 2 3 2 3 4 4 3 Stride 1 2 1 2 1 2 2 1 Padding 1 0 1 0 1 1 1 1 Table 1: Additional autoencoder parameters. 4. EXPERIMENTS 4.1 Data generation The dataset will be generated using COMPASS,12 an end-to-end AO simulation tool. COMPASS allows the user to generate experiments with different atmospheric conditions and telescope configurations. In COMPASS, the noise levels can vary from n=−1 (no noise) to n= 0 (only photon noise) and n > 0 (increasing values of readout noise + photon noise). We select experiments where we have high noise, n= 3, and where the magnitude, M(9 and 9.2), of the WFS guide star is high enough so that the noise impact is considerable due to the low amount of available photons. We have conducted most experiments on a telescope with diameter of 2 meters (D= 2 m) with 10x10 subapertures but also tested on a D= 8 m 40x40 subapertures in order to confirm that this method can be extrapolated to telescopes of different sizes. Finally, to test the autoencoder’s robustness to different atmospheric conditions, we have tested the method on different values of Fried parameter, r0. The remaining simulation parameters are defined in table 2. While the atmospheric turbulence is simulated using a single layer at the ground level, we do not expect these results to be impacted by a more structured turbulence profile. Atmospheric parameters Telescope Parameters L0(m) 105λtarget (µm) 1.65 r0(m) 0.08/0.16/0.24 @ 0.5 µm Wind speed (m/s) 20 WFS parameters Wind direction (°) 45 Number of subapertures 10x10/40x40 AO loop parameters Number of valid subapertures 64/1200 Loop frequency (Hz) 500 Pixels per subaperture 16 Delay 0/2 Pixel size (arcsec) 0.25 DM parameters λwfs (µm) 0.5 Mirrors Pzt and TT GS Magnitude 9/9.2 Coupling (pzt) 0.2 Read Out Noise (e- RMS) 3 Table 2: Simulation parameters. Symbol ”/” indicates that different values for that parameter are used. To generate the training dataset, we set the delay in the AO loop to 0, however, for performance testing we will use both delay 0 and 2. This 0 delay brings us closer to a real operational scenario where the autoencoder would be trained on the AO bench using the calibration unit and internally generated turbulence (e.g. with the DM itself). Moreover, when generating data or testing performance, every configuration will have an optimised gain for the integrator via testing different gain values in a 10000 frame simulation and selecting the best performance in terms of long exposure (L.E.) Strehl Ratio (SR). Once the gain is optimised, the dataset consisting of pairs of (noisy images, noise-free images) is generated by recording the images of two WFS, one with no noise (n=−1) and another with noise (n= 3). As the system dimensioning (i.e. number of subapertures) is different for the D= 2mand D= 8mcases, we have obtained the dataset with a different number of frames for each: •For D= 2mwe run ten simulations with different seeds for 1000 frames and in this case the WFS has 64 valid subapertures the dataset size ends up as (6.4·105,16,16). •For D= 8mwe run one simulation for 1000 frames and as the WFS has 1200 valid subapertures in this case, the dataset size ends up as (1.2·106,16,16). Finally, we separate both datasets into training and validation sets with a random 80/20 split. The validation loss will be computed at every epoch (one full pass to the whole training dataset) and if it does not decrease after 10 epochs the training will be stopped. 4.2 Results 4.2.1 Reconstruction The training and validation losses for all the experiments can be seen in figure 2. As explained in Sec. 4.1, the validation loss is the metric to stop training. Overall the denoising autoencoder appears to learn the denoising function between 30 and 40 epochs for all experiments. Figure 2: Training and validation losses for all experiments. The experiment ends when the validation loss does not decrease for 10 consecutive epochs. Given the trained autoencoder we can observe the learned denoising procedure by reconstructing noisy samples. Reconstruction results can be found in 3,4,5,6,7for each experiment respectively. Overall it appears that the reconstruction is able to filter out most of the noise with a final result very close to the noise-free ground truth in all the cases, without introducing any artefact in the image. Figure 3: D= 2m10x10 subapertures GS M= 9 r0= 0.08 reconstruction example. Figure 4: D= 2m10x10 subapertures GS M= 9 r0= 0.16 reconstruction example. Figure 5: D= 2m10x10 subapertures GS M= 9 r0= 0.24 reconstruction example. Figure 6: D= 2m10x10 subapertures GS M= 9.2r0= 0.16 reconstruction example. Figure 7: D= 8m40x40 subapertures GS M= 9 r0= 0.16 reconstruction example. Finally, to have a more general metric on how our method is improving the image quality for calculating centroids, we have computed the mean squared error (MSE) between the centroids of the autoencoder processed images and the GT as well as between the centroids of the original image and GT over all validation dataset. The results are shown in table 3. Experiment Centroid MSE(Ac, Gt) Centroid MSE(Original, Gt) r0= 0.08 m 0.0039 0.0697 r0= 0.16 m 0.0014 0.0683 r0= 0.24 m 0.0008 0.0675 M= 9.2 0.0019 0.3035 D= 8 m 0.0013 0.0687 Table 3: Mean squared error in arcsec for both autoencoder processed and original image with the ground truth on the evaluation set. As seen in the table 3, the autoencoder is able to reduce the error by at least an order of magnitude. In the most complicated problem, M= 9.2, the MSE is reduced by two orders of magnitude indicating that the autoencoder works even for regimes where the noise is fairly high. 4.2.2 Denoising on closed-loop simulation To check if the denoising autoencoder can help to improve the performance of AO controllers we plugged it into the closed-loop system simulation. After the WFS produces the image, the denoising autoencoder will output a noise filtered image which is then fed to the centroider module that computes the centroids in an almost noise-free setting. Before capturing the final results in terms of AO performance, the gain values have been reoptimised with the integrator + autoencoder approach. The autoencoder + integrator (Int. + Ac. (n=3)) has been tested with 5 different seed experiments of 2000 frames each. It has been compared against integrator with noise (Int. n=3) and integrator without noise (Int. n=-1). Finally, we have added another controller which is the integrator with the same gain as the autoencoder + integrator (Int. g* n=3) to show that the increase in performance is not only due to the change in the gain parameter. The performance has been be compared in terms of long exposure Strehl Ratio (L.E. SR). The results can be found in table 4. Controller SR (r0= 0.08) SR (r0= 0.16) SR (r0= 0.24) SR (M= 9.2) SR (D= 8m) Int. + Ac. (n=3) 0.765 ±0.0068 0.914 ±0.0037 0.953 ±0.0022 0.911 ±0.003 0.912 ±0.002 Int. (n=3) 0.542 ±0.0864 0.756 ±0.0037 0.800 ±0.0308 0.420 ±0.2096 0.707 ±0.0140 Int. g* (n=3) 0.383 ±0.0246 0.559 ±0.0059 0.582 ±0.0017 0.168 ±0.1159 0.533 ±0.0085 Int. (n=-1) 0.809 ±0.0031 0.932 ±0.0029 0.964 ±0.0062 0.932 ±0.0031 0.931 ±0.0017 Table 4: L.E. SR for different simulations with delay 0. These results indicate that the autoencoder + integrator controller seem to operate in an almost a noise-free setting as the result are very close to those obtained with the integrator without noise. Moreover, as shown by Int. g* (n=3) the use of denoising allows one to increase the integrator gain without amplifying noise which leads to better AO rejection bandwidth. Comparing the different r0indicates that this method is robust to different atmospheric conditions. The same can be said for D= 8m. Finally, even in a situation where the noise decreases the performance even further, M = 9.2, the autoencoder is able to remove enough noise so that the performance increases by more than double. While the results for delay 0 appear to be encouraging this is not a realistic situation as there is always a delay in the AO loop. To see if the autoencoder, trained with data with zero delay, can solve the same problem in a more realistic setting with a delay of 2 frames, we have computed the same test (5 simulation of 2000 frames) with delay=2. The results can be found in table 5. Controller SR (r0= 0.08) SR (r0= 0.16) SR (r0= 0.24) SR (M= 9.2) SR (D= 8m) Int. + Ac. (n=3) 0.524 ±0.0062 0.805 ±0.0039 0.892 ±0.0022 0.801 ±0.0034 0.788 ±0.0034 Int. (n=3) 0.338 ±0.0595 0.637 ±0.0055 0.741 ±0.0049 0.359 ±0.1761 0.558 ±0.0138 Int. g* (n=3) 0.206 ±0.0312 0.374 ±0.0130 0.410 ±0.0045 0.139 ±0.0642 0.342 ±0.0093 Int. (n=-1) 0.599 ±0.0058 0.846 ±0.0031 0.917 ±0.0020 0.846 ±0.0031 0.835 ±0.0034 Table 5: L.E. SR for different simulations with delay 2. Again, the results indicate that the integrator + autoencoder appears to solve the problem with noise in the WFS even if we set the delay to 2 frames and even if the autoencoder is trained with zero delay. This clearly opens the way to a real world implementation, in which the autoencoder could be trained on the bench during daytime, and using the calibration unit to reproduce various simulated noise conditions, and then applied on-sky. 5. DISCUSSION AND FUTURE WORK We have shown how a deep learning method, a stacked convolutional denoising autoencoder, by training on pairs of (noise, noise-free) image data, is able to learn a denoising function on different atmospheric conditions, guide star magnitudes and telescope diameters. Moreover, plugging this learned function into a COMPASS closed-loop simulation appears to improve the integrator with gain with different delay values. Regarding possible future work, to implement this method in a real world system, as it usually operates on frequencies of around 500 Hz, one problem can be that it extends the delay between receiving a WFS image and issuing a command. To solve that neural network knowledge distillation,13 the process to transfer learned functions to smaller networks, could help. A way to speed up inference, given the limited memory footprint of such method, would be to implement such denoising method directly in the framegrabber, if the latter is based on a reprogrammable FPGA device. Other possible future work could be to compare this method against other denoising methods such as Kalman filters or brightest pixel selection. Finally, an implementation in a controlled real life setting could bring light if this method is worth exploring more. ACKNOWLEDGMENTS We would like to thank F. Ferreira for his help with COMPASS simulator. REFERENCES [1] Vincent, P., Larochelle, H., Bengio, Y., and Manzagol, P.-A., “Extracting and composing robust features with denoising autoencoders,” in [Proceedings of the 25th international conference on Machine learning], 1096–1103 (2008). [2] Krizhevsky, A., Sutskever, I., and Hinton, G. E., “Imagenet classification with deep convolutional neural networks,” Communications of the ACM 60(6), 84–90 (2017). [3] Masci, J., Meier, U., Cire¸san, D., and Schmidhuber, J., “Stacked convolutional auto-encoders for hierarchical feature extraction,” in [International conference on artificial neural networks], 52–59, Springer (2011). [4] Gondara, L., “Medical image denoising using convolutional denoising autoencoders,” in [2016 IEEE 16th International Conference on Data Mining Workshops (ICDMW)], 241–246, IEEE (2016). [5] Lu, X., Tsao, Y., Matsuda, S., and Hori, C., “Speech enhancement based on deep denoising autoencoder.,” in [Interspeech], 2013, 436–440 (2013). [6] Paschall, R. N. and Anderson, D. J., “Linear quadratic gaussian control of a deformable mirror adaptive optics system with time-delayed measurements,” Applied optics 32(31), 6347–6358 (1993). [7] Thomas, S., “Optimized centroid computing in a shack-hartmann sensor,” in [Advancements in Adaptive Optics], 5490, 1238–1246, International Society for Optics and Photonics (2004). [8] Basden, A., Myers, R., and Gendron, E., “Wavefront sensing with a brightest pixel selection algorithm,” Monthly Notices of the Royal Astronomical Society 419(2), 1628–1636 (2012). [9] Nair, V. and Hinton, G. E., “Rectified linear units improve restricted boltzmann machines,” in [ICML], (2010). [10] Kingma, D. P. and Ba, J., “Adam: A method for stochastic optimization,” arXiv preprint arXiv:1412.6980 (2014). [11] Paszke, A., Gross, S., Chintala, S., Chanan, G., Yang, E., DeVito, Z., Lin, Z., Desmaison, A., Antiga, L., and Lerer, A., “Automatic differentiation in pytorch,” in [NIPS-W], (2017). [12] Ferreira, F., Gratadour, D., Sevin, A., Doucet, N., Vidal, F., Deo, V., and Gendron, E., “Real-time end-to- end ao simulations at elt scale on multiple gpus with the compass platform,” in [Adaptive Optics Systems VI], 10703, 1070347, International Society for Optics and Photonics (2018). [13] Hinton, G., Vinyals, O., and Dean, J., “Distilling the knowledge in a neural network,” arXiv preprint arXiv:1503.02531 (2015).