• Loading…

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:

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 nn points {Pi∣i=1,…,n}\{P_i \mid i = 1, \dots, n\}, each a vector of its coordinates (x,y,z)(x, y, z), 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, kk scores for the kk candidate classes of the whole input; for segmentation, n×mn \times m scores, one for each point and each of mm 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 NN points must give the same answer for all N!N! 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 hh to each point separately and combining the results with a symmetric function gg:

f({x1,…,xn})≈g(h(x1),…,h(xn)),(1) f(\{\bfx_1, \dots, \bfx_n\}) \approx g\big(h(\bfx_1), \dots, h(\bfx_n)\big), \tag{1}
(1)

where h:RN→RKh : \bbR^N \to \bbR^K and g:RK×⋯×RK→Rg : \bbR^K \times \cdots \times \bbR^K \to \bbR is symmetric. In PointNet, hh is a multilayer perceptron and gg is an elementwise maximum over the points followed by a further function γ\gamma, so that g=γ∘MAX⁡g = \gamma \circ \operatorname{MAX}. Each of the KK coordinates of hh is a learned function of position, and the maximum keeps, for each, the largest value attained anywhere in the set. A collection of such hh thus learns a collection of ff’s, each capturing a different property of the set.

The perceptron hh is shared: the same weights are applied to every point, independently. Applied to an n×3n \times 3 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.

  1. The n×3n \times 3 input passes through an input transform: a small network predicts a 3×33 \times 3 matrix, which multiplies the points.
  2. A shared perceptron with layers of 6464 and 6464 units lifts each point to 6464 dimensions.
  3. A feature transform predicts a 64×6464 \times 64 matrix, which multiplies the features.
  4. A shared perceptron with layers of 6464, 128128 and 10241024 units lifts each point to 10241024 dimensions.
  5. Max pooling over the nn points gives the 10241024-dimensional global feature.
  6. A perceptron with layers of 512512, 256256 and kk units maps the global feature to the class scores, with dropout (keeping 70%70\% of units) on the 256256-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 6464, 128128 and 10241024 units, max pooling, and fully connected layers of 512512 and 256256 units, regressing the matrix, whose output is initialised to the identity.

The feature transform is a 64×6464 \times 64 matrix, far harder to optimise than the 3×33 \times 3 one, so the training loss adds a regulariser that pushes it towards an orthogonal matrix:

Lreg=∥I−AA⊤∥F2,(2) L_{\mathrm{reg}} = \lVert I - A A\T \rVert_F^2, \tag{2}
(2)

where AA is the predicted feature transform and ∥⋅∥F\lVert\cdot\rVert_F 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 0.0010.001.

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 6464-dimensional features after the feature transform are concatenated, for each point, with the 10241024-dimensional global feature, giving n×1088n \times 1088; a shared perceptron of 512512, 256256 and 128128 units and then one of 128128 and mm 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 0.0010.001, momentum 0.90.9 and batches of 3232, halving the learning rate every 2020 epochs. The batch-normalisation decay rate starts at 0.50.5 and rises gradually to 0.990.99. The segmentation network uses no dropout.

Theoretical analysis

The paper gives two theorems about the decomposition (1) with g=γ∘MAX⁡g = \gamma \circ \operatorname{MAX}. They need a notion of distance between point sets.

The Hausdorff distance

The Hausdorff distance between two sets SS and S′S' measures how far either set strays from the other:

