Description:
This pull request introduces a new detector (Angle-Based Detector).
given a set of sub-cluster per class the detector measure the distance to the cluster of the infered point based on the cosine similarity. (training could be done using the already defined losses or the pytorrch_metric_learning package)
An extra test to the mahalanobis distance is added
Motivation:
Angular loss functions, such as Additive Angular Margin Loss (ArcFace), have demonstrated significant improvements in discriminative power for tasks like face recognition by optimizing angular margins between classes. Applying similar principles to OOD detection could improve the model's ability to distinguish between in-distribution and out-of-distribution samples. An Angle-Based Detector utilizes angular distances between feature representations and class centers to identify OOD samples, potentially providing a more robust method for OOD detection.
Description: This pull request introduces a new detector (Angle-Based Detector).
Motivation: Angular loss functions, such as Additive Angular Margin Loss (ArcFace), have demonstrated significant improvements in discriminative power for tasks like face recognition by optimizing angular margins between classes. Applying similar principles to OOD detection could improve the model's ability to distinguish between in-distribution and out-of-distribution samples. An Angle-Based Detector utilizes angular distances between feature representations and class centers to identify OOD samples, potentially providing a more robust method for OOD detection.