본문 바로가기
3D point clouds/Segmentation

Point Transformer 리뷰

by khslab 2023. 8. 9.

해당 논문은 point cloud에 transformer를 적용한 논문이다.

해당 논문을 읽어보면 transformer 특성이

point cloud를 처리하기에 알맞다는 것을 알 수 있다.

 

ICCV' 21

https://arxiv.org/abs/2012.09164

 

Point Transformer

Self-attention networks have revolutionized natural language processing and are making impressive strides in image analysis tasks such as image classification and object detection. Inspired by this success, we investigate the application of self-attention

arxiv.org


Abstract

 

저자들은 point cloud를 위한 self-attention layer를 설계한다.

Point Transformer 설계는 domain과 task를 넘어 앞선 work를 개선한다.


1. Introduction

 

저자들은 자연어 처리와 이미지 분석에서 transformer의 성공에

감명을 받아 point cloud deep leanring 접근법을 발전시킨다.

transformer family는 point cloud처리에 알맞다.

왜냐하면 self-attention operaor는 input element의 순서와 집합 크기에

불변하기 때문이다.

pont cloud는 본질적으로 3D space에 임베딩된 set이므로

3D point cloud에 self-attention의 적용은 그러므로 꽤 자연스럽다.

 

저자들은 이 직관에 살을 붙이고 3D point cloud를 위한

self-attention layer를 만든다.

저다들은 self-attention의 형태를 조사하여

각 point 주위의 local neighborhood에 self-attention을 적용하고

network의 잠재 정보를 인코딩한다.

최종 network는 순수한 self-attention과 pointwise operation을 기반으로 한다.

 

저자들은 Point Transformers가 주목할만하게 효율적임을 보여준다.

저자들의 contribution은 다음과 같다.

 

1. 저자들은  극도로 표현력 있는 Point Transformer layer를 설계한다.

 

2. Point Transformer layer를 기반으로,

classification과 dense 예측에 대한 높은 성능을 가진다.


3. Point Transformer

 

3.1. Background

 

Self-attention operator는 2가지 타입으로 구분할 수 있다.

scalar attention, vector attention

$\mathcal{X} = \left\{ x_{i} \right\}_{i}$를 feature vector의 집합으로 하자.

standard scalar dont-product attention layer는 다음과 같이 표현된다.

$y_{i}$는 output feature다.

$\varphi, \psi, \alpha$는 linear projection이나 MLPs같은

pointwise feature transformation이다.

$\delta$는 position encoding function이고

$\rho$는 softmax같은 normalization function이다.

 

scalar attention layer는 $\varphi, \psi$에 의해 변환된

feature들 사이의 scalar product를 하고 output을

$\alpha$에 의해 변환된 aggregating feature를 위한

attention weight로 사용한다.

 

vector attention에서, attention weight의 계산이 다르다.

특히, attention weight는 개별적인 feature channel로

모듈화 할 수 있는 vector다.

$\beta$는 relation function (구체적으로 subtraction)이고

$\gamma$는 mapping function (구체적으로 MLP)고

feature aggregation을 위해 attention vector를 생산한다.

 

scalar와 vector self-attention은 둘다 set operator다.

set은 전체 signal (구체적으로 문장 또는 이미지)를 표현하는

feature vector의 수집이 되거나

signal 내에서 local patch로부터 feawture vector의 수집이 될 수 있다.


3.2. Point Transformer Layer

 

self-attention은 point cloud를 위해 자연적으로 알맞다.

왜냐하면 point cloud는 본질적으로 metric space에서

불규칙적으로 임베딩된 set이기 때문이다.

Point Transformer layer는 vector attention을 기반으로 한다.

저자들은 subtraction relation을 사용하고

position encoding $\delta$를 attention vector $\gamma$와

transformed feature $\alpha$ 둘데 적용한다.

$\mathcal{X(i)} \subseteq \mathcal{X}$는 $x_{i}$의 $k$NN으로 구한

local neighborhood에서 point의 집합이다.

mapping function $\gamma$는 two linear layer와

one ReLU로 구성된 MLP다.

Point Transformer layrer는 구조는 다음과 같다.


3.3. Position Encoding

 

3D point cloud 처리에서, 3D point 좌표 스스로는

position encoding에 대한 자연적인 후보다.

저자들은 파라미터화된 position encoding을 학습하도록 하고

이 position encoding function $\delta$는 다음과 같다.

$p_{i}$와 $p_{j}$는 3D point 좌표다.

encoding function $\theta$는 two linear layer와

one ReLU로 구성된 MLP다.

 

저자들은 position encoding이 attention generation branch와

feature transformation branch에 대해서 중요하다는 것을 발견했다.

따라서 식 (3)에는 식(4)가 들어가고 $\theta$는

end-to-end로 학습된다.


3.4. Point Transformer Block

 

저자들은 point  transformer layer와 함께

residual point transformer block를 구성한다.

transformer block는 self-attention layer와

차원을 감소시키고 처리 속도를 가속할 수 있는 linear projection과

