Deep Learning Tutorials

Convolutional Neural Networks (CNNs)

Overview

Convolutional Neural Networks are a class of deep neural networks that excel at processing data with a grid-like topology, such as images. They automatically learn spatial hierarchies of features through convolutional layers, pooling, and non‑linear activations.

Typical Architecture

Convolutional Layer Explained

A convolution operation slides a filter (kernel) over the input, computing dot products to produce a feature map.

The demo visualizes a 3×3 edge‑detecting kernel applied to a grayscale image.

Implementation with TensorFlow/Keras

import tensorflow as tf
from tensorflow.keras import layers, models

model = models.Sequential([
    layers.Input(shape=(32, 32, 3)),
    layers.Conv2D(32, (3,3), activation='relu', padding='same'),
    layers.MaxPooling2D((2,2)),
    layers.Conv2D(64, (3,3), activation='relu', padding='same'),
    layers.MaxPooling2D((2,2)),
    layers.Flatten(),
    layers.Dense(128, activation='relu'),
    layers.Dense(10, activation='softmax')
])

model.compile(optimizer='adam',
              loss='sparse_categorical_crossentropy',
              metrics=['accuracy'])

model.summary()

Further Reading