Causal Inference-inspired Open Set Recognition.
This is a description of the source code for "Open Set Recognition in Real World".
- A new open-set recognition task, RWOSR, was introduced for the purpose of addressing open-set recognition challenges in the real world.
- A novel Causal Inference-inspired OSR (CIOSR) method has been proposed to address the problem of OSR in real-world scenarios. With our proposed method, we have successfully tackled the challenges of both covariate shift and semantic shift in RWOSR, thereby enhancing the feasibility of applying OSR in real-world settings.
- Linux with Python >= 3.6
- PyTorch >= 1.1.0
- torchvision >= 0.3.0
- tensorboard >= 1.14.0
The data should be placed in Data/
. Train data is Data/Train/
. Test data is Data/Test/
. Unknown classes is Data/Unknown/
.
Note: Train data and test data should not come from the same distribution, meaning that the distribution of train data is different from that of test data, but the categories are the same. Data/Unknown/
is new/unknown category data.
python RWOSR_train --gpu 0
python OSR1 --gpu 0
Result files will be saved in results/
.
The training and testing settings of CIOSR are displayed in
ops/config.py
The trained models can be obtained in CIOSR-Resnet18,CIOSR-Resnet50,CIOSR-Resnet34. If you want to get the results of Table 3, 4, 5 in the manuscript, just run 'OSR1.py' on datasets NICO, VLCS, and PACS. The model used is CIOSR-Resnet18(for the NICO dataset).