Skip to content

Flowcon: Out-of-Distribution Detection using Flow-Based Contrastive Learning [In Progress]

License

Notifications You must be signed in to change notification settings

saandeepa93/FlowCon_OOD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FlowCon: Out-of-Distribution Detection using Flow-Based Contrastive Learning

ECCV 2024

Saandeep Aathreya, Shaun Canavan
University of South Florida, USA.

💡 Contributions:

  • A new density-based OOD detection technique called FlowCon is proposed. We introduce a new loss function $L_{con}$ which contrastively learns class separability in the probability distribution space. This learning occurs without any external OOD dataset and it operates on fixed classifiers.

  • The proposed method is evaluated on various metrics - FPR95, AUROC, AUPR-Success, and AUPR-Error and compared against state of the art. We observe that FlowCon is competitive or outperforms most methods under different OOD conditions. Additionally, FlowCon is stable even for a large number of classes and shows improvement for high-dimensional features

  • Histogram plots are detailed along with unified manifold approximations (UMAP) embeddings of the trained FlowCon model to respectively showcase it’s OOD detection and class-preserving capabilities. We also show FlowCon’s discriminative capabilities.

Results


Image 1 Image 2

Configurations

  • All config files are present under path ./configs/experiments
  • We have 4 config files
cifar10_3.yaml -> CIFAR10 with ResNet18
cifar10_5.yaml -> CIFAR10 with WideResNet
cifar100_6.yaml -> CIFAR100 with ResNet18
cifar100_4.yaml -> CIFAR100 with WideResNet

Pretrained Classifiers

  • The original ResNet18 and WideResNet classifiers are taken from Heatmap paper

Training FlowCon model

CIFAR-10

Training Resnet and WideResNet FlowCon model for CIFAR10. Follow similar commands for other configs

CUDA_VISIBLE_DEVICES=0 python ./trainer/train_flow.py --config cifar10_3 #Resnet

CUDA_VISIBLE_DEVICES=0 python ./trainer/train_flow.py --config cifar10_5 #WRN

CIFAR-100

CUDA_VISIBLE_DEVICES=0 python ./trainer/train_flow.py --config cifar100_6
CUDA_VISIBLE_DEVICES=0 python ./trainer/train_flow.py --config cifar100_4

Getting OOD Scores

  • Inference follows similar arguments
CUDA_VISIBLE_DEVICES=0 python ./tester/emperical_params.py --config cifar10_5

CUDA_VISIBLE_DEVICES=0 python ./tester/emperical_params.py --config cifar100_4
  • The $k$ distributions will be saved under ./data/distributions directory

  • The results will be saved under ./data/results directory

Pre-trained model weights

All the pretrained classifiers, and pretrained FlowCon models can be found in link

About

Flowcon: Out-of-Distribution Detection using Flow-Based Contrastive Learning [In Progress]

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages