splitAnomalyData
Split data into training, validation and testing sets for anomaly detection
Since R2023a
Syntax
Description
[
automatically splits the input image datastore, dsTrain
,dsVal
,dsTest
] = splitAnomalyData(ds
,anomalyLabels
)ds
, into three
datastores for training, validation and testing of anomaly detection networks.
anomalyLabels
indicates which class labels in
gtLabels
belong to the anomaly (positive) class. By default, 70% of
the total input data is used for training, 10% are used for validation, and 20% are used for
testing. By default, the training datastore does not include anomaly images.
Note
This functionality requires the Automated Visual Inspection Library for Computer Vision Toolbox™. You can install the Automated Visual Inspection Library for Computer Vision Toolbox from Add-On Explorer. For more information about installing add-ons, see Get and Manage Add-Ons.
[
automatically splits the input datastore, dsTrain
,trainLabels
,dsVal
,valLabels
,dsTest
,testLabels
] = splitAnomalyData(ds
,gtLabels
,anomalyLabels
)ds
, into three datastores and
their labels for training, validation and testing of anomaly detection networks.
gtLabels
represents the ground-truth labels for each corresponding
image in the datastore and anomalyLabels
determine which labels in
gtLabels
belong to the anomaly class.
[___] = splitAnomalyData(___,
uses name-value arguments to perform custom proportioning of the images. You can specify
either the proportion of images in each
datastore or the proportion of anomaly and normal
images.Name=Value
)
If you specify name-value arguments for both proportioning strategies, then
splitAnomalyData
uses the arguments that specify the proportion of
images in each datastore. In this case, the function ignores the arguments that specify the
proportion of anomaly and normal images.
Examples
Input Arguments
Output Arguments
Version History
Introduced in R2023a