BC DS

Do you know what's better than a machine learning model?

Two models.

More than one model working together to solve a problem is called "an emsemble." A simple way to build this is having each model vote for an answer.

But there's a problem with this approach: ↓

I'm gonna focus here on image classification.

Let's assume you built two different models:

• Model 1: A ResNet model.
• Model 2: A one-shot model (Siamese network.)

They both solve the same problem, so you want to combine their results to pick the right answer.
The problem is that you have two models, so voting is not trivial.

What happens in this case?

• Model 1's answer: Class A
• Model 2's answer: Class B

Which one do you select?
Notice that this problem is not limited to an even number of models.

You could have 3 models, each giving you a different answer.

How do you decide which answer to choose?
There are multiple ways to approach this problem. I'll mention a few different ideas on this thread.

Important: Some of these ideas might not be feasible depending on your context. They have worked for me before on different situations, but every problem is different.
Here is a solution:

• Take 6 months' worth of data
• Compute the prior probability of every class
• Run the data through your ensemble
• Track the results of the models
• Use performance and priors to weight these results

Let's try to break these down.
The prior probability of each class tells us how likely we are to get one specific result from a model.

If I tell you that I saw a plane, you would believe me. But how about if I tell you I saw a UFO?

Planes have a higher chance of being the correct answer.
The second component is the performance of each model on every class.

For example, Model 1 might be really good at identifying planes, but Model 2 may constantly make mistakes.

This should tell us how much we should believe the results from each model.
A third component may be the score assigned by the model.

In the case of the ResNet model, the softmax probability. In the case of the one-shot model, the similarity score.
These three different features can help us evaluate each answer and decide which one is more likely to be correct.

The ensemble then becomes:

• Model 1
• Model 2
• Model 3 ← This one is the new model deciding which answer to pick.
Keep in mind that introducing a third model adds complexity to the system.

Sometimes, a simple heuristic might be a good enough solution.

It's our job to weigh the pros and cons. Better performance is just one side of the equation.
If you enjoy these threads, follow me @svpino as I help you deconstruct machine learning and turn it into Your Next Big Thing™.

Do you have any experience dealing with ensemble voting? Any other ideas that come to mind on how to tackle this problem?

More from Santiago

Free machine learning education.

Many top universities are making their Machine Learning and Deep Learning programs publicly available. All of this information is now online and free for everyone!

Here are 6 of these programs. Pick one and get started!



Introduction to Deep Learning
MIT Course 6.S191
Alexander Amini and Ava Soleimany

Introductory course on deep learning methods and practical experience using TensorFlow. Covers applications to computer vision, natural language processing, and more.

https://t.co/Uxx97WPCfR


Deep Learning
NYU DS-GA 1008
Yann LeCun and Alfredo Canziani

This course covers the latest techniques in deep learning and representation learning with applications to computer vision, natural language understanding, and speech recognition.

https://t.co/cKzpDOBVl1


Designing, Visualizing, and Understanding Deep Neural Networks
UC Berkeley CS L182
John Canny

A theoretical course focusing on design principles and best practices to design deep neural networks.

https://t.co/1TFUAIrAKb


Applied Machine Learning
Cornell Tech CS 5787
Volodymyr Kuleshov

A machine learning introductory course that starts from the very basics, covering all of the most important machine learning algorithms and how to apply them in practice.

https://t.co/hD5no8Pdfa

More from Ds

1/

Get a cup of coffee.

In this thread, I'll walk you through 2 probability concepts: Standard Deviation (SD) and Mean Absolute Deviation (MAD).

This will give you insight into Fat Tails -- which are super useful in investing and in many other fields.


2/

Recently, I watched 2 probability "mini-lectures" on YouTube by Nassim Taleb.

One ~10 min lecture covered SD and MAD. The other ~6 min lecture covered Fat Tails.

In these ~16 mins, @nntaleb shared so many useful nuggets that I had to write this thread to unpack them.

3/

For those curious, here are the YouTube links to the lectures:

SD and MAD (~10 min):
https://t.co/0TwubymdE6

Fat Tails (~6 min):

4/

The first thing to understand is the concept of a Random Variable.

In essence, a Random Variable is a number that depends on a random event.

For example, when we roll a die, we get a Random Variable -- a number from the set {1, 2, 3, 4, 5, 6}.

5/

Every Random Variable has a Probability Distribution.

This tells us all the possible values the Random Variable can take, and their respective probabilities.

For example, when we roll a fair die, we get a Random Variable with this Probability Distribution:

You May Also Like

The first ever world map was sketched thousands of years ago by Indian saint
“Ramanujacharya” who simply translated the following verse from Mahabharat and gave the world its real face

In Mahabharat,it is described how 'Maharishi Ved Vyasa' gave away his divine vision to Sanjay


Dhritarashtra's charioteer so that he could describe him the events of the upcoming war.

But, even before questions of war could begin, Dhritarashtra asked him to describe how the world looks like from space.

This is how he described the face of the world:

सुदर्शनं प्रवक्ष्यामि द्वीपं तु कुरुनन्दन। परिमण्डलो महाराज द्वीपोऽसौ चक्रसंस्थितः॥
यथा हि पुरुषः पश्येदादर्शे मुखमात्मनः। एवं सुदर्शनद्वीपो दृश्यते चन्द्रमण्डले॥ द्विरंशे पिप्पलस्तत्र द्विरंशे च शशो महान्।

—वेद व्यास, भीष्म पर्व, महाभारत


Meaning:-

हे कुरुनन्दन ! सुदर्शन नामक यह द्वीप चक्र की भाँति गोलाकार स्थित है, जैसे पुरुष दर्पण में अपना मुख देखता है, उसी प्रकार यह द्वीप चन्द्रमण्डल में दिखायी देता है। इसके दो अंशो मे पीपल और दो अंशो मे विशाल शश (खरगोश) दिखायी देता है।


Meaning: "Just like a man sees his face in the mirror, so does the Earth appears in the Universe. In the first part you see leaves of the Peepal Tree, and in the next part you see a Rabbit."

Based on this shloka, Saint Ramanujacharya sketched out the map, but the world laughed