VisFIS: Visual Feature Importance Supervision with Right-for-the-Right-Reason Objectives
Zhuofan Ying*, Peter Hase*, Mohit Bansal
Create and activate conda environment:
conda create -n visfis python=3.6
conda activate visfisInstall the dependencies with:
pip install -r requirements.txt- Download gdrive to
path_to_gdrivefor running the scripts. Alternatively, you can also download data from google drive manually. - Inside
scripts/common.sh, editPROJ_DIRvariable by assigning it the project path.
Download data for XAI-CP (put path_to_gdrive as the first argument):
./scripts/download/download_xai.sh ${path_to_gdrive}Preprocess the data:
./scripts/preprocessing/preprocessing_xai.shDownload data for HAT-CP (put path_to_gdrive as the first argument):
./scripts/download/download_vqa.sh ${path_to_gdrive}Preprocess the data:
./scripts/preprocessing/preprocessing_vqa.shDownload data for GQA-CP (put path_to_gdrive as the first argument):
./scripts/download/download_gqa.sh ${path_to_gdrive}Preprocess the data:
./scripts/preprocessing/preprocessing_gqa.sh- Run scripts in
scripts/baseline/, andscripts/visfis/to train models and calculate metrics. Put dataset name as the first argument chosen fromxaicp,hatcp, andgqacp. Put GPU number as the second argument. For example, to reproduce results from the main table onxaicp, execute:
./scripts/baseline/baseline_updn.sh xaicp 0
./scripts/visfis/visfis_updn.sh xaicp 1- To train with random supervision, change the value of
--hint_typeparameter in scripts tohints_random. - Scripts for tuning and reproducing other SOTA results can be found in
scripts/all/.
The analysis/ directory contains R scripts that read .pkl files of metrics and conduct data analysis.
This code used resources from negative analysis of grounding, ramen, and bottom-up-attention-vqa .
If you find this code useful for your research, please consider citing:
@inproceedings{ying2022visfis,
title={VisFIS: Visual Feature Importance Supervision with Right-for-the-Right-Reason Objectives},
author = {Ying, Zhuofan and Hase, Peter and Bansal, Mohit},
booktitle={arXiv},
year={2022}
}
