Answers.Body: <p>Convolutional layers are added in order to extract features from the image (like edges, corners, textures). After extracting those features, you feed them to a fully connected neural network to get the prediction.  </p>
  
  <p>Let's take an example, consider you want to classify the cat's image. But you decided to do this by only using the convolutional layer. So, you feed the image to a convolutional layer. After passing through some layer it extracted the key features from the cat's image and at the end of the layer, you add a single neuron(since we have a single class to predict). Now it's ready to classify it as a cat. But unfortunately, it's misclassified the image. Why? Now let us answer the question. </p>
  
  <p>Since convolutional layers are not fully connected layers, the neuron added at the last layer is only connected with a handful of neurons from the previous layer. So it misses the key features (encapsulated by some other neurons it is not connected with them) in order to detect this image as a cat. In order to get the prediction right, you have to add a dense layer(a fully connected layer) at the end of the convolutional layer so that it can get all of those extracted features. </p>
  
  <p>If this does not satisfy you, please, ask the question more specifically and also edit the question because linear layer does not call fully connected layer. </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-26T18:31:28.810Z
Answers.LastActivityDate: 2020-04-26T19:25:59.680Z
Answers.LastEditDate: 2020-04-26T19:25:59.680Z
Answers.UserDisplayName: Swakshar Deb
Body: <p>Many neural net architectures for computer vision tasks use several convolutional layers and then several fully-connected (or dense) layers. While the reasons for using convolutional layers are clear to me, I don't understand why the dense layers are needed. Can't high accuracy be achieved with only convolutional layers?</p>
  
Tags: <neural-networks><deep-learning><convolutional-neural-networks><computer-vision><architecture>
Title: Why are denser layers needed in computer vision neural nets?
UserDisplayName: Gilad Deutsch
ThreadText: # Why are denser layers needed in computer vision neural nets?
  
  (Asked by: username_0 on 2020-04-26)
  
  Many neural net architectures for computer vision tasks use several convolutional layers and then several fully-connected (or dense) layers. While the reasons for using convolutional layers are clear to me, I don't understand why the dense layers are needed. Can't high accuracy be achieved with only convolutional layers?
  
  **Tags:** neural-networks, deep-learning, convolutional-neural-networks, computer-vision, architecture
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-04-26. Score: 1
  
  Convolutional layers are added in order to extract features from the image (like edges, corners, textures). After extracting those features, you feed them to a fully connected neural network to get the prediction.
  
  Let's take an example, consider you want to classify the cat's image. But you decided to do this by only using the convolutional layer. So, you feed the image to a convolutional layer. After passing through some layer it extracted the key features from the cat's image and at the end of the layer, you add a single neuron(since we have a single class to predict). Now it's ready to classify it as a cat. But unfortunately, it's misclassified the image. Why? Now let us answer the question.
  
  Since convolutional layers are not fully connected layers, the neuron added at the last layer is only connected with a handful of neurons from the previous layer. So it misses the key features (encapsulated by some other neurons it is not connected with them) in order to detect this image as a cat. In order to get the prediction right, you have to add a dense layer(a fully connected layer) at the end of the convolutional layer so that it can get all of those extracted features.
  
  If this does not satisfy you, please, ask the question more specifically and also edit the question because linear layer does not call fully connected layer.
  
  
  ---
  
  