AI Dictionary of Terms

CNN (Convolutional Neural Network)

A specialized type of neural network designed to automatically learn spatial hierarchies of features from grid-like data such as images, making it the foundation of modern computer vision.

The Simple Version

Imagine you’re trying to teach a computer to recognize cats in photos. You could show it thousands of cat pictures and tell it “this is a cat” each time. But that’s not how humans learn, is it?

When you look at a cat photo, your eyes don’t look at every single pixel at once. Instead, they move around and notice patterns: first edges and lines, then shapes like circles and triangles, then bigger patterns like ears and eyes, and finally the whole face.

A CNN works the same way. It has special “filters” that slide across an image, looking for small patterns first (like edges), then combining those to find bigger patterns (like shapes), and eventually recognizing whole objects (like a cat). It’s like having a team of detectives, each looking for different clues, working together to solve the mystery of “what’s in this picture?”

Detailed Explanation

CNNs are designed to process data with grid-like topology, most commonly images. They use a mathematical operation called convolution, where learnable filters (kernels) slide across the input to detect local patterns.

Core components:

How it works:

  1. Feature Extraction: Early layers detect simple features (edges, corners)
  2. Hierarchical Learning: Deeper layers combine simple features into complex patterns (shapes, objects)
  3. Spatial Invariance: CNNs can recognize objects regardless of their position in the image
  4. Parameter Sharing: Same filter is applied across entire image, reducing parameters

Common architectures (with foundational papers):

Key Characteristics

Business Context

CNNs are essential for enterprise applications involving visual data:

Use cases:

Business advantages:

Considerations:

Real-World Analogy

Looking at a painting through a series of magnifying glasses. First, you use a small magnifying glass to see brush strokes and colors. Then a larger one to see shapes and forms. Finally, you step back to see the whole composition. Each level of magnification reveals different details, and together they help you understand the entire artwork.

Code Example

# Simple CNN for image classification using PyTorch
import torch
import torch.nn as nn
import torch.nn.functional as F

class SimpleCNN(nn.Module):
    def __init__(self, num_classes=10):
        super(SimpleCNN, self).__init__()
        
        # Convolutional layers
        self.conv1 = nn.Conv2d(3, 32, kernel_size=3, padding=1)
        self.conv2 = nn.Conv2d(32, 64, kernel_size=3, padding=1)
        self.conv3 = nn.Conv2d(64, 128, kernel_size=3, padding=1)
        
        # Pooling layer
        self.pool = nn.MaxPool2d(2, 2)
        
        # Fully connected layers
        self.fc1 = nn.Linear(128 * 4 * 4, 512)
        self.fc2 = nn.Linear(512, num_classes)
        
    def forward(self, x):
        x = self.pool(F.relu(self.conv1(x)))
        x = self.pool(F.relu(self.conv2(x)))
        x = self.pool(F.relu(self.conv3(x)))
        
        # Flatten
        x = x.view(-1, 128 * 4 * 4)
        
        # Fully connected layers
        x = F.relu(self.fc1(x))
        x = self.fc2(x)
        
        return x

# Initialize model
model = SimpleCNN(num_classes=10)
total_params = sum(p.numel() for p in model.parameters())
print("Total parameters:", total_params)

Common Misconceptions

Sources & Further Reading