๐ก ํ ์ค ์์ฝ#
LiDAR 3D ํฌ์ธํธ ํด๋ผ์ฐ๋๋ฅผ z์ถ ๊ตฌ๋ถ ์๋ ์์ง ๊ธฐ๋ฅ(Pillar)์ผ๋ก ์กฐ์งํํ๊ณ , Simplified PointNet ์ธ์ฝ๋ฉ ํ 2D Pseudo-Image๋ก Scatter ์ฌ์ํ์ฌ ๋ฌด๊ฑฐ์ด 3D ํฉ์ฑ๊ณฑ(Convolution) ์์ด 2D CNN๋ง์ผ๋ก ์ด๊ณ ์(62Hz) SOTA 3D ๊ฐ์ฒด ํ์ง๋ฅผ ์คํํ๋ค.
๐ ๊ฐ์ ๋ฐ ํต์ฌ ๊ธฐ์ฌ (Key Contributions)#
- ์ ์: Alex H. Lang, Sourabh Vora, Holger Caesar, Lubing Zhou, Jiong Yang, Oscar Beijbom (nuTonomy / APTIV)
- ๋ฐํ๋ ๋: 2019 (arXiv:1812.05784, CVPR 2019)
- ์ฃผ์ ๊ธฐ์ฌ์ :
- 3D Convolution ์์ ์ ๊ฑฐ: ๋ฌด๊ฑฐ์ด 3D ๋ณต์ ๋์ 2D Pillar ์์ง ๊ธฐ๋ฅ ์ธ์ฝ๋๋ฅผ ์ ์ํ์ฌ ๊ธฐ์กด VoxelNet/SECOND ๋๋น ์ธ์ฝ๋ฉ ์ง์ฐ์๊ฐ์ 146๋ฐฐ ๊ฐ์ (1.3ms).
- 9์ฐจ์ ํฌ์ธํธ ์ฅ์ (Point Decoration): ๋จ์ 3D ์ขํ ์ธ์ Pillar ๋ด๋ถ ์ฐ์ ํ๊ท ์ขํ ์ค์ฐจ $(x_c, y_c, z_c)$ ๋ฐ Pillar ์ค์ฌ ์คํ์ $(x_p, y_p)$์ ๊ธฐํํ์ ์๋ฒ ๋ฉ์ผ๋ก ์ถ๊ฐ.
- 2D Pseudo-Image Scatter ์์: PointNet์ผ๋ก ์์ถ๋ $(C, P)$ Pillar ํน์ง ๋ฒกํฐ๋ฅผ ์๋ 2D BEV ๊ทธ๋ฆฌ๋ ์์ $(C, H, W)$ ์ด๋ฏธ์ง ํ ์๋ก ์ฆ์ ๋งคํํ์ฌ 2D CNN ๋ฐฑ๋ณธ ์ฐ๊ฒฐ.
๐ฏ ๊ด๋ จ ์ฐ๊ตฌ ํ๋ฆ ๋ฐ ๊ธฐ์กด ํ๊ณ (Related Work & Motivation)#
๊ด๋ จ ์ฐ๊ตฌ ํ๋ฆ#
- Hand-crafted BEV Feature (PIXOR, Complex-YOLO): ์์์ ํผ์ฒ๋ก 2D CNN์ ๊ตฌ๋ํ๋ ์์ง ๊ธฐํ์ ๋ณด ์์ค ๋ฐ์.
- Voxel-based 3D Conv (VoxelNet, SECOND): 3D ๋ณต์ ํํ์ผ๋ก ์ธ๋ฐํ ๊ธฐํ๋ฅผ ์ก์ผ๋ 3D Conv ์ฐ์ฐ์ผ๋ก ์ถ๋ก ์๋๊ฐ 4.4Hz~20Hz์ ๊ทธ์นจ.
- PointPillars: ์๋์ ์ ํ๋์ ์ต์ ํธ๋ ์ด๋์คํ(62Hz ์ค์๊ฐ ์ฒ๋ฆฌ)๋ฅผ ์ ๋ฆฝํ LiDAR 3D Perception์ ๊ฑฐ๋.
๐ ๋ชฉ์ฐจ#
- Chapter 1: 9D Point Feature Decoration (ํฌ์ธํธ ์ฅ์ ์์)
- Chapter 2: Simplified PointNet ๋ฐ Pseudo-Image Scatter Pooling
- Chapter 3: 3D Bounding Box Target Regression & Sine Heading
- Chapter 4: Multi-Task ์์ค ํจ์ (Focal Loss + Direction Loss)
- Chapter 5: ์ฃผ์ ์คํ ๋ฐ ๊ฒฐ๊ณผ
- Chapter 6: ๊ฒฐ๋ก ๋ฐ ์์ฌ์
๐ ๏ธ Chapter 1: 9D Point Feature Decoration#
1. ์์ฝ#
๊ฐ LiDAR ํฌ์ธํธ $l_i$์ ๋ํด 3D ์ขํ $(x, y, z)$, ๋ฐ์ฌ์จ $r$, Pillar ๋ด ํ๊ท ๊ณผ์ ์ฐจ์ด $(x_c, y_c, z_c)$, Pillar Center ์คํ์ $(x_p, y_p)$์ 9์ฐจ์ ๋ฒกํฐ๋ก ํ๋ถํ๊ฒ ์ฅ์(Decorate)ํฉ๋๋ค.
2. ์์ ๋ฐ ํ์ด์ฌ ์ฝ๋ ์ค๋ช #
$$l_i = [x, \ y, \ z, \ r, \ x_c, \ y_c, \ z_c, \ x_p, \ y_p]^T \in \mathbb{R}^9$$$$x_c = x - \bar{x}, \quad y_c = y - \bar{y}, \quad z_c = z - \bar{z}$$$$x_p = x - x_{\text{pillar}}, \quad y_p = y - y_{\text{pillar}}$$import torch
def decorate_point_cloud_into_pillars(
points_3d: torch.Tensor, # (N, 4) -> x, y, z, reflectance
pillar_size: float = 0.16,
max_points_per_pillar: int = 100,
max_pillars: int = 12000
) -> torch.Tensor:
"""
PointPillars: 3D ํฌ์ธํธ๋ฅผ 9์ฐจ์ ํผ์ฒ ํ
์ (D=9, P, N)๋ก ์ฅ์
"""
N_pts, _ = points_3d.shape
# 1. Pillar ์ขํ ์ธ๋ฑ์ค ๊ณ์ฐ (x_pillar, y_pillar)
pillar_x = torch.floor(points_3d[:, 0] / pillar_size).long()
pillar_y = torch.floor(points_3d[:, 1] / pillar_size).long()
# 2. Pillar ์ค์ฌ ์ค์ธก ์ขํ
x_p = points_3d[:, 0] - (pillar_x.float() * pillar_size + pillar_size / 2.0)
y_p = points_3d[:, 1] - (pillar_y.float() * pillar_size + pillar_size / 2.0)
# 3. Pillar ๋ด ์ฐ์ ํ๊ท ์ค์ฌ ์ค์ฐจ (x_c, y_c, z_c)
mean_x = points_3d[:, 0].mean()
mean_y = points_3d[:, 1].mean()
mean_z = points_3d[:, 2].mean()
x_c = points_3d[:, 0] - mean_x
y_c = points_3d[:, 1] - mean_y
z_c = points_3d[:, 2] - mean_z
# 4. 9์ฐจ์ ์ฅ์ ๋ฒกํฐ ๊ฒฐํฉ
decorated_pts = torch.stack([
points_3d[:, 0], points_3d[:, 1], points_3d[:, 2], points_3d[:, 3],
x_c, y_c, z_c, x_p, y_p
], dim=-1) # (N, 9)
return decorated_pts
# --- ์ฌ์ฉ ์์ ---
pts_raw = torch.randn(1000, 4)
dec_pts = decorate_point_cloud_into_pillars(pts_raw)
print("์ฅ์๋ ํฌ์ธํธ 9์ฐจ์ ํผ์ฒ Shape:", dec_pts.shape)๐ ๏ธ Chapter 2: Simplified PointNet ๋ฐ Pseudo-Image Scatter Pooling#
1. ์์ฝ#
$(D=9, P, N)$ ํ ์๋ฅผ 1D Conv/Linear $\to$ BN $\to$ ReLU $\to$ MaxPool์ ์ ์ฉํด $(C, P)$ ๋ก ์์ถํ ํ, ์๋ BEV ๊ทธ๋ฆฌ๋ ํฝ์ ์์น๋ก Scatter ์ฌ์ํ์ฌ $(C, H, W)$ 2D Pseudo-Image๋ฅผ ์์ฑํฉ๋๋ค.
2. ์์ ๋ฐ ํ์ด์ฌ ์ฝ๋ ์ค๋ช #
$$f_{\text{pillar}} = \text{MaxPool}_{N}\Big( \text{ReLU}\left( \text{BN}( \mathbf{W} \cdot l ) \right) \Big) \in \mathbb{R}^{C \times P}$$$$F_{\text{pseudo-image}} = \text{Scatter}\Big( f_{\text{pillar}}, \ (x_{\text{pillar}}, y_{\text{pillar}}) \Big) \in \mathbb{R}^{C \times H \times W}$$import torch
import torch.nn as nn
class PointPillarEncoder(nn.Module):
"""
Simplified PointNet ์ธ์ฝ๋ ๋ฐ 2D Pseudo-Image Scatter ๋ชจ๋
"""
def __init__(self, in_dim: int = 9, out_channels: int = 64):
super().__init__()
self.linear = nn.Linear(in_dim, out_channels)
self.bn = nn.BatchNorm1d(out_channels)
def forward(self, pillar_tensor: torch.Tensor, pillar_coords: torch.Tensor, grid_shape: tuple) -> torch.Tensor:
"""
pillar_tensor: (P, N, D=9)
pillar_coords: (P, 2) -> (x_idx, y_idx)
"""
P, N, D = pillar_tensor.shape
H, W = grid_shape
# 1. Simplified PointNet
x = self.linear(pillar_tensor.view(-1, D))
x = self.bn(x).view(P, N, -1)
x = torch.relu(x)
# MaxPool over N points in each pillar -> (P, C)
feat_p, _ = torch.max(x, dim=1)
# 2. Scatter to 2D Pseudo-Image (C, H, W)
C = feat_p.shape[-1]
pseudo_img = torch.zeros((C, H, W), device=pillar_tensor.device)
x_idx = pillar_coords[:, 0]
y_idx = pillar_coords[:, 1]
pseudo_img[:, y_idx, x_idx] = feat_p.T
return pseudo_img.unsqueeze(0) # (1, C, H, W)
# --- ์ฌ์ฉ ์์ ---
p_tensor = torch.randn(500, 32, 9)
p_coords = torch.randint(0, 100, (500, 2))
encoder = PointPillarEncoder()
print("์์ฑ๋ 2D Pseudo-Image Shape:", encoder(p_tensor, p_coords, (100, 100)).shape)๐ ๏ธ Chapter 3: 3D Anchor Target Regression & Multi-Task Loss#
1. ์์ฝ#
3D ์์น ์ค์ฐจ $(\Delta x, \Delta y, \Delta z)$, 3D ํฌ๊ธฐ ๋ก๊ทธ ์ค์ฐจ $(\Delta w, \Delta l, \Delta h)$, ๊ฐ๋ $\Delta\theta = \sin(\theta^{gt} - \theta^a)$๋ฅผ Focal Loss ๋ฐ Smooth L1 Loss๋ก ๊ณต๋ ์ต์ ํํฉ๋๋ค.
2. ์์ ๋ฐ ํ์ด์ฌ ์ฝ๋ ์ค๋ช #
$$\Delta x = \frac{x^{gt} - x^a}{d^a}, \quad \Delta y = \frac{y^{gt} - y^a}{d^a}, \quad d^a = \sqrt{(w^a)^2 + (l^a)^2}$$$$\Delta w = \log \frac{w^{gt}}{w^a}, \quad \Delta l = \log \frac{l^{gt}}{l^a}, \quad \Delta h = \log \frac{h^{gt}}{h^a}, \quad \Delta\theta = \sin(\theta^{gt} - \theta^a)$$$$\mathcal{L} = \frac{1}{N_{pos}} \left( \beta_{loc} \mathcal{L}_{loc} + \beta_{cls} \mathcal{L}_{cls} + \beta_{dir} \mathcal{L}_{dir} \right)$$import torch
import torch.nn.functional as F
def compute_pointpillars_loss(
cls_preds: torch.Tensor, # (N_anchors, Num_classes)
box_preds: torch.Tensor, # (N_anchors, 7)
dir_preds: torch.Tensor, # (N_anchors, 2)
cls_targets: torch.Tensor,
box_targets: torch.Tensor,
dir_targets: torch.Tensor
) -> torch.Tensor:
"""
PointPillars Multi-Task Loss (Focal + SmoothL1 + Direction CrossEntropy)
"""
pos_mask = (cls_targets > 0)
N_pos = pos_mask.sum().float().clamp(min=1.0)
# 1. Focal Loss (Classification)
p = torch.sigmoid(cls_preds)
focal_weights = 0.25 * torch.pow(1.0 - p, 2.0)
loss_cls = F.binary_cross_entropy_with_logits(cls_preds, cls_targets.float(), reduction='none') * focal_weights
loss_cls = loss_cls.sum() / N_pos
# 2. Smooth L1 Loss (Box Regression)
loss_box = F.smooth_l1_loss(box_preds[pos_mask], box_targets[pos_mask], reduction='sum') / N_pos
# 3. Direction Loss (Softmax CE)
loss_dir = F.cross_entropy(dir_preds[pos_mask], dir_targets[pos_mask], reduction='sum') / N_pos
return 1.0 * loss_cls + 2.0 * loss_box + 0.2 * loss_dir
# --- ์ฌ์ฉ ์์ ---
c_p, b_p, d_p = torch.randn(100, 1), torch.randn(100, 7), torch.randn(100, 2)
c_t, b_t, d_t = torch.randint(0, 2, (100, 1)), torch.randn(100, 7), torch.randint(0, 2, (100,))
print("PointPillars ์ด ์์ค:", compute_pointpillars_loss(c_p, b_p, d_p, c_t, b_t, d_t).item())๐ ์ฃผ์ ์คํ ๋ฐ ๊ฒฐ๊ณผ (Experiments & Results)#
1. KITTI 3D / BEV ๊ฐ์ฒด ํ์ง ๋ฆฌ๋๋ณด๋ ๋น๊ต#
| ์๊ณ ๋ฆฌ์ฆ (Method) | ์ ๋ ฅ ๋ชจ๋ฌ๋ฆฌํฐ | ์ฒ๋ฆฌ ์๋ (Hz) โ | Car BEV mAP โ | Car 3D mAP โ |
|---|---|---|---|---|
| VoxelNet | LiDAR | 4.4 Hz (๋๋ฆผ) | 79.26 | 65.11 |
| SECOND | LiDAR | 20.0 Hz | 79.37 | 76.48 |
| PointPillars (Ours) | LiDAR | 62.0 Hz (์ค์๊ฐ SOTA) | 86.10 (+6.73%) | 74.99 |
| PointPillars + TensorRT | LiDAR | 105.0 Hz (์ด๊ณ ์) | 86.10 | 74.99 |
- ๊ฒฐ๊ณผ: 3D Conv๋ฅผ ํํผํ Pillar ์ธ์ฝ๋ ๋๋ถ์ ์ธ์ฝ๋ฉ ์๊ฐ์ 1.3ms๋ก 146๋ฐฐ ๊ฐ์ํ๊ณ 62Hz ์ค์๊ฐ ์ฒ๋ฆฌ ๋ฌ์ฑ.
๐ก ๊ฒฐ๋ก ๋ฐ ์์ฌ์ (Conclusion & Insights)#
1. ๊ฒฐ๋ก #
PointPillars๋ 3D ํฌ์ธํธ ํด๋ผ์ฐ๋๋ฅผ 2D Pseudo-Image ์ฌ์๊ณ๋ก ์ ํํ์ฌ ๋ฌด๊ฑฐ์ด 3D Conv ์์ด 2D CNN๋ง์ผ๋ก ์ด๊ณ ์(62Hz) SOTA 3D ๊ฐ์ฒด ํ์ง๋ฅผ ๊ตฌํํ ์์จ์ฃผํ 3D Perception์ ๊ธฐ์ด ํ๋ ๋ ผ๋ฌธ์ ๋๋ค.
2. ํ๊ณ์ ๋ฐ ์์ฌ์ด ์ #
- Pillar ๋จ์ ์ฒ๋ฆฌ๋ก z์ถ ์ ๋ณด(๋์ด)๊ฐ MaxPool๋ก ์ง์ฝ๋์ด ์ธ๋ฐํ ์์ง ๊ตฌ์กฐ ํํ์ด ๋ถ๊ฐ๋ฅํ๋ค.
- ๋ณดํ์ยท์์ ๊ฑฐ ํ์ง ์ฑ๋ฅ์ด ์ฐจ๋๋ณด๋ค ๋ฎ๋ค(์์ ๊ฐ์ฒด, ํฌ์ ํฌ์ธํธ).
- ์นด๋ฉ๋ผ์์ ์ตํฉ์ ๊ณ ๋ คํ์ง ์์ LiDAR ์ ์ฉ ์ค๊ณ๋ก, ์นด๋ฉ๋ผ๋ง์ด ์ ๊ณตํ๋ ์ยท์ง๊ฐ ์ ๋ณด๋ฅผ ํ์ฉํ์ง ๋ชปํ๋ค.
์ฐธ๊ณ ์๋ฃ#
๊ด๋ จ ๋ ผ๋ฌธ: PointNet, CenterPoint, BEVFusion, nuScenes