원시데이터 수집 시스템
선정목록으로

An adaptive approach to machine learning for compact particle accelerators

관련 수소연료전지 · (5) 연료전지용 수분제어장치(가습기)

기본 정보

저자
  1. Alexander Scheinker — Applied Electrodynamics Group, Los Alamos National Laboratory, Los Alamos, NM, 87545, USA
  2. Frederick Cropp — Department of Physics and Astronomy, University of California Los Angeles, Los Angeles, CA, 90095, USA
  3. Sergio Paiagua — Lawrence Berkeley National Laboratory, One Cyclotron Road, Berkeley, CA, 94720, USA
  4. D. Filippetto — Lawrence Berkeley National Laboratory, One Cyclotron Road, Berkeley, CA, 94720, USA
DOI
10.1038/s41598-021-98785-0
저널
Scientific Reports
발행년도
2021
발행기관
Nature Portfolio
피인용수
35
라이선스
cc-by
논문 유형
–
언어
–
원문 페이지
https://doi.org/10.1038/s41598-021-98785-0
토픽
Electron and X-Ray Spectroscopy Techniques
OpenAlex ID
W3201898136

평가 내용

관련도
관련
사업분야
수소연료전지 · (5) 연료전지용 수분제어장치(가습기)
부 분야
–
R&D 측면
–
확신도
–
근거 용어
–
판단 근거
임베딩 유사도 기반 평가로 '수소연료전지 > 연료전지용 수분제어장치(가습기)' 분야에 선정된 논문입니다.
R&D 활용 포인트
–
평가 입력
–

초록

Machine learning (ML) tools are able to learn relationships between the inputs and outputs of large complex systems directly from data. However, for time-varying systems, the predictive capabilities of ML tools degrade if the systems are no longer accurately represented by the data with which the ML models were trained. For complex systems, re-training is only possible if the changes are slow relative to the rate at which large numbers of new input-output training data can be non-invasively recorded. In this work, we present an approach to deep learning for time-varying systems that does not require re-training, but uses instead an adaptive feedback in the architecture of deep convolutional neural networks (CNN). The feedback is based only on available system output measurements and is applied in the encoded low-dimensional dense layers of the encoder-decoder CNNs. First, we develop an inverse model of a complex accelerator system to map output beam measurements to input beam distributions, while both the accelerator components and the unknown input beam distribution vary rapidly with time. We then demonstrate our method on experimental measurements of the input and output beam distributions of the HiRES ultra-fast electron diffraction (UED) beam line at Lawrence Berkeley National Laboratory, and showcase its ability for automatic tracking of the time varying photocathode quantum efficiency map. Our method can be successfully used to aid both physics and ML-based surrogate online models to provide non-invasive beam diagnostics.

본문 55,180자