residual connection을 합친다.

input은 3D 좌표 $p$와 연관된 featuer vector $x$의 집합이다.

point transformer block는 localized feature vector들 사이의

정보 교환을 용이하게 한다.

그래서 output으로 모든 data point에 대한 new feature vector를 만든다.

정보 aggregation은 featuer vector와 layout의 content에 모두 적용된다.


3.4. Network Architecture

 

point transformer는 network를 지나는 동안

primary feature aggregation operator다.

Network는 전체적으로 point transformer layer,

pointwise transformation, pooling을 기반으로 한다.

network 구조는 다음과 같다.

Backbone structure

 

semantic segmentation과 classification을 위한 transformer network에서

feature encoder는 점ㅈ진적으로 downsampling하는 2가지 단계를 가진다.

stage당 downsampling rate는 [1, 4, 4, 4, 4]다.

따라서, 각 stage에 의해 만들어진 point set의 크기는

[N, N/4, N/16, N/64, N/256]이고 N은 input point의 수다.

stage의 수와 downsampling rate는 appolication에 따라 다양해질 수 있다.

연이은 stage는 trasnsition module에 의해 연결된다.

(transition down은 encoding, transition up은 decoding)

 

Transition down

 

trnasition down module의 key function은

필요한 point set의 수를 낮추는 것이다.

transition down module에 input으로 제공된 point set을

$P_{1}$로 나타내고 output point set을 $P_{2}$로 나타낸다.

저자들은 farthest point sampling 알고리즘을 $P_{1}$에 수행하여

필요한 크기로 well-spread subset $P_{2} \subset P_{1}$를 확인한다.

$P_{1}$에서 $P_{2}$로 feature vector를 pooling하기 위해

저자들은 $P_{1}$에 kNN graph를 사용한다. (k=16)

 

각 input feature는 linear transformation을 지나가고 뒤이어

batch normalization과 ReLU에 들어가고 뒤이어

$P_{1}$에 있는 k neighbor로부터 $P_{2}$에 있는 각 point로 max pooling을 한다.

Transition up

 

저자들은 U-net 설계를 채택하여 encoder는 대칭적으로

decoder와 묶인다.

decoder에 있는 연이은 stage는 transfition up module에 의해 연결된다.

이것들의 primary function은 downsampled input point set $P_{2}$에서

superset $P_{1} \subset P_{2}$으로 feature가 mapping 된다.

각 input point feature는 linear layer에 의해 처리되고 뒤이어

batch normalization과 ReLU에 의해 처리되고

teature는 삼선형(trilinear) 보간법을 통해 $P_{1}$

higher-resolution ponit set으로 mapping된다.

앞선 decoder stage로 부터 보간된 feature는 skip connection을 통해

encoder stage에 대응되는것으로부터 feature가 요약된다.

Output Head

 

final decoder stage는 input point set에서 각 point에 대한

feature vector를 처리한다.

저잗르은 final logits으로 feature를 mapping하기 위해

MLP를 사용한다.


4. Experiments

 

저자들은 S3DIS dataset과 ModelNet 40,

ShapeNetPart에 대해 실험한다.

 

4.1. Semantic Segmentation

 

Data and metric

 

저자들은 S3DIS dataset을 사용하고

mean classwise Int4ersection over Union (mIoU)

mean of classwise Accuracy (mAcc)

Overall pointwise Accuracy (OA)로 평가한다.

 

Performance comparision

 

Visualization

 


4.4. Ablation Study

 

Number of neighbors

 

저자들은 k 수에 대해 조사한다.

Softmax reglarization

 

저자들은 식(3)에서 normalization function $\rho$에 대해

ablation study를 진행한다.

softmax가 없을 때 S3DIS의 mIOU/mACC/OA는

66.5%/72.8%/89.3%이고

있을때는

70.4%/76.5%/90.8%다.

 

Position encoding

 

저자들은 position encoding $\delta$의 선택에 대해 연구한다.

Attention type

 

저자들은 point transformer layer에서 사용된 self-attention의

type에 대해 조사한다.

여기서 MLP라는 것은 attention 없이 MLP만 적용하는 것이다.


5. Conclustion

 

저자들은 3D point cloud를 위해

transformer architecture를 발전시켰다.

Transformer는 아마 point cloud처리에

NLP, 2D Vision 보다 더 자연스럽다.

왜냐하면 point cloud는 본질적으로 metirc space에 임베딩된 집합이고

self-attention operator는 근본적으로 set operator이기 때문이다.

 

저자들의 연구가 Point Transformer의 특징 조사에 더 영향을 주고

새로운 설계와 operator로 발전되고 여러 task에 적용되기를 바란다.


A. Appendix

 

More detaild results

Inference time and memory

 

저자들은 1대의 Quadro RTX 6000에 대해 실험한 결과

input 수 10k 20k 40k 80k
시간 44ms 86ms 222ms 719ms
메모리 1702M 2064M 2800M 4266M

 

kNN effciency