Feature Clipping
Pretrained models
All logits and features and extracted from the following models:
- CIFAR10 (from focal loss calibration)
- CIFAR100 (from focal loss calibration)
- IMAGENET (from pytorch's torchvision.models)
- Resnet-50: torchvision.models.resnet50(weights=torchvision.models.ResNet50_Weights.IMAGENET1K_V1)
- DenseNet-121: torchvision.models.densenet121(weights=torchvision.models.DenseNet121_Weights.IMAGENET1K_V1)
- Wide-Resnet-50: torchvision.models.wide_resnet50_2(weights=torchvision.models.Wide_ResNet50_2_Weights.IMAGENET1K_V1)
- MobileNet-V2: torchvision.models.mobilenet_v2(weights=torchvision.models.MobileNet_V2_Weights.IMAGENET1K_V1)
- ViT-L-16: torchvision.models.vit_l_16(weights=torchvision.models.ViT_L_16_Weights.IMAGENET1K_V1)
Dependencies
conda create -n feature-clipping python=3.10
python -m pip install -r requirements.txt
Evalutation
run bash evaluate_scripts_post_hoc.sh to evaluate post hoc methods
run bash evaluate_scripts_train-time.sh to evaluate train time methods