Skip to content

mariamashraf731/Debiasing-Facial-Detection-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 

Repository files navigation

βš–οΈ FairFace: Debiasing Facial Detection using DB-VAE

Python Framework Topic Model

πŸ“Œ Project Overview

FairFace is a Deep Learning project aimed at identifying and mitigating algorithmic bias in facial detection systems. Standard CNNs often perform poorly on underrepresented groups (e.g., darker skin tones or specific gender/age groups) due to dataset imbalance.

This project implements a Debiasing Variational Autoencoder (DB-VAE) to learn the latent structure of facial features and automatically re-weight training examples during learning, ensuring fair classification accuracy across all demographics.

βš™οΈ The Problem & Solution

  • The Bias: Models trained on skewed datasets (like CelebA) tend to learn features correlated with the majority class (e.g., Light Skin / Female), leading to high error rates for minorities.
  • The Fix (DB-VAE):
    1. Latent Learning: A VAE learns a low-dimensional representation of faces (Latent Space).
    2. Automated Re-sampling: The model identifies images in "sparse" regions of the latent space (underrepresented faces) and increases their sampling probability during training.
    3. Result: The classifier sees "hard" or "rare" examples more often, reducing bias without needing manual labeling of attributes.

πŸ› οΈ Technical Implementation

  • Architecture: Convolutional VAE (Encoder-Decoder) with a Classification Head.
  • Loss Function:
    • VAE Loss: Reconstruction Loss + KL Divergence (for latent learning).
    • Classification Loss: Cross-Entropy (for face detection).
  • Debiasing Algorithm: Adaptive re-sampling based on the estimated latent distribution $Q(z|x)$.

πŸš€ How to Run

  1. Clone the repository:
    git clone [https://github.com/mariamashraf731/FairFace-DBVAE.git](https://github.com/mariamashraf731/FairFace-DBVAE.git)
  2. Install Dependencies:
    pip install -r requirements.txt
  3. Run the Analysis:
    jupyter notebook notebooks/Debiasing_Facial_Detection.ipynb

πŸ‘¨β€πŸ’» Tech Stack

  • Language: Python
  • Deep Learning: TensorFlow / Keras
  • Concepts: Unsupervised Learning, VAEs, Latent Space Analysis, Algorithmic Fairness.

About

Mitigating algorithmic bias in facial detection systems using Debiasing Variational Autoencoders (DB-VAE). An implementation focusing on AI Fairness and latent space re-sampling.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors