1. Home
  2. Explore
  3. Computer Science
  4. CNN Architectures

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

CNN Architectures

Transcript

- All right welcome to lecture nine. So today we will be talking about CNN Architectures. And just a few administrative points before we get started, assignment two is due Thursday. The mid term will be in class on Tuesday May ninth, so next week and it will cover material through Tuesday through this coming Thursday May fourth. So everything up to recurrent neural networks are going to be fair game. The poster session we've decided on a time, it's going to be Tuesday June sixth from twelve to three p.m. So this is the last week of classes. So we have our our poster session a little bit early during the last week so that after that, once you guys get feedback you still have some time to work for your final report which will be due finals week.

Okay, so just a quick review of last time. Last time we talked about different kinds of deep learning frameworks. We talked about you know PyTorch, TensorFlow, Caffe2 and we saw that using these kinds of frameworks we were able to easily build big computational graphs, for example very large neural networks and comm nets, and be able to really easily compute gradients in these graphs. So to compute all of the gradients for all the intermediate variables weights inputs and use that to train our models and to run all this efficiently on GPUs

And we saw that for a lot of these frameworks the way this works is by working with these modularized layers that you guys have been working writing with, in your home works as well where we have a forward pass, we have a backward pass, and then in our final model architecture, all we need to do then is to just define all of these sequence of layers together. So using that we're able to very easily be able to build up very complex network architectures. So today we're going to talk about some specific kinds of CNN Architectures that are used today in cutting edge applications and research. And so we'll go into depth in some of the most commonly used architectures for these that are winners of ImageNet classification benchmarks. So in chronological order AlexNet, VGG net, GoogLeNet, and ResNet. And so these will go into a lot of depth. And then I'll also after that, briefly go through some other architectures that are not

as prominently used these days, but are interesting either from a historical perspective, or as recent areas of research. Okay, so just a quick review. We talked a long time ago about LeNet, which was one of the first instantiations of a comNet that was successfully used in practice. And so this was the comNet that took an input image, used com filters five by five filters applied at stride one and had a couple of conv layers, a few pooling layers and then some fully connected layers at the end. And this fairly simple comNet was very successfully applied to digit recognition.

So AlexNet from 2012 which you guys have also heard already before in previous classes, was the first large scale convolutional neural network that was able to do well on the ImageNet classification task so in 2012 AlexNet was entered in the competition, and was able to outperform all previous non deep learning based models by a significant margin, and so this was the comNet that started the spree of comNet research and usage afterwards. And so the basic comNet AlexNet architecture is a conv layer followed by pooling layer, normalization, com pool norm,

and then a few more conv layers, a pooling layer, and then several fully connected layers afterwards. So this actually looks very similar to the LeNet network that we just saw. There's just more layers in total. There is five of these conv layers, and two fully connected layers before the final fully connected layer going to the output classes. So let's first get a sense of the sizes involved in the AlexNet. So if we look at the input to the AlexNet this was trained on ImageNet, with inputs at a size 227 by 227 by 3 images. And if we look at this first layer which is a conv layer for the AlexNet, it's 11 by 11 filters, 96 of these applied at stride 4. So let's just think about this for a moment. What's the output volume size of this first layer?

And there's a hint. So remember we have our input size, we have our convolutional filters, ray. And we have this formula, which is the hint over here that gives you the size of the output dimensions after applying com right? So remember it was the full image, minus the filter size, divided by the stride, plus one. So given that that's written up here for you 55, does anyone have a guess at what's the final output size after this conv layer? [student speaks off mic] - So I had 55 by 55 by 96, yep. That's correct.

Right so our spatial dimensions at the output are going to be 55 in each dimension and then we have 96 total filters so the depth after our conv layer is going to be 96. So that's the output volume. And what's the total number of parameters in this layer? So remember we have 96 11 by 11 filters. [student speaks off mic] - [Lecturer] 96 by 11 by 11, almost. So yes, so I had another by three, yes that's correct. So each of the filters is going to see through a local region of 11 by 11 by three, right because the input depth was three. And so, that's each filter size, times we have 96 of these total. And so there's 35K parameters in this first layer.

Okay, so now if we look at the second layer this is a pooling layer right and in this case we have three three by three filters applied at stride two. So what's the output volume of this layer after pooling? And again we have a hint, very similar to the last question. Okay, 27 by 27 by 96. Yes that's correct.

