  Online unsupervised detection of anomalies is crucial to guarantee the
correct operation of cyber-physical systems and the safety of humans
interacting with them. State-of-the-art approaches based on deep learning via
neural networks achieve outstanding performance at anomaly recognition,
evaluating the discrepancy between a normal model of the system (with no
anomalies) and the real-time stream of sensor time series. However, large
training data and time are typically required, and explainability is still a
challenge to identify the root of the anomaly and implement predictive
maintainance. In this paper, we use causal discovery to learn a normal causal
graph of the system, and we evaluate the persistency of causal links during
real-time acquisition of sensor data to promptly detect anomalies. On two
benchmark anomaly detection datasets, we show that our method has higher
training efficiency, outperforms the accuracy of state-of-the-art neural
architectures and correctly identifies the sources of >10 different anomalies.
The code is at https://github.com/Isla-lab/causal_anomaly_detection.
