LiDAR Writeup
PointNet: Deep Learning on Point Sets for 3D Classification and Segmentation
Contents
This writeup is a companion to the paper PointNet: Deep Learning on Point Sets for 3D Classification and Segmentation by Charles R. Qi, Hao Su, Kaichun Mo and Leonidas J. Guibas [Qi17], presented at CVPR in 2017. The paper introduced the first deep network to consume raw point clouds directly, without first converting them to voxels or to rendered images, and it did so with an architecture so simple that it fits in one equation: apply the same small network to every point, then take an elementwise maximum over the points. That design, and the paper’s analysis of why it works, underlies a large part of the deep learning on point clouds that followed, including the pillar and voxel encoders of the LiDAR object detectors in use today.
The paper relies on the following material from the crash course:
- Deep learning on point clouds, which explains why point clouds are awkward for networks, gives a short summary of PointNet of which this writeup is the full account, and describes the encoders built on it;
- Filtering, normals and local features, for the hand-crafted point features, such as FPFH, that PointNet’s learned features replace;
- Clustering and bounding boxes, for the connected-component clustering the paper uses in its detection experiment.
It also assumes familiarity with multilayer perceptrons, batch normalisation, dropout and training by stochastic gradient descent.
The problem
Before PointNet, networks for 3D data imposed a regular structure on it: they voxelised shapes into occupancy grids and applied 3D convolutions, or rendered them from many viewpoints and applied 2D convolutions to the images. The authors object that these conversions make the data “unnecessarily voluminous” and introduce quantisation artefacts that obscure its natural invariances, and they propose instead to consume the points themselves.
The input is a set of points , each a vector of its coordinates , possibly with extra channels such as colour or normal; most of the paper uses the coordinates alone. Two kinds of output are wanted from one architecture: for classification, scores for the candidate classes of the whole input; for segmentation, scores, one for each point and each of semantic categories, which may be the parts of an object or the classes of objects in a scene.
Properties of point sets
The design follows from three properties the authors identify (their Section 4.1).
- Unordered. A point cloud is a set, so a network that consumes points must give the same answer for all orders in which they might be listed.
- Interaction among points. The points lie in a metric space, so neighbouring points form meaningful subsets, and the network should be able to capture local structure and the interactions between local structures.
- Invariance under transformations. Rotating and translating all the points together should not change the category of the object or the segmentation of its points.
A symmetric function for unordered input
The paper considers three ways to make a network invariant to the order of its input. The first is to sort the input into a canonical order. The authors argue that this cannot work in general: an ordering that is stable under small perturbations of the points would be a map from a high-dimensional space to the real line that preserves proximity, which cannot exist, so the network would still see inputs whose order changes abruptly under small changes. The second is to treat the points as a sequence and train a recurrent network on many random permutations, hoping it learns to ignore the order. Earlier work had shown that order matters to such networks, and they scale poorly to the thousands of elements a point cloud holds. The third, adopted by the paper, is to combine the points with a symmetric function, one whose value does not depend on the order of its arguments, as addition and multiplication do not.
Specifically, a function on point sets is approximated by applying a function to each point separately and combining the results with a symmetric function :
where and is symmetric. In PointNet, is a multilayer perceptron and is an elementwise maximum over the points followed by a further function , so that . Each of the coordinates of is a learned function of position, and the maximum keeps, for each, the largest value attained anywhere in the set. A collection of such thus learns a collection of ’s, each capturing a different property of the set.
The perceptron is shared: the same weights are applied to every point, independently. Applied to an array of points, a shared layer is a matrix product of the array with a weight matrix, followed by a bias and a nonlinearity on each row, which is why such layers are usually implemented as convolutions with a kernel of size one over the list of points.
The architecture
Classification network
The classification network is shown in the paper’s Figure 2. Every layer except the last uses batch normalisation and a ReLU.
- The input passes through an input transform: a small network predicts a matrix, which multiplies the points.
- A shared perceptron with layers of and units lifts each point to dimensions.
- A feature transform predicts a matrix, which multiplies the features.
- A shared perceptron with layers of , and units lifts each point to dimensions.
- Max pooling over the points gives the -dimensional global feature.
- A perceptron with layers of , and units maps the global feature to the class scores, with dropout (keeping of units) on the -unit layer.
Joint alignment networks
The two transforms are the paper’s answer to the third property. Rather than hoping the network learns invariance to rigid motions, it learns to undo them: a small network, the T-Net, predicts a transformation matrix from the input and applies it directly to the coordinates. The idea follows the spatial transformer networks of image recognition, which must resample images; for points the transformation is just a matrix product, and no new kind of layer is needed. The T-Net is itself a small PointNet: a shared perceptron of , and units, max pooling, and fully connected layers of and units, regressing the matrix, whose output is initialised to the identity.
The feature transform is a matrix, far harder to optimise than the one, so the training loss adds a regulariser that pushes it towards an orthogonal matrix:
where is the predicted feature transform and the Frobenius norm. An orthogonal transformation loses no information from its input, which is the property wanted, and the authors report that the regulariser makes optimisation more stable and the results better. It is added to the classification loss with weight .
Segmentation network
Segmentation needs both local and global information: whether a point lies on a chair leg depends on its own position and on the shape of the whole chair. The segmentation network obtains both by concatenating the global feature onto the per-point features. The -dimensional features after the feature transform are concatenated, for each point, with the -dimensional global feature, giving ; a shared perceptron of , and units and then one of and units produce the per-point scores. Each point’s prediction then depends on its own feature and on a summary of the whole set. As a check that this gives local awareness, the authors train the segmentation network to regress each point’s surface normal, a property of its neighbourhood, and report reasonable reconstructions.
For part segmentation, the paper modifies this network: it concatenates a one-hot vector of the object’s category to the global feature, widens some layers, and adds skip connections from several intermediate layers to the per-point features.
Training
Training uses Adam with an initial learning rate of , momentum and batches of , halving the learning rate every epochs. The batch-normalisation decay rate starts at and rises gradually to . The segmentation network uses no dropout.
Theoretical analysis
The paper gives two theorems about the decomposition (1) with . They need a notion of distance between point sets.
The Hausdorff distance
The Hausdorff distance between two sets and measures how far either set strays from the other:
It is small exactly when every point of each set is near some point of the other, regardless of how the points correspond or how many there are. Two scans of the same surface, sampled at different points, are close in Hausdorff distance, while a set and the same set with one stray outlier are not. A set function is continuous with respect to it if moving the points slightly, in this sense, changes its value only slightly.
Universal approximation
The first theorem says that the architecture loses nothing in principle: any continuous set function can be approximated.
Let and let be continuous with respect to the Hausdorff distance . For every there exist a continuous function and a symmetric function , where is continuous and takes vectors to their elementwise maximum, such that for every ,
The paper’s supplementary material proves the case , of sets of numbers in ; the idea carries over to higher dimensions. By continuity, choose such that whenever , and let . Divide into equal intervals, and let move each point to the left end of its interval. The set is within of in Hausdorff distance, so .
Now let , a soft indicator that equals on the -th interval and decays away from it, and . The elementwise maximum of over the points of records which intervals contain a point of : the paper treats it as an occupancy vector , and it does not depend on the order of the points. The map that sends an occupancy vector to the set of left ends of the occupied intervals recovers exactly . Choosing a continuous with on occupancy vectors gives , which is within of .
The construction is a voxelisation: in the worst case, the network can learn to convert the points into an occupancy grid and compute the function from that. The authors remark that in practice it learns a much more economical way of probing space, which the second theorem and the visualisations explore.
Critical point sets
The second theorem explains PointNet’s robustness to missing and extra points. Write for the -dimensional pooled feature, so that .
Let be and let . Then
- for every there are sets such that for every with , and
- .
The output is determined by . For each coordinate of , the maximum is attained by at least one point , with . Let be the set of these points, one for each coordinate, so . Any set containing attains at least these maxima, and adding any point with in every coordinate raises none of them, so , and with it , is unchanged. Taking to be the set of all such points gives the result.
The paper calls the critical point set of and the bottleneck dimension. The output is determined by at most points, every other point of the input can be deleted, and any number of points can be added inside the upper-bound shape , without changing the result. Combined with the continuity of , this explains why small perturbations, deletions and insertions change the output little. The authors liken it to the sparsity principle in machine learning: the network summarises a shape by a sparse set of key points.
- input points
- critical points
- upper-bound shape
- +centres of the point functions
Visualising the critical sets of trained networks on ModelNet shapes, the authors find that they trace the skeleton of each object, and they build upper-bound shapes by passing every point of a cube through the network and keeping those whose point-function values nowhere exceed the global feature.
Experiments
Object classification
On ModelNet40, CAD models in categories, split into for training and for testing, the authors sample points uniformly over each mesh’s faces, normalise them into a unit sphere, and augment training data by random rotation about the vertical axis and Gaussian jitter of standard deviation .
| Method | Input | Views | Average class accuracy | Overall accuracy |
|---|---|---|---|---|
| 3DShapeNets | volume | 1 | 77.3 | 84.7 |
| VoxNet | volume | 12 | 83.0 | 85.9 |
| Subvolume | volume | 20 | 86.0 | 89.2 |
| MVCNN | image | 80 | 90.1 | — |
| Baseline (MLP on hand-crafted features) | point | — | 72.6 | 77.4 |
| PointNet | point | 1 | 86.2 | 89.2 |
PointNet matched or exceeded every method working on 3D input, volumetric or point, while a multi-view image method remained ahead, which the authors attribute to fine geometric detail captured by rendered images.
Part segmentation
On the ShapeNet part dataset, shapes in categories annotated with parts, part segmentation is per-point classification scored by mean intersection over union (mIoU). PointNet reached mIoU, against for the best previous method and for a 3D convolutional baseline the authors built, an improvement of points, winning in most categories. Trained and tested on simulated partial Kinect scans of the same shapes, it lost only points of mIoU.
Semantic segmentation of scenes
On the Stanford 3D semantic parsing dataset (S3DIS), scans of rooms in areas with every point labelled as one of classes, rooms are divided into blocks of m, each point is described by nine numbers (coordinates, colour and its normalised position in the room), and points per block are sampled during training. PointNet reached a mean IoU of and an overall accuracy of , against and for a baseline classifying hand-crafted point features (including density, curvature and normal). Turning the segmentation into object detection by connected-component clustering of points with the same predicted label (search radius m, clusters of over points), it improved the mean average precision over four furniture classes from to against a previous sliding-shape method.
Design choices
Order invariance. Comparing a perceptron on unsorted and on sorted points, a recurrent network on the points as a sequence, and symmetric functions (max pooling, average pooling and an attention-weighted sum) on ModelNet40, max pooling performed best by a large margin.
Transforms. The overall accuracy on ModelNet40 with each combination of alignment networks was as follows.
| Transform | Accuracy |
|---|---|
| none | 87.1 |
| input () | 87.9 |
| feature () | 86.9 |
| feature () with regulariser | 87.4 |
| both | 89.2 |
The feature transform hurts without the regulariser (2) and helps with it, and the two transforms together give the best result.
Robustness. With half the input points deleted, accuracy fell by only when points were dropped by furthest-point sampling and when dropped at random. Trained with outliers, the network stayed above accuracy with of the points replaced by outliers. In a direct comparison on missing points, a volumetric network (VoxNet) fell from to with half the points missing while PointNet fell by points, as the critical-point analysis predicts.
Bottleneck and input size. Accuracy grew with the number of input points but saturated around , and increasing the bottleneck dimension from to gained to points, which the authors read as the network needing enough point functions to cover the space.
Efficiency
| Network | Parameters | FLOPs per sample |
|---|---|---|
| PointNet without transforms | 0.8 M | 148 M |
| PointNet | 3.5 M | 440 M |
| Subvolume | 16.6 M | 3633 M |
| MVCNN | 60.0 M | 62057 M |
PointNet was times cheaper than MVCNN and times cheaper than Subvolume in computation, with times fewer parameters than MVCNN, and its cost grows linearly in the number of points, where volumetric methods grow cubically with the grid’s resolution and image methods quadratically with the image’s. On one GPU it processed over a million points per second.
Assessment
PointNet’s lasting contribution is the pattern of (1): a shared per-point network followed by a symmetric pooling, which respects the fact that a point cloud is a set and costs time linear in the number of points. The theorems make the pattern principled, showing that it can approximate any continuous set function and that its output depends on a bounded critical set, which accounts for its robustness.
Its main limitation, from the standpoint of LiDAR, follows from the same design. Each point’s feature is computed independently, and the only interaction between points is the single global maximum, so the network does not capture the local structure, the arrangement of neighbouring points, that the authors themselves list as the second property of point sets. Its successor, PointNet++, addressed this by applying PointNet hierarchically within local neighbourhoods, as the crash course describes. And the experiments concern CAD objects normalised into a unit sphere and indoor rooms cut into one-metre blocks, not the large, sparse, range-dependent scans of a driving LiDAR. In driving, PointNet’s lasting role is as a component: the encoder that summarises the points within each voxel or pillar of a VoxelNet or PointPillars detector, where the points are few, local and already grouped, which is exactly the setting in which a shared network and a max-pool excel.
References
- [Qi17] Charles R. Qi, Hao Su, Kaichun Mo and Leonidas J. Guibas. PointNet: Deep Learning on Point Sets for 3D Classification and Segmentation. 2017.