Right so the pooling layer is basically going to use this formula that we had here. Again because these are pooling applied at a stride of two so we're going to use the same formula to determine the spatial dimensions and so the spatial dimensions are going to be 27 by 27, and pooling preserves the depth. So we had 96 as depth as input, and it's still going to be 96 depth at output. And next question. What's the number of parameters in this layer?

I hear some muttering. [student answers off mic] - Nothing. Okay. Yes, so pooling layer has no parameters, so, kind of a trick question. Okay, so we can basically, yes, question? [student speaks off mic] - The question is, why are there no parameters in the pooling layer? The parameters are the weights right, that we're trying to learn. And so convolutional layers have weights that we learn but pooling all we do is have a rule, we look at the pooling region, and we take the max. So there's no parameters that are learned. So we can keep on doing this and you can just repeat the process and it's kind of a good exercise to go through this and figure out the sizes, the parameters, at every layer.

And so if you do this all the way, you can look at this is the final architecture that you can work with. There's 11 by 11 filters at the beginning, then five by five and some three by three filters. And so these are generally pretty familiar looking sizes that you've seen before and then at the end we have a couple of fully connected layers of size 4096 and finally the last layer, is FC8 going to the soft max, which is going to the 1000 ImageNet classes.

And just a couple of details about this, it was the first use of the ReLu non-linearity that we've talked about that's the most commonly used non-linearity. They used local response normalization layers basically trying to normalize the response across neighboring channels but this is something that's not really used anymore. It turned out not to, other people showed that it didn't have so much of an effect. There's a lot of heavy data augmentation, and so you can look in the paper for more details, but things like flipping, jittering, cropping, color normalization all of these things which you'll probably find useful for you when you're working on your projects for example, so a lot of data augmentation here. They also use dropout batch size of 128, and learned with SGD with momentum which we talked about in an earlier lecture, and basically just started with a base learning rate of 1e negative 2.

Every time it plateaus, reduce by a factor of 10 and then just keep going. Until they finish training and a little bit of weight decay and in the end, in order to get the best numbers they also did an ensembling of models and so training multiple of these, averaging them together and this also gives an improvement in performance. And so one other thing I want to point out is that if you look at this AlexNet diagram up here, it looks kind of like the normal comNet diagrams that we've been seeing, except for one difference, which is that it's, you can see it's kind of split in these two different rows or columns going across.

And so the reason for this is mostly historical note, so AlexNet was trained on GTX580 GPUs older GPUs that only had three gigs of memory. So it couldn't actually fit this entire network on here, and so what they ended up doing, was they spread the network across two GPUs. So on each GPU you would have half of the neurons, or half of the feature maps. And so for example if you look at this first conv layer, we have 55 by 55 by 96 output, but if you look at this diagram carefully, you can zoom in later in the actual paper, you can see that, it's actually only 48 depth-wise, on each GPU, and so they just spread it, the feature maps, directly in half.

And so what happens is that for most of these layers, for example com one, two, four and five, the connections are only with feature maps on the same GPU, so you would take as input, half of the feature maps that were on the the same GPU as before and you don't look at the full 96 feature maps for example. You just take as input the 48 in that first layer. And then there's a few layers so com three, as well as FC six, seven and eight, where here are the GPUs do talk to each other and so there's connections with all feature maps in the preceding layer. so there's communication across the GPUs, and each of these neurons are then connected to the full depth of the previous input layer. Question. - [Student] It says the full simplified AlexNetwork architecture. [mumbles]

- Oh okay, so the question is why does it say full simplified AlexNet architecture here? It just says that because I didn't put all the details on here, so for example this is the full set of layers in the architecture, and the strides and so on, but for example the normalization layer, there's other, these details are not written on here. And then just one little note, if you look at the paper and try and write out the math and architectures and so on, there's a little bit of an issue on the very first layer they'll say if you'll look in the figure they'll say 224 by 224 , but there's actually some kind of funny pattern going on and so the numbers actually work out if you look at it as 227.

