Part 5 · Article 2 Stage 2 · How modern AI works

CONVOLUTION: SCANNING FOR PATTERNS

The sliding magnifying-glass idea—how one tiny 3×3 number stamp scans across an entire image to spot edges, textures, and hairline fractures anywhere they hide.

About 13–15 minutes

01

The Magnifying Glass That Only Looks for One Clue at a Time

Imagine searching a gigantic crowded "Where's Waldo?" poster—or scanning a 4-million-pixel chest X-ray for a tiny 4-millimeter lung nodule. You don't stare at all 4 million pixels in one frozen instant. Instead, your eyes glide smoothly from top-left to bottom-right, examining one small neighborhood at a time and asking: "Does this tiny patch look like a curved border? A dark circle? A sharp vertical edge?"

That exact sliding magnifying-glass trick is called Convolution—and despite having one of the scariest-sounding names in mathematics, it is built out of simple elementary-school multiplication and addition [1].

Instead of wiring every single pixel to every neuron (which would require billions of messy, fragile connections that break the moment an object shifts one inch sideways), a Convolutional Neural Network (CNN) slides small, reusable pattern stamps—called filters or kernels—across the entire image to light up every spot where a specific visual clue appears.

ZappyHold on! You're telling me "convolution" is literally just sliding a tiny 3×3 stencil across a photo like a rubber stamp?

Prof. BoltSpot on! Slide the stencil one pixel right, multiply overlapping numbers, add them up, write down the score, and keep sliding! One tiny 9-number stencil can hunt down every vertical bone edge across an entire X-ray!

02

Try It Yourself: Inside a 3×3 Edge-Detector Stamp

Let's actually run a real convolution in our heads—zero calculus required! Picture a tiny 3 × 3 magnifying-glass stamp designed to detect a vertical bright-to-dark edge (like the sharp outer border of a thigh bone on an X-ray). Its 9 numbers are:

  • Left column: [ +1, +1, +1 ] (likes bright white pixels on the left)
  • Middle column: [ 0, 0, 0 ] (neutral)
  • Right column: [ -1, -1, -1 ] (subtracts right-side pixels)

Now slide this 3×3 glass over two different patches of our X-ray:

Patch A (Flat Uniform Gray Background — All Pixels = 100): Multiply each pixel by the stamp and add: Left side gives +300, right side gives -300. Total score = 0! The filter stays completely dark—no vertical edge here.

Patch B (Sharp Bone Edge — Left Pixels = 220 Bright Bone, Right Pixels = 40 Dark Muscle): Left side gives +660, right side gives -120. Total score = +540! Boom—the magnifying glass lights up like a neon beacon! Slide that exact stamp over every 3×3 neighborhood across the entire scan, and out pops a brand-new glowing blueprint—called a Feature Map—tracing every single vertical bone outline in the body while erasing flat empty backgrounds [2].

How One Sliding Filter Turns Raw Pixels Into a Glowing Feature Map
Place 3×3 Stamp on Patch Multiply & Sum 9 Numbers Slide 1 Step (Stride) Glowing Feature Map!
FROM HAND-CRAFTED FILTERS TO LEARNED FILTERSWhy deep learning stopped guessing stencils by hand and let backpropagation invent hundreds of its own
03

The Breakthrough: Letting the AI Invent Its Own Magnifying Glasses

For thirty years (1970s–2000s), computer-vision engineers wrote famous edge and blur stencils by hand—like the Sobel filter (which is basically the exact vertical-edge stamp we just did!) and Gaussian blur filters inside Photoshop. That worked great for basic photo editing, yet nobody could possibly hand-design the exact 9 numbers to detect "fuzzy ground-glass opacity in viral pneumonia" or "torn anterior cruciate ligament fiber."

In a Convolutional Neural Network, the 9 numbers inside every filter are learnable weights! Layer 1 doesn't use just one stencil—it might use 64 different 3×3 stencils simultaneously, all initialized randomly. During backpropagation, the network automatically tunes Filter #1 to catch 45-degree bone edges, Filter #2 to catch bright metallic pins, Filter #3 to catch soft circular shadows, and so on—producing a stack of 64 glowing feature maps [3].

Then Layer 2 slides a brand-new set of 128 magnifying glasses across that stack of 64 feature maps—combining simple edges into corners, branching blood vessels, and textures! Layer 3 combines textures into anatomical parts, and by Layer 20, a single tiny filter sees the whole lung field or knee joint at once.

Weight Sharing (Huge Efficiency)

Because the exact same 9-number filter scans all 4 million pixels, Layer 1 needs just 9 weights per filter instead of 4 million! That slashes memory and prevents overfitting.

Shift Invariance (Works Anywhere)

Whether a hairline wrist fracture sits in the top-left corner or dead center of the film, the sliding fracture-edge stencil finds it reliably without ever needing to relearn every pixel coordinate.

04

Three Engineering Knobs: Stride, Padding, and Receptive Field

