Books Deep-Read · ML System Design Interview · Chapter 3

Street View Blurring: the question where you skew the threshold on purpose

Machine Learning System Design Interview · Ch 3 · Ali Aminian & Alex Xu · 2023

中文 →

What is this chapter about?

A camera car drives past your front door and photographs the whole street on the way. In those photos there are pedestrians, license plates parked at the curb, and possibly you. The photos are going online for the whole world to browse — so before they do, every face and every plate has to be smudged out. This chapter is about how a machine finds the parts that need smudging, and then smudges them.

First, something strange

You would assume the people building this want it to be as accurate as possible — smudge what needs smudging, nothing more. The opposite is true. They deliberately tune the machine to be paranoid: it would rather smear things that are not faces at all than let one real face through. They know it will smudge the wrong things, and they tune it that way anyway.

Why the old world was hard

The first problem is volume. Count the archive in billions of photos. Even if one person could glance at a photo in five seconds, that is five billion seconds — roughly 158 people working full-time for a year — and the camera cars are out again tomorrow.

The second problem is sneakier. A machine that says "there is a face in this photo" is useless here. What you have to smudge is that particular patch of pixels, so you need to know where the face is and how big it is. "Noticing something is there" and "pointing at exactly where" are two completely different difficulties.

How it actually works

Four moves, each more important than the last.

What it costs

Lean paranoid and the imagery fills up with inexplicably erased shop signs, billboard portraits and street art — and blurring is destructive, so once a patch is smeared it essentially never comes back.

Remember this one line

When one kind of mistake costs orders of magnitude more than the other, "be as accurate as possible" is the wrong goal. The right move is to skew knowingly toward the cheap mistake — and then spend a whole extra stage cleaning up the mess that skew creates.

Want the mechanisms, the notation and the diagrams? → Switch to the deep read