Main Content

trainPointNetPlusClassifier

Train PointNet++ point cloud classifier

Since R2025a

    Description

    Train a Classifier

    classifier = trainPointNetPlusClassifier(trainingData,classifier,options) trains an untrained or pretrained PointNet++ point cloud classifier, specified by classifier, on the training data trainingData, and returns the trained point cloud classifier classifier. The options 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 = trainPointNetPlusClassifier(trainingData,checkpoint,options) resumes training the classifier from the saved checkpoint specified by checkpoint. 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,info] = trainPointNetPlusClassifier(___) returns information on the training progress of the network, using any combination of input arguments from previous syntaxes.

    [___] = trainPointNetPlusClassifier(___,ExperimentMonitor=experimentMonitor) 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

    collapse all

    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 the combine 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 of trainingOptions when creating your training options object. To control how frequently the function saves checkpoints, use the CheckPointFrequency 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 your options 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 the detector 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

    collapse all

    Trained PointNet++ classifier, returned as a pointNetPlusClassifier object.

    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 of NaN for that iteration. The structure contains the ValidationLoss and FinalValidationLoss fields only when the options input contains validation data.

    Version History

    Introduced in R2025a