Understanding AI · lesson 35 of 60 · about 6 minutes
Recognising Things
From edges to shapes to a cat. See how a network adds up evidence to recognise what's in a picture.
What you'll learn
- Explain how features add up to a decision
- Score a picture from the features found
- Explain why AI can be fooled by odd pictures
Adding up evidence
By its last layers, a network has detectors for things like pointy ears, whiskers and fur. The final layer weighs that evidence, just like a neuron weighs inputs, and gives each possible answer a score. The highest score wins.
A pretend final layer. Each feature found adds to some answers' scores.
found = {"pointy ears": 1, "whiskers": 1, "wheels": 0}
cat = found["pointy ears"] * 2 + found["whiskers"] * 3 + found["wheels"] * -5
car = found["pointy ears"] * -1 + found["whiskers"] * -1 + found["wheels"] * 5
print("cat:", cat)
print("car:", car)Output
cat: 5
car: -2Easy to fool
Because AI adds up patterns rather than truly understanding, unusual pictures can fool it: a cow on a beach instead of a field, or a photo with a few carefully changed pixels. People would never be fooled by these, which shows how different AI's seeing is from ours.
Tip
AI adds up evidence. It doesn't understand what it's looking at.
Now try it yourself
This lesson is free in Codiqo, with 6 questions on what you just read. You can only learn to code by writing code, so it ends with a short program you write yourself, which we run and check straight away.