pecl

Paired embeddings contrastive learning

https://github.com/vdplasthijs/pecl

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: arxiv.org, zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.1%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

Paired embeddings contrastive learning

Basic Info
Statistics
  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created about 2 years ago · Last pushed 9 months ago
Metadata Files
Readme License Citation

README.md

arXiv Dataset CI Issues Python PyTorch License

Predicting butterfly species presence from satellite imagery using soft contrastive regularisation

This repository contains all code of our 2025 CVPR FGVC paper, including: - PECL (Paired Embeddings Contrastive Loss) implementation in scripts/paired_embeddings_models.py. - Torch dataloader for the S2BMS dataset in scripts/DataSetImagePresence.py - Resnet-based model to predict species presence vectors from satellite images, using PECL.

Installation:

  • Use conda to install packages using pecl.yml or pip install from requirements.txt.
  • Add your user profile data paths in content/data_paths_pecl.json. (This step is not needed when just experimenting with the code and the example data provided in the repo).

Getting started:

  • A sample data set (of 16 locations) is provided in tests/data_tests/.
  • Go to notebooks/Getting started.ipynb to see examples of how to load the data and model.

Data:

  • The full S2-BMS data set is available on Zenodo.
  • Our Torch dataloader is available in scripts/DataSetImagePresence.py.

PECL implementation

  • For details please see our paper.
  • PyTorch implementation can be found in scripts/paired_embeddings_models.py (ImageEncoder.pecl_loss()).

Results

  • The training scripts used for the paper are scripts/train.py and scripts/train_randomsearch.py.
  • The figures and tables in the paper were created in notebooks/Results figs and tables.ipynb.

Please cite our paper if you use this method or data in a publication - thank you!!

Owner

  • Name: Thijs van der Plas
  • Login: vdplasthijs
  • Kind: user
  • Location: Oxford, UK
  • Company: The Alan Turing Institute

Post doctoral researcher @ The Alan Turing Institute

Citation (CITATION.bib)

@article{van2025predicting,
  title={Predicting butterfly species presence from satellite imagery using soft contrastive regularisation},
  author={van der Plas, Thijs L and Law, Stephen and Pocock, Michael JO},
  journal={arXiv preprint arXiv:2505.09306},
  year={2025},
  url={https://arxiv.org/abs/2505.09306}
}

GitHub Events

Total
  • Issues event: 2
  • Watch event: 1
  • Issue comment event: 1
  • Push event: 10
Last Year
  • Issues event: 2
  • Watch event: 1
  • Issue comment event: 1
  • Push event: 10