2023-08
: Accepted to BMVC 2023
KFC: Kinship Verification with Fair Contrastive Loss and Multi-Task Learning aims to solve the kinship verification task while improving racial fairness. We utilize an attention module in our model and employ multi-task learning to enhance accuracy in kinship verification. Additionally, we have developed a new fair contrastive loss function and use gradient reversal to decrease the standard deviation among the four races (African, Asian, Caucasian, Indian).
Furthermore, we combine six kinship datasets (see below) to create a large kinship dataset. Moreover, we have annotated every identity in our dataset to include racial information.
$ git clone https://github.com/garynlfd/KFC.git
$ conda create --name KFC python=3.8
$ conda create activate KFC
$ pip install -r requirements.txt
./KFC
βββ train.py
βββ find.py
βββ test.py
βββ ...(other files)
βββ Cornell_Kin/
βββ UB_KinFace/
βββ KinFaceW-I/
βββ KinFaceW-II/
βββ Family101_150x120/
βββ Train(from FIW)/
βββ Validation(from FIW)/
βββ Test(from FIW)/
batch_size: default 25
sample: The folder in which the data should be placed, corresponding to data files folder
save_path: THe folder in which the ckpt will be saved, corresponding to log files folder
epochs: default 100
beta: temperature parameters default 0.08
log_path: name the log file
gpu: choose which gpu you want to use$ python train.py --batch_size 25 \ --sample ./data_files \ --save_path ./log_files \ --epochs 100 --beta 0.08 \ --log_path log_files/{file_name}.txt \ --gpu 1
Finding
sample: The folder in which the data should be placed, corresponding to data files folder
save_path: THe folder in which the ckpt will be saved, corresponding to log files folder
batch_size: default 50
log_path: name the log file
gpu: choose which gpu you want to use$ python find.py --sample ./data_files \ --save_path ./log_files \ --batch_size 50 \ --log_path log_files/{file_name}.txt \ --gpu 1
sample: The folder in which the data should be placed, corresponding to data files folder
save_path: THe folder in which the ckpt will be saved, corresponding to log files folder
threshold: the output value from find.py
batch_size: default 50
log_path: name the log file
gpu: choose which gpu you want to use$ python test.py --sample ./sample0 \ --save_path ./log_files \ --threshold {output value from find.py} \ --batch_size 50 \ --log_path log_files/{file_name}.txt \ --gpu 1
Our implementation uses code from the following repositories: