AI Hints
Home›Computer Vision Tutorial›The Field Today
Computer Vision · Lesson 94 of 111

Choosing an Architecture

A practical guide.

⏱ 2 min read▶ Video at 2:28:03🎓 Free
Watch this lesson in the Computer Vision courseWatch on YouTube ↗Full Computer Vision course

There are thousands of published architectures, with a new one each week. Newcomers often spend weeks reading about them, and get nowhere. Here's the truth that experienced engineers know. For most projects, the choice barely matters, and a good default will take you ninety percent of the way.

Choosing an Architecture
From the video: Choosing an Architecture
  • Thousands of architectures
  • A new one each week
  • A good default gets you far

Sensible defaults

Here are sensible defaults. For classification, use a small ConvNeXt or EfficientNet, with transfer learning. For detection, use a recent YOLO. For segmentation, use U-Net for medical images, and a YOLO segmentation model for general use. For features, use DINO, which is very strong. And to go from text to image understanding, use CLIP or a multimodal model.

TaskDefault
ClassificationConvNeXt, EfficientNet
DetectionRecent YOLO
SegmentationU-Net, YOLO-seg
Interactive masksSAM
General featuresDINO
Text and imageCLIP, multimodal model

CNNs and transformers

Are transformers better than convolutional networks? It depends. Convolutions build in useful assumptions, so they learn well from smaller datasets, and they run efficiently on devices. Transformers learn more from huge datasets, and see the whole image at once. With a pretrained start, both work well. In a small project, the data will matter much more.

CNNs

  • Good with less data
  • Efficient on devices
  • Local view that grows

Transformers

  • Great with huge data
  • Heavier
  • Global from the start

How to choose in practice

First, begin with the smallest model that could possibly work. Measure it against your speed limit. Fix your data problems. Only then try a bigger model. Most of the improvement in real projects comes from better data, not from better architecture. And keep your code modular, so that you can swap models in an afternoon.

Start smallmeet the speed limit
Fix data firstbiggest gains
Then go biggerif you need to
Stay modularswap in an afternoon

Summary

Pick a good default, and put your energy into data. Next, a model that changed how people label images.

Key takeaways
  • Defaults get you far
  • Data beats architecture
  • Start with the smallest
Next up: Segment Anything — one click, one mask