Answers.Body: <p>Good questions. Let me reply one by one.</p>
  
  <p>1- Filter size can be increased. There is no limit for it. However, think two cases:</p>
  
  <ul>
  <li>DNN part. Shape will be 1024 x 7 x 7 and it will map to 4096 features, it will cause 204M parameters at dense_1 layer. This change will cause two possible problem. Overfitting and inference/training speed.</li>
  <li>Sparsity. You can implement 1024 features at 5th conv block and train the network and check the accuracy to see if increased feature count will make any impact or not.</li>
  </ul>
  
  <p>So, to decide the number of con layers, it is a good practice to check sparsity of feature layers. </p>
  
  <p>2- If I did not understand your question wrong, those layers are DNN classifier as a fully connected layer.</p>
  
  <p>3- Maxpooling is not causing us to see a subset of the image. It is just an algorithm to resizing. What you see in that video is the filter response to some objects exist in the image. In deeper level, do not expect to have visual shape like in shallow layers. You may even get single white pixel at deepest layer and it may be a response to an object like human face. </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-13T18:42:24.257Z
Answers.Text: Hi, Thank you. I can understand now on filter size. And I can now visualize better on max pooling results as well. But about point 2, conv2d_8 and the 9th layer has same hyper-parameters and those layers don't act as a classifier right? Convolution2D helps in better activation values for edge detection, was just wondering how they arrived at two conv2d layers at later stages of the layer with same hyper-parameters. So playing around with changes in vgg architecture to what gave that thought instead of just one of such layer. Also flatten layer is the one we call fully connected layer?
Answers.UserDisplayName: Rajesh Mappu
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-13T03:18:12.600Z
Answers.LastActivityDate: 2017-12-13T03:18:12.600Z
Answers.UserDisplayName: Deniz Beker
Body: <p>Trying to understand the VGG architecture and I have these following questions.</p>
  
  <ol>
  <li>I understand the general understanding of increasing filter size is because we are using max pooling and so its image size gets reduced. So in order to keep information gain, we increase filter size. But the last few layers in the VGG architecture, the filter size remained same when vgg was max pooling from 14x14 to 7x7 image size, the filter size remained same at 512x512. Why wasn’t there the need to increase filter size there?</li>
  <li>Also few consecutive layers, in the end, was constructed with both same filter and image size, those layers were built just to increase accuracy? (experimentation?)</li>
  <li>And I couldn’t wrap around that visualization at final filters have the entire face as the feature as I understood through convolution visualizing (Matt Zieler video explanation). But max pooling causes us to see only a subset part of the image right? When filter size is 512x512 (face as the filter/feature) the image size as 7x7, so how does entire face as a filter will work on images when we are moving over small subset of the image pixels?</li>
  </ol>
  
  <p><a href="https://i.sstatic.net/rVB4S.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/rVB4S.png" alt="VGG architecture summary"></a><a href="https://i.sstatic.net/yfw43.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/yfw43.png" alt="VGG architecture final layers summary"></a></p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-12-03T16:24:47.323Z
Comments.Text: Go through the following blog to get a deep understanding of VGG-16 architecture:
  The Architecture and Implementation of VGG-16 (https://medium.com/towards-artificial-intelligence/the-architecture-and-implementation-of-vgg-16-b050e5a5920b)
Comments.UserDisplayName: Vaibhav Khandelwal
Tags: <convolutional-neural-networks><image-recognition><vgg>
Title: Trying to understand VGG convolution neural networks architecture
UserDisplayName: Rajesh Mappu
ThreadText: # Trying to understand VGG convolution neural networks architecture
  
  (Asked by: username_0 on 2017-12-11)
  
  Trying to understand the VGG architecture and I have these following questions.
  
  1. I understand the general understanding of increasing filter size is because we are using max pooling and so its image size gets reduced. So in order to keep information gain, we increase filter size. But the last few layers in the VGG architecture, the filter size remained same when vgg was max pooling from 14x14 to 7x7 image size, the filter size remained same at 512x512. Why wasn’t there the need to increase filter size there?
  2. Also few consecutive layers, in the end, was constructed with both same filter and image size, those layers were built just to increase accuracy? (experimentation?)
  3. And I couldn’t wrap around that visualization at final filters have the entire face as the feature as I understood through convolution visualizing (Matt Zieler video explanation). But max pooling causes us to see only a subset part of the image right? When filter size is 512x512 (face as the filter/feature) the image size as 7x7, so how does entire face as a filter will work on images when we are moving over small subset of the image pixels?
  
  [![VGG architecture summary](https://i.sstatic.net/rVB4S.png)](https://i.sstatic.net/rVB4S.png)[![VGG architecture final layers summary](https://i.sstatic.net/yfw43.png)](https://i.sstatic.net/yfw43.png)
  
  **Tags:** convolutional-neural-networks, image-recognition, vgg
  
  > **Comments:**
  > **username_1**: Go through the following blog to get a deep understanding of VGG-16 architecture: The Architecture and Implementation of VGG-16 (https://medium.com/towards-artificial-intelligence/the-architecture-and-implementation-of-vgg-16-b050e5a5920b)  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2017-12-13. Score: 2 | Accepted answer
  
  Good questions. Let me reply one by one.
  
  1- Filter size can be increased. There is no limit for it. However, think two cases:
  
  * DNN part. Shape will be 1024 x 7 x 7 and it will map to 4096 features, it will cause 204M parameters at dense\_1 layer. This change will cause two possible problem. Overfitting and inference/training speed.
  * Sparsity. You can implement 1024 features at 5th conv block and train the network and check the accuracy to see if increased feature count will make any impact or not.
  
  So, to decide the number of con layers, it is a good practice to check sparsity of feature layers.
  
  2- If I did not understand your question wrong, those layers are DNN classifier as a fully connected layer.
  
  3- Maxpooling is not causing us to see a subset of the image. It is just an algorithm to resizing. What you see in that video is the filter response to some objects exist in the image. In deeper level, do not expect to have visual shape like in shallow layers. You may even get single white pixel at deepest layer and it may be a response to an object like human face.
  
  > **Comments:**
  > **username_0**: Hi, Thank you. I can understand now on filter size. And I can now visualize better on max pooling results as well. But about point 2, conv2d_8 and the 9th layer has same hyper-parameters and those layers don't act as a classifier right? Convolution2D helps in better activation values for edge detection, was just wondering how they arrived at two conv2d layers at later stages of the layer with same hyper-parameters. So playing around with changes in vgg architecture to what gave that thought instead of just one of such layer. Also flatten layer is the one we call fully connected layer?  
  
  ---
  
  