본문 펼치기
## OPEN # An adaptive approach to machine learning for compact particle accelerators Alexander Scheinker <sup>1</sup> <sup>*</sup> , Frederick Cropp <sup>2,3</sup> , Sergio Paiagua <sup>3</sup> & Daniele Filippetto <sup>3</sup> Machine learning (ML) tools are able to learn relationships between the inputs and outputs of large complex systems directly from data. However, for time-varying systems, the predictive capabilities of ML tools degrade if the systems are no longer accurately represented by the data with which the ML models were trained. For complex systems, re-training is only possible if the changes are slow relative to the rate at which large numbers of new input-output training data can be non-invasively recorded. In this work, we present an approach to deep learning for time-varying systems that does not require re-training, but uses instead an adaptive feedback in the architecture of deep convolutional neural networks (CNN). The feedback is based only on available system output measurements and is applied in the encoded low-dimensional dense layers of the encoder-decoder CNNs. First, we develop an inverse model of a complex accelerator system to map output beam measurements to input beam distributions, while both the accelerator components and the unknown input beam distribution vary rapidly with time. We then demonstrate our method on experimental measurements of the input and output beam distributions of the HiRES ultra-fast electron diffraction (UED) beam line at Lawrence Berkeley National Laboratory, and showcase its ability for automatic tracking of the time varying photocathode quantum efficiency map. Our method can be successfully used to aid both physics and ML-based surrogate online models to provide non-invasive beam diagnostics. Machine learning (ML) methods, such as deep neural networks, can learn relationships between the components of and predict the outputs of complex physical systems such as phases of ­matter <sup>1</sup> and extreme events in complex ­systems <sup>2</sup> . Consider an n-dimensional complex physical system whose evolution is described by a system of dynamic equations <u>∂</u> <u>x</u> <u>(</u> <u>p</u>, t) = F ( x ( p, t), p ), (1) ∂t where x = (x1, . . ., xn) is a vector of physical quantities within the system such as atomic positions or energies, p = (p1, . . ., pm) is a vector of controlled system parameters such as voltages or chemical concentrations, and F represents the nonlinear dynamics governing the physical system which may include partial derivatives with respect to the components of both x and p . Associated with a system such as (1) there is usually some physicalmeaningful measurement, M x ( p, t), p, which depends on the parameter settings p and on the entire result meaningful measurement, M x ( p, t), p, which depends on the parameter settings p and on the entire result ing time-history of x ( p, t) . For example, such a measurement may be material properties such as strength of a � complex alloy or the results of a high energy physics experiment. There are cases where the system (1) is so large and complex that an accurate analytical representation of F is unknown. There are also cases in which an analytic physics-based model of F exists, but is so computationally expensive that it cannot be numerically simulated over large length and time scales and requires lengthy computations with high performance computing resources. In either of those two cases, ML methods can be useful for learning a representation of the system that quickly maps parameter settings to measurements. Tool such as recurrent neural networks can handle entire time-series trajectories and reinforcement learning approaches can model analytically unknown reward functions and their corresponding optimal controllers for analytically unknown systems. Such ML-based approaches can learn these representations directly from raw data, whether the data comes from measurements or simulations, by using large collections of input-output pairs, - x ( p, t), p 1Applied Electrodynamics Group, Los Alamos National Laboratory, Los Alamos, NM 87545, USA. 2Department of Physics and Astronomy, University of California Los Angeles, Los Angeles, CA 90095, USA. <sup>3</sup> Lawrence Berkeley National Laboratory, One Cyclotron Road, Berkeley, CA 94720, USA. <sup>*</sup> email: ascheink@lanl.gov �� D = ��Mi, p i��i=1,...,N <sup>,</sup> (2) i=1,...,N <sup>,</sup> to learn parameter to measurement maps ��Mi, p i p =⇒ M <sup>ˆ</sup> - w, b, p - ≈ M� x ( p, t)�, (3) - ≈ M - x ( p, t) �, - w, b, p where w, b are the weights and biases of the ML model whose values are found by minimizing the error between measurements and predictions based on data set _D_ as in (2). Once such maps are learned they can be used for applications such as fast searches over large parameter spaces, to extract correlations and physics from experimental data, and to guide the design of new systems. To give a few concrete examples, various ML methods have now been demonstrated for a wide range of systems such as molecular and materials science ­studies <sup>3</sup>, for use in optical communications and ­photonics <sup>4</sup>, to accurately predict battery ­life <sup>5</sup>, to accelerate lattice Monte Carlo simulations using neural ­networks <sup>6</sup>, for studying complex ­networks <sup>7</sup>, for characterizing surface microstructure of complex ­materials <sup>8</sup>, for chemical ­discovery <sup>9</sup>, for noninvasive identification of Hypotension using convolutional-deconvolutional ­networks <sup>10</sup>, for active matter analysis by using deep neural networks to track ­objects <sup>11</sup>, for imputation of missing physiological waveform data by using convolutional ­autoencoders <sup>12</sup>, for optimizing operational problems in ­hospitals <sup>13</sup>, for cardiovascular disease risk ­prediction <sup>14</sup>, for particle ­physics <sup>15</sup>, for antimicrobial ­studies <sup>16</sup>, for pattern recognition for optical microscopy images of metallurgical ­microstructures <sup>17</sup>, for learning Perovskit ­bandgaps <sup>18</sup>, for real-time mapping of electron backscatter diffraction (EBSD) patterns to crystal ­orientations <sup>19</sup>, for speeding up simulation-based accelerator optimization ­studies <sup>20</sup>, for Bayesian optimization of free electron lasers (FEL) <sup>21</sup>, for temporal power reconstruction of ­FELs <sup>22</sup>, for various applications at the Large Hadron Collider (LHC) at CERN including optics corrections and detecting faulty beam position ­monitors <sup>23–26</sup>, for reconstruction of a storage ring’s linear optics based on Bayesian ­inference <sup>27</sup>, to analyze beam position monitor placement in accelerators to find arrangements with the lowest probable predictive errors based on Bayesian Gaussian ­regression <sup>28</sup>, for temporal shaping of electron bunches in particle ­accelerators <sup>29</sup>, for stabilization of source properties in synchrotron light ­sources <sup>30</sup>, and to represent many-body interactions with restricted-Boltzmann-machine neural ­networks <sup>31</sup> . One challenge faced in applying ML methods to complex physical systems is if the systems have hidden time-varying characteristics which describe the parameter-to-physical system relationships. A simple example of a time-varying system is x˙ = x + ph(t)p, (4) where ph(t) is an unknown time-varying parameter and _p_ is an input parameter. By hidden parameters we mean parameters whose settings are not directly observable. Note that in this simple example (4) if there is no feedback ( p ≡ 0 ) the system is unstable and exponentially diverges. If the unknown time-varying function ph(t) repeatedly changes sign, such as ph(t) = cos(ω(t)t), (5) where the frequency of oscillation is itself also an uncertain time-varying system, it is a major challenge for data-based methods because the input _p_ to output _x_ ( _t_ ) relationship changes repeatedly in an unpredictable way, resulting in the smallest error for a large data set being an average approximation of ph(t) ≡ 0 . Such systems are also challenging for standard feedback controls such as proportional integral derivative (PID) feedback which must assume a known sign of ph(t) and fails spectacularly, destabilizing the system even more whenever ph(t) changes sign. Although many model-independent adaptive feedback control methods ­exist <sup>32</sup>, the problem of designing a stabilizing feedback controller for unknown time-varying systems with unknown control directions such as (4) with analytical proof of convergence was not accomplished until 2013 by utilizing nonlinear timevarying adaptive feedback and Lyapunov stability analysis ­methods <sup>33</sup> . Another form of hidden time-varying characteristics is when the initial conditions of a system are themselves time-varying, not easily measurable, and influence the dynamics of the system in a non-trivial way. In both of the above cases, if either the dynamics-to-parameters relationships or the initial conditions vary with time, then the accuracy of data-based predictions will start to degrade as the system changes to such an extent that it is no longer accurately represented by the data that was originally used to train the ML model. Although powerful ML methods such as domain transfer and re-training are available, for large quickly changing systems with many parameters they may become infeasible. Furthermore, for many systems even if it was possible to quickly collect new data to re-train an ML model for new conditions, sometimes such measurements are highly invasive and cannot be accomplished in real time without interrupting regular operations. Including time as an extra input to the ML tool and attempting to learn the time dependence of the system from data is only possible for simple cases in which the changes are predictable, such as monotonic or periodic changes. Although ML methods for time-series data exist, such as LSTM-based neural networks, those also need to be trained with consistent data and if the dynamics that govern that data change then the predicted time-series will be wrong. Model-independent adaptive feedback methods which respond in real time to un-modeled disturbances and changes face their own major limitations. Although adaptive methods are able to handle time-varying systems they are usually local in nature and can require lengthy tuning or get stuck in local minima especially for large complex systems with many parameters. In this paper, we present an approach to deep learning for time-varying systems which combines the ability of data-based ML methods to learn global complex relationships directly from data with the robustness of model-independent adaptive feedback to handle unknown time-varying conditions. In particular we focus on encoder-decoder type convolutional neural networks (CNN) which encode high dimensional inputs to a low measurement adaptive feedback prediction Figure 1. A high level overview of the adaptive ML approach for time-varying systems with flexibility for adaptation added by including an input vector of adaptively tuned parameter that is concatenated together with a vector output of a dense layer within a convolutional neural network after the encoder and before the generative section. dimensional latent space of dense layers. Our approach adds flexibility into the generative half of the CNN by adding adaptively-guided feedbacks into the low-dimensional dense layers of the network. A high level overview of this approach is shown in Fig. 1. Our adaptive ML method is designed for time-varying systems of the form x ˙( p, p h(t), t) = F ( x ( p, p h, t), p, p h(t), t), (6) where as before x = (x1, . . ., xn) are physical quantities whose measurements are of interest, p = (p1, . . ., pm) are adjustable parameters, and the new term p h(t) = ph,1(t), . . ., ph,mh (t) are hidden time-varying parameters are adjustable parameters, and the new term p h(t) = ph,1(t), . . ., ph,mh (t) are hidden time-varying parameters that influence the time-varying system dynamics F, but are not directly observable. Our goal is to develop an � adaptive ML-based model M <sup>ˆ</sup> for predicting a time-varying measurement _M_ of states of the system (6). Our model is of the form �ph,1(t), . . ., ph,mh (t) , Mˆ - w, b, p, ˆ p h(t)� ≈ M� p, p h(t), t�, p ˙ˆ h(t) = f h( p ˆ h, t, C(t)), C(t) = µ�Mˆ (t)�, (7) - p, p h(t), t �, p ˙ˆ h(t) = f h( p ˆ h, t, C(t)), C(t) = µ �Mˆ (t) - w, b, p, ˆ p h(t) - ≈ M where as before the w, b are network weights and biases that are trained from data sets, p are known set parameters, and the p ˆ h(t) are time-varying tunable parameters that are adjusted dynamically according to an adaptive algorithm whose dynamics are represented as f h . Although we write p ˆ h(t) to represent the fact that these adjustable parameters are supposed to track the unknown hidden parameters p h(t), they can also include more abstract quantities such as additional neural network inputs, weights, or biases. The adjustable parameters are adaptively tuned based on feedback that depends on some function of the prediction, C(t) = µ�Mˆ (t)�, where we are only tuned based on feedback that depends on some function of the prediction, C(t) = µ�Mˆ (t)�, where we are only showing the time arguments of the functions to emphasize that they may be drifting and changing. For example, for the application described below, our ML model’s goal is to predict the time-varying input beam distribution Ii(t) of an accelerator based on the measurement of an output beam distribution Io(t) at another location further down the beam line. This is done because the input beam distribution is not easily directly measurable and therefore our adaptive tuning adjusts both the neural network’s estimate of Ii(t) as well as a hidden parameter which represents a time-varying magnet in the accelerator lattice. The adaptive feedback is performed based on a comparison between the measured accelerator output beam Io(t) and that of an online model whose input is the ML-based approximated distribution and whose time-varying magnet setting is also adaptively adjusted. This allows us to make adjustments in real time purely based on available diagnostics without having to re-train the ML model. Our approach of combining external feedbacks with neural networks is analogous to a natural phenomenon in biological systems in which networks of neurons interact with each other and are controlled by external feedback loops and other ­networks <sup>34</sup> . For example recent studies have shown that the challenging task of synchronization between neuron networks can be achieved by feedback controls in the presence of signal delay, noise, and external ­disturbances <sup>35,36</sup>, and that resonance can be excited and controlled in complex neuron systems by using external feedback signals including chaotic ­resonances <sup>37,38</sup> . Some initial simplified adaptive ML studies have also begun on coupling the outputs of CNNs to adaptive feedback for real-time accelerator phase space ­control <sup>39</sup> and for predicting 3D electron density distributions for 3D coherent diffraction ­imaging <sup>40</sup> . In the remainder of this paper we focus on ML-based inverse physics models for time-varying systems, an overview of the approach is shown in Fig. 2, which is a specialized form of the general setup in Fig. 1. This approach is motivated by the fact that very sophisticated and accurate physics models as well as ML-based surrogate models have been developed for many complex systems, which could benefit from accurate estimates of the time-varying initial distributions which are used as their inputs. In particular we will demonstrate our method for particle accelerators and their charged particle beams for which our inverse modeling approach is motivated by sophisticated beam dynamics models which have the potential to serve as non-invasive beam diagnostics if their parameters and input beam distributions could be matched to actual accelerators. Particle accelerators are powerful tools for scientific research such as imaging of nuclear motion by ultrafast electron diffraction (UED) <sup>42,43</sup> reaching femtosecond temporal ­resolution <sup>44</sup> allowing for the visualization of lattice ­dynamics <sup>45</sup> and monitoring the spatiotemporal dynamics of excited atoms or ­molecules <sup>46</sup>, imaging dynamic phenomenon at free electron lasers (FEL) <sup>47</sup>, and generating GV/m accelerating fields in plasma wakefield accelerators (PWFA) <sup>48</sup> . Major challenges faced by accelerators are the ability to quickly and automatically control the phase space distributions of accelerated beams such as custom current profiles, and switching between different experiments with order of magnitude changes in beam properties, which can require hours of hands on tuning due to limited non-invasive diagnostics, time variation of accelerator parameters, and complex time varying beams. �Mˆ (t) A physics/ML model (M) measurement error output M(input) C Io(t) D Ii(t) feedback E M <sup>-1</sup> (output) input ML-based inverse physics model (M <sup>-1</sup> ) B measured output distribution prediction of time-varying input distribution Figure 2. Overview of an adaptive ML approach for ML-based time-varying inverse models. In our application a convolutional neural network is trained to represent an inverse physics model M <sup>−1</sup> which maps an output distribution Io(t) to its associated input distribution Ii(t) for a complex system ( A, B ). The ML-based estimate of the input Ii is then fed into a physics or ML-based surrogate model ( C ) and the model’s output is compared to measurements to quantify an error which is used to guide iterative feedback ( D ). In this adaptive approach the dense layers of the network include inputs from an adaptive feedback loop which are perturbed based on model or measurement-based errors ( E ). RF buncher view screen/collimation sample holder S1 S2 D1 VS - view screen S - solenoid D - dipole collimation VS2 Faraday cup D2 electron gun quadrupole triplet sample chamber UED detector Figure 3. Overview of the HiRES UED adapted ­from <sup>41</sup> . Intense bunches of 10 <sup>5</sup> −10 <sup>10</sup> particles are complex objects whose 6D phase space (x, y, z, px, py, pz) dynamics are coupled through collective effects such as space charge forces and coherent synchrotron ­radiation <sup>49</sup> . Accelerators generate extremely short bunches: 30 fs bunches at the SwissFEL X-ray ­FEL <sup>50</sup>, sub 100 fs bunches for ­UEDs <sup>51</sup>, and picosecond bunch trains for UEDs and multicolor ­XFELs <sup>52</sup> . The High Repetition-rate Electron Scattering apparatus (HiRES, shown in Fig. 3) at Lawrence Berkeley National Laboratory (LBNL), accelerates pC-class, sub-picosecond long electron bunches up to one million times a second (MHz), providing some of the most dense 6D phase space among accelerators at unique repetition rates, making it an ideal test bed for advanced algorithm ­development <sup>41,53</sup> . Advanced diagnostics are important for particle accelerator applications because the dynamics of intense charged particle beams are dominated by complex nonlinear collective effects such as space charge forces and coherent synchrotron radiation in a 6 dimensional (6D) phase space (x, y, z, px, py, pz) . Non-invasive real-time phase space diagnostics would be of great benefit to all particle accelerators as they would provide information which could guide adaptive feedback mechanisms. Automatic fast feedback could then be used for real-time beam tuning, such as quickly changing between various experiments at free electron lasers by modifying the energy vs time phase space of the beam, for creating custom tailored current profiles of intense bunches in plasma wakefield acceleration experiments, and for controlling the transverse bunch shapes for ultra fast electron diffraction (UED) microscopy beam lines. Although physics and machine learning-based surrogate models can potentially serve as non-invasive beam diagnostics, the main challenges they face are uncertain and drifting accelerator parameters and uncertain initial beam distributions at the entrance of an accelerator to be used for initial conditions. Such distributions drift with time requiring lengthy measurements that interrupt accelerator operations. For example, it has been demonstrated that an online model can be adaptively tuned in order to provide a virtual diagnostic for the timevarying longitudinal phase space (LPS) of an electron beam at the Facility for Advanced Accelerator Experimental Tests (FACET) at SLAC National Accelerator Laboratory by comparing the model’s predictions to a non-invasive energy spread spectrum ­measurement <sup>54</sup> . Although the adaptive model tuning approach at FACET was able to track the beam’s LPS in real time its accuracy was limited by the fact that there was no access to a good estimate of the time varying input beam distribution. Another set of virtual LPS diagnostics at FACET and at the LCLS free electron laser (FEL) were then developed which utilized neural networks to instantly map accelerator parameters to LPS ­measurements <sup>55</sup> . A third approach to virtual LPS diagnostics was recently developed at the LCLS which used neural networks with spectral inputs as well as parameter settings resulting in higher accuracy n=1 n=2 n=3 n=4 n=5 n=6 n=7 n=8 n=9 n=10 n=11 n=12 n=13 n=14 n=15 n=16 n=17 n=18 n=19 n=20 n=21 n=22 n=23 n=24 n=25 n=26 n=27 n=28 n=29 n=30 Figure 4. The first 30 principal components (normalized) of the input electron beam distribution are shown. The most dominant modes are n = 1 to n = 15, after which the components are seen to represent very fine details. ­predictions <sup>56</sup> . Recently encoder-decoder CNNs have also been demonstrated with measured beam data at the European XFEL to provide extremely high accuracy (768 × 1064 pixel images) predictions of the beam’s LPS and have also demonstrated an innovative method in which once the decoder half is trained and fixed, multiple different encoders can be used for various working points without having to re-train the ­decoder <sup>57</sup> . Simulation-based surrogate modeling studies have also been performed for mapping LPS distributions between various locations in ­accelerators <sup>58</sup> . All such ML methods could also greatly benefit from adding an estimate of the time-varying initial beam distribution as an input via the approach proposed in this paper or from adding adaptive tuning to some of their dense layers to make them more robust to time-varying initial beam distributions. Methods In the present work we utilized an adaptive CNN-based inverse model for mapping output beam measurements measurements directly to the learned principal components that represent beam inputs at the High Repetitionrate Electron Scattering apparatus (HiRES, shown in Fig. 3) beamline at Lawrence Berkeley National Laboratory (LBNL), which accelerates pC-class, sub-picosecond long electron bunches up to one million times a second (MHz), providing some of the most dense 6D phase space among accelerators at unique repetition rates, making it an ideal test bed for advanced algorithm ­development <sup>41,53</sup> . The first step was to collect data to learn a basis with which to represent a distribution of interest. We were interested in representing the time-varying input beam distribution Ii(t)(x, y) at the photocathode of the electron gun of HiRES. We started by collecting laser spot images on the HiRES photocathode over several days. The transverse electron beam density distribution ρ(x, y) created by a laser pulse of intensity _I_ ( _x_, _y_ ) is given by ρ(x, y) = I(x, y) × QE(x, y) . For our experiments we used a laser spot of small transverse size of roughly 200 × 200 μm <sup>2</sup>, an area small enough so that no significant quantum efficiency variations were expected and we could relate laser intensity directly to an initial electron bunch charge distribution. In order to increase the generality of our approach the laser images were then each rotated through 360° at steps of 1° generating a total of 1800 52 × 52 pixel images. These images were then stretched out as 1 × ­52 <sup>2</sup> dimensional vectors and stacked in a 2704 × 1800 data matrix _D_ . Considering this as a collection of 1800 vectors from a 2705 dimensional space, we then carried out a principal component analysis (PCA) <sup>59</sup>, a method closely related to singular value decomposition for finding lower dimensional representations of higher dimensional spaces, such as the method for finding the most important components of a large complex beam ­line <sup>60</sup> . PCA was performed by subtracting the mean of each column of _D_ and then factorizing the data matrix _D_ via singular value decomposition to calculate the score matrix _T_ according to D = U�W <sup>T</sup>, T = DW = U�W <sup>T</sup> W = U�, (8) whose components can be used in linear combinations as a basis with which to represent the original images. We then generated input beam distributions Ii as linear combinations of Npca PCA components as Npca �n=1 Ii,Npca = - αi,n × PCn. (9) αi,n × PCn. Although hundreds of PCA components were required to represent > 95% of the variance in our data, we wanted to significantly reduce the dimensionality of our problem. The first 30 principal components (PC1, . . ., PC30) are shown in Fig. 4 and qualitatively the most dominant modes are the first 15. To quantify the accuracy of reconstruction as a function of the number of PCA components used, we defined the error �x,y ��x,y ��Ii − Ii,Npca �� error = 100 × - Ii. (10) Ii. x,y A B N C N Ι = αn × PCn n=1 error ∆p 1,...,∆p M measured output beam F model parameters adaptive update 26×26×15 13×13×15 7×7×15 4×4×15 200 0 -200 model simulated output beam D error -200 0 200 x [ m] measured output beam PCA components adaptive update E Figure 5. ( A ) The measured beam output is fed into the CNN of convolutional layers with LeakyReLU activation functions followed by dense layers with ReLU activations. The CNN outputs principal component coefficients (α1, . . ., αN ) which generate an input beam distribution ( B ) used as an input to the simulation ( C ). ( D ) Simulation output is compared to the measured beam output to adaptively fine tune both the principal components ( E ) and model parameters ( F ). We then represented the 5 measured input beam distributions according to (9) and found that the error quickly dropped and leveled off at ∼ 8% for Npca = 15 after which it decayed very slowly so we used the first 15 images shown in Fig. 4 as the basis vectors for representing input beam distributions for HiRES. This limits the lowest error we can achieve for real distributions at 8%, but greatly speeds up real time adaptive tuning. Next we calibrated a General Particle Tracer (GPT) model using a generative neural network surrogate model (SM) to quickly map parameter settings to output beam ­distributions <sup>61,62</sup> by a high dimensional parameter search (including average beam energy (xp, yp, z, E) ) to match predictions to measured beam data. The calibrated GPT model was then used to generate 51 thousand pairs (Xi, y i), with each y i = (αi,1, . . ., αi,15) representing 15 PCA coefficients sampled from a normal distribution to generate a random input beam distribution I <sup>ˆ</sup> i as in (9), and Xi being the 51 × 51 image of the ( _x_, _y_ ) output beam distribution at the first view screen of HiRES, generated by the GPT model using I <sup>ˆ</sup> i as input. We then trained a CNN to map output beam distributions to the accelerator’s input beam distribution as shown in Fig. 5A. For the generative half of the CNN, instead of allowing the CNN to build in an arbitrary latent space by a standard approach such as transposed convolution layers, our approach guided the CNN to produce physically significant quantities which were the PCA components representing the basis out of which to build our input beam distributions. The CNN was tested on 1000 unseen input-output pairs and had an average error as defined in (10) of 1.88% with a standard deviation of 0.56%. Next, we used an experimentally measured output beam distribution as the input to the CNN and were able to predict the corresponding measured input beam distribution with an accuracy of 14.05%. Finally, the CNN’s prediction was fine tuned using an iterative adaptive feedback approach with each new input distribution fed into GPT giving a new output distribution, as shown in Fig. 5B–E, resulting in prediction accuracy of 9.69%. A detailed view of adaptive CNN predictions is shown in Fig. 6. The input beam distributions generated by the CNN were then fed into the GPT model to produce output beam estimates, which were compared to measurements. The error between predicted and measured beam outputs was used to drive an adaptive feedback loop which was connected back into the dense layer of the CNN to adaptively tune the CNN’s generative layer’s predictions. The adaptive method used was extremum seeking (ES) for high dimensional dynamic systems of the form x ˙ = f ( x ( p, t), p, t), yˆ = y( x ( p, t), p, t) + n(t), (11) where f is an analytically unknown time-varying nonlinear function, x are measurable system values, p are adjustable parameters, and yˆ is a noisy measurement of an analytically unknown function _y_ that can be maximized by adjusting p according to <u>dpj</u> dt <sup>=</sup> 2αωj cos(ωjt + kyˆ), (12) dt <sup>=</sup> �2αωj cos(ωjt + kyˆ), where ωj = ωi for i = j . The term α - 0 is the dithering amplitude and can be increased to escape local minima and k > 0 is feedback gain. For large ωi, the dynamics of (12) are, on average d p /dt = −kα∇ p y, a gradient descent (for k > 0 ) or ascent (for k < 0 ), with respect to p, of the actual, analytically unknown function _y_ although feedback is based only on the noisy measurements yˆ(t), for details and proofs ­see <sup>33,63,64</sup> . true CNN error A B C D E F G CNN CNN + ES contours CNN CNN + ES Figure 6. ( A - E ) Comparing input distributions to the CNN predictions reconstructed from the predicted PCA component coefficients. 5 examples were chosen from the 1000 test distributions and show the CNN’s best prediction ( A ), worst prediction ( E ), and a uniformly spaced range between ( B - D ). ( F ) The CNN’s prediction is shown for an experimentally measured beam output and compared to the experimentally measured beam input. ( G ) Results of the prediction from ( F ) fine tuned via ES. Results Demonstration at HiRES UED. In our approach the dynamic system of interest was the HiRES beamline and its GPT-based simulation. Our inverse model was designed to map HiRES output beam distributions to their associated input distributions and the CNN parameters being tuned, p, were dense layers which created the PCA coefficients defining the input beam distribution, as well as a hidden parameter within the HiRES simulation represented by the solenoid magnet setting. Our adaptive feedback was guided by maximizing the structural similarity index (SSIM) between a measured output beam distribution Io(t) = ρm(x, y, t), and the GPT simulation-based output beam distribution Iˆ0(t) = ρs(x, y, t), both of which were smoothed with a Gaussian filter of variance 2 and normalized to a range of [0, 1]. SSIM is defined as <u>(2µmµs + c1)(2σms + c2)</u> SSIM(ρm, ρs) = (13) <u>�µ</u> <sup>2</sup> m + µ <sup>2</sup> s + c1��σm <sup>2</sup> + σs <sup>2</sup> + c2�, <u>��σm</u> <sup>2</sup> + σs <sup>2</sup> + c2 <u>�</u>, m <sup>2 and σ</sup> s <sup>2</sup> where µm and µs are mean values of the measured and simulated distributions, σm <sup>2</sup> where µm and µs are mean values of the measured and simulated distributions, σm <sup>2 and σ</sup> s <sup>2 are their variance, σms</sup> is the covariance, and c1 = c2 = 10 <sup>−465</sup> . The SSIM value lies within the range [−1.0, 1.0] with a value of 1.0 for images that are exactly the same. To demonstrate the robust adaptive capability of our approach to simultaneously track both changing accelerator parameters and time-varying initial beam distributions, we performed a study running three sets of GPT simulations. In the first simulation, representing HiRES, an input beam was defined and its PCA components as well as the current of solenoid S1 were changed over time, resulting in a large variation of both the input and output beam. Based on that output beam of the first simulation, the CNN alone was used to predict the PCA components which generated an input to a second simulation to predict the output beam. This second simulation quickly diverged from the first because the system changed from the one that had been used to train the CNN. For a third simulation, the adaptive feedback algorithm (12) was also applied with _y_ as in (13), which adaptively tuned both the PCA components and the current of solenoid S1 in order to track the time-varying output distribution of the first simulation, as shown in Fig. 5B–F. Figure 7A shows the error of the PCA component predictions and demonstrates that the CNN + ES setup was able to simultaneously track both the time-varying solenoid current and the PCA components. Figure 7B compares the SSIM of the output beams with and without ES for tracking, (C) shows the percent error (10), and Fig. 8 compares the target output beam and input beam with and without using ES. Using the adaptively tracked input distribution and S1 setting we simulated a 1.6 pC bunch with 3D space charge and compared the 6D phase space to that which would have been generated by the exact correct values as well as to the CNN alone in Fig. 9, showing an almost exact match of the 6D phase space. A 4 3 2 1 0 -1 -2 -3 4 3 2 1 0 -1 -2 -3 70 60 50 40 30 20 10 5.0 4.9 4.8 4.7 4.6 B 1 C CNN + ES CNN <u>CNN PCA error</u> CNN + ES PCA error CNN + ES Solenoid Solenoid target 10 20 30 40 50 60 70 time [s] 10 20 30 40 50 60 70 0.8 0.6 0.4 0.2 20 15 10 5 output error CNN + ES output error CNN input error CNN + ES input error CNN time [s] time [s] 0 0 10 20 30 40 50 60 70 Figure 7. ( A ) PCA component tracking error shown with CNN alone and with CNN + ES, in the latter case the solenoid strength is also tracked. ( B ) CNN + ES tracks the output beam. ( C ) Output and input beam distribution errors continuously minimized. A ES no ES B ES no ES ES error no ES error output beam input beam ES error no ES error Figure 8. ( A ) The output beam distribution prediction adaptively tracked by tuning solenoid current and PCA components. ( B ) Input beam distribution is predicted with high accuracy. Figure 9. 6D phase space predictions with and without adaptive ML. Note that we chose solenoid S1 as the hidden time-varying parameter to be tracked only for the purpose of demonstrating this adaptive technique. In general many such parameters can be adaptively tuned simultaneously such as multiple quadrupole magnets which suffer from hysteresis. Finally, to demonstrate the ability of the approach in Fig. 7 to track time-varying beamline paramters, we generated an artificial quantum efficiency map _QE_ ( _x_, _y_ ), and used the measured laser intensity _I_ ( _x_, _y_ ) to construct a beam distribution ρ = I × QE which was used as input to the GPT model. The output was fed into the CNN whose initial guess of ρ was then adaptively fine tuned. The QE of the cathode was then reconstructed as QE(x, y) = ρ(x, y)/I(x, y), as shown in Fig. 10. Discussion We have proposed an approach for adaptively tuning the parameters of both an online physics model and encoder-decoder CNN-based inverse physics model by using an extremum seeking model-independent feedback method. This approach results in an overall adaptive ML setup which automatically compensates for unknown time-varying changes to accelerator components (such as magnets, and to unknown changes in the accelerator’s input beam distribution), by tuning inputs to the low dimensional dense layers preceding the decoder section Figure 10. ( A ) Schematic of laser image, quantum efficiency, and the resulting beam density. ( B, C ) Target QE and beam density compared to adaptive reconstructions. of the CNN. We showed how the precision of the prediction is greatly improved when an adaptive component is added to the CNN, resulting in a much improved robustness of the model and broader application space. Adjustments to the input values were only based on outputs and online non-invasive system measurements. Although demonstrated here for a particle accelerator, such method can be applied to a wide range of complex time-varying systems with limited diagnostics. We have demonstrated our method for adaptively tracking the time varying input beam distribution of the HiRES UED particle accelerator and the associated quantum efficiency (QE) when a measurement of the laser transverse profile at the cathode is available, for example through implementation of virtual cathode diagnostic. Our general approach can be applied at various particle accelerators to enable physics models to accurately map distributions between various locations to enable adaptive tuning. For example transverse deflecting radio frequency resonant cavity (TCAV)-based LPS measurements can be used to reconstruct the initial ( _z_, _E_ ) LPS. Such model-based non-invasive diagnostics are possible because the rich physics in models are strong constraints on the dynamic maps between accelerator distributions. Given sufficiently rich measurements we are very unlikely to achieve a close match at one section of an accelerator without uniquely reproducing the correct input distribution. Tracking non-stationary systems requires adaptive algorithms to be able to map measured outputs to unknown time-varying input(s). Isolating the correct changing input(s), together with its magnitude and time-scale, is an extremely complex problem, including multi-parameter optimization of the inverse physics problem. While this could be achieved using particle tracking codes (such as GPT), it would be incredibly computationally expensive and time consuming, and would practically prevent the method to be used in beamlines for real-time feedbacks. Powerful ML tools, such as convolutional neural networks, speed up operations by order of magnitudes (a single prediction as shown in Fig. 6F takes less than a millisecond), and can therefore efficiently be used for fine-tuned by the adaptive feedback and tracked over time, as shown in Figs. 6G and 7. We demonstrated that our approach is simultaneously tracking both the unknown input beam distribution and time-varying accelerator parameters. Lastly, it is worth pointing out the limitations to the re-training free approach presented here. First, if the magnitude of the input beam distribution change it is such that the new input no longer falls within the span of the PCA-based basis vectors which we are using, the error between the real and predicted input will diverge. Second, if something in the system changes that is not part of the model or is not being adaptively tuned in the model, such as adding or removing a magnet from the beamline, then a new online model and a new experimental data set must be collected for this fundamentally different system. In future work we plan to expand on our results by using several diagnostics simultaneously, including TCAV based LPS measurements and magnet tuning-based transverse phase space measurements. Our method can also be extended to 3D distributions ρ( r ) using 3D PCA components, spherical harmonics defining star-convex distribution boundaries ∂ρ(θ, ϕ) as �l,m αl <sup>m</sup> l <sup>mY</sup> l <sup>m</sup> l <sup>m(θ, ϕ),</sup> ∂ρ(θ, ϕ) = αl <sup>mY</sup> l <sup>m(θ, ϕ),</sup> (14) where a convolutional neural network can be used to generate the spherical harmonics coefficients αl <sup>m which are</sup> then adaptively tuned. A more general approach is to generate distributions from combinations of radial basis functions (RBF) defined as �n αne <sup>−(</sup> <sup>r</sup> <sup>−</sup> <sup>r</sup> <sup>c,n)2/σ 2</sup> n <sup>2</sup> n, ρ( r ) = αne <sup>−(</sup> <sup>r</sup> <sup>−</sup> <sup>r</sup> <sup>c,n)2/σ 2</sup> n, (15) n where the neural network predicts the RBF amplitudes αn, centers r c,n = (xc,n, yc,n, zc,n), and decay rates σn, all of which are adaptively tuned. Received: 29 March 2021; Accepted: 13 September 2021 References 1. Carrasquilla, J. & Melko, R. G. Machine learning phases of matter. _Nat. Phys._ 13, 431–434 (2017). 2. Qi, D. & Majda, A. J. Using machine learning to predict extreme events in complex systems. _Proc. Natl. Acad. Sci._ 117, 52–59 (2020). 3. Butler, K. T., Davies, D. W., Cartwright, H., Isayev, O. & Walsh, A. Machine learning for molecular and materials science. _Nature_ 559, 547–555 (2018). 4. Zibar, D., Wymeersch, H. & Lyubomirsky, I. Machine learning under the spotlight. _Nat. Photonics_ 11, 749–751 (2017). 5. Berecibar, M. Machine-learning techniques used to accurately predict battery life (2019). 6. Li, S., Dee, P. M., Khatami, E. & Johnston, S. Accelerating lattice quantum Monte Carlo simulations using artificial neural networks: Application to the Holstein model. _Phys. Rev, B_ 100, 020302 (2019). 7. Muscoloni, A., Thomas, J. M., Ciucci, S., Bianconi, G. & Cannistraci, C. V. Machine learning meets complex networks via coalescent embedding in the hyperbolic space. _Nat. Commun._ 8, 1–19 (2017). 8. Lansford, J. L. & Vlachos, D. G. Infrared spectroscopy data-and physics-driven machine learning for characterizing surface micro structure of complex materials. _Nat. Commun._ 11, 1–12 (2020). 9. Tkatchenko, A. Machine learning for chemical discovery. _Nat. Commun._ 11, 1–4 (2020). 10. Miller, D., Ward, A., Bambos, N., Shin, A. & Scheinker, D. Noninvasive identification of hypotension using convolutional-decon volutional networks. In _2019 IEEE International Conference on E-health Networking, Application & Services (HealthCom)_, 1–6 (IEEE, 2019). 11. Cichos, F., Gustavsson, K., Mehlig, B. & Volpe, G. Machine learning for active matter. _Nat. Mach. Intell._ 2, 94–103 (2020). 12. Miller, D., Ward, A., Bambos, N., Scheinker, D. & Shin, A. Physiological waveform imputation of missing data using convolutional autoencoders. In _2018 IEEE 20th International Conference on e-Health Networking, Applications and Services (Healthcom)_, 1–6 [(IEEE, 2018). https://​ieeex​plore.​ieee.​org/​abstr​act/​docum​ent/​85310​94.](https://ieeexplore.ieee.org/abstract/document/8531094) 13. Scheinker, D. & Brandeau, M. L. Implementing analytics projects in a hospital: Successes, failures, and opportunities. _INFORMS_ _J. Appl. Anal._ 50, 176–189 (2020). 14. Ward, A. _et al._ Machine learning and atherosclerotic cardiovascular disease risk prediction in a multi-ethnic population. _NPJ Digit._ _Med._ 3, 1–7 (2020). 15. Radovic, A. _et al._ Machine learning at the energy and intensity frontiers of particle physics. _Nature_ 560, 41–48 (2018). 16. Ragno, R. _et al._ Essential oils against bacterial isolates from cystic fibrosis patients by means of antimicrobial and unsupervised machine learning approaches. _Sci. Rep._ 10, 1–11 (2020). 17. Bulgarevich, D. S., Tsukamoto, S., Kasuya, T., Demura, M. & Watanabe, M. Pattern recognition with machine learning on optical microscopy images of typical metallurgical microstructures. _Sci. Rep._ 8, 1–8 (2018). 18. Pilania, G. _et al._ Machine learning bandgaps of double perovskites. _Sci. Rep._ 6, 1–10 (2016). 19. Shen, Y.-F., Pokharel, R., Nizolek, T. J., Kumar, A. & Lookman, T. Convolutional neural network-based method for real-time orientation indexing of measured electron backscatter diffraction patterns. _Acta Mater._ 170, 118–131 (2019). 20. Edelen, A. _et al._ Machine learning for orders of magnitude speedup in multiobjective optimization of particle accelerator systems. _Phys. Rev. Accel. Beams_ 23, 044601 (2020). 21. Duris, J. _et al._ Bayesian optimization of a free-electron laser. _Phys. Rev. Lett._ 124, 124801 (2020). 22. Ren, X. _et al._ Temporal power reconstruction for an x-ray free-electron laser using convolutional neural networks. _Phys. Rev. Accel._ _Beams_ 23, 040701 (2020). 23. Fol, E., de Portugal, J. C., Franchetti, G. & Tomás, R. Optics corrections using machine learning in the lhc. In _Proceedings of the_ _2019 International Particle Accelerator Conference, Melbourne, Australia_ (2019). 24. Fol, E., de Portugal, J. C., Tomás, R. _et al._ Unsupervised machine learning for detection of faulty beam position monitors. In _Proc._ _10th Int. Particle Accelerator Conf.(IPAC–19), Melbourne, Australia_, Vol. 2668 (2019). 25. Fol, E., Tomás, R. & Franchetti, G. Supervised learning-based reconstruction of magnet errors in circular accelerators. _Eur. Phys._ _J. Plus_ 136, 1–19 (2021). 26. Arpaia, P. _et al._ Machine learning for beam dynamics studies at the cern large hadron collider. _Nucl. Instrum. Methods Phys. Res._ _Sect. A Accel. Spectrom. Detect. Assoc. Equip._ 985, 164652 (2021). 27. Hao, Y., Li, Y., Balcewicz, M., Neufcourt, L. & Cheng, W. Reconstruction of storage ring’s linear optics with bayesian inference. _arXiv preprint_ [arXiv:​1902.​11157](http://arxiv.org/abs/1902.11157) _(2019)._ 28. Li, Y., Hao, Y., Cheng, W. & Rainer, R. Analysis of beam position monitor requirements with bayesian gaussian regression. _arXiv_ _preprint_ [arXiv:​1904.​05683](http://arxiv.org/abs/1904.05683) _(2019)._ 29. Wan, J., Jiao, Y. & Wu, J. Machine learning-based direct solver for one-to-many problems of temporal shaping of electron bunches. _arXiv preprint_ [arXiv:​2103.​06594](http://arxiv.org/abs/2103.06594) _(2021)._ 30. Leemann, S. _et al._ Demonstration of machine learning-based model-independent stabilization of source properties in synchrotron light sources. _Phys. Rev. Lett._ 123, 194801 (2019). 31. Rrapaj, E. & Roggero, A. Exact representations of many-body interactions with restricted-Boltzmann-machine neural networks. _Phys. Rev. E_ 103, 013302 (2021). 32. Åström, K. J. & Wittenmark, B. _Adaptive Control_ (Courier Corporation, 2013). 33. Scheinker, A. & Krstić, M. Minimum-seeking for CLFs: Universal semiglobally stabilizing feedback under unknown control direc tions. _IEEE Trans. Autom. Control_ 58, 1107–1122 (2012). 34. Doho, H., Nobukawa, S., Nishimura, H., Wagatsuma, N. & Takahashi, T. Transition of neural activity from the chaotic bipolar disorder state to the periodic healthy state using external feedback signals. _Front. Comput. Neurosci._ 14, 76 (2020). 35. Ibrahim, M. M. & Jung, I. H. Complex synchronization of a ring-structured network of fitzhugh-nagumo neurons with single-and dual-state gap junctions under ionic gates and external electrical disturbance. _IEEE Access_ 7, 57894–57906 (2019). 36. Ibrahim, M. M., Kamran, M. A., Mannan, M. M. N., Jung, I. H. & Kim, S. Lag synchronization of coupled time-delayed fitzhugh nagumo neural networks via feedback control. _Sci. Rep._ 11, 1–15 (2021). 37. Nobukawa, S. _et al._ Resonance phenomena controlled by external feedback signals and additive noise in neural systems. _Sci. Rep._ 9, 1–15 (2019). 38. Nobukawa, S. & Shibata, N. Controlling chaotic resonance using external feedback signals in neural systems. _Sci. Rep._ 9, 1–9 (2019). 39. Scheinker, A., Edelen, A., Bohler, D., Emma, C. & Lutman, A. Demonstration of model-independent control of the longitudinal phase space of electron beams in the linac-coherent light source with femtosecond resolution. _Phys. Rev. Lett._ 121, 044801 (2018). 40. Scheinker, A. & Pokharel, R. Adaptive 3D convolutional neural network-based reconstruction method for 3D coherent diffraction imaging. _J. Appl. Phys._ 128, 184901 (2020). 41. Filippetto, D. & Qian, H. Design of a high-flux instrument for ultrafast electron diffraction and microscopy. _J. Phys. B Atom. Mol._ _Opt. Phys._ 49 [, 104003 https://​doi.​org/​10.​1088/​0953-​4075/​49/​10/​104003/​meta (2016).](https://doi.org/10.1088/0953-4075/49/10/104003/meta) 42. Yang, J. _et al._ Diffractive imaging of coherent nuclear motion in isolated molecules. _Phys. Rev. Lett._ 117, 153002 (2016). 43. Yang, X. _et al._ A compact tunable quadrupole lens for brighter and sharper ultra-fast electron diffraction imaging. _Sci. Rep._ 9, 1–7 (2019). 44. Yang, X. _et al._ Toward monochromated sub-nanometer UEM and femtosecond UED. _Sci. Rep._ 10, 1–11 (2020). 45. Yang, X. _et al._ Visualizing lattice dynamic behavior by acquiring a single time-resolved MeV diffraction image. _J. Appl. Phys._ 129, 054901 (2021). 46. Musumeci, P. Ultrashort electron probe opportunities. _Nat. Photonics_ 14, 199–200 (2020). 47. Decking, W. _et al._ A MHz-repetition-rate hard X-ray free-electron laser driven by a superconducting linear accelerator. _Nat._ _Photonics_ 14, 391–397 (2020). 48. Turner, M. _et al._ Experimental observation of plasma wakefield growth driven by the seeded self-modulation of a proton bunch. _Phys. Rev. Lett._ 122, 054801 (2019). 49. Landau, L. D. _The Classical Theory of Fields_ Vol. 2 (Elsevier, 2013). 50. Malyzhenkov, A. _et al._ Single-and two-color attosecond hard X-ray free-electron laser pulses with nonlinear compression. _Phys._ _Rev. Res._ 2, 042018 (2020). 51. Van Oudheusden, T. _et al._ Compression of subrelativistic space-charge-dominated electron bunches for single-shot femtosecond electron diffraction. _Phys. Rev. Lett._ 105, 264801 (2010). 52. Lemery, F. _et al._ Passive ballistic microbunching of nonultrarelativistic electron bunches using electromagnetic wakefields in dielectric-lined waveguides. _Phys. Rev. Lett._ 122, 044801 (2019). 53. Ji, F. _et al._ Ultrafast relativistic electron nanoprobes. _Commun. Phys._ 2, 1–10 (2019). 54. Scheinker, A. & Gessner, S. Adaptive method for electron bunch profile prediction. _Phys. Rev. Special Top. Accel. Beams_ 18, 102801 (2015). 55. Emma, C. _et al._ Machine learning-based longitudinal phase space prediction of particle accelerators. _Phys. Rev. Accel. Beams_ 21, 112802 (2018). 56. Hanuka, A. _et al._ Accurate and confident prediction of electron beam longitudinal properties using spectral virtual diagnostics. _Sci. Rep._ 11, 1–10 (2021). 57. Zhu, J. _et al._ High-fidelity prediction of megapixel longitudinal phase-space images of electron beams using encoder-decoder neural networks. _Phys. Rev. Appl._ 16, 024005 (2021). 58. Edelen, A., Neveu, N., Mayes, C., Emma, C. & Ratner, D. Machine learning models for optimization and control of x-ray free electron lasers. In _NeurIPS Machine Learning for the Physical Sciences Workshop_ (2019). 59. Pearson, K. Liii. on lines and planes of closest fit to systems of points in space. _The London, Edinburgh, and Dublin Philosophical_ _Magazine and Journal of Science_, Vol. 2, 559–572 (1901). 60. Irwin, J. _et al._ Model-independent beam dynamics analysis. _Phys. Rev. Lett._ 82, 1684 (1999). 61. Van Der Geer, S., Luiten, O., De Loos, M., Pöplau, G. & Van Rienen, U. 3d space-charge model for gpt simulations of high bright ness electron bunches. In _Institute of Physics Conference Series_ [, Vol. 175, 101 (2005). https://​s3.​cern.​ch/​inspi​re-​prod-​files-8/​8812f​](https://s3.cern.ch/inspire-prod-files-8/8812f03d97ce7513a5baff557975cf6b#page=109) [03d97​ce751​3a5ba​ff557​975cf​6b#​page=​109.](https://s3.cern.ch/inspire-prod-files-8/8812f03d97ce7513a5baff557975cf6b#page=109) 62. Brynes, A. _et al._ Beyond the limits of 1D coherent synchrotron radiation. _New J. Phys._ 20, 073035 (2018). 63. Scheinker, A. Model independent beam tuning. In _Int. Partile Accelerator Conf.(IPAC’13), Shanghai, China, 19-24 May 2013_, [1862–1864 (JACOW Publishing, 2013). http://​accel​conf.​web.​cern.​ch/​Accel​Conf/​IPAC2​013/​papers/​tupwa​068.​pdf?n=​IPAC2​013/​](http://accelconf.web.cern.ch/AccelConf/IPAC2013/papers/tupwa068.pdf?n=IPAC2013/papers/tupwa068.pdf) [papers/​tupwa​068.​pdf.](http://accelconf.web.cern.ch/AccelConf/IPAC2013/papers/tupwa068.pdf?n=IPAC2013/papers/tupwa068.pdf) 64. Scheinker, A. & Scheinker, D. Constrained extremum seeking stabilization of systems not affine in control. _Int. J. Robust Nonlinear_ _Control_ 28, 568–581 (2018). 65. Wang, Z., Bovik, A. C., Sheikh, H. R. & Simoncelli, E. P. Image quality assessment: From error visibility to structural similarity. _IEEE Trans. Image Process._ 13, 600–612 (2004). Acknowledgements This material is based upon work supported by the U.S. Department of Energy (DOE), Office of Science, Office of High Energy Physics under contract number 89233218CNA000001 and DE-AC02-05CH11231. F.C. acknowledge support from NSF PHY-1549132, Center for Bright Beams. D.F and S.P. acknowledge support for Machine learning studies at HiRES by the Laboratory Directed Research and Development program of LBNL under U.S. DOE Contract DE-AC02-05CH11231. Author contributions A.S. conceived the adaptive model ML approach for time-varying systems, A.S. and D.F. conceived the PCAbased input distribution generating method, E.C. developed and calibrated the GPT model to match the HiRES beamline, A.S. developed the adaptive and ML tools, D.F., S.P., and F.C. conducted the experiments, A.S., E.C., and D.F. analysed the data. All authors reviewed the manuscript. Competing interests The authors declare no competing interests. Additional information Correspondence and requests for materials should be addressed to A.S. Reprints and permissions information is available at www.nature.com/reprints. Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from [the copyright holder. To view a copy of this licence, visit http://​creat​iveco​mmons.​org/​licen​ses/​by/4.​0/.](http://creativecommons.org/licenses/by/4.0/) This is a U.S. Government work and not under copyright protection in the US; foreign copyright protection may apply 2021

