This is the continuation of the workd done in Synthetic outlier generation for anomaly detection in autonomous driving. I pretrain the semantic segmentation models on the SHIFT and StreetHazards datasets and propose using the Standardized Max Logits on the simplified detector, which uses no additional resources compared to the segmentation model, but is trained with outlier exposure to improve outlier detection.
In this case, I use the COCO dataset as the OOD dataset, compared to the original paper that uses the ADE20K dataset. I evaluate the results on the SHIFT-nopedestrian and StreetHazards datasets, as in the original paper.
To use the scripts create a new environment python3 -m venv .env
, activate and install the requirements from requirements.txt
.
To prepare the datasets, SHIFT, StreetHazards and COCO2014-val run the corresponding prepare_DATASET.sh
bash script.
To pretrain the segmentation models use the pretrain_shift.py
and pretrain_sh.py
scripts. The pretrained models (weights only) are available in this link, and should be placed on the pretrained
folder. These models are trained to 83% mIoU on StreetHazards and 85% (val mIoU) and X% test mIoU (on images without the pedestrian class) on SHIFT.
The Outlier Injection training is done with the ood_train.py
script, with the following command:
python3 ood_train --dataset DATASET_NAME --checkpoint SAVE_PATH --epochs NUM_EPOCHS \
--beta BETA1_PARAMETER --beta2 BETA2_PARAMETER --lr LEARNING_RATE \
--alpha ALPHA_BLENDING --horizon HORIZON_PARAMETER --blur BLURRING (--histogram)
The images that the script uses from the COCO dataset during training (as outliers) are previously filtered to exclude pedestrian-like and in-distribution instances.