Spatial predictions and generation / 5 of 6

Computer vision architectures

8 minOpening your notebook…

What you’ll learn

  • Explain the main idea of “Computer vision architectures” in your own words.
  • Trace a concrete example and identify the assumptions behind it.
  • Apply the principle in a practice problem and recognize a common failure.

The idea, intuitively

CNNs, vision transformers, and hybrid models organize visual computation differently. CNNs emphasize local shared filters; vision transformers often convert image patches into token sequences. Architecture choices interact with data scale and resolution.

Begin with the numeric image representation and the exact target the model must predict. Image classification, detection, and segmentation use different labels and evaluation rules. Changes in lighting, camera, geography, and resolution can create distribution shifts even when the subject appears unchanged to a person.

Under the hood

A patch embedding projects each flattened patch into a feature vector. A decoder may restore spatial resolution for dense tasks. A classification backbone alone does not automatically perform segmentation or detection.

A useful caution

A larger input resolution can greatly increase computation and attention memory.

A worked example

A 224×224 image split into 16×16 non-overlapping patches produces 14×14=196 patch tokens, before extra special tokens.

How to use this way of thinking

Inspect inputs after preprocessing, not only the original files. Visualize labels and predictions together. Evaluate small objects, rare classes, and unfamiliar capture conditions separately. If a transformation changes the label meaning, it is not a valid augmentation for that task.

Try it yourself

How many 8×8 patches fit into a 32×32 image without overlap?

Key takeaways

  • A learned projection of an image region
  • A larger input resolution can greatly increase computation and attention memory.
  • Check the assumptions with a small example before applying this idea to a larger system.

Check your understanding

0/2 checked

Use feedback to learn. Quiz scores and lesson completion are tracked separately.

1What does a patch embedding represent?
2True or false: Splitting a 32×32 image into non-overlapping 8×8 patches produces 16 patches.
Go to lesson completion

Further reading

Original papers and reference material for this school. External resources may be in English and require internet access.

Stanford CS231n notes (opens a new tab)Hugging Face Diffusers documentation (opens a new tab)

Finish this lesson

Mark this lesson complete when you’re ready to continue.

Start with a question

Introduction to AIAI FoundationsA brief history of AIAI FoundationsTypes of AIAI FoundationsAI, ML, and deep learningAI FoundationsUnderstanding generative AIAI FoundationsEthics, limitations, and responsibilityAI FoundationsLinear algebra for learning systemsMathematics for AIVectors, matrices, and similarityMathematics for AICalculus: measuring changeMathematics for AIDerivatives and gradientsMathematics for AIProbability and statisticsMathematics for AIOptimization and objectivesMathematics for AI
K to open · Escape to close