본문 바로가기
Paper

논문 리뷰 | Contrastive Audio-Visual Masked Autoencoder (2023)

by 힢힢 2025. 7. 7.

 

멀티모달 (A+V) 에 contrastive learning과 masked autoencoder를 적용한 논문이다.

 

https://arxiv.org/abs/2210.07839

 

Contrastive Audio-Visual Masked Autoencoder

In this paper, we first extend the recent Masked Auto-Encoder (MAE) model from a single modality to audio-visual multi-modalities. Subsequently, we propose the Contrastive Audio-Visual Masked Auto-Encoder (CAV-MAE) by combining contrastive learning and mas

arxiv.org

 

 


 

[ Contrastive Audio-Visual Masked  Autoencoder (2023) ] (CAV-MAE)

 

✦ Abstract

 

MAE를 single modality에서 multi modality로 확장

contrastive learning, masked data modelting 결합해 CAV-MAE 제안

 


 

 

✦ Introduction

 

사람은 청각, 시각 정보를 자연스레 통합해 세상을 인지할 수 있지만, 모델은 이를 수행하기 어렵고, 특히, 라벨링이 어렵기 때문에 web-scale unlabeled video data를 self-supervised manner로 학습하는 것이 중요 과제가 되었다. audio-visual self-supervised learning에는 대표적으로 두 가지의 방식이 존재한다. 첫 번째로, Contrastive Audio-Visual Learning은 매칭이 되는 오디오-비주얼 샘플이 가까워지도록 coordinated representations를 학습하는 것이고, 이렇게 학습된 representation은 cross-modal retrieval에 유용하다. 두 번째로, Masked Data Modeling (MDM)은 corrupted input에서 original input을 복원하는 태스크로, meaningful representation을 학습할 수 있다. 

 

실험에 의해 이 두가지의 objectives는 서로 상호보완적임을 알 수 있었다. Contrastive Audio-Visual Learning은 모달리티 간의 관련 정보를 학습함으로써 유용한 audio-visual pair information을 사용할 수 있지만, 각 모달리티에 대한 고유 정보를 무시할 수 있다. 한편, reconstruction task는 input의 대부분의 정보를 보존하지만, audio-visual correspondence를 명시적으로 학습하지 않아 서로 관련된 정보를 사용하기 어렵다. 

 

본 논문의 contribution은 다음과 같다.

 

1. single-modal MAE를 multi-modal AV-MAE로 확장

2. contrastive audio-visual learning과 masked data modeling을 결합하여 CAV-MAE 제안

3. contrastive objective와 masked data modeling objective가 complementary임을 증명

 

 


 

Contrastive Audio-Visual Masked Autoencoder

 

1️⃣ Contrastive Audio-Visual Learning (CAV)

 

conventional CAV model

 

1. N개의 오디오-비디오 쌍 샘플로 구성된 mini-batch에서 각 샘플 i에 대해 오디오와 이미지를 tokenize하여, 오디오 토큰 , 비주얼 토큰 {v_i} 시퀀스를 얻는다.

2. 각 모달리티별 토큰 시퀀스에 대해 linear projection을 적용하여 공통 임베딩 차원인 768차원으로 매핑한다.

3. 프로젝션된 토큰들을 독립적인 트랜스포머 인코더에 넣어 오디오 임베딩과 비주얼 임베딩을 얻는다.

4. 각 모달리티 별로 mean pooling을 수행하여 하나의 벡터 표현을 얻는다.

     $c^a_i = MeanPool(E_a(Proj_a(a_i)))$, $c^v_i = MeanPool(E_v(Proj_v(v_i)))$

5. $c^a_i$와 $c^v_i$ 간의 contrastive loss를 적용하여 동일한 샘플의 오디오-비주얼 벡터는 가깝게, 다른 샘플과는 멀어지도록 학습한다.

 


 

2️⃣ Vanilla Audio-Visual Masked Autoencoder (AV-MAE)

 

* masked auto-encoder (MAE)

MAE는 주요한 self-supervised framework 중 하나인 masked data modeling (MDM)의 변형 중 하나로, 간단하지만 효과적인 방법이다. MAE에서는 입력의 일부를 무작위로 마스킹하고, 마스킹되지 않은 토큰만 모델의 input으로 사용한다. 모델은 마스킹된 토큰을 reconstruct하도록 학습되며, MSE loss를 줄이는 것을 목표로 한다. 이러한 과정을 통해 input data에 대한 meaningful representation을 학습하게 된다.

MAE의 장점은 예측 대상이 입력 자체이기 때문에 label이 필요 없어 training pipeline을 단순화할 수 있고, encoder에 unmasked token만 입력하므로, 특히 높은 마스킹 비율을 사용할 경우 계산량을 크게 줄일 수 있다. 또, 오디오와 비주얼 모달리티 모두에서 single-modal task에 대한 강력한 성능을 입증하였다.

 

⇒ single-modal MAE가 이미지와 오디오 태스크 각각에서 SOTA를 달성한 것을 기반으로, unimodal signal을 결합하는 joint representation을 학습하는 AV-MAE를 제안한다. 

 

