After studying this material, you should be able to:
Deep learning models are extremely powerful but function as "black boxes" โ they produce outputs without clearly showing why or how.
Input Image โ [Black Box Neural Network] โ Output: "Cat"
โ
What happened in here?
Researchers try to explain models using human-understandable concepts
๐ก Key Idea: Instead of looking at raw numbers inside the network, we map network behavior to concepts humans already understand (e.g., "this unit detects eyes")
A neural network is organized in layers, and each layer contains units (also called neurons or filters).
Layer 1 Units Layer 2 Units Layer 3 Units
[Unit 1] โ [Unit 4] โ [Unit 7]
[Unit 2] โ [Unit 5] โ [Unit 8]
[Unit 3] โ [Unit 6] โ [Unit 9]
Each unit activates (responds strongly) when it detects certain patterns in the input.
| Unit | Activates When It Sees |
|---|---|
| Unit A | Curved edges |
| Unit B | Eyes |
| Unit C | Faces |
๐ก Goal of Explanation Methods: Assign a meaningful label/concept to each unit that describes what it detects
Atomic = single, indivisible concept
Each unit is assigned one simple concept label:
Unit 47 โ "eye"
Unit 83 โ "wheel"
Unit 12 โ "stripe"
Limitation: Reality is more complex. A unit might detect something that cannot be captured by a single word.
Instead of one word, units are explained using logical combinations of concepts:
Unit 47 โ "eye AND (round OR oval)"
Unit 83 โ "wheel AND NOT bicycle"
Unit 12 โ "stripe AND (horizontal OR diagonal)"
These are called logical forms and use operators like:
| Feature | Network Dissection | Compositional Explanations |
|---|---|---|
| Explanation Type | Single concept ("eye") | Logical form ("eye AND round") |
| Expressiveness | Low | High |
| Complexity | Simple | More complex |
| Name for concepts | Atomic | Logical forms |
๐ก Intuition: Compositional explanations are like the difference between describing someone as "tall" vs. "tall AND dark-haired AND wearing glasses"
The most common metric was Intersection over Union (IoU):
Area where Unit Activates โฉ Area of Concept
IoU = โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Area where Unit Activates โช Area of Concept
In simple terms:
Search Process: "Find the best explanation by maximizing IoU"
Evaluation: "Score the explanation using IoU"
โ ๏ธ You are evaluating with the same metric you optimized โ this is like grading your own exam you wrote yourself
"eye""eye AND round""eye AND round AND dark"Question: When do you stop adding concepts? Problem: This requires manually tuning a hyper-parameter โ a subjective choice
Instead of measuring overlap, measure consistency of detection:
"How accurately does a unit detect the presence or absence of its assigned concept across many images?"
Step 1: Take a unit with an assigned explanation (e.g., Unit 47 โ "eye AND round")
Step 2: For a set of images, record:
Step 3: Compare these across all images:
Image 1: Unit activates=YES, Concept present=YES โ โ Correct
Image 2: Unit activates=NO, Concept present=NO โ โ Correct
Image 3: Unit activates=YES, Concept present=NO โ โ Wrong
Image 4: Unit activates=NO, Concept present=YES โ โ Wrong
Step 4: Calculate accuracy:
Detection Accuracy = (Number of Correct Predictions) / (Total Images)
Concept Present?
YES NO
Unit YES โ โ
Activates? NO โ โ
Detection Accuracy = (โ + โ) / Total
Detection Accuracy does not automatically reward longer explanations.
Length 1: "eye" โ DA = 0.78
Length 2: "eye AND round" โ DA = 0.85
Length 3: "eye AND round AND dark" โ DA = 0.83
You can now meaningfully compare these scores
Detection Accuracy can tell you when to stop adding concepts:
Start: DA = 0.60 (too simple, keep going)
Length 2: DA = 0.78 (improving, keep going)
Length 3: DA = 0.85 (improving, keep going)
Length 4: DA = 0.84 (stopped improving โ STOP HERE)
๐ก This eliminates the need for a manually-tuned length hyper-parameter
This is the most intellectually interesting finding:
Observation: Some units have:
Example:
Unit 99:
Length 1 explanation: "face" DA = 0.91
Length 3 explanation: "face AND smiling AND female" DA = 0.89
Interpretation: The unit is specialized โ its simple label "face" is actually an abstraction of a more specific pattern it truly detects
These are called "specialized units" โ their atomic explanation is a perceptual abstraction of their true, more complex behavior
PROBLEM: How do we explain what neural network units detect?
METHOD 1 (Network Dissection):
Unit โ Single Concept ("eye")
[Simple but limited]
METHOD 2 (Compositional Explanations):
Unit โ Logical Form ("eye AND round AND dark")
[More expressive but harder to evaluate]
OLD EVALUATION (IoU):
- Circular (same metric as search)
- Requires hyper-parameter tuning
- Cannot fairly compare lengths
NEW EVALUATION (Detection Accuracy):
- Independent of search process
- Works as stopping criterion
- Reveals specialized units
- Fairly compares all lengths
| Concept | Definition | Key Point |
|---|---|---|
| Neural Unit | Individual neuron/filter in a layer | Activates for specific patterns |
| Atomic Concept | Single-word explanation | Simple but limited |
| Logical Form | Multi-concept explanation using AND/OR/NOT | Expressive but complex |
| IoU | Overlap-based metric | Biased toward longer explanations |
| Detection Accuracy | Classification accuracy of unit's detection | Fair, independent, informative |
| Specialized Unit | Unit whose short label abstracts its longer explanation | Reveals hidden structure |