Fairness and Word Embeddings in AI/ML
Fairness and Word Embeddings in AI/ML
AI/ML
Goal: Understand and apply basic AI/ML techniques to data scenarios, with a focus on
instituting “fair” practices when designing decision-making systems based on big data.
Number of publications on
fairness from 2011 to 2017
[Link]
[Link] facebook-apple-hiring-techlash/
fairness-in-machine-learning-3ff8ba1040cb
Fairness in AI/ML
Word
Embedding
(NLP)
⬣ Word embeddings are a set of techniques in natural language processing (NLP)
for identifying similarities between words in a corpus by using some type of
model to predict the co-occurence of words within a small chunk of text
⬣ Word embeddings transform human language meaningfully into a numerical
form. This allows computers to understand the nuances implicitly encoded into our
languages.
[Link]
microsofts-politically-
correct-chat-bot-is-
even-worse-than-its-
[Link] racist-one/
technology/2016/03/microsoft-terminates-its-
tay-ai-chatbot-after-she-turns-into-a-nazi/
[Link]
[Link]
Chocolate 0 1 0 1 0 0 2 0 1 0 1 0
Example
Document 1 Document 3
Document 2 Document 4
atlanta 1 1 0 0
similar
falcons 1 1 0 0
losangeles 0 0 1 1
similar
dodgers 0 0 1 1 ⬣ Document 1 : “atlanta falcons jerseys”
⬣ Document 2 : “atlanta falcons highlights”
⬣ Document 3 : “losangeles dodgers jerseys”
⬣ Document 4 : “losangeles dodgers highlights”
Falcons 2 0 1 1 0 0
Dodgers 0 0 1 1 0 2
similar
Los
0 0 0 0 2 0
Angeles
Vectors are quite similar Vectors are not similar Vectors are similar but
to each other opposite
Mathematically, cosine similarity measures the cosine of the angle between two vectors
projected in a multi-dimensional space, where the two vectors are the word vector as
mentioned previously.
Cosine Similarity
Atlanta 1 1 0 0
Falcons 1 1 0 0
Los Angeles 0 0 1 1
Dodgers 0 0 1 1
Thus, as claimed before, based on cosine similarity Atlanta is similar to Falcons and
Los Angeles is similar to Dodgers
Cosine Similarity
⬣ Word analogy problems have become one of the standard tools for
evaluating context-based word vectors.
⬣ The task consists of questions like “a is to b as c is to ______”
⬣ To solve the analogy problem, we need to find the word vector that is
most similar to the result vector of [c] + [b] – [a]
Word Embeddings
King Good
King
Awesome
- Man Bad
Queen
Man Worst
+ Woman
Queen
Woman
Examples
Vector Space Models
⬣ Two versions:
CBOW (continuous
bag of words) and
Skip-gram
Word2Vec Architecture
CBoW is a neural network that is trained to predict which word fits in a gap in a
sentence. For example, given the partial sentence “the student ___ the exam”, the
neural network predicts that “passed” has a high probability of filling the gap.
the
exam
1. eat|apple
Illustrative Corpus:
2. eat|orange
1. I like to eat apples
3. eat|rice
2. I like to eat oranges
4. drink|juice
3. I like to eat rice
5. drink|milk
4. I drink juice
6. drink|water
5. I drink milk
7. orange|juice
6. I drink water
8. apple|juice
7. I drink apple juice
9. rice|milk
8. I drink orange juice
10. milk|drink
9. I drink rice milk
11. water|drink
10. …
12. juice|drink
[Link]
[Link]
Using word2vec
Word: walk
Window size = 3 Window size = 30
espresso
A dapt ed f rom a c art oon by Dmit ry Malk ov, a dat a s c ient ist and c art oonis t at Dat a Mons t ers
Bias: word2vec
ht t ps : //www. [Link]/art icle/ 21316-a-i-doesn-t-get-black-t witt er-y et
Bias
ht t ps : //mot herboard. [Link]/
en_us / art icle/ j5jmj8/ google-
art if icial-intelligenc e-bias
Bias
h t t p s://[Link] stcomp an [Link]/3 01 02 23 /go og le -tr an sla te s-g en de r- pr ob lem-
a n d - b i n g- tra nsl ate s-a nd -systr an s h t t p s://www.b lo g.g oo gl e/ pr od ucts/tr an sla te/ re du cin g- ge nd er -
b i a s - g oo gl e- tra nsl ate /
Bias
0.0001%
h t t p s://[Link] gg le .com/c/g en de re d- pr on ou n-
h t t p s://[Link] tista .co m/st ati stics/5 07 85 8/ al ph ab et- go og le -r d- costs/ r e s o l u tio nh ttps: //[Link] gg le .co m/c/g e nd er ed -p ro no un -r eso lu tio n
For notes:
[Link]
8_MarcEtienneBrunet.pdf
Word Co-Occurrences
Bias in Embeddings
⬣ Cultural Biases
⬣ Biased Framings of Women
⬣ Ethnic Stereotypes
Garg, Nikhil, Schiebinger, Londa, Jurafsky, Dan, and Zou, James (2018). Word embeddings quantify 100
years of gender and ethnic stereotypes.
A=Male
B=Female
WEAT
1. Identify bias direction.
Non-bias
⬣ Calculate the difference between:
doctor
⬣ ehe - eshe
babysitter
⬣ emale - efemale
⬣ ....
bias
grandmother grandfather Average
Bolukbasi et. al., 2016. Man is to computer programmer as woman is to homemaker? Debiasing word embeddings
Bolukbasi et. al., 2016. Man is to computer programmer as woman is to homemaker? Debiasing word embeddings
Bolukbasi et. al., 2016. Man is to computer programmer as woman is to homemaker? Debiasing word embeddings
Bolukbasi et. al., 2016. Man is to computer programmer as woman is to homemaker? Debiasing word embeddings
Class Exercise
Facial
Recognition
Face Recognition
Example Applications:
⬣ Exam Identity Verification
⬣ Physical Building Access
⬣ Computer/Device Access
⬣ Passport Verification
⬣ Jail Management Systems and Booking
⬣ Law Enforcement Investigations
⬣ Photo Tagging in Facebook
⬣ Smartphone and App Access
Wang, Y., & Kosinski, M. (in press). Deep neural networks are more accurate than humans at
detecting sexual orientation from facial images. Journal of Personality and Social Psychology.
[Link]
to-find-late-passengers
[Link]
[Link]
law-enforcement-for-a-fistful-of-dollars
[Link]
Facial
Recognition
Algorithms
Timeline of Innovations
⬣ 1960s: Facial recognition is possible as
an application by joining the power of
computers with human skills
⬣ 1980s-90s: Advancements occurred in
the development of mapping and
recognition software
⬣ 2000s: Facial recognition became
integrated with surveillance applications
such as for law enforcement
⬣ 2010s: Faster, portable, more powerful
processors along with advancements in
deep learning
⬣ Face detection: to identify and
locate human faces in an image
regardless of their position,
scale, in plane rotation,
orientation, pose (out of plane
rotation), and illumination.
Face Recognition
In General
Face recognition algorithms “measure”
nodal points on the face such as the
distance between the eyes, the length of the
nose, and the angle of the jaw to identify
distinguishable features.
Features that usually do not change:
⬣ Upper ridges of the eye sockets
⬣ Nose shape
⬣ Size of the mouth
⬣ Positioning of major features relative to
each other
Face space is a theory
in psychology that
defines a
multidimensional
space in which
recognizable faces are
stored. The
representation of faces
within this space are
according to invariant
features of the face
itself.
[Link]
in-face-verification/
⬣ Happiness
⬣ Sadness
⬣ Anger
⬣ Fear
⬣ Disgust Surprise
22 Lip Funneler
Example - AUs
[Link]
/facial-recognition-software-emotional-science
[Link]
observation-techniques-spot-program
Issues with
Facial
Recognition
Algorithms
The perpetrator in the Boston Marathon bombing, whose image was in a
national database, was not recognized in video surveillance images. Why?
?
Dzhokhar Tsarnaev caught Dzhokhar drivers' licenses photo
by surveillance cameras in the Mass. DMV database
[Link]
bombing-manhunt/
Try it yourself!
Today’s facial recognition technology will reliably find this
photo in a mugshot database of controlled facial images
But in the wild, identification becomes problematic due to:
⬣ Resolution (not enough pixels)
⬣ Facial Pose – angulated
⬣ Illumination
⬣ Occluded facial areas
Resulting in:
⬣ Facial Feature Points (eyes, mouth, etc.) not found or distorted
⬣ Higher errors in Algorithm Measurements
⬣ Not Enough Data or Feature Points to Analze
Test suites,
e.g. [Link]
Clare Garvie, Alvaro M. Bedoya, Jonathan Frankle The Perpetual Line-up Unregulated Police Face
Recognition In America Georgetown Law Center on Privacy and Technology, October 18, 2016
[Link]
[Link]
[Link]
Predictive Algorithms
Typical Prediction Tasks
positive negative
Class = 1 Class = 0
Actual positive TP FN
Class = 1 f11 f10
Class negative FP TN
Class = 0 f01 f00
Performance Evaluation
Classification
Algorithms
Training
Data
Supervised Learning
⬣ Labels are provided and there is a strong
learning signal present between inputs
and outputs.
⬣ e.g. classification, regression.
Unsupervised learning
⬣ There is no direct learning signal or
obvious correlations between inputs and
outputs. We’re simply trying to find some
structure in the data.
⬣ e.g. clustering, dimensionality reduction
Supervised Learning
Classification Regression
⬣ Logistic Regression ⬣ Linear Regression
⬣ Naive Bayes ⬣ Decision Tree
⬣ Decision Tree ⬣ Random Forest
⬣ Random Forest
⬣ Neural Networks/Deep NN Unsupervised Learning
Clustering
⬣ K-means Clustering
(nurse) (doctor)
⬣ Data: 100 nurse images and 100 doctor images with labels of what is what.
!
{xi ,yi = 0}, i = 1,...,100
!
{x j ,y j = 1}, j = 1,...,200
where x represents the greyscale of the image pixels and
y=0 means “nurse” while y=1 means “doctor”
Supervised Learning
Clustering
⬣ Find the picture in the database which is closest to your query image
⬣ Check its label
⬣ Declare the class of your query image to be the same as that of the
closest picture.
decision
curve
Closest Image
Query
(doctor)
kNN Decision Surface
Clustering
Finding a group structure in the data
⬣ Data in one cluster is similar to each other
⬣ Data in different clusters is dissimilar
The class labels of training data is unknown
⬣ Given a set of measurements, observations, etc.
with the aim of establishing the existence of
classes or clusters in the data
Map each data point to a discrete cluster index
⬣ Centroid-based: Assume k clusters, guess at the
centers, assign points to nearest center
⬣ Hierarchical: Assume one cluster per point, and
repeatedly merge nearby clusters using some
distance threshold
Clustering
⬣ Learn face similarity from training pairs labeled as same/different
⬣ Cluster faces based on identity
Clustering Example
⬣ Example input database: Two numerical variables
⬣ How many groups are here?
Customer Demographics
Age Salary
100
90 20 40
80 25 50
Salary in $10K
70
60
24 45
50 Customers 23 50
40 40 80
30
20
45 85
10 42 87
0
0 20 40 60 80
35 82
Age
70 30
Clustering
Regression
⬣ Training set: faces (represented as vectors of distances between keypoints)
together with experimentally obtained attractiveness rankings
⬣ Learn: function to reproduce attractiveness ranking based on training inputs
and outputs
Vector of distances v
T. Leyvand, D. Cohen-Or, G. Dror, and D. Lischinski, Data-driven enhancement of facial attractiveness, SIGGRAPH
2008
Regression Example
[Link]
Consider the following regression
problem:
Generalization
⬣ Ockham’s razor: prefer
the simplest hypothesis
consistent with data
⬣ Similarity/continuity
bias: similar inputs
should have similar
outputs
Generalization
⬣ Models with too many ⬣ Models with too few parameters
parameters may fit the training may not fit the data well (high
data well (low bias), but are bias) but are consistent across
sensitive to choice of training set different training sets (low
(high variance) variance)
⬣ Generalization error is due to ⬣ Generalization error is due to
overfitting underfitting
Decision Trees
Attributes / Features
Attribute Values
Classes
NO YES
Training Data
NO
Married
Single, Divorced
TaxInc NO
< 80K > 80K
NO YES
NO
Married
Single, Divorced
TaxInc NO
< 80K > 80K
NO YES
NO
Married
Single, Divorced
TaxInc NO
< 80K > 80K
NO YES
NO
Married
Single, Divorced
TaxInc NO
< 80K > 80K
NO YES
NO
Married
Single, Divorced
TaxInc NO
< 80K > 80K
NO YES
Considerations
Crime Based
Predictive
Algorithms
in Use
[Link]
⬣ Algorithms identify
potential crime hot-
spots
⬣ Based on where
crime is previously
reported, not where it
is known to have
occurred
Predicting Policing
• Choose an address or zipcode (home, work place, …)
• E.g. 85 5th Street NW, Atlanta, GA 30308
• Enter into the Interactive Crime Map
• [Link]
• Enter into the Income Map
• [Link]
• Report Back
• Crime Layer (correlated with key) [E.g. Well above avg. (> 2x)]
• Income level [E.g. $80,132 ± $21,087]
• Majority Demographic [E.g. Nonwhite 53.3%]
⬣ 137-questions
questionnaire and
predictive model for "risk of
recidivism”
Criminal Recidivism
Supreme Court of Wisconsin (US)
Trade-Offs
[Link]
⬣ Leads to retaining more high risk offenders but also more low risk
offenders
Race
ZIP Code Forecast Forecast
Age Arrest No arrest
Prior Record RISK Actual 100
400
Gender Arrest False Negatives
Current Changes 300
Actual No
Recency of Crime False 300
Arrest
Positives
Age at First Arrest
……
Predictors
Judges release
50% of defendants
whose predicted
crime risk exceeds
60%
Judges’ Release Decisions vs. Machine Predictions and Crime Risk
Judges release
50% of defendants
whose predicted
crime risk exceeds
60%
Bunches of
bananas with
Bananas stickers on them
on shelves in a
store
Bananas in
a store
Why don’t we tend
Did any of you say to say yellow
Bunches of yellow bananas? bananas?
bananas
Yet, bananas have different attributes:
⬣ Yellow
⬣ Green
⬣ Spotty
Why then is Yellow considered the
prototypical attribute for bananas whereas
everything else needs a label added?
This is an example of human biases. And it
causes issues because it means the data
that’s fed into our algorithms is labeled in this
biased way as well.
⬣ Reporting Bias
⬣ Selection Bias
⬣ Stereotypical Bias
⬣ Historical Biases
There is also the biases present in the collection of data as discussed earlier
[Link]
[Link]