dH(S,S′)=max⁡{max⁡s∈Smin⁡s′∈S′∥s−s′∥, max⁡s′∈S′min⁡s∈S∥s−s′∥}. d_H(S, S') = \max\Big\{ \max_{\bfs \in S} \min_{\bfs' \in S'} \lVert \bfs - \bfs' \rVert,\ \max_{\bfs' \in S'} \min_{\bfs \in S} \lVert \bfs - \bfs' \rVert \Big\}.

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.

Theorem 3(Universal approximation).

Let X={S⊆[0,1]m:∣S∣=n}\calX = \{S \subseteq [0,1]^m : |S| = n\} and let f:X→Rf : \calX \to \bbR be continuous with respect to the Hausdorff distance dHd_H. For every ε>0\varepsilon > 0 there exist a continuous function hh and a symmetric function g(x1,…,xn)=γ∘MAX⁡g(\bfx_1, \dots, \bfx_n) = \gamma \circ \operatorname{MAX}, where γ\gamma is continuous and MAX⁡\operatorname{MAX} takes nn vectors to their elementwise maximum, such that for every S∈XS \in \calX,

∣f(S)−γ(MAX⁡xi∈S{h(xi)})∣<ε. \Big| f(S) - \gamma\Big(\operatorname{MAX}_{\bfx_i \in S} \{ h(\bfx_i) \}\Big) \Big| < \varepsilon.
Proof.

The paper’s supplementary material proves the case m=1m = 1, of sets of numbers in [0,1][0, 1]; the idea carries over to higher dimensions. By continuity, choose δ\delta such that ∣f(S)−f(S′)∣<ε|f(S) - f(S')| < \varepsilon whenever dH(S,S′)<δd_H(S, S') < \delta, and let K=⌈1/δ⌉K = \lceil 1/\delta \rceil. Divide [0,1][0, 1] into KK equal intervals, and let σ(x)=⌊Kx⌋/K\sigma(x) = \lfloor Kx \rfloor / K move each point to the left end of its interval. The set S~={σ(x):x∈S}\tilde S = \{\sigma(x) : x \in S\} is within 1/K≤δ1/K \le \delta of SS in Hausdorff distance, so ∣f(S)−f(S~)∣<ε|f(S) - f(\tilde S)| < \varepsilon.

Now let hk(x)=e−d(x,[k−1K,kK])h_k(x) = e^{-d(x, [\frac{k-1}{K}, \frac{k}{K}])}, a soft indicator that equals 11 on the kk-th interval and decays away from it, and h=(h1,…,hK)h = (h_1, \dots, h_K). The elementwise maximum of hh over the points of SS records which intervals contain a point of SS: the paper treats it as an occupancy vector v∈{0,1}Kv \in \{0, 1\}^K, and it does not depend on the order of the points. The map τ\tau that sends an occupancy vector to the set of left ends of the occupied intervals recovers exactly S~\tilde S. Choosing a continuous γ\gamma with γ(v)=f(τ(v))\gamma(v) = f(\tau(v)) on occupancy vectors gives γ(MAX⁡{h(xi)})=f(S~)\gamma(\operatorname{MAX}\{h(x_i)\}) = f(\tilde S), which is within ε\varepsilon of f(S)f(S).

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 u(S)=MAX⁡xi∈S{h(xi)}u(S) = \operatorname{MAX}_{\bfx_i \in S}\{h(\bfx_i)\} for the KK-dimensional pooled feature, so that f=γ∘uf = \gamma \circ u.

Theorem 4(Critical point sets).

Let u:X→RKu : \calX \to \bbR^K be u(S)=MAX⁡xi∈S{h(xi)}u(S) = \operatorname{MAX}_{\bfx_i \in S}\{h(\bfx_i)\} and let f=γ∘uf = \gamma \circ u. Then

  1. for every SS there are sets CS⊆S⊆NSC_S \subseteq S \subseteq N_S such that f(T)=f(S)f(T) = f(S) for every TT with CS⊆T⊆NSC_S \subseteq T \subseteq N_S, and
  2. ∣CS∣≤K|C_S| \le K.
Proof.

The output f(S)f(S) is determined by u(S)u(S). For each coordinate jj of uu, the maximum uj(S)u_j(S) is attained by at least one point xj∈S\bfx_j \in S, with hj(xj)=uj(S)h_j(\bfx_j) = u_j(S). Let CSC_S be the set of these points, one for each coordinate, so ∣CS∣≤K|C_S| \le K. Any set containing CSC_S attains at least these maxima, and adding any point x\bfx with h(x)≤u(S)h(\bfx) \le u(S) in every coordinate raises none of them, so uu, and with it ff, is unchanged. Taking NSN_S to be the set of all such points gives the result.

The paper calls CSC_S the critical point set of SS and KK the bottleneck dimension. The output is determined by at most KK points, every other point of the input can be deleted, and any number of points can be added inside the upper-bound shape NSN_S, without changing the result. Combined with the continuity of hh, 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
A toy PointNet in two dimensions whose K point functions each measure closeness to a centre, so that each coordinate of the max-pooled feature is attained at the input point nearest its centre. Those points form the critical set, never more than K of them. Any point set that contains the critical set and lies within the shaded upper-bound shape has exactly the same feature. Increase K and the critical set grows to outline the mug while the upper-bound shape tightens around it; with few functions, many shapes are indistinguishable.

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, 12,31112{,}311 CAD models in 4040 categories, split into 9,8439{,}843 for training and 2,4682{,}468 for testing, the authors sample 10241024 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 0.020.02.

MethodInputViewsAverage class accuracyOverall accuracy
3DShapeNetsvolume177.384.7
VoxNetvolume1283.085.9
Subvolumevolume2086.089.2
MVCNNimage8090.1—
Baseline (MLP on hand-crafted features)point—72.677.4
PointNetpoint186.289.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, 16,88116{,}881 shapes in 1616 categories annotated with 5050 parts, part segmentation is per-point classification scored by mean intersection over union (mIoU). PointNet reached 83.783.7 mIoU, against 81.481.4 for the best previous method and 79.479.4 for a 3D convolutional baseline the authors built, an improvement of 2.32.3 points, winning in most categories. Trained and tested on simulated partial Kinect scans of the same shapes, it lost only 5.35.3 points of mIoU.

Semantic segmentation of scenes

On the Stanford 3D semantic parsing dataset (S3DIS), scans of 271271 rooms in 66 areas with every point labelled as one of 1313 classes, rooms are divided into blocks of 1×11 \times 1 m, each point is described by nine numbers (coordinates, colour and its normalised position in the room), and 40964096 points per block are sampled during training. PointNet reached a mean IoU of 47.7147.71 and an overall accuracy of 78.62%78.62\%, against 20.1220.12 and 53.19%53.19\% 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 0.20.2 m, clusters of over 200200 points), it improved the mean average precision over four furniture classes from 18.2218.22 to 24.2424.24 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.

