Latent GIG Backup
Research project backup for Latent Gradient Integrated Gradients (Latent GIG) - an explainability method for image classifiers that leverages latent space paths.
Download & Extract
# huggingface_hub 설치 (필요시)
pip install huggingface_hub
# 다운로드
huggingface-cli download leekwoon/latent_gig_backup --repo-type dataset --local-dir ./latent_gig_data
# 무결성 확인 (선택사항)
cd latent_gig_data
md5sum -c checksums.md5
# 파일 합치기 및 압축 해제
cat data.tar.gz.part_* | tar -xzvf -
Directory Structure
latent_gig/
├── cleanig/ # Core implementation modules
│ ├── explainer/ # Explainability algorithms (IG, GIG, AGI, Latent GIG)
│ ├── dataset/ # Dataset utilities (ImageNet, OxfordPet, OxfordFlower)
│ ├── classifier/ # Classifier utilities
│ ├── metric/ # Evaluation metrics (DiffID)
│ ├── mar_vae/ # MAR-VAE implementation
│ └── vae_wrapper.py # VAE wrapper for different models
├── configs/ # Configuration files
│ ├── dataset/ # Dataset configs
│ ├── ig.yaml # Integrated Gradients config
│ ├── gig.yaml # Guided IG config
│ ├── agi.yaml # Adversarial GI config
│ ├── latent_gig.yaml # Latent GIG config
│ └── superpixel_gig.yaml
├── notebooks/ # Jupyter notebooks
│ └── analysis/ # Result analysis notebooks
├── results/ # Experiment results
│ ├── benchmark_diffid/ # DiffID benchmark results
│ └── classifier_*/ # Trained classifiers
├── scripts/ # Execution scripts
│ ├── baselines/ # Baseline method scripts
│ ├── run_baselines.sh # Run all baselines
│ ├── run_latent_gig.sh # Run Latent GIG experiments
│ ├── analyze_results.py # Result analysis tool
│ └── diffid.py # DiffID evaluation
├── papers/ # Related papers
└── requirements.txt # Python dependencies
Key Components
Explainers
- IG (Integrated Gradients): Standard integrated gradients
- GIG (Guided IG): Guided version with adversarial paths
- AGI (Adversarial GI): Adversarial gradient integration
- Latent GIG: Our method using latent space paths with VAE models
VAE Models Supported
- SD1: Stable Diffusion v1 VAE
- SD2: Stable Diffusion v2 VAE
- KD: Kandinsky VAE
- MAR: Masked Auto-Regressive VAE
Datasets
- ImageNet (subset)
- Oxford-IIIT Pet Dataset
- Oxford Flower Dataset
Evaluation Metrics
- DiffID (Diffusion-generated Image Detection)
- Insertion/Deletion curves
- Attribution quality metrics
Parameters for Latent GIG
- fraction: Amount of latent to move at each step (0.05, 0.1, 0.2, 0.3)
- vae_type: VAE model to use (mar, sd1, sd2, kd)
Citation
This is a research project for developing improved explainability methods for image classifiers using latent space interpolation.