trainYOLOv4ObjectDetector
Syntax
Description
returns an object detector trained using you only look once version 4 (YOLO v4) network
specified by the input detector
= trainYOLOv4ObjectDetector(trainingData
,detector
,options
)detector
. The input
detector
can be an untrained or pretrained YOLO v4 object detector.
The options
input specifies training parameters for the detection
network.
You can also use this syntax for fine-tuning a pretrained YOLO v4 object detector.
resumes training from the saved detector checkpoint.detector
= trainYOLOv4ObjectDetector(trainingData
,checkpoint
,options
)
You can use this syntax to:
Add more training data and continue the training.
Improve training accuracy by increasing the maximum number of iterations.
___ = trainYOLOv4ObjectDetector(___,Name=Value)
specifies options using one or more name-value arguments in addition to any combination of
arguments from previous syntaxes. For example,
trainYOLOv4ObjectDetector(trainingData,ExperimentManager="none")
sets
the metrics to track with Experiment Manager to "none"
.
Note
To run this function, you will require the Deep Learning Toolbox™.
Examples
Input Arguments
Output Arguments
Tips
To generate the ground truth, use the Image Labeler or Video Labeler app. To create a table of training data from the generated ground truth, use the
objectDetectorTrainingData
function.To improve prediction accuracy,
Increase the number of images you can use to train the network. You can expand the training dataset through data augmentation. For information on how to apply data augmentation for preprocessing, see Preprocess Images for Deep Learning (Deep Learning Toolbox).
Choose anchor boxes appropriate to the dataset for training the network. You can use the
estimateAnchorBoxes
function to compute anchor boxes directly from the training data.
A pretrained axis-aligned network can be converted to a rotated rectangle network by providing rotated rectangle training data. When you provide the rotated rectangle training data, the
trainYOLOv4ObjectDetector
function fine tunes the network heads allowing the rotated rectangle detections to occur.When you train a rotated rectangle bounding box detector, use a learning rate approximately one order of magnitude below that of its axis-aligned counterpart training rate.
When you perform transfer learning using a YOLO v4 object detector, consider freezing the subnetworks using the name-value argument
FreezeSubNetwork
to increase training speed and reduce GPU memory consumption.
Version History
Introduced in R2022aSee Also
Apps
Functions
trainingOptions
(Deep Learning Toolbox) |yolov4ObjectDetector
|objectDetectorTrainingData
|trainYOLOv2ObjectDetector