๐ก ํ ์ค ์์ฝ#
VectorMapNet์ ๋งต ์์๋ฅผ ๋์คํฐ ํฝ์ ์ธ๊ทธ๋ฉํ ์ด์ ๋์ ํฌ์ ํด๋ฆฌ๋ผ์ธ(Polyline) ์งํฉ์ผ๋ก ์ ์ํ๊ณ , DETR ํ์ง๊ธฐ(Element Detector)์ ์๊ธฐํ๊ท ์ ์ ์ํ์ค ์์ฑ๊ธฐ(Autoregressive Polyline Generator)์ 2๋จ๊ณ ๊ตฌ์กฐ๋ก ์ผ์ ์ ๋ณด๋ก๋ถํฐ ์ง์ ๋ฒกํฐํ๋ HD ๋งต์ End-to-End ์์ธกํ์ฌ nuScenes ๋์คํฐ SOTA ๋๋น +22.7 mAP๋ฅผ ๋ฌ์ฑํ๋ค.
๐ ๊ฐ์ ๋ฐ ํต์ฌ ๊ธฐ์ฌ (Key Contributions)#
- ์ ์: Yicheng Liu, Tianyuan Yuan, Yue Wang, Yilun Wang, Hang Zhao (Shanghai Qi Zhi Inst., Tsinghua Univ., MIT, Li Auto)
- ๋ฐํ๋ ๋: 2022 (arXiv:2206.08920, ICML 2023)
- ์ฃผ์ ๊ธฐ์ฌ์ :
- ์ต์ด์ ํ์ต ๊ธฐ๋ฐ 3D ๋ฒกํฐ HD ๋งต ๋คํธ์ํฌ: ๋ณ๋์ ํด๋ฆฌ์คํฑ ํ์ฒ๋ฆฌ ์ฐ์ฐ ์์ด ์ผ์ ์ ๋ ฅ(์นด๋ฉ๋ผ/LiDAR)์์ ์ธ์คํด์ค ์ ์ ์ํ์ค๋ฅผ ์ง์ ์ถ๋ ฅํ๋ ํ์ดํ๋ผ์ธ.
- 2๋จ๊ณ ํ์ง-์์ฑ ์ํคํ ์ฒ (Map Detector + Polyline Generator): Element Detector๊ฐ ๋งต ์์์ ์์น(ํคํฌ์ธํธ $\mathcal{A}_i$)์ ํด๋์ค๋ฅผ ํ์งํ๊ณ , Polyline Generator๊ฐ ์ด๋ฅผ ์กฐ๊ฑด์ผ๋ก ์ ์ขํ ํ ํฐ ์ํ์ค๋ฅผ ์๊ธฐํ๊ท ์์ฑ.
- ์ด์ฐ ๋ฒ์ฃผํ ๋ถํฌ(Categorical Distribution) ์ ์ ์ธ์ฝ๋ฉ: ์ ์ขํ๋ฅผ ์์ํ ํ ํฐ์ผ๋ก ๋ณํํด ๋น๋์นญ ๋ค์ค ๋ชจ๋(Multimodal) ๋๋ก ๊ฒฝ๊ณ ๋ถํฌ ๋ชจ๋ธ๋ง.
- ๋ค์ด์คํธ๋ฆผ ํ๋๋ ํธํ์ฑ: ์์ธก๋ ๋ฒกํฐ ํด๋ฆฌ๋ผ์ธ์ ๋ชจ์ ์์ธก ๋ชจ๋ธ์ ์ง์ ํฌ์ ํ์ฌ minADE ์ค์ฐจ -0.083m ๊ฐ์ถ ๊ฒ์ฆ.
๐ฏ ๊ด๋ จ ์ฐ๊ตฌ ํ๋ฆ ๋ฐ ๊ธฐ์กด ํ๊ณ (Related Work & Motivation)#
๊ด๋ จ ์ฐ๊ตฌ ํ๋ฆ#
- Rasterized HD Map (HDMapNet): 2D BEV ์ธ๊ทธ๋ฉํ ์ด์ ์ด๋ฏธ์ง๋ฅผ ์ป์ ํ ๋ค๋จ๊ณ ํด๋ฆฌ์คํฑ ์์ฝ/์ ํ์ฒ๋ฆฌ๋ก ๋ฒกํฐํํ๋ฏ๋ก ์ง์ฐ์๊ฐ์ด ๊ธธ๊ณ ์ธ์คํด์ค ์ผ๊ด์ฑ ํ๊ดด.
- VectorMapNet: ์ต์ด๋ก ๋งต ๊ตฌ์ฑ์ ํฌ์ ํด๋ฆฌ๋ผ์ธ ์งํฉ ์์ธก ๋ฌธ์ ๋ก ์ ์ํ(Formalization)ํ์ฌ ๋ฅ๋ฌ๋ ๊ธฐ๋ฐ ์ค์๊ฐ ๋ฒกํฐ ๋งคํ ๋ฐ์ ์ด์ ์ ์.
๐ ๋ชฉ์ฐจ#
- Chapter 1: ๋ฉํฐ๋ชจ๋ฌ ์นด๋ฉ๋ผ-LiDAR BEV ํน์ง ์ตํฉ
- Chapter 2: Map Element Detector (DETR ์ฟผ๋ฆฌ & ํคํฌ์ธํธ ํ๊ท)
- Chapter 3: Autoregressive Polyline Generator (์๊ธฐํ๊ท ์ ์ ์ํ์ค ์์ฑ)
- Chapter 4: ๋ค์ค ํ์คํฌ ํ์ต ์์ค ํจ์ (Bipartite Loss + NLL Loss)
- Chapter 5: ์ฃผ์ ์คํ ๋ฐ ๊ฒฐ๊ณผ
- Chapter 6: ๊ฒฐ๋ก ๋ฐ ์์ฌ์
๐ ๏ธ Chapter 1: ๋ฉํฐ๋ชจ๋ฌ ์นด๋ฉ๋ผ-LiDAR BEV ํน์ง ์ตํฉ#
1. ์์ฝ#
์นด๋ฉ๋ผ IPM ํน์ง $\mathcal{F}_{\text{BEV}}^{\mathcal{I}}$์ LiDAR PointPillars ํน์ง $\mathcal{F}_{\text{BEV}}^{\mathcal{P}}$๋ฅผ ์ฑ๋ ์ถ์ผ๋ก ๊ฒฐํฉํ ํ, 2D Conv ๋ ์ด์ด๋ฅผ ํต๊ณผ์์ผ ๊ณต์ BEV ํผ์ฒ ๋งต $\mathcal{F}_{\text{BEV}}$๋ฅผ ๊ตฌ์ฑํฉ๋๋ค.
2. ์์ ๋ฐ ํ์ด์ฌ ์ฝ๋ ์ค๋ช #
$$\mathcal{F}_{\text{BEV}} = \text{Conv2D}\left( \Big[ \mathcal{F}_{\text{BEV}}^{\mathcal{I}} \;;\; \mathcal{F}_{\text{BEV}}^{\mathcal{P}} \Big] \right) \in \mathbb{R}^{H \times W \times (C_1 + C_2)}$$import torch
import torch.nn as nn
class MultiSensorBEVFeatureFusion(nn.Module):
"""
VectorMapNet: ์นด๋ฉ๋ผ IPM BEV ํผ์ฒ์ LiDAR PointPillars ํผ์ฒ ์ฑ๋ ๊ฒฐํฉ
"""
def __init__(self, cam_channels: int = 64, lidar_channels: int = 64, out_channels: int = 256):
super().__init__()
self.fusion_conv = nn.Sequential(
nn.Conv2d(cam_channels + lidar_channels, out_channels, kernel_size=3, padding=1),
nn.BatchNorm2d(out_channels),
nn.ReLU()
)
def forward(self, cam_bev: torch.Tensor, lidar_bev: torch.Tensor) -> torch.Tensor:
"""
cam_bev: (B, C1, H, W)
lidar_bev: (B, C2, H, W)
"""
fused_in = torch.cat([cam_bev, lidar_bev], dim=1)
fused_bev = self.fusion_conv(fused_in)
return fused_bev
# --- ์ฌ์ฉ ์์ ---
c_b = torch.randn(1, 64, 100, 100)
l_b = torch.randn(1, 64, 100, 100)
fusion = MultiSensorBEVFeatureFusion()
print("์ตํฉ๋ ๊ณต์ BEV Feature Map Shape:", fusion(c_b, l_b).shape)๐ ๏ธ Chapter 2: Map Element Detector (DETR ์ฟผ๋ฆฌ & ํคํฌ์ธํธ ํ๊ท)#
1. ์์ฝ#
Element Query $q_{i,j}^{\text{kp}}$๋ฅผ Deformable DETR ๋์ฝ๋์ ํต๊ณผ์์ผ ๊ฐ ๋งต ์์ $i$์ ํคํฌ์ธํธ ์ขํ $\mathcal{A}_i = \{a_{i,j}\}_{j=1}^k$์ ํด๋์ค ํ๋ฅ $l_i$๋ฅผ ํ์งํฉ๋๋ค.
2. ์์ ๋ฐ ํ์ด์ฌ ์ฝ๋ ์ค๋ช #
$$a_{i,j} = \text{MLP}_{kp}(q_{i,j}^{\text{kp}}) \in \mathbb{R}^2, \quad l_i = \text{MLP}_{cls}\left( [q_{i,1}^{\text{kp}}, \ldots, q_{i,k}^{\text{kp}}] \right)$$import torch
import torch.nn as nn
class MapElementDetectorHead(nn.Module):
"""
VectorMapNet Element Detector: ํคํฌ์ธํธ ์์น(A_i) ๋ฐ ํด๋์ค(l_i) ํ๊ท
"""
def __init__(self, embed_dim: int = 256, num_keypoints: int = 2, num_classes: int = 4):
super().__init__()
self.num_keypoints = num_keypoints
self.kp_head = nn.Linear(embed_dim, 2)
self.cls_head = nn.Linear(embed_dim * num_keypoints, num_classes)
def forward(self, query_kp: torch.Tensor) -> tuple:
"""
query_kp: (B, N_elements, k_keypoints, C)
"""
B, N_elem, k, C = query_kp.shape
# 1. ํคํฌ์ธํธ ์์น (B, N_elem, k, 2)
kp_coords = torch.sigmoid(self.kp_head(query_kp))
# 2. ์ธ์คํด์ค ํด๋์ค ๋ถ๋ฅ
concat_query = query_kp.view(B, N_elem, k * C)
cls_logits = self.cls_head(concat_query)
return kp_coords, cls_logits
# --- ์ฌ์ฉ ์์ ---
q_kp = torch.randn(1, 50, 2, 256) # 50๊ฐ ์์, 2๊ฐ Bounding Box ํคํฌ์ธํธ
det_head = MapElementDetectorHead()
kp_res, cls_res = det_head(q_kp)
print("์์ธก ํคํฌ์ธํธ ์ขํ Shape:", kp_res.shape, "ํด๋์ค Logits Shape:", cls_res.shape)๐ ๏ธ Chapter 3: Autoregressive Polyline Generator#
1. ์์ฝ#
ํคํฌ์ธํธ ์ขํ $\mathcal{A}_i$์ ํด๋์ค $l_i$๋ฅผ ์กฐ๊ฑด์ผ๋ก, ์ ์ ์ขํ ํ ํฐ $v_{i,n}^f$๋ฅผ ์ด์ฐ ํ๋ฅ ๋ถํฌ $\hat{p}$๋ก๋ถํฐ ์๊ธฐํ๊ท(Autoregressive) ์์ฑํฉ๋๋ค.
2. ์์ ๋ฐ ํ์ด์ฌ ์ฝ๋ ์ค๋ช #
$$p(\mathcal{V}_i^{\text{poly}} \mid \mathcal{A}_i, l_i, \mathcal{F}_{\text{BEV}}) = \prod_{n=1}^{2N_v} p(v_{i,n}^f \mid v_{i,import torch
import torch.nn as nn
import torch.nn.functional as F
class AutoregressivePolylineGenerator(nn.Module):
"""
VectorMapNet Polyline Generator: ์์ํ ํ ํฐ ์๊ธฐํ๊ท ๋์ฝ๋
"""
def __init__(self, vocab_size: int = 1000, embed_dim: int = 256):
super().__init__()
self.vocab_size = vocab_size
self.val_embed = nn.Embedding(vocab_size, embed_dim)
self.pos_embed = nn.Embedding(100, embed_dim)
self.decoder_layer = nn.TransformerDecoderLayer(d_model=embed_dim, nhead=8)
self.out_head = nn.Linear(embed_dim, vocab_size)
def forward(self, input_tokens: torch.Tensor, cond_feat: torch.Tensor) -> torch.Tensor:
"""
input_tokens: (B, N_seq) ์ด์ ์ขํ ์์ํ ํ ํฐ
cond_feat: (B, 1, C) Detector์ ์กฐ๊ฑด ์๋ฒ ๋ฉ
"""
B, N_seq = input_tokens.shape
pos = torch.arange(N_seq, device=input_tokens.device).unsqueeze(0)
# Coordinate + Position Embedding
x = self.val_embed(input_tokens) + self.pos_embed(pos)
x = x.permute(1, 0, 2) # (N_seq, B, C)
memory = cond_feat.permute(1, 0, 2)
out = self.decoder_layer(x, memory)
logits = self.out_head(out.permute(1, 0, 2)) # (B, N_seq, vocab_size)
return logits
# --- ์ฌ์ฉ ์์ ---
tokens = torch.randint(0, 1000, (1, 20))
cond_f = torch.randn(1, 1, 256)
poly_gen = AutoregressivePolylineGenerator()
print("์๊ธฐํ๊ท ์์ฑ Logits Shape:", poly_gen(tokens, cond_f).shape)