Skip to content

Sytwu/BeyondMemo

Repository files navigation

YearCLIP

Created by Li-Zhong Szu-Tu, Ting-Lin Wu, Chia-Jui Chang, He Syu, Yu-Lun Liu

This repository contains PyTorch implementation of YearCLIP in "Beyond Memorization: A Multi-Modal Ordinal Regression Benchmark to Expose Popularity Bias in Vision-Language Models".

intro

Project Page | Paper | Dataset | Statistics

Prerequisite

Clone repository

git clone --depth 1 https://github.com/Sytwu/BeyondMemo

Quick Download

cd BeyondMemo
sh prepare.sh

Dataset

Download links: [Google Drive]

Download data and save them to data/ according to the config files.

Checkpoint

Base weights download links: [Google Drive]

Download checkpoints (Pytorch/CLIP/Custom) and save them to .cache/ accordingly.

.cache
├── clip
│   ├── RN50.pt
│   └── ViT-B-16.pt
├── resnet
│   └── resnet50_imagenet.pt
└── vgg
    ├── vgg16_imagenet.pt
    └── vgg_imdb_wiki.pt

YearCLIP best weights (MAE=39.26) download links: [Google Drive]

Download checkpoints and save them to results/building/ accordingly.

Installation

Local Conda Environment

Manually install:

conda create --name yearclip python=3.8 -y
conda activate yearclip
pip install "pip<24.1"
pip install -r requirements.txt
pip install git+https://github.com/openai/CLIP
pip install -e .

Usage

Directly run the code (train+test):

python scripts/run.py --config configs/building.yaml

Reproduce from ckpt (test):

python scripts/run.py --config configs/building.yaml --test_only

Reproduce YearCLIP best (test):

python scripts/run.py --config configs/building.yaml --output_dir results/building/YearCLIP_114514 --test_only

Local Demo

Try out the interactive Gradio demo locally:

conda activate yearclip
python gradio_demo_local.py

Then open http://localhost:7861 in your browser.

Features:

  • Upload building images or select from example datasets (FI-London, MapYourCity, YearGuessr)
  • Optional GPS coordinates for improved accuracy
  • AI-powered explainability showing architectural features
  • Interactive card-based example gallery

Experiments Structure

Each experiment has its own name, with several config component names split by "_". The experiment folder includes:

  • ckpt/: checkpoints
  • *_logger/: the logs from pytorch_lightning
  • config.yaml: config
  • run.log: log the status of model during running
  • val/test_stats.json: metrics to be parsed
  • val/val_stats.json: metrics to be parsed
  • val/ordinality.json: metrics to be parsed

Acknowledgement

Many thanks to the following repositories:

Citation

If you find this codebase helpful, please consider to cite:

@misc{szutu2025memorizationmultimodalordinalregression,
      title={Beyond Memorization: A Multi-Modal Ordinal Regression Benchmark to Expose Popularity Bias in Vision-Language Models}, 
      author={Li-Zhong Szu-Tu and Ting-Lin Wu and Chia-Jui Chang and He Syu and Yu-Lun Liu},
      year={2025},
      eprint={2512.21337},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2512.21337}, 
}

About

Beyond Memorization: A Multi-Modal Ordinal Regression Benchmark to Expose Popularity Bias in Vision-Language Models

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors