anomalyThreshold
R2026bOptimal anomaly threshold for set of anomaly scores and corresponding labels
Since R2022b
Syntax
Description
calculates the optimal anomaly threshold given per-image anomaly scores and corresponding
ground truth labels. t = anomalyThreshold(gtLabels,scores,anomalyLabels)anomalyLabels indicates which class labels in
gtLabels belong to the anomaly (positive) class. When performing
anomaly detection, images with scores below the calculated threshold are considered normal
images and images with scores above the threshold are considered anomalous images.
also specifies the optimization method.t = anomalyThreshold(gtLabels,scores,anomalyLabels,optimMethod)
also specifies the maximum false positive rate.t = anomalyThreshold(gtLabels,scores,anomalyLabels,MaxFalsePositiveRate=maxFPR)
also specifies the maximum false negative rate.t = anomalyThreshold(gtLabels,scores,anomalyLabels,MaxFalseNegativeRate=maxFNR)
[
also returns the receiver operating characteristic (ROC) curve and performance
metrics.t,anomalyROC] = anomalyThreshold(___)
Examples
Input Arguments
Output Arguments
Tips
You can plot ROC and PR curves returned by
anomalyROCusing theplot(Deep Learning Toolbox) function.
Version History
Introduced in R2022bSee Also
fcddAnomalyDetector | patchCoreAnomalyDetector | fastFlowAnomalyDetector | efficientADAnomalyDetector | rocmetrics (Deep Learning Toolbox) | anomalyMap