Ensemble Methods for Sequence Classification with Hidden Markov Models

Maxime Kawawa-Beaudan, Srijan Sood, Soham Palande, Ganapathy Mani, Tucker Balch, Manuela VelosoarXiv 2024 · DOI

Abstract

This paper introduces HMM-e, a lightweight ensemble framework designed to revitalize Hidden Markov Models (HMMs) for modern sequence classification tasks. Traditional deep learning models, such as CNNs and LSTMs, often struggle with extreme data imbalance and variable sequence lengths. HMM-e addresses these issues through class-specific bagging and a novel tournament-style pairwise scoring method. Evaluated on genomics benchmarks with a 50:1 imbalance ratio, HMM-e demonstrates superior precision and robustness compared to deep learning baselines, while remaining computationally efficient on standard CPU hardware.

Introduction

Sequence classification is a fundamental task in machine learning, with applications ranging from financial fraud detection to genomic sequencing. Despite the dominance of deep learning architectures like LSTMs and Transformers, two significant challenges persist in real-world scenarios:

  1. Data Imbalance: In domains like anomaly detection, positive instances are often extremely rare. Deep models frequently overfit the majority class, leading to poor detection of critical minority events.
  2. Variable Sequence Lengths: Standard neural networks often require padding or truncation to handle non-uniform sequences. Furthermore, raw HMM likelihoods are inherently biased by sequence length, as longer sequences naturally yield lower joint probabilities.

HMM-e aims to provide a robust, interpretable, and efficient alternative that excels in these challenging conditions.

The HMM-e Framework

The core of the HMM-e (Ensemble HMM) framework lies in its unique training and inference strategy.

Class-Specific Bagging

Instead of a single monolithic model, HMM-e employs an ensemble of $N$ models for the positive class and $M$ models for the negative class. Diversity is ensured by training each sub-model on a small, random subset (e.g., 1%) of the available data.

Tournament Scoring and Normalization

To classify an unseen sequence, HMM-e performs a "tournament" across the ensemble. The sequence is processed by every positive and negative model. The final score, $s(O)$, is calculated based on how many times a positive model's likelihood outscores a negative model's. This pairwise comparison effectively normalizes for sequence length, as the length-induced decay is consistent across all models for the same input sequence.

Overview of the HMM-e training and inference pipeline.

Hybrid Architectures

HMM-e can also serve as a non-linear feature extractor. The vector of likelihoods generated by the ensemble can be fed into downstream discriminative classifiers, such as Support Vector Machines (SVMs) or Multi-Layer Perceptrons (MLPs), combining temporal generative modeling with modern discriminative power.

Experimental Setup

The framework was evaluated using an open-source genomics benchmark featuring four datasets: human_nontata_promoters, human_enhancers_ensembl, demo_human_or_worm, and demo_coding_vs_intergenomics. To simulate realistic "needle-in-a-haystack" scenarios, the positive classes were subsampled to create a 50:1 imbalance ratio.

Discussion: The Role of Diversity

A key insight of this work is the importance of ensemble diversity. By using diverse initializations and data subsets, "weak" HMMs aggregate into a "strong" classifier. Analysis of model similarity matrices reveals that a well-trained ensemble maintains low inter-model correlation, preventing the system from collapsing into redundant, inefficient blocks.

Similarity matrix of a well-trained HMM-e ensemble, demonstrating high model diversity.

Key Results

In highly imbalanced settings, HMM-e significantly outperformed deep learning alternatives:

  • Superior Precision: On the demo_coding_vs_intergenomics dataset, the HMM-e + NN hybrid achieved an Average Precision (AP) of 52.1, compared to 32.6 for CNNs and 23.1 for LSTMs.
  • Robustness: HMM-e maintained high AUC-ROC and AP scores even as imbalance increased, whereas the performance of CNNs and LSTMs dropped sharply.
  • Computational Efficiency: HMM-e is lightweight and does not require GPU acceleration, making it suitable for standard CPU-based production environments.

Conclusion and Future Work

HMM-e offers a compelling alternative for sequence classification under data constraints. Future research directions include expanding the framework to multivariate and continuous data via Gaussian HMMs, implementing ensemble pruning for increased efficiency, and exploring generative data augmentation to further enhance downstream neural network training.

Summary updated

BibTeX
@misc{kawawabeaudan2024ensemble,
  author = {Maxime Kawawa-Beaudan and Srijan Sood and Soham Palande and Ganapathy Mani and Tucker Balch and Manuela Veloso},
  title = {{Ensemble Methods for Sequence Classification with Hidden Markov Models}},
  year = {2024},
  eprint = {2409.07619},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2409.07619},
}
Figure