관련 포스팅
Point-based Method: DGCNN
관련 포스팅 Point-based Method: PointNet개요이전 글 LiDAR에서 잠깐 언급했듯이 포인트 클라우드는 unordered한 irregular format으로 raw data 그대로 직접 딥러닝에 적용하기란 쉽지 않았다. Voxel grid나 이미지
sohee-zoe.tistory.com
개요
이전 글 LiDAR에서 잠깐 언급했듯이 포인트 클라우드는 unordered한 irregular format으로 raw data 그대로 직접 딥러닝에 적용하기란 쉽지 않았다. Voxel grid나 이미지 집합으로 변환하여 사용하기에는 불필요하게 큰 용량으로 렌더링되거나 데이터 손실이 발생하게 된다.
선구적인 연구로 PointNet이 나온 이후로 포인트 클라우드를 직접 다룰 수 있는 딥러닝 모델들이 활발하게 연구되고 있다.
이번 글은 포인트 클라우드를 다루는 딥러닝 모델로 PointNet과 DGCNN (다음글)에 대해 알아보려고 한다.
PointNet: Deep Learning on Point Sets for 3D Classification and Segmentation
PointNet
PointNet: Deep Learning on Point Sets for 3D Classification and Segmentation Charles R. Qi* Hao Su* Kaichun Mo Leonidas J. Guibas Stanford University Conference on Computer Vision and Pattern Recognition (CVPR) 2017 Figure 1. Applic
stanford.edu
Key Contributions
Unordered한 포인트 클라우드를 별도 전처리 없이 직접 사용하여 Classification이나 Segmentation 같은 Task를 처리하는 것이다.
Challenges
Unordered
이미지의 픽셀 배열과 달리 포인트 클라우드는 특정 순서가 없는 점들의 집합이다. 다시 말해, $ N \times 3D $ point sets을 다루는 네트워크는 입력 순서와 무관하게 $ N! $개의 input set에도 동일한 결과 (permutation invariance)를 나타내어야 한다.
Permutation Invariance: Symmetric Function
따라서 네트워크가 포인트 클라우드의 입력 순서에 상관없이 permutation invariant 하기 위해 symmetric function을 사용한다. symmetric function은 입력 순서에 상관없이 일정한 출력을 갖는 함수로, PointNet에서는 max-pooling을 사용한다.
Interaction
인접한 이웃 포인트끼리는 유사한 정보를 가지고 있다. (= 기하학적 구조를 갖는다.) 따라서, 인접한 점들의 거리를 계산해 local structures을 포착해야 하며, local structures간의 combinatorial interactions (global structures)을 포착할 수 있어야 한다.
Local and Global Information Aggregation
Segmentation task을 위해 local feature와 global feature 정보가 필요하다. 따라서 두 feature를 concatenate 한 후 다시 MLP를 거쳐 point별로 class들에 대한 score $ m $개가 나와 최종적으로 $ n \times m $ shape의 output이 나온다.
Invariance
포인트 클라우드는 geometric transformations (rotation, translation) 시켜도 변함이 없어야 한다. 다시 말해 input에 어떤 trasnformation을 적용시켜도 output에는 영향을 끼쳐서는 안된다.
Joint Alignment Network: T-Net
이러한 조건을 만족시키기 위해 PointNet에서는 이미지에 적용되는 STN (Spatial Transformer Network)의 아이디어에서 착안해 T-Net을 소개한다.
Input Transform
T-Net의 목적은 모든 점들이 표준화된 공간에 놓이게 하는 것이다. T-Net (mini-network)을 통해 $ 3 \times 3 $ affine transformation matrix를 예측하고 이 변환을 입력에 곱해 표준화시킨다.
Feature Transform
Input Transformation을 거치고 난 $ n \times 3 $ 크기의 벡터는 MLP를 거쳐 feature를 추출한다. feature space에서도 포인트 클라우드의 feautre를 정렬하기 위해 $64 \times 64$ 크기의 feautre transformation matrix를 예측하고 곱해준다. 이때, feature transformation matrix은 높은 차원을 가지고 있어 최적화 난이도가 크게 증가하며, 따라서 softmax loss에 regularization 항을 추가한다. 이 정규항은 transformation matrix $ A $가 orthogonal matrix가 되도록 하는 식이며, orthogonal matrix는 변환 이후에도 물체의 모양이나 길이가 유지되는 rigid body motion이다.
A square matrix $ A $ is called orthogonal
if $ AA^T = A^TA = I $, i.e., $ A^T = A^{-1} $
Evaluation
여담으로 2019년에 관련 연구를 진행해보고자 PointNet을 사용해본 적이 있는데, 당시에 환경 세팅이 굉장히 어려웠다. 한달 가까이 걸렸던 것 같은데.. 아래는 당시 삽질과 노력의 증거물들이다.
undefined symbol: _ZN10tensorflow8internal21CheckOpMessageBuilder9NewStringEv · Issue #10 · charlesq34/pointnet-autoencoder
I use Ubuntu 18.04 / python 3.6 / Cuda 10.0 / tensorflow 1.9 (py36_gpu) sohee@IPIS-sohee:~/coding/pointnet-autoencoder$ python train.py --model model --log_dir log_chair_norotation --num_point 2048...
github.com
NameError: global name 'nn_distance' is not defined · Issue #21 · optas/latent_3d_points
reset_tf_graph() ae = PointNetAutoEncoder(conf.experiment_name, conf) /home/~~/latent_3d_points/src/point_net_ae.py in _create_loss(self) ---> cost_p1_p2, _, cost_p2_p1, _ = nn_distance(self.x_reco...
github.com
_ZTIN10tensorflow8OpKernelE · Issue #12 · charlesq34/pointnet-autoencoder
I have tried everything there is . It doesn't stop giving me this error. #/bin/bash CUDA_ROOT=/usr/local/cuda-10.0 TF_INC=$(python -c 'import tensorflow as tf; print(tf.sysconfig.get_include())') T...
github.com
GitHub - sohee-zoe/nndistance
Contribute to sohee-zoe/nndistance development by creating an account on GitHub.
github.com