anomalyThreshold
Optimal anomaly threshold for set of anomaly scores and corresponding labels
Syntax
Description
calculates the optimal anomaly threshold given per-image anomaly scores and corresponding
ground truth labels, with positive labels specified by t
= anomalyThreshold(trueLabels
,scores
,truePosLabels
)truePosLabels
.
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.
Note
This function requires the Computer Vision Toolbox™ Automated Visual Inspection Library. You can install the Computer Vision Toolbox Automated Visual Inspection Library from Add-On Explorer. For more information about installing add-ons, see Get and Manage Add-Ons. To run this function, you will require the Deep Learning Toolbox™.
also specifies the optimization method.t
= anomalyThreshold(trueLabels
,scores
,truePosLabels
,optimMethod
)
also specifies the maximum false positive rate.t
= anomalyThreshold(trueLabels
,scores
,truePosLabels
,MaxFalsePositiveRate=maxFPR
)
also specifies the maximum false negative rate.t
= anomalyThreshold(trueLabels
,scores
,truePosLabels
,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
anomalyROC
using theplot
(Deep Learning Toolbox) function.
Version History
Introduced in R2022b
See Also
fcddAnomalyDetector
| rocmetrics
(Deep Learning Toolbox)
Topics
- Getting Started with Anomaly Detection Using Deep Learning
- ROC Curve and Performance Metrics (Deep Learning Toolbox)