  Particle accelerators are complex and comprise thousands of components, with
many pieces of equipment running at their peak power. Consequently, particle
accelerators can fault and abort operations for numerous reasons. These faults
impact the availability of particle accelerators during scheduled run-time and
hamper the efficiency and the overall science output. To avoid these faults, we
apply anomaly detection techniques to predict any unusual behavior and perform
preemptive actions to improve the total availability of particle accelerators.
Semi-supervised Machine Learning (ML) based anomaly detection approaches such
as autoencoders and variational autoencoders are often used for such tasks.
However, supervised ML techniques such as Siamese Neural Network (SNN) models
can outperform unsupervised or semi-supervised approaches for anomaly detection
by leveraging the label information. One of the challenges specific to anomaly
detection for particle accelerators is the data's variability due to system
configuration changes. To address this challenge, we employ Conditional Siamese
Neural Network (CSNN) models and Conditional Variational Auto Encoder (CVAE)
models to predict errant beam pulses at the Spallation Neutron Source (SNS)
under different system configuration conditions and compare their performance.
We demonstrate that CSNN outperforms CVAE in our application.
