How Facebook Uses Machine Learning

Ashish Kumar
6 min readOct 20, 2020

Machine Learning

Machine learning is an application of artificial intelligence (AI) that provides systems the ability to automatically learn and improve from experience without being explicitly programmed. Machine learning focuses on the development of computer programs that can access data and use it learn for themselves.

The process of learning begins with observations or data, such as examples, direct experience, or instruction, in order to look for patterns in data and make better decisions in the future based on the examples that we provide. The primary aim is to allow the computers learn automatically without human intervention or assistance and adjust actions accordingly.

Machine Learning in Facebook

  1. Facial Recognition

Facial Recognition is among the many wonders of Machine Learning on Facebook. It might be trivial for you to recognize your friends on social media (even under that thick layer of makeup!!!) but how does Facebook manage it? Well, if you have your “tag suggestions” or “face recognition” turned on in Facebook (this means you have provided permission for Facial Recognition), then the Machine Learning System analyses the pixels of the face in the image and creates a template which is basically a string of numbers. But this template is unique for every face (sort of a facial fingerprint!) and can be used to detect that face again in another face and suggest a tag.

So now the question is, What is the use of enabling Facial Recognition on Facebook? Well, in case any newly uploaded photo or video on Facebook includes your face but you haven’t been tagged, the Facial Recognition algorithm can recognize your template and send you a notification. Also, if another user tries to upload your picture as their Facebook profile picture (maybe to get more popular!), then you can be notified immediately. Facial Recognition in conjugation with other accessibility options can also inform people with visual impairments if they are in a photo or video.

2. Textual Analysis

While you may believe photos are the most important on Facebook (especially your photos!), the text is equally as important. And there is a lot of text on Facebook!!! To understand and manage this text in the correct manner, Facebook uses DeepText which is a text engine based on deep learning that can understand thousands of posts in a second in more than 20 languages with as much accuracy as you can!

But understanding a language-based text is not that easy as you think! In order to truly understand the text, DeepText has to understand many things like grammar, idioms, slang words, context, etc. For example: If there is a sentence “I love Apple” in a post, then does the writer mean the fruit or the company? Most probably it is the company (Except for Android users!) but it really depends on the context and DeepText has to learn this. Because of these complexities, and that too in multiple languages, DeepText uses Deep Learning and therefore it handles labeled data much more efficiently than traditional Natural Language Processing models.

3. Targeted Advertising

Did you just shop for some great clothes at Myntra and then saw their ads on your Facebook page? Or did you just like a post by Lakme and then magically see their ad also? Well, this magic is done using deep neural networks that analyze your age, gender, location, page likes, interests, and even your mobile data to profile you into select categories and then show you ads specifically targeted towards these categories. Facebook also partners with different data collection companies like Epsilon, Acxiom, Datalogix, BlueKai, etc. and also uses their data about you to accurately profile you.

For Example, Suppose that the data collected from your online interests, field of study, shopping history, restaurant choices, etc. profiles you in the category of young fashionista according to the Facebook deep neural networks algorithm. Then the ads you are shown will likely cater to this category so that you get the most relevant and useful ads that you are most likely to click. (So that Facebook generates more revenue of course!) In this way, Facebook hopes to maintain a competitive edge against other high-tech companies like Google who is also fighting to obtain our short attention spans!!!

4. Language Translation

Facebook is less a social networking site and more a worldwide obsession! There are people all over the world that use Facebook but many of them also don’t know English. So what should you do if you want to use Facebook but you only know Hindi? Never fear! Facebook has an in-house translator that simply converts the text from one language to another by clicking the “See Translation” button. And in case you wonder how it translates more or less accurately, well Facebook Translator uses Machine Learning of course!

The first click on the “See Translation” button for some text (Suppose it’s Beyonce’s posts) sends a translation request to the server and then that translation is cached by the server for other users (Who also require translation for Beyonce’s posts in this example). The Facebook translator accomplishes this by analyzing millions of documents that are already translated from one language to another and then looking for the common patterns and basic vocabulary of the language. After that, it picks the most accurate translation possible based on educated guesses that mostly turn out to be correct. For now, all languages are updated monthly so that the ML system is up to date on new slangs and sayings!

5. News Feed

The Facebook News Feed was one addition that everybody hated initially but now everybody loves!!! And if you are wondering why some stories show up higher in your Facebook News Feed and some are not even displayed, well here is how it works! Different photos, videos, articles, links or updates from your friends, family or businesses you like show up in your personal Facebook News Feed according to a complex system of ranking that is managed by a Machine Learning algorithm.

The rank of anything that appears in your News Feed is decided on three factors. Your friends, family, public figures or businesses that you interact with a lot are given top priority. Your feed is also customized according to the type of content you like (Movies, Books, Fashion, Video games, etc.) Also, posts that are quite popular on Facebook with lots of likes, comments and shares have a higher chance of appearing on your Facebook News Feed.

Thank you!!!!!

--

--