## 2 Related Work
### Anomaly Detection and Classification  
The premise of performing anomaly detection is to endow robots with longer-term autonomy. To this end, we would like to discriminate between nominal and anomalous behavior while the robot executes a task. In this work, we define an anomaly whenever a data stream is structurally different from prior learned models [33]. As [PERSON] et al. 's review paper shows, many anomaly detection approaches have been proposed in the last decade [34]. However, few works focused on multivariate time series with spatial and temporal dependencies as in our case. In [PERSON] et al. [35], the method requires the full data sequence for processing, thus precluding the online detection capability. Besides our previous work [9; 36], others have used non-parametric Bayesian approaches to learn HMMs in contact tasks for abnormal detection and recognition. In [37; 38], [PERSON] et al. used the sticky hierarchical Dirichlet process prior to learn the model parameters of an HMM based on wrench signatures for an industrial robot alignment task. The work learned specific failure modes online. The approach is robust as it models not just individual contact events but rather the evolution of signals, doing so while incorporating domain knowledge, and adjusting its model complexity according to the data patterns presented. Nonetheless, the approach is limited by the assumptions of the HMM in which observations are conditionally independent given the state. This is often an insufficient condition to capture the temporal dependencies of complex dynamical behaviors. In [14], [PERSON] et al. used a beta-process prior on the vector auto-regressive (BP-AR-HMM) to extract the state complexity from the data. The BP-AR-HMM can discover and model primitives from multiply-related time series. Robot skill discrimination was reliable and consistent; however, this work only modeled robot joint angles in a primarily non-contact-oriented task. In [39], [PERSON] et al. implemented anomaly detection based on HDP-HMM models and analyzed the efficiency and effectiveness of beam sampling in the HDP-HMM model. This implementation, however, suffers from low computational efficiency. Instead, we explore efficient online inference algorithms instead of the conventional sampling algorithms. Over the past decade, multivariate time-series classification has received significant interest in areas such as healthcare, object recognition, and human action recognition [40; 41; 42]. In robotics--complex semi-autonomous systems that have provided extensive assistance to humans--anomalies occur occasionally [43]. For this reason, enabling accurate, robust, and fast anomaly detection and classification in robots has the potential to enable more effective, safer, and more autonomous systems. Execution monitoring, especially with the focus on detecting and classifying anomalous executions, has been well studied in robotics [44]. [PERSON] et al. [43] introduced a multimodal execution monitoring system to detect and classify anomalous executions for robot-assisted feeding. Specifically, the classifier labeled not only the anomaly type but also the cause of the anomaly by using an artificial neural network system. The neural net successfully integrated the anomaly detection and classification for assisting a person with severe quadriplegia. However, due to the HMM anomaly detector limitations, the classified accuracy for anomaly types and causes are 90.0% and 54.0%, respectively. In [45], [PERSON] et al. introduced a monitoring system that also can detect, classify, and correct anomalous behaviors using a predictive model. Those two integrated systems give us a lot of inspiration and confidence for improving the robot introspection with the anomaly detection and classification. The anomaly classification has been used to determine the source of anomalies while running manipulator or mobile robots [46].