AlexNet was the winner of the ImageNet classification benchmark in 2012, you can see that it cut the error rate by quite a large margin. It was the first CNN base winner, and it was widely used as a base to our architecture almost ubiquitously from then until a couple years ago. It's still used quite a bit. It's used in transfer learning for lots of different tasks and so it was used for basically a long time, and it was very famous and now though there's been some more recent architectures that have generally just had better performance and so we'll talk about these next and these are going to be the more common architectures that you'll be wanting to use in practice.

So just quickly first in 2013 the ImageNet challenge was won by something called a ZFNet. Yes question. [student speaks off mic] - So the question is intuition why AlexNet was so much better than the ones that came before, DefLearning comNets [mumbles] this is just a very different kind of approach in architecture. So this was the first deep learning based approach first comNet that was used.

So in 2013 the challenge was won by something called a ZFNet [Zeller Fergus Net] named after the creators. And so this mostly was improving hyper parameters over the AlexNet. It had the same number of layers, the same general structure and they made a few changes things like changing the stride size, different numbers of filters and after playing around with these hyper parameters more, they were able to improve the error rate. But it's still basically the same idea. So in 2014 there are a couple of architectures that were now more significantly different and made another jump in performance, and the main difference with these networks first of all was much deeper networks. So from the eight layer network that was in 2012 and 2013, now in 2014 we had two very close winners

that were around 19 layers and 22 layers. So significantly deeper. And the winner of this was GoogleNet, from Google but very close behind was something called VGGNet from Oxford, and on actually the localization challenge VGG got first place in some of the other tracks. So these were both very, very strong networks. So let's first look at VGG in a little bit more detail. And so the VGG network is the idea of much deeper networks and with much smaller filters.

So they increased the number of layers from eight layers in AlexNet right to now they had models with 16 to 19 layers in VGGNet. And one key thing that they did was they kept very small filter so only three by three conv all the way, which is basically the smallest com filter size that is looking at a little bit of the neighboring pixels. And they just kept this very simple structure of three by three convs with the periodic pooling all the way through the network. And it's very simple elegant network architecture, was able to get 7.3% top five error on the ImageNet challenge.

So first the question of why use smaller filters. So when we take these small filters now we have fewer parameters and we try and stack more of them instead of having larger filters, have smaller filters with more depth instead, have more of these filters instead, what happens is that you end up having the same effective receptive field as if you only have one seven by seven convolutional layer. So here's a question, what is the effective receptive field of three of these three by three conv layers with stride one? So if you were to stack three three by three conv layers with Stride one what's the effective receptive field, the total area of the input, spatial area of the input that enure at the top layer of the three layers is looking at.

So I heard fifteen pixels, why fifteen pixels? - [Student] Okay, so the reason given was because they overlap-- - Okay, so the reason given was because they overlap. So it's on the right track. What actually is happening though is you have to see, at the first layer, the receptive field is going to be three by three right? And then at the second layer, each of these neurons in the second layer is going to look at three by three other first layer filters, but the corners of these three by three

have an additional pixel on each side, that is looking at in the original input layer. So the second layer is actually looking at five by five receptive field and then if you do this again, the third layer is looking at three by three in the second layer but this is going to, if you just draw out this pyramid is looking at seven by seven in the input layer. So the effective receptive field here is going to be seven by seven. Which is the same as one seven by seven conv layer. So what happens is that this has the same effective receptive field as a seven by seven conv layer but it's deeper. It's able to have more non-linearities in there, and it's also fewer parameters. So if you look at the total number of parameters, each of these conv filters for the three by threes is going to have nine parameters in each conv [mumbles]

three times three, and then times the input depth, so three times three times C, times this total number of output feature maps, which is again C is we're going to preserve the total number of channels. So you get three times three, times C times C for each of these layers, and we have three layers so it's going to be three times this number, compared to if you had a single seven by seven layer then you get, by the same reasoning, seven squared times C squared. So you're going to have fewer parameters total, which is nice.

So now if we look at this full network here there's a lot of numbers up here that you can go back and look at more carefully but if we look at all of the sizes and number of parameters the same way that we calculated the example for AlexNet, this is a good exercise to go through, we can see that you know going the same way we have a couple of these conv layers and a pooling layer a couple more conv layers, pooling layer, several more conv layers and so on. And so this just keeps going up.

