NeuralNetwork-Viterbi: A Framework for Weakly Supervised Video Learning

Alexander Richard, Hilde Kuehne, Ahsan Iqbal, Juergen Gall · DOI

Abstract

Training models for temporal action segmentation typically requires dense, frame-level annotations, which are costly to produce. This paper introduces NeuralNetwork-Viterbi (NN-Viterbi), a novel end-to-end framework for weakly supervised learning that requires only an ordered list of actions (transcripts). By integrating Viterbi decoding directly into the neural network's loss function and explicitly modeling action lengths, the proposed method avoids the instabilities of pseudo-ground-truth generation. Experimental results on standard benchmarks show significant performance gains, including a 10% improvement in frame accuracy on the Breakfast dataset.

Introduction

Temporal action segmentation involves dividing long, untrimmed videos into a sequence of distinct actions, such as "crack egg" or "stir." While supervised learning has seen success, the requirement for frame-by-frame labeling is a major bottleneck. Weakly supervised methods address this by using transcripts—ordered lists of actions without timestamps—as the only supervision during training.

Traditional weakly supervised approaches often employ a two-step iterative process: generating a "pseudo ground-truth" alignment and then training a neural network on these labels. However, this approach is prone to instability, oscillation between iterations, and is generally unsuitable for online learning. Furthermore, standard Hidden Markov Models (HMMs) used in these pipelines often fail to capture the varying durations of human actions effectively.

Methodology

The NN-Viterbi framework addresses these challenges by allowing a neural network to learn directly from transcripts in an online fashion.

Viterbi-based Network Training

Instead of separating alignment and training, NN-Viterbi incorporates Viterbi decoding directly into the training loop. The network predicts frame-wise action probabilities, and the Viterbi algorithm finds the optimal alignment constrained by the transcript. The network then computes a cross-entropy loss based on this alignment to update its weights immediately.

The NN-Viterbi framework integrates Viterbi decoding into the neural network training loop, allowing direct optimization from action transcripts.

Explicit Length and Context Models

To move beyond the limitations of HMMs, the authors introduce an explicit length model using a class-dependent Poisson distribution and a context model based on a stochastic grammar. This allows the system to learn the statistical duration of specific actions, providing a more realistic representation of human activity. Swapping the HMM for an explicit length model alone yielded a significant +6% accuracy boost.

Replay Buffer for Robustness

Processing long video sequences can introduce "sequence bias," where the model's gradients are heavily skewed toward the current video, leading to catastrophic forgetting of previously learned classes. To stabilize training, the authors implement a memory buffer of recently processed sequences. During training, a small ratio of frames (1:25) is sampled from this buffer to provide a more diverse and stable gradient signal.

Experimental Results

The framework was evaluated on three major datasets: Breakfast (1,712 videos), 50 Salads (50 long videos), and Hollywood Extended (937 videos).

Performance Benchmarks

NN-Viterbi significantly outperformed existing state-of-the-art weakly supervised methods. On the Breakfast dataset, it achieved 43.0% frame accuracy, compared to the previous HMM/RNN state-of-the-art of 33.3%. On the 50 Salads dataset, accuracy reached 49.4%. For action alignment tasks on Hollywood Extended, the model achieved a 48.7% Jaccard index.

Impact of Robust Training

The introduction of the replay buffer proved critical for performance. As shown in the training curves, the "robust" training approach using the buffer achieves much higher and more stable accuracy compared to pure online learning, which only reached 27.2% accuracy on the Breakfast dataset.

Comparison of frame accuracy over training iterations for standard online learning versus the robust training approach using a replay buffer.

Conclusion

The NN-Viterbi framework demonstrates that direct learning from transcripts via integrated Viterbi decoding is superior to traditional pseudo-labeling approaches. By combining explicit length modeling with a robust replay buffer, the system achieves state-of-the-art results in weakly supervised action segmentation. While the Viterbi decoding step introduces some computational complexity, the framework's generic nature makes it a promising candidate for various sequence modeling tasks where only ordered labels are available.

Summary updated

BibTeX
@inproceedings{richard2018neuralnetwork,
  author = {Alexander Richard and Hilde Kuehne and Ahsan Iqbal and Juergen Gall},
  title = {{NeuralNetwork-Viterbi: A Framework for Weakly Supervised Video Learning}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2018},
  doi = {10.1109/cvpr.2018.00771},
}
Figure