Open paulnovello opened 7 months ago
current status: β
Overall Coverage
Lines Covered Coverage Threshold Status 2390 2213 93% 70% π’ New Files
No new covered files...
Modified Files
File Coverage Status oodeel/extractor/feature_extractor.py 94% π’ oodeel/extractor/keras_feature_extractor.py 97% π’ oodeel/extractor/torch_feature_extractor.py 99% π’ oodeel/methods/base.py 83% π’ oodeel/methods/energy.py 100% π’ oodeel/methods/entropy.py 100% π’ oodeel/methods/gen.py 96% π’ oodeel/methods/mls.py 100% π’ oodeel/methods/odin.py 100% π’ TOTAL 96% π’ updated for commit:
26ee9fb
by actionπ
Implements both ASH and SCALE baselines at the same time because they are very similar.
SCALE method
SCALE method basically consists of re-using existing logit-based OOD methods, but with penultimate layer activations scaled. Let $a$ be the activation vector, and $Pp(a)$ the $p$-th percentile of $a$'s values. The scaling is computed using the formula $s = \exp(\frac{\sum{i} ai}{\sum{a_i > P_p(a)} a_i})$
Here, we focus on a Resnet trained on CIFAR10, challenged on SVHN.
Reference
Scaling for Training Time and Post-hoc Out-of-distribution Detection Enhancement, ICLR 2024 https://arxiv.org/abs/2111.12797
ASH method
This notebook aims at evaluating the ASH method.
ASH method basically consists of re-using existing logit-based OOD methods, but with penultimate layer activations scaled and pruned. Let $a$ be the activation vector, and $P_p(a)$ the $p$-th percentile of $a$'s values. The scaling is computed using the same formula as above. The activation vector is pruned for values $a_i \leq P_p(a)$.
Here, we focus on a Resnet trained on CIFAR10, challenged on SVHN.
Reference
Extremely Simple Activation Shaping for Out-of-Distribution Detection, ICLR 2023 http://arxiv.org/abs/2209.09858