And if you counted the total number of convolutional and fully connected layers, we're going to have 16 in this case for VGG 16, and then VGG 19, it's just a very similar architecture, but with a few more conv layers in there. And so the total memory usage of this network, so just making a forward pass through counting up all of these numbers so in the memory numbers here written in terms of the total numbers, like we calculated earlier, and if you look at four bytes per number, this is going to be about 100 megs per image, and so this is the scale of the memory usage that's happening and this is only for a forward pass right, when you do a backward pass you're going to have to store more and so this is pretty heavy memory wise. 100 megs per image, if you have on five gigs of total memory, then you're only going to be able to store about 50 of these.

And so also the total number of parameters here we have is 138 million parameters in this network, and this compares with 60 million for AlexNet. Question? [student speaks off mic] - So the question is what do we mean by deeper, is it the number of filters, number of layers? So deeper in this case is always referring to layers. So there are two usages of the word depth which is confusing one is the depth rate per channel, width by height by depth, you can use the word depth here, but in general we talk about the depth of a network, this is going to be the total number of layers in the network, and usually in particular we're counting the total number of weight layers. So the total number of layers with trainable weight, so convolutional layers and fully connected layers. [student mumbles off mic]

- Okay, so the question is, within each layer what do different filters need? And so we talked about this back in the comNet lecture, so you can also go back and refer to that, but each filter is a set of let's say three by three convs, so each filter is looking at a, is a set of weight looking at a three by three value input input depth, and this produces one feature map, one activation map of all the responses of the different spatial locations.

And then we have we can have as many filters as we want right so for example 96 and each of these is going to produce a feature map. And so it's just like each filter corresponds to a different pattern that we're looking for in the input that we convolve around and we see the responses everywhere in the input, we create a map of these and then another filter will we convolve over the image and create another map. Question. [student speaks off mic]

- So question is, is there intuition behind, as you go deeper into the network we have more channel depth so more number of filters right and so you can have any design that you want so you don't have to do this. In practice you will see this happen a lot of the times and one of the reasons is people try and maintain kind of a relatively constant level of compute, so as you go higher up or deeper into your network, you're usually also using basically down sampling and having smaller total spatial area and then so then they also increase now you increase by depth a little bit, it's not as expensive now to increase by depth because it's spatially smaller and so, yeah that's just a reason. Question. [student speaks off mic]

- So performance-wise is there any reason to use SBN [mumbles] instead of SouthMax [mumbles], so no, for a classifier you can use either one, and you did that earlier in the class as well, but in general SouthMax losses, have generally worked well and been standard use for classification here. Okay yeah one more question. [student mumbles off mic]

- Yes, so the question is, we don't have to store all of the memory like we can throw away the parts that we don't need and so on? And yes this is true. Some of this you don't need to keep, but you're also going to be doing a backwards pass through ware for the most part, when you were doing the chain rule and so on you needed a lot of these activations as part of it and so in large part a lot of this does need to be kept. So if we look at the distribution of where memory is used and where parameters are, you can see that a lot of memories in these early layers right where you still have spatial dimensions you're going to have more memory usage and then a lot of the parameters are actually in the last layers, the fully connected layers have a huge number of parameters right, because we have all of these dense connections. And so that's something just to know and then

keep in mind so later on we'll see some networks actually get rid of these fully connected layers and be able to save a lot on the number of parameters. And then just one last thing to point out, you'll also see different ways of calling all of these layers right. So here I've written out exactly what the layers are. conv3-64 means three by three convs with 64 total filters. But for VGGNet on this diagram on the right here there's also common ways that people will look at each group of filters, so each orange block here, as in conv1 part one, so conv1-1, conv1-2, and so on. So just something to keep in mind.

So VGGNet ended up getting second place in the ImageNet 2014 classification challenge, first in localization. They followed a very similar training procedure as Alex Krizhevsky for the AlexNet. They didn't use local response normalization, so as I mentioned earlier, they found out this didn't really help them, and so they took it out. You'll see VGG 16 and VGG 19 are common variants of the cycle here, and this is just the number of layers, 19 is slightly deeper than 16.

In practice VGG 19 works very little bit better, and there's a little bit more memory usage, so you can use either but 16 is very commonly used. For best results, like AlexNet, they did ensembling in order to average several models, and you get better results. And they also showed in their work that the FC7 features of the last fully connected layer before going to the 1000 ImageNet classes. The 4096 size layer just before that, is a good feature representation, that can even just be used as is, to extract these features from other data, and generalized these other tasks as well. And so FC7 is a good feature representation.