섹션 본문 24문단 · 31,614자

(제목 없음)

1Machine learning (ML) tools are able to learn relationships between the inputs and outputs of large complex systems directly from data. However, for time-varying systems, the predictive capabilities of ML tools degrade if the systems are no longer accurately represented by the data with which the ML models were trained. For complex systems, re-training is only possible if the changes are slow relative to the rate at which large numbers of new input-output training data can be non-invasively recorded. In this work, we present an approach to deep learning for time-varying systems that does not require re-training, but uses instead an adaptive feedback in the architecture of deep convolutional neural networks (CNN). The feedback is based only on available system output measurements and is applied in the encoded low-dimensional dense layers of the encoder-decoder CNNs. First, we develop an inverse model of a complex accelerator system to map output beam measurements to input beam distributions, while both the accelerator components and the unknown input beam distribution vary rapidly with time. We then demonstrate our method on experimental measurements of the input and output beam distributions of the HiRES ultra-fast electron diffraction (UED) beam line at Lawrence Berkeley National Laboratory, and showcase its ability for automatic tracking of the time varying photocathode quantum efficiency map. Our method can be successfully used to aid both physics and ML-based surrogate online models to provide non-invasive beam diagnostics.OPENto learn parameter to measurement maps where w , b are the weights and biases of the ML model whose values are found by minimizing the error between measurements and predictions based on data set D as in(2). Once such maps are learned they can be used for applications such as fast searches over large parameter spaces, to extract correlations and physics from experimental data, and to guide the design of new systems.To give a few concrete examples, various ML methods have now been demonstrated for a wide range of systems such as molecular and materials science studies 3 , for use in optical communications and photonics 4 , to accurately predict battery life 5 , to accelerate lattice Monte Carlo simulations using neural networks 6 , for studying complex networks 7 , for characterizing surface microstructure of complex materials 8 , for chemical discovery 9 , for noninvasive identification of Hypotension using convolutional-deconvolutional networks 10 , for active matter analysis by using deep neural networks to track objects 11 , for imputation of missing physiological waveform data by using convolutional autoencoders 12 , for optimizing operational problems in hospitals 13 , for cardiovascular disease risk prediction 14 , for particle physics 15 , for antimicrobial studies 16 , for pattern recognition for optical microscopy images of metallurgical microstructures 17 , for learning Perovskit bandgaps 18 , for real-time mapping of electron backscatter diffraction (EBSD) patterns to crystal orientations 19 , for speeding up simulation-based accelerator optimization studies 20 , for Bayesian optimization of free electron lasers (FEL) 21 , for temporal power reconstruction of FELs 22 , for various applications at the Large Hadron Collider (LHC) at CERN including optics corrections and detecting faulty beam position monitors 23-26 , for reconstruction of a storage ring's linear optics based on Bayesian inference 27 , to analyze beam position monitor placement in accelerators to find arrangements with the lowest probable predictive errors based on Bayesian Gaussian regression 28 , for temporal shaping of electron bunches in particle accelerators 29 , for stabilization of source properties in synchrotron light sources 30 , and to represent many-body interactions with restricted-Boltzmann-machine neural networks 31 .One challenge faced in applying ML methods to complex physical systems is if the systems have hidden time-varying characteristics which describe the parameter-to-physical system relationships. A simple example of a time-varying system is Scientific Reports | (2021) 11:19187 | https://doi.

