
Chernoff face - Pete_D
https://en.wikipedia.org/wiki/Chernoff_face
======
aecs99
I worked with Chernoff faces long time back and love how this is an
interesting way to visualize how discriminative your features are.

The idea is that you take features of your dataset, and use those to represent
a face. Say for example, you want to classify 100 people based on different
features. And let's say you've collected 15 features for each person (e.g.,
height, weight, shoulder width, length of first name, length of last name,
type of car driven, etc.). Now try mapping each of these features to Chernoff
faces. You'd map it in the following manner: height->area of face,
weight->shape of face, shoulder width->length of nose, length of first
name->location of mouth, length of last name->curve of smile, type of car
driven->width of mouth, etc.

Once you've mapped in that fashion and visualize the faces, you can observe
how discriminative your features are. How do you interpret this? If your
Chernoff faces tend to show a lot of variation in expression (e.g., smiling
vs. sad), you say the length of last name is more discriminative. On the other
hand, if the faces all appear to have same area, your first feature (i.e.,
height) is not very discriminative.

Other features used for Chernoff faces could be: location, separation, angle,
shape, and width of eyes; location, and width of pupil; location, angle, and
width of eyebrow, etc.

One drawback (as listed in the Wikipedia page) is that we humans perceive the
importance of these faces by the way in which variables are mapped to the
Chernoff facial features. If the feature mapping is not carefully chosen, your
largest varying feature may be ignored because we appreciated the change in
expression more than the change in eyebrow length.

~~~
amelius
> this is an interesting way to visualize how discriminative your features
> are.

I don't get why that is easier or more revealing than doing a principal
component analysis (?)

~~~
BjoernKW
Because recognising faces is an innate human ability while calculating
eigenvectors is not.

~~~
IshKebab
That's why we get computers to calculate eigenvectors and plot the result in a
nice graph that humans are fine at interpreting.

