项目介绍

xmed-lab/CLIP_Surgery 是一个托管在 GitHub 上的开源项目,主要使用 Jupyter Notebook 编写,目前获得 481 个 Star、30 次 Fork。

仓库全名
xmed-lab/CLIP_Surgery
Star 数
481
Fork 数
30
未关闭 Issue
3

README 摘要

A closer look at the explainability of Contrastive language-image pre-training (Pattern Recognition) Early version: CLIP Surgery for Better Explainability with Enhancement in Open-Vocabulary Tasks (arxiv) Introduction This work focuses on the explainability of CLIP via its raw predictions. We identify two problems about CLIP's explainability: opposite visualization and noisy activations. Then we propose the CLIP…

完整内容见 GitHub 原始 README 或本页 。

常见问题

CLIP_Surgery 用什么语言开发?

主要使用 Jupyter Notebook 编写,目前有 481 个 Star。

如何获取 CLIP_Surgery 的源码?

可以直接克隆仓库:git clone https://github.com/xmed-lab/CLIP_Surgery.git,默认分支为 master;安装与运行步骤见仓库 README。

CLIP_Surgery 最近还在维护吗?

仓库最近一次更新为 2025年3月1日,当前有 3 个未关闭 Issue;Star 数为 481,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

[Pattern Recognition 25] CLIP Surgery for Better Explainability with Enhancement in Open-Vocabulary Tasks

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

语言占比

Jupyter Notebook
Python

贡献者

README

A closer look at the explainability of Contrastive language-image pre-training (Pattern Recognition)

Early version: CLIP Surgery for Better Explainability with Enhancement in Open-Vocabulary Tasks (arxiv)

Introduction

This work focuses on the explainability of CLIP via its raw predictions. We identify two problems about CLIP’s explainability: opposite visualization and noisy activations. Then we propose the CLIP Surgery, which does not require any fine-tuning or additional supervision. It greatly improves the explainability of CLIP, and enhances downstream open-vocabulary tasks such as multi-label recognition, semantic segmentation, interactive segmentation (specifically the Segment Anything Model, SAM), and multimodal visualization. Currently, we offer a simple demo for interpretability analysis, and how to convert text to point prompts for SAM. Rest codes including evaluation and other tasks will be released later.

Opposite visualization is due to wrong relation in self-attention: image

Noisy activations is owing to redundant features across lables: image

Our visualization results: image

Text2Points to guide SAM: image

Multimodal visualization: image

Segmentation results: image

Multilabel results: image

Demo

Firstly to install the SAM, and download the model

pip install git+https://github.com/facebookresearch/segment-anything.git
wget https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth

Then explain CLIP via jupyter demo “demo.ipynb”. Or use the python file:

python demo.py

(Note: demo’s results are slightly different from the experimental code, specifically no apex amp fp16 for easier to use.)

Cite

@article{LI2025111409,
title = {A closer look at the explainability of Contrastive language-image pre-training},
journal = {Pattern Recognition},
volume = {162},
pages = {111409},
year = {2025},
issn = {0031-3203},
doi = {https://doi.org/10.1016/j.patcog.2025.111409},
url = {https://www.sciencedirect.com/science/article/pii/S003132032500069X},
author = {Yi Li and Hualiang Wang and Yiqun Duan and Jiheng Zhang and Xiaomeng Li}
}

评论

暂无评论