vanilla AV-MAE

 

 

1. 오디오와 이미지를 tokenize하여, modality-specific linear projection layer로 각각을 768차원으로 매핑한다.

2. modality type embedding $E_a$, $E_v$와 modality specific 2D sinusoidal positional embedding $E^p_a$, $E^p_v$를 더한다.

    $a'=Proj_a(a)+E_a+E_a^p$, $v'=Proj_v(v)+E_v+E_v^p$ -> 얘 왜 적용안되는 거야 ㅠ

3. $a'$와 $v'$를 concat해서 joint embedding을 만든다.

4. 전체 토큰 중 일부 (여기선 75%)를 무작위로 마스킹하고, 마스킹되지 않은 토큰 ($x_{unmask}$)을 audio-visual joint encoder에 넣어 $x'_{unmask}$를 얻는다.

5. trainable masked tokens를 원래 위치에 padding하여 입력 x'를 구성한다.

6. x'에 modality type embedding $E'_a$, $E'_v$와 modality specific 2D sinusoidal positional embedding $E^{p'}_a$, $E^{p'}_v$를 더한다.

7. 이를 joint audio-visual decoder에 넣어 복원된 오디오 $\hat{a}$와 이미지 $\hat{v}$를 출력한다.

8. 정규화된 입력 a, v와 복원된 $\hat{a}$, $\hat{v}$ 사이의 MSE loss를 최소화하도록 학습한다.

 

AV-MAE는 cross-modal masked data modeling objective로 학습되어 한 모달리티의 정보에 기반하여 다른 모달리티를 복원할 수 있다. 이는 모델이 audio-visual correlation을 학습하도록 도운다. 그러나, paired audio-visual correspondence를 사용하는 명시적인 objective가 없어 (같은 샘플에서 나온 오디오-이미지인지 학습할 수 없음) vanilla AV-MAE는 오디오-비주얼 쌍 정보를 효과적으로 사용하지 못한다. 또한, joint encoder는 cross-modal attention을 가능하게 하지만, 서로 매우 다른 두 모달리티를 동일한 가중치로 처리하여 최적의 솔루션을 도출하지 못한다.

 

 


 

3️⃣ Contrastive Audio-Visual Masked Autoencoder (CAV-MAE)

 

CAV와 AV-MAE의 보완적인 장점을 통합하기 위해 CAV-MAE 제안.

 

CAV-MAE

 

 

1. 오디오와 이미지를 전처리, tokenize하고 linear projection으로 768차원으로 매핑한다.

2. modality type embedding과 modality-specific 2D sinusoidal positional embedding을 더한다.

3. 각 모달리티의 토큰 중 75%를 마스킹한다.

4. 마스킹되지 않은 토큰 $a^{unmask}_i$, $v^{unmask}_i$를 각각 독립적인 인코더에 넣어 $a'_i$, $v'_i$를 얻는다.

5. $a'_i$, $v'_i$, $[a'_i, v'_i]$ (concat된 audio-visual token)을 joint audio-visual encoder에 세 개의 독립적인 forward pass로 넣는다.

    각 stream은 다음과 같은 출력을 얻는다 :

 

    $c^a_i$ : audio encoding, $c^v_i$ : visual encoding → contrastive learning에 사용

    $x_i$ : multimodal encoding → reconstruction task에 사용

6. $x_i$의 원래 마스킹된 위치에 trainable masked token을 padding하여 $x'_i$를 만들고, modality type embedding과 modality-specific 2D sinusoidal positional embedding을 더한다.

7. 이를 joint audio-visual decoder에 넣어 복원된 오디오 $\hat{a}_i$, 복원된 이미지 $\hat{v}_i$를 얻는다.

 

total loss : $L_{CAV\_MAE}=L_r + \lambda_c \cdot L_c$

(reconstructin loss + contrastive loss)

 

reconstruction loss
contrastive loss

 

 

* key designs

1. Multi-stream forward passes for the joint encoder

contrastive learning을 수행할 때에는 representation을 제한하는 것이 중요하므로, audio representation은 audio input으로만, video representation은 video input으로만 얻도록 한다. 동시에, reconstruction 및 downstream task를 수행하려면 다른 모달리티 간의 정보를 fuse해야 한다.

⇒ audio stream, visual stream, audio-visual stream 으로 분리된 forward pass를 설계

 

2. Modality-specific encoders and LN layers

오디오와 비디오가 본질적으로 다르기 때문에 modality-specific network와 동일한 이유 다른 정규화 통계값을 사용함

 

 


 

본 논문의 핵심은 masked data modeling과 contrastive learning을 결합하면 상호보완적으로 작동해 audio-visual SSL에 효과적인 프레임워크가 된다는 것이다. 이를 위해, multi-stream forward pass, joint-specific encoder처럼 representation collapse를 방지하기 위한 설계가 필요하다. 학습된 representation은 audio-visual joint event classification과 audio-visual retrieval task에 유용하다.