{
  "source_file": "0930",
  "source_platform": "Hashnode",
  "author": "Muhammad Fahad Bashir",
  "title_listed": "Why Shift to CNNs: Solving Simple Neural Network Limitations and Understanding CNN [part1]",
  "keywords": "",
  "domain": "图像处理",
  "content_type": "深度技术解析",
  "is_paid_flag": "否",
  "url": "https://mfahadbashir.hashnode.dev/why-shift-to-cnns-solving-simple-neural-network-limitations-and-understanding-cnn-part1",
  "publish_date": "2024-10-03",
  "corpus_stage": "",
  "notes": "",
  "id": "a35ef7c66941",
  "collected_at": "2026-10-02T14:10:58",
  "title": "Why Shift to CNNs: Solving Simple Neural Network Limitations and Understanding CNN [part1]",
  "body_markdown": "Why Shift to CNNs: Solving Simple Neural Network Limitations and Understanding CNN [part1]\nUpdated\nOctober 16, 2024\n•\n5\nmin read\n•\nView as Markdown\nM\nMuhammad Fahad Bashir\nMachine Learning, Artificial Intelligence\nPart of series\nML & DL\nToday, we’re excited to explore one of the most widely used neural networks, especially in image processing:\nConvolutional Neural Networks (CNNs)\n.\nYou might be wondering — we already have simple neural networks that can handle images as we explored in previous article -\nNeural Networks Simplified: The Future Beyond Traditional ML\n. So, why did we feel the need to move to CNNs? After all, simple neural networks can perform tasks like classification, and they’re easier to understand.\nWell, here’s the reason:\nLimitations of Simple Neural Networks\nFully Connected Structure\nIn a simple neural network, each neuron is connected to every neuron in the next layer (this is what we call\nfully connected\n). So, if we add just one neuron, it gets connected to all the neurons in the next layer, which increases the number of parameters drastically.\nImagine dealing with an image that’s even a modest size — say 32x32 pixels. The number of parameters grows exponentially as the image size increases. Now, think about images in today’s world, where we have\nmegapixel-sized\nimages. A simple neural network just can’t handle that efficiently; it would need billions of parameters for just one image. This takes a lot of time and costs a lot of computational power.\nExample:\nLet's say you have an image of size 32x32 pixels with\n3 color channels\n(RGB), which is very common. So, the total number of input neurons would be:\n32 x 32 x 3 = 3,072 input neurons.\nNow, imagine you have a fully connected layer with\n1,000 neurons\n. Each neuron in this layer is connected to every input neuron. So, the total number of parameters (weights) required to connect this layer to the input would be:\n3,072 input neurons x 1,000 neurons = 3,072,000 parameters\n.\nThat’s already over\n3 million parameters\nfor a single layer, and this is for a relatively small image.while if f the image is\n128x128 pixels\nwith 3 channels with same number of neuron then\n128 x 128 x 3 = 49,152 input neurons\n.\n49,152 input neurons x 1,000 neurons = 49,152,000 parameters\n.\nLoss of Image Information:\nAnother limitation is that simple neural networks convert images into 1D arrays before processing them, meaning we lose important spatial information like the position of pixels and other intricate details.\nSure, a simple neural network can give an answer for basic images, but when it comes to complex images, it starts to struggle. That’s because it can’t effectively capture\nlocal patterns\nand\nstructures\nwithin the image.\nWhy CNNs Are Better\nCNNs drastically reduce the number of parameters because they\nonly connect neurons locally\n. Instead of connecting every neuron to every other neuron,\nCNNs use small filters that slide over the image. This not only preserves the spatial structure of the image but also reduces the computational load\n, allowing CNNs to handle large, high-dimensional images more efficiently.\nFor example, instead of having millions or billions of parameters for a single layer, CNNs only need\nthousands\nof parameters, which makes them far more scalable and practical for image-related tasks.\nUnderstanding Convolutional Neural Networks (CNNs)\nSo, to overcome the limitations, we turn to\nConvolutional Neural Networks (CNNs)\n. CNNs are mainly used in tasks related to images and videos, like classification, object detection, and more.\nThe\nconvolution operation\nitself has been around for years in image processing, and CNNs have built on that trusted foundation. CNNs perform these convolutions through\nconvolutional layers\n, and instead of connecting each neuron to all others like in simple neural networks, CNNs focus on smaller, localized regions of the input.\nHow Do CNNs Work?\nThe main idea behind CNNs is the use of\nfilters\n(small matrices) that slide over the input image to detect patterns. Let’s break it down:\nConvolution Operation:\nThe convolution operation applies\nfilters\nto the image. These filters are small grids of numbers that move (or “slide”) over the image and perform mathematical operations to create\nfeature maps\n.\nThis allows CNNs to detect features such as\nedges\n,\ntextures\n, and\npatterns\nin the image. Each filter has a specific task — one might detect vertical edges, while another could detect horizontal edges.\nConvolutional Layers:\nThese layers are where the filters are applied to the image. Early layers detect basic features (like edges), while deeper layers start detecting more complex patterns and structures.\nThe key point is that\neach convolutional neuron\nperforms convolutional operations to detect features, and these neurons don’t lose the image's structure — unlike fully connected neural networks.\nSource Image\nFeature Hierarchy:\nAs the image passes through successive convolutional layers, t\nhe network starts recognizing more\ncomplex features\n.\nSo, the first layer might detect simple lines or edges, and as the image goes through more layers, the network can recognize more sophisticated patterns like shapes or even objects.\nPooling Layers:\nAfter each convolutional layer,\nthere’s usually a\npooling layer\n, which helps summarize the feature\nmaps.\nPooling layers reduce the size of the feature maps, making the network more efficient by focusing on the most important features.\nThink of pooling layers as taking the essence or summary of the features detected in the convolutional layers and passing it forward.\nImage Source\nFully Connected Layer (FCN):\nAfter all the convolutions and pooling operations, the final step involves using a fully connected layer (similar to what we see in traditional neural networks).\nHere, the CNN uses all the extracted features to make its final prediction, whether it’s classifying the image or detecting an object.\nCNN Structure\nTo summarize, a typical CNN consists of:\nConvolutional Layer:\nApplies the convolution operation, detects basic and complex features.\nPooling Layer:\nReduces the size of the feature maps and summarizes the important features.\nFlattening Layer:\nConverts the output of the last pooling layer into a 1D array to prepare it for the fully connected layer.\nFully Connected Layer:\nTakes the flattened features and gives the final output, such as classifying the image.\nA complete picture for understanding CNN is\nConclusion\nSo, to wrap things up, CNNs solve the problems that traditional neural networks face when it comes to handling images. CNNs keep the spatial structure of the image intact and significantly reduce the number of parameters, making them efficient and capable of processing today's high-dimensional data. CNNs have transformed the way we work with images, allowing us to extract both simple and complex features, all while saving on computation time and resources.\n#\nneural-networks\n#\ncnn\n#\ntutorial\n#\ndeep-learning\n#\nbeginner\n#\nartificial-intelligence\n63\nviews",
  "metadata": {
    "title": "Why Shift to CNNs: Solving Simple Neural Network Limitations and Understanding CNN [part1]",
    "description": "CNNs enhance image processing efficiency and preserve spatial structure, addressing simple neural network limitations in complex visual tasks",
    "keywords": null,
    "author": null,
    "og:title": "Why Shift to CNNs: Solving Simple Neural Network Limitations and Understanding CNN [part1]",
    "og:description": "CNNs enhance image processing efficiency and preserve spatial structure, addressing simple neural network limitations in complex visual tasks",
    "og:url": "https://mfahadbashir.hashnode.dev/why-shift-to-cnns-solving-simple-neural-network-limitations-and-understanding-cnn-part1",
    "og:site_name": "Muhammad Fahad Bashir",
    "og:image": "https://cdn.hashnode.com/res/hashnode/image/upload/v1727941143369/a9b18f8a-2ada-4f74-b523-c86b4d74362c.png",
    "og:image:width": "1200",
    "og:image:height": "630",
    "og:type": "article",
    "twitter:card": "summary_large_image",
    "twitter:title": "Why Shift to CNNs: Solving Simple Neural Network Limitations and Understanding CNN [part1]",
    "twitter:description": "CNNs enhance image processing efficiency and preserve spatial structure, addressing simple neural network limitations in complex visual tasks",
    "twitter:image": "https://cdn.hashnode.com/res/hashnode/image/upload/v1727941143369/a9b18f8a-2ada-4f74-b523-c86b4d74362c.png",
    "article:published_time": "2024-10-03T07:40:33.225Z",
    "article:modified_time": "2024-10-16T12:48:02.370Z",
    "article:author": "https://mfahadbashir.hashnode.dev/@mfahadbashir"
  },
  "paywall": {
    "listed_paid": false,
    "detected": false,
    "marker": "",
    "public_only": false,
    "policy": "付费/会员内容只保留页面公开可见部分，不绕过付费墙"
  },
  "crawl": {
    "success": true,
    "status_code": 200,
    "error": ""
  },
  "code_blocks": [],
  "images": [
    {
      "status": "ok",
      "url": "https://cdn.hashnode.com/res/hashnode/image/upload/v1727941143369/a9b18f8a-2ada-4f74-b523-c86b4d74362c.png",
      "bytes": 274831,
      "reused": true,
      "local_path": "attachments/a35ef7c66941/images/000.png",
      "src": "https://cdn.hashnode.com/res/hashnode/image/upload/v1727941143369/a9b18f8a-2ada-4f74-b523-c86b4d74362c.png",
      "alt": "Why Shift to CNNs: Solving Simple Neural Network Limitations and Understanding CNN [part1]",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://miro.medium.com/v2/resize:fit:720/1*VHOUViL8dHGfvxCsswPv-Q.png",
      "bytes": 281730,
      "reused": true,
      "local_path": "attachments/a35ef7c66941/images/002.png",
      "src": "https://miro.medium.com/v2/resize:fit:720/1*VHOUViL8dHGfvxCsswPv-Q.png",
      "alt": "Fully Connected vs Convolutional Neural Networks | by Pooja Mahajan | The  Startup | Medium",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://ars.els-cdn.com/content/image/3-s2.0-B9780323905503000114-f14-04-9780323905503.jpg",
      "bytes": 22123,
      "reused": true,
      "local_path": "attachments/a35ef7c66941/images/003.jpg",
      "src": "https://ars.els-cdn.com/content/image/3-s2.0-B9780323905503000114-f14-04-9780323905503.jpg",
      "alt": "Convolutional Layer - an overview | ScienceDirect Topics",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://cdn.hashnode.com/res/hashnode/image/upload/v1727939931974/54936876-fc5e-480a-bfde-2834db464c46.png",
      "bytes": 43135,
      "reused": true,
      "local_path": "attachments/a35ef7c66941/images/004.png",
      "src": "https://cdn.hashnode.com/res/hashnode/image/upload/v1727939931974/54936876-fc5e-480a-bfde-2834db464c46.png",
      "alt": "",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://cdn.hashnode.com/res/hashnode/image/upload/v1727940081088/5768e2ab-c4dc-413e-86a1-f8a707c2f4f1.jpeg",
      "bytes": 21028,
      "reused": true,
      "local_path": "attachments/a35ef7c66941/images/005.jpeg",
      "src": "https://cdn.hashnode.com/res/hashnode/image/upload/v1727940081088/5768e2ab-c4dc-413e-86a1-f8a707c2f4f1.jpeg",
      "alt": "",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://cdn.hashnode.com/res/hashnode/image/upload/v1727940366013/7c8359e4-fadb-47dd-93a1-b0e4c20ff4e9.png",
      "bytes": 92772,
      "reused": true,
      "local_path": "attachments/a35ef7c66941/images/006.png",
      "src": "https://cdn.hashnode.com/res/hashnode/image/upload/v1727940366013/7c8359e4-fadb-47dd-93a1-b0e4c20ff4e9.png",
      "alt": "",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://cdn.hashnode.com/res/hashnode/image/upload/v1727939044982/26027ce0-01d0-4cb8-aa1f-f3d47faa16c4.jpeg",
      "bytes": 74191,
      "reused": true,
      "local_path": "attachments/a35ef7c66941/images/007.jpeg",
      "src": "https://cdn.hashnode.com/res/hashnode/image/upload/v1727939044982/26027ce0-01d0-4cb8-aa1f-f3d47faa16c4.jpeg",
      "alt": "",
      "downloaded": true
    }
  ],
  "audio": [],
  "videos": [],
  "links": [
    {
      "href": "https://mfahadbashir.hashnode.dev/why-shift-to-cnns-solving-simple-neural-network-limitations-and-understanding-cnn-part1.md",
      "label": "View as Markdown",
      "type": "a"
    },
    {
      "href": "https://hashnode.com/@mfahadbashir",
      "label": "M",
      "type": "a"
    },
    {
      "href": "https://www.linkedin.com/in/muhammad-fahad-bashir-09568216a/",
      "label": "",
      "type": "a"
    },
    {
      "href": "https://mfahadbashir.hashnode.dev/series/mldl",
      "label": "Part of series ML & DL",
      "type": "a"
    },
    {
      "href": "https://mfahadbashir.hashnode.dev/neural-networks-simplified-the-future-beyond-traditional-ml",
      "label": "Neural Networks Simplified: The Future Beyond Traditional ML",
      "type": "a"
    },
    {
      "href": "https://www.google.com/url?sa=i&url=https%3A%2F%2Fwww.researchgate.net%2Ffigure%2Fa-Description-of-the-convolutional-layer-of-a-CNN-and-b-the-convolution-operation-In_fig3_353889156&psig=AOvVaw06tf0BNmfoy7kzO7IHrQLr&ust=1728026245469000&source=images&cd=vfe&opi=89978449&ved=0CBcQjhxqFwoTCNCRh8jV8YgDFQAAAAAdAAAAABAJ",
      "label": "Source Image",
      "type": "a"
    },
    {
      "href": "https://www.sciencedirect.com/topics/mathematics/pooling-layer",
      "label": "Image Source",
      "type": "a"
    },
    {
      "href": "https://mfahadbashir.hashnode.dev/tag/neural-networks",
      "label": "# neural-networks",
      "type": "a"
    },
    {
      "href": "https://mfahadbashir.hashnode.dev/tag/cnn",
      "label": "# cnn",
      "type": "a"
    },
    {
      "href": "https://mfahadbashir.hashnode.dev/tag/tutorial",
      "label": "# tutorial",
      "type": "a"
    },
    {
      "href": "https://mfahadbashir.hashnode.dev/tag/deep-learning",
      "label": "# deep-learning",
      "type": "a"
    },
    {
      "href": "https://mfahadbashir.hashnode.dev/tag/beginner",
      "label": "# beginner",
      "type": "a"
    },
    {
      "href": "https://mfahadbashir.hashnode.dev/tag/artificial-intelligence",
      "label": "# artificial-intelligence",
      "type": "a"
    }
  ],
  "retry_at": "2026-10-03T08:08:22",
  "repair_version": 2,
  "repaired_at": "2026-10-14T10:50:45Z",
  "source_url": "https://mfahadbashir.hashnode.dev/why-shift-to-cnns-solving-simple-neural-network-limitations-and-understanding-cnn-part1",
  "papers": [],
  "actual_video_files": [],
  "body_chars": 7008,
  "expected_body_images": 7,
  "discovery_status": "ok",
  "delivery_status": "ok",
  "missing_reason": "",
  "raw_html": "attachments/a35ef7c66941/pages/source.html",
  "local_html": "attachments/a35ef7c66941/pages/article.html",
  "body_base_path": "attachments/a35ef7c66941/pages/",
  "body_markdown_path": "attachments/a35ef7c66941/pages/article.md"
}