Answers.Body: <p>First of all, (FC) Neural Networks (NN) are universal function approximators. This means, that, in theory, there must exist some NN of appropriate size that is capable of doing what a CNN can do as well. The only difference is that the standard NN would have to be considerably larger than a corresponding CNN with the same capabilities. Each input pixel would probably have to map to a few dozens to hundreds of input nodes that are trained each on detecting some part of a distinct feature in their respective input image location. Consecutive, hidden layers than have to combine the parts extracted by the input layer for any given location and finally act as the true feature detectors, detecting features as compositions of values in the first layer.</p>
  <p>So, for each position in the input image separately, all the filters have to be learned separately. This absence of weight sharing (since filters are not shared across input locations, but have to be trained for each separate input location) makes using a standard NN for feature extraction so inefficient.</p>
  <p>However, in theory, also a standard NN could be trained on solving an image classification task, thereby learning to extract features. Actually, I would not be surprised if someone had tested that already on the MNIST dataset.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-29T23:51:31.590Z
Answers.Text: Note that, if you trained an MLP (or FFNN) to solve some task involving images (e.g. classification of MNIST digits), the MLP wouldn't probably attempt to mimic a CNN, as one may think while reading your answer. However, I understand that you're just trying to show how an MLP would mimic a CNN, if it needed. Regarding your last paragraph, if I remember correctly, in the past, I trained a small FFNN on MNIST and I got decent results, although typically worse than CNN's results (maybe you saw the comment that I deleted), but it's important to note that MNIST is a relatively easy task.
Answers.UserDisplayName: nbro
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-30T10:22:50.893Z
Answers.Text: The ease of learning the MNIST dataset is exactly why I brought up this example. Just because it is one of the few datasets where one can probably observe that it is possible, indeed, to employ a FCNN for image classification. 
  And, of course, in practice gradient descent will not nicely teach the FCNN to extract crisp features for every isolated position in the input image. Just because that would very likely be too inefficient and there would be no clear-cut distinction between nodes learning to extract parts of features and those that serve as ultimate feature detectors.
Answers.UserDisplayName: Daniel B.
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-27T03:53:54.270Z
Answers.Text: A core idea of CNN is convolution and max pooling. Max pooling essentially attempts to have certain features be dominate and the maxpooling extracts this feature. This provides translation invariance for objects.
Answers.UserDisplayName: FourierFlux
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-29T23:18:56.460Z
Answers.LastActivityDate: 2020-06-29T23:42:26.357Z
Answers.LastEditDate: 2020-06-29T23:42:26.357Z
Answers.UserDisplayName: Daniel B.
Body: <p>I need help in understanding something basic.</p>
  <p>In <a href="https://www.youtube.com/watch?v=ay3zYUeuyhU&amp;list=PLkDaE6sCZn6Gl29AoE31iwdVwSG-KnDzF&amp;index=11" rel="nofollow noreferrer">this video</a>, Andrew Ng says, essentially, that convolutional layers are better than fully connected (FC) layers because they use fewer parameters.</p>
  <p>But I'm having trouble seeing when FC layers would/could ever be used for what convolutional layers are used for, specifically, feature detection.</p>
  <p>I always read that FC layers are used in the final, classification stages of a CNN, but could they ever be used for the feature detection part?</p>
  <p>In other words, is it even possible for a &quot;feature&quot; to be deciphered when the filter size is the same as the entire image?</p>
  <p>If not, it's hard for me to understand Andrew Ng's comparison---there aren't any parameter reduction &quot;savings&quot; if we're not going to use an FC &quot;filter&quot; in place of a CNN layer in the first place.</p>
  <p>A semi-related question: Can multi-layer perceptrons (which I understand to be fully connected neural networks) be used for feature detection? If so, how do image-sized &quot;filters&quot; make any sense?</p>
  
Tags: <convolutional-neural-networks><dense-layers><convolutional-layers><feature-detection>
Title: Can fully connected layers be used for feature detection?
UserDisplayName: Justin
ThreadText: # Can fully connected layers be used for feature detection?
  
  (Asked by: username_0 on 2020-06-29)
  
  I need help in understanding something basic.
  
  In [this video](https://www.youtube.com/watch?v=ay3zYUeuyhU&list=PLkDaE6sCZn6Gl29AoE31iwdVwSG-KnDzF&index=11), Andrew Ng says, essentially, that convolutional layers are better than fully connected (FC) layers because they use fewer parameters.
  
  But I'm having trouble seeing when FC layers would/could ever be used for what convolutional layers are used for, specifically, feature detection.
  
  I always read that FC layers are used in the final, classification stages of a CNN, but could they ever be used for the feature detection part?
  
  In other words, is it even possible for a "feature" to be deciphered when the filter size is the same as the entire image?
  
  If not, it's hard for me to understand Andrew Ng's comparison---there aren't any parameter reduction "savings" if we're not going to use an FC "filter" in place of a CNN layer in the first place.
  
  A semi-related question: Can multi-layer perceptrons (which I understand to be fully connected neural networks) be used for feature detection? If so, how do image-sized "filters" make any sense?
  
  **Tags:** convolutional-neural-networks, dense-layers, convolutional-layers, feature-detection
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-06-29. Score: 1
  
  First of all, (FC) Neural Networks (NN) are universal function approximators. This means, that, in theory, there must exist some NN of appropriate size that is capable of doing what a CNN can do as well. The only difference is that the standard NN would have to be considerably larger than a corresponding CNN with the same capabilities. Each input pixel would probably have to map to a few dozens to hundreds of input nodes that are trained each on detecting some part of a distinct feature in their respective input image location. Consecutive, hidden layers than have to combine the parts extracted by the input layer for any given location and finally act as the true feature detectors, detecting features as compositions of values in the first layer.
  
  So, for each position in the input image separately, all the filters have to be learned separately. This absence of weight sharing (since filters are not shared across input locations, but have to be trained for each separate input location) makes using a standard NN for feature extraction so inefficient.
  
  However, in theory, also a standard NN could be trained on solving an image classification task, thereby learning to extract features. Actually, I would not be surprised if someone had tested that already on the MNIST dataset.
  
  > **Comments:**
  > **username_2**: Note that, if you trained an MLP (or FFNN) to solve some task involving images (e.g. classification of MNIST digits), the MLP wouldn't probably attempt to mimic a CNN, as one may think while reading your answer. However, I understand that you're just trying to show how an MLP would mimic a CNN, if it needed. Regarding your last paragraph, if I remember correctly, in the past, I trained a small FFNN on MNIST and I got decent results, although typically worse than CNN's results (maybe you saw the comment that I deleted), but it's important to note that MNIST is a relatively easy task.  
  > **username_1**: The ease of learning the MNIST dataset is exactly why I brought up this example. Just because it is one of the few datasets where one can probably observe that it is possible, indeed, to employ a FCNN for image classification.  And, of course, in practice gradient descent will not nicely teach the FCNN to extract crisp features for every isolated position in the input image. Just because that would very likely be too inefficient and there would be no clear-cut distinction between nodes learning to extract parts of features and those that serve as ultimate feature detectors.  
  > **username_3**: A core idea of CNN is convolution and max pooling. Max pooling essentially attempts to have certain features be dominate and the maxpooling extracts this feature. This provides translation invariance for objects.  
  
  ---
  
  