Follow
Subscribe via Email!

Enter your email address to subscribe to this platform and receive notifications of new posts by email.

Convolutional Neural Networks Learn Visual Features in Layers

Convolutional neural networks use shared filters, pooling layers, and deep hierarchies to read images, speech, and spatial data with far fewer weights than standard networks.
A matrix diagram illustrating how a convolution filter multiplies across a padded image grid.

Convolutional neural networks are feedforward neural networks that learn visual and spatial patterns by sliding small filters across input grids. Unlike standard networks that wire every neuron to every pixel, a ConvNet (often called a CNN) arranges neurons in three dimensions—width, height, and depth—and shares one set of weights across an image [1, 4]. On a 100-by-100 pixel image, a 5-by-5 filter needs 25 shared weights instead of 10,000 separate weights per neuron [1]. Early layers respond to edges and color blotches, while deeper layers assemble those signals into shapes for tasks from radiology to speech recognition [4, 16, 17].

How Do Convolutional Neural Networks Work?

Convolutional neural networks take in pixel grids as three-dimensional volumes, such as a 32-by-32-by-3 color image from the CIFAR-10 dataset. Each convolutional layer slides small learnable kernels over the width and height of that grid while spanning its full channel depth [2, 4]. At every stop, the filter computes a dot product—usually a Frobenius inner product—with the local input patch to produce a 2D feature map [1, 2].

Stacking several filters in one layer creates a deeper output tensor, turning a 32-by-32-by-3 image into a 32-by-32-by-12 volume when 12 filters scan the input. An activation layer using ReLU then sets negative numbers to zero without changing that volume’s size [1, 4]. Three hyperparameters set the output shape: filter count (depth), stride, and zero-padding [2, 4]. A stride of 1 shifts the kernel one pixel at a time, while a stride of 2 or 3 produces smaller maps with less overlap. Zero-padding adds zeros around the borders so edge pixels stay in play and spatial dimensions do not shrink after each step [2].

At the end of the pipeline, the network flattens the final feature maps and passes them through fully connected layers [1, 4]. Every neuron in those ending layers connects to all values from the previous volume, computing class scores such as CIFAR-10’s 10 object categories via Softmax or an SVM loss [4].

Diagram illustrating stride movement across an input grid in convolutional neural networks
Stride settings control how many pixels a filter shifts across an input volume in CS231n notes. (Credit: CS231n)

Receptive Fields and Shared Weights

Ordinary fully connected networks scale poorly as images grow larger. In Stanford CS231n’s breakdown, a single neuron in the first hidden layer for a 200-by-200-by-3 RGB photo needs 120,000 weights. Adding more neurons multiplies that count quickly, wasting memory and pushing the network to overfit training noise [1, 4].

Convolutional layers cut that load with local connectivity and shared parameters. Each neuron reads only a small 2D patch called its receptive field, such as a 5-by-5 pixel square, while still connecting through the full input depth [1, 4]. A 5-by-5 filter on a 32-by-32-by-3 volume holds 75 weights plus one bias, and a 3-by-3 filter on a 16-by-16-by-20 volume needs 180 connections [4]. Because every spatial location in one feature map shares the same weight vector and bias, a CNN stores far fewer free parameters. Wikipedia notes that this shared-weight design also helps prevent vanishing and exploding gradients during backpropagation [1].

Receptive fields widen automatically in deeper layers because each convolution aggregates pixels from earlier windows. Networks can also expand a neuron’s view without adding weights by using dilated—or atrous—convolutions, which insert gaps between kernel entries [1, 2]. A single dilated layer can even combine filters with different dilation ratios [1].

Pooling Layers

Pooling layers sit between convolutional stages to shrink spatial dimensions by combining local clusters of neurons into single outputs. A 2-by-2 local pooling window reduces a 32-by-32-by-12 activation volume to 16-by-16-by-12 using fixed rules and no trainable weights [1, 4]. Max pooling picks the largest number in each cluster, whereas average pooling takes the mean. Global pooling compresses every neuron in a feature map into a single value [1].

