Lesson 10.1 · 7 min read · about 50 min to master at a very slow pace

From Fully Connected to Convolutional

Why a fully connected layer is a poor fit for images, and the two ideas that fix it: local connectivity and weight sharing. With the parameter count that shows the difference.

Not startedJump to quiz

The problem with fully connected layers on images

In a fully connected (FC) layer every output unit connects to every input value. For an image that ignores two facts:

  • Locality: nearby pixels are related; a pixel in the top-left corner says little about one in the bottom-right.
  • Translation: the same pattern (an edge, an eye) can appear anywhere, and should be detected the same way wherever it is.

Two ideas

IdeaWhat it meansEffect
Local connectivityEach output looks only at a small patch of the input (e.g. 3×3)Far fewer connections
Weight sharingThe same small filter is applied at every positionParameters don't depend on image size; a pattern is detected anywhere

Worked example: parameter count

A 32×32 colour image has values.

  • Fully connected to 100 units: parameters.
  • Convolutional, 16 filters of size 3×3×3: parameters.

The convolutional count depends on the filter size and the number of filters, not on the number of positions the filters slide over.

Rule: a conv layer with filters of size over input channels has parameters.

Stuck? Common doubts

Questions real learners asked while studying this lesson. They stay closed so they don't spoil your own thinking: open only the ones you need.

First passDo fewer parameters make a CNN less powerful?

Not for images. The parameters it gives up encode connections that don't help (distant pixels, position-specific copies of the same detector). Building locality and translation into the architecture makes learning far more data-efficient, which is why CNNs beat FC networks on images while being much smaller.

Cheatsheet

Why convolutions

Local connectivity (small patches) + weight sharing (same filter everywhere). 32×32×3 → 100 FC units: 307,300 params; 16 filters 3×3×3: 448.

Conv layer parameters

(weights + one bias per filter).

See every cheatsheet by category →

Check your understanding

Score 75% or more to master this lesson and earn XP. Answer first, then check.

Q1calculateA 32×32×3 image is flattened and fully connected to 100 units. How many parameters does that layer have?
Q2calculateA convolutional layer has 16 filters of size 3×3 over a 3-channel image. How many parameters does it have?
Q3conceptWhat does weight sharing mean in a convolutional layer?
Q4interpretWhy does the conv layer's parameter count not grow when the input image gets larger?
Q5conceptWhich two properties of images do convolutional layers exploit?