Yeah question. [student speaks off mic] - Sorry what was the question? Okay, so the question is what is localization here? And so this is a task, and we'll talk about it a little bit more in a later lecture on detection and localization so I don't want to go into detail here but it's basically an image, not just classifying What's the class of the image, but also drawing a bounding box around where that object is in the image. And the difference with detection, which is a very related task is that detection there can be multiple instances of this object in the image localization we're assuming there's just one, this classification but we just how this additional bounding box.

So we looked at VGG which was one of the deep networks from 2014 and then now we'll talk about GoogleNet which was the other one that won the classification challenge. So GoogleNet again was a much deeper network with 22 layers but one of the main insights and special things about GoogleNet is that it really looked at this problem of computational efficiency and it tried to design a network architecture that was very efficient in the amount of compute. And so they did this using this inception module which we'll go into more detail and basically stacking a lot of these inception modules on top of each other.

There's also no fully connected layers in this network, so they got rid of that were able to save a lot of parameters and so in total there's only five million parameters which is twelve times less than AlexNet, which had 60 million even though it's much deeper now. It got 6.7% top five error. So what's the inception module? So the idea behind the inception module is that they wanted to design a good local network typology and it has this idea of this local topology that's you know you can think of it as a network within a network and then stack a lot of these local typologies one on top of each other. And so in this local network that they're calling an inception module what they're doing is they're basically applying several different kinds of filter operations

in parallel on top of the same input coming into this same layer. So we have our input coming in from the previous layer and then we're going to do different kinds of convolutions. So a one by one conv, right a three by three conv, five by five conv, and then they also have a pooling operation in this case three by three pooling, and so you get all of these different outputs from these different layers, and then what they do is they concatenate all these filter outputs together depth wise, and so then this creates one tenser output at the end that is going tom pass on to the next layer.

So if we look at just a naive way of doing this we just do exactly that we have all of these different operations we get the outputs we concatenate them together. So what's the problem with this? And it turns out that computational complexity is going to be a problem here. So if we look more carefully at an example, so here just for as an example I've put one by one conv, 128 filter so three by three conv 192 filters, five by five convs and 96 filters. Assume everything has basically the stride that's going to maintain the spatial dimensions, and that we have this input coming in.

So what is the output size of the one by one filter with 128 , one by one conv with 128 filters? Who has a guess? OK so I heard 28 by 28, by 128 which is correct. So right by one by one conv we're going to maintain spatial dimensions and then on top of that, each conv filter is going to look through the entire 256 depth of the input, but then the output is going to be, we have a 28 by 28 feature map for each of the 128 filters that we have in this conv layer. So we get 28 by 28 by 128.

OK and then now if we do the same thing and we look at the filter sizes of the output sizes sorry of all of the different filters here, after the three by three conv we're going to have this volume of 28 by 28 by 192 right after five by five conv we have 96 filters here. So 28 by 28 by 96, and then out pooling layer is just going to keep the same spatial dimension here, so pooling layer will preserve it in depth, and here because of our stride, we're also going to preserve our spatial dimensions.

And so now if we look at the output size after filter concatenation what we're going to get is 28 by 28, these are all 28 by 28, and we concatenating depth wise. So we get 28 by 28 times all of these added together, and the total output size is going to be 28 by 28 by 672. So the input to our inception module was 28 by 28 by 256, then the output from this module is 28 by 28 by 672.

So we kept the same spatial dimensions, and we blew up the depth. Question. [student speaks off mic] OK So in this case, yeah, the question is, how are we getting 28 by 28 for everything? So here we're doing all the zero padding in order to maintain the spatial dimensions, and that way we can do this filter concatenation depth-wise. Question in the back. [student speaks off mic]

- OK The question is what's the 256 deep at the input, and so this is not the input to the network, this is the input just to this local module that I'm looking at. So in this case 256 is the depth of the previous inception module that came just before this. And so now coming out we have 28 by 28 by 672, and that's going to be the input to the next inception module. Question. [student speaks off mic] - Okay the question is, how did we get 28 by 28 by 128 for the first one, the first conv, and this is basically it's a one by one convolution right, so we're going to take this one by one convolution slide it across our 28 by 28 by 256 input spatially

