Answers.Body: <p>The 6th point is wrong. Filters do linear combination with group of pixels (depends on filter size) and move over the image and continue to do linear combination operation until it finishes the whole image. 
  Please look at <a href="http://cs231n.github.io/convolutional-networks/" rel="nofollow noreferrer">2D convolution in CNN</a></p>
  
  <p>I would explain CNN following way:</p>
  
  <p>CNN is a kind of neural network that generally contains many convolutional layers and one or two fully connected layers. The purpose of the convolutional layers is feature extraction. Each of the convolutional layers contains many kernels. The purpose of the kernel is to extract different types of features. E. g. Edge, color, shape, and so on. </p>
  
  <p>Finally, fully connected layers at the end of the network decide the output based on the features that were extracted by convolutional layers. </p>
  
  <p>The advantage of CNN is that we can learn feature extraction kernels based training images. 
  If you look earlier days of image processing. You can
  see the image processing community used convolution for feature extraction all the time. They were just using selective kernel for feature extraction. E. g. Sobel operator for edge detection.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-03-11T15:41:30.537Z
Answers.Text: Sorry, I gave the link for convolution that is used among signal processing community. Although, it’s it’s same thing if you just skip mirroring the kernel. Now, I updated the link to another page. I hope the new one will help you.
Answers.UserDisplayName: Ta_Req
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-03-11T14:05:22.643Z
Answers.LastActivityDate: 2020-03-11T17:41:22.603Z
Answers.LastEditDate: 2020-03-11T17:41:22.603Z
Answers.UserDisplayName: Ta_Req
Answers.Body: <p>To address your description point by point,</p>
  
  <ol>
  <li><p>There are many types of CNN architectures. You appear to be describing a <strong>fully-convolutional neural network</strong> built only from convolutional layers which is a very specialized type of network (typically used for segmentation tasks). </p>
  
  <ul>
  <li>Most networks will include other layer types which have trainable parameters too, i.e. batch normalization layers or densely connected layers. </li>
  <li>Yes, the training process operates on the same concept of error backpropagation.</li>
  </ul></li>
  <li><p>If the model is performing a segmentation task (or any task which requires a 1-to-1 mapping of individually classified pixels), then yes its typically the same size.</p></li>
  <li><p>The raw output of a fully-CNN is typically a <strong>probability map</strong> where each pixel is the probability between 0 and 1 of it being a member of the positive class. This is normally thresholded at 0.5 to obtain a binary mask which delimits the area of interest.</p></li>
  <li><p>In essence, yes. But it may be more accurate to say that the goal is to minimise the loss function (reduce the error) which is done by learning optimal filter weights.</p></li>
  <li><p>Overfitting is not about pixel location. In fact, CNNs are translationally invariant which means that the location of the feature has no impact on the output. There are some types of CNNs which take feature location into account but thats still not standard. Overfitting generally happens when a filter is an exact fit to a pixel patch, for example, the filter is no longer just looking for vertical lines but the exact pixel values of a section of vertical line in a specific image.</p></li>
  <li><p>No, each convolution of a 3x3 filter takes 3x3 pixels and it is convolved over the whole image which means that the filter output will likely be around the same size of the image depending on stride length, padding and dilation. Have a look at one of my other <a href="https://ai.stackexchange.com/a/17066/31980">answers</a> for more details.</p></li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-03-11T13:19:45.567Z
Answers.LastActivityDate: 2020-03-18T14:38:23.413Z
Answers.LastEditDate: 2020-03-18T14:38:23.413Z
Answers.UserDisplayName: tynowell
Body: <p>I don't know if this is the right place to ask this question. If it is not, please tell me and I remove it.</p>
  
  <p>I've just started to learn CNN and I'm trying to understand what they do and how they do it.</p>
  
  <p>I have written some sentences to describe it:</p>
  
  <ol>
  <li><p>Let's say that CNN is a mathematical function that adjusts its values based on the result obtained and the desired output.</p>
  
  <ul>
  <li>The values are the filters of the convolutional layers (in other
  types of networks would be the weights).</li>
  <li>To adjust these values there is a backpropagation method as in all networks.</li>
  </ul></li>
  <li><p>The result obtained is an image of the same size as the original.</p></li>
  <li><p>In this image you can see the delimited area.</p></li>
  <li><p>The goal of the network is to learn these filters.</p></li>
  <li><p>The overfitting may be because the network has learned where the pixels you are looking for are located.</p></li>
  <li><p>The filters have as input a pixel of the image and return a 1 or a 0.</p></li>
  </ol>
  
  <p>My doubt is:</p>
  
  <p>In your own words, Have I forgotten something?</p>
  
  <p><strong>NOTE</strong>:<br/></p>
  
  <p>This is only one question. The six points above are affirmative sentences, not questions.</p>
  
  <p>There is only one question mark, and it is on my question.</p>
  
  <p>I have to clarify this because someone has closed my previous question because she/he thinks there were more than one question.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-03-11T12:25:35.707Z
