Santiago Profile picture
13 Feb, 17 tweets, 7 min read
It takes a single picture of an animal for my son to start recognizing it everywhere.

Neural networks aren't as good as we are, but they are good enough to be competitive.

This is a thread about neural networks and bunnies.

🧵👇
A few days ago, I discussed how networks identify patterns and use them to extract meaning from images.

Let's start this thread right from where we ended that conversation.



(2 / 16)
Let's assume we use these four pictures to train a neural network. We tell it that they all contain a bunny 🐇.

Our hope is for the network to learn features that are common to these images.

(3 / 16)
It's reasonable to think that the network will find the following:

▫️ There's an eye
▫️ There's fur
▫️ There are long ears

The neural network's understanding of a "bunny" will become the combination of "eye + fur + long ears."

(4 / 16)
At this point, I'm obligated to disclose that neural networks don't technically focus on high-level concepts like "eyes" or "ears" because they don't know about such things.

But don't let facts get in the middle of a good story.

😉

(5 / 16)
There's something else in these pictures that will likely get picked up by the network.

See all of that green grass?

If these are all the pictures that we use to train our network, I'm sure the grass will be a strong indicator.

Ridiculous, right?

(6 / 16)
Neural networks don't know better.

They are incapable of focusing on what we know to be relevant.

They generalize by finding common patterns, and we all agree that grass is very prominent in all four pictures.

(7 / 16)
How do we solve this problem?

How do we teach our network to focus on the stuff that matters and discard what doesn't?

One way is by showing it more pictures.

(8 / 16)
What would happen if we now show the attached image to the network?

There's still an eye, fur, and long ears. But there's no grass!

Internally, the network will start decreasing the importance of the presence of green grass.

(9 / 16)
Four more pictures later, and the grass is probably not a relevant feature anymore.

Most of the images don't have grass or anything green, so the network will learn to ignore those patterns.

The eyes, ears, and fur are still very relevant!

(10 / 16)
In this thread, I've been taking advantage of your capacity to recognize high-level concepts to explain how neural networks work.

In reality, there's a lot of variability in "eyes," "ears," and "fur." We need many images to "teach" those concepts to a network.

(11 / 16)
The more specific we want to get with our classification, the harder it will be for the network.

Look at these two pictures. Recognizing the bunny is not hard, but what if we wanted to differentiate these pictures by their species?

(12 / 16)
Personally, I don't know if these bunnies are from the same species, but assuming they aren't, high-level concepts (eyes, ears, fur) will not be enough.

We need more specificity, and our network will require many more images to identify relevant patterns.

(13 / 16)
A common question I get:

"How many images do I need?"

At this point, the answer may be obvious: "It depends."

To identify a bunny apart from an elephant, we need fewer images than to classify bunnies based on their individual species.

(14 / 16)
The more visually complex your problem is, the more likely it is that you'll need more images to achieve proper generalization.

Every situation is different.

(15 / 16)
A couple of notes before closing:

1. The goal of this thread is to build intuitions, not to be factually correct about the technical details of how neural networks work.

2. There are different techniques to interpret images. Not all of them require a lot of data.

(16 / 16)
If you enjoy these attempts to make machine learning a little more intuitive, follow me and let me know below what I should be covering in my next thread.

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Santiago

Santiago Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @svpino

14 Feb
A collection of the most interesting threads I've written about machine learning.

🧵 x 🧵
Read 13 tweets
11 Feb
Today let's talk about why we keep "splitting the data" into different sets.

Besides machine learning people being quirky, what else is going on here?

Grab your coffee ☕️, and let's do it!

🧵👇
Imagine you are teaching a class.

Your students are getting ready for the exam, and you give them 100 answered questions, so they prepare.

You now need to design the exam.

What's the best way to evaluate the students?

(2 / 19)
If you evaluate the students on the same questions you gave them to prepare, you'll reward those who just memorized the questions.

That won't give you a good measure of how much they learned.

😑

(3 / 19)
Read 21 tweets
10 Feb
Interviews aren't broken.

A lot of people complain about them, yet few have any experience hiring.

This is a rant full of my own biases and limited perspective —a break from machine learning threads.

🧵👇
Building a team is incredibly hard.

Building a good team is even more challenging.

Building a good, diverse team is a nightmare.

👇
Imagine you are starting a new company and you need a couple of developers.

▫️ Where do you find them?
▫️ How do you know they are any good?
▫️ How much do you pay them?

How do you make somebody come and work for you, a nobody?

👇
Read 25 tweets
9 Feb
Seriously though, how the heck can a computer recognize what's in an image?

Grab a coffee ☕️, and let's talk about one of the core ideas that makes this possible.

(I'll try to stay away from the math, I promise.)

👇
If you are a developer, spend a few minutes trying to think about a way to solve this problem:

→ Given an image, you want to build a function that determines whether it shows a person's face.

2/ Image
It gets overwhelming fast, right?

What are you going to do with all of these pixels?

3/
Read 27 tweets
7 Feb
Everything you need to know about the batch size when training a neural network.

(Because it really matters, and understanding it makes a huge difference.)

A thread.
Gradient Descent is an optimization algorithm to train neural networks.

The algorithm computes how much we need to adjust the model to get closer to the results we want on every iteration.

2/
We take samples from the training dataset, run them through the model, and determine how far away our results are from the ones we expect.

We call this "error," and using it, we compute how much we need to update the model weights to improve the results.

3/
Read 19 tweets
5 Feb
The one million dollar question:

"Is it reasonable for someone to dive into machine learning with a shallow knowledge of math?"

▫️ The short answer is "yes."
▫️ The more nuanced answer is "it depends."

Let me try and unpack this question for you.

🧵👇 Image
You can think about machine learning as a spectrum that goes all the way from pure research to engineering.

The more you move towards a research position, the more you can benefit from your math knowledge. If you move in the other direction, you'll get away with less of it.

👇
I have friends that got a Ph.D. and became college professors.

For them, math is an absolute requirement!

Not only are they working on research projects, but they are teaching the next generation of scientists and engineers.

👇
Read 11 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!