Official implementation of Protected Attribute Suppression System, ICCV 2021

Related tags

Deep LearningPASS
Overview

Introduction

This repository contains the source code for training PASS-g and PASS-s using features from a pre-trained model.

BibTeX:

@InProceedings{Dhar_Gleason_2021_ICCV,
    author    = {Dhar, Prithviraj and Gleason, Joshua and Roy, Aniket and Castillo, Carlos D. and Chellappa, Rama},
    title     = {{PASS}: Protected Attribute Suppression System for Mitigating Bias in Face Recognition},
    booktitle = {Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV)},
    month     = {October},
    year      = {2021},
    pages     = {15087-15096}
}

Running The Code

Requirements are defined in requirements.txt and may be installed in a new virtual environment using

pip install -r requirements.txt

An example configuration is defined in config/config_template.yaml.

In the config file set TYPE:'race' for PASS-s or TYPE:'gender' for PASS-g.

Required Input Files

Training features (train.py)

This file should be provided in the TRAIN_BIN_FEATS and VAL_BIN_FEATS config entries. Must be a binary file. Given a numpy array of N 512-dimensional features you can create this file using the following snippet (note we assume binary file created with same byte order as system used to train)

import numpy as np
import struct

# feat = ... (load features into np.ndarray of shape [N, 512])
# ...

with open('input_features.bin', 'wb') as f:
    f.write(struct.pack('i', np.int32(N)))
    f.write(struct.pack('i', np.int32(512)))
    np.ascontiguousarray(feat).astype(np.float32).tofile(f)

Training metadata (train.py)

This file should be provided in the TRAIN_META and VAL_META config entries. This CSV file must contain information about each training feature (one-to-one corresponding) and must contain the following columns:

SUBJECT_ID,FILENAME,RACE,PR_MALE
  • SUBJECT_ID is an integer corresponding to subject
  • FILENAME is original filename that feature was extracted from (not used currently)
  • RACE is an integer representing a BUPT class label between 0 and 3 with {0: asian, 1: caucasian, 2: african, 3: indian}
  • PR_MALE is a float between 0 and 1 representing probability that subject is male

Note that for PASS-g RACE may be omitted and for PASS-s PR_MALE may be omitted.

Test features (inference.py)

CSV file containing features to perform debiasing on after training is finished with following columns:

SUBJECT_ID,FILENAME,DEEPFEATURE_1,...,DEEPFEATURE_512

where DEEPFEATURE_* contains the value of the input feature at the specified dimension.


To run PASS training execute

python train.py

To generate debiased features, select the desired checkpoint file and update CHECKPOINT_FILE in the config then run

python inference.py
Owner
Prithviraj Dhar
Prithviraj Dhar
Python package to add text to images, textures and different backgrounds

nider Python package for text images generation and watermarking Free software: MIT license Documentation: https://nider.readthedocs.io. nider is an a

Vladyslav Ovchynnykov 131 Dec 30, 2022
Source code for Acorn, the precision farming rover by Twisted Fields

Acorn precision farming rover This is the software repository for Acorn, the precision farming rover by Twisted Fields. For more information see twist

Twisted Fields 198 Jan 02, 2023
PyDeepFakeDet is an integrated and scalable tool for Deepfake detection.

PyDeepFakeDet An integrated and scalable library for Deepfake detection research. Introduction PyDeepFakeDet is an integrated and scalable Deepfake de

Junke, Wang 49 Dec 11, 2022
The aim of the game, as in the original one, is to find a specific image from a group of different images of a person's face

GUESS WHO Main Links: [Github] [App] Related Links: [CLIP] [Celeba] The aim of the game, as in the original one, is to find a specific image from a gr

Arnau - DIMAI 3 Jan 04, 2022
Code release for Local Light Field Fusion at SIGGRAPH 2019

Local Light Field Fusion Project | Video | Paper Tensorflow implementation for novel view synthesis from sparse input images. Local Light Field Fusion

1.1k Dec 27, 2022
Final report with code for KAIST Course KSE 801.

Orthogonal collocation is a method for the numerical solution of partial differential equations

Chuanbo HUA 4 Apr 06, 2022
A sketch extractor for anime/illustration.

Anime2Sketch Anime2Sketch: A sketch extractor for illustration, anime art, manga By Xiaoyu Xiang Updates 2021.5.2: Upload more example results of anim

Xiaoyu Xiang 1.6k Jan 01, 2023
Code release for Universal Domain Adaptation(CVPR 2019)

Universal Domain Adaptation Code release for Universal Domain Adaptation(CVPR 2019) Requirements python 3.6+ PyTorch 1.0 pip install -r requirements.t

THUML @ Tsinghua University 229 Dec 23, 2022
An ML & Correlation platform for transforming disparate data points of interest into usable intelligence.

SSIDprobeCollector An ML & Correlation platform for transforming disparate data points of interest into usable intelligence. At a High level the platf

Bill Reyor 1 Jan 30, 2022
《LXMERT: Learning Cross-Modality Encoder Representations from Transformers》(EMNLP 2020)

The Most Important Thing. Our code is developed based on: LXMERT: Learning Cross-Modality Encoder Representations from Transformers

53 Dec 16, 2022
Enhancing Knowledge Tracing via Adversarial Training

Enhancing Knowledge Tracing via Adversarial Training This repository contains source code for the paper "Enhancing Knowledge Tracing via Adversarial T

Xiaopeng Guo 14 Oct 24, 2022
Kalidokit is a blendshape and kinematics solver for Mediapipe/Tensorflow.js face, eyes, pose, and hand tracking models

Blendshape and kinematics solver for Mediapipe/Tensorflow.js face, eyes, pose, and hand tracking models.

Rich 4.5k Jan 07, 2023
CasualHealthcare's Pneumonia detection with Artificial Intelligence (Convolutional Neural Network)

CasualHealthcare's Pneumonia detection with Artificial Intelligence (Convolutional Neural Network) This is PneumoniaDiagnose, an artificially intellig

Azhaan 2 Jan 03, 2022
Segmentation vgg16 fcn - cityscapes

VGGSegmentation Segmentation vgg16 fcn - cityscapes Priprema skupa skripta prepare_dataset_downsampled.py Iz slika cityscapesa izrezuje haubu automobi

6 Oct 24, 2020
This repo contains code to reproduce all experiments in Equivariant Neural Rendering

Equivariant Neural Rendering This repo contains code to reproduce all experiments in Equivariant Neural Rendering by E. Dupont, M. A. Bautista, A. Col

Apple 83 Nov 16, 2022
Diabet Feature Engineering - Predict whether people have diabetes when their characteristics are specified

Diabet Feature Engineering - Predict whether people have diabetes when their characteristics are specified

Şebnem 6 Jan 18, 2022
Classification Modeling: Probability of Default

Credit Risk Modeling in Python Introduction: If you've ever applied for a credit card or loan, you know that financial firms process your information

Aktham Momani 2 Nov 07, 2022
Automated Attendance Project Using Face Recognition

dependencies for project: cmake 3.22.1 dlib 19.22.1 face-recognition 1.3.0 openc

Rohail Taha 1 Jan 09, 2022
Official implementation of "Robust channel-wise illumination estimation"

This repository provides the official implementation of "Robust channel-wise illumination estimation." accepted in BMVC (2021).

Firas Laakom 4 Nov 08, 2022
The PyTorch implementation of Directed Graph Contrastive Learning (DiGCL), NeurIPS-2021

Directed Graph Contrastive Learning The PyTorch implementation of Directed Graph Contrastive Learning (DiGCL). In this paper, we present the first con

Tong Zekun 28 Jan 08, 2023