Patch Embeddings
Flattening a fixed-size image patch into a raw pixel vector, then projecting it with one shared learned matrix into a transformer's token embedding dimension.
Think of It Like This
Like cutting a jigsaw puzzle into 16 square cardboard tiles and stamping each tile with a barcode that a reader scans in sequence.
Patch embedding is the layer between raw pixels and a sequence a transformer can read: slice the image into non-overlapping squares, unroll each into a vector, then multiply by one shared learned projection matrix — the same matrix for every patch.
The whole operation is mathematically identical to a single convolution whose kernel size and stride both equal the patch size, which is why it's the natural input layer for a Vision Transformer even though nothing downstream uses convolution again.