liveBook · Manning

Edge

As explained in Math and Architectures of Deep Learning

A boundary-like location in an input array where values change abruptly, producing a strong convolution response here.

An edge is a sharp change in values within an input array. In a one-dimensional signal, a large difference between successive elements marks an edge; in an image, an abrupt color change marks an edge. Flat regions carry less semantic information than boundaries such as a person’s silhouette. section 10.1.2 section 10.3.2

Convolution detects edges by weighting neighboring values with positive and negative kernel elements. Uniform neighborhoods cancel toward zero, while a sharp transition produces a large positive or negative response. A one-dimensional filter therefore spikes at jump locations, and two-dimensional kernels can distinguish vertical from horizontal edges. section 10.1.2 section 10.3.2

Detecting an image edge with PyTorch

For a grayscale image, a fixed 2 × 2 kernel such as [[−0.25, 0.25], [−0.25, 0.25]] responds to horizontal changes across its columns. PyTorch represents the image and kernel as four-dimensional tensors, shaped N × C × H × W, then applies Conv2d with the weights held fixed. section 10.3.3

Figure 10.6 Graph of the input array solid) and output array (dashed) from figure 10.3. The output the input. Edges provide vital clues for understanding the signal.

Compare the input signal with its convolution output and see how response spikes align with edge locations. section 10.1.2

How Math and Architectures of Deep Learning covers it

How deep it goes
Explains edge responses from value differences through 1D and 2D kernels, then demonstrates fixed PyTorch weights without developing learned filters.
Examples
Uses a jumping one-dimensional array, a silhouette against a wall, directional image kernels, and fixed-weight PyTorch Conv2d.
What it assumes
Assumes convolution basics while defining edges from zero through array differences and neighborhood responses.
What you can do after
Apply edge detection via hand-chosen convolution kernels and interpret the resulting response spikes.
How it connects
Connects edges with convolution, image understanding, semantic information, and human visual attention.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Math and Architectures of Deep Learning. The section links point to the parts of the book it draws on.