2Machine learning (ML) methods, such as deep neural networks, can learn relationships between the components of and predict the outputs of complex physical systems such as phases of matter 1 and extreme events in complex systems 2 . Consider an n-dimensional complex physical system whose evolution is described by a system of dynamic equations where x = (x 1 , . . . , x n ) is a vector of physical quantities within the system such as atomic positions or energies, p = (p 1 , . . . , p m ) is a vector of controlled system parameters such as voltages or chemical concentrations, and F represents the nonlinear dynamics governing the physical system which may include partial derivatives with respect to the components of both x and p . Associated with a system such as (1) there is usually some physicalmeaningful measurement, M x(p, t), p , which depends on the parameter settings p and on the entire resulting time-history of x(p, t) . For example, such a measurement may be material properties such as strength of a complex alloy or the results of a high energy physics experiment.

3There are cases where the system (1) is so large and complex that an accurate analytical representation of F is unknown. There are also cases in which an analytic physics-based model of F exists, but is so computationally expensive that it cannot be numerically simulated over large length and time scales and requires lengthy computations with high performance computing resources. In either of those two cases, ML methods can be useful for learning a representation of the system that quickly maps parameter settings to measurements. Tool such as recurrent neural networks can handle entire time-series trajectories and reinforcement learning approaches can model analytically unknown reward functions and their corresponding optimal controllers for analytically unknown systems. Such ML-based approaches can learn these representations directly from raw data, whether the data comes from measurements or simulations, by using large collections of input-output pairs,

