Original Paper
PointNet++: Deep Hierarchical Feature Learning on Point Sets in a Metric Space
Qi et al. (2017). NeurIPS 2017
Read paper →What PointNetConv does
PointNetConv performs local point cloud convolution:
- For each point i, find its k nearest neighbors (pre-computed as edge_index)
- For each neighbor j, concatenate features with relative position: [h_j, pos_j - pos_i]
- Apply a shared MLP to each concatenated vector
- Max-pool over the neighborhood to get the updated point representation
PyG implementation
import torch
import torch.nn.functional as F
from torch_geometric.nn import PointNetConv, global_max_pool, fps, radius
from torch_geometric.nn import knn_graph
class PointNet(torch.nn.Module):
def __init__(self, out_channels):
super().__init__()
local_nn1 = torch.nn.Sequential(
torch.nn.Linear(3 + 3, 64), # 3 features + 3 relative position
torch.nn.ReLU(),
torch.nn.Linear(64, 64),
)
local_nn2 = torch.nn.Sequential(
torch.nn.Linear(64 + 3, 128),
torch.nn.ReLU(),
torch.nn.Linear(128, 128),
)
self.conv1 = PointNetConv(local_nn=local_nn1)
self.conv2 = PointNetConv(local_nn=local_nn2)
self.classifier = torch.nn.Linear(128, out_channels)
def forward(self, pos, batch):
edge_index = knn_graph(pos, k=16, batch=batch)
x = self.conv1(x=None, pos=pos, edge_index=edge_index)
x = F.relu(x)
edge_index = knn_graph(x, k=16, batch=batch)
x = self.conv2(x=x, pos=pos, edge_index=edge_index)
x = global_max_pool(x, batch)
return self.classifier(x)
model = PointNet(out_channels=40) # ModelNet40x=None at layer 1 means only positions are used. After layer 1, both learned features and positions inform the neighborhood and messages.
When to use PointNetConv
- Point cloud baseline. Fast, well-understood, and a standard comparison point for 3D deep learning.
- Simple 3D classification. When global shape is more important than local detail (object recognition).
- LiDAR data processing. Outdoor scene understanding where per-point MLPs with spatial context capture the necessary patterns.
When not to use PointNetConv
- When local structure matters. EdgeConv captures richer local patterns via pairwise edge features. For segmentation tasks with fine boundaries, EdgeConv is usually better.
- Non-geometric graphs. PointNetConv requires positional coordinates. For social/relational/citation graphs, use standard GNN layers.