<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Saidi Souhaieb</title>
    <description>The latest articles on DEV Community by Saidi Souhaieb (@saidi-souhaieb).</description>
    <link>https://dev.to/saidi-souhaieb</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1464144%2F79369b75-8efa-494b-a5b4-95d5c913d9c3.png</url>
      <title>DEV Community: Saidi Souhaieb</title>
      <link>https://dev.to/saidi-souhaieb</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/saidi-souhaieb"/>
    <language>en</language>
    <item>
      <title>What are Convolutional Neural Networks (CNN)? The Art of Computer Vision For Beginners</title>
      <dc:creator>Saidi Souhaieb</dc:creator>
      <pubDate>Sat, 04 May 2024 07:59:28 +0000</pubDate>
      <link>https://dev.to/saidi-souhaieb/what-are-convolutional-neural-networks-cnn-the-art-of-computer-vision-for-beginners-34nn</link>
      <guid>https://dev.to/saidi-souhaieb/what-are-convolutional-neural-networks-cnn-the-art-of-computer-vision-for-beginners-34nn</guid>
      <description>&lt;p&gt;Fascinated by the idea of computers understanding images and patterns? Convolutional Neural Networks are one of the most popular neural networks which handle analysis of visual imagery.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnkenw3hv1yjtw8jh4nst.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnkenw3hv1yjtw8jh4nst.png" alt="Image description" width="800" height="428"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this guide you’ll learn:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What are Convolutional Neural Networks&lt;/li&gt;
&lt;li&gt;Convolutional Neural Network’s Architecture&lt;/li&gt;
&lt;li&gt;Convolutional Neural Network Layers&lt;/li&gt;
&lt;li&gt;Convolutional Layer&lt;/li&gt;
&lt;li&gt;Pooling Layer&lt;/li&gt;
&lt;li&gt;Fully-Connected Layer&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What are Convolutional Neural Networks
&lt;/h2&gt;

&lt;p&gt;Convolutional Neural Network or CNN, is a type of neural networks mainly used for computer vision tasks. Thanks to its architecture, CNN is able to pick out and detect patterns and understand images by looking at one patch of an image at a time by using multiple layers of filters and matrix dot operations which we will cover in-depth later in the article.&lt;/p&gt;

&lt;h2&gt;
  
  
  Convolutional Neural Network’s Architecture
&lt;/h2&gt;

&lt;p&gt;Unlike regular neural networks, CNNs have unique architectures where the pixels of images given become the neurons and use special type of layers to process images and achieve desired results. That comes from the fact that processing images in NNs is possible but it would lead to very heavy computation for worse results.&lt;/p&gt;

&lt;p&gt;Imagine you have an image of a cat with dimensions of 6*6*3 (6 wide, 6 high, 3 RGB color channels), to process the image in a regular neural network we would have to flatten the image so every pixel would be in one long 1D matrix and that becomes the input layer. However if we take as example 100 nodes in first hidden layer that would add up to 108 input nodes and 10800 weights connecting to first layer alone, now imagine if we took a real world sized image of at least 200*200*3 , that would lead to very heavy computation for only first layer without taking in consideration the rest of the hidden layers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F89goqjclubndlpktcpqt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F89goqjclubndlpktcpqt.png" alt="Image description" width="461" height="531"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Example of an image with 6*6*3 dimensions&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Convolutional Neural Network Layers
&lt;/h2&gt;

&lt;p&gt;Diving deeper into CNNs architecture we would come across its main building blocks. Three special layers designed to handle processing images:&lt;/p&gt;

&lt;h3&gt;
  
  
  Convolutional Layer
&lt;/h3&gt;

&lt;p&gt;Holds most of the computational heavy lifting, the convolutional layer’s task is the learning and detection of features from a given image using learnable filters.&lt;/p&gt;