Some networks factor standard convolutions into two lighter steps to cut compute costs. Developed by Laurent Sifre during a 2013 Google Brain internship as a variation on AlexNet, depthwise separable convolution runs a spatial filter over each input channel alone and then merges channels with a 1-by-1 pointwise filter [1, 2]. In a 2016 arXiv preprint that has not undergone peer review, François Chollet tested this idea in Xception. Matching Inception V3 in parameter count, Xception edged ahead on ImageNet and beat it on a 350 million-image, 17,000-class dataset through better parameter use [9].

Visual representation of learned filter weights from the CS231n convolutional network guide
Learned filter weights from the first convolutional layer as shown in Stanford CS231n materials. (Credit: CS231n)

Other architectures reverse standard CNN flow to build images from compact codes. Transposed convolutions—also called deconvolutions—multiply by transposed matrices to upsample tensors for image generation and semantic segmentation, though default setups cause checkerboard artifacts unless networks upscale before convolving [1, 2].

Visual Cortex Roots to LeNet-5

Biological vision research gave CNNs their layered blueprint. In the 1950s and 1960s, Hubel and Wiesel studied cat visual cortices and found neurons that respond only to restricted patches of the visual field [1, 2]. Their 1968 paper split those cortical units into simple cells, which fire strongest for straight edges at specific angles, and complex cells, which cover wider regions and ignore small edge shifts [1]. Decades later, Olshausen and Field (1996) showed that sparse linear codes on natural scenes match those simple-cell filters, a pattern also seen in bottom CNN kernels [2].

Kunihiko Fukushima translated those findings into a multilayer visual model in 1969 using ReLU activation and identical, non-trainable weights over each layer. In 1979 and 1980, Fukushima introduced the neocognitron, pairing trainable weight-sharing S-layers with downsampling C-layers that learned patterns without supervision—a method he called “learning without a teacher” [1, 2]. That split between local feature extraction and spatial pooling set the basic template for later ConvNets [1].

Trainable backpropagation networks for real documents followed in the late 1980s and 1990s. Yann LeCun and colleagues applied backpropagation to zip code reading in 1989 and built a series of CNNs culminating in LeNet-5 in 1998. Trained on MNIST handwritten digits, LeNet-5 read characters straight from pixels despite noise and shifts, and banks put it into automated teller machines [2, 5].

Video thumbnail for Deep Learning for Computer Vision featuring Andrej Karpathy of OpenAI
Andrej Karpathy discusses deep learning for computer vision in a recorded interview. (Credit: Lex Fridman)

GPU Contests and AlexNet

Deep networks stalled for years because Sepp Hochreiter proved in 1991 that backpropagated error signals either grow or decay exponentially across many layers. Many researchers turned to unsupervised pre-training in 2006 to work around the problem. In 2010, Dan Ciresan and Jürgen Schmidhuber’s lab at IDSIA ran plain backpropagation on graphics processing units (GPUs) 50 times faster than CPUs and broke the MNIST record—a result one reviewer called a “wake-up call” [6].

In 2011, the IDSIA team scaled that GPU speedup to deep CNNs with DanNet, running 60 times faster than CPU models. DanNet won the ICDAR 2011 Chinese handwriting contest, leading Apple to hire one team member, and in August 2011 outperformed humans twofold on traffic sign recognition [6, 10]. In a 2012 arXiv preprint not yet peer-reviewed, Cireşan, Ueli Meier, and Schmidhuber reported that multi-column DanNet averages also approached human accuracy on MNIST [10]. DanNet then won 2012 image segmentation, object detection, and breast cancer mitosis contests, scanning images over 1,000 times faster than earlier methods [6].

Mainstream computer vision shifted permanently in 2012 when Alex Krizhevsky, I. Sutskever, and G. E. Hinton won ImageNet with AlexNet. Built with eight trainable layers, about 650,000 neurons, and 60 million parameters, AlexNet paired GPU convolutions and ReLU neurons with “dropout” regularization to hit a 15.3% top-5 test error against the runner-up’s 26.2% [2, 7].

Graphic from Juergen Schmidhuber's archive on GPU-trained deep neural networks
Archival graphic accompanying SchmidhuberAI’s timeline of GPU-trained computer vision contest winners. (Credit: SchmidhuberAI)