TransformAccuracy
none87.1
input (3×33 \times 3)87.9
feature (64×6464 \times 64)86.9
feature (64×6464 \times 64) with regulariser87.4
both89.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 2.4%2.4\% when points were dropped by furthest-point sampling and 3.8%3.8\% when dropped at random. Trained with outliers, the network stayed above 80%80\% accuracy with 20%20\% of the points replaced by outliers. In a direct comparison on missing points, a volumetric network (VoxNet) fell from 86.3%86.3\% to 46.0%46.0\% with half the points missing while PointNet fell by 3.73.7 points, as the critical-point analysis predicts.

Bottleneck and input size. Accuracy grew with the number of input points but saturated around 10001000, and increasing the bottleneck dimension KK from 6464 to 10241024 gained 22 to 44 points, which the authors read as the network needing enough point functions to cover the space.

Efficiency

NetworkParametersFLOPs per sample
PointNet without transforms0.8 M148 M
PointNet3.5 M440 M
Subvolume16.6 M3633 M
MVCNN60.0 M62057 M

PointNet was 141141 times cheaper than MVCNN and 88 times cheaper than Subvolume in computation, with 1717 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

  1. [Qi17] Charles R. Qi, Hao Su, Kaichun Mo and Leonidas J. Guibas. PointNet: Deep Learning on Point Sets for 3D Classification and Segmentation. 2017.