Convolutional Neural Network
Watch learned filters scan pixels, pool local evidence, and produce a real image-classification prediction.
A deliberately tiny two-filter CNN keeps convolution, max pooling, dense classification, and backpropagation numerically visible on ordinary browsers.
Step by step
- Read a tiny 6×6 image.
- Slide two learned 3×3 filters over all valid local patches.
- Apply ReLU to both convolution feature maps.
- Apply 2×2 max pooling with stride 2.
- Flatten both pooled maps into eight features.
- Convert those features to a sigmoid class probability.
- Backpropagate through the dense layer, max-pool switches, ReLU, and both shared filters.
Core formulas
Convolution
z_f[i,j] = ΣₘΣₙ X[i+m,j+n]K_f[m,n] + b_fEach learned filter is reused across image positions.
ReLU
A_f[i,j] = max(0,z_f[i,j])Positive local responses continue.
Max pool
P_f[r,c] = max A_f[2r:2r+2,2c:2c+2]Each local 2×2 region keeps its strongest activation.
Dense output
p = σ(wᵀ flatten(P) + b)Eight pooled features feed the learned output classifier.
When to use Convolutional Neural Network
- Learning convolution, shared kernels, feature maps, pooling, and end-to-end gradients.