Deeper CNN Architectures

From the 2013 ImageNet contest onward, almost every competing system relied on deep CNNs, pushing architectures like VGGNet and GoogLeNet past AlexNet’s eight layers [2, 4]. Even so, feedforward networks topped out at roughly 20 to 30 layers until May 2015, when R. K. Srivastava, K. Greff, and J. Schmidhuber built Highway Networks with over 100 layers using gating ideas borrowed from LSTM networks [6].

In December 2015, K. He, X. Zhang, S. Ren, and J. Sun released ResNet in an arXiv preprint that has not passed peer review [8]. Schmidhuber described ResNets as Highway Networks whose gates stay permanently open [6]. Rather than fitting unreferenced mappings, ResNet blocks learn residual functions tied to layer inputs, letting a 152-layer ensemble—eight times deeper than VGG nets at lower complexity—win ILSVRC 2015 with a 3.57% error rate and boost COCO object detection by 28% relative [8].

Speed budgets and object localization shaped other designs. In a 2014 arXiv preprint not yet peer-reviewed, K. He and J. Sun balanced filter counts and sizes to hit 11.8% top-5 ImageNet error 20% faster than AlexNet’s 16.0% [11]. For locating objects inside bounding boxes, the R-CNN line evolved from November 2013 R-CNN to Faster R-CNN in June 2015—which folded region proposals inside the network—and Mask R-CNN in March 2017, which added pixel-level instance segmentation via ROIAlign [3].

Small Shifts in Input Images

Many engineers assume pooling and shared kernels make CNNs immune to small image shifts, yet moving or resizing an input by a few pixels can flip its predicted class [12, 13]. In a 2019 Journal of Machine Learning Research paper, Aharon Azulay and Yair Weiss showed that standard CNNs ignore the classical sampling theorem. They also found that data augmentation only grants invariance for inputs that closely resemble typical training photos [12].

Other studies tested how individual layers affect that weakness. In a 2017 arXiv preprint not yet peer-reviewed, E. Kauderer-Abrams used translation-sensitivity maps to measure shift tolerance across architectures. His experiments showed that pooling layer counts and convolution filter sizes had only a secondary effect, pointing to training data augmentation as the main driver of shift tolerance [14].

Convolutional Neural Networks Learn Visual Features in Layers — arXiv.org image
(Credit: arXiv.org)

Two architectural fixes aim to restore shift stability without bloating models [13, 14]. In a 2015 arXiv preprint not yet peer-reviewed, M. Jaderberg, K. Simonyan, A. Zisserman, and K. Kavukcuoglu introduced learnable Spatial Transformer modules that warp feature maps dynamically based on the input, helping models handle translation, scale, and rotation [14]. Later, in a 2019 arXiv preprint not yet peer-reviewed, R. Zhang placed low-pass anti-aliasing filters before downsampling, raising ImageNet accuracy and corruption stability on ResNet, DenseNet, and MobileNet [13].

Convolutional Neural Networks in Practice

Convolutional neural networks now anchor software far beyond photo tagging [1, 6]. Region-based models power Google Lens object lookup, text localization, drone camera tracking, and Mask R-CNN runs in the MLPerf Training Benchmark [3]. In 2012, Schmidhuber’s team partnered with steelmaker Arcelor Mittal to spot steel defects using max-pooling CNNs, and major tech firms including Apple, Google, Microsoft, Facebook, and Amazon integrated deep GPU-CNNs into consumer services [6].

Researchers also adapted CNNs to non-photographic signals across science and medicine [16, 17, 18]. O. Abdel-Hamid and colleagues (2014) used limited-weight-sharing CNNs to cut speech recognition errors by 6% to 10% compared with standard deep neural networks on TIMIT phone and voice search benchmarks [17]. G. Masi and co-authors (2016) adapted a three-layer super-resolution CNN with nonlinear radiometric indices to sharpen satellite images in Remote Sensing [18], while R. Yamashita and colleagues (2018) reviewed radiology CNNs in Insights into Imaging and warned that small medical datasets risk overfitting [16].

