trainPointNetPlusClassifier - Train PointNet++ point cloud classifier - MATLAB (original) (raw)
Train PointNet++ point cloud classifier
Since R2025a
Syntax
Description
Train a Classifier
[classifier](#mw%5Fda7a6a24-3ef5-4d31-928a-7c8b91e2812b) = trainPointNetPlusClassifier([trainingData](#mw%5F79dfa5b4-04bf-4e77-91d2-690ce1165bea),[classifier](#mw%5Fda7a6a24-3ef5-4d31-928a-7c8b91e2812b),[options](#mw%5F8fbe3d30-e004-4582-aa0f-7ace4877f9b0))
trains an untrained or pretrained PointNet++ point cloud classifier, specified byclassifier
, on the training data trainingData
, and returns the trained point cloud classifier classifier
. Theoptions
input specifies the training parameters for the classification network. You can use this syntax to fine-tune a pretrained PointNet++ classifier.
Resume Training a Classifier
[classifier](#mw%5Fda7a6a24-3ef5-4d31-928a-7c8b91e2812b) = trainPointNetPlusClassifier([trainingData](#mw%5F79dfa5b4-04bf-4e77-91d2-690ce1165bea),[checkpoint](#mw%5F4fabd6e1-cbe0-4948-812b-013fdce5d8a7),[options](#mw%5F8fbe3d30-e004-4582-aa0f-7ace4877f9b0))
resumes training the classifier from the saved checkpoint specified bycheckpoint
. You can use this syntax to add more training data and continue training a network, or to improve training accuracy by increasing the maximum number of iterations.
Additional Options
[[classifier](#mw%5Fda7a6a24-3ef5-4d31-928a-7c8b91e2812b),[info](#mw%5Fe2820ba8-4f58-44c4-8f9c-ea2fbeb9cdf1)] = trainPointNetPlusClassifier(___)
returns information on the training progress of the network, using any combination of input arguments from previous syntaxes.
[___] = trainPointNetPlusClassifier(___,ExperimentMonitor=[experimentMonitor](#mw%5F30af4c8b-7ef8-44d7-86ad-3efb65651303))
specifies whether to monitor the progress of the training experiment with Experiment Manager, in addition to any combination of arguments from previous syntaxes.
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
Training data, specified as a valid datastore object. You must configure the datastore object such that using the read function of the datastore object returns a 1-by-2 cell array with this format.
- First cell — Organized or unorganized point cloud data, specified as a pointCloud object.
- Second cell — Classification label for the point cloud in the first cell, specified as a categorical scalar.
You can use a fileDatastore object to store the point cloud data and an arrayDatastore object to store the classification labels. Then, use thecombine function to combine two or more datastores. For more information on creating datastore objects, see the datastore function.
PointNet++ classifier, specified as a pointNetPlusClassifier object.
- You can train an untrained point cloud classifier using the specified training options
options
. - You can continue training a pretrained classifier with additional training data, or perform more training iterations to improve classification accuracy.
Training options, specified as a TrainingOptionsSGDM
,TrainingOptionsRMSProp
, or TrainingOptionsADAM
object returned by the trainingOptions (Deep Learning Toolbox) function. To specify the solver name and other options for network training, use the trainingOptions (Deep Learning Toolbox) function.
Saved checkpoint, specified as a pointNetPlusClassifier object. To periodically save a detector checkpoint during training, specify the CheckpointPath
name-value argument oftrainingOptions
when creating your training options object. To control how frequently the function saves checkpoints, use theCheckPointFrequency
and CheckPointFrequencyUnit
name-value arguments when creating your training options.
To load a checkpoint for a previously trained classifier, first load the corresponding MAT file from the checkpoint path. Then extract the object from the loaded data. For example, if the CheckpointPath
property of youroptions object is '/checkpath'
, you can load a checkpoint MAT file by using this code.
data = load("/checkpath/net_checkpoint__1__2024_11_18__07_26_34.mat"); checkpoint = data.detector;
The name of the MAT file includes the iteration number and timestamp of when the detector checkpoint was saved. The MAT file saves the detector in thedetector
variable. To continue training, specify the network extracted from the file to the trainPointNetPlusClassifier
function.
trainedDetector = trainPointNetPlusClassifier(trainingData,checkpoint,options);
Training experiment monitoring, specified as an experiments.Monitor (Deep Learning Toolbox) object for use with the Experiment Manager (Deep Learning Toolbox) app. You can use this object to track the progress of training, update information fields in the training results table, record values for the metrics used in training, and produce training plots.
The app monitors this information during training.
- Training loss at each iteration.
- Learning rate at each iteration.
- Validation loss at each iteration, if the options input contains validation data.
The app also monitors the final validation loss at the end of the training, if the options input contains validation data.
Output Arguments
Training progress information, returned as a structure array with these fields. Each field corresponds to a stage of training.
TrainingLoss
— Training loss at each iteration.BaseLearnRate
— Learning rate at each iteration.ValidationLoss
— Validation loss at each iteration.FinalValidationLoss
— Final validation loss at the end of the training.
Each field is a numeric vector with one element per training iteration. If the function does not calculate a value at a specific iteration, it returns a value ofNaN
for that iteration. The structure contains theValidationLoss
and FinalValidationLoss
fields only when the options input contains validation data.
Version History
Introduced in R2025a