Drop-DTW: Aligning Common Signal Between Sequences While Dropping Outliers

Nikita Dvornik, Isma Hadji, Konstantinos G. Derpanis, Animesh Garg, Allan D. Jepson

TL;DR

Standard Dynamic Time Warping (DTW) breaks down when sequences contain irrelevant, interspersed noise because it forces every single element to match. Drop-DTW solves this by integrating an explicit "drop cost" into a unified dynamic program, allowing it to skip arbitrary outliers while finding the optimal monotonic alignment. Because the algorithm naturally admits a differentiable approximation, it functions both as an effective inference-time aligner and as an end-to-end training loss.

What Problem Does This Paper Address?

Dynamic Time Warping (DTW) is a classic algorithm used to align variable-length temporal sequences (e.g., video, audio, or sensor data). While DTW gracefully handles temporal speed variations and shifts, it operates under rigid constraints: every point must be matched, path continuity must be preserved, and endpoints must strictly align ($M_{1,1} = M_{K,N} = 1$).

In real-world data—such as untrimmed instructional videos—meaningful action steps are frequently interrupted by unrelated "outlier" frames (e.g., a presenter talking to the camera or washing dishes between recipe steps). Standard DTW forces these background frames into correspondences, polluting alignment paths, corrupting similarity metrics, and producing poor training signals. Previous attempts to fix this either only allowed dropping outliers at the sequence endpoints, used brittle two-stage "filter-then-align" greedy heuristics, or restricted matchings to strict one-to-one correspondences.

Methods

Drop-DTW unifies outlier rejection and sequence alignment into a single global optimization problem:

  • Relaxed Alignment Formulation: Drop-DTW discards the endpoint and continuity constraints of traditional DTW, enforcing only monotonicity. Elements in either sequence can remain entirely unmatched ($M_{:,j} = 0$ or $M_{i,:} = 0$).
  • Drop Costs: To prevent the model from trivially dropping everything, skipping an element incurs an explicit drop penalty ($d^x_j$ or $d^z_i$). The total objective minimizes the sum of pairwise matching costs plus the accumulated drop penalties.
  • Dynamic Programming Table: The algorithm maintains separate recurrence states for matching an element ($D^+$) versus dropping it ($D^-$), solved efficiently in $\mathcal{O}(KN)$ time.
  • Setting Drop Costs:
  • Percentile Drop Cost: The drop cost is set to a top percentile (e.g., the 30th or 70th percentile) of the pairwise cost matrix, serving as an intuitive prior on the expected outlier ratio.
  • Learnable Drop Cost: A lightweight neural network dynamically predicts element drop costs conditioned on the opposing sequence's mean embedding.
  • Differentiable Loss: Replacing the discrete $\min$ operator with a smoothed operator (smoothMin) makes Drop-DTW fully differentiable, allowing it to be used as a loss function for gradient-based representation learning.

Datasets

The authors evaluate Drop-DTW across multiple domains:

  • TMNIST (Synthetic): A synthetic video dataset generated from MNIST digits moving along trajectories (split into TMNIST-full and TMNIST-part), with random Gaussian frame-blurring injected as noise.
  • Instructional Video Datasets:
  • CrossTask: 2,750 videos across 83 tasks.
  • COIN: A large-scale instructional video benchmark spanning 180 tasks.
  • YouCook2: Cooking procedures with multimodal narrations.
  • PennAction: Action recognition/alignment dataset, contaminated by randomly inserting $p\%$ frames from unrelated activities to test representation learning under noise.
  • AVE (Audio-Visual Event): Video clips with synchronous and asynchronous audio-visual events, used for cross-modal localization.

Key Insights and Ideas

  • Joint Optimization vs. Greedy Filtering: A naive two-stage approach—filtering out low-similarity frames before applying standard DTW—consistently underperforms. Errors in greedy outlier removal are irreversible, and filtering destroys temporal context. Jointly discovering the alignment and drops within the dynamic program is crucial.
  • Inference as "Free" Background Parsing: For step localization, Drop-DTW labels unassigned frames as background by virtue of dropping them. It accurately segments step boundaries without explicitly training a background classifier.
  • Asymmetric vs. Symmetric Matching: In cross-modal tasks where one sequence is guaranteed clean (e.g., an ordered list of text recipe steps) while the other is noisy (untrimmed video), asymmetric formulation allows element-dropping strictly on the noisy visual sequence ($d^z_i = \infty$).

Key Results

  • Synthetic Video Retrieval: Under the highest level of injected frame noise on TMNIST, Drop-DTW achieves an $8\times$ improvement in Recall@1 compared to standard DTW.
  • Weakly-Supervised Step Localization: Trained with only ordered text step lists (no framewise temporal boundary annotations):
  • On CrossTask, Drop-DTW achieves 49.1% Recall and 34.5% IoU, clearly surpassing MIL-NCE (39.1% Recall, 20.9% IoU) and OTAM (43.8% Recall, 30.8% IoU).
  • Sets the first weakly-supervised benchmarks on COIN (up to 42.8% Recall, 59.6% Framewise Acc) and YouCook2 (77.4% Recall, 49.4% IoU).
  • Inference Robustness (Table 2): When using frozen features without model fine-tuning, Drop-DTW yields 20.8% IoU on CrossTask, outperforming the greedy drop heuristic (13.8% IoU) and standard DTW (10.1% IoU).
  • Noisy Representation Learning: On PennAction contaminated with up to 70% outlier frames, representations learned via Drop-DTW maintain a Kendall's Tau alignment score near $\sim 65$, whereas SmoothDTW degrades significantly (dropping below 55).
  • Audio-Visual Localization: Unsupervised Drop-DTW scores 41.1% on Audio-to-Visual (A2V) localization on the AVE dataset, outperforming SmoothDTW (39.8%) and even surpassing the fully supervised baseline (34.8% on Visual-to-Audio).

Limitations and Future Work

  • Strict Monotonicity Constraint: Drop-DTW assumes that the underlying clean signals occur in a strict, known chronological order. It cannot align partially ordered sequences or handle steps executed out of order.
  • Hyperparameter Sensitivity: When using percentile-based drop costs, the user must supply a reasonable prior on the expected outlier percentage; suboptimal thresholds may either keep outliers or over-prune true signals.
  • Future Directions: Adapting Drop-DTW to handle partially ordered graphs or permutation-invariant sequences represents the primary avenue for future research.

Summary updated

BibTeX
@inproceedings{dvornik2021drop,
  author = {Nikita Dvornik and Isma Hadji and Konstantinos G. Derpanis and Animesh Garg and Allan D. Jepson},
  title = {{Drop-DTW: Aligning Common Signal Between Sequences While Dropping Outliers}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
  url = {https://openreview.net/forum?id=DcuxliFGUSn},
}

Loading related content...

Figure