Programming/Machine Learning

[Paper Preview] Lumiere : A Space-Time Diffusion Model for Video Generation

Claid 2024. 1. 25. 14:54

조코딩님이 올려주시는 커뮤니티 글에서 놀라운 AI 비디오 결과물을 하나 볼 수 있어서 공유하고자 합니다. Text-to-Video, Image-to-Video, Stylized Generation, Video Stylization, Cinemagraphs, Video Inpainting 등 다양한 기능들에서 우수한 성능을 보이고 있습니다. 논문 수준에서 소개하는 영상들이 기존 비디오 생성하는 서비스보다 퀄리티가 좋아보여서 저도 깜짝 놀랐습니다.

 

아주 얕게 논문을 소개하고, 모델이 지향하는 바를 정리해보는 시간도 같이 가지겠습니다.

 

- 결과물을 볼 수 있는 소개 사이트: https://lumiere-video.github.io/

- 논문 : https://arxiv.org/abs/2401.12945

 

Lumiere - Text-to-Video

 

1. 용어소개

본문에 소개된 용어를 간단히 설명하자면 다음과 같습니다. 논문의 모든 것을 소개하지는 않기 때문에 이 정도만 아셔도 충분할 것 같습니다.

 

Temporal (시간적): 'Temporal'이라는 용어는 시간과 관련된 것을 의미합니다. 컴퓨터 비전에서, 이는 비디오나 연속적인 이미지 프레임에서의 움직임이나 변화를 분석하는 데 사용됩니다. 예를 들어, 객체 추적, 행동 인식, 또는 비디오 분류에서 시간적 정보는 매우 중요합니다. 시간적 분석은 객체나 현상이 시간에 따라 어떻게 변화하는지를 이해하는 데 도움을 줍니다.

Spatial (공간적): 'Spatial'은 공간적인 측면, 즉 이미지나 비디오 내의 객체와 형태의 공간적 배열과 관련이 있습니다. 이 개념은 이미지 내의 픽셀이나 특징들의 위치를 파악하고, 이를 통해 형태, 질감, 색상과 같은 시각적 정보를 분석하는 데 중요합니다. 예를 들어, 객체 감지나 세분화에서 공간적 분석은 이미지 내의 개별 객체를 식별하고 분류하는 데 필수적입니다.

Super Resolution (초해상도): 'Super Resolution'은 저해상도 이미지나 비디오를 고해상도로 변환하는 과정을 말합니다. 이는 컴퓨터 비전과 딥러닝에서 매우 중요한 연구 영역으로, 기존의 저품질 이미지를 더 선명하고 상세한 고품질 이미지로 개선하는 기술입니다. 딥러닝 기반의 초해상도 기술은 저해상도 데이터에서 높은 수준의 세부 정보를 추출하고 재구성하는 능력이 뛰어나, 의료 영상, 위성 이미지, 보안 카메라 영상 등 다양한 분야에서 응용되고 있습니다.

 

앞으로 소개할 약어 중 TSR은 Temporal Super Resolution, SSR은 Spatial Super Resolution 입니다.

 

2. 간단한 논문 설명

Abstract

We introduce Lumiere – a text-to-video diffusion model designed for synthesizing videos that portray realistic, diverse and coherent motion – a pivotal challenge in video synthesis. To this end, we introduce a Space-Time U-Net architecture that generates the entire temporal duration of the video at once, through a single pass in the model. This is in contrast to existing video models which synthesize distant keyframes followed by temporal super-resolution – an approach that inherently makes global temporal consistency difficult to achieve. By deploying both spatial and (importantly) temporal down and up-sampling and leveraging a pre-trained text-to-image diffusion model, our model learns to directly generate a fullframe-rate, low-resolution video by processing it in multiple space-time scales. We demonstrate state-of-the-art text-to-video generation results, and show that our design easily facilitates a wide range of content creation tasks and video editing applications, including image-to-video, video inpainting, and stylized generation.

 

논문의 초록에 제시된 내용 중 Space-Time U-Net architecture라는게 뭔지 궁금했습니다. 우선 전체적인 구조에 있어서 어떻게 접근하는지를 Figure 3에서 설명합니다.

 

Lumiere - Our Approach

 

Figure 3: Lumiere pipeline. This illustrates the pipeline of Lumiere and how it differs from the common approach used in previous works. The typical approach includes a base model generating distant keyframes, followed by a series of temporal super-resolution (TSR) models to fill in frames, and a spatial super-resolution (SSR) model applied in non-overlapping windows for high-resolution results. In contrast, Lumiere's base model processes all frames simultaneously without TSR models, enabling globally coherent motion. For high-resolution video, it uses an SSR model on overlapping windows and employs MultiDiffusion (Bar-Tal et al., 2023) to merge predictions into a coherent outcome. Refer to Section 3 for more details.

 

기존에는 먼 프레임을 만드는 Base 모델 → 중간단위 프레임으로 잘라서 → TSR을 연속적으로 여러개 둠으로서 통해 일관된 움직임과 프레임 보간을 → 각 프레임을 SSR을 통해 이미지의 해상도를 끌어올려서 만드는 것이라고 설명합니다.

Lumiere는 시간 전역적으로 모든 프레임을 출력하고 SSR을 사용하여 일관된 움직임을 갖는 프레임을 얻는다고 설명합니다. 확실히 모든 프레임을 동시에 처리할 수만 있다면 일관된 느낌을 줄 수 있을 것 같습니다.

 

STUNet architecture

 

Figure 4: STUNet architecture. This figure shows the STUNet architecture, which expands a pre-trained Text-to-Image (T2I) U-Net architecture (Ho et al., 2022a) into a Space-Time UNet (STUNet). This STUNet is capable of down-sampling and up-sampling videos in both spatial and temporal dimensions. The illustration demonstrates STUNet’s activation maps, where different colors indicate features from various temporal modules. It includes (b) convolution-based blocks comprising pre-trained T2I layers followed by factorized space-time convolution, and (c) attention-based blocks at the coarsest U-Net level, where the pre-trained T2I layers are augmented with temporal attention. At this coarsest level, where video representation is highly compressed, several temporal attention layers are stacked to add functionality with minimal additional computational cost. More details can be found in Section 3.1.

 

Lumiere의 핵심인 STUNet(Space-Time U-Net)은 THW의 입력구조를 THWD로 만든다음 THW를 계속 줄이고(시간-공간 축의 크기를 줄이면서), 다시 THW를 늘리면서 기존의 U-Net 구조를 사용하는 것으로 보입니다. THW를 줄이거나 늘릴때는 Convolution-based로, U-Net의 가장 깊은 곳에서는 Attention-based로 시간 부분을 주로 처리하는 것으로 보입니다. 따라서 깊은 곳에서 이미지의 공간과 feature 처리를 수행하고, 마지막에 똑같은 T만큼의 프레임을 되돌려주는 것으로 보입니다.

 

3. 결론

모델의 핵심은 pretrained T2I U-Net 구조를 확장하여, convolution기반의 블록으로 시간과 공간영역을 처리하고, U-Net의 중간 부분에서는 Transformer 기반의 블록으로 처리한다는 것입니다. 

기존에 없는 Diffusion을 사용했다거나, 이나 다른 획기적인 기반 기술을 제시한건 아니지만 전체 프레임을 한 번에 만들려고 하는 시도와 결과는 훌륭한 것 같습니다.

기존에 사용했다던 T2I U-Net도 나중에 한 번 확인해보겠습니다.

 

출처

1차 출처 : 조코딩 커뮤니티

https://www.youtube.com/@jocoding/community