How oonat/ezpc works
EZPC learns a concept-space projection that explains CLIP/SigLIP zero-shot predictions. The main workflow prepares image embeddings and class splits, caches text embeddings for class names and concepts, trains a projection, then evaluates generalized zero-shot accuracy and fidelity. Separate analysis tools inspect concept geometry, faithfulness, transfer, and visual explanations. The README documents the data-to-training-to-evaluation flow; experiment relationships beyond imports and named utilities are shown only where supported, with uncertain links omitted.
Main entry points: utils.py Shared utilities · train.py Projection training · test.py Zero-shot evaluation · dataset.py Raw image datasets
Components 22
Data preparation
- Dataset download
data/download_dataset.py - Image embeddings
data/extract_clip_features.py - Class splits
data/split_dataset.py - Text embeddings
data/save_text_embs.py - Raw image datasets
dataset.py
Projection and evaluation
- Shared utilities
utils.py - Projection training
train.py - EZPC projection
model.py - Zero-shot evaluation
test.py
Model analysis
- Concept-space analysis
experiments/concept_space_analysis.py - Faithfulness analysis
experiments/faithfulness_analysis.py - Cross-dataset transfer
experiments/cross_dataset_transfer/cross_train.py - Vocabulary ablation
experiments/vocab_size_ablation/train.py - Concept clustering
experiments/qualitative_experiments/clustering.py
Visual explanations
- Region IoU metrics
experiments/concept_region_alignment/calculate_iou_metrics.py - Patch heatmaps
experiments/concept_region_alignment/generate_patch_heatmap.py - Class explanations
experiments/qualitative_experiments/class_level_analysis.py - Image explanations
experiments/qualitative_experiments/image_level_analysis.py
Other components
- Researcher
- Benchmark data
- Cached embeddings
- Learned projection
Connections 29
- Researcher → Dataset download: prepares data
README.md - Benchmark data → Dataset download: download source
README.md - Dataset download → Image embeddings: supplies images
README.md - Image embeddings → Cached embeddings: writes image vectors
README.md - Cached embeddings → Class splits: splits vectors
README.md - Class splits → Cached embeddings: writes class splits
README.md - Cached embeddings → Text embeddings: stores text vectors
README.md - Researcher → Projection training: trains projection
README.md - Cached embeddings → Projection training: loads training vectors
README.md - Projection training → Shared utilities: uses helpers
train.py - Projection training → EZPC projection: optimizes
train.py - Projection training → Learned projection: saves weights
README.md - Researcher → Zero-shot evaluation: evaluates model
README.md - Zero-shot evaluation → Learned projection: loads weights
README.md - Zero-shot evaluation → Cached embeddings: loads test vectors
README.md - Zero-shot evaluation → Shared utilities: uses helpers
- Concept-space analysis → Shared utilities: uses helpers
experiments/concept_space_analysis.py - Faithfulness analysis → Shared utilities: uses helpers
experiments/faithfulness_analysis.py - Cross-dataset transfer → Shared utilities: uses helpers
experiments/cross_dataset_transfer/cross_train.py - Cross-dataset transfer → EZPC projection: optimizes
experiments/cross_dataset_transfer/cross_train.py - Vocabulary ablation → Shared utilities: uses helpers
experiments/vocab_size_ablation/train.py - Vocabulary ablation → EZPC projection: optimizes
experiments/vocab_size_ablation/train.py - Patch heatmaps → Shared utilities: uses helpers
experiments/concept_region_alignment/generate_patch_heatmap.py - Patch heatmaps → Raw image datasets: loads images
experiments/concept_region_alignment/generate_patch_heatmap.py - Class explanations → Shared utilities: uses helpers
experiments/qualitative_experiments/class_level_analysis.py - Class explanations → Raw image datasets: loads images
experiments/qualitative_experiments/class_level_analysis.py - Image explanations → Raw image datasets: uses dataset
experiments/qualitative_experiments/image_level_analysis.py - Concept clustering → Raw image datasets: uses dataset
experiments/qualitative_experiments/clustering.py - Region IoU metrics → Shared utilities: uses helpers
experiments/concept_region_alignment/calculate_iou_metrics.py