Anomaly detection is an important task for complex scientific experiments and other complex systems (e.g. industrial facilities, manufacturing), where failures in a sub-system can lead to lost data, poor performance, or even damage to components. While scientific facilities generate a wealth of data, labeled anomalies may be rare (or even nonexistent), and expensive to acquire. Unsupervised approaches are therefore common and typically search for anomalies either by distance or density of examples in the input feature space (or some associated low-dimensional representation). This paper presents a novel approach called coincident learning for anomaly detection (CoAD), which is specifically designed for multi-modal tasks and identifies anomalies based on coincident behavior across two different slices of the feature space. We define an unsupervised metric, F<^>beta, out of analogy to the supervised classification F beta statistic. CoAD uses F<^>beta to train an anomaly detection algorithm on unlabeled data, based on the expectation that anomalous behavior in one feature slice is coincident with anomalous behavior in the other. The method is illustrated using a synthetic outlier data set and a MNIST-based image data set, and is compared to prior state-of-the-art on two real-world tasks: a metal milling data set and our motivating task of identifying RF station anomalies in a particle accelerator.
Accelerator physics relies on numerical algorithms to solve optimization problems in online accelerator control and tasks such as experimental design and model calibration in simulations. The effectiveness of optimization algorithms in discovering ideal solutions for complex challenges with limited resources often determines the problem complexity these methods can address. The accelerator physics community has recognized the advantages of Bayesian optimization algorithms, which leverage statistical surrogate models of objective functions to effectively address complex optimization challenges, especially in the presence of noise during accelerator operation and in resource-intensive physics simulations. In this review article, we offer a conceptual overview of applying Bayesian optimization techniques towards solving optimization problems in accelerator physics. We begin by providing a straightforward explanation of the essential components that make up Bayesian optimization techniques. We then give an overview of current and previous work applying and modifying these techniques to solve accelerator physics challenges. Finally, we explore practical implementation strategies for Bayesian optimization algorithms to maximize their performance, enabling users to effectively address complex optimization challenges in real-time beam control and accelerator design.
To demonstrate the feasibility of automating UED operation and diagnosing the machine performance in real time, a two-stage machine learning (ML) model based on self-consistent start-to-end simulations has been implemented. This model will not only provide the machine parameters with adequate precision, toward the full automation of the UED instrument, but also make real-time electron beam information available as single-shot nondestructive diagnostics. Furthermore, based on a deep understanding of the root connection between the electron beam properties and the features of Bragg-diffraction patterns, we have applied the hidden symmetry as model constraints, successfully improving the accuracy of energy spread prediction by a factor of five and making the beam divergence prediction two times faster. The capability enabled by the global optimization via ML provides us with better opportunities for discoveries using near-parallel, bright, and ultrafast electron beams for single-shot imaging. It also enables directly visualizing the dynamics of defects and nanostructured materials, which is impossible using present electron-beam technologies.
Accelerator performance often deteriorates with time during a long period of operation due to secular changes in the machine components or the surrounding environment. In many cases, some tuning knobs are effective in compensating the performance drifts and optimization methods can be used to find the ideal machine setting. However, such intervention usually cannot be done without interrupting user operation as the optimization algorithms can substantially impact the machine’s performance. We propose an optimization algorithm, Safe Robust Conjugate Direction Search, which can perform accelerator tuning while keeping the machine performance within a designated safe envelope. The algorithm builds probability models of the objective function using Lipschitz continuity of the function as well as characteristics of the drifts and applies to the selection of trial solutions to ensure the machine operates safely during tuning. The algorithm can run during normal user operation constantly, or periodically, to compensate for the performance drifts. Simulation and online tests have been done to validate the performance of the algorithm.
Optimization algorithms/techniques such as genetic algorithm, particle swarm optimization, and Gaussian process have been widely used in the accelerator field to tackle complex design/online optimization problems. However, connecting the algorithm with the optimization problem can be difficult, as the algorithms and the problems may be implemented in different languages, or they may require specific resources. We introduce an optimization platform named Teeport that is developed to address the above issues. This real-time communication-based platform is designed to minimize the effort of integrating the algorithms and problems. Once integrated, the users are granted a rich feature set, such as monitoring, controlling, and benchmarking. Some real-life applications of the platform are also discussed.
While the APS linac [1] lattice is set up using a model developed with ELEGANT [2], the thermionic RF gun [3, 4] front-end beam dynamics has been difficult to model. One of the issues is that beam properties from the thermionic gun can vary from time to time. As a result, linac front-end beam tuning is required to establish good matching and maximize the charge transported through the linac. We have been using a Nelder-Mead (or simplex) [5] optimizer to find the best settings for the gun front-end magnets and steering magnets. However, it takes a long time and requires fairly good initial conditions. Therefore, we imported other on-line optimizers, such as robust conjugate direction search (RCDS) [6], which is a classic optimizer (as is Nelder-Mead), multi-objective particle swarm (MOPSO) [7], and multi-generation Gaussian process optimizer (MG-GPO) [8], which is based on a machine learning (ML) technique. In this paper we report our experience with these on-line optimizers for maximum bunch charge transportation efficiency through the APS linac.
To harness the full potential of the ultrafast electron diffraction (UED) and microscopy (UEM), we must know accurately the electron beam properties, such as emittance, energy spread, spatial-pointing jitter, and shot-to-shot energy fluctuation. Owing to the inherent fluctuations in UED/UEM instruments, obtaining such detailed knowledge requires real-time characterization of the beam properties for each electron bunch. While diagnostics of these properties exist, they are often invasive, and many of them cannot operate at a high repetition rate. Here, we present a technique to overcome such limitations. Employing a machine learning (ML) strategy, we can accurately predict electron beam properties for every shot using only parameters that are easily recorded at high repetition rate by the detector while the experiments are ongoing, by training a model on a small set of fully diagnosed bunches. Applying ML as real-time noninvasive diagnostics could enable some new capabilities, e.g., online optimization of the long-term stability and fine single-shot quality of the electron beam, filtering the events and making online corrections of the data for time-resolved UED, otherwise impossible. This opens the possibility of fully realizing the potential of high repetition rate UED and UEM for life science and condensed matter physics applications.
We present a multi-objective evolutionary optimization algorithm that uses Gaussian process (GP) regression-based models to select trial solutions in a multi-generation iterative procedure. In each generation, a surrogate model is constructed for each objective function with the sample data. The models are used to evaluate solutions and to select the ones with a high potential before they are evaluated on the actual system. Since the trial solutions selected by the GP models tend to have better performance than other methods that only rely on random operations, the new algorithm has much higher efficiency in exploring the parameter space. Simulations with multiple test cases show that the new al-gorithm has a substantially higher convergence speed and stability than NSGA-II, MOPSO, and some other recent preselection-assisted algorithms.
Online optimization is critical for realizing the design performance of accelerators. Highly efficient stochastic optimization algorithms are needed for many online accelerator optimization problems in order to find the global optimum in the non-linear, coupled parameter space. In this study, we propose to use the multi-generation Gaussian process optimizer for online accelerator optimization and demonstrate that the algorithm is significantly more efficient than other stochastic algorithms that are commonly used in the accelerator community.
Nonlinear beam dynamics optimization is essential in a low emittance storage ring design. Multi-objective optimization algorithms are needed in order to simultaneously optimize the dynamic aperture and the momentum aperture. In this study we demonstrate the application of a highly efficient stochastic optimization algorithm, the multi-generation Gaussian process optimizer (MG-GPO), to storage ring nonlinear dynamics optimization by successfully applying the method to the SPEAR3 upgrade lattice. It is shown that the new method, owing to its capability of selecting high rank candidates from a large number of trial solutions, converges significantly faster than the commonly used traditional algorithms, multi-objective genetic algorithms (MOGA) and particle swarm optimization (PSO).
We present a multi-objective evolutionary optimization algorithm that uses Gaussian process (GP) regression-based models to select trial solutions in a multi-generation iterative procedure. In each generation, a surrogate model is constructed for each objective function with the sample data. The models are used to evaluate solutions and to select the ones with a high potential before they are evaluated on the actual system. Since the trial solutions selected by the GP models tend to have better performance than other methods that only rely on random operations, the new algorithm has much higher efficiency in exploring the parameter space. Simulations with multiple test cases show that the new algorithm has a substantially higher convergence speed and stability than NSGA-II, MOPSO, and some other more recent algorithms.
A 50MeV electron linac have been developed in Tsinghua University, which consists of a 1.6 cell photocathode rf gun, a 3-meter s-band SLAC type traveling wave (TW) accelerating structure an a s-band TW buncher. The photocathode rf gun is working at ∼110MV/m with very small dark current. The emittance of the electron beam is less than 1mm·mrad at 500 pC, and 0.5mm.mrad at 200 pC. The linac is designed for Tsinghua Thomson scattering X-ray source (TTX). The total photon yield has been increased to ∼2×107 photon/bunch at 50 keV after upgrade of the facility and the spectra have been reconstructed by two kinds of methods. Recent experiments have demonstrate that TTX can be applied in phase contrast imaging, computed tomography and X-ray polarization control. Electron bunch train has been produced to generate narrow-band THz radiation.
This study aims to explain the development of S-band photocathode RF guns at Tsinghua University, with especial attention on the progress of guns developed after 2011. Two types of RF guns were developed based on the BNL/SLAC/UCLA gun prior 2011. These guns have been operated as electron sources for Tsinghua Thomson scattering X-ray source (TTX), MeV ultrafast electron diffraction, and Shanghai deep ultraviolet FEL test facility. Based on our operation experiences and other gun modifications worldwide, numerous improvements have been proposed, and seven third-type guns have been designed and fabricated since 2011. Cold tests of all third-type guns have been completed, confirming a significantly improved quality factor and mode separation. The first third-type gun has been installed on TTX and operated for four years, demonstrating high gradient, low dark current, stable quantum efficiency, and small emittances. The optimal transverse emittance was εx=0.56mmmrad, εy=0.66mmmrad for 200pC with a peak current of 25A, and εx=0.78mmmrad, εy=0.92mmmrad for 500pC with a peak current of 62.5A under a 110MV/m gun gradient.
The roughness of a photocathode could lead to an additional uncorrelated divergence of the emitted electrons and therefore to an increased thermal emittance. To calculate the emittance growth due to the cathode roughness, people usually choose a simple 2D sinusoidal surface model to avoid mathematical complexity. In this paper, we demonstrate an analytical method, which is inspired by the point spread function that has been widely used in radiation imaging field, to accurately evaluate the emittance growth due to the random roughness of a real-life cathode. Both analytical and numerical studies are performed. Our analytical formulas clearly reveal the relationship between the surface roughness and the emittance growth. Both analytical and numerical results surprisingly show that in the typical 3D random surface case, the influence of the surface roughness on the emittance growth is much smaller than the 2D sinusoidal case with typical roughness properties, however with roughness properties which are matched to the 3D case, the emittance growth conditions in these two cases are very similar. Even with applied electric field strength up to 120 MV/m, the total emittance growth is still below 10%. It implies that the large emittance growth (50%-100%) observed on metallic cathodes in some experiments, which is generally believed to be the result of the electric field on the rough surface, might be due to some other reasons.
The roughness of a photocathode could lead to an additional uncorrelated divergence of the emitted electrons and therefore to an increased thermal emittance. The randomness of the real-life photocathode surface makes it unrealistic to perform typical beam dynamics simulation to study the roughness emittance growth. We develope a numerical simulation code based on the point spread function (PSF) and an estimated form of electric field distribution on an arbitrary gently undulating surface to deal with the problem. The simulation result shows that the emittance growth factor is 1.04, which is much smaller than expected (1.5 ∼ 2).
Thomson Scattering sources have attracted a lot of interest as the new generation of bright X-ray sources. Traditional spectra measurement methods, applied to measured Thomson Scattering source, are troublesome as the X-ray beam is too intense to cause pile up problems. In this case, the analysis of attenuation data, which can provide some information about the spectral distribution, as not affected by the rate of incidence of photons, is a good candidate to measure the X-ray spectrum of the Thomson Scattering. We introduce an iterative statistical algorithm (Expectation-Maximization) to reconstruct the spectra from the attenuation data and a numerical experiment is carried out to test the spectrum reconstruction process. This method performs well to reconstruct the local spectra at small collecting angles. In order to reconstruct spectra at large collecting angles, a new method to process the attenuation data was proposed based on the spectral property of Thomson Scattering source. At collecting angles less than 3.5 mrad, our method performs well and we can also still use it to evaluate the FWHM of the spectra at larger angles.