State Sequence Analysis in Hidden Markov Models

Yuri Grinberg, Theodore J. PerkinsUAI 2015

Introduction

In the realm of Hidden Markov Models (HMMs), the Viterbi algorithm is the standard for inferring hidden states. However, Viterbi is designed to find the most likely trajectory—the specific state at every time step. In many practical applications, such as activity recognition or gene annotation, the exact timing is less important than the sequence of states visited. This paper introduces State Sequence Analysis (SSA), an algorithm that marginalizes out dwelling times to find the most probable order of states, offering significant improvements in accuracy, particularly in noisy environments.

Methodology: Beyond the Most Likely Trajectory

The fundamental flaw in using Viterbi for sequence inference is that the most probable trajectory does not necessarily correspond to the most probable sequence. A sequence may be highly likely because it is supported by numerous trajectories with varying timings, even if no single trajectory is dominant. Viterbi is an "overly specific inference" that can be misled by noisy data or atypical paths that happen to have high peak probability at specific timestamps.

SSA addresses this by treating transition times as nuisance variables and marginalizing them. The authors developed a recursive evaluation formula that computes the probability of a state sequence in $O(nk)$ time. To handle the vast search space of possible sequences, SSA employs a dominance-based pruning strategy, maintaining a set of non-dominated sequences to efficiently find the most probable one.

HMM model for synthetic event detection experiments illustrating the state transitions and emission distributions.

Experimental Evaluation

The performance of SSA was benchmarked against Viterbi using both synthetic and real-world data:

  1. Synthetic Models: Controlled HMMs designed to simulate rare events (like security intrusions) hidden within noisy background data.
  2. House A Dataset: A real-world activity recognition benchmark containing 592 hours of sensor data and 10 annotated activities performed by an individual in a smart home.

Results and Discussion

SSA consistently outperformed Viterbi in sequence inference tasks. In synthetic experiments, SSA achieved a higher "Correct Fraction" of inferences, especially as the signal-to-noise ratio ($\mu_B$) decreased. SSA also demonstrated significantly fewer false positives than the Viterbi-based approach.

Performance comparison (C) and confusion matrices (D) for Viterbi and SSA, showing SSA's superior accuracy in noisy conditions.

On the real-world "House A" dataset, SSA and Viterbi disagreed on approximately 5% of trajectories. In these instances of disagreement, SSA's prediction was correct twice as often as Viterbi's. In a broader simulation of 1,000 trajectories from the House A model, SSA showed a 70% improvement in performance over the proposed method.

These results highlight SSA's robustness to noise. While Viterbi can be forced into specific, low-probability sequences to satisfy timing constraints, SSA captures the more representative behavior of the system by averaging away the transition times.

Conclusion

State Sequence Analysis provides a more principled approach to sequence inference in HMMs than the standard Viterbi algorithm. By marginalizing over dwelling times, SSA avoids the "overly specific inference" trap. While SSA is computationally more demanding—taking minutes where Viterbi takes seconds—its superior accuracy in noisy and real-world scenarios makes it a compelling alternative for applications where the sequence of events is the primary concern. Future work includes extending SSA to Hidden Semi-Markov Models (HSMMs) to accommodate more complex dwelling-time distributions.

Summary updated

BibTeX
@inproceedings{grinberg2015state,
  author = {Yuri Grinberg and Theodore J. Perkins},
  title = {{State Sequence Analysis in Hidden Markov Models}},
  booktitle = {Conference on Uncertainty in Artificial Intelligence},
  year = {2015},
}
Figure