Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

License

NotificationsYou must be signed in to change notification settings

Bernardo1998/FairGRAPE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repo presents an official implementation of FairGRAPE: Fairness-aware GRAdient Pruning mEthod for Face Attribute Classification

FairGRAPE_concept2

Dependencies

The code has been tested on the following environment:

python 3.9pytorch 1.11.0dlib 19.22.0opencv2 4.5.5

Use Anaconda and the following command to replicate the full environment:

conda env create -f environment.yml

Datasets

This code automatically downloads the following datasets for trianing, cross validation and testing:FairFace,UTKFace andCelebA. Request demographics labels of the Imagenet person subtree through the officaldatabase, save the annotation file under /csv and images under /Images/Imagenet.

Example Usage:

UTKFace experiments:

python main_test.py --sensitive_group 'gender' --loss_type 'race' --prune_type 'FairGRAPE' --network 'resnet34' --dataset 'UTKFace'  --prune_rate 0.9 --keep_per_iter 0.975

FairFace experiments

python main_test.py --sensitive_group race--loss_type 'race' --prune_type 'FairGRAPE' --network 'resnet34' --dataset 'FairFace'  --prune_rate 0.99

CelebA experiments

python main_test.py --sensitive_group 'gender' --loss_type 'classes' --prune_type 'FairGRAPE' --network 'mobilenetv2' --dataset 'CelebA' --prune_rate 0.9

Imagenet experiments:

python main_test.py --sensitive_group 'gender' --loss_type 'classes' --prune_type 'FairGRAPE' --network 'resnet34' --dataset 'Imagenet'  --prune_rate 0.5

Download trained modelshere.

Loading a trained model:

python main_test.py --sensitive_group 'gender' --loss_type 'race' --prune_type 'FairGRAPE' --network 'mobilenetv2'--dataset 'UTKFace'  --prune_rate 0.9 --keep_per_iter 0.975 --checkpoint "UTKFace_FairGRAPE_race_bygender_resnet34_0.9_0.pt" --init_train 0 --retrain 0 --print_acc 1

Acknowledgement

Parts of code were borrowed fromSNIP,WS,GraSP

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp