Point Cloud Processing
Instead of converting 3D scans into bulky grids, point cloud processing works directly on unstructured sets of 3D coordinates.
Why Does This Exist?
When LiDAR sensors or depth cameras capture the world in 3D, they output a point cloud: a raw, unordered set of coordinates. Historically, computer vision models designed for 2D images couldn't handle this unordered data. The workaround was to convert these points into 3D voxel grids or render them into multiple 2D views.
However, voxel grids are mostly empty space, making them incredibly inefficient for memory and computation. We needed a way to learn representations directly from the raw, unstructured point sets without enforcing a bulky grid over them.
Think of It Like This
A Bag of Marbles
Imagine a bag of differently colored and sized marbles. You want to understand what's in the bag.
The voxel approach is like building a massive, perfectly spaced ice cube tray, dropping each marble into its nearest slot, and mostly storing empty slots. It takes up a lot of space in your freezer.
The point cloud processing approach is like simply reaching into the bag, picking up each marble, observing its properties independently, and then tallying everything up at the end. You don't care what order you pulled the marbles out in—the final summary of "what's in the bag" remains exactly the same.
How It Actually Works
Processing a point cloud effectively requires handling its two most important mathematical properties: permutation invariance (the order of points doesn't matter) and transformation invariance (rotating or translating the points shouldn't change the object's identity).
Here is how modern architectures like PointNet solve this:
1. Independent Point Feature Extraction
Instead of convolving across neighboring points right away, the network applies a Shared Multi-Layer Perceptron (MLP) to every single point independently. If you have points, each with coordinates , the MLP transforms each point into a higher-dimensional feature vector, say of size .
2. Symmetric Pooling
Because a point cloud is just a set, the network must output the same result no matter how the points are ordered in the array. To achieve this permutation invariance, the network applies a symmetric function across all points. The most common choice is Max Pooling. By taking the maximum value across all points for each of the feature dimensions, the network collapses the matrix into a single global feature vector.
3. Global and Local Feature Fusion
For tasks like classification (e.g., "is this a chair?"), the global feature vector is passed to another MLP to get the final prediction. For tasks like segmentation (e.g., "which points belong to the chair's legs?"), the global feature vector is concatenated back onto the individual point features, allowing the network to make per-point decisions with global context.
Code
Here is a simplified PyTorch snippet demonstrating how to achieve permutation invariance on a set of points.
import torchimport torch.nn as nn
class MiniPointNet(nn.Module): def __init__(self): super().__init__() # Shared MLP applied to each point independently (3D -> 64D) self.shared_mlp = nn.Sequential( nn.Linear(3, 64), nn.ReLU(), nn.Linear(64, 1024), nn.ReLU() ) def forward(self, x): # x shape: (batch_size, num_points, 3) # 1. Independent Point Features point_features = self.shared_mlp(x) # (batch, num_points, 1024) # 2. Symmetric Pooling (Max Pooling over the points dimension) # This makes the output invariant to point order global_feature = torch.max(point_features, dim=1)[0] # (batch, 1024) return global_feature
# -> MiniPointNet()(torch.randn(1, 1000, 3)).shape == (1, 1024)Watch Out For
Density Variations
Real-world LiDAR point clouds are incredibly dense near the sensor and extremely sparse further away. Basic point cloud architectures can struggle with this varying density, as they might treat 100 points on a nearby leaf with the same importance as 10 points making up a distant car.
The Quick Version
- Point clouds are raw sets of coordinates, typically from LiDAR or depth sensors.
- Voxelization is too memory-intensive because most of 3D space is empty.
- To process points directly, networks must be permutation invariant (order doesn't matter).
- Shared MLPs extract features per point independently.
- Max Pooling aggregates all point features into one global representation, ensuring order independence.