๐ก ํ ์ค ์์ฝ#
์์์ ์นด๋ฉ๋ผ ํ๋ผ๋ฏธํฐ ๊ตฌ์กฐ๋ฅผ ๊ฐ์ง ๋ฉํฐ๋ทฐ RGB ์ด๋ฏธ์ง์์ ์ด์ฐ ๊น์ด ๋ฒ์ฃผ ๋ถํฌ(Categorical Depth Distribution)๋ฅผ ์์ธกํ์ฌ 3D Frustum์ผ๋ก “Lift"ํ๊ณ , ์์ฐจ ๊ธฐ์ค BEV ํ๋ฉด์์ “Splat"ํ ๋ค, ํ ํ๋ฆฟ ๊ถค์ ๋น์ฉ์ ์ต์ ํํ๋ “Shoot” ๊ตฌ์กฐ๋ก End-to-End ์นด๋ฉ๋ผ BEV ํํ ํ์ดํ๋ผ์ธ์ ์์ด๋ฅผ ์ด์๋ค.
๐ ๊ฐ์ ๋ฐ ํต์ฌ ๊ธฐ์ฌ (Key Contributions)#
- ์ ์: Jonah Philion, Sanja Fidler (NVIDIA, University of Toronto, Vector Institute)
- ๋ฐํ๋ ๋: 2020 (arXiv:2008.05711, ECCV 2020)
- ์ฃผ์ ๊ธฐ์ฌ์ :
- Lift (3D Unprojection): ๋จ์ ํฝ์ ์ ๊น์ด ๋ชจํธ์ฑ์ ์ด์ฐ ํ๋ฅ ๋ถํฌ $\alpha$๋ก ๋ชจ๋ธ๋งํ๊ณ , 2D ์ปจํ ์คํธ ํน์ง $\mathbf{c}$์์ ์ธ์ (Outer Product)์ผ๋ก 3D Frustum ํน์ง ์์ฑ.
- Splat (BEV Pillar Pooling): ์นด๋ฉ๋ผ ๋ทฐ๋ณ Frustum ํฌ์ธํธ๋ค์ ์์ฐจ(Ego) ๊ธฐ์ค 2D BEV ๊ทธ๋ฆฌ๋(Pillar)์ ์ง๊ณ(Sum Pooling).
- Cumulative Sum (CumSum) Trick: GPU ๋ฉ๋ชจ๋ฆฌ ํ ๋น ๋ฐ ํจ๋ฉ ์ค๋ฒํค๋ ์์ด ์ ๋ ฌ๊ณผ ๋์ ํฉ ์ฐ์ฐ๋ง์ผ๋ก Pooling ์ญ์ ํ ์๋๋ฅผ 2๋ฐฐ ๊ฐ์.
- Shoot (Motion Planning): ์์ธก๋ BEV Cost Map ์์ ํ ํ๋ฆฟ ๊ถค์ ๋ค์ ํฌ์ฌ(Shoot)ํ์ฌ Boltzmann ํ๋ฅ ๋ถํฌ๋ก ์ข ๋จ๊ฐ ๋ชจ์ ํ๋๋ ํตํฉ.
๐ฏ ๊ด๋ จ ์ฐ๊ตฌ ํ๋ฆ ๋ฐ ๊ธฐ์กด ํ๊ณ (Related Work & Motivation)#
๊ด๋ จ ์ฐ๊ตฌ ํ๋ฆ#
- OFT (Orthographic Feature Transform): 3D ๋ณต์ ์ ์ด๋ฏธ์ง์ ํฌ์ํด ํน์ง์ ๋ชจ์ผ๋ ๊น์ด ๋ถํฌ์ ์๊ด์์ด ๋์ผ ํน์ง์ ๊ธฐ์ฌํจ.
- Pseudo-LiDAR: ๋จ์ ๊น์ด๋ฅผ ํฌ์ธํธ ํด๋ผ์ฐ๋๋ก ๋ณํ ํ 3D ํ์ง๊ธฐ๋ฅผ ์ฐ๊ฒฐํ๋ End-to-End ๋ฏธ๋ถ ๋ถ๊ฐ๋ฅ.
- Lift-Splat-Shoot: ์นด๋ฉ๋ผ ํ๋ผ๋ฏธํฐ๊ฐ ๋ฌด์์๋ก ๋ณ๊ฒฝ(Arbitrary Camera Rigs)๋์ด๋ ์ ์ฐํ๊ฒ ๋์ํ๋ ์ต์ด์ ์์ ๋ฏธ๋ถ ๊ฐ๋ฅํ LSS ํ๋ ์์ํฌ.
๐ ๋ชฉ์ฐจ#
- Chapter 1: Lift โ ๋ฒ์ฃผํ ๊น์ด ํ๋ฅ ๋ถํฌ ๋ฐ Frustum ํน์ง ์์ฑ
- Chapter 2: Splat โ 3D ์ญํฌ์ ๋ฐ BEV Pillar Sum Pooling
- Chapter 3: Cumulative Sum (CumSum) Trick ๊ณ ์ ํ๋ง ๊ตฌํ
- Chapter 4: Shoot โ Boltzmann ๊ถค์ ํ๊ฐ ๋ฐ ๋ชจ์ ํ๋๋
- Chapter 5: ์ฃผ์ ์คํ ๋ฐ ๊ฒฐ๊ณผ
- Chapter 6: ๊ฒฐ๋ก ๋ฐ ์์ฌ์
๐ ๏ธ Chapter 1: Lift โ ๋ฒ์ฃผํ ๊น์ด ํ๋ฅ ๋ถํฌ ๋ฐ Frustum ํน์ง ์์ฑ#
1. ์์ฝ#
๊ฐ ์นด๋ฉ๋ผ ์ด๋ฏธ์ง ํฝ์ $(u, v)$์ ๋ํด ์ด์ฐ ๊น์ด Bin $D = \{d_0, d_1, \dots, d_{|D|-1}\}$์ ์ํ ํ๋ฅ $\alpha_d(u, v)$์ ์ปจํ ์คํธ ํน์ง $\mathbf{c}(u, v)$๋ฅผ ์์ธกํ ๋ค, ๋ ๋ฒกํฐ์ ์ธ์ ์ผ๋ก 3D Frustum ํน์ง $\mathbf{c}_d(u, v)$๋ฅผ ์์ฑํฉ๋๋ค.
2. ์์ ๋ฐ ํ์ด์ฌ ์ฝ๋ ์ค๋ช #
$$\boldsymbol{\alpha}(u, v) = \text{Softmax}\left( \text{Conv2D}(F_{2D}) \right) \in \mathbb{R}^{|D|}, \quad \mathbf{c}(u, v) = \text{Conv2D}(F_{2D}) \in \mathbb{R}^{C}$$$$\mathbf{c}_d(u, v) = \alpha_d(u, v) \cdot \mathbf{c}(u, v) \in \mathbb{R}^{C} \quad (d \in D)$$import torch
import torch.nn as nn
import torch.nn.functional as F
class LSSLiftModule(nn.Module):
"""
LSS Lift ๋จ๊ณ: 2D ์ด๋ฏธ์ง ํน์ง์์ ์ด์ฐ ๊น์ด ํ๋ฅ ๋ถํฌ alpha์ Context feature c ์์ฑ
"""
def __init__(self, in_channels: int = 256, num_depth_bins: int = 41, context_dim: int = 64):
super().__init__()
self.num_depth_bins = num_depth_bins
self.context_dim = context_dim
# Depth + Context ํฉ์ฑ๊ณฑ ํค๋
self.depth_context_head = nn.Conv2d(in_channels, num_depth_bins + context_dim, kernel_size=1)
def forward(self, img_feat: torch.Tensor) -> torch.Tensor:
"""
img_feat: (B, C_in, H, W)
Return Frustum Feat: (B, D, C_ctx, H, W)
"""
B, _, H, W = img_feat.shape
out = self.depth_context_head(img_feat)
# 1. ๊น์ด ํ๋ฅ ๋ถํฌ (Softmax) ๋ฐ Context ๋ถ๋ฆฌ
depth_logits = out[:, :self.num_depth_bins, :, :]
depth_prob = F.softmax(depth_logits, dim=1) # (B, D, H, W)
context = out[:, self.num_depth_bins:, :, :] # (B, C_ctx, H, W)
# 2. Outer Product: Frustum = Depth_prob (B, D, 1, H, W) * Context (B, 1, C_ctx, H, W)
frustum_feat = depth_prob.unsqueeze(2) * context.unsqueeze(1)
return frustum_feat # (B, D, C_ctx, H, W)
# --- ์ฌ์ฉ ์์ ---
f_2d = torch.randn(1, 256, 16, 44)
lift = LSSLiftModule()
print("Lift Frustum Feature Shape:", lift(f_2d).shape)๐ ๏ธ Chapter 2: Splat โ 3D ์ญํฌ์ ๋ฐ BEV Pillar Sum Pooling#
1. ์์ฝ#
2D ํฝ์ $(u, v)$ ๋ฐ ์ด์ฐ ๊น์ด $d$๋ก๋ถํฐ ์นด๋ฉ๋ผ ์ขํ๊ณ 3D ์ขํ $\mathbf{p}_{3D}$๋ฅผ ๊ณ์ฐํ๊ณ , ์ธ์ฌ ํ๋ผ๋ฏธํฐ $(R, t)$๋ฅผ ์ด์ฉํด ์์ฐจ ์ขํ๊ณ 3D ์ขํ $\mathbf{p}_{BEV}$๋ก ๋ณํ ํ ์ง์ ๋ Pillar ์ ์ ํน์ง๋ค์ Sum Poolingํฉ๋๋ค.
2. ์์ ๋ฐ ํ์ด์ฌ ์ฝ๋ ์ค๋ช #
$$\mathbf{p}_{3D}(u, v, d) = d \cdot \mathbf{K}^{-1} \begin{bmatrix} u \\ v \\ 1 \end{bmatrix}$$$$\mathbf{p}_{BEV}(u, v, d) = \mathbf{R} \cdot \mathbf{p}_{3D}(u, v, d) + \mathbf{t}$$$$\text{BEV}(x, y) = \sum_{(u, v, d) \in \text{Pillar}(x, y)} \mathbf{c}_d(u, v)$$import torch
def unproject_frustum_to_bev_coords(
depth_bins: torch.Tensor, # (D,) ์ด์ฐ ๊น์ด๊ฐ๋ค (m)
K_inv: torch.Tensor, # (3, 3) ์นด๋ฉ๋ผ ์ญ๋ด์ฌ ํ๋ ฌ
R_c2e: torch.Tensor, # (3, 3) ์นด๋ฉ๋ผ->Ego ํ์
t_c2e: torch.Tensor, # (3,) ์นด๋ฉ๋ผ->Ego ์ด๋
img_shape: tuple # (H, W)
) -> torch.Tensor:
"""
Frustum ๊ฐ ํฝ์
(u, v, d)์ 3D Ego ์ขํ๊ณ ์ขํ๋ก ์ญํฌ์
"""
H, W = img_shape
D = len(depth_bins)
# 2D Grid (u, v, 1)
vs = torch.arange(0, H).float()
us = torch.arange(0, W).float()
grid_v, grid_u = torch.meshgrid(vs, us, indexing='ij')
# (3, H*W)
pts_2d = torch.stack([grid_u.flatten(), grid_v.flatten(), torch.ones(H*W)], dim=0)
# 3D normalized rays in camera frame
rays_cam = K_inv @ pts_2d # (3, H*W)
# (D, 3, H*W)
pts_cam_3d = depth_bins.view(D, 1, 1) * rays_cam.unsqueeze(0)
# Ego ์ขํ๊ณ ๋ณํ: p_ego = R @ p_cam + t
# (D, H*W, 3)
pts_cam_flat = pts_cam_3d.permute(0, 2, 1).reshape(-1, 3)
pts_ego = (R_c2e @ pts_cam_flat.T).T + t_c2e
return pts_ego.view(D, H, W, 3)
# --- ์ฌ์ฉ ์์ ---
bins = torch.linspace(4.0, 45.0, 41)
K_i = torch.eye(3)
R_e, t_e = torch.eye(3), torch.zeros(3)
pts_ego_res = unproject_frustum_to_bev_coords(bins, K_i, R_e, t_e, (16, 44))
print("์ญํฌ์๋ 3D Ego ์ขํ Shape:", pts_ego_res.shape)๐ ๏ธ Chapter 3: Cumulative Sum (CumSum) Trick ๊ตฌํ#
1. ์์ฝ#
GPU ๋ฉ๋ชจ๋ฆฌ ํจ๋ฉ์ด๋ ๋ถํ์ํ ์ค๋ ๋ ๋๊ธฐ ์์ด, ํฌ์ธํธ๋ค์ BEV Bin ์ธ๋ฑ์ค ์์๋ก ์ ๋ ฌ(Sort)ํ ํ torch.cumsum๊ณผ ๊ตฌ๊ฐ ๊ฒฝ๊ณ ์ฐจ๋ถ์ผ๋ก BEV Sum Pooling์ ๊ณ ์ ๊ณ์ฐํฉ๋๋ค.
2. ์์ ๋ฐ ํ์ด์ฌ ์ฝ๋ ์ค๋ช #
$$\text{CumSum}(k) = \sum_{j=1}^k \mathbf{c}_{d, j}$$$$\text{PillarSum}(m) = \text{CumSum}(\text{end}_m) - \text{CumSum}(\text{start}_m)$$import torch
def cumsum_trick_bev_pooling(
feats: torch.Tensor, # (N, C) Frustum ํน์ง๋ค
bin_ids: torch.Tensor, # (N,) ์ ์ํ BEV ์
Bin ์ธ๋ฑ์ค
num_bins: int # ์ด BEV ์
๊ฐ์ H * W
) -> torch.Tensor:
"""
LSS์ ํต์ฌ: Cumulative Sum Trick ๊ธฐ๋ฐ ๊ณ ์ Pillar Sum Pooling
"""
N, C = feats.shape
# 1. Bin ID ์์๋ก ์ ๋ ฌ
ranks = torch.argsort(bin_ids)
sorted_feats = feats[ranks]
sorted_bins = bin_ids[ranks]
# 2. Cumulative Sum ๊ณ์ฐ
cum_sum = torch.cumsum(sorted_feats, dim=0)
# 3. Bin ๊ฒฝ๊ณ ์ง์ (Section Boundaries) ๊ฒ์ถ
kept = torch.ones(N, dtype=torch.bool, device=feats.device)
kept[:-1] = sorted_bins[:-1] != sorted_bins[1:]
end_indices = torch.where(kept)[0]
# ๊ตฌ๊ฐ ์ฐจ๋ถ์ผ๋ก Bin๋ณ Sum ์ถ์ถ
slice_sum = cum_sum[end_indices]
prev_sum = torch.cat([torch.zeros((1, C), device=feats.device), slice_sum[:-1]], dim=0)
final_bin_sum = slice_sum - prev_sum
unique_bins = sorted_bins[end_indices]
bev_flat = torch.zeros((num_bins, C), device=feats.device)
bev_flat[unique_bins] = final_bin_sum
return bev_flat
# --- ์ฌ์ฉ ์์ ---
f_dummy = torch.randn(1000, 64)
b_dummy = torch.randint(0, 100, (1000,))
bev_res = cumsum_trick_bev_pooling(f_dummy, b_dummy, 100)
print("CumSum Trick Pooling ๊ฒฐ๊ณผ Shape:", bev_res.shape)๐ ๏ธ Chapter 4: Shoot โ Boltzmann ๊ถค์ ํ๊ฐ ๋ฐ ๋ชจ์ ํ๋๋#
1. ์์ฝ#
์์ฑ๋ BEV ํน์ง ์์์ ํ์ต๋ Cost Map $c_o(x, y)$์ ์ถ์ถํ๊ณ , ์ฌ์ ์ ์๋ ํ ํ๋ฆฟ ๊ถค์ $\tau_i$ ์์ ๋์ ๋น์ฉ์ ๋ํ Boltzmann ํ๋ฅ ๋ถํฌ๋ฅผ ๊ณ์ฐํ์ฌ ์ต์ ์ ์ฃผํ ๊ถค์ ์ ์ ํํฉ๋๋ค.
2. ์์ ๋ฐ ํ์ด์ฌ ์ฝ๋ ์ค๋ช #
$$p(\tau_i \mid o) = \frac{\exp\left(-\sum_{(x, y) \in \tau_i} c_o(x, y)\right)}{\sum_{\tau \in \mathcal{T}} \exp\left(-\sum_{(x', y') \in \tau} c_o(x', y')\right)}$$import torch
import torch.nn.functional as F
def shoot_template_trajectories(
bev_cost_map: torch.Tensor, # (H, W) ์์ธก๋ BEV ๊ณต๊ฐ ์ฃผํ ์ํ๋ Cost Map
trajectories: torch.Tensor # (K_templates, T_steps, 2) ๊ถค์ ํ
ํ๋ฆฟ ํฝ์
์ขํ (x, y)
) -> torch.Tensor:
"""
Shoot ๋จ๊ณ: ํ
ํ๋ฆฟ ๊ถค์ ๋ค์ ๋ํ Boltzmann ํ๋ฅ ๋ถํฌ ํ๊ฐ
"""
K, T, _ = trajectories.shape
costs = []
for i in range(K):
traj = trajectories[i] # (T, 2)
xs = traj[:, 0].long().clamp(0, bev_cost_map.shape[1]-1)
ys = traj[:, 1].long().clamp(0, bev_cost_map.shape[0]-1)
# ๊ถค์ ๋์ ๋น์ฉ
traj_cost = bev_cost_map[ys, xs].sum()
costs.append(traj_cost)
costs_tensor = torch.stack(costs)
# Boltzmann Probability (๋น์ฉ์ด ๋ฎ์์๋ก ๋์ ํ๋ฅ )
probs = F.softmax(-costs_tensor, dim=0)
return probs
# --- ์ฌ์ฉ ์์ ---
c_map = torch.rand(200, 200)
trajs = torch.randint(0, 200, (10, 20, 2)).float()
print("์ต์ ๊ถค์ ์ ํ ํ๋ฅ :", shoot_template_trajectories(c_map, trajs))๐ ์ฃผ์ ์คํ ๋ฐ ๊ฒฐ๊ณผ (Experiments & Results)#
1. nuScenes & Lyft 3D ๋ถํ ๋ฐ ๋ชจ์ ํ๋๋ ์ฑ๊ณผ#
| ์๊ณ ๋ฆฌ์ฆ (Method) | ์ฌ์ฉ ์นด๋ฉ๋ผ ์ | nuScenes Car mIoU โ | Lyft Car mIoU โ | Zero-Shot Transfer mIoU โ |
|---|---|---|---|---|
| CNN Baseline | 6 Cameras | 22.78 | 30.71 | 7.00 |
| OFT | 6 Cameras | 29.72 | 39.48 | 16.25 |
| Lift-Splat (Ours) | 6 Cameras | 32.06 (+2.3%) | 43.09 (+3.6%) | 21.35 (+5.1%) |
๐ก ๊ฒฐ๋ก ๋ฐ ์์ฌ์ (Conclusion & Insights)#
1. ๊ฒฐ๋ก #
Lift-Splat-Shoot์ ์นด๋ฉ๋ผ ํ๋ผ๋ฏธํฐ๋ฅผ ๋ถ๋ณ(Implicit Unprojection)์ผ๋ก ์์ฉํ์ฌ ๋จ์ ๊น์ด์ ๋ฒ์ฃผํ ํ๋ฅ ๋ถํฌ๋ฅผ 3D BEV ๊ณต๊ฐ์ผ๋ก ์ฌ์ํ๊ณ ๋ชจ์ ํ๋๋๊น์ง ์๋ ํ๋ ์นด๋ฉ๋ผ ๊ธฐ๋ฐ 3D Perception์ ๊ธฐ์ด ์์กฐ์ ๋๋ค.
2. ํ๊ณ์ ๋ฐ ์์ฌ์ด ์ #
- ์ผ๊ฐ์ด๋ ์ฅ๊ฑฐ๋ฆฌ์์ LiDAR ๋๋น ์ฑ๋ฅ ๊ฒฉ์ฐจ๊ฐ ์กด์ฌํ๋ค.
- ๋จ์ผ ํ์์คํ ๋ง ์ฒ๋ฆฌํ๋ฏ๋ก temporal ์ ๋ณด๋ฅผ ์ ํ ํ์ฉํ์ง ๋ชปํ๋ค (์ด๋ ์ดํ BEVDet4D, BEVFormer ๋ฑ์ด ํด๊ฒฐ).
- ๋ชจ์ ํ๋๋ ์ฑ๋ฅ๋ LiDAR ๊ธฐ๋ฐ๋ณด๋ค ๋ช ํํ ๋ฎ์, ์ค์ ๋ฐฐํฌ์๋ ์ถ๊ฐ ๊ฒ์ฆ์ด ํ์ํ๋ค.
์ฐธ๊ณ ์๋ฃ#
๊ด๋ จ ๋ ผ๋ฌธ: BEVDepth, BEVFormer, BEVFusion, DETR3D, nuScenes