where it's at each location, it's going to multiply, it's going to do a [mumbles] through the entire 256 depth, and so we do this one by one conv slide it over spatially and we get a feature map out that's 28 by 28 by one. There's one number at each spatial location coming out, and each filter produces one of these 28 by 28 by one maps, and we have here a total 128 filters, and that's going to produce 28 by 28, by 128.

OK so if you look at the number of operations that are happening in the convolutional layer, let's look at the first one for example this one by one conv as I was just saying at each each location we're doing a one by one by 256 dot product. So there's 256 multiply operations happening here and then for each filter map we have 28 by 28 spatial locations, so that's the first 28 times 28 first two numbers that are multiplied here. These are the spatial locations for each filter map, and so we have to do this to 25 60 multiplication each one of these then we have 128 total filters at this layer, or we're producing 128 total feature maps. And so the total number of these operations here is going to be 28 times 28 times 128 times 256.

And so this is going to be the same for, you can think about this for the three by three conv, and the five by five conv, that's exactly the same principle. And in total we're going to get 854 million operations that are happening here. - [Student] And the 128, 192, and 96 are just values [mumbles] - Question the 128, 192 and 256 are values that I picked. Yes, these are not values that I just came up with. They are similar to the ones that you will see in like a particular layer of inception net, so in GoogleNet basically, each module has a different set of these kinds of parameters, and I picked one that was similar to one of these.

And so this is very expensive computationally right, these these operations. And then the other thing that I also want to note is that the pooling layer also adds to this problem because it preserves the whole feature depth. So at every layer your total depth can only grow right, you're going to take the full featured depth from your pooling layer, as well as all the additional feature maps from the conv layers and add these up together. So here our input was 256 depth and our output is 672 depth and you're just going to keep increasing this as you go up.

So how do we deal with this and how do we keep this more manageable? And so one of the key insights that GoogleNet used was that well we can we can address this by using bottleneck layers and try and project these feature maps to lower dimension before our our convolutional operations, so before our expensive layers. And so what exactly does that mean? So reminder one by one convolution, I guess we were just going through this but it's taking your input volume, it's performing a dot product at each spatial location and what it does is it preserves spatial dimension but it reduces the depth and it reduces that by projecting your input depth to a lower dimension. It just takes it's basically like a linear combination of your input feature maps.

And so this main idea is that it's projecting your depth down and so the inception module takes these one by one convs and adds these at a bunch of places in these modules where there's going to be, in order to alleviate this expensive compute. So before the three by three and five by five conv layers, it puts in one of these one by one convolutions. And then after the pooling layer it also puts an additional one by one convolution. Right so these are the one by one bottleneck layers that are added in. And so how does this change the math that we were looking at earlier? So now basically what's happening is that we still have the same input here 28 by 28 by 256, but these one by one convs are going to reduce the depth dimension and so you can see before the three by three convs, if I put a one by one conv with 64 filters, my output from that is going to be, 28 by 28 by 64.

So instead of now going into the three by three convs afterwards instead of 28 by 28 by 256 coming in, we only have a 28 by 28, by 64 block coming in. And so this is now reducing the smaller input going into these conv layers, the same thing for the five by five conv, and then for the pooling layer, after the pooling comes out, we're going to reduce the depth after this. And so, if you work out the math the same way for all of the convolutional ops here, adding in now all these one by one convs on top of the three by threes and five by fives, the total number of operations is 358 million operations, so it's much less than the 854 million that we had in the naive version, and so you can see how you can use this one by one conv, and the filter size for that to control your computation. Yes, question in the back. [student speaks off mic]

- Yes, so the question is, have you looked into what information might be lost by doing this one by one conv at the beginning. And so there might be some information loss, but at the same time if you're doing these projections you're taking a linear combination of these input feature maps which has redundancy in them, you're taking combinations of them, and you're also introducing an additional non-linearity after the one by one conv, so it also actually helps in that way with adding a little bit more depth and so, I don't think there's a rigorous analysis of this, but basically in general this works better and there's reasons why it helps as well. OK so here we have, we're basically using these one by one convs to help manage our computational complexity, and then what GooleNet does is it takes these