&lt;p&gt;Filters are dimensionally small matrixes that slide over input image pixels performing matrix dot product operations on their way to transform the pixels to highlight certain features producing convolved features that get aggregated to feature maps.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu8dp085akhz58rgu91q8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu8dp085akhz58rgu91q8.png" alt="Image description" width="800" height="486"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Left: example of input pixels of an image&lt;br&gt;
Right: 3*3 dimension filter&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjuhs3v4rcru8uod4fssw.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjuhs3v4rcru8uod4fssw.gif" alt="Image description" width="800" height="466"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Example of how the filter slides across the image and calculates the feature maps&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;However a single convolutional layer won’t be enough to recognize objects or complex features because that is produced by multiple convolutional layers each using the last layer’s output as its input also know as feature hierarchy, where the first input layers start recognizing edges (horizontal/vertical lines), gradients and as you go deeper into more convolutional layers, it starts detecting outlines of objects until it becomes able to detect the complex feature or object.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw05n5fd5zkbwjxpmnocs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw05n5fd5zkbwjxpmnocs.png" alt="Image description" width="685" height="494"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Here (a) are the input images of moths and (b,c,d,e,f) are feature maps or results after going each through a convolutional layer, we can see that it starts detecting lines and outlines then as it progress through the layers it starts detecting the full moth in the image.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Note the at the values called weights inside the filter matrix stay the same as it slides across the image that is because the filter is being used to find a certain feature like vertical lines it would be reasonable to keep that filter the same throughout the whole image so it detects the vertical lines in every part of the image, that is called parameter sharing. However it would be beneficial to not use it in some cases, for instance detecting human faces in certain places it is better to use filters optimized for eye regions to detect eyes and use different valued filters optimized for mouth regions to detect mouths.&lt;/p&gt;

&lt;p&gt;There are more parameters that can be tuned in convolutional layers like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Number of filters: The number of filters applied on each part of the image, this enables the layer to find and learn a diverse set of features from multiple filters. However using more filters comes with more computational cost.&lt;/li&gt;
&lt;li&gt;Stride: The distance that the filter matrix moves across the image each time, the majority of stride values don’t exceed 2 because it can cause information loss.&lt;/li&gt;
&lt;li&gt;Zero-Padding: Pads the input image by adding zeros to the edges when the filters don’t fit in the size of the input image.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Pooling Layer
&lt;/h3&gt;

&lt;p&gt;Also known as downsampling, it performs dimensionality reduction to remove unwanted noise and features in the feature maps as well as reduce computational power. Mostly used after every convolutional layer.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fucultudixq5oh1mw36is.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fucultudixq5oh1mw36is.png" alt="Image description" width="563" height="399"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Max pooling: moves through the image and takes the maximum pixel value of every size defined region.&lt;br&gt;
Average pooling: moves through the image and calculates the average of the pixel values in every size defined region.&lt;br&gt;
Note: Max pooling performs better than average pooling.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Fully-Connected Layer
&lt;/h3&gt;

&lt;p&gt;Flattens the resulted feature maps from 3D matrixes to 1D vector and uses every pixel as a neuron to pass to a classification neural network and re-intrdouces the concept of weights to perform the task of classification the features extracted.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffrufa2mauxmzs7lt80xu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffrufa2mauxmzs7lt80xu.png" alt="Image description" width="581" height="287"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Example of a full CNN architecture&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;In this article, we’ve explored Convolutional Neural Networks (CNNS) and understood the architecture of CNNs, i avoided speaking about the limitations, activations functions and Regularization techniques as this article is aimed towards beginners. I covered these subjects in other articles, check References.&lt;/p&gt;

&lt;p&gt;References:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/saidi-souhaieb/what-are-neural-networks-deep-learning-explained-for-beginners-2h4k"&gt;What are Neural Networks? Deep Learning Explained for Beginners&lt;br&gt;
&lt;/a&gt;&lt;br&gt;
Thank you for reading&lt;/p&gt;

&lt;p&gt;Please feel free to share your thoughts, any errors will be corrected in the blog.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>neuralnetworks</category>
      <category>beginners</category>
      <category>convolutional</category>
    </item>
    <item>
      <title>What are Neural Networks? Deep Learning Explained for Beginners</title>
      <dc:creator>Saidi Souhaieb</dc:creator>
      <pubDate>Thu, 02 May 2024 14:26:38 +0000</pubDate>
      <link>https://dev.to/saidi-souhaieb/what-are-neural-networks-deep-learning-explained-for-beginners-2h4k</link>
      <guid>https://dev.to/saidi-souhaieb/what-are-neural-networks-deep-learning-explained-for-beginners-2h4k</guid>
      <description>&lt;p&gt;Intrigued by the idea of computers learning? well Neural Networks are the main key players, they are interconnected neurons that resemble loosely the structure of a human brain, mimicking the act of learning and decision making.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk2svilmk1lql3w7j4wge.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk2svilmk1lql3w7j4wge.png" alt="Image description" width="800" height="375"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this guide, you’ll learn:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What are Neural Networks&lt;/li&gt;
