Skip to content

qxzha/UCPM

Repository files navigation

UCPM: Uncertainty-Guided Cross-Modal Retrieval with Partially Mismatched Pairs

The official pytorch implementation of UCPM: Uncertainty-Guided Cross-Modal Retrieval with Partially Mismatched Pairs (submitted to IEEE TIP).

Introduction

UCPM framework

Requirements

  • Python 3.8
  • PyTorch 1.20.0
  • numpy
  • scikit-learn
  • Punkt Sentence Tokenizer:
import nltk
nltk.download()
> d punkt

(Optional) if the above download failed, you can manually download it from here. The directory structure is:

/home/username/
├── nltk_data
│     ├── tokenizers
│          ├── punkt
│               ├── czech.pickle
│               ├── french.pickle
│               ├── polish.pickle
│               ├── ......

DATASETS

Our directory structure of data.

data
├── f30k_precomp # pre-computed BUTD region features for Flickr30K, provided by SCAN
│     ├── train_ids.txt
│     ├── train_caps.txt
│     ├── ......
│
├── coco_precomp # pre-computed BUTD region features for COCO, provided by SCAN
│     ├── train_ids.txt
│     ├── train_caps.txt
│     ├── ......
│
├── cc152k_precomp # pre-computed BUTD region features for cc152k, provided by NCR
│     ├── train_ids.txt
│     ├── train_caps.tsv
│     ├── ......
│
└── vocab  # vocab files provided by SCAN and NCR
      ├── f30k_precomp_vocab.json
      ├── coco_precomp_vocab.json
      └── cc152k_precomp_vocab.json

Downloads

We follow NCR to obtain image features and vocabularies. Download Dataset

Noise Index

If you want to experiment with the same noise index as in this paper, the noise index files can be downloaded from here.

Training and Evaluation

Training

Coming soon

Pre-trained models and Evaluation

The pre-trained models are available here:

  1. CC152K model Download
  2. F30k 20% MRate model Download
  3. F30k 40% MRate model Download
  4. F30k 60% MRate model Download
  5. F30k 80% MRate model Download
  6. COCO 20% MRate model Download
  7. COCO 40% MRate model Download
  8. COCO 60% MRate model Download
  9. COCO 80% MRate model Download

Modify the data_path, vocab_path, and model_paths in the eval.py file and run it.

python eval.py

Experiment Results

Results on Well-Annotated Datasets

Results on Simulated PMPs

Results on Real-World PMPs

License

Apache License 2.0

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages