0
0
PyTorchml~12 mins

Feature map visualization in PyTorch - Model Pipeline Trace

Choose your learning style9 modes available
Model Pipeline - Feature map visualization

This pipeline shows how an image passes through a simple convolutional neural network. It highlights how feature maps are created and transformed at each convolution layer, helping us understand what the model 'sees' inside the image.

Data Flow - 5 Stages
1Input Image
1 image x 3 channels x 32 height x 32 widthRaw image loaded and normalized1 image x 3 channels x 32 height x 32 width
A 32x32 color image with 3 color channels (RGB)
2First Convolution Layer
1 x 3 x 32 x 32Apply 6 filters of size 5x5 with stride 1, padding 01 x 6 x 28 x 28
6 feature maps showing edges and simple patterns
3ReLU Activation
1 x 6 x 28 x 28Apply ReLU to keep positive values, zero out negatives1 x 6 x 28 x 28
Same 6 feature maps with negative values replaced by zero
4Second Convolution Layer
1 x 6 x 28 x 28Apply 16 filters of size 5x5 with stride 1, padding 01 x 16 x 24 x 24
16 feature maps capturing more complex patterns
5ReLU Activation
1 x 16 x 24 x 24Apply ReLU activation1 x 16 x 24 x 24
16 feature maps with negative values zeroed
Training Trace - Epoch by Epoch
Loss
1.2 |****
0.9 |***
0.7 |**
0.5 |*
0.4 |
EpochLoss ↓Accuracy ↑Observation
11.20.45Model starts learning, loss is high, accuracy low
20.90.60Loss decreases, accuracy improves as model learns features
30.70.72Better feature extraction reflected in improved accuracy
40.50.80Model converging, loss dropping steadily
50.40.85Good feature maps help model classify better
Prediction Trace - 5 Layers
Layer 1: Input Image
Layer 2: First Convolution Layer
Layer 3: ReLU Activation
Layer 4: Second Convolution Layer
Layer 5: ReLU Activation
Model Quiz - 3 Questions
Test your understanding
What does the first convolution layer mainly detect in the input image?
ANoise in the image
BFinal classification labels
CEdges and simple shapes
DColor histograms
Key Insight
Feature maps show how the model transforms raw images into meaningful patterns step-by-step. Visualizing these maps helps us understand what the model learns and why accuracy improves during training.