Coder Social home page Coder Social logo

clip-feat-vis's Introduction

In-depth Understanding of CLIP Neurons via Faceted Feature Visualization

Hyesu Lim, Changdae Oh, Junhyeok Park, Rohan Prasad

In this project, we reproduce the result of multimodal neuron analysis (OpenAI, 2021) and further investigate the behavior of such neurons after being fine-tuned on diverse downstream task.


Quick Start

  1. Prepare the basic experiment pipeline by cloning this repository.
git clone https://github.com/hyesulim/clip-feat-vis.git
cd clip-feat-vis
  1. Environment setup (any of python ver >= 3.7, torch ver >= 1.8 should be okay). However, this code has been extensively tested on Python 3.11.6 and PyTorch 2.1.1 and is what we recommend. A requirements.txt file is included to help resolve any version conflicts.
conda create -n mmn python=3.11
conda activate mmn
pip install -r requirements.txt
  1. A sample Jupyter notebook is included inside notebooks. This should help you get started.

Module description

  1. linear_probe - This folder contains all our code related to training the Linear Probe used for faceted visualization

  2. `initial_ablations' - This folder contains the scripts and codes that used Lucent for performing the initial ablations on vanilla feature visualization

  3. faceted_visualization - This folder contains all the experiments and code related to faceted visualization

    a.) visualizer - this is a python package containing reusable code for using faceted visualization in your project. It currently only supports CLIP models.

  4. finetuning - This folder contains our the code required for finetuning

Ablation Details

You can find the links to our ablations here:

CelebA

Pre-Trained (Rohan)

Pre-Trained (Changdae)

Fine-Tuned

SUN397

Pre-Trained (Rohan)

Pre-Trained (Changdae)

Fine-Tuned

Aircraft

Pre-Trained (Rohan)

Pre-Trained (Changdae)

Fine-Tuned

Acknowledgement

This repository is built on top of Lucent library, and we would like to thank the authors of Lucent for their extensive efforts.!

clip-feat-vis's People

Contributors

hyesulim avatar rohan097 avatar changdaeoh avatar jun-hyeok avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.