4where p h (t) is an unknown time-varying parameter and p is an input parameter. By hidden parameters we mean parameters whose settings are not directly observable. Note that in this simple example (4) if there is no feedback ( p ≡ 0 ) the system is unstable and exponentially diverges. If the unknown time-varying function p h (t) repeatedly changes sign, such as where the frequency of oscillation is itself also an uncertain time-varying system, it is a major challenge for data-based methods because the input p to output x(t) relationship changes repeatedly in an unpredictable way, resulting in the smallest error for a large data set being an average approximation of p h (t) ≡ 0 . Such systems are also challenging for standard feedback controls such as proportional integral derivative (PID) feedback which must assume a known sign of p h (t) and fails spectacularly, destabilizing the system even more whenever p h (t) changes sign. Although many model-independent adaptive feedback control methods exist 32 , the problem of designing a stabilizing feedback controller for unknown time-varying systems with unknown control directions such as (4) with analytical proof of convergence was not accomplished until 2013 by utilizing nonlinear timevarying adaptive feedback and Lyapunov stability analysis methods 33 . Another form of hidden time-varying characteristics is when the initial conditions of a system are themselves time-varying, not easily measurable, and influence the dynamics of the system in a non-trivial way.

5In both of the above cases, if either the dynamics-to-parameters relationships or the initial conditions vary with time, then the accuracy of data-based predictions will start to degrade as the system changes to such an extent that it is no longer accurately represented by the data that was originally used to train the ML model. Although powerful ML methods such as domain transfer and re-training are available, for large quickly changing systems with many parameters they may become infeasible. Furthermore, for many systems even if it was possible to quickly collect new data to re-train an ML model for new conditions, sometimes such measurements are highly invasive and cannot be accomplished in real time without interrupting regular operations. Including time as an extra input to the ML tool and attempting to learn the time dependence of the system from data is only possible for simple cases in which the changes are predictable, such as monotonic or periodic changes. Although ML methods for time-series data exist, such as LSTM-based neural networks, those also need to be trained with consistent data and if the dynamics that govern that data change then the predicted time-series will be wrong. Model-independent adaptive feedback methods which respond in real time to un-modeled disturbances and changes face their own major limitations. Although adaptive methods are able to handle time-varying systems they are usually local in nature and can require lengthy tuning or get stuck in local minima especially for large complex systems with many parameters.

