Measuring the distance between sequences—such as video frames, audio signals, or sensor readings—is inherently more complex than comparing static feature vectors. Sequences often vary in length, speed, and temporal alignment. To compare them effectively, researchers typically rely on alignment algorithms like Dynamic Time Warping (DTW) or Optimal Transport (OT).
However, these alignment methods share a critical dependency: the ground metric, which defines how the distance between individual elements (or frames) within the sequences is measured. If this underlying ground metric is poorly tuned, the entire sequence alignment fails. Furthermore, traditional metric learning methods are designed for "flat" data and ignore temporal relationships. When adapted for sequences, they usually rely on comparing pairs or triplets of samples, leading to a combinatorial explosion of constraints ($O(N^2)$ or $O(N^3)$). This makes training on large sequence datasets prohibitively slow.
To address these bottlenecks, researchers have introduced Regressive Virtual Sequence Metric Learning (RVSML), a unified framework that learns how to measure the distance between multi-dimensional sequences by jointly optimizing the ground metric and the temporal alignments.
The RVSML Framework
RVSML tackles the computational and representational challenges of sequence comparison through several key innovations:
- Unified Formulation: The framework defines sequence distance as the inner product of an alignment matrix ($T^*$) and a cost matrix ($D$). The cost matrix is based on a Mahalanobis ground metric ($M$), allowing the model to learn a specialized distance space rather than relying on standard Euclidean distance.
- Virtual Sequences (The $O(N)$ Trick): Instead of comparing every sequence to every other sequence in the dataset, RVSML associates each training sample with a "virtual sequence"—a representative prototype for its specific class. By regressing samples toward these class prototypes, the number of constraints is drastically reduced to $O(N)$, making the math highly scalable.
- Alternating Optimization: Because the sequence alignment depends on the ground metric, and the optimal metric depends on the alignment, RVSML uses an iterative approach. It alternates between fixing the alignment to update the ground metric (which has a fast, closed-form solution) and fixing the metric to update the alignment using standard algorithms like DTW or Sinkhorn’s algorithm.
- Ground Metric Learning: Specifically, the method learns a transformation matrix $W$ (where $M = WW^T$) that projects sequence elements into a new space where similar sequences are pulled closer to their respective class prototypes.
Experimental Results
The research team evaluated RVSML across four diverse sequence datasets: MSR Action3D (depth video sequences), MSR Activity3D (Kinect daily activities), ChaLearn Gesture (Kinect video gestures), and Spoken Arabic Digits (SAD) (audio MFCCs).
Accuracy and Robustness
RVSML consistently matched or outperformed state-of-the-art metric learning methods (such as LMNN, ITML, and LDMLT) across the evaluated datasets. By demonstrating compatibility with different types of sequence distances (both DTW and OPW), the authors proved RVSML's versatility as a general-purpose framework.
Dramatic Speed Improvements
Perhaps the most striking result of the RVSML framework is its computational efficiency. Using virtual sequences as "anchors" bypasses the need for expensive triplet mining. On the ChaLearn dataset, RVSML (using DTW) completed training in approximately 2,477 seconds. In stark contrast, a competing sequence metric learning method (LDMLT) took 213,921 seconds. This represents nearly a 100x speedup, proving that joint optimization with class prototypes is highly effective for large-scale sequence data.
Limitations and Future Directions
While RVSML offers a massive leap in efficiency, the authors note a few areas for future refinement:
- Virtual Sequence Design: The model's performance is sensitive to how the virtual sequences are generated. While a segmentation-based approach works well for the tested datasets, different data distributions might require bespoke virtual sequence strategies.
- Linearity: The core method currently utilizes a linear transformation for the ground metric. While it can theoretically be kernelized or extended to deep networks (like RNNs), the primary experiments focus on the linear Mahalanobis case.
- Convergence: The alternating iterative process is guaranteed to decrease the objective function, but it only ensures convergence to a local optimum, not necessarily a global one.
Ultimately, RVSML demonstrates that you don't necessarily need to invent a complex new sequence distance measure. Simply learning a better way to compare the elements of a sequence—the ground metric—can significantly boost the performance and speed of existing alignment algorithms.
Summary updated