Skip to content

This repo contains all the code I used for my Honors Thesis. More information about my project/presentations on my website!

Notifications You must be signed in to change notification settings

ewingard/HonorsThesis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Code for The Impact of Biases within Facial Recognition Neural Networks

Within the respective folders are code pertaining to NN pre-trained models / scripts related to my Honors Thesis for SUNY Oswego's College Honors Program

The models folder contains pre-trained models

  • FairFace model/code: To run the FairFace script (predict.py), you must download the required models from Google Drive
    • The original filenames for the FairFace models within predict.py was not updated at the time of download (circa 2022), so there may be a discrepancy from the original source code located within the FairFace Github Page.
  • IRNv1 model/code: The predict_age_gender_race method draws directly from the FairFace code. All other code used within this script is original to the Author.
    • model used: VGGface2 pre-trained InceptionResNet v1 model taken from here
      • BE SURE TO DOWNLOAD THE PRE-TRAINED MODEL FROM THE ABOVE LINK TO RUN THE SCRIPT *

The misc_code folder contains misc scripts used to make my life easier.

  • Includes a ReadMe specifically for those scripts, and they were commented to help others read and use them.

RFiles - RScript / files used to analyse my data

  • thesis_analyses serves as the source code to actually provide analyses
  • .csv files within this folder are outputs from my thesis.

Datasets used within the honors thesis are not going to be added to this repo for ethics reasons.

In order to run the models, awareness / previous use of pytorch is preferred

Download pytorch and/or familiarize yourself with their docs

  • Pytorch's documentation is located here
  • Please also install dlib, PIL, numpy, pandas, os and more.
  • SPECIFICALLY FOR THE IRNv1 CODE: install face-net pytorch using the following pip command:
    • pip install facenet-pytorch
  • This facenet_pytorch package will give you access to the IRNv1 model as shown within the script.
  • If you want to get a different pre-trained model, please visit the following Github page for other InceptionResNet models and MTCNN models.

IMPORTANT THINGS TO NOTE

CITATIONS / REFERENCES TO CODE USED FOR INSPIRATION OR DIRECT USE

Karkkainen, K., & Joo, J. (2021). FairFace: Face Attribute Dataset for Balanced Race, Gender, and Age for Bias Measurement and Mitigation. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision (pp. 1548-1558).

Schroff, F., Kalenichenko, D., & Philbin, J. (2015). Facenet: A unified embedding for face recognition and clustering. In Proceedings of the IEEE conference on computer vision and pattern recognition (pp. 815-823).

Cao, Q., Shen, L., Xie, W., Parkhi, O., & Zisserman, A. (2017). VGGFace2: A dataset for recognising faces across pose and age.

About

This repo contains all the code I used for my Honors Thesis. More information about my project/presentations on my website!

Topics

Resources

Stars

Watchers

Forks