Main Content

trainEfficientADAnomalyDetector

Train EfficientAD anomaly detection network

Since R2024b

    Description

    detector = trainEfficientADAnomalyDetector(normalData,detectorIn,options) trains the input EfficientAD anomaly detection network detectorIn. The training data consists of the specified normal images normalData.

    Note

    This functionality requires Deep Learning Toolbox™ and 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.

    Note

    It is recommended that you also have Parallel Computing Toolbox™ to use with a CUDA® enabled NVIDIA® GPU. For information about the supported compute capabilities, see GPU Computing Requirements (Parallel Computing Toolbox).

    detector = trainEfficientADAnomalyDetector(___,Ratio=MapNormalizationDataRatio) specifies the data ratio to use for anomaly map normalization, in addition to the input arguments from the previous syntax.

    Input Arguments

    collapse all

    EfficientAD anomaly detector to train, specified as an efficientADAnomalyDetector object.

    Training data, specified as a datastore. The training data consists of samples of normal images. Do not include anomaly images in the training data.

    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 function.

    Tip

    When you perform tile-based training and GPU memory is limited, reduce the mini-batch size using the MiniBatchSize (Deep Learning Toolbox) argument of the trainingOptions function, at the expense of slower computation speed.

    Data ratio to use for anomaly map normalization, specified as a numeric scalar in the range [0, 1]. For example, a data ratio of 0.1 specifies that the detector must use only 10% of the training data for anomaly map normalization. To not perform the normalization, set the value to 0. Use a higher percentage of training data for normalization when your training data size is large.

    Output Arguments

    collapse all

    Trained EfficientAD anomaly detector, returned as an efficientADAnomalyDetector object.

    Tips

    • For a given training image size and number of training images, if the peak memory usage for creating a memory bank exceeds the available memory, EfficientAD outputs a warning. To address insufficient memory, try reducing image resolution, using fewer training images, or enhancing GPU performance.

    Version History

    Introduced in R2024b