Machine Learning for Anomaly Detection in Neural Network Security and SRF Cavities