# A computer sees an image as numbers

Subject: Deep Learning

Exam: MT2

Reader: https://deep-learning-study-room.vercel.app/#mt2/read/7/mt2-c7-s1

Canonical: https://deep-learning-study-room.vercel.app/read/dl/mt2/section/mt2-c7-s1/

**Definition.** A digital image is a spatially arranged numerical tensor. In a CNN, convolutions transform input channels into learned feature maps using local connectivity and spatially shared kernel parameters.

### Explanation and working

A pixel is one position in an image. A grayscale image stores one intensity per position. A colour RGB image usually stores three numbers per position: red, green and blue. Therefore 32 × 32 × 3 means height 32, width 32 and 3 input channels. It contains 32 × 32 × 3 = 3,072 numbers, not 32 neurons.

![Each visible pixel corresponds to a matrix entry. Brightness is a number the network can calculate with.](https://deep-learning-study-room.vercel.app/assets/figures/v_image_grid.svg)

Diagram: Each visible pixel corresponds to a matrix entry. Brightness is a number the network can calculate with.. Labels: Pixels are numerical entries | Pixels are numerical entries | A small grayscale image can be stored as a matrix of brightness values. | 0 | 0 | 0 | 0 | 0 | 180 | 180 | 0 | 0 | 180 | 180 | 0 | 0 | 0 | 0 | 0 | Image | 4 rows × 4 columns | An RGB image has three such channels. A pixel location has a red, green and blue | value.

Each visible pixel corresponds to a matrix entry. Brightness is a number the network can calculate with. Tap the diagram to enlarge.

A **feature** is a useful pattern, such as an edge or texture. A **feature map** is a grid of responses that says where a learned filter matches the input. Early CNN layers often detect local simple patterns; later layers combine them into parts and more complex patterns.

A filter, also called a kernel in many exam questions, is a small set of learned weights. Slide it across the image, multiply corresponding numbers, and add. The same weights are reused at every spatial position. This is **weight sharing**.