Newer transformer models have replaced CNNs in some computer vision workloads. Still, surveys by M. Krichen (2023) in Computers and Z. Li and colleagues (2021) document active 1D, 2D, and multidimensional CNN research in natural language processing, brain-computer interfaces, financial time series, and DNA sequence classification [1, 19, 20]. Developers commonly train and deploy these networks using frameworks such as TensorFlow, Keras, PyTorch, and Caffe [19].

Sources
  1. WEBSITE Wikipedia. Convolutional neural network. [Article Link]
  2. WEBSITE Wikipedia. Convolutional layer. [Article Link]
  3. WEBSITE Wikipedia. Region-based convolutional neural network. [Article Link]
  4. WEBSITE CS231n. (2016). Convolutional Neural Networks (CNNs / ConvNets). [Article Link]
  5. WEBSITE LeCun, Y. (1995). LeNet-5, convolutional neural networks. [Article Link]
  6. WEBSITE Schmidhuber, J. (2017). History of computer vision contests won by deep CNNs on GPU. [Article Link]
  7. ACADEMIC JOURNAL Krizhevsky, A., Sutskever, I., & Hinton, G. E. (2017). ImageNet classification with deep convolutional neural networks. Communications of the ACM, 60(6), 84-90. [Article Link]
  8. PREPRINT He, K., Zhang, X., Ren, S., & Sun, J. (2015). Deep Residual Learning for Image Recognition. arXiv. [Article Link]
  9. PREPRINT Chollet, F. (2016). Xception: Deep Learning with Depthwise Separable Convolutions. arXiv. [Article Link]
  10. PREPRINT Ciresan, D. C., Meier, U., & Schmidhuber, J. (2012). Multi-column Deep Neural Networks for Image Classification. arXiv. [Article Link]
  11. PREPRINT He, K., & Sun, J. (2014). Convolutional Neural Networks at Constrained Time Cost. arXiv. [Article Link]
  12. ACADEMIC JOURNAL Azulay, A., & Weiss, Y. (2019). Why do deep convolutional networks generalize so poorly to small image transformations? Journal of Machine Learning Research, 20(184), 1-25. [Article Link]
  13. PREPRINT Zhang, R. (2019). Making Convolutional Networks Shift-Invariant Again. arXiv. [Article Link]
  14. PREPRINT Jaderberg, M., Simonyan, K., Zisserman, A., & Kavukcuoglu, K. (2015). Spatial Transformer Networks. arXiv. [Article Link]
  15. PREPRINT Kauderer-Abrams, E. (2017). Quantifying Translation-Invariance in Convolutional Neural Networks. arXiv. [Article Link]
  16. ACADEMIC JOURNAL Yamashita, R., Nishio, M., Gian, R. K., & Togashi, K. (2018). Convolutional neural networks: an overview and application in radiology. Insights into Imaging, 9(4), 611-629. [Article Link]
  17. ACADEMIC JOURNAL Abdel-Hamid, O., Mohamed, A., Jiang, H., Deng, L., Penn, G., & Yu, D. (2014). Convolutional Neural Networks for Speech Recognition. IEEE/ACM Transactions on Audio Speech and Language Processing, 22(10), 1533-1545. [Article Link]
  18. ACADEMIC JOURNAL Masi, G., Cozzolino, D., Verdoliva, L., & Scarpa, G. (2016). Pansharpening by Convolutional Neural Networks. Remote Sensing, 8(7), 594. [Article Link]
  19. ACADEMIC JOURNAL Krichen, M. (2023). Convolutional Neural Networks: A Survey. Computers, 12(8), 151. [Article Link]
  20. ACADEMIC JOURNAL Li, Z., Liu, F., Yang, W., Peng, S., & Zhou, J. W. (2021). A Survey of Convolutional Neural Networks: Analysis, Applications, and Prospects. IEEE Transactions on Neural Networks and Learning Systems, 33(12), 6999-7019. [Article Link]

Cover image: Daniel Voigt Godoy / Wikimedia Commons, CC BY 4.0

Leave a Comment

Related Posts
Total
0
Share