Machine Learning for automatic pointing alignment and spatial beam filtering

. Constraint Bayesian optimization approach is used to optimize the beam pointing and spatial filtering of a laser beam using the capillary transmission and the output beam profile, as the optimization criteria. We have demonstrated that the developed method was able to robustly find the optimal laser parameters and it will be implemented in the SwissFEL UV photocathode laser in the future


Motivation
The performance of SwissFEL at Paul Scherrer Institute is very sensitive to the beam profile and pointing stability of the photocathode laser.High-energy femtosecond deep UV laser damages optics in the beam path and the beam becomes non-Gaussian in spatial profile, which can be improved by Fourier filtering [1].The filtering properties are strongly dependent on the incoming beam pointing and the focal position, creating a five-dimensional parameter space for alignment, which currently needs to be manually adjusted.

Setup
We implemented a data-driven optimization in order to robustly find the optimal operation point within a few minutes.This machine-learning method, using Bayesian optimization [2] in a Python framework [3], was characterized on a laboratory setup utilizing a heliumneon laser, and a capillary spatial filter, as shown in Fig 1 .In this setup, the beam pointing direction and angle to the spatial filter are controlled by utilizing two motorized mirror mounts equipped with stepper motors and encoders.The beam position and the angle to the spatial filter are evaluated by running a Gaussian fit of the beam profile images provided by Cameras 1 and 2. Due to the high beam quality of the helium-neon laser, a broken ND filter was placed in the beam path, in order to create a degraded beam profile.The performance of the spatial filtering method is evaluated in terms of a combination of the transmission through the spatial filter, the beam asymmetry, and the deviation of the filtered profile from an ideal 2D-gaussian beam.The method was tested using a large dataset consisting of output beam profiles for various stepper motor positions of the motorized mirror 2.

Results
The results of running the Bayesian Optimizationalgorithm on the recorded dataset are shown in Figures 2  and 3. Figure 2 illustrates the progress of the algorithm as it navigates the motorized mirror mount and converges towards the optimum.In Figure 3 the measured and the predicted output values are plotted as a function of the iterations.In this example, the weight on the transmission was set to 90 % and the weight on the aspect ratio was set to 10 %.The algorithm can easily deal with different number of parameters, and therefore allows for fast adjusting of the filter performance by using only two parameters (the beam focus position, motorized mirror 2 x/y actuators).We demonstrated that Bayesian Optimization is capable of solving a multidimensional optimization problem in optical setups with a minimal number of iterations only.Due to the adaptive nature of the Bayesian optimization, it does not rely on the input beam profiles and thus easily handles beam profiles, which arise from degraded UV optics.
As the next step, we intend to implement the Python code into the SwissFEL control system and test the optimization method on the photocathode laser, where the adaptive capabilities of our method will be fully exploited.This approach can easily be extended to numerous similar applications, including pump beam pointing stabilization, fiber coupling temporal drift correction etc.

Fig. 1
Fig. 1 Layout of the test setup.

Fig. 2
Fig. 2 Results of running the optimization algorithm.The red dots represent the location of each sampled measurement on the plane of the spatial filter.

Fig. 3
Fig. 3 Results of running the optimization algorithm.The blue shaded area represents the uncertainty of the prediction.