Learning Less is More - 6D Camera Localization via 3D Surface Regression
현재 Learning-based Visual Localization에서 SOTA 중 하나인 LessMore 논문의 발표자료
- 발표자료의 일부는 ECCV 2018, Visual Localization workshop에서 Eric Brachmann의 슬라이드를 참고하였습니다.
3. Q. 아래 용어 중 다른 방법을 지칭하는 말은?
1. Visual Localization
2. Image-based Localization
3. Camera Relocalization
4. Image Retrieval
5. Image-based pose estimation
6. Camera pose regression
3[1] Piasco, Nathan, et al. "A survey on Visual-Based Localization: On the benefit of heterogeneous data." Pattern Recognition 74 (2018): 90-109.
4. Visual Localization이란?
4
• 입력 (query) image에 대해
카메라의 pose를 구하거나,
query image와 유사한 image
들을 찾는 과정
• Feature-based method
vs.
Learning-based method
Learning based Method
Feature-based Method
5. Visual Localization 목적에 따른 구분 [1]
• Indirect method
• Image Retrieval
• 가지고 있는 이미지들 중
Query와 가장 유사한 이미지들을
찾는 것
5
• Direct method
• 6D pose regression
• Query의 Map 상에서의 6D pose를
구하는 것
[1] Piasco, Nathan, et al. "A survey on Visual-Based Localization: On the benefit of heterogeneous data." Pattern Recognition 74 (2018): 90-109.
근데 사실 image
retrieval 후 pose
estimation
하기도 함
오늘의 주제
7. Pose regression 삼국지
7
Check slide notes for references
Learning Pose Directly
: 네트워크를 이용해
글로벌 포즈를 바로 학습
Sparse Feature Based
: 2D-3D correspondence를
구한 후 PnP method로
Pose estimation
Learning Pose with 3D map points
: Scene coordinates (3D map points)과
글로벌 포즈를 학습 (또는 유추)
9. Learning-based Camera Pose Regression
• 학습 기반 영상의 글로벌 포즈 추정 (Naïve)
9
Slide from Eric Brachmann in ECCV 2018 WorkshopTraining image with
global ground-truth poses
10. Scene Coordinate Regression
10
3D Points in a map
Shotton, Jamie, et al. "Scene coordinate regression forests for camera relocalization in RGB-D images." IEEE Conference on Computer Vision and Pattern Recognition. 2013.
15. Scene Coordinate Regression
15
3D Points in a map
Shotton, Jamie, et al. "Scene coordinate regression forests for camera relocalization in RGB-D images." IEEE Conference on Computer Vision and Pattern Recognition. 2013.
이걸 러닝으로 풀겠다
(RGB 입력으로)
16. 그리고 RANSAC? (Random Sample Consensus)
16
• 모르시면 3분 안에
Install 해드려요
• RANSAC Song
자매품
Fundamental Matrix Song
(https://www.youtube.com/watc
h?v=DgGV3l82NTk)
21. Overview
21
1. CNN
: Trainable
2. PnP
: Differentiable
3. Scoring
: Differentiable?
4. Selection
: Differentiable?
Slide from Eric Brachmann in ECCV 2018 Workshop
22. 순서대로 정리해서 살펴보면
1. 입력 영상에서 Patch-wise로 Scene Coordinate Estimation
• Fully Convolution Network로 입력 Patch에 대해 출력은
해당 Patch의 center의 global 3D position
2. 2D image에 대해서 3D global position을 (우선) 구했기 때문에, 여기서 4개의
matching pair를 random 하게 뽑아서 pose estimation을 수행 (n번 수행)
• 4개의 2D-3D matching pair가 있으면 unique pose를 구할 수 있다
• 4개의 matching pair를 n번 랜덤하게 뽑아서 n개의 pose hypothesis를 구함
3. Scene Coordinate를 image에 reprojection해서 에러를 구하고, 어떤 pose
hypothesis가 좋은 예측인지 scoring
4. 가장 좋은 hypothesis를 선택하고, inlier set을 구해서 refinement. 그리고 Global
True pose와 비교해서 학습
22
23. 1. Scene Coordinate Regression
• DSAC: Distance to GT scene coordinates
23
• LessMore: Reprojection Error
GT pose h*를 이용해 scene coordinate를 image plane으로 projection 했을 때 pixel error
y: scene coordinates
y*: true scene coordinates
h*: true pose
p: pixels
True global points를 알고 있으므로,
Estimation과 GT의 Distance를 Loss로 사용
True global pose를 알고 있으므로,
Estimation을 image plane으로
projection, pixel distance를 Loss로 사용
24. 1. Scene Coordinate Regression
• DSAC: Distance to GT scene coordinates
24
• LessMore: Reprojection Error
y: scene coordinates
y*: true scene coordinates
h*: true pose
p: pixels
True global points를 알고 있으므로,
Estimation과 GT의 Distance를 Loss로 사용
True global pose를 알고 있으므로,
Estimation을 image plane으로
projection, pixel distance를 Loss로 사용
True global points를 몰라도
학습할 수 있다 (Unsupervised)
25. 1. Scene Coordinate Regression w/o GT
• Key
• True Scene coordinates,
즉, RGBD 입력이나
Rendering truth가 없어도
학습이 가능하다
• Predefined depth, GT Pose를
이용해서,
Plane 형태의 initial 가정
• 만약 GT scene coordinate가
있다면 그대로 사용 가능
25
26. 2. Pose Hypothesis Estimation
• 4개의 2D-3D correspondences -> one unique pose
• PnP (Perspective-n-Point)
• solvePnP in OpenCV!
• N개의 pose hypotheses 생성
26
https://icwww.epfl.ch/~lepetit/papers/lepetit_ijcv08.pdf
27. 2. Pose Hypotheses Estimation
• 각 Hypothesis에 대해 reprojection error 계산
• C: calibration matrix
• y: scene coordinate
• h: pose hypothesis
• p: corresponding pixel
• Reprojection errors
27
https://icwww.epfl.ch/~lepetit/papers/lepetit_ijcv08.pdf
28. 3. Pose Hypothesis Scoring
28Slide from Eric Brachmann in ECCV 2018 Workshop
Sigmoid function을 이용한 soft counting
Score learning 보다 좋은 이유
1. Learning은 global error를 학습하므로 generalize 성능 떨어짐
2. 강한 스코어를 가지는 hypothesis로 치우치게 된다 (overfit)
• Reprojection error를 이용해서 각 hypothesis를 scoring 해야한다
Soft Counting이
Generality가
훨씬 좋다
30. • Probabilistic Selection
• Softmax distribution with scaling factor α (α에 대한 학습은 다음페이지)
• Policy gradient 기반의 학습방법
• RL에서 expected reward를 최대화 하는 policy를 구하는 것 처럼,
여기선 expected loss를 minimize하는 hypothesis를 구하는 것 (이를 위해
softmax를 이용해서 확률화)
4. Hypothesis Selection
30
31. 4. Hypothesis Selection – Entropy Control
• Inlier score는 scene의 종류에 따라 달라질 수 있기 때문에, 여러
이미지에서 고르게 학습이 되려면, inlier score의 magnitude를
적절하게 유지해주는 것이 좋다!
• First few iteration에서 target entropy를 설정하고, target entropy와
유사하게 scoring probability가 나오도록 α 를 학습
31
32. 5. End-to-end Learning
• Pose refinement process를 미분 가능하게 approximation
• Pose refinement (R) 만 미분가능하면 이제 모든 process가 미분가능! (학습가능)
32
Reproj error of inliers
Approximated gradient
for training
33. 5. End-to-end Learning
• Learning the pipeline (Policy Gradient)
• Policy Gradient에서 최적의 Policy를 학습 = 최적의 pose hypothesis를 학습
• Policy Gradient에서 Maximum reward로 학습 = Minimum pose loss로 학습
33
z
Derivative of the selection probability Derivative of the task loss
Details? .. https://medium.freecodecamp.org/an-introduction-to-policy-gradients-with-cartpole-and-doom-495b5ef2207f
Refined pose hypothesis와
True pose의 Distance (Loss)
34. 다시 순서대로 정리해서 살펴보면
1. 입력 영상에서 Patch-wise로 Scene Coordinate Estimation
• Fully Convolution Network로 입력 Patch에 대해 출력은
해당 Patch의 center의 global 3D position
2. 2D image에 대해서 3D global position을 (우선) 구했기 때문에, 여기서 4개의
matching pair를 random 하게 뽑아서 pose estimation을 수행 (n번 수행)
• 4개의 2D-3D matching pair가 있으면 unique pose를 구할 수 있다
• 4개의 matching pair를 n번 랜덤하게 뽑아서 n개의 pose hypothesis를 구함
3. Scene Coordinate를 image에 reprojection해서 에러를 구하고, 어떤 pose
hypothesis가 좋은 예측인지 scoring
4. 가장 좋은 hypothesis를 선택하고, inlier set을 구해서 refinement. 그리고 Global
True pose와 비교해서 학습
34
40. Conclusion
• Accurate! And Robust!
• 가장 중요한 부분은 RANSAC의 Non-differentiable한 부분을 미분 가능한 형태로
구현해서 학습이 가능하도록 했다는 것
• SfM이나 SLAM과 같은 다양한 알고리즘을 deep learning framework으로 구성할 수 있지 않을까..
• DSAC to LessMore (DSAC+)
• Hypotheses scorin하는 부분이 scoring network에서 soft counting으로 바꾸었을 때 나타나는 효과는
domain knowledg의 효과를 나타낸다고 생각
• 즉, 명확하게 정보를 줄 수 있는 부분은 학습이 아니라 미분가능한 형태로 구성하는 것이,
딥러닝에서 발생하는 네트워크의 모호성을 낮출 수 있다!
• Limitations (Open problems)
• Training stability and computation load
• Scalability
• Modelling ambiguities
40
41. References
[1] Kendall, Alex, Matthew Grimes, and Roberto Cipolla. "Posenet: A convolutional network for real-time 6-dof camera relocalization."
Proceedings of the IEEE international conference on computer vision. 2015.
[2] Kendall, Alex, and Roberto Cipolla. "Modelling uncertainty in deep learning for camera relocalization." 2016 IEEE international conference
on Robotics and Automation (ICRA). IEEE, 2016.
[3] Kendall, Alex, and Roberto Cipolla. "Geometric loss functions for camera pose regression with deep learning." Proc. CVPR. Vol. 3. 2017.
[4] Walch, Florian, et al. "Image-based localization using lstms for structured feature correlation." Int. Conf. Comput. Vis.(ICCV). 2017.
[5] Melekhov, Iaroslav, et al. "Image-based localization using hourglass networks." arXiv preprint arXiv:1703.07971 (2017).
[6] Brachmann, Eric, et al. "DSAC-differentiable RANSAC for camera localization." IEEE Conference on Computer Vision and Pattern Recognition
(CVPR). Vol. 3. 2017.
[7] Valada, Abhinav, Noha Radwan, and Wolfram Burgard. "Deep auxiliary learning for visual localization and odometry." arXiv preprint
arXiv:1803.03642 (2018).
[8] Radwan, Noha, Abhinav Valada, and Wolfram Burgard. "Vlocnet++: Deep multitask learning for semantic visual localization and odometry."
arXiv preprint arXiv:1804.08366 (2018).
[9] Shotton, Jamie, et al. "Scene coordinate regression forests for camera relocalization in RGB-D images." Proceedings of the IEEE Conference
on Computer Vision and Pattern Recognition. 2013.
[10] Sattler, Torsten, Bastian Leibe, and Leif Kobbelt. "Improving image-based localization by active correspondence search." European
conference on computer vision. Springer, Berlin, Heidelberg, 2012.
[11] Camposeco, Federico, et al. "Hybrid Camera Pose Estimation." Proceedings of the IEEE Conference on Computer Vision and Pattern
Recognition. 2018.
41