6In this paper, we present an approach to deep learning for time-varying systems which combines the ability of data-based ML methods to learn global complex relationships directly from data with the robustness of model-independent adaptive feedback to handle unknown time-varying conditions. In particular we focus on encoder-decoder type convolutional neural networks (CNN) which encode high dimensional inputs to a low where as before the w , b are network weights and biases that are trained from data sets, p are known set parameters, and the p h (t) are time-varying tunable parameters that are adjusted dynamically according to an adaptive algorithm whose dynamics are represented as f h . Although we write p h (t) to represent the fact that these adjustable parameters are supposed to track the unknown hidden parameters p h (t) , they can also include more abstract quantities such as additional neural network inputs, weights, or biases. The adjustable parameters are adaptively tuned based on feedback that depends on some function of the prediction, C(t) = µ M (t) , where we are only showing the time arguments of the functions to emphasize that they may be drifting and changing. For example, for the application described below, our ML model's goal is to predict the time-varying input beam distribution I i (t) of an accelerator based on the measurement of an output beam distribution I o (t) at another location further down the beam line. This is done because the input beam distribution is not easily directly measurable and therefore our adaptive tuning adjusts both the neural network's estimate of I i (t) as well as a hidden parameter which represents a time-varying magnet in the accelerator lattice. The adaptive feedback is performed based on a comparison between the measured accelerator output beam I o (t) and that of an online model whose input is the ML-based approximated distribution and whose time-varying magnet setting is also adaptively adjusted. This allows us to make adjustments in real time purely based on available diagnostics without having to re-train the ML model. Our approach of combining external feedbacks with neural networks is analogous to a natural phenomenon in biological systems in which networks of neurons interact with each other and are controlled by external feedback loops and other networks 34 . For example recent studies have shown that the challenging task of synchronization between neuron networks can be achieved by feedback controls in the presence of signal delay, noise, and external disturbances 35,36 , and that resonance can be excited and controlled in complex neuron systems by using external feedback signals including chaotic resonances 37,38 . Some initial simplified adaptive ML studies have also begun on coupling the outputs of CNNs to adaptive feedback for real-time accelerator phase space control 39 and for predicting 3D electron density distributions for 3D coherent diffraction imaging 40 .

7In the remainder of this paper we focus on ML-based inverse physics models for time-varying systems, an overview of the approach is shown in Fig. 2, which is a specialized form of the general setup in Fig. 1. This approach is motivated by the fact that very sophisticated and accurate physics models as well as ML-based surrogate models have been developed for many complex systems, which could benefit from accurate estimates of the time-varying initial distributions which are used as their inputs. In particular we will demonstrate our method for particle accelerators and their charged particle beams for which our inverse modeling approach is motivated by sophisticated beam dynamics models which have the potential to serve as non-invasive beam diagnostics if their parameters and input beam distributions could be matched to actual accelerators.

8Particle accelerators are powerful tools for scientific research such as imaging of nuclear motion by ultrafast electron diffraction (UED) 42,43 reaching femtosecond temporal resolution 44 allowing for the visualization of lattice dynamics 45 and monitoring the spatiotemporal dynamics of excited atoms or molecules 46 , imaging dynamic phenomenon at free electron lasers (FEL) 47 , and generating GV/m accelerating fields in plasma wakefield accelerators (PWFA) 48 . Major challenges faced by accelerators are the ability to quickly and automatically control the phase space distributions of accelerated beams such as custom current profiles, and switching between different experiments with order of magnitude changes in beam properties, which can require hours of hands on tuning due to limited non-invasive diagnostics, time variation of accelerator parameters, and complex time varying beams. www.nature.com/scientificreports/ Intense bunches of 10 5 −10 10 particles are complex objects whose 6D phase space (x, y, z, p x , p y , p z ) dynamics are coupled through collective effects such as space charge forces and coherent synchrotron radiation 49 . Accelerators generate extremely short bunches: 30 fs bunches at the SwissFEL X-ray FEL 50 , sub 100 fs bunches for UEDs 51 , and picosecond bunch trains for UEDs and multicolor XFELs 52 . The High Repetition-rate Electron Scattering apparatus (HiRES, shown in Fig. 3) at Lawrence Berkeley National Laboratory (LBNL), accelerates pC-class, sub-picosecond long electron bunches up to one million times a second (MHz), providing some of the most dense 6D phase space among accelerators at unique repetition rates, making it an ideal test bed for advanced algorithm development 41,53 .

9Advanced diagnostics are important for particle accelerator applications because the dynamics of intense charged particle beams are dominated by complex nonlinear collective effects such as space charge forces and coherent synchrotron radiation in a 6 dimensional (6D) phase space (x, y, z, p x , p y , p z ) . Non-invasive real-time phase space diagnostics would be of great benefit to all particle accelerators as they would provide information which could guide adaptive feedback mechanisms. Automatic fast feedback could then be used for real-time beam tuning, such as quickly changing between various experiments at free electron lasers by modifying the energy vs time phase space of the beam, for creating custom tailored current profiles of intense bunches in plasma wakefield acceleration experiments, and for controlling the transverse bunch shapes for ultra fast electron diffraction (UED) microscopy beam lines.

10Although physics and machine learning-based surrogate models can potentially serve as non-invasive beam diagnostics, the main challenges they face are uncertain and drifting accelerator parameters and uncertain initial beam distributions at the entrance of an accelerator to be used for initial conditions. Such distributions drift with time requiring lengthy measurements that interrupt accelerator operations. For example, it has been demonstrated that an online model can be adaptively tuned in order to provide a virtual diagnostic for the timevarying longitudinal phase space (LPS) of an electron beam at the Facility for Advanced Accelerator Experimental Tests (FACET) at SLAC National Accelerator Laboratory by comparing the model's predictions to a non-invasive energy spread spectrum measurement 54 . Although the adaptive model tuning approach at FACET was able to track the beam's LPS in real time its accuracy was limited by the fact that there was no access to a good estimate of the time varying input beam distribution. Another set of virtual LPS diagnostics at FACET and at the LCLS free electron laser (FEL) were then developed which utilized neural networks to instantly map accelerator parameters to LPS measurements 55 . A third approach to virtual LPS diagnostics was recently developed at the LCLS which used neural networks with spectral inputs as well as parameter settings resulting in higher accuracy 58 . All such ML methods could also greatly benefit from adding an estimate of the time-varying initial beam distribution as an input via the approach proposed in this paper or from adding adaptive tuning to some of their dense layers to make them more robust to time-varying initial beam distributions.

Methods

11In the present work we utilized an adaptive CNN-based inverse model for mapping output beam measurements measurements directly to the learned principal components that represent beam inputs at the High Repetitionrate Electron Scattering apparatus (HiRES, shown in Fig. 3) beamline at Lawrence Berkeley National Laboratory (LBNL), which accelerates pC-class, sub-picosecond long electron bunches up to one million times a second (MHz), providing some of the most dense 6D phase space among accelerators at unique repetition rates, making it an ideal test bed for advanced algorithm development 41,53 . The first step was to collect data to learn a basis with which to represent a distribution of interest. We were interested in representing the time-varying input beam distribution I i (t)(x, y) at the photocathode of the electron gun of HiRES. We started by collecting laser spot images on the HiRES photocathode over several days. The transverse electron beam density distribution ρ(x, y) created by a laser pulse of intensity I(x, y) is given by ρ(x, y) = I(x, y) × QE(x, y) . For our experiments we used a laser spot of small transverse size of roughly 200 × 200 μm 2 , an area small enough so that no significant quantum efficiency variations were expected and we could relate laser intensity directly to an initial electron bunch charge distribution.

12In order to increase the generality of our approach the laser images were then each rotated through 360° at steps of 1° generating a total of 1800 52 × 52 pixel images. These images were then stretched out as 1 × 52 2 dimensional vectors and stacked in a 2704 × 1800 data matrix D. Considering this as a collection of 1800 vectors from a 2705 dimensional space, we then carried out a principal component analysis (PCA) 59 , a method closely related to singular value decomposition for finding lower dimensional representations of higher dimensional spaces, such as the method for finding the most important components of a large complex beam line 60 . PCA was performed by subtracting the mean of each column of D and then factorizing the data matrix D via singular value decomposition to calculate the score matrix T according to whose components can be used in linear combinations as a basis with which to represent the original images.

13We then generated input beam distributions I i as linear combinations of N pca PCA components as

14Although hundreds of PCA components were required to represent > 95% of the variance in our data, we wanted to significantly reduce the dimensionality of our problem. The first 30 principal components (PC 1 , . . . , PC 30 ) are shown in Fig. 4 and qualitatively the most dominant modes are the first 15. To quantify the accuracy of reconstruction as a function of the number of PCA components used, we defined the error www.nature.com/scientificreports/ We then represented the 5 measured input beam distributions according to (9) and found that the error quickly dropped and leveled off at ∼ 8% for N pca = 15 after which it decayed very slowly so we used the first 15 images shown in Fig. 4 as the basis vectors for representing input beam distributions for HiRES. This limits the lowest error we can achieve for real distributions at 8%, but greatly speeds up real time adaptive tuning. Next we calibrated a General Particle Tracer (GPT) model using a generative neural network surrogate model (SM) to quickly map parameter settings to output beam distributions 61,62 by a high dimensional parameter search (including average beam energy (x p , y p , z, E) ) to match predictions to measured beam data. The calibrated GPT model was then used to generate 51 thousand pairs (X i , y i ) , with each y i = (α i,1 , . . . , α i,15 ) representing 15 PCA coefficients sampled from a normal distribution to generate a random input beam distribution Î i as in (9), and X i being the 51 × 51 image of the (x, y) output beam distribution at the first view screen of HiRES, generated by the GPT model using Î i as input.

