Home

Awesome

ICCV2021-AtypicalityDetection

This is a PyTorch implementation of the model proposed in our ICCV 2021 paper: Detecting Persuasive Atypicality by Modeling Contextual Compatibility.

Environment Setup

python=3.6

pytorch=1.6.0

torchvision=0.7.0

Self-supervised training with our models and detecting atypicality on test samples

  1. Data:

Download the Ads dataset at page.

Extract the image features by the Faster R-CNN feature extractor demonstrated in "Bottom-Up and Top-Down Attention for Image Captioning and Visual Question Answering" (CVPR 2018). You may refer to these github (1, 2, 3) for the extraction.

Please save them and adapt the structure of folders with our code.

  1. Self-supervised training:

First update the config file.

Use Spatial-Relative Transformer:

python main.py --train --test --svte --cartesian

Use Transformer:

python main.py --train --test --vte

  1. Detecting atypicality by pre-trained model:

First update the config file.

Use Spatial-Relative Transformer:

python main.py --atypical_test --svte --cartesian

Use Transformer:

python main.py --atypical_test --vte

Citation

If you make use of this code, please kindly cite our paper:

@InProceedings{Guo_2021_ICCV,
    author    = {Guo, Meiqi and Hwa, Rebecca and Kovashka, Adriana},
    title     = {Detecting Persuasive Atypicality by Modeling Contextual Compatibility},
    booktitle = {Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV)},
    month     = {October},
    year      = {2021},
    pages     = {972-982}
}