deeplearning-wisc / poem

PyTorch implementation of POEM (Out-of-distribution detection with posterior sampling), ICML 2022
28 stars 2 forks source link

Is this a bug? #3

Closed AlanPeng0897 closed 1 year ago

AlanPeng0897 commented 1 year ago

Whether "start_idx" should be updated? (!https://github.com/deeplearning-wisc/poem/blob/main/neural_linear_opt.py#L94-L95)

alvinmingwisc commented 1 year ago

Thanks for the comments! As the ID buffer always stores the same ID points, for the OOD buffer, there exists a tradeoff when deciding the number of data kept in the buffer after it is full. The learned decision boundary may not remain stable if data points in the buffer are changed frequently. However, when the batch size is not large, it is reasonable to gradually replace the old data in the buffer by adjusting start_idx for every iteration. We will give a try and check the performance. Please stay tuned!

alvinmingwisc commented 1 year ago

We ran POEM with start_idx updated every iteration after the buffer is full, and the results look similar to the original version. Codebase is updated :) and here are some new results.

CIFAR-10

We ran the train_poem.py script with default hyperparameters (e.g., sigma_n 20, sigma 0.5) for 100 epochs. Places365 denotes the random subset of 10,000 examples.

Places365 FPR95: 2.37 AUROC: 99.23 AUPR: 99.33

LSUN
FPR95: 15.17 AUROC: 97.03 AUPR: 97.54

LSUN_resize FPR95: 0.00 AUROC: 100.00 AUPR: 100.00

iSUN
FPR95: 0.00 AUROC: 100.00 AUPR: 100.00

Textures FPR95: 0.20 AUROC: 99.87 AUPR: 99.93

SVHN
FPR95: 0.82 AUROC: 99.35 AUPR: 99.52

Avg FPR95: 3.09 Avg AUROC: 99.3 Avg AUPR: 99.4

CIFAR-100

We train with default hyperparameters (e.g., sigma_n 20, sigma 0.5) for 200 epochs. We found that the performance is relatively stable (not sensitive to posterior update hyperparams) when trained longer with random replacement of OOD samples per iteration. Places365 denotes the random subset of 10,000 examples.