15We then trained a CNN to map output beam distributions to the accelerator's input beam distribution as shown in Fig. 5A. For the generative half of the CNN, instead of allowing the CNN to build in an arbitrary latent space by a standard approach such as transposed convolution layers, our approach guided the CNN to produce physically significant quantities which were the PCA components representing the basis out of which to build our input beam distributions.

16The CNN was tested on 1000 unseen input-output pairs and had an average error as defined in (10) of 1.88% with a standard deviation of 0.56%. Next, we used an experimentally measured output beam distribution as the input to the CNN and were able to predict the corresponding measured input beam distribution with an accuracy of 14.05%. Finally, the CNN's prediction was fine tuned using an iterative adaptive feedback approach with each new input distribution fed into GPT giving a new output distribution, as shown in Fig. 5B-E, resulting in prediction accuracy of 9.69%. A detailed view of adaptive CNN predictions is shown in Fig. 6.

17The input beam distributions generated by the CNN were then fed into the GPT model to produce output beam estimates, which were compared to measurements. The error between predicted and measured beam outputs was used to drive an adaptive feedback loop which was connected back into the dense layer of the CNN to adaptively tune the CNN's generative layer's predictions. The adaptive method used was extremum seeking (ES) for high dimensional dynamic systems of the form where f is an analytically unknown time-varying nonlinear function, x are measurable system values, p are adjustable parameters, and ŷ is a noisy measurement of an analytically unknown function y that can be maximized by adjusting p according to where ω j = ω i for i = j . The term α > 0 is the dithering amplitude and can be increased to escape local minima and k > 0 is feedback gain. For large ω i , the dynamics of (12) are, on average dp/dt = −kα∇ p y , a gradient descent (for k > 0 ) or ascent (for k < 0 ), with respect to p , of the actual, analytically unknown function y although feedback is based only on the noisy measurements ŷ(t) , for details and proofs see 33,63,64 . , t), p, t),ŷ = y(x(p, t), p, t) + n(t), (12) dp j dt = 2αω j cos(ω j t + kŷ),

Results

18Demonstration at HiRES UED. In our approach the dynamic system of interest was the HiRES beamline and its GPT-based simulation. Our inverse model was designed to map HiRES output beam distributions to their associated input distributions and the CNN parameters being tuned, p , were dense layers which created the PCA coefficients defining the input beam distribution, as well as a hidden parameter within the HiRES simulation represented by the solenoid magnet setting. Our adaptive feedback was guided by maximizing the structural similarity index (SSIM) between a measured output beam distribution I o (t) = ρ m (x, y, t) , and the GPT simulation-based output beam distribution Î 0 (t) = ρ s (x, y, t) , both of which were smoothed with a Gaussian filter of variance 2 and normalized to a range of [0, 1]. SSIM is defined as where µ m and µ s are mean values of the measured and simulated distributions, σ 2 m and σ 2 s are their variance, σ ms is the covariance, and c 1 = c 2 = 10 −465 . The SSIM value lies within the range [−1.0, 1.0] with a value of 1.0 for images that are exactly the same.

19To demonstrate the robust adaptive capability of our approach to simultaneously track both changing accelerator parameters and time-varying initial beam distributions, we performed a study running three sets of GPT simulations. In the first simulation, representing HiRES, an input beam was defined and its PCA components as well as the current of solenoid S1 were changed over time, resulting in a large variation of both the input and output beam. Based on that output beam of the first simulation, the CNN alone was used to predict the PCA components which generated an input to a second simulation to predict the output beam. This second simulation quickly diverged from the first because the system changed from the one that had been used to train the CNN. For a third simulation, the adaptive feedback algorithm (12) was also applied with y as in (13), which adaptively tuned both the PCA components and the current of solenoid S1 in order to track the time-varying output distribution of the first simulation, as shown in Fig. 5B-F. Figure 7A shows the error of the PCA component predictions and demonstrates that the CNN + ES setup was able to simultaneously track both the time-varying solenoid current and the PCA components. Figure 7B compares the SSIM of the output beams with and without ES for tracking, (C) shows the percent error (10), and Fig. 8 compares the target output beam and input beam with and without using ES. Using the adaptively tracked input distribution and S1 setting we simulated a 1.6 pC bunch with 3D space charge and compared the 6D phase space to that which would have been generated by the exact correct values as well as to the CNN alone in Fig. 9, showing an almost exact match of the 6D phase space. www.nature.com/scientificreports/ Note that we chose solenoid S1 as the hidden time-varying parameter to be tracked only for the purpose of demonstrating this adaptive technique. In general many such parameters can be adaptively tuned simultaneously such as multiple quadrupole magnets which suffer from hysteresis.

20Finally, to demonstrate the ability of the approach in Fig. 7 to track time-varying beamline paramters, we generated an artificial quantum efficiency map QE(x, y), and used the measured laser intensity I(x, y) to construct a beam distribution ρ = I × QE which was used as input to the GPT model. The output was fed into the CNN whose initial guess of ρ was then adaptively fine tuned. The QE of the cathode was then reconstructed as QE(x, y) = ρ(x, y)/I(x, y) , as shown in Fig. 10.

Discussion

