Home

Awesome

Perception and Semantic Aware Regularization for Sequential Confidence Calibration

<!-- <p align="center"> <a href="https://arxiv.org/pdf/2404.04624.pdf"><img src="https://img.shields.io/badge/arXiv-Paper-<color>"></a> </p> -->

This is the official PyTorch implementation for the paper: "Perception and Semantic Aware Regularization for Sequential Confidence Calibration". For more details, please refer to our paper.<br>

Runtime Environment

Datasets

We use lmdb dataset for training and evaluation. The training datasets can be downloaded in clovaai and the ensemble of evalutaion datasets can be downloaded here.

Calibration

1. Get Correlated Sequence

Perception Similarity Sequence

bash get_perc_sim_seq.sh

Semantic Correlation Sequence

CUDA_VISIBLE_DEVICES=0 python abinet/get_sem_cor_seq.py --checkpoint /path/to/checkpoint

2. Calibrate Model With PSSR

CUDA_VISIBLE_DEVICES=0 python train.py \
--train_data data_lmdb_release/training --valid_data data_lmdb_release/test \
--select_data MJ-ST --batch_ratio 0.5-0.5 --lr 0.1 \
--Transformation TPS --FeatureExtraction ResNet --SequenceModeling BiLSTM --Prediction Attn \
--saved_model /path/to/checkpoint --calibrator PSSR --alpha 0.05 --with_vis

Evaluation

CUDA_VISIBLE_DEVICES=0 python test.py \
--eval_data data_lmdb_release/test \
--Transformation TPS --FeatureExtraction ResNet --SequenceModeling BiLSTM --Prediction Attn \
--saved_model pretrained_models/TPS-ResNet-BiLSTM-Attn.pth

Calibrated Models Download

Download calibrated model by PSSR from this link.

<!-- Performances of the calibrated model are: | Model | ECE(%) | ACE(%) | MCE(%) | | ------- | :---: | :---: | :---: | | TRBA | 0.36 | 0.28 | 3.99 | | TRBC | 0.47 | 0.25 | 6.22 | | CRNN | 0.97 | 0.49 | 8.52 | -->

Acknowledgements

This implementation has been based on clovaai and ABINet.

Citation

If you find our work useful in your research, please cite the following:

@inproceedings{peng2023perception,
  title={Perception and Semantic Aware Regularization for Sequential Confidence Calibration},
  author={Peng, Zhenghua and Luo, Yu and Chen, Tianshui and Xu, Keke and Huang, Shuangping},
  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  pages={10658--10668},
  year={2023}
}