inception modules and it's going to stack all these together. So this is a full inception architecture. And if we look at this a little bit more detail, so here I've flipped it, because it's so big, it's not going to fit vertically any more on the slide. So what we start with is we first have this stem network, so this is more the kind of vanilla plain conv net that we've seen earlier [mumbles] six sequence of layers. So conv pool a couple of convs in another pool just to get started and then after that we have all of our different our multiple inception modules all stacked on top of each other, and then on top we have our classifier output. And notice here that they've really removed the expensive fully connected layers it turns out that the model works great without them, even and you reduce a lot of parameters. And then what they also have here is,

you can see these couple of extra stems coming out and these are auxiliary classification outputs and so these are also you know just a little mini networks with an average pooling, a one by one conv, a couple of fully connected layers here going to the soft Max and also a 1000 way SoftMax with the ImageNet classes. And so you're actually using your ImageNet training classification loss in three separate places here. The standard end of the network, as well as in these two places earlier on in the network, and the reason they do that is just this is a deep network and they found that having these additional auxiliary classification outputs, you get more gradient

training injected at the earlier layers, and so more just helpful signal flowing in because these intermediate layers should also be helpful. You should be able to do classification based off some of these as well. And so this is the full architecture, there's 22 total layers with weights and so within each of these modules each of those one by one, three by three, five by five is a weight layer, just including all of these parallel layers, and in general it's a relatively more carefully designed

architecture and part of this is based on some of these intuitions that we're talking about and part of them also is just you know Google the authors they had huge clusters and they're cross validating across all kinds of design choices and this is what ended up working well. Question? [student speaks off mic]

- Yeah so the question is, are the auxiliary outputs actually useful for the final classification, to use these as well? I think when they're training them they do average all these for the losses coming out. I think they are helpful. I can't remember if in the final architecture, whether they average all of these or just take one, it seems very possible that they would use all of them, but you'll need to check on that. [student speaks off mic]

- So the question is for the bottleneck layers, is it possible to use some other types of dimensionality reduction and yes you can use other kinds of dimensionality reduction. The benefits here of this one by one conv is, you're getting this effect, but it's all, you know it's a conv layer just like any other. You have the soul network of these, you just train it this full network back [mumbles] through everything, and it's learning how to combine the previous feature maps.

Okay yeah, question in the back. [student speaks off mic] - Yes so, question is are any weights shared or all they all separate and yeah, all of these layers have separate weights. Question. [student speaks off mic] - Yes so the question is why do we have to inject gradients at earlier layers? So our classification output at the very end,

where we get a gradient on this, it's passed all the way back through the chain roll but the problem is when you have very deep networks and you're going all the way back through these, some of this gradient signal can become minimized and lost closer to the beginning, and so that's why having these additional ones in earlier parts can help provide some additional signal. [student mumbles off mic] - So the question is are you doing back prop all the times for each output.

No it's just one back prop all the way through, and you can think of these three, you can think of there being kind of like an addition at the end of these if you were to draw up your computational graph, and so you get your final signal and you can just take all of these gradients and just back plot them all the way through. So it's as if they were added together at the end in a computational graph. OK so in the interest of time because we still have a lot to get through, can take other questions offline.

Okay so GoogleNet basically 22 layers. It has an efficient inception module, there's no fully connected layers. 12 times fewer parameters than AlexNet, and it's the ILSVRC 2014 classification winner. And so now let's look at the 2015 winner, which is the ResNet network and so here this idea is really, this revolution of depth net right. We were starting to increase depth in 2014, and here we've just had this hugely deeper model at 152 layers was the ResNet architecture. And so now let's look at that in a little bit more detail. So the ResNet architecture, is getting extremely deep networks, much deeper than any other networks before and it's doing this using this idea

of residual connections which we'll talk about. And so, they had 152 layer model for ImageNet. They were able to get 3.5 of 7% top 5 error with this and the really special thing is that they swept all classification and detection contests in the ImageNet mart benchmark and this other benchmark called COCO. It just basically won everything. So it was just clearly better than everything else. And so now let's go into a little bit of the motivation behind ResNet and residual connections that we'll talk about. And the question that they started off by trying to answer is what happens when we try and stack deeper and deeper layers on a plain convolutional neural network? So if we take something like VGG or some normal network that's just stacks of conv and pool layers on top of each other can we just continuously extend these, get deeper layers and just do better?

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent