Train lane detector for lidar data
trains an untrained or pretrained lidar lane detection network utilizing global feature
correlation (LLDN-GFC) lane detector, specified by
detector = trainLidarLaneDetector(
options input specifies training parameters for the detection
You can use this syntax to fine-tune a pretrained LLDN-GFC lane detector.
This functionality requires Deep Learning Toolbox™, Lidar Toolbox™, and the Automated Driving Toolbox™ Model for Lidar Lane Detection support package. You can download and install the Automated Driving Toolbox Model for Lidar Lane Detection from Add-On Explorer. For more information about installing add-ons, see Get and Manage Add-Ons.
trainingData — Input training data
valid combined datastore object
Training data, specified as a valid combined datastore object.
You must set up the data such that using the
readfunction of the datastore object returns a 1-by-2 cell array. The columns of the cell array must follow this format.
First column — Organized or unorganized point cloud data, specified as a
Second column — Labeled ground truth data of the corresponding point cloud, specified as a 1-by-Q table. Each column of the table represents a single lane class, such as
lane3. The names of the variables must match the names of the classes stored in the
ClassNamesproperty of the
lidarLaneDetectorobject specified by
checkpoint. Each cell of the column must be empty or an N-by-3 matrix that specifies the [x y z] coordinates of N lane points of the corresponding lane in the point cloud data. An empty cell indicates that the point cloud does not have any lane points for the corresponding lane.
The pretrained LLDN-GFC lane detector model can detect a maximum of six lanes, and it assumes that the ego vehicle is placed such that there are three lane boundaries on either the left or right side of it. Thus, the class labels for the left and right lane boundaries of the ego vehicle must be
When you train the detector with your data set, you must use consistent class labels for the lane boundaries of the ego vehicle across all point clouds in the data set.
You can use a
fileDatastore object to store the point cloud
data and an
arrayDatastore object to store the ground truth data. Then, use the
function to combine two or more datastores. For more information on creating datastore
objects, see the
detector — LLDN-GFC lane detector
Untrained or pretrained LLDN-GFC lane detector, specified as a
lidarLaneDetector object. Use a pretrained detector to train it with
additional training data, or perform more training iterations to improve detection
options — Training options
Training options, specified as a
TrainingOptionsADAM (Deep Learning Toolbox) object returned by the
trainingOptions (Deep Learning Toolbox) function. To specify the solver name and other options for
network training, use the
trainingOptions function. The
trainLidarLaneDetector function supports only these properties of
Plots and Display —
Mini-Batch Options —
Solver Options —
Hardware Options —
checkpoint — Saved detector checkpoint
Saved detector checkpoint, specified as a
lidarLaneDetector object. To periodically save a detector checkpoint during
training, specify the
CheckpointPath training option. To control the
frequency for saving check points, in number of epochs, specify the
CheckPointFrequency training option.
To load a checkpoint for a previously trained detector, first load the corresponding
MAT file from the checkpoint path. Then, extract the lane detector from the loaded data.
For example, if the
CheckpointPath property of your
options object is
"/checkpath", you can load a
checkpoint MAT file for a detector named
detector by using this
data = load("/checkpath/detector-2.mat"); checkpoint = data.detector;
The name of the MAT file includes the epoch number at which the detector checkpoint
was saved. The MAT file saves the detector in the
To resume training from the saved detector checkpoint, use this syntax.
laneDetector = trainLidarLaneDetector(trainingData,checkpoint,options);
detector — Trained LLDN-GFC lane detector
Trained LLDN-GFC lane detector, returned as a
info — Training progress information
Training progress information, returned as a structure with these fields. Each field corresponds to a stage of training.
TrainingLoss— Training loss at each iteration.
ValidationLoss— Validation loss at each iteration.
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
ValidationLoss only when
Introduced in R2023b