Skip to main content

Temporal inference with Vision-Language Models — predict when an image was taken from its visual content.

Project description

A Matter of Time: Revealing the Structure of Time in Vision-Language Models

PyPI Python License arXiv Paper Dataset Demo

Teaser

Official implementation of "A Matter of Time: Revealing the Structure of Time in Vision-Language Models", published at ACM Multimedia 2025 (MM '25).

We investigate the temporal awareness of VLMs, assessing their ability to position visual content in time. We introduce TIME10k, a benchmark of over 10,000 images with temporal ground truth, and evaluate 37 VLMs. We reveal that temporal information is structured along a low-dimensional, non-linear manifold in the VLM embedding space. We propose methods to derive an explicit "timeline" representation using UMAP and Bezier curve approximation, achieving competitive to superior accuracy while being computationally efficient.

Performance

Try it now: A live demo is available on Hugging Face Spaces.


Quick Start

Install

pip install timeline-vlm

For CLIP models, also install:

pip install git+https://github.com/openai/CLIP.git

Predict the year of any image in 3 lines:

from timeline_vlm import TimelinePredictor

predictor = TimelinePredictor('clip-vit-b32').fit_from_precomputed('encodings')
print(predictor.predict('photo.jpg'))  # -> 1972

Or from the command line:

timeline-vlm predict photo.jpg
timeline-vlm predict photo.jpg --model "CLIP ViT-L/14" --method time_probing

List available models:

from timeline_vlm import list_models
print(list_models())  # 37 supported VLMs

# or from CLI
timeline-vlm list-models

No GPU required — precomputed embeddings for CLIP and EVA-CLIP are included.


Installation

From PyPI (recommended)

pip install timeline-vlm

From source (for development or paper reproduction)

git clone https://github.com/tekayanidham/timeline-vlm.git
cd timeline-vlm
pip install -e .

Optional dependencies

# CLIP models (not on PyPI, must be installed separately)
pip install git+https://github.com/openai/CLIP.git

# OpenCLIP models
pip install timeline-vlm[openclip]

# All optional dependencies (excluding CLIP)
pip install timeline-vlm[all]

# For all 37 models (including EVA-CLIP, ImageBind and ViT-Lens)
bash install_models.sh

Python API

from timeline_vlm import TimelinePredictor

# Initialize and fit
predictor = TimelinePredictor(
    model='clip-vit-b32',          # Any of the 37 supported models
    method='bezier',               # 'time_probing', 'umap', or 'bezier'
    reduce_dim=None,               # KPCA dimensions (None = original space, 13 = optimal)
    bezier_method='interpolation', # 'interpolation' or 'nearest_neighbor'
)
predictor.fit_from_precomputed('encodings')

# Single prediction
year = predictor.predict('photo.jpg')

# Batch prediction
years = predictor.predict_batch(['img1.jpg', 'img2.jpg', 'img3.jpg'])

# Detailed prediction
details = predictor.predict_with_details('photo.jpg')

# Evaluate on your own data
results = predictor.evaluate(image_embeddings, ground_truth_years)
print(f"MAE: {results['mae']:.2f}, TAI: {results['tai']:.3f}")

See docs/library.md for the full API reference.


CLI

# Predict
timeline-vlm predict photo.jpg
timeline-vlm predict photos/ --output json --save results.json

# List models
timeline-vlm list-models
timeline-vlm list-models --verbose

# Visualize (1D, 2D, or 3D)
timeline-vlm visualize timeline --model clip-vit-b32 --dim 3 --save timeline.png
timeline-vlm visualize prediction --image photo.jpg --dim 2 --save pred.png

Reproducing Paper Results

python scripts/reproduce_results.py --table 5                        # Single table
python scripts/reproduce_results.py --table 4 5                      # Multiple tables
python scripts/reproduce_results.py --figure 6                       # Figure 6
python scripts/reproduce_results.py --all                            # Everything
python scripts/run_experiments.py --config configs/full_evaluation.yaml  # Full benchmark
Flag What it reproduces
--table 1 Time probing MAE & TAI for 37 VLMs (P7)
--table 2 Prompt sensitivity P1-P9
--table 3 Class-wise temporal awareness
--table 4 Chronological ordering quality (KPCA vs UMAP)
--table 5 Method comparison: Time Probing vs UMAP vs 4 Bezier variants
--figure 6 MAE per KPCA dimension (optimal S=13)

See docs/reproducing_results.md for the full step-by-step guide.


Methods

Three temporal inference approaches, each described in detail in docs/methods.md:

Method Paper CLIP MAE Description
Time Probing Sec. 3.1 9.24 Dot-product similarity baseline
UMAP Timeline Sec. 3.3.1 13.01 1D manifold projection
Bezier(R^S, Int) Sec. 3.3.2 8.80 Bezier curve in KPCA subspace (best)

Supported Models (37 VLMs)

Family Count Backend
CLIP 9 openai/CLIP
EVA-CLIP 8 eva_clip (BAAI)
OpenCLIP 10 open_clip
SigLIP 3 open_clip
Others (CoCa, MobileCLIP, ViTamin, CLIPA, ImageBind, ViT-Lens) 7 various

See docs/models.md for the full list with model keys and installation instructions.


Documentation


Citation

@inproceedings{10.1145/3746027.3758163,
  author = {Tekaya, Nidham and Waldner, Manuela and Zeppelzauer, Matthias},
  title = {A Matter of Time: Revealing the Structure of Time in Vision-Language Models},
  year = {2025},
  isbn = {9798400720352},
  publisher = {Association for Computing Machinery},
  address = {New York, NY, USA},
  url = {https://doi.org/10.1145/3746027.3758163},
  doi = {10.1145/3746027.3758163},
  booktitle = {Proceedings of the 33rd ACM International Conference on Multimedia},
  pages = {12371--12380},
  numpages = {10},
  keywords = {benchmark dataset, multimodal representations, time estimation, time modeling, time reasoning, vision-language models},
  location = {Dublin, Ireland},
  series = {MM '25}
}

Links

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

timeline_vlm-1.0.5.tar.gz (39.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

timeline_vlm-1.0.5-py3-none-any.whl (45.0 kB view details)

Uploaded Python 3

File details

Details for the file timeline_vlm-1.0.5.tar.gz.

File metadata

  • Download URL: timeline_vlm-1.0.5.tar.gz
  • Upload date:
  • Size: 39.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for timeline_vlm-1.0.5.tar.gz
Algorithm Hash digest
SHA256 f686f4cca08fdc0f55ecec2e6bad9a734e1859c54844831ae45fe6e1ce22f991
MD5 e221a8f95ded9c498bad597577bbe503
BLAKE2b-256 e89f3579449bb7f14a5937d87110eb45877f0d0e0c5691b089abb852a9940185

See more details on using hashes here.

Provenance

The following attestation bundles were made for timeline_vlm-1.0.5.tar.gz:

Publisher: publish.yml on TekayaNidham/timeline-vlm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file timeline_vlm-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: timeline_vlm-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 45.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for timeline_vlm-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 5219119a4f460defeac21d121d3700cec988dacf408b24c4da46cca6ae73c64c
MD5 88d40e436fbb7079fc61b5ef4b1f5de8
BLAKE2b-256 6ccf16919ce34b64779a3cc019ccf955b5afa8630b0b2fe404e05aa026f2d7d5

See more details on using hashes here.

Provenance

The following attestation bundles were made for timeline_vlm-1.0.5-py3-none-any.whl:

Publisher: publish.yml on TekayaNidham/timeline-vlm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page