When engineers design a convolutional layer, three simple practical knobs control how the magnifying glass moves:

  • Stride (Step Size): Does the glass slide 1 pixel at a time (Stride = 1, ultra-detailed) or jump 2 pixels at a time (Stride = 2, faster and shrinks the output map by half)?
  • Padding (Border Cushion): Without a cushion, corner pixels only get scanned once while center pixels get scanned nine times, shrinking the image slightly every layer. Adding a 1-pixel rim of zeros around the frame (Zero Padding) lets the glass examine border ribs and skin margins just as fairly as the center.
  • Receptive Field (How Wide a View Each Neuron Has): A Layer 1 neuron only sees a tiny 3×3 patch of pixels. A Layer 2 neuron looking at 3×3 Layer 1 neurons sees a 5×5 patch of the original photo. Stack 20 layers plus pooling, and a deep neuron's receptive field spans the entire X-ray—allowing it to compare the left lung against the right lung for symmetry! [4]
05

CNNs vs. Vision Transformers (ViTs): The Modern Twist

For a solid decade after 2012, Convolutional Neural Networks ruled computer vision unchallenged. Then in 2020, Google researchers asked a bold question: "Can the exact same Transformer architecture powering ChatGPT also read pictures without sliding convolutions?"

They unveiled the Vision Transformer (ViT) [5]: instead of sliding a tiny 3×3 glass pixel by pixel, ViT slices a photo into a neat 16×16 patchwork quilt (like 196 square puzzle tiles), treats each tile like a "word," and uses Self-Attention so every tile can look directly at every other tile across the whole image right from Layer 1! Today, modern medical vision uses both: CNNs (like ConvNeXt and U-Net) remain fast, data-efficient champions for clinic-sized imaging datasets, while Vision Transformers shine when pre-trained on millions of scans and paired with text in multimodal medical AI [6].

Vision EngineHow It Scans an ImageBiggest StrengthBest Clinical Fit
Hand-Coded Filters (Sobel)Fixed 3×3 math stampInstant, zero training neededBasic edge sharpening & contrast prep
CNN (ResNet / U-Net)Learned sliding 3×3 magnifying glassesFast, data-efficient, great local detailX-rays, CT/MRI segmentation, edge devices
Vision Transformer (ViT)16×16 patch tiles + global attentionSees whole-image context from Layer 1Giant multi-hospital foundation & text+image AI
Standard 2D convolutions don't automatically know "up from down" if you flip a medical scan upside down or mirror left and right—forgetting left-right orientation can confuse rare mirror-image heart anatomy (dextrocardia) unless engineers guard against blind horizontal flipping during data augmentation!

ZappySeeing that 3×3 vertical-edge math with +1 and -1 made convolution click in ten seconds! It's literally just a learnable pattern spotlight.

Prof. BoltAnd once a machine can spotlight edges, curves, and whole organs anywhere on a scan, it can do three wildly useful jobs: name what's there, draw a box around it, or trace its exact pixel outline!

Convolution slides tiny, learnable magnifying-glass filters across an image to build glowing feature maps—giving vision models shift invariance and efficiency that still power medical imaging alongside modern Vision Transformers.
06

3D Convolutions: Scanning Through Stacks of CT and MRI Slices

Up to now, we pictured sliding a flat 2D 3 × 3 magnifying glass across a flat photograph or single X-ray. Now ask yourself: "How does a vision AI read a 3D brain MRI or chest CT scan containing 250 stacked cross-section slices?"

Engineers have two clever strategies—and understanding both explains how modern hospital radiology AI works:

  • 2.5D Slice Stacking (Fast & Clever): Instead of looking at Slice #112 all by itself, feed Slice #111 (above), Slice #112 (middle), and Slice #113 (below) into the exact same three Red/Green/Blue channels of a standard 2D CNN! That gives a fast 2D network instant awareness of whether a round white dot is a tiny spherical lung nodule (which vanishes on neighboring slices) or simply a harmless blood vessel traveling straight up and down through all three slices!
  • True 3D Convolutions (The Rubiks-Cube Magnifying Glass): Replace the flat 3 × 3 stencil with a tiny 3D cube (3 × 3 × 3 = 27 weights) that slides left-right, up-down, AND front-to-back through the entire 3D volume of voxels! True 3D CNNs capture full organ shapes, tumor volumes, and joint alignment natively—at the cost of much heavier GPU memory, which is why modern hospital workstations pair fast 2.5D screening with high-precision 3D segmentation.

The evidence file

Checked December 2026. Source types are labelled. Dialogue is fictional.

  1. CS231n: Convolutional Neural Networks for Visual Recognition, Stanford University Course Notes, updated 2025; visual breakdown of kernels, stride, padding, and feature maps.
  2. Image Kernels Explained Visually, Interactive Explainer (Victor Powell), 2015; hands-on demonstration of 3×3 Sobel edge and sharpen filters.
  3. Gradient-Based Learning Applied to Document Recognition, Proceedings of the IEEE (LeCun et al.), 1998; learned convolutional weights and parameter sharing.
  4. Computing Receptive Fields of Convolutional Neural Networks, Distill.pub, 2019; how stacked 3×3 filters expand to whole-image context.
  5. An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale (ViT), ICLR (Dosovitskiy et al.), 2021; introducing patch-based Vision Transformers.
  6. A ConvNet for the 2020s (ConvNeXt), CVPR (Liu et al.), 2022; proving modernized CNNs remain competitive with Vision Transformers.
Write to ussrini.present@gmail.com
Read more: srinipresents.com