MCPcopy Index your code
hub / github.com/Vincent-ZHQ/UniS-MMC

github.com/Vincent-ZHQ/UniS-MMC @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
124 symbols 276 edges 10 files 11 documented · 9%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

UniS-MMC

Code for UniS-MMC: Multimodal Classification via Unimodality-supervised Multimodal Contrastive Learning (ACL 2023)

Environemt

Python=3.8, Pytorch=1.8.0, CUDA=11.1

conda create -n unis111 python=3.8
conda install pytorch==1.8.0 torchvision==0.9.0 torchaudio==0.8.0 cudatoolkit=11.1 -c pytorch -c conda-forge
pip install -r requirements.txt

Code Structure

-- model: TextEncoder.py, ImageEncoder.py, model.py
-- data: dataloader.py, create_data.py
-- results: logs, results, imgs, models
-- Pretrained: bert_base_uncased, bert_large_uncased, roberta_base, roberta_large, vit_base, vit_large
-- src: config.py, functions.py, metrics.py, train_food101.py
-- main.py
-- train.sh
-- test.sh
-- requirements.txt

Data Preparation

UPMC-Food-101 is a multimodal food classification dataset. We adopt the most commonly used split method and remove those image-text pairs with missing images or text. The final dataset split is available here.

N24News is a multimodal news classification dataset. We adopt the original split method.

Train and Test

The examples for training and test are included in train.sh and test.sh. For direct inference on Food101, we provide a pretrained checkpoint here.

Citations

If you use this code as part of any published research, we'd really appreciate it if you could cite the following paper:

@inproceedings{Zou2023UniSMMCMC,
  title={UniS-MMC: Multimodal Classification via Unimodality-supervised Multimodal Contrastive Learning},
  author={Heqing Zou and Meng Shen and Chen Chen and Yuchen Hu and Deepu Rajan and Eng Siong Chng},
  year={2023}
}

License

MIT License

Core symbols most depended-on inside this repo

_check_args_tf
called by 6
src/augment_ops.py
_randomly_negate
called by 6
src/augment_ops.py
dict_to_str
called by 4
src/functions.py
mmc_2
called by 3
model/model.py
collect_metrics
called by 3
src/metrics.py
get_tokenizer
called by 2
model/TextEncoder.py
infer
called by 2
model/model.py
remove_tags
called by 2
data/dataloader.py

Shape

Function 66
Method 43
Class 15

Languages

Python100%

Modules by API surface

src/augment_ops.py66 symbols
model/model.py15 symbols
data/dataloader.py10 symbols
src/functions.py9 symbols
src/train_food101.py6 symbols
model/TextEncoder.py5 symbols
src/config.py4 symbols
model/ImageEncoder.py4 symbols
main.py4 symbols
src/metrics.py1 symbols

For agents

$ claude mcp add UniS-MMC \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact