Day 64 of 100DaysofML

Charan Soneji
100DaysofMLcode
Published in
5 min readAug 31, 2020

Data Mining Algorithms used by Instagram and Facebook. So very recently, I had a discussion with a few friends about how Instagram starts displaying ads based on a few keywords that we type or we speak whilst having a conversation. A lot of people who use Instagram might have noticed this — Ads pop up in between stories which are based on a conversation or a few keywords that you may have used. So I decided to do a bit of research and share my opinion in this blog.

Most of these social media platforms try to create an entire profile of you as a person. By profile, I mean everything ranging from your income to your sexual interests as well as your preferences on a wide number of topics. Instagram and Facebook both use extensive data mining algorithms to generate an incredibly detailed and accurate understanding of you as a person. Using these algorithms, it tries to generate a profile and displays ads in between stories.

Irony — “Instagram head Adam Mosseri promises the platform does not listen in on its users.”. Check out the below given link to read more about what the CEO actually had to say.

Let’s discuss more about the algorithm that they use or could be using. This was something I read of TechCrunch.

Instagram’s feed ranking criteria

Instagram relies on machine learning based on your past behavior to create a unique feed for everyone. Even if you follow the exact same accounts as someone else, you’ll get a personalized feed based on how you interact with those accounts.

Three main factors determine what you see in your Instagram feed:

  1. Interest: How much Instagram predicts you’ll care about a post, with higher ranking for what matters to you, determined by past behavior on similar content and potentially machine vision analyzing the actual content of the post.
  2. Recency: How recently the post was shared, with prioritization for timely posts over weeks-old ones.
  3. Relationship: How close you are to the person who shared it, with higher ranking for people you’ve interacted with a lot in the past on Instagram, such as by commenting on their posts or being tagged together in photos.

Similarly, Facebook works on a very similar concept. I mean technically, Facebook owns Instagram so a lot of its algos are implemented there.

So Facebook assigns a relevancy score which is different for each person or user based on what that person sees, the time that he/she sees and based on this, it sorts out the stories in the most relevant order for the user. The algorithm takes into account thousands of different signals.

Have a look at the above given picture which depicts an overview of the factors used in order to generate a relevancy score. Facebook also injects ads into the News Feed. These don’t replace any naturally visible post but instead just get injected in between them, pushing down the ones that come after. Facebook uses a similar but separate ranking algorithm to determine whether you’re likely to be interested in a Page or business’ ads. Facebook limits the number of ads you see, and therefore wants to maximize the likelihood that the ones it shows you will resonate with you or get you to click, since that’s how it earns more money. The more Facebook knows about you, the more relevant the ads will be. If you fill out your profile and Like the Pages of things you care about, Facebook’s ads will become more personalized and relevant, informing you about products, apps, events, and more that you’re truly interested in.

Usage of ML and Big Data for Ads and its Algorithms.

The data that Instagram and Facebook collect over users can only be made relevant after a good number of insights can be collected or extracted from it. By assessing the search preferences and engagement insights from its users, Instagram can sell advertising to companies who want to reach that particular customer profile and who might be most interested in receiving a particular marketing message. Since Facebook with 1.8 billion users owns Instagram they have a powerful network of analytics information to help target advertising based on what people like, who they follow and interact with and what they save.

About Instagram’s Recommendation Engine

Instagram Recommendation System is a rule-based personal assistant which can focus on broadening users’ access to content and switch from chronological feed to algorithmic one based on both topical relevance and personal relevance. This type of relevance is related to relevant searching and data mining which may include hardcore NLP or information retrieval.

In the Instagram recommendation system, the algorithm collects all the data of the example observations and analyzes it to discover the relationship which might not be observed by humans. The input representation includes both the attributes of each posts based on keywords and hashtag and the attributes of each audience, such as their ike, comment, share, and other attributes which reflect audience’s interaction with certain topics and certain posts. These inputs are then recorded by the system as data and sample and ranked according to relevance, therefore calculate the values to estimate by using the sample and data generate the output which has a numerical score that is a measure of how much the system believes that a particular audience will enjoy a particular post.

Picture shows how content is generated for the explore page on Instagram

Anyways, that’s it for today. Thanks for reading. Keep Learning.

Cheers.

--

--