21We have proposed an approach for adaptively tuning the parameters of both an online physics model and encoder-decoder CNN-based inverse physics model by using an extremum seeking model-independent feedback method. This approach results in an overall adaptive ML setup which automatically compensates for unknown time-varying changes to accelerator components (such as magnets, and to unknown changes in the accelerator's input beam distribution), by tuning inputs to the low dimensional dense layers preceding the decoder section 10 Although demonstrated here for a particle accelerator, such method can be applied to a wide range of complex time-varying systems with limited diagnostics. We have demonstrated our method for adaptively tracking the time varying input beam distribution of the HiRES UED particle accelerator and the associated quantum efficiency (QE) when a measurement of the laser transverse profile at the cathode is available, for example through implementation of virtual cathode diagnostic. Our general approach can be applied at various particle accelerators to enable physics models to accurately map distributions between various locations to enable adaptive tuning. For example transverse deflecting radio frequency resonant cavity (TCAV)-based LPS measurements can be used to reconstruct the initial (z, E) LPS. Such model-based non-invasive diagnostics are possible because the rich physics in models are strong constraints on the dynamic maps between accelerator distributions. Given sufficiently rich measurements we are very unlikely to achieve a close match at one section of an accelerator without uniquely reproducing the correct input distribution.

22Tracking non-stationary systems requires adaptive algorithms to be able to map measured outputs to unknown time-varying input(s). Isolating the correct changing input(s), together with its magnitude and time-scale, is an extremely complex problem, including multi-parameter optimization of the inverse physics problem. While this could be achieved using particle tracking codes (such as GPT), it would be incredibly computationally expensive and time consuming, and would practically prevent the method to be used in beamlines for real-time feedbacks. Powerful ML tools, such as convolutional neural networks, speed up operations by order of magnitudes (a single prediction as shown in Fig. 6F takes less than a millisecond), and can therefore efficiently be used for fine-tuned by the adaptive feedback and tracked over time, as shown in Figs. 6G and 7. We demonstrated that our approach is simultaneously tracking both the unknown input beam distribution and time-varying accelerator parameters.

23Lastly, it is worth pointing out the limitations to the re-training free approach presented here. First, if the magnitude of the input beam distribution change it is such that the new input no longer falls within the span of the PCA-based basis vectors which we are using, the error between the real and predicted input will diverge. Second, if something in the system changes that is not part of the model or is not being adaptively tuned in the model, such as adding or removing a magnet from the beamline, then a new online model and a new experimental data set must be collected for this fundamentally different system.

24In future work we plan to expand on our results by using several diagnostics simultaneously, including TCAV based LPS measurements and magnet tuning-based transverse phase space measurements. Our method can also be extended to 3D distributions ρ(r) using 3D PCA components, spherical harmonics defining star-convex distribution boundaries ∂ρ(θ, ϕ) as where a convolutional neural network can be used to generate the spherical harmonics coefficients α m l which are then adaptively tuned. A more general approach is to generate distributions from combinations of radial basis functions (RBF) defined as where the neural network predicts the RBF amplitudes α n , centers r c,n = (x c,n , y c,n , z c,n ) , and decay rates σ n , all of which are adaptively tuned.

참고문헌 81건

  1. The Classical Theory of Fields 2013 10.1002/9781118516911.ch17
  2. Minimum-Seeking for CLFs: Universal Semiglobally Stabilizing Feedback Under Unknown Control Directions IEEE Transactions on Automatic Control · Institute of Electrical and Electronics Engineers · 2012 10.1109/tac.2012.2225514
  3. Compression of Subrelativistic Space-Charge-Dominated Electron Bunches for Single-Shot Femtosecond Electron Diffraction Physical Review Letters · American Physical Society · 2010 10.1103/physrevlett.105.264801
  4. Model-Independent Beam Dynamics Analysis Physical Review Letters · American Physical Society · 1999 10.1103/physrevlett.82.1684
  5. <i>The Classical Theory of Fields</i> Physics Today · AIP Publishing · 1952 10.1063/1.3067575
  6. Image quality assessment: from error visibility to structural similarity IEEE Transactions on Image Processing · Institute of Electrical and Electronics Engineers · 2004 10.1109/tip.2003.819861
  7. MODEL INDEPENDENT BEAM TUNING 2013
  8. Machine learning meets network science: dimensionality reduction for fast and efficient embedding of networks in the hyperbolic space arXiv (Cornell University) · Cornell University · 2016
  9. LIII. <i>On lines and planes of closest fit to systems of points in space</i> The London Edinburgh and Dublin Philosophical Magazine and Journal of Science · Taylor & Francis · 1901 10.1080/14786440109462720
  10. Machine learning phases of matter Nature Physics · Nature Portfolio · 2017 10.1038/nphys4035
  11. Machine learning bandgaps of double perovskites Scientific Reports · Nature Portfolio · 2016 10.1038/srep19375
  12. Design of a high-flux instrument for ultrafast electron diffraction and microscopy Journal of Physics B Atomic Molecular and Optical Physics · IOP Publishing · 2016 10.1088/0953-4075/49/10/104003
  13. Adaptive method for electron bunch profile prediction Physical Review Special Topics - Accelerators and Beams · American Physical Society · 2015 10.1103/physrevstab.18.102801
  14. Machine learning quantum phases of matter beyond the fermion sign problem Scientific Reports · Nature Portfolio · 2017 10.1038/s41598-017-09098-0
  15. Diffractive Imaging of Coherent Nuclear Motion in Isolated Molecules Physical Review Letters · American Physical Society · 2016 10.1103/physrevlett.117.153002
  16. Ultrastructural Characterization of the Lower Motor System in a Mouse Model of Krabbe Disease Scientific Reports · Nature Portfolio · 2016 10.1038/s41598-016-0001-8
  17. Adaptive Control 1989
  18. Constrained extremum seeking stabilization of systems not affine in control International Journal of Robust and Nonlinear Control · Wiley · 2017 10.1002/rnc.3886
  19. Machine learning under the spotlight Nature Photonics · Nature Portfolio · 2017 10.1038/s41566-017-0058-3
  20. Inter-annual and decadal changes in teleconnections drive continental-scale synchronization of tree reproduction Nature Communications · Nature Portfolio · 2017 10.1038/s41467-017-02348-9
  21. Threshold-induced correlations in the Random Field Ising Model Scientific Reports · Nature Portfolio · 2018 10.1038/s41598-018-20759-6
  22. Pattern recognition with machine learning on optical microscopy images of typical metallurgical microstructures Scientific Reports · Nature Portfolio · 2018 10.1038/s41598-018-20438-6
  23. Passive Ballistic Microbunching of Nonultrarelativistic Electron Bunches Using Electromagnetic Wakefields in Dielectric-Lined Waveguides Physical Review Letters · American Physical Society · 2019 10.1103/physrevlett.122.044801
  24. Machine learning at the energy and intensity frontiers of particle physics Nature · Nature Portfolio · 2018 10.1038/s41586-018-0361-2
  25. Machine learning for molecular and materials science Nature · Nature Portfolio · 2018 10.1038/s41586-018-0337-2
  26. Demonstration of Model-Independent Control of the Longitudinal Phase Space of Electron Beams in the Linac-Coherent Light Source with Femtosecond Resolution Physical Review Letters · American Physical Society · 2018 10.1103/physrevlett.121.044801
  27. Experimental Observation of Plasma Wakefield Growth Driven by the Seeded Self-Modulation of a Proton Bunch Physical Review Letters · American Physical Society · 2019 10.1103/physrevlett.122.054801
  28. Physiological Waveform Imputation of Missing Data using Convolutional Autoencoders 2018 10.1109/healthcom.2018.8531094
  29. Machine learning-based longitudinal phase space prediction of particle accelerators Physical Review Accelerators and Beams · American Physical Society · 2018 10.1103/physrevaccelbeams.21.112802
  30. Subpixel three-dimensional laser imaging with a downscaled avalanche photodiode array using code division multiple access Communications Physics · Nature Portfolio · 2018 10.1038/s42005-018-0096-2
  31. Occurrence of the potent mutagens 2- nitrobenzanthrone and 3-nitrobenzanthrone in fine airborne particles Scientific Reports · Nature Portfolio · 2019 10.1038/s41598-018-37186-2
  32. Ultrafast Relativistic Electron Nanoprobes Communications Physics · Nature Portfolio · 2019 10.1038/s42005-019-0154-4
  33. Reconstruction of Storage Ring 's Linear Optics with Bayesian Inference arXiv (Cornell University) · Cornell University · 2019 10.48550/arxiv.1902.11157
  34. Controlling Chaotic Resonance using External Feedback Signals in Neural Systems Scientific Reports · Nature Portfolio · 2019 10.1038/s41598-019-41535-0
  35. Convolutional neural network-based method for real-time orientation indexing of measured electron backscatter diffraction patterns Acta Materialia · Elsevier BV · 2019 10.1016/j.actamat.2019.03.026
  36. A compact tunable quadrupole lens for brighter and sharper ultra-fast electron diffraction imaging Scientific Reports · Nature Portfolio · 2019 10.1038/s41598-019-39208-z
  37. Analysis of beam position monitor requirements with Bayesian Gaussian regression arXiv (Cornell University) · Cornell University · 2019 10.48550/arxiv.1904.05683
  38. Machine-learning techniques used to accurately predict battery life Nature · Nature Portfolio · 2019 10.1038/d41586-019-01138-1
  39. Complex Synchronization of a Ring-Structured Network of FitzHugh-Nagumo Neurons With Single-and Dual-State Gap Junctions Under Ionic Gates and External Electrical Disturbance IEEE Access · Institute of Electrical and Electronics Engineers · 2019 10.1109/access.2019.2913872
  40. Accelerating lattice quantum Monte Carlo simulations using artificial neural networks: Application to the Holstein model Physical review. B./Physical review. B · American Physical Society · 2019 10.1103/physrevb.100.020302
  41. Resonance phenomena controlled by external feedback signals and additive noise in neural systems Scientific Reports · Nature Portfolio · 2019 10.1038/s41598-019-48950-3
  42. Bayesian Optimization of a Free-Electron Laser Physical Review Letters · American Physical Society · 2020 10.1103/physrevlett.124.124801
  43. Demonstration of Machine Learning-Based Model-Independent Stabilization of Source Properties in Synchrotron Light Sources Physical Review Letters · American Physical Society · 2019 10.1103/physrevlett.123.194801
  44. The emission of γ-Ray beams with orbital angular momentum in laser-driven micro-channel plasma target Scientific Reports · Nature Portfolio · 2019 10.1038/s41598-019-55217-4
  45. Using machine learning to predict extreme events in complex systems Proceedings of the National Academy of Sciences · National Academy of Sciences · 2019 10.1073/pnas.1917285117
  46. Re-epithelialization and immune cell behaviour in an ex vivo human skin model Scientific Reports · Nature Portfolio · 2020 10.1038/s41598-019-56847-4
  47. Essential oils against bacterial isolates from cystic fibrosis patients by means of antimicrobial and unsupervised machine learning approaches Scientific Reports · Nature Portfolio · 2020 10.1038/s41598-020-59553-8
  48. Machine learning for active matter Nature Machine Intelligence · Nature Portfolio · 2020 10.1038/s42256-020-0146-9
  49. Noninvasive Identification of Hypotension Using Convolutional-Deconvolutional Networks 2019 10.1109/healthcom46333.2019.9009594
  50. Infrared spectroscopy data- and physics-driven machine learning for characterizing surface microstructure of complex materials Nature Communications · Nature Portfolio · 2020 10.1038/s41467-020-15340-7
  51. Ultrashort electron probe opportunities Nature Photonics · Nature Portfolio · 2020 10.1038/s41566-020-0613-1
  52. Temporal power reconstruction for an x-ray free-electron laser using convolutional neural networks Physical Review Accelerators and Beams · American Physical Society · 2020 10.1103/physrevaccelbeams.23.040701
  53. Exact representations of many-body interactions with restricted-Boltzmann-machine neural networks Physical review. E · American Physical Society · 2021 10.1103/physreve.103.013302
  54. Implementing Analytics Projects in a Hospital: Successes, Failures, and Opportunities INFORMS Journal on Applied Analytics · Institute for Operations Research and the Management Sciences · 2020 10.1287/inte.2020.1036
  55. A MHz-repetition-rate hard X-ray free-electron laser driven by a superconducting linear accelerator Nature Photonics · Nature Portfolio · 2020 10.1038/s41566-020-0607-z
  56. Mechanism and consequences for avoidance of superparasitism in the solitary parasitoid Cotesia vestalis Scientific Reports · Nature Portfolio · 2020 10.1038/s41598-020-67050-1
  57. 3D space-charge model for GPT simulations of high-brightness electron bunches CRC Press eBooks · Informa · 2005 10.1201/9781482269086-16
  58. Machine learning for chemical discovery Nature Communications · Nature Portfolio · 2020 10.1038/s41467-020-17844-8
  59. Transition of Neural Activity From the Chaotic Bipolar-Disorder State to the Periodic Healthy State Using External Feedback Signals Frontiers in Computational Neuroscience · Frontiers Media · 2020 10.3389/fncom.2020.00076
  60. Machine learning for beam dynamics studies at the CERN Large Hadron Collider Nuclear Instruments and Methods in Physics Research Section A Accelerators Spectrometers Detectors and Associated Equipment · Elsevier BV · 2020 10.1016/j.nima.2020.164652
  61. Machine learning and atherosclerotic cardiovascular disease risk prediction in a multi-ethnic population npj Digital Medicine · Nature Portfolio · 2020 10.1038/s41746-020-00331-1
  62. Toward monochromated sub-nanometer UEM and femtosecond UED Scientific Reports · Nature Portfolio · 2020 10.1038/s41598-020-73168-z
  63. Optics Corrections Using Machine Learning in the LHC 10th Int. Particle Accelerator Conf. (IPAC'19), Melbourne, Australia, 19-24 May 2019 · 2019 10.18429/jacow-ipac2019-thprb077
  64. Detection of faulty beam position monitors using unsupervised learning Physical Review Accelerators and Beams · American Physical Society · 2020 10.1103/physrevaccelbeams.23.102805
  65. Single- and two-color attosecond hard x-ray free-electron laser pulses with nonlinear compression Physical Review Research · American Physical Society · 2020 10.1103/physrevresearch.2.042018
  66. Quantum reflection above the classical radiation-reaction barrier in the quantum electro-dynamics regime Communications Physics · Nature Portfolio · 2019 10.1038/s42005-019-0164-2
  67. Machine learning meets complex networks via coalescent embedding in the hyperbolic space Nature Communications · Nature Portfolio · 2017 10.1038/s41467-017-01825-5
  68. Adaptive 3D convolutional neural network-based reconstruction method for 3D coherent diffraction imaging Journal of Applied Physics · American Institute of Physics · 2020 10.1063/5.0014725
  69. Beyond the limits of 1D coherent synchrotron radiation New Journal of Physics · IOP Publishing · 2018 10.1088/1367-2630/aad21d
  70. Machine learning for orders of magnitude speedup in multiobjective optimization of particle accelerator systems Physical Review Accelerators and Beams · American Physical Society · 2020 10.1103/physrevaccelbeams.23.044601
  71. Prospects of measuring $$R_b$$ in hadronic $$\mathrm{Z}$$ decays at the CEPC The European Physical Journal Plus · Springer Science+Business Media · 2021 10.1140/epjp/s13360-020-01001-7
  72. Plasma Hsp90 levels in patients with systemic sclerosis and relation to lung and skin involvement: a cross-sectional and longitudinal study Scientific Reports · Nature Portfolio · 2021 10.1038/s41598-020-79139-8
  73. Unsupervised Machine Learning for Detection of Faulty Beam Position Monitors 10th Int. Particle Accelerator Conf. (IPAC'19), Melbourne, Australia, 19-24 May 2019 · 2019 10.18429/jacow-ipac2019-wepgw081
  74. Accurate and confident prediction of electron beam longitudinal properties using spectral virtual diagnostics Scientific Reports · Nature Portfolio · 2021 10.1038/s41598-021-82473-0
  75. Visualizing lattice dynamic behavior by acquiring a single time-resolved MeV diffraction image Journal of Applied Physics · American Institute of Physics · 2021 10.1063/5.0036619
  76. Lag synchronization of coupled time-delayed FitzHugh–Nagumo neural networks via feedback control Scientific Reports · Nature Portfolio · 2021 10.1038/s41598-021-82886-x
  77. Machine Learning-Based Direct Solver for One-To-Many Problems on Temporal Shaping of Electron Beams Research Square · 2021 10.21203/rs.3.rs-524222/v1
  78. Supervised learning-based reconstruction of magnet errors in circular accelerators The European Physical Journal Plus · Springer Science+Business Media · 2021 10.1140/epjp/s13360-021-01348-5
  79. A novel synthetic microtubule inhibitor exerts antiproliferative effects in multidrug resistant cancer cells and cancer stem cells Scientific Reports · Nature Portfolio · 2021 10.1038/s41598-021-90337-w
  80. High-Fidelity Prediction of Megapixel Longitudinal Phase-Space Images of Electron Beams Using Encoder-Decoder Neural Networks Physical Review Applied · American Physical Society · 2021 10.1103/physrevapplied.16.024005
  81. Development and performance testing of a miniaturized multi-sensor system combining MOX and PID for potential UAV application in TIC, VOC and CWA dispersion scenarios The European Physical Journal Plus · Springer Science+Business Media · 2021 10.1140/epjp/s13360-021-01858-2