&lt;li&gt;What are Neural Networks made of&lt;/li&gt;
&lt;li&gt;How do Neural Networks learn&lt;/li&gt;
&lt;li&gt;What are the types of Neural Networks&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What are Neural Networks
&lt;/h2&gt;

&lt;p&gt;Artificial Neural Network or (ANN) is a deep learning method in artificial intelligence based on the human brain, made to make a computer capable of learning to perform tasks based on training examples. However, for a computer to be able to perform these tasks it has to learn, which is the key concept behind neural networks, for instance, a neural network may be fed thousands of images of cats and dogs each labelled with “cat” or “dog”, and it would find visual patterns in the images to learn how to classify a given image as a cat or a dog.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5ibl36ih394aabkq1kgp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5ibl36ih394aabkq1kgp.png" alt="Image description" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What are Neural Networks made of
&lt;/h2&gt;

&lt;p&gt;In broad terms, layers are the building blocks of neural networks made of nodes, each responsible for processing and transforming data in a specific way. There are three types of layers:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Input Layer: This is layer receives the input data and pass it to he rest of the network.&lt;/li&gt;
&lt;li&gt;Hidden Layer: Made of one or more layers based on the complexity of the network, they are the key components of learning and complexity. Hidden layers work by analyzing the output from the previous layer, processing it further and passing it on the next layer.&lt;/li&gt;
&lt;li&gt;Output Layer: Holds the final results of the network after all the data processing. The number of nodes of this layer depends on the number of classes to be predicted.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fobl9wajzuw5vvjv6x4p8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fobl9wajzuw5vvjv6x4p8.png" alt="Image description" width="442" height="272"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Diving a little bit deeper to the connection between two layers, we find that each node is connected to every node in the next layer. The strength of these connections is determined by a parameter called weight, during training, the network learns the optimal values for these weights through a process called backpropagation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fveiykhx019al0hb90tds.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fveiykhx019al0hb90tds.png" alt="Image description" width="502" height="286"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How do Neural Networks learn
&lt;/h2&gt;

&lt;p&gt;Learning or mostly known as Training, generally speaking it is a process involving presenting neural networks with examples of input data along with the corresponding correct output. Specifically multiple steps are involved in the training process. These steps include:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;nitialization: Setting up the initial configuration of the neural network, which typically involves assigning random values to its parameters such as weights.&lt;/li&gt;
&lt;li&gt;Forward Propagation: Processing input data through the network to generate predictions or outputs.&lt;/li&gt;
&lt;li&gt;Error Measurement: Assessing the accuracy between the predicted outputs and the actual outputs using a measure of error or loss.&lt;/li&gt;
&lt;li&gt;Adjustment Calculation: Determining how to update the network’s parameters based on the observed errors, aiming to reduce them over time.&lt;/li&gt;
&lt;li&gt;Parameter Updates: Modifying the parameters of the network, such as weights and biases, to minimize the errors observed during training.&lt;/li&gt;
&lt;li&gt;Iterative Optimization: Repeating the above steps across multiple iterations, gradually improving the network’s performance.&lt;/li&gt;
&lt;li&gt;Validation and Testing: Assessing the trained network’s performance on independent validation and test datasets to ensure its ability to generalize to unseen data.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What are the types of Neural Networks
&lt;/h2&gt;

&lt;p&gt;Neural Networks are varied, each with a unique structure and function to solve different problems. The most common neural networks are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Convolutional neural network(CNN): Used in classification and computer vision tasks, it utilizes filters optimization to reduce images into a form that is easier to process, without losing critical features. Real life applications include pattern recognition, image recognition, object detection, facial recognition and more.&lt;/li&gt;
&lt;li&gt;Recurrent neural networks(RNN): A bi-directional neural network for handling sequential data, meaning RNNs have connections that form directed cycles where output from the previous step is fed as input to the current step. Used in cases like speech recognition or handwriting recognition where it is essential to remember previous information.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;In this beginner-friendly guide, i explained neural networks on a broader level avoiding complex explanations, concepts and mathematical equations. For more mathematically involved discussion refer to the references.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;:&lt;br&gt;
…&lt;/p&gt;

&lt;p&gt;Thank you for reading&lt;/p&gt;

&lt;p&gt;Please feel free to share your thoughts, any errors will be corrected in the blog.&lt;/p&gt;

</description>
      <category>blog</category>
      <category>ai</category>
      <category>neuralnetworks</category>
      <category>machinelearning</category>
    </item>
  </channel>
</rss>