------
mysterypie
The Wikipedia example (Chernoff faces for lawyers' ratings of twelve judges)
would make a whole lot more sense if they mentioned what properties of the
judges were being mapped to which facial features.

Here are the Lawyers' Ratings of State Judges in the US Superior Court:

[https://www.rdocumentation.org/packages/datasets/versions/3....](https://www.rdocumentation.org/packages/datasets/versions/3.4.3/topics/USJudgeRatings)

And here is the R code:

    
    
      library(TeachingDemos)
      svg("Chernoff faces for evaluations of US judges.svg", height=6, width=8)
      faces2(USJudgeRatings[1:12,c(2:11,2:9)]/5-1, scale="none")
      dev.off()
    

Could someone who knows R and where to find the faces2() function give us a
legend (i.e., a table of judge's property to facial feature)? Maybe we can add
that into Wikipedia afterward too.

~~~
klmr
Thanks for finding this, the lack of explanation in the Wikipedia article was
driving me crazy. Here’s what the `TeachingDemos::faces2` documentation says
about the feature mapping:

> The features are: 1 Width of center 2 Top vs. Bottom width (height of split)
> 3 Height of Face 4 Width of top half of face 5 Width of bottom half of face
> 6 Length of Nose 7 Height of Mouth 8 Curvature of Mouth (abs < 9) 9 Width of
> Mouth 10 Height of Eyes 11 Distance between Eyes (.5-.9) 12 Angle of
> Eyes/Eyebrows 13 Circle/Ellipse of Eyes 14 Size of Eyes 15 Position
> Left/Right of Eyeballs/Eyebrows 16 Height of Eyebrows 17 Angle of Eyebrows
> 18 Width of Eyebrows

So there are 18 visually distinguishable features, and the code maps the
columns 2–9 redundantly to two features each, and columns 10–11 to one feature
each. I don’t understand how the scaling was chosen — the function requires
the values to be in the interval [0, 1] but since the original scores appear
to be in [0, 10], a more natural transformation would be to just divide by 10
instead of `x / 5 - 1`. Obviously these two transformations result in markedly
different faces.

If I find time later I’ll upload an updated plot that includes a legend.
Unfortunately that’s not easy since the `faces2` function overrides R’s plot
layout so there’s no space to fit the legend.

------
meagher
I made a Chernoff Fish generator with D3 & React a while back: [http://tmm-
archive.github.io/chernoff-fish/](http://tmm-archive.github.io/chernoff-fish/)

All the code is on GitHub: [https://github.com/tmm-archive/chernoff-
fish](https://github.com/tmm-archive/chernoff-fish)

------
domoritz
I suggest reading "Ross-Chernoff Glyphs Or: How Do We Kill Bad Ideas in
Visualization?" ([https://research.tableau.com/sites/default/files/altCHI-
prep...](https://research.tableau.com/sites/default/files/altCHI-
preprint.pdf)), a paper on why Chernoff faces are bad by taking them to the
extreme with Bob Ross.

~~~
brownbat
Great recommendation. It's snarky, but entertaining and raises some good
questions.

> Using a neural net... would be a useful way of generating custom Ross-
> Chernoff plots, and also allows me to include “deep learning” in the author
> keywords.

------
k__
Just read about this in Blindsight.

A vampire had hologram faces of tortured humans as graphs

~~~
shoo
Quoting from Peter Watts' book:
[http://www.rifters.com/real/Blindsight.htm](http://www.rifters.com/real/Blindsight.htm)

A sea of tortured faces, rotating in slow orbits around my vampire commander.

"My God, what is this?"

"Statistics." Sarasti seemed focused on a flayed Asian child. "Rorschach's
growth allometry over a two-week period."

"They're faces…"

He nodded, turning his attention to a woman with no eyes. "Skull diameter
scales to total mass. Mandible length scales to EM transparency at one
Angstrom. One hundred thirteen facial dimensions, each presenting a different
variable. Principle-component combinations present as multifeature aspect
ratios." He turned to face me, his naked gleaming eyes just slightly sidecast.
"You'd be surprised how much gray matter is dedicated to the analysis of
facial imagery. Shame to waste it on anything as—counterintuitive as residual
plots or contingency tables."

I felt my jaw clenching. "And the expressions? What do they represent?"

"Software customizes output for user."

------
asciimo
Reminds me of the Doom status bar face. Pretty straightforward when you're
visualizing one value.
[[http://doom.wikia.com/wiki/Status_bar_face](http://doom.wikia.com/wiki/Status_bar_face)]

------
gnarmis
Chernoff faces are pretty fun to play with too! A while back, I played with
it[1], and they do seem useful. I wonder if more realistic faces lead to
better utility as a at-a-glance data visualization tool?

[1]: [https://gnarmis.github.io/chernoff-
faces/](https://gnarmis.github.io/chernoff-faces/) \-- a simple toy

------
mrtksn
This is brilliant, can be better than pie charts in some cases.

For example, here are Chernoff Faces of some Turkish Universities:
[https://ibb.co/nFAoC7](https://ibb.co/nFAoC7)

The size of the eyes represents the number of projects submitted to
TUBITAK(Govt science body that coordinates and provides funding), the size of
the nose represents the number of projects that are accepted. The size of the
face is the number of professors in the institution and the size of the mouth
is the number of publications.

So, if you are looking for Turkish Universities that have lot's of accepted
projects look for a big nose. Big eyes and small nose will be an indicator for
a large number of failed applications and a face that has a huge mouth but
small nose and eyes is an indicator for an institution with lot's of
publishing going on without seeking funding to projects.

~~~
heavenlyblue
Why would you not use a series of bar charts for that?

------
sneak
As a prosopagnosiac, this is sort of like a feature in a firmware I don’t have
the license key to unlock.

------
NelsonMinar
Chernoff Faces are one of those HCI ideas that seem clever but have never
really worked great in practice. See also: pie menus, zoomable user
interfaces. At least those latter two show up occasionally in real products, I
don't think I've ever seen Chernoff Faces used in a final product.

------
dmazin
Can someone post examples? Most of the Wikipedia links are dead.

~~~
gwern
All of the links should be in the Internet Archive. (I wrote OP and the links
would've been included in my archive queue at the time.)

FWIW, as much as I liked the idea of Chernoff faces after running into them in
_Blindsight_, I was never able to find a productive use for them where they
were really all that much a better visualization than, say, a bunch of
scatterplots or fancier techniques like t-SNE.

~~~
k__
I think they could be good to detect small changes.

------
DanBC
The book _Computers, Pattern, Chaos, and Beauty_ has some nice examples of
Chernoff faces used to represent DNA sequences or characteristics of sound.

It's still available, and there are pirate versions if you want to try it
before buying it. It's a great book, it's chock full of odd ways to visualise
data.

~~~
DanBC
Here's an Imgur gallery from the book with a lot more info about these faces.

Chernoff Faces
[https://imgur.com/gallery/ES3in](https://imgur.com/gallery/ES3in)

------
JohnJamesRambo
What does it mean that the second faces in the top two rows are
indistinguishable? I guess maybe Burns is smiling a little more?

~~~
gnulinux
Their data are very similar, to the extent your brain can tell.

