OpenOOD
Benchmarking Generalized Out-of-Distribution Detection
Install / Use
/learn @Jingkang50/OpenOODREADME
OpenOOD: Benchmarking Generalized OOD Detection
<!-- | :exclamation: We are looking forward to further extending the scope and building OpenOOD v2.0. Specifically, we are interested in 1) incorporating more modalities (e.g., text/language), 2) OOD in vision-language models, multi-modal foundation models, and large language models. If you want to join us or have any other ideas/thoughts, please don't heisitate to contact [jingkang001@e.ntu.edu.sg](mailto:jingkang001@e.ntu.edu.sg)! | |-----------------------------------------| --->| :exclamation: When using OpenOOD in your research, it is vital to cite both the OpenOOD benchmark (versions 1 and 1.5) and the individual works that have contributed to your research. Accurate citation acknowledges the efforts and contributions of all researchers involved. For example, if your work involves the NINCO benchmark within OpenOOD, please include a citation for NINCO apart of OpenOOD.| |-----------------------------------------|
<img src="https://live.staticflickr.com/65535/52145428300_78fd595193_k.jpg" width="800">This repository reproduces representative methods within the Generalized Out-of-Distribution Detection Framework,
aiming to make a fair comparison across methods that were initially developed for anomaly detection, novelty detection, open set recognition, and out-of-distribution detection.
This codebase is still under construction.
Comments, issues, contributions, and collaborations are all welcomed!
|
|
|:--:|
| <b>Timeline of the methods that OpenOOD supports. More methods are included as OpenOOD iterates.</b>|
Updates
- 06 Nov, 2024: OpenOOD
v1.5full paper is accepted to The Journal of Data-centric Machine Learning Research (DMLR). - 17 Aug, 2024: :bulb::bulb: Wondering how OOD detection evolves and what new research topics could be in the new era of multimodal LLMs? Don't hesistate to check out our recent work Unsolvable Problem Detection: Evaluating Trustworthiness of Vision Language Models and Generalized Out-of-Distribution Detection and Beyond in Vision Language Model Era: A Survey.
- 27 Oct, 2023: A short version of OpenOOD
v1.5is accepted to NeurIPS 2023 Workshop on Distribution Shifts as an oral presentation. You may want to check out our presentation slides. - 25 Sept, 2023: OpenOOD now supports OOD detection with foundation models including zero-shot CLIP and DINOv2 linear probe. Check out the example evaluation script here.
- 16 June, 2023: :boom::boom: We are releasing OpenOOD
v1.5, which includes the following exciting updates. A detailed changelog is provided in the Wiki. An overview of the supported methods and benchmarks (with paper links) is available here.- A new report which provides benchmarking results on ImageNet and for full-spectrum detection.
- A unified, easy-to-use evaluator that allows evaluation by simply creating an evaluator instance and calling its functions. Check out this colab tutorial!
- A live leaderboard that tracks the state-of-the-art of this field.
- 14 October, 2022: OpenOOD
v1.0is accepted to NeurIPS 2022. Check the report here. - 14 June, 2022: We release
v0.5. - 12 April, 2022: Primary release to support Full-Spectrum OOD Detection.
Contributing
We appreciate all contributions to improve OpenOOD. We sincerely welcome community users to participate in these projects.
- For contributing to this repo, please refer to CONTRIBUTING.md for the guideline.
- For adding your method to our leaderboard, simply open an issue where you will see the template that has detailed instructions.
FAQ
APS_modemeans Automatic (hyper)Parameter Searching mode, which enables the model to validate all the hyperparameters in the sweep list based on the validation ID/OOD set. The default value is False. Check here for example.
Get Started
v1.5 (up-to-date)
Installation
OpenOOD now supports installation via pip.
pip install git+https://github.com/Jingkang50/OpenOOD
pip install libmr
# optional, if you want to use CLIP
# pip install git+https://github.com/openai/CLIP.git
Data
If you only use our evaluator, the benchmarks for evaluation will be automatically downloaded by the evaluator (again check out this tutorial). If you would like to also use OpenOOD for training, you can get all data with our downloading script. Note that ImageNet-1K training images should be downloaded from its official website.
Pre-trained checkpoints
OpenOOD v1.5 focuses on 4 ID datasets, and we release pre-trained models accordingly.
- CIFAR-10 [Google Drive]: ResNet-18 classifiers trained with cross-entropy loss from 3 training runs.
- CIFAR-100 [Google Drive]: ResNet-18 classifiers trained with cross-entropy loss from 3 training runs.
- ImageNet-200 [Google Drive]: ResNet-18 classifiers trained with cross-entropy loss from 3 training runs.
- ImageNet-1K [Google Drive]: ResNet-50 classifiers including 1) the one from torchvision, 2) the ones that are trained by us with specific methods such as MOS, CIDER, and 3) the official checkpoints of data augmentation methods such as AugMix, PixMix.
Again, these checkpoints can be downloaded with the downloading script here.
Our codebase accesses the datasets from ./data/ and pretrained models from ./results/checkpoints/ by default.
├── ...
├── data
│ ├── benchmark_imglist
│ ├── images_classic
│ └── images_largescale
├── openood
├── results
│ ├── checkpoints
│ └── ...
├── scripts
├── main.py
├── ...
Training and evaluation scripts
We provide training and evaluation scripts for all the methods we support in scripts folder.
Supported Benchmarks (10)
This part lists all the benchmarks we support. Feel free to include more.
<img src="https://live.staticflickr.com/65535/52146310895_7458dd8cbc_k.jpg" width="800"> <details open> <summary><b>Anomaly Detection (1)</b></summary></details> <details open> <summary><b>Open Set Recognition (4)</b></summary>
- [x] MVTec-AD
</details> <details open> <summary><b>Out-of-Distribution Detection (6)</b></summary>
- [x] MNIST-4/6
- [x] CIFAR-4/6
- [x] CIFAR-40/60
- [x] TinyImageNet-20/180
</details>
- [x] BIMCV (A COVID X-Ray Dataset)
Near-OOD:
CT-SCAN,X-Ray-Bone;<br> Far-OOD:MNIST,CIFAR-10,Texture,Tiny-ImageNet;<br>- [x] MNIST
Near-OOD:
NotMNIST,FashionMNIST;<br> Far-OOD:Texture,CIFAR-10,TinyImageNet,Places365;<br>- [x] CIFAR-10
Near-OOD:
CIFAR-100,TinyImageNet;<br> Far-OOD:MNIST,SVHN,Texture,Places365;<br>- [x] CIFAR-100
Near-OOD:
CIFAR-10,TinyImageNet;<br> Far-OOD:MNIST,SVHN,Texture,Places365;<br>- [x] ImageNet-200
Near-OOD:
SSB-hard,NINCO;<br> Far-OOD:iNaturalist,Texture,OpenImage-O;<br> Covariate-Shifted ID:ImageNet-C,ImageNet-R,ImageNet-v2;- [x] ImageNet-1K
Near-OOD:
SSB-hard,NINCO;<br> Far-OOD:iNaturalist,Texture,OpenImage-O;<br> Covariate-Shifted ID:ImageNet-C,ImageNet-R,ImageNet-v2,ImageNet-ES;
Note that OpenOOD v1.5 emphasizes and focuses on the last 4 benchmarks for OOD detection.
Supported Backbones (6)
This part lists all the backbones we will support in our codebase, including CNN-based and Transformer-based models. Backbones like ResNet-50 and Transformer
Related Skills
node-connect
331.7kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
81.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
331.7kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
81.6kCommit, push, and open a PR
