Main Content

pointnetplusLayers

Create PointNet++ segmentation network

Description

PointNet++ is a neural network that predicts point-wise labels for an unorganized lidar point cloud. The network partitions the input points into a set of clusters and then extracts the features using a multi-layer perceptron (MLP) network. To use this network for semantic segmentation, train it using the trainNetwork (Deep Learning Toolbox) function.

example

lgraph = pointnetplusLayers(numPoints,pointsDim,numClasses) creates a PointNet++ segmentation network and returns it as lgraph, a layerGraph (Deep Learning Toolbox) object.

lgraph = pointnetplusLayers(___,Name=Value) specifies options using one or more name-value arguments in addition to the input arguments in the preceding syntax. For example, pointnetplusLayers(numPoints,pointsDim,numClasses,ClusterSize=32) creates a PointNet++ network with 32 points in each cluster.

Examples

collapse all

Define the input parameters for a custom PointNet++ network.

numPoints = 10000;
pointsDim = 3;
numClasses = 8;

Create the custom PointNet++ network.

lgraph = pointnetplusLayers(numPoints,pointsDim,numClasses, ...
    NormalizationLayer="instance", ...
    NumSetAbstractionModules=3, ...
    NumClusters=2048, ...
    ClusterRadius=0.1, ...
    ClusterSize=32, ...
    PointNetLayerSize=32);

Analyze the network using the analyzeNetwork (Deep Learning Toolbox) function.

analyzeNetwork(lgraph)

You can train this network using the trainNetwork (Deep Learning Toolbox) function and use it for different applications. To learn more about training the PointNet++ network, see the Aerial Lidar Semantic Segmentation Using PointNet++ Deep Learning example.

Input Arguments

collapse all

Number of points in the input point cloud, specified as a positive integer.

Dimensions of the input point cloud data matrix, specified as a positive integer greater than or equal to 3. The matrix must contain the xyz coordinates and any additional data such as range, mask, and intensity.

Number of classes the network must be configured to classify, specified as a positive integer greater than 1.

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: lgraph = pointnetplusLayers(numPoints,pointsDim,numClasses,NumSetAbstractionModules=3);

Type of normalization used in network, specified as "batch" or "instance".

Data Types: string | char

Number of set abstraction modules for the encoder subnetwork, specified as a positive integer. The decoder subnetwork contains the same number of feature propagation modules.

Number of clusters to group the input points into, specified as a positive integer. The value of NumClusters must be a power of two in the range [ 4N, numPoints], where N is the number of set abstraction modules.

This value specifies the number of clusters in the first set abstraction module. For subsequent set abstraction modules, the function automatically computes the number of clusters as K/4, where K is the number of clusters from the previous set abstraction module.

Cluster radius of the input points, specified as a positive scalar in the range (0, 1].

This value specifies the cluster radius for the first set abstraction module. For subsequent set abstraction modules, the function automatically computes the cluster radius as twice the value from the previous set abstraction module.

Number of points in each cluster, specified as a positive integer. For a given cluster radius in each set abstraction module, this value must be a power of two less than K/4(N — 2). K is the number of clusters in the network and N is the number of set abstraction modules.

This value is constant across all set abstraction modules.

Size of first layer in the MLP network of the set abstraction module, specified as a positive integer. Each set abstraction module contains a mini PointNet with a shared MLP network implemented using 1-by-1 convolution. The sizes of first, second, and third layers in the shared MLP network are S, S, 2*S which correspond to the number of filters in the first, second and third convolution layers, respectively.

This value specifies the size of first layer in the MLP network of the first set abstraction module. For each subsequent set abstraction modules, the value of S is twice the value of S from the previous set abstraction module.

Output Arguments

collapse all

Output PointNet++ network, returned as a layerGraph (Deep Learning Toolbox) object.

More About

collapse all

PointNet++ Network

A PointNet++ network has an encoder subnetwork with set abstraction modules, followed by a corresponding decoder subnetwork with feature propagation modules.

  • The set abstraction module identifies new cluster centers using farthest point sampling and groups the points into clusters using the ball query algorithm. The feature propagation module interpolates the points using inverse weighted distance based on the k-nearest neighbors algorithm.

  • The function creates the network with single scale grouping (SSG) architecture.

  • The function uses the narrow-normal weight initialization method to initialize the weights of each convolution layer in the network.

  • The function initializes all bias terms to zero.

Introduced in R2021b