[논문 요약] Cross-modal Prompts: Adapting Large Pre-trained Models for Audio-Visual Downstream Tasks
2023 NeurIPS
https://arxiv.org/abs/2311.05152
Cross-modal Prompts: Adapting Large Pre-trained Models for Audio-Visual Downstream Tasks
In recent years, the deployment of large-scale pre-trained models in audio-visual downstream tasks has yielded remarkable outcomes. However, these models, primarily trained on single-modality unconstrained datasets, still encounter challenges in feature ex
arxiv.org
Abstract
최근 대규모 pretrained 모델을 오디오-비주얼 downstream task에 접목시키는 것이 주목할만한 결과를 보여주고 있다.
하지만 이런 모델들은 기본적으로 단일 모달리티 데이터로 학습되었기 때문에, 멀티모달 task에서 feature를 추축하는 것에 어려움이 있어 최적의 해답을 찾기 어렵다. 이런 제한은 관련 없는 모달리티 특정 정보의 개입으로 발생하며, 성능 저하를 일으킨다.
이 문제를 해결하기 위하여 이 논문은 Dual-Guided Spatial-Channel-Temporal (DG-SCT) attention mechanism을 제안한다. 이는 오디오와 비주얼 모달리티를 soft prompts로 사용하여 현재의 멀티모달 입력 feature를 기반으로 pretrained 모델의 파라미터를 동적으로 조정한다.
DG-SCT 모듈은 학습 가능한 cross-modal interaction layer를 포함하며, 현재 모달리티 사이의 spatial, channel, and temporal 차원에서의 중요한 정보를 추출한다.
이 모델은 AVE, AVVP, AVS, and AVQA 에서 SOTA이며, few-shot and zero-shot 분야에도 유망하다.
1. Introduction
대규모 pretrained 모델을 다양한 멀티모달 downstream task에 접목시키려는 시도가 있지만, pre-trained 모델은 단일 모달리티로 학습되어있기 때문에 최적의 해를 찾기는 어렵다.
위 사진을 예시로 보면, 엔진 소리가 들어갈 때 '자동차'의 비주얼 영역이 '나무'보다 attention을 받아야 할 것이며, '자동차'를 관찰할 때 엔진 소리의 audio segments에 더 집중해야 할 것이다.
인코더는 단일 모달 특정 정보 뿐만 아니라 다른 모달리티의 관련있는 부분의 정보를 강조해 다양한 모달리티 사이에서의 feature fusion을 강화해야 한다.
이 논문에서는 CLIP 과 Swin-Transformer 같은 대규모 모델을 어떻게 사용해서 상대 모달리티를 guidance로 삼아 인코딩 feature를 조정할 수 있는지 연구했다. 사전 학습된 모델을 오디오, 비주얼 입력 기반으로 feature extraction하는 모듈인 Dual-Guided Spatial-Channel-Temporal (DG-SCT) attention mechanism을 제안한다.
이 연구는 최소한의 추가 파라미터로 다양한 오디오-비주얼 downstream task의 성능을 높인 LAVisH [17]를 기반으로 진행되었다. 이는 사전 학습 모델과 학습 가능한 레이어 사이의 파라미터를 공유해 오디오-비주얼 feature의 fusion을 강화했다, 그러나, 몇 가지 한계가 있었다. 1. 비주얼 인코더가 오디오를 인코드했기 때문에 중요한 오디오 정보를 충분하게 학습하지 못했다. 2. 학습 가능한 레이어에 cross-attention을 다른 모달리티의 정보를 도입하는 부분에만 사용하고, 현재 모달리티 안에서의 중요한 정보가 무엇인지 강조하지 않았다.
이 논문에서는 cross-modal 상호작용 레이어를 audio (HTS-AT [3]) and visual (ViT [4] or Swin-T[20]) pre-trained models에 포함시켜, 다른 모달리티를 프롬프트처럼 사용해 서로 다른 모달리티의 spatial, channel, temporal 차원에서 어느 영역이 연관이 있는지 집중했다. 여기서 말하는 "prompts"는 preceding layer안의 trainable weights에 의해 제공되는 guidance를 의미한다. 이것은 오디오와 비디오 단서를 상대 모달리티의 representation의 가이드로 사용하는 것을 강조한다.
그림 1에서 볼 수 있듯이, 이전의 오디오 및 비주얼 인코더는 오디오 및 비주얼 특징을 각각 독립적으로 균일하게 생성하는 반면(Fig. 1 (a)), 우리 모델의 특징은 멀티모달 정보의 유도 특성을 활용하여 여러 수준에서 보다 세밀하고 과제별(task-specific) 정보를 포함한다 [37, 36]. 그리고, 다른 CLIP 기반 연구 [45, 46] 들과는 다르게 양방향 프롬프트가 가능하다.
[36] 번 논문
- we propose to utilize audio-visual features as novel prompts to fully leverage the feature extraction capabilities of large-scale models, enabling the effective utilization of task-specific information
from different modalities. - introduce a novel attention mechanism named Dual-Guided Spatial-Channel-Temporal
(DG-SCT), which utilizes audio and visual modalities to guide the feature extraction of
their respective counterpart modalities across spatial, channel, and temporal dimensions. - adds only a limited number of parameters for the interaction layer,
while keeping the original parameters of the large-scale pre-trained models frozen.
2. Related work
2.1 Audio-visual understanding
오디오-비주얼 이해는 두 모달리티를 모두 사용해서 시나리오에 대한 더 좋은 이해를 하는 것이다.
- Audio-Visual Event Localization(AVE [33]): recognize joint audio-visual events
- [33, 16, 35, 37, 36]: late interaction strategies to better leverage the visual and audio features encoded from
modality-specific pre-trained models. - Audio-Visual Video Parsing (AVVP [32]): breaks the restriction that audio and visual signals are definitely aligned.
- [32]: hybrid attention network and attentive Multimodal Multiple Instance Learning (MMIL) Pooling mechanism to aggregate all features.
- Audio-Visual Segmentation (AVS [42]): focuses on whether each pixel corresponds to the given audio so that
a mask of the sounding object(s) is generated. - [43]: use a temporal pixel-wise audio-visual interaction module to inject audio semantics as guidance for the visual segmentation process.
- Audio-Visual Question Answering (AVQA [14]): perceive both audio and visual modalities to answer human-generated questions about the audio-visual content.
- [14]: spatiotemporal grounding model to achieve scene understanding and reasoning over audio and visual modalities.
대부분의 방식들은 모달리티 특정 pretrained 모델에 의존하기 때문에 representation stage에서 다중 모달리티 단서를 사용할 수 없다. 이 논문에서는 새로운 early-interaction strategy로 현재 모달리티로부터 spatial, channel, temporal dimension에서 중요한 정보를 추출하는 방식을 제안한다.
2.2 Vision-language models and prompt learning
Vision-language models
CLIP으로 인해 많은 downstream task에서 zero/few-shot 방식이 생성되고 있다.
반면에, NLP의 개념인 프롬프트는 GPT 시리즈 등의 NLP에서 인상적인 성과를 내고있다.
- CLIP-adapter [7]: proposing to use embedding of video and language to guide each other at the end of the encoder.
- MaPLe [12]: use an adaptor to guide each other inside the encoder, integrating visual and text representations with the semantics of each other to enhance the generalization ability of the
model.
이 논문에서는 오디오와 비디오 단서를 사용하는 새로운 양방향 프롬프트 방식을 소개한다.
3. Approach
3.1 Representations for audio-visual modalities
Visual representation
- 비디오 프레임 샘플링
- 입력 비디오에서 일정 개수의 RGB 프레임을 선택 ($T$ 개의 프레임).
- 각 프레임의 크기는 $T \times H \times W \times 3$
- 패치 분할 (Patch Splitting)
- Swin-T 모델을 따라, 각 프레임을 $P_v, P_v$ 크기의 작은 패치로 나눔.
- 이 패치들은 겹치지 않으며, 하나의 패치는 하나의 토큰(token)으로 취급됨.
- 패치 특징 추출 및 변환
- 각 패치의 특징은 원본 픽셀 값의 concatenation으로 설정.
- 이후, 선형 임베딩 레이어(linear embedding layer)를 적용하여 고차원 특징 벡터 $ v_t 를 얻음.
- 최종적으로 얻어지는 특징의 차원: $v_t \in \mathbb{R}^{\frac{H}{P_v} \times \frac{W}{P_v} \times C_v}$ 여기서 $C_v$ 는 시각적 특징 채널 수.
Audio representation
- 오디오 입력 → 멜-스펙트로그램 $A_t$ 생성 $L \times F$
- 패치 분할: Patch-Embed CNN을 사용하여 $P_a \times P_a$ 크기의 패치로 나눔
- 선형 임베딩: 각 패치에 대해 특징 벡터 $a_t$ 추출 $P_a \times P_a \times C_a)$
- 결과: 각 시간 스텝에서 추출된 오디오 특징 $a_t$
3.2 Adding DG-SCT modules to frozen encoders
pre-trained Swin-T and HTS-AT 사용.
Swin-T and HTS-AT의 모든 레이어는 3 가지 operations로 구성되어 있음: 1) multi-head attention (MHA), 2) multi-layer perceptron (MLP), and 3) our DG-SCT modules.
DG-SCT 모듈은 오디오와 비디오의 중간 레이어로 사용되어 프롬프트처럼 서로에게 가이드를 준다.
linear normalization layers in both MHA and MLP 는 생략.
3.3 Dual-guided spatial-channel-temporal attention
오디오-비주얼 쌍이 서로에게 guidance를 주는 프롬프트로 사용되어, 사전 학습 모델이 반대 모달 입력의 특정 영역에 더 주목하도록 했다.
Channel-wise attention
각각의 채널은 다른 feature 양상을 띄는데, channel attention을 도입함으로써 모델이 관계 없는 특징을 무시하도록 했다.
네트워크 구조가 수식으로 나와있는데, 이는 원문을 확인하도록 하자.
Spatial-wise attention
오디오 주파수와 비주얼 spatial attention끼리 서로 가이드를 주도록 했다.
Temporal-gated attention
오디오에서 엔진 소리가 나는 time segments는 강조되고, 배경 소리는 주목을 받으면 안된다. 비주얼 정보도 매한가지다. 이를 위해 Temporal-gated attention을 마지막 레이어에 추가했다.
Summary
위의 세 메커니즘을 DG-SCT 모듈에 넣었다.
오디오와 비주얼 feature가 주어지면 DG-SCT 모듈에서는 먼저 channel-wise attention map을 생성하며 각 모달리티에 상응하는 feature를 강조한다. 그 다음, 오디오가 소리가 나는 부근을 강조하는 spatial-wise attention map을 만들도록 하고, 비디오가 중요한 주파수 지역을 강조하는 frequency-wise attention map을 만든다.두 개의 temporal attention gate까지 통과하면 최종 출력물이 나온다.
4. Experiments
5. Conclusion and discussion
-끝-