pointNetPlusClassifier - Create PointNet++ classifier to classify 3-D point clouds - MATLAB (original) (raw)
Create PointNet++ classifier to classify 3-D point clouds
Since R2025a
Description
The pointNetPlusClassifier
object creates a PointNet++ network[1] to classify 3-D point clouds that contain only one object. Using this object, you can:
- Create a pretrained 3-D point cloud classification model by using a PointNet++ deep learning network trained on the Sydney Urban Objects data set [2].
- Classify 3-D point clouds by using the classify object function.
- If you have the training data, you can create an untrained
pointNetPlusClassifier
object and use the trainPointNetPlusClassifier function to train the network. Using this function, you can also perform transfer learning to retrain a pretrained network.
Creation
Syntax
Description
[classifier](#mw%5F85e92d68-c6ab-4bd5-9201-9cf9cc3068b4) = pointNetPlusClassifier
creates a pretrained point cloud classifier by using a PointNet++ deep learning network trained on the Sydney Urban Objects data set.
[classifier](#mw%5F85e92d68-c6ab-4bd5-9201-9cf9cc3068b4) = pointNetPlusClassifier([weights](#mw%5F6e9f70de-b260-428c-8759-bcdc30e7df53),[classNames](#mw%5Fbedee62e-c5af-43b2-8b5d-9ad7be521b02))
creates a pretrained or untrained PointNet++ network using a specified set of classes.
If you specify weights
as "sydney-urban"
, the function creates a pretrained network and configures it to perform transfer learning using the specified set of classes. For optimal results, train the network on new training data before performing classification. Use the trainPointNetPlusClassifier function to train the network.
If you specify weights
as "random"
, the function creates an untrained network. To train the network, use the trainPointNetPlusClassifier function.
[classifier](#mw%5F85e92d68-c6ab-4bd5-9201-9cf9cc3068b4) = pointNetPlusClassifier([weights](#mw%5F6e9f70de-b260-428c-8759-bcdc30e7df53),[classNames](#mw%5Fbedee62e-c5af-43b2-8b5d-9ad7be521b02),[Name=Value](#namevaluepairarguments))
sets writable properties using one or more name-value arguments. For example,ModelName="pointCloudClassifier"
creates apointNetPlusClassifier
object with the model name"pointCloudClassifier"
.
Note
This functionality requires Deep Learning Toolbox™, Lidar Toolbox™, and the Lidar Toolbox Model for PointNet++ Classification support package. You can download and install the Lidar Toolbox Model for PointNet++ Classification from Add-On Explorer. For more information about installing add-ons, see Get and Manage Add-Ons.
Input Arguments
Data set for the pretrained network, specified as one of these options.
"sydney-urban"
— Creates apointNetPlusClassifier
object using a pretrained PointNet++ deep learning network trained on common urban road objects, scanned using a Velodyne® HDL-64E lidar sensor, from the Sydney Urban Objects data set.
Note
The pretrained network has been trained using only the location information of the point cloud data."random"
— Creates apointNetPlusClassifier
object using an untrained PointNet++ network with randomly initialized weights. For this option, you must specify class names using theclassNames
input argument.
Data Types: char
| string
Names of object classes to use when training the PointNet++ network, specified as a vector of strings, cell array of character vectors, or categorical vector.
- If you create an untrained network by specifying
weights
as"random"
, you must specify this argument to configure thepointNetPlusClassifier
object for training from scratch. - If you create a pretrained network by specifying
weights
as"sydney-urban"
, you can use this argument to specify custom object classes and configure thepointNetPlusClassifier
object for transfer learning. Otherwise, the network uses these default classes for the pretrained network.
This argument sets the ClassNames property.
Data Types: string
| cell
| categorical
Name-Value Arguments
Specify optional pairs of arguments asName1=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: pointNetPlusClassifier(ModelName="pointCloudClassifier")
creates a pointNetPlusClassifier
object with the model name"pointCloudClassifier"
.
Name of the PointNet++ network, specified as a string scalar or character vector.
- If the
weights
argument value is"sydney-urban"
, the default value ofModelName
is'sydney-urban'
. - If you specify
weights
as"random"
, the default value ofModelName
is''
.
This argument sets the ModelName property.
Data Types: char
| string
Number of points input to the PointNet++ network, specified as a positive integer greater than or equal to 1024 and divisible by 256. When you classify point clouds by using the classify object function, the function downsamples the point cloud to retain onlyNumPoints
number of points, as the PointNet++ network expects a fixed number of points.
This argument sets the NumPoints property. You must specify theclassNames
argument when you specify this argument.
Data Types: single
| double
Properties of point clouds input to the PointNet++ network, specified as a string scalar, character vector, string array, or cell array of character vectors.
By default, an untrained or a pretrained PointNet++ network takes only the locations of the points as input. You can provide additional properties by using this argument. For example,pointNetPlusClassifier("sydney-urban",classNames,PointCloudProperty="intensity")
creates a PointNet++ network that takes the locations and intensities of the points as input.
This argument sets the PointCloudProperty property. You must specify theweights
and classNames
arguments when you specify this argument.
Data Types: char
| string
| cell
Output Arguments
PointNet++ classifier, returned as a pointNetPlusClassifier
object.
Properties
This property is read-only.
PointNet++ deep learning network to use for point cloud classification, represented as a dlnetwork (Deep Learning Toolbox) object.
This property is read-only after object creation. To set this property, use theclassNames
input argument when calling thepointNetPlusClassifier
function.
Names of object classes for training the PointNet++ network, stored as a categorical vector.
- If you create an untrained network by specifying
weights
as"random"
, you must specify theclassNames
argument to set this property, and configure thepointNetPlusClassifier
object for training from scratch. - If you create a pretrained network by specifying
weights
as"sydney-urban"
, you can set this property by specifyingclassNames
, and configure thepointNetPlusClassifier
object for transfer learning. Otherwise, the network uses the default classes for the pretrained network.
Data Types: categorical
This property is read-only after object creation. To set this property, use theNumPoints
input argument when calling thepointNetPlusClassifier
function.
Number of points input to PointNet++ network, stored as a positive integer. When you classify point clouds by using the classify object function, the function downsamples the point cloud to retain onlyNumPoints
number of points, as the PointNet++ network expects a fixed number of points.
Data Types: single
| double
| int16
| int32
| int64
| uint16
| uint32
| uint64
This property is read-only after object creation. To set this property, use theNumPoints
name-value argument, along with theweights
and classNames
arguments, when calling the pointNetPlusClassifier
function.
Properties of point clouds input to PointNet++ network, stored as a cell array of character vectors. By default, an untrained or a pretrained PointNet++ network takes only the locations of the points as input.
Example: pointNetPlusClassifier("sydney-urban",classNames,PointCloudProperty="intensity")
creates a PointNet++ network that uses the locations and intensities of the points as input to the network.
Data Types: cell
Name of the PointNet++ network, stored as a character vector.
- If the
weights
argument value is"sydney-urban"
, the default value ofModelName
is'sydney-urban'
. - If you specify
weights
as"random"
, the default value ofModelName
is''
.
Data Types: char
Object Functions
classify | Classify point cloud using PointNet++ classifier |
---|
Examples
Create a PointNet++ Classifier.
classifier = pointNetPlusClassifier;
Read the input point cloud.
filename = "bus.pcd"; ptCloud = pcread(filename);
Apply the pretrained PointNet++ classifier to the input point cloud.
class = classify(classifier,ptCloud);
Display the input point cloud and its predicted class.
pcshow(ptCloud.Location,[0 1 0], ... MarkerSize=40, ... VerticalAxisDir="down") title(class)
References
[1] Qi, Charles R., Li Yi, Hao Su, and Leonidas J. Guibas. “PointNet++: Deep Hierarchical Feature Learning on Point Sets in a Metric Space.” In Proceedings of the 31st International Conference on Neural Information Processing Systems, 5105–14. NIPS’17. Red Hook, NY, USA: Curran Associates Inc., 2017.
[2] De Deuge, Mark, Alastair Quadras, Calvin Hung, and Bertrand Douillard. "Unsupervised Feature Learning for Classification of Outdoor 3D Scans." In Australasian Conference on Robotics and Automation 2013 (ACRA 13). Sydney, Australia: ACRA, 2013.
Version History
Introduced in R2025a