Comments.Text: You missed my point. Although you ask only one question, your post is too broad. I could ask the question: "Is this info in this article of 100 pages correct?". That would be one question, but too broad. Do you understand now? As you can see from the given existing answer, your question "Have I forgotten something?" could not be answered with a "yes" or "no".
Comments.UserDisplayName: nbro
Tags: <convolutional-neural-networks>
Title: Understanding CNN in a few sentences
UserDisplayName: VansFannel
ThreadText: # Understanding CNN in a few sentences
  
  (Asked by: username_0 on 2020-03-11)
  
  I don't know if this is the right place to ask this question. If it is not, please tell me and I remove it.
  
  I've just started to learn CNN and I'm trying to understand what they do and how they do it.
  
  I have written some sentences to describe it:
  
  1. Let's say that CNN is a mathematical function that adjusts its values based on the result obtained and the desired output.
  
     * The values are the filters of the convolutional layers (in other
       types of networks would be the weights).
     * To adjust these values there is a backpropagation method as in all networks.
  2. The result obtained is an image of the same size as the original.
  3. In this image you can see the delimited area.
  4. The goal of the network is to learn these filters.
  5. The overfitting may be because the network has learned where the pixels you are looking for are located.
  6. The filters have as input a pixel of the image and return a 1 or a 0.
  
  My doubt is:
  
  In your own words, Have I forgotten something?
  
  **NOTE**:
  
  This is only one question. The six points above are affirmative sentences, not questions.
  
  There is only one question mark, and it is on my question.
  
  I have to clarify this because someone has closed my previous question because she/he thinks there were more than one question.
  
  **Tags:** convolutional-neural-networks
  
  > **Comments:**
  > **username_1**: You missed my point. Although you ask only one question, your post is too broad. I could ask the question: "Is this info in this article of 100 pages correct?". That would be one question, but too broad. Do you understand now? As you can see from the given existing answer, your question "Have I forgotten something?" could not be answered with a "yes" or "no".  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_3 on 2020-03-11. Score: 2 | Accepted answer
  
  To address your description point by point,
  
  1. There are many types of CNN architectures. You appear to be describing a **fully-convolutional neural network** built only from convolutional layers which is a very specialized type of network (typically used for segmentation tasks).
  
     * Most networks will include other layer types which have trainable parameters too, i.e. batch normalization layers or densely connected layers.
     * Yes, the training process operates on the same concept of error backpropagation.
  2. If the model is performing a segmentation task (or any task which requires a 1-to-1 mapping of individually classified pixels), then yes its typically the same size.
  3. The raw output of a fully-CNN is typically a **probability map** where each pixel is the probability between 0 and 1 of it being a member of the positive class. This is normally thresholded at 0.5 to obtain a binary mask which delimits the area of interest.
  4. In essence, yes. But it may be more accurate to say that the goal is to minimise the loss function (reduce the error) which is done by learning optimal filter weights.
  5. Overfitting is not about pixel location. In fact, CNNs are translationally invariant which means that the location of the feature has no impact on the output. There are some types of CNNs which take feature location into account but thats still not standard. Overfitting generally happens when a filter is an exact fit to a pixel patch, for example, the filter is no longer just looking for vertical lines but the exact pixel values of a section of vertical line in a specific image.
  6. No, each convolution of a 3x3 filter takes 3x3 pixels and it is convolved over the whole image which means that the filter output will likely be around the same size of the image depending on stride length, padding and dilation. Have a look at one of my other [answers](https://ai.stackexchange.com/a/17066/31980) for more details.
  
  
  ---
  
  ### Answer by username_2 on 2020-03-11. Score: 2
  
  The 6th point is wrong. Filters do linear combination with group of pixels (depends on filter size) and move over the image and continue to do linear combination operation until it finishes the whole image.
  Please look at [2D convolution in CNN](http://cs231n.github.io/convolutional-networks/)
  
  I would explain CNN following way:
  
  CNN is a kind of neural network that generally contains many convolutional layers and one or two fully connected layers. The purpose of the convolutional layers is feature extraction. Each of the convolutional layers contains many kernels. The purpose of the kernel is to extract different types of features. E. g. Edge, color, shape, and so on.
  
  Finally, fully connected layers at the end of the network decide the output based on the features that were extracted by convolutional layers.
  
  The advantage of CNN is that we can learn feature extraction kernels based training images.
  If you look earlier days of image processing. You can
  see the image processing community used convolution for feature extraction all the time. They were just using selective kernel for feature extraction. E. g. Sobel operator for edge detection.
  
  > **Comments:**
  > **username_2**: Sorry, I gave the link for convolution that is used among signal processing community. Although, it’s it’s same thing if you just skip mirroring the kernel. Now, I updated the link to another page. I hope the new one will help you.  
  
  ---
  
  