소소한 개발 공부

논문 리뷰: STAR: A Structure-aware Lightweight Transformer for Real-time Image Enhancement (ICCV2021) 본문

컴퓨터 지식/논문

논문 리뷰: STAR: A Structure-aware Lightweight Transformer for Real-time Image Enhancement (ICCV2021)

이내내 2022. 10. 13. 15:42

Zhaoyang Zhang, Yitong Jiang, Jun Jiang, Xiaogang Wang, Ping Luo and Jinwei Gu. STAR: A Structure-aware Lightweight Transformer for Real-time Image Enhancement. Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 4106-4115. 2021. paper link

 

이 논문을 이해하기 위해서 사전 지식으로 Transformer를 알고 있어야 합니다.

https://soso-study.tistory.com/74

 

논문 리뷰: Attention Is All You Need (NIPS2017)

아래 영상을 보면서 리뷰를 진행했습니다. 동빈나, https://www.youtube.com/watch?v=AA621UofTUA 논문 리뷰: Attention Is All You Need (NIPS2017) Attention Is All You Need, Ashish Vaswani et al, NIPS 2017..

soso-study.tistory.com

 

분석한 내용에 대해 발표한 자료입니다.

20221013, ICCV2021, STAR_A Structure-aware Lightweight Transformer for Real-time Image Enhancement.pptx
2.94MB

1. 소개

실시간 이미지 개선을 위한 구조 인식 경량 트랜스포머(STAR) 모델을 제안

 

Transformer 모듈에 기반 (Multi-head self-attention과 완전 연결 레이어만 있음)

Image patch 사이 long-range dependency* 캡처, 서로 다른 지역의 구조적 관계를 알 수 있음

 

다양한 이미지 개선 작업에 적

  - illumination enhancement(조명 강화)

  - auto white balance(자동 화이트 밸런스)

  - photo retouching(사진 보정)

 

이미지 patch가 토큰 임베딩으로 토큰화 됨

픽셀 단위 의존성을 직접 계산하는 대신, 이미지의 토큰 단위 의존성을 학습 (덩어리로 학습)

의미 구조를 학습할 수 있어 CNN보다 더 의미 있는 결과를 보여줌

 

STAR가 전역 context를 캡처하게 하기 위해

long-short range Transformer 라는 2 branch 설계를 채택 -> 계산 시간 감소

의의: 적은 메모리 사용으로 빠른 추론

 

long-range dependency : 장기 메모리 또는 장기 지속성이라고도 하는 장기 의존성은

시간 간격 또는 점 사이의 공간적 거리가 증가함에 따라 두 점의 통계적 종속성이 감소하는 비율과 관련된다.

https://en.wikipedia.org/wiki/Long-range_dependence

 

Long-range dependence - Wikipedia

Long-range dependence (LRD), also called long memory or long-range persistence, is a phenomenon that may arise in the analysis of spatial or time series data. It relates to the rate of decay of statistical dependence of two points with increasing time inte

en.wikipedia.org

 

2. STAR 구조

STAR 구조

1.Tokenization (토큰화)

토큰화는 기본적으로 아래의 단계를 거친다.

1) Linear Flatten

이미지 I∈R^(H×W×C_I ) ⇒ sequence of patch (이미지의 작은 조각)

2) patch에 대한 Dimension Reduction (차원 축소)

3) Linear Embedding(선형적으로 집어넣기)

-> patchtoken 추출

 

위의 단계를 거치는 토큰화 전략은 3가지가 있다.

1) Linear Head

가장 전형적인 토큰화 전략

입력 이미지가 flatten 되어 patch 로 나뉘며,

Linear 레이어를 통해 토큰 얻음

* 매우 무거운 방법

성능은 비슷한데 모델 복잡도가 너무 큼

 

2) Conv Head

P^2 C×C_T  projection을 계산하는 대신,

점진적으로 공간 크기를 줄이는 전처리 CNN 사용

= 그대로 Transformer에 넣지 않고 다운샘플링해서 넣음

토큰 순서는 단순히 feature map의 공간 차원을 flatten 해서 얻음

P: patch size
C: 입력 채널 차원
C_T: Transformer 차원
 

3) Mean Head

Adaptive Average Pooling 에 의해 공간 크기가 바로 줄어듦

Flatten 하여 patch를 얻고

Linear 레이어를 통해 토큰을 얻음

이 방법이 가장 복잡도를 줄일 수 있음

2. Long-short range Transformer Module

1.토큰 (T∈R^(HW/P^2 ×C_T ))을 두 부분으로 분할  (채널 기준 1/2)
-> T_long, T_short
2.분할된 임베딩({T_long, T_short}∈R^(HW/P^2 ×C_T/2))은 각 branch들어감

왼쪽 branch - Normal transformer

-skip connection = residual connection
-Multi-head Attention
-MLP(Multi-layer perceptron) - GELU
-Normalization
-position embedding p∈R^(C_T/2) : 위치 정보 유지

> context y_long 도출

오른쪽 branch – local relationship

-인접 토큰을 다루기 위해 2D convolution 사용
-Normalization
-LeakyRelu

> 좁은 범위 context y_short 도출

3. 평가

3가지 이미지 개선 방법을 통해 평가를 진행한다.

1. Illumination Enhancement (조도 향상)

DCE-NetCNN backboneSTAR로 교체하여 평가

Deep Curve Estimation Network(DCE-Net) : 이미지에서 가장 적합한 광량 향상 곡선 추정

광량 향상 곡선 Light-Enhancement curves (LE-curves)

=> LE(I(x); α) = I(x)+αI(x)(1 I(x))

I(x): 원래 입력 이미지

LE(I(x); α): 조정된 이미지

y_longy_short 사용해 α 추정으로 조도 향상 이미지 출력

2. Auto White Balance (자동 화이트밸런스)

백색광으로 조명 효과를 바꾸는 작업

Deep white-balance editing 모델(인코더 1, 디코더 3)의 인코더를 STAR 교체하여 평가

3. Photo Retouching with 3D-LUTs* (사진 보정)

LUT를 사용한 CNN 모델* CNNSTAR로 교체하여 평가

Global 조정 가중치 대신 32 x 32 크기의 토큰 당 가중치 계산

-> 전역 조정은 지역 조정에 맞지 않기 때문에

 

* LUT: Look Up Table; 사진 색조, 포화도, 노출, 색깔, 톤 조정에 적용하는 기술

* Hui Zeng, Jianrui Cai, Lida Li, Zisheng Cao, and Lei Zhang. Learning image-adaptive 3d lookup tables for high performance photo enhancement in real-time. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2020.