## 7 Results and Analysis
### Anomaly Classification in a Kitting Experiment
#### 7.2.3 Results  
To avoid overfitting, we performed _3-fold_ cross validation for each anomaly type separately. An 18-dimensional feature vector was used as presented in Equation (36). We compare against five baselines consisting of parametric HMMs (with a fixed number of hidden states), various observation models, and various variational inference methods. The training and testing dataset for all the classification methods was the same in this comparison. All methods were trained according to Algorithm 1. \(\bullet\)_Parametric HMM Settings:_ We train 3 differing types of HMMs for each anomaly class. Each HMM uses four different numbers of hidden states \(K\in\{3,5,7,10\}\) to train each class. We need to estimate the transition matrix, mean, and covariance parameters. To this end, K-Means++ [55] clusters the data and yields initial estimates. During testing, we evaluate a test sample against all classes and select the class with the largest log-likelihood. The parametric HMMs result summary is presented in Table 2.  
\(\circ\)_HMM-Gauss-EM_: A classifier based on a classical HMM with Gaussian observations was trained independently for each anomaly class. The standard Baum-Welch Expectation Maximization algorithm [56] was used to learn the HMM model. \(\circ\)_HMM-Gauss-VB:_ A classifier based on classical HMM with Gaussian observation was trained independently for each anomaly class. The standard Variational Bayesian (VB) inference algorithm [57] was used to learn the HMM model. \(\circ\)_HMM-AR-VB:_ A classifier based on a classical HMM with first-order auto-regressive Gaussian observations was trained independently for each anomaly class. The standard VB inference algorithm [57] was used to learn the HMM model. In conclusion, we find that for parametric HMMs (i) the best classification accuracy rate was 95.7% when using 5 to 7 fixed states; (ii) variational inference algorithms outperformed the standard EM algorithm; (iii) the auto-regressive observation model classified better than the Gaussian model due to  
Figure 10: A TC sample is shown in the red window of \(window\_size=2\) s.  
it is linear conditional nature; (iv) parametric HMMs, in general, are less effective at jointly modeling the dynamics of the robotic task. Therefore, we consider a Bayesian non-parametric version of HMMs with a hierarchical prior, which shares statistical strength across the training samples. \(\bullet\)_Non-parametric HMMs Setting:_ We also train 4 kinds of classifiers based on non-parametric HMMs, independently for each anomaly class. We specify the truncation number of states as K = 10 as explained in Section 3.2. Compared to the parametric HMMs, the actual number of hidden states of each anomaly class is automatically learned from data in non-parametric fashion. The same procedure during testing as described in parametric HMMs. Benefits from the automatic state inference with HDP-HMM, the auto-regressive correlation of the anomaly data, and the effective variational inference techniques. The summary of classification results of non-parametric HMMs are presented in Table 2. Those numbers in blue are denoted the optimal classification accuracy of specific anomaly type across all the methods, respectively. \(\circ\)_HDP-HMM-Gauss-VB:_ A classifier based on HDP-HMM with Gaussian observation was trained independently for each anomaly class. The standard VB inference algorithm [32] was used to learn the HDP-HMM model. Similar to the method proposed in [38], instead of the blocked Gibbs sampling algorithm, we learn the model by Variational Bayesian inference. \(\circ\)_HDP-HMM-Gauss-moVB:_ A classifier based on HDP-HMM with Gaussian observation was trained independently for each anomaly class. A memorized online variational inference (moVB) [58] based on scalable adaptation of state complexity is used to learn this HDP-HMM model. \(\circ\)_HDP-HMM-AR-VB:_ A classifier based on HDP-HMM with first-order auto-regressive Gaussian observation was trained independently for each anomaly class.