Photo by Ravi Sharma on Unsplash
Twitter shows preview images of shared images. If the aspect ratio is not the wanted one, the image needs to be cropped for the preview.
The way the cropping is done is supposedly not random. People seem to think that it is “smart” in the sense that it chooses an interesting or reasonable part of the image. Maybe a crop is chosen that maximizes clicks.
So far, so good. But now there is this:
You might not be able to see it, but there are two times two images: One of Senator McConnell and one of the former president Obama. Twitter chose to show McConnell for both images.
The German comedian Abdelkarim pointed out that Twitter preferably shows blonde people:
There are many tweets like this. For many, the impression seems to be that this bias towards some pictures is racist.
Are white people shown more often than black people in Twitter previews?
The follow-up tweets are for sure very interesting and indicate that there could be an issue. From an outsider’s perspective, it’s pretty hard to tell. Twitter certainly receives many thousands of images and creates previews for them. A reasonable objective for a company is to maximize clicks. For example, Twitter could simply change the preview image depending on the user. This would mean that Twitter tries to estimate which users click more often on which types of images. If the user clicks more often on white people, then it shows white people more often.
I’m not saying that this is what happens, but it could be.
Let’s assume it’s not. Let’s assume everybody sees the same preview images in all cases. Then you could still optimize globally for click rates. If the Twitter population clicks more often on white people, the Twitter population gets to see white people.
Biased Data Leads to Biased Results
In 2016, the Guardian published a very related article about an AI judging beauty and preferring white people: A beauty contest was judged by AI and the robots didn’t like dark skin
There is a key takeaway in this article:
Machine Learning systems need data. If the data has issues, the Machine Learning system has issues.
The AI was trained on a dataset with few black people. The generalization the machine learning algorithm took from that is that being black does not correlate well with winning this contest. Which is correct. The gap where it becomes problematic is that it was used to judge “objective” beauty. It’s a machine, it can’t be biased. Right?
Bias and Racism
This for sure is interesting trivia, but does it have a bigger effect? Is the effect of less exposure on Twitter even negative?
It’s weird for sure, and it should be fixed. I wouldn’t call it racist, though. In my opinion, it’s very unlikely that some Twitter developers had the evil master plan to harm black people by preferring to show white people in case two image crops are possible. Calling this racist distracts from the many real racist cases we have seen in the past few months. Events where one knows that the actors were aware of the effects their actions can have. Events where the effect was death.
A software developer writing a slightly smarter algorithm for image cropping than just taking a random crop is not racist. If this assessment is correct, it’s simply sloppy work.
I’ve also tried this myself by uploading an image with the four Teletubbies. You could now be outraged that it shows a white-only image or just conclude that the algorithm is pretty bad:
What can we do against biased AI products?
One simple reason why the algorithm might be biased is class imbalance. This can also be combined with a mismatch of the training data compared to the production data. One class is just represented way more often in the training dataset. One technique to deal with more frequent classes is to over-sample the less frequent ones or to under-sample the more frequent ones. This means the algorithm gets to see the training data of the under-represented class more often.
Very often, it is also possible to find application-specific solutions. For example, Twitter could simply not show preview images at all. Or show a random crop. Letting the user choose the crop would also be an option. Google also chose a drastic option when they faced bias issues in a machine learning product: Google’s solution to accidental algorithmic racism: ban gorillas
Post-processing is another option. If you notice that two candidates for good crops both contain faces, flip a coin which face to show. You can also try to be super smart about it, recognize famous people, and rank them according to their number of hashtags/mentions in the last 24 hours.
There are way more things to consider. If you’re interested, I encourage you to read one of the following articles.
See also
- Jiayuan Huang, Alexander J. Smola, Arthur Gretton, Karsten M. Borgwardt, Bernhard Schölkopf: Correcting Sample Selection Bias by Unlabeled Data
- Jaspreet Sandhu: Understanding and Reducing Bias in Machine Learning
- Salma Ghoneim: 5 Types of bias & how to eliminate them in your machine learning project