๐ก ํ ์ค ์์ฝ#
BEV ํ๋ฉด์ ๋์ด ์ถ ์ ๋ณด ์์ค์ ๋ง๊ธฐ ์ํด 3D ๊ณต๊ฐ ์ฟผ๋ฆฌ๋ฅผ 2D ๋ฉํฐ์นด๋ฉ๋ผ ํน์ง ๋งต์ ์ง์ ์ดํ ์ ํ๋ 2D-3D Spatial Deformable Cross-Attention์ ์ค๊ณํ๊ณ , Poisson Surface Reconstruction ๊ธฐ๋ฐ ๋ฐ์ง(Dense) GT ์๋ ์์ฑ ํ์ดํ๋ผ์ธ์ผ๋ก nuScenes 3D Occupancy ์์ธก SOTA(20.30 mIoU)๋ฅผ ๋ฌ์ฑํ๋ค.
๐ ๊ฐ์ ๋ฐ ํต์ฌ ๊ธฐ์ฌ (Key Contributions)#
- ์ ์: Yi Wei, Linqing Zhao, Wenzhao Zheng, Zheng Zhu, Jie Zhou, Jiwen Lu (Tsinghua Univ., Tianjin Univ., PhiGent Robotics)
- ๋ฐํ๋ ๋: 2023 (arXiv:2303.09551, ICCV 2023)
- ์ฃผ์ ๊ธฐ์ฌ์ :
- 2D-3D Volumetric Spatial Attention: BEV ํ๋ฉด ๋์ 3D ๋ณผ๋ฅจ ์ฟผ๋ฆฌ $Q \in \mathbb{R}^{C \times H \times W \times Z}$๋ฅผ ์ง์ ์์ฑํ์ฌ ๋์ด ์ ๋ณด๋ฅผ ์จ์ ํ ์ ์ง.
- Multi-Scale 3D U-Net & Decayed Loss: ์ ํด์๋๋ถํฐ ๊ณ ํด์๋๊น์ง ๋ณต์ ํน์ง์ ์ ์ง์ ์ผ๋ก ์ ์ ํ๋ 3D Deconv ํผ๋ผ๋ฏธ๋ ์คํ.
- Poisson Surface Reconstruction ๊ธฐ๋ฐ Dense GT ํ์ดํ๋ผ์ธ: ๋ฉํฐํ๋ ์ ๋์ /์ ์ LiDAR ํฌ์ธํธ๋ฅผ ์คํฐ์นญ ํ ๋ฉ์ฌ ํ๋ฉด์ ์์ฑํ์ฌ ๊ฐ๋ ค์ง ์์ญ๊น์ง ์์ ๋ฐ์ง(Dense) Occupancy GT ๊ตฌ์ถ.
๐ฏ ๊ด๋ จ ์ฐ๊ตฌ ํ๋ฆ ๋ฐ ๊ธฐ์กด ํ๊ณ (Related Work & Motivation)#
๊ด๋ จ ์ฐ๊ตฌ ํ๋ฆ#
- BEV-based Perception (BEVFormer): 3D ์ ๋ณด๋ฅผ 2D BEV ํ๋ฉด์ผ๋ก ์ฌ์ํ์ฌ ๋์ด ์ถ(Z-axis) ์ธ๋ถ ๊ธฐํ๊ฐ ์์๋จ.
- Sparse LiDAR Supervision (TPVFormer): ํฌ์ํ LiDAR ๋ ์ด๋ธ๋ก ํ์ตํ์ฌ ์์ธก ๊ฒฐ๊ณผ๋ ๋ฌ์ฑ๋ฌ์ฑํ ๋น ๊ณต๊ฐ ํํ๋ก ์์ฑ๋จ.
- SurroundOcc: 3D ๊ณต๊ฐ ๋ณต์ ๊ณผ ๋ฐ์ง Poisson GT๋ฅผ ์ด์ฉํด ์์ ํ ๋ฐ์ง(Dense) 3D Occupancy ๋ณต์.
๐ ๋ชฉ์ฐจ#
- Chapter 1: 2D-3D Volumetric Spatial Attention ์์
- Chapter 2: Multi-Scale 3D U-Net ํผ๋ผ๋ฏธ๋ ์ ์ํ๋ง
- Chapter 3: Decayed Multi-Scale Occupancy Loss
- Chapter 4: 3D Occupancy IoU & mIoU ํ๊ฐ ์ฐ์
- Chapter 5: ์ฃผ์ ์คํ ๋ฐ ๊ฒฐ๊ณผ
- Chapter 6: ๊ฒฐ๋ก ๋ฐ ์์ฌ์
๐ ๏ธ Chapter 1: 2D-3D Volumetric Spatial Attention ์์#
1. ์์ฝ#
3D ๊ณต๊ฐ ์์ ๋ณต์ ์ฟผ๋ฆฌ $q \in Q_{x, y, z}$๋ฅผ 6๊ฐ ์นด๋ฉ๋ผ $m$์ 2D ํ๋ฉด์ผ๋ก ์ฌ์ํ ์ง์ $p_{m}$ ๊ทผ๋ฐฉ์์ Deformable Attention์ผ๋ก ํน์ง์ ์ง๊ณํฉ๋๋ค.
2. ์์ ๋ฐ ํ์ด์ฌ ์ฝ๋ ์ค๋ช #
$$\text{DeformAttn}(q, p, x) = \sum_{i=1}^{N_{\text{head}}} \mathbf{W}_i \sum_{j=1}^{N_{\text{key}}} \mathcal{A}_{ij} \cdot \mathbf{W}'_i x(p + \Delta p_{ij})$$- $q$: 3D ๋ณผ๋ฅจ ์ฟผ๋ฆฌ ๋ฒกํฐ ($x, y, z$)
- $p$: 3D ๊ธฐ์ค์ ์ 2D ์ด๋ฏธ์ง ํ๋ฉด์ผ๋ก ์ฌ์ํ ์ ๊ทํ ์ขํ
import torch
import torch.nn as nn
import torch.nn.functional as F
class VolumetricSpatialCrossAttention3D(nn.Module):
"""
SurroundOcc: 3D ๋ณผ๋ฅจ ์ฟผ๋ฆฌ์ 2D ๋ฉํฐ๋ทฐ ์ด๋ฏธ์ง ๊ฐ Deformable Cross-Attention
"""
def __init__(self, embed_dim: int = 128, num_heads: int = 4, num_keys: int = 4):
super().__init__()
self.num_heads = num_heads
self.num_keys = num_keys
self.offset_head = nn.Linear(embed_dim, num_heads * num_keys * 2)
self.weight_head = nn.Linear(embed_dim, num_heads * num_keys)
def forward(self, query_3d: torch.Tensor, img_feats_2d: torch.Tensor) -> torch.Tensor:
"""
query_3d: (B, Dx, Dy, Dz, C)
img_feats_2d: (B, N_cams, C, H, W)
"""
B, Dx, Dy, Dz, C = query_3d.shape
N_cams, _, H, W = img_feats_2d.shape[1:]
q_flat = query_3d.view(B, Dx * Dy * Dz, C)
num_q = Dx * Dy * Dz
# 3D ๋ณต์
์ฟผ๋ฆฌ๋ก๋ถํฐ ์นด๋ฉ๋ผ๋ณ ์ฐธ์กฐ์ ์คํ์
๊ณผ ์ดํ
์
๊ฐ์ค์น ์์ธก
offsets = self.offset_head(q_flat).view(B, num_q, self.num_heads, self.num_keys, 2)
weights = torch.softmax(
self.weight_head(q_flat).view(B, num_q, self.num_heads, self.num_keys), dim=-1
)
# ์นด๋ฉ๋ผ ๋ด์ ํ๋ผ๋ฏธํฐ๋ก ๋ณต์
์ ๊ฐ ์นด๋ฉ๋ผ ์ด๋ฏธ์ง ํ๋ฉด์ ํฌ์ํ๋ค๊ณ ๊ฐ์ ํ
# ์ ๊ทํ ์ขํ(์ค์ ๊ตฌํ์์๋ 3D->2D projection ๊ฒฐ๊ณผ)์ ์คํ์
์ ๋ํด ์ฐธ์กฐ์ ์์ฑ
base_ref = torch.zeros(B, num_q, 1, 1, 2, device=q_flat.device)
sample_grid = (base_ref + offsets).clamp(-1, 1) # (B, num_q, heads, keys, 2)
# ์นด๋ฉ๋ผ 1๊ฐ(๋ํ)์ ๋ํด grid_sample๋ก ์ด๋ฏธ์ง ํน์ง์ ์ค์ ๋ก ์ํ๋ง
img_feat_cam0 = img_feats_2d[:, 0] # (B, C, H, W)
grid = sample_grid.view(B, num_q * self.num_heads, self.num_keys, 2)
sampled = F.grid_sample(img_feat_cam0, grid, align_corners=False) # (B, C, num_q*heads, keys)
sampled = sampled.view(B, C, num_q, self.num_heads, self.num_keys).permute(0, 2, 3, 4, 1)
# ํค๋/ํค ์ฐจ์์ ๋ํด ์ดํ
์
๊ฐ์คํฉ
attn_out = (sampled * weights.unsqueeze(-1)).sum(dim=(2, 3)) # (B, num_q, C)
updated_volume = query_3d + attn_out.view(B, Dx, Dy, Dz, C)
return updated_volume
# --- ์ฌ์ฉ ์์ ---
q_vol = torch.randn(1, 16, 16, 8, 128)
f_2d = torch.randn(1, 6, 128, 32, 32)
vol_attn = VolumetricSpatialCrossAttention3D()
print("3D Volumetric Attention ์ถ๋ ฅ Shape:", vol_attn(q_vol, f_2d).shape)๐ ๏ธ Chapter 2: Multi-Scale 3D U-Net ํผ๋ผ๋ฏธ๋ ์ ์ #
1. ์์ฝ#
์ ํด์๋ 3D ํผ์ฒ $Y_{j-1}$๋ฅผ 3D Deconvolution ์ฐ์ฐ์ผ๋ก 2๋ฐฐ ์ ์ํํ์ฌ ์์ ์ค์ผ์ผ ํน์ง $F_j$์ ํฉ์ฐ ๊ฒฐํฉํฉ๋๋ค.
2. ์์ ๋ฐ ํ์ด์ฌ ์ฝ๋ ์ค๋ช #
$$Y_j = F_j + \text{Deconv3D}(Y_{j-1})$$import torch
import torch.nn as nn
class MultiScale3DUnetDecoder(nn.Module):
"""
SurroundOcc: ์ ํด์๋ 3D ๋ณผ๋ฅจ ํผ์ฒ๋ฅผ ๊ณ ํด์๋๋ก ์ ์ง ์
์ํ ์ ์
"""
def __init__(self, in_channels: int = 128, out_channels: int = 128):
super().__init__()
self.deconv3d = nn.ConvTranspose3d(in_channels, out_channels, kernel_size=4, stride=2, padding=1)
self.conv3d = nn.Conv3d(out_channels, out_channels, kernel_size=3, padding=1)
def forward(self, low_res_feat: torch.Tensor, high_res_feat: torch.Tensor) -> torch.Tensor:
"""
low_res_feat: (B, C, Dx/2, Dy/2, Dz/2)
high_res_feat: (B, C, Dx, Dy, Dz)
"""
upsampled = self.deconv3d(low_res_feat)
fused = self.conv3d(upsampled + high_res_feat)
return fused
# --- ์ฌ์ฉ ์์ ---
low_f = torch.randn(1, 128, 8, 8, 4)
high_f = torch.randn(1, 128, 16, 16, 8)
unet_3d = MultiScale3DUnetDecoder()
print("์
์ํ ์ ์ ๋ 3D Volume Feature Shape:", unet_3d(low_f, high_f).shape)๐ ๏ธ Chapter 3: Decayed Multi-Scale Occupancy Loss#
1. ์์ฝ#
ํผ๋ผ๋ฏธ๋ ์ค์ผ์ผ $j$ ($0$: ์ต์์ ๊ณ ํด์๋ $\dots$ $M-1$: ์ตํ์ ์ ํด์๋)์ ๋ํด ๊ฐ์ ๊ฐ์ค์น $\alpha_j = \frac{1}{2^j}$๋ฅผ ๊ณฑํด ์ด ์์ค์ ๊ณ์ฐํฉ๋๋ค.
2. ์์ ๋ฐ ํ์ด์ฌ ์ฝ๋ ์ค๋ช #
$$\alpha_j = \frac{1}{2^j}$$$$\mathcal{L}_{total} = \sum_{j=0}^{M-1} \frac{1}{2^j} \mathcal{L}_{occ}(Y_j, \text{GT}_j)$$import torch
import torch.nn.functional as F
def compute_decayed_multiscale_occupancy_loss(
multiscale_preds: list, # [Level_0 (High), Level_1, Level_2 (Low)]
multiscale_gts: list
) -> torch.Tensor:
"""
SurroundOcc: ๊ฐ์ ๊ฐ์ค์น alpha_j = 1 / (2^j) ๊ธฐ๋ฐ Multi-Scale Occupancy Loss
"""
total_loss = 0.0
for j, (pred, gt) in enumerate(zip(multiscale_preds, multiscale_gts)):
weight = 1.0 / (2.0 ** j)
loss_j = F.cross_entropy(pred, gt)
total_loss += weight * loss_j
return total_loss
# --- ์ฌ์ฉ ์์ ---
preds = [torch.randn(100, 18), torch.randn(100, 18), torch.randn(100, 18)]
gts = [torch.randint(0, 18, (100,)), torch.randint(0, 18, (100,)), torch.randint(0, 18, (100,))]
print("SurroundOcc Decayed Multi-Scale Loss:", compute_decayed_multiscale_occupancy_loss(preds, gts).item())๐ ์ฃผ์ ์คํ ๋ฐ ๊ฒฐ๊ณผ (Experiments & Results)#
1. nuScenes 3D Occupancy ์์ธก ์ฑ๋ฅ ๋ฆฌ๋๋ณด๋#
| ์๊ณ ๋ฆฌ์ฆ (Method) | ์ ๋ ฅ ๋ชจ๋ฌ๋ฆฌํฐ | SC (Scene Completion) IoU โ | SSC mIoU โ |
|---|---|---|---|
| MonoScene | RGB (Monocular) | 23.96 | 7.31 |
| BEVFormer | RGB (Multi-Camera) | 30.50 | 16.75 |
| TPVFormer | RGB (Multi-Camera) | 30.86 | 17.10 |
| SurroundOcc (Ours) | RGB (Multi-Camera) | 31.49 (+0.63%) | 20.30 (+3.20%) |
- ๊ฒฐ๊ณผ: 3D ๋ณผ๋ฅจ ์ฟผ๋ฆฌ์ Poisson ๋ฐ์ง GT ํ์ต ๋๋ถ์ TPVFormer ๋๋น SSC mIoU +3.2%p ๋ํญ ํฅ์.
๐ก ๊ฒฐ๋ก ๋ฐ ์์ฌ์ (Conclusion & Insights)#
1. ๊ฒฐ๋ก #
SurroundOcc๋ 2D-3D Volumetric Spatial Attention๊ณผ Poisson Surface Reconstruction ๋ฐ์ง GT ๋ผ๋ฒจ๋ง์ ์ต์ด ๊ตฌํํ์ฌ ์นด๋ฉ๋ผ ์ ์ฉ 3D Occupancy ์์ธก ์ฑ๋ฅ์ ํ๊ณ๋ฅผ ๊ฒฉ์์์ผฐ์ต๋๋ค.
2. ํ๊ณ์ ๋ฐ ์์ฌ์ด ์ #
- ๋จ์ผ ํ๋ ์ ์ ๋ ฅ๋ง ์ฒ๋ฆฌํ๋ฏ๋ก ์๊ฐ์ ์ฐ์์ฑ(occupancy flow)์ด ์์ด motion prediction์ ์ง์ ํ์ฉํ๊ธฐ ์ด๋ ต๋ค.
- BEVFormer ๋๋น latency/memory๊ฐ ๋ค์ ์ฆ๊ฐํ์ฌ ์ค์๊ฐ์ฑ๊ณผ ์ ํ๋ ์ฌ์ด์ ํธ๋ ์ด๋์คํ๊ฐ ์กด์ฌํ๋ค.
- GT ์์ฑ ํ์ดํ๋ผ์ธ์ด ๋ฉํฐํ๋ ์ LiDAR ๋ฐ์ดํฐ์ ์์กดํ๋ฏ๋ก LiDAR๊ฐ ์๋ ์์ ์นด๋ฉ๋ผ ๋ฐ์ดํฐ์ ์๋ ๊ทธ๋๋ก ์ ์ฉํ๊ธฐ ์ด๋ ต๋ค.
์ฐธ๊ณ ์๋ฃ#
๊ด๋ จ ๋ ผ๋ฌธ: MonoScene, TPVFormer, Occ3D, BEVFormer, GaussianWorld