-
-
EthiTech Website: Testing Photos and Recording Results
-
Example: Testing the Balanced Model
-
Stored Results for an Unbalanced Dataset: Notice Any Trends?
-
EthiTech Logo
-
-
-
HTML File Code: Part 1
-
HTML File Code: Part 2
-
HTML File Code: Part 3
-
HTML File Code: Part 4
-
HTML File Code: Part 5
-
Flask Code: Part 1
-
Flask Code: Part 2
-
ML Algorithm
Tracks
Activism, Education
Inspiration
Facial/image recognition software is becoming relevant in all walks of life, from locating and sentencing criminals to identifying health issues in patients. Unfortunately, however, many of these algorithms have been known to harbor unintentional racial bias. Clearly, as the impact and reach of machine learning and facial recognition grow, this ethical issue is something we should be aware of and understand. However, due to the subject's complexity, most members of the general public are either unaware of it, unsure what it means, or simply don't know how/if it can be solved.
EthiTech seeks to help solve this disconnect by creating an easily understood, beginner-accessible microcosm of the racial bias that occurs in large-scale facial recognition. Using EthiTech, laymen can test photos on real machine learning algorithms, record their research, and see for themselves how racial bias develops in algorithms.
What it does
EthiTech allows users to test out photos of their choice on two different machine learning models.
- A model trained on a balanced dataset (equal representation from each race)
- A model trained on an unbalanced dataset (10 times as many White individuals as individuals from any other race) These models will both attempt to predict the race of the individual in the photo, allowing the user to compare the results and determine what kinds of bias might have developed. The user can then easily record the results of these tests, storing them towards the bottom of the page in any desired string format.
In this way, EthiTech creates a convenient platform for users to conduct their own mini-experiments and ultimately gain a better understanding of how racial bias emerges in machine learning.
How I built it
Both machine learning models were created using the sci-kit learn MLP Classifier, a common algorithm for small-scale image classification, and trained on subsets of the UTKFace Dataset. They are designed to classify the individual in the image as either White, Black, East Asian, South Asian, or Other. Like most commercial facial recognition, this algorithm can be considered a 'black box,' meaning it develops its own methods of classification. Therefore, even the programmers do not know what exactly the algorithm is using to differentiate between races. NOTE: EthiTech does not take credit for all data pre-processing done on the two machine learning models.
The two models were then exported to pickles using the joblib library and integrated into a Python Flask program. From there, they could be displayed on the website using the render_template( ) function. The front end of the website consists of HTML, Bootstrap, and Javascript. It uses the tag to collect data from the user, including images files and test results.
Challenges I ran into
One of my primary challenges was finding a way for users to record the results of their tests on the website. I initially tried using a score-keeping method, and even attempted integrating PHP into the file. Ultimately, however, I found that the simplest solution was obtained through getElementByID( ).innerHMTL. Another thing I struggled with was connecting the front and back ends while still preserving the integrity of the models. This was solved by adding a processing step that condenses the user's images into usable data.
Accomplishments that I'm proud of
Creating a website that successfully applies machine learning! While I do have quite a bit of experience with WebDev, this is just the second time I've worked with a machine learning algorithm. Connecting all of the pieces took a lot of time (and research) and I am so thrilled that EthiTech eventually turned into a cohesive product!
What I learned
On the technical side? How Flask works as a tool for web development, how to "pickle" a machine learning model, and so, so much more. On the soft side? Trust in my abilities and lots of patience.
What's next for EthiTech
In the future, I would like to refine EthiTech's machine learning models by training them on more/better data, so that they can provide a more accurate depiction of real-world facial recognition. Another route could be to attempt a more complex/modern algorithm, such as the Keras convolutional neural network. I would also like to work on improving the user interface and adding more educational link/features.
Log in or sign up for Devpost to join the conversation.