https://github.com/aditya-grover/cyclip

https://github.com/aditya-grover/cyclip

Science Score: 10.0%

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

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

Repository

Basic Info
  • Host: GitHub
  • Owner: aditya-grover
  • Default Branch: main
  • Size: 16.1 MB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Fork of goel-shashank/CyCLIP
Created almost 4 years ago · Last pushed almost 4 years ago

https://github.com/aditya-grover/CyCLIP/blob/main/

# CyCLIP — Official PyTorch Implementation
![Python 3.10](https://img.shields.io/badge/python-3.10-green.svg?style=plastic)
![PyTorch 1.10](https://img.shields.io/badge/pytorch-1.11.0+cu115-green.svg?style=plastic)
![License CC BY-NC](https://img.shields.io/badge/license-CC_BY--NC-green.svg?style=plastic)

This repository contains the official PyTorch implementation of the following paper: > **CyCLIP: Cyclic Contrastive Language-Image Pretraining**
> Shashank Goel (UCLA), Hritik Bansal (UCLA), Sumit Bhatia (MDSR Lab, Adobe Systems), Ryan A. Rossi (Adobe Research), Vishwa Vinay (Adobe Research), Aditya Grover (UCLA)
> [https://arxiv.org/abs/2205.14459](https://arxiv.org/abs/2205.14459) > > **Abstract:** *Recent advances in contrastive representation learning over paired image-text data have led to models such as CLIP that achieve state-of-the-art performance for zero-shot classification and distributional robustness. Such models typically require joint reasoning in the image and text representation spaces for downstream inference tasks. Contrary to prior beliefs, we demonstrate that the image and text representations learned via a standard contrastive objective are not interchangeable and can lead to inconsistent downstream predictions. To mitigate this issue, we formalize consistency and propose CyCLIP, a framework for contrastive representation learning that explicitly optimizes for the learned representations to be geometrically consistent in the image and text space. In particular, we show that consistent representations can be learned by explicitly symmetrizing (a) the similarity between the two mismatched image-text pairs (cross-modal consistency); and (b) the similarity between the image-image pair and the text-text pair (in-modal consistency). Empirically, we show that the improved consistency in CyCLIP translates to significant gains over CLIP, with gains ranging from 10%-24% for zero-shot classification accuracy on standard benchmarks (CIFAR-10, CIFAR-100, ImageNet1K) and 10%-27% for robustness to various natural distribution shifts* ## Acknowledgements Some portions of the code in this repository are adaptations from the following repositories: [mlfoundations](https://github.com/mlfoundations/open_clip) and [openai](https://github.com/openai/CLIP). ## Licenses You can use, redistribute, and adapt the material for non-commercial purposes, as long as you give appropriate credit by citing our paper and indicating any changes that you've made. ## Requirements - Both Linux and Windows are supported, but we strongly recommend Linux for performance and compatibility reasons. - 64-bit Python 3.7+ installation. - One or more high-end GPUs with at least 16GB of DRAM. ## Setup Environment and Install dependencies ### Clone the repository ```bash git clone git@github.com:goel-shashank/CyCLIP.git cd CyCLIP ``` ### Conda (recommended) Please follow the instructions at the following link to set up anaconda: [Anaconda Setup](https://docs.anaconda.com/anaconda/install/index.html) The following commands create a conda environment inside the repository with the dependencies. ```bash conda env create --prefix ./env -f environment.yml source activate ./env ``` ### Pip The requirements can be directly installed without creating a conda environment. ```bash pip install -r requirements.txt ``` ## Pretrained Checkpoints You can find the pre-trained checkpoints [here](https://drive.google.com/drive/u/0/folders/1K0kPJZ3MA4KAdx3Fpq25dgW59wIf7M-x).

Owner

  • Name: Aditya Grover
  • Login: aditya-grover
  • Kind: user

Assistant Professor of Computer Science at UCLA

GitHub Events

Total
Last Year