Lecture Note: Multimodal Alignment 1

11-777 Multimodal Machine Learning CMU Fall 2023
Instructor: Dr. Louis-Philippe Morency | Co-lecturer: Dr. Paul Pu Liang
Author: Yi-Jing Sie

Overview

Multimodal Alignment is the second major challenge following representation in multimodal machine learning, and it is defined as:

Identifying and modeling cross-modal connections between "all elements" of multiple modalities, building from the data structure

Unlike representation coordination that only considers the corresponding counterpart in the other modality, multimodal alignment focuses on identifying correspondences by jointly considering all elements across modalities.

The challenge splits into three sub-challenges:

  • Discrete Alignment: aligns distinct elements across modalities
  • Continuous Alignment: happens when the signals have no explicit elements and must instead be warped or segmented before they can be compared.
  • Contextualized Representation: combines alignment with representation learning, unifying the two processes into one.

This post covers the first two sub-challenges: discrete alignment and continuous alignment.

Discrete Alignment

Discrete alignment is the task of identifying and modeling connections between discrete elements of multiple modalities. It can be described along two axes:

  • Local vs. Global:Are the matching pair of elements across modalities given or learned?
  • Directed vs. Undirected: Does the connection flow one way or is it symmetric?

A classic example is language grounding: tying words or phrases to non-linguistic elements such as objects in an image, for instance linking the words "woman" and "newspaper" in a caption to their corresponding regions in a photo.

Local Alignment: Coordinated Representations

Local alignment models connections between a given matching pair of modality elements. Representation Coordination learns coordinated embeddings for a given matching pair in a shared representation space. Therefore, many methods for representation coordination are also applicable for local alignment. ( Readers can refer to the previous post for representation coordination-related approaches.)

Directed Alignment

In directed alignment, one modality acts as the query and the other as the key, then attention is used to connect them, and the connection direction is from query to key element.
Soft attention produces a weighted distribution over all elements of the key modality when connecting to a query element, while hard attention connects a single key element to the query.

Global Alignment

Global alignment, unlike local alignment, is performed globally to learn the matchings and connections.
There are two ways to achieve global alignment:

  • Linear Programming: is used when both modalities have the same number of elements and a strict one-to-one mapping is required, and all the elements must be assigned.
  • Optimal Transport: is used when the modalities have different numbers of elements and a many-to-many "soft" alignment is allowed.

Continuous Alignment

Continuous alignment addresses modalities that lack clearly defined discrete elements, such as time-series signals. There are two general strategies: continuous warping, which stretches and compresses the signals directly, and discretization (segmentation), which first breaks the signals into elements and then aligns those.

Dynamic Time Warping & Canonical Time Warping

Given two unaligned temporal unimodal signals, Dynamic Time Warping (DTW) finds the index vectors that minimize the total distance between aligned points (alignment difference), subject to constraints such as monotonicity (no going backward in time), continuity (no gaps), fixed start/end points, etc., using dynamic programming.
Building on this, Canonical Time Warping (CTW) combines DTW with Canonical Correlation Analysis, jointly learning temporal alignment and cross-modal spatial alignment, which can allign signals from different modalities or from different viewpoints of the same modality.

Temporal Cycle-Consistency Learning

Temporal Cycle-Consistency Learning builds on the premise that there are paired video sequences which can be temporally aligned and jointly aligns those video sequences while learning good representation at the same time via enforcing Cycle Consistency.

The idea behind cycle consistency is that, for each frame in one sequence, a single "soft"/"weighted" nearest neighbor is found in the other sequence based on similarity distribution. That found soft nearest neighbor is then used to find back a soft nearest neighbor in the original sequence. The encoder model for video sequence representation is penalized whenever this round trip does not land back near the starting frame.
The core idea behind cycle consistency: a frame's closest neighbor in another sequence should, in turn, view me as its own closest neighbor.

Grid Image

Discretization (Segmentation)

Continuous signals can also be aligned by first discretizing them into elements:

  • Connectionist Temporal Classification (CTC): is a classification-based solution where a network outputs a label distribution (including a "blank" option) at every time step to derive the most probable label sequence.
  • Cluster-based Discretization: Hidden-Unit BERT (HuBERT) trains a self-attention transformer to predict cluster identities (via k-means) for masked segments of speech, jointly learning discretization and representation from raw audio.

Key Takeaways

Multimodal Alignment

The goal is to identify and model multimodal connections by jointly considering all elements across modalities.


Discrete Alignment & Continuous Alignment

Discrete alignment applies when modalities have well-defined discrete elements to connect (words, objects, etc.), while continuous alignment applies when the signals are unsegmented. The right technique depends heavily on which of these two situations a problem falls into.