## 1 Introduction  
Human interactions with the environment are directed by their ability to understand the consequences of their actions, including failures, and their ability to learn from such failures. For robot motion, we consider introspection to be the ability to assess streaming sensory data quality, the actions that data underpin, and how actions are performed. When robots learn models from demonstrated data, their long-term autonomy capability depends on their ability to have good insights into the data--allowing them to differentiate nominal conditions from anomalous ones. In this work, we improve the introspection ability initially presented in our Sense-Plan-Act-Introspect-Recover (SPAIR) system (http://www:juanrojas.net/re_enact_adapt/). The introspection portion of the framework (see Figure 1) enables robots to better understand their state at a high level [1,2]. The SPAIR system consists of four modules: (i) task representation through a Finite-State Machine (FSM); (ii) motion modules that encode manipulation skills through movement generation techniques [3, 4, 5, 6]; (iii) introspection modules that identify and classify anomalies; and (iv) anomaly recovery policies performed with respect to a specific anomaly. We make use of multivariate time series to represent robot multimodal sensory-motor data. If current multimodal data representation trends continue, robots will become increasingly multimodal, making the study of multimodal anomaly detection and classification ever more pertinent for introspection. Over the past decade, modeling multivariate time series has received significant interest by applying HMM or supervised learning techniques. For example, describing human motion requires the formulation of a model that represents the large number of degrees of freedom provided by human joints [7,8]. In this paper, we consider methods for learning models for multivariate time series with complex and uncertain behavior patterns during different robot execution phases. Specifically, we show how Bayesian non-parametric methods can be used to provide a flexible and valuable structure for modeling and learning multivariate sensory data. Unlike how parametric models require a specific number of hidden states in advance, non-the parametric method allows the inference of latent states automatically from provided data and promises better capture of the spatial, temporal, and hierarchical structure expected in the underlying data. Here, we primarily examine two research questions regarding robot introspection using Bayesian non-parametric methods: what is the best way to model the multivariate time series for anomaly detection, and how can we classify anomalies after anomalies are triggered? For the anomaly detection, we achieved it by comparing the cumulative log-likelihood deviation to a given threshold from nominal executions [1,2,9]. An improved anomaly detector will be proposed in this paper, which can more effectively and robustly detect the anomalies. To do so, our anomaly detector learns a generative Bayesian non-parametric HMM of the multivariate time-series data, which can model the spatial and temporal patterns into a low-dimensional hidden-state space. A nominal criterion is  
Figure 1: Manipulation tasks are controlled through a graph-based scheme consisting of nodes and edges. Each node contains three types of modules: (i) motion; (ii) visualization; (iii) and introspection; all of which run in parallel. Motion modules use pose goals provided by the visualization module as well as node-specific skill parameters to generate desirable skills. Introspection modules use node-specific model, parameter, and hyper-parameter settings to continually look for anomalies. If detected, the introspection modules further classify them. A recovery critic then issues a policy for re-enactment or adaptation. consequently learned from nominal training data under the hidden-state representation. The learned criterion is used to discriminate anomalies from the nominal execution by log-likelihood thresholding.