-: Hello, and welcome back to the course on deep learning.
Today we're kicking off convolutional neural networks.
This is gonna be exciting.
Let's dive straight into it.
We're going to start off with an image.
What do you see when you look at this image?
Do you see a person looking at you,
or do you see a person looking to the right?
You can see that your brain is struggling to adjust.
If you look to the right side of the image,
just look at the right border of the image,
you'll see a person looking to the right.
If you look at the left border of the image,
you'll see a person looking at you.
And this just proves that what our brain is looking
for when we see things is features.
Depending on the features that it sees,
depending on the features that you process,
you categorize things in certain ways.
So when you look on the right side of the image,
you see certain features of a person looking to the right,
because they're closer to your center of focus.
And therefore, your brain classifies that
as a person looking to the right.
When you look to the left side of the image,
you see more features of a person looking at you,
and therefore your brain classifies it as such.
So let's have a look at another one.
This is a very famous image.
You probably have already seen it, but what do you see here?
So, some people will say
that they see a young lady wearing a dress looking away.
Some people will say they see an old lady, wearing a scarf
on her head, looking down.
So I'm gonna point these features out,
and you'll see that'll become very obvious.
So, this is the face of the young lady looking away.
She's looking into the distance.
That's her coat, that's her hair,
that's her little feather in her hair.
And on the other hand, this is the head
of the old lady looking down.
That's her nose, that's her mouth, that's her chin.
That's the scarf on her head, and she's looking down.
So as you can see, two in one, and depending
on which features your brain picks up, it will switch
between classifying the image as one or the other.
The oldest one of these illusions recorded
in the printed work is this one.
It's the duck or the rabbit.
So, is this a duck or is this a rabbit?
Another example.
And now I'm gonna show you an image which will just,
for a second, just look at it and see what emotions,
or what kind of visual experience you go through.
So, what do you see?
Do you feel a bit, not dizzy, but a bit dazzled?
Like your brain is trying to understand what
it is, like it's trying to, it's jumping
between her eyes, the up and down eyes.
And this is a classic example of when there are
certain features where it could be this, it could be that,
but your brain cannot decide.
And because both seem plausible.
Yeah, so, basically all these examples illustrate
to us how the brain works,
that it processes certain features
on an image, or on whatever you see in real life,
and it classifies that as such.
And you've probably been in situations when you look
over your shoulder quickly and you see something,
you think it's, I don't know if it's like a ball,
but it turns out to be a cat, or you think it's a car,
but it turns out to be a shadow, and things like that.
That's because you don't have enough time
to process those features, or you don't have enough features
to classify things as such.
And this is, for me, this is very interesting,
because what we are going to be doing with neural networks,
with convolution neural networks, is very similar.
And you'll find that the way that computers are going to
be processing images is going to be extremely similar
to the way we are processing images.
So it's very valuable to understand,
and just kind of remember these things,
that this is how we do it.
And I'm going to take this lady off your screens
because she's probably already freaking you out by now.
So here's something different.
Here's an experiment.
An experiment done on computers,
on convolutional neural networks.
So we're slowly moving now from humans to computers.
And this slide is from a (indistinct) by Geoffrey Hinton.
And here you have, basically it describes an experiment
that he had done on some convolutional neural networks
that he had trained up.
So here you see three images,
and we're gonna go through them left to right,
and see how you would classify them,
and then see how the computer classified them.
So on the left, what do you think this is?
You probably said cheetah, and you will be right.
And this is what the computer said.
So, right away, right off the bat,
we're going to learn how to read these images,
because if you're going to go deep
into convolutional neural networks, no pun intended,
if you're going to start learning more and more about them
and using them, you'll see a lot of these.
And I've actually seen people read them incorrectly.
So here at the top, cheetah is what it actually is.
So that's the actual correct label of the image.
That's what the label of the image is,
regardless of any processing and computer vision.
And then here are the guesses.
The top four, or five sometimes, guesses of the algorithm,
and they're given the probability.
So the computer said, or the neural network said,
cheetah, leopard, snow leopard, or Egyptian cat can
be one of the four, and cheetah has the highest vote.
And throughout this part of the course,
you'll understand what these votes mean
and how they're derived.
But for now, it's pretty intuitive, right?
So it's a cheetah in reality.
And the neural network guessed right, it said
with a high probability of about, like, 95, 99%,
it's a cheetah.
Then the second one, what do you think is it that is?
That is a bullet train.
And the neural network was able to distinguish
between bullet train, passenger car, subway, train,
those are the top choices,
of course it had many more options.
These neural networks learn to distinguish
from not just four categories,
from dozens, thousands of categories at the same time.
So those are the four options that it picked.
And so that's bullet train, and it's a bullet train.
So what do you think the last one is?
There are a couple of options
where it's not very clear what it is.
It could be a frying pan, it could be a magnifying glass,
it could be even maybe a pair of scissors, some might say.
Well, the neural network said it was a pair of scissors.
But you can see how you can go wrong here.
First of all, it's not a very clear image,
and also you can see that the probabilities
are not as clear here.
So the neural network was a bit confused,
a bit indecisive, just as we are.
So it said scissors was the highest probability,
but then it had hand glass, which it actually was,
not so far away on the second place,
and frying pan, stethoscope.
So basically, here you can see that scissors
was its first guess, but the correct option was number two,
and that's why it's colored in red.
So there we go, that's what neural networks
are already capable of, and this is actually quite
an old slide, this was several years ago,
now they're even better.
And you will see that from the practical application
that you'll be coding together with (indistinct).
But now let's try to understand
a bit better what convo nets,
or convolutional neural networks actually are,
and why are they gaining so much popularity.
And they actually are gaining popularity,
so you can see here a Google trends comparison
I did just yesterday.
Here you can see that convolutional neural networks
are even taking over artificial neural networks.
So a massive increase,
and they're just gonna keep going that way
because it is a very important field,
that is where all the things happen,
such as self-driving cars,
how do they recognize people on the road,
how to recognize stop signs and things like that.
How is Facebook able to tag images or people in images?
And not only just like, remember previously years ago,
you had to tag people yourself?
Then it would recognize faces, you had to add the names,
and now it just recognizes the faces
and adds the names at the same time.
Well, that is what convolutional neural networks
are capable of.
And speaking of Facebook,
if Geoffrey Hinton is the godfather
of artificial neural networks and deep learning,
then Yann LeCun is the grandfather
of convolutional neural networks.
Yann LeCun is a student of Geoffrey Hinton's.
And in fact, here, you can see them together.
And Geoffrey Hinton now is pioneering deep learning
at Google.
Yann LeCun is the director of Facebook
artificial intelligence research,
and also a professor at NYU.
So slowly we're, I love this part of the course,
slowly we're building up these names,
or this kind of picture of the profiles
of the people who are driving this field.
And in the next couple of parts we'll get to know about
a few more and we'll have this whole mafia
as they call themselves, or Yann LeCun calls them,
mafia, or conspiracy of deep learning.
And you'll learn a bit more
about how this whole field developed.
And yeah, these are just some great, great people.
And so, Yann LeCun back in the 80s
and the 90s made significant contributions
to the field of convolutional neural networks.
And as we'll see throughout this course,
has been able to develop, or help the world develop,
something so extremely powerful.
So, moving onto how convolution neural networks work.
You have an input.
It's very simple, it's very straightforward.
So you have an input image,
it goes through the convolutional neural network,
and you have an output label, so it classifies that image
as something like as a cheetah, or a bullet train,
or something else.
Now, going into a bit more detail.
For instance, after a neural network has been trained up
on certain images, on certain classified images,
or images that have been categorized prior.
After that you can give it,
let's say a neural network has been trained
up to recognize facial expressions, emotions.
You can give it a face of a smiling person.
Not just a face, like a drawing of a face, like this,
but actual face of a person smiling,
and it'll tell you that that person is happy.
And you can give a face of a person that's frowning,
it will tell you that that person is sad.
You can recognize these emotions.
And as you can see, that's already very powerful
in terms of so many different applications,
just of this one example you can think of right away.
And, and in both cases it'll give you a probability.
So it won't say, you know,
with a hundred percent the person's happy or sad,
it'll be 99, or 98, or maybe 80%
when it's unclear of what's going on.
And just like we are, right?
Sometimes we can mistake things for what they're not.
Or sometimes it's just not clear
if the person is smiling or frowning,
or if it's a dog a cat,
or if it's a train or a bullet train, right?
Sometimes we haven't seen enough features.
And it all goes down to features,
because that's how we process visual information,
as we saw from the start of this tutorial.
So, how is a neural network able
to recognize these features?
Well, it all starts at the very basic level.
You have, let's say you have an image, you have two images.
One is a black and white image of two by two pixels,
and one is a colored image of two by two pixels.
Well, neural networks leverage the fact
that the black and white image is a two-dimensional array.
So the way we see it right now on the left
is just the visual representation, right?
So it's some kind of picture,
and for simplicity's sake it's just a two by two picture.
But in computer terms, it's actually a two-dimensional array
with every single one of those pixels having a value
between zero and 255.
So that's eight bits of information,
two to the power of eight is 256.
So therefore, the values are from zero to 255.
And that's the intensity of the color.
And in this case, the color white.
So zero will be a completely black pixel,
255 will be a completely white pixel,
and between them you have the grayscale range
of possible options for this pixel.
And based on that information,
computers are able to then work with the image,
and that's kind of like the starting point
that any image actually has a digital representation,
has a digital form.
And those are just basically ones and zeros
that form a number, zero to 255 for every single pixel.
And that's what the computer works with.
It doesn't actually work with, you know,
the colors or anything, it works with the ones
and zeros at the end of the day,
that's kind of like the foundation of it all.
And in a colored image,
it's actually a three-dimensional array.
You've got a blue layer, a green layer, and a red layer.
And in that sense, for RGB, red, green, blue,
and each one of those colors has its own intensity.
So basically, a pixel has three values assigned to it.
Each one of them is between zero and 256, 255.
And therefore you can find out what this image,
what color exactly this pixel is,
by combining those three values.
And again, computers are going to be working with that.
So that's the foundation of it all.
That's the red channel, the green channel, the blue channel.
And finally, let's have a look at, for instance,
an example, a very trivial example,
of a smiling face in computer terms.
If we just really simplify things instead
of having from zero to 255, in terms of having those values,
just so that we can understand things better
and really grasp the concepts,
we're going to say zero is white, one is black, right?
So we're just going to simplify things to the extreme
and you'll see that that image can be represented like that.
So the reason why we've brought this up is
because we're going to, in all of our intuition tutorials
we're gonna to structure on images like this
which are very simple, but at the same time,
then all those concepts can translate back
to the zero to 256 range of values,
and everything applies the same way there.
And the steps that we're going to be going
through with these images are step number one, convolution,
step number two, max pooling, step number three, flattening,
and step number four, full connection.
And I can imagine that probably none
of these words mean much to you at the moment,
but by the end of this section of the course,
you will understand them in great detail
and exactly what they're doing.
So we'll get started on the next tutorial.
For now, the additional reading that you might want to look
into is Yann LeCun's original paper
that gave the rise to convolutional neural networks,
it's called Gradient-Based Learning Applied
to Document Recognition.
You may have seen this image before,
floating around the internet, it is from that paper.
So if you wanna go back to the very beginnings
of how it all happened, where it all came from,
this is the paper to look into.
And I look forward to seeing you on the next tutorial.
Until then, enjoy deep learning.