human-analysis / FairerCLIP

Official code for the paper "FairerCLIP: Debiasing CLIP’s Zero-Shot Predictions using Functions in RKHSs".
5 stars 2 forks source link

Code for replicating MaxSkew results #1

Open ryan-caesar-ramos opened 4 months ago

ryan-caesar-ramos commented 4 months ago

Hi! First of all thanks for releasing code for your work

I'm very interested in replicating your experiments for FairFace/MaxSkew. Any chance you have code for it? Or if you could at least point me in the right direction regarding making a custom config yaml file for FairFace?

Thanks again!

lan-lw commented 4 months ago

Thank you for your interests! For FairFace, we follow the setting of paper "Debiasing Vision-Language Models via Biased Prompts", adopting 10 training concepts to construct the prompts, including good, evil, smart, dumb, attractive, unattractive, lawful, criminal, friendly, unfriendly. We group the 10 training concepts into 5 opposite pairs, and conduct debiasing for each pair. For example, we use good and evil as a pair, assign y=0 to "A photo of a good celebrity." and y=1 to "A photo of a evil celebrity.", use gender or race as sensitive attribute, and then do debiasing as what we did for other dataset. After debiasing, we calculate the average MaxSkew@1000 for the 5 pairs. We will update the code for FairFace soon after cleaning up.