A patch extractor turns an image into a sequence of small image tiles, then converts each tile into a vector that a transformer can process. It plays a role similar to tokenization for text. section 6.3.1
The conversion proceeds in a few practical steps:
- Divide the image into fixed-size patches, commonly square tiles such as 16 × 16 pixels. section 6.3.1
- Represent every pixel with its red, green, and blue values, producing a 768-value vector for each 16 × 16 RGB patch. section 6.3.1
- Pass each initial vector through a small neural network before sending the sequence to the transformer. section 6.3.1
A tiled image
Treating an image like a sheet of tiles makes the process easier to picture: each tile is individually uninformative, but the sequence of vectors can represent the complete image for the transformer. section 6.3.1
