Skip to content

zhendashen896/SPD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SPD: Subspace Projection Debiasing

An official repository for "Bias Is a Subspace, Not a Coordinate: A Geometric Rethinking of Post‑hoc Debiasing in Vision-Language Models"

This repository contains the implementation of SPD and the baseline method SFID on attribute-replacement experiments on FairFace.

This experiment uses the SPD and SFID methods on the FairFace dataset to replace features across three dimensions, age, gender, and race, with low-confidence mean embeddings. Logistic regression is then used to evaluate the classification performance of these replaced embeddings. This verifies the effectiveness and completeness of the debiasing process and measures the level of feature entanglement (i.e., whether replacing one attribute significantly affects the accuracy of others) to ensure semantic integrity.

Folder Structure

  • src/: Source code (Python scripts).
  • embedding/: Raw PyTorch .pt checkpoint files. Obtained from the SFID repo.
  • low_conf/: Pre-computed low-confidence statistics (output_*.json). Obtained from the SFID repo.
  • artifacts/: Intermediate generated files (.jsonl, axes.json).
  • result/: Final evaluation results.

Setup

Ensure you have the required dependencies installed:

pip install -r requirements.txt

Method 1: SPD (Proposed Method)

To run the full SPD workflow:

sh run_spd.sh

To experiment with different values of $r$ in our paper, adjust the value of MAX_AXES in line 4.


Method 2: SFID (Baseline Method)

To run the full SFID workflow:

sh run_sfid.sh

If you find SPD useful for your research and applications, please cite using this BibTeX:

@article{zhao2025bias,
  title={Bias Is a Subspace, Not a Coordinate: A Geometric Rethinking of Post-hoc Debiasing in Vision-Language Models},
  author={Zhao, Dachuan and Li, Weiyue and Shen, Zhenda and Qiu, Yushu and Xu, Bowen and Chen, Haoyu and Chen, Yongchao},
  journal={arXiv preprint arXiv:2511.18123},
  year={2025}
}

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors