## 8 Discussion  
Comprehensive experimental results showed robust, sensitive, and better-timed anomaly detection and classification for a wide range of anomalous situations in an unstructured co-bot scenario where a human and a robot collaborated to complete kitting tasks. The improved anomaly detector exploits the mapping relationship between latent states and the marginal log-likelihood values  
Figure 11: Confusion matrix for classification results on kitting experiment dataset with seven anomalies by HDP-HMM-AR-moVB method. Figure 12: The number of hidden states being active for different anomaly classes using HDP-HMM-AR-moVB method. An active state is one in which at least one observation is assigned to this state. from the sHDP-VAR-HMM for monitoring anomalies. The multiclass classifier that is flagged when an anomaly is detected was also tested through the sHDP-VAR-HMM on seven anomalies and six baseline methods. Our evaluations showed that we could not only detect anomalies reliably (overall accuracy of 91.0%) but also classify them precisely (overall accuracy of 97.1%). With regard to anomaly detection, Table 1 indicated that our proposed detector achieved unexpectedly superior _recall_ measurements compared to the baseline (the gradient-based method of Section 7.1), an improvement of 61.7%. By adjusting the anomaly detection threshold during the task's progress execution as a function of the maximum and minimum of the log-likelihood of observations for latent states, we gained enhanced sensitivity. Human-centric safety approaches dictate that increased sensitivity is highly desirable in human-robot collaboration tasks to provide higher safety guarantees for a human. Robotic work cells on the other hand may work better with approaches such as the GD (Section 7.1) that was less sensitive but had higher precision. Here the reduction in the false-positive rate may support longer-term autonomy in a work cell. The anomaly detector exhibited not only a better _accuracy_ but also more accurately timed anomaly flags. That is, our anomaly flags occurred closer to the ground truth time. This would be useful. Timeliness may prove a critical role in cases where anomalies are triggered as a chain reaction, i.e., anomalies cause more anomalies. By acquiring more timely detection, we may be able to also provide more timely recovery techniques or even prevention to minimize the possibility of a cascade of anomalies. With regard to anomaly classification, anomalies usually occur from various sources such as sensing errors, control failures, or environmental changes [59]. If a robot identifies the type, it may be beneficial to prevent or at least recover from the anomalous situation. In our proposed classification method, we trained the sHDP-VAR-HMM model for each anomaly type separately. To address this, [PERSON] et al. [60] had proposed a signal discriminative HDP-HMM for all classes, albeit with an extra level that is class specific. Thus, an interesting future direction consists of investigating a multilevel sHDP-VAR-HMM for all classes for multiclass classification and the extensions of the observation model by using higher-order auto-regressive Gaussian models. Development of robot introspection is expected to have a direct impact on a large variety of practical applications, such that can be used to estimate the log-likelihood of failure and prevent failure during robot manipulation tasks. Also, the improvement of safety in the human-robot collaborative environment by assessing the quality of learned internal model for each skill is important, which can speed up the anomaly recovery and/or repair process by providing the detailed skill identification and anomaly monitoring. There are several limitations in our work. Currently we do not explicitly reduce the influence of outliers occasionally found in the derived log-likelihood values for specific hidden states. The outliers have a significant impact on the calculation of the threshold and our approach needs to address them specifically to avoid their impact.