A round brown blob with three dark dots. By any yardstick — a single pixel, average color, or pixel distance — chihuahuas and muffins are each other’s closest match. You’ll see a low-level feature that looks for dark spots respond identically to both photos, check what disappears first when you lower the resolution, and find out why a pixel rule picks irrelevant background cells. Finally, we sum up the three ways models go wrong and the whole series.
A round brown blob with three dark dots. Two eyes and a nose, three blueberries, in almost the same places. Are the two alike in numbers, too?
This pair is a classic example of how hard image classification can be. Even people are briefly confused when they glance at small thumbnails. What they share are low-level features (a round blob, beige and brown colors, three dark dots arranged in a triangle); what separates them are high-level features (glints in the pupils, the sheen of a moist nose, fur texture vs bread texture, ears vs the pleats of a paper cup).
This episode pulls out every tool from 4-1 to 4-3 to dissect this pair. We’ll look at how alike they are in numbers (Section 2), why low-level features get fooled (Section 3), what happens when you lower the resolution (Section 4), pixel rules vs patterns (Section 5), and how models go wrong and where their limits lie (Section 6), then sum up the whole series on a single page (Section 7).
“Chihuahua or muffin” comes from a collection of photos that spread widely online around 2016, and it has since become a common example for explaining why image recognition is hard. The images on this page were newly made by the author based on the same idea.
We measure the eye cell and the blueberry cell, the average color of the two photos, and the grayscale pixel distance. By the yardstick of numbers, the chihuahua’s closest friend is the muffin.
| Chihuahua | Muffin | Difference | |
|---|---|---|---|
| One dark cell (R, G, B) · shrunk to 14 × 14 | Eye (39, 37, 43) | Blueberry (37, 31, 37) | Nearly the same |
| Average color of the whole photo (R, G, B) | (189, 162, 138) | (189, 164, 136) | Nearly the same |
| Grayscale pixel distance (56 × 56) | Chihuahua ↔ muffin 61.4 · Chihuahua ↔ dog 71.0 · Chihuahua ↔ cat 87.8 | Muffin is closest | |
Whichever yardstick you use (a single pixel, the average color, or pixel distance), the chihuahua looks most like the muffin. As we saw in 4-2, these yardsticks have no idea “what is in the picture.” You can check the distances for all five photos in the table below.
We measured the pixel distance between every pair of the five photos on this page. The smaller the number, the more “alike” they were computed to be. The smallest value is highlighted.
The values in this table were measured on the five photos on this page (cropped to the face and reduced to 56 × 56). With other photos, the values vary greatly with background, lighting, and framing, but the conclusion that “pixel distance differs from distance in meaning” is a well-known property of real photos too.
This result doesn’t happen “because the model is dumb.” It happens because the simplest ways of comparing numbers measure appearance, not meaning. In this collection, made so that the appearances match, that limit shows up most clearly. In real photos, backgrounds and framing vary, so the numbers may be less alike, but the same kind of trap is still there.
We apply the same filter, one that looks for “round spots darker than their surroundings,” to both photos. In both, three spots are picked up in almost the same triangle.
In the “Dark spot” view, both photos show three black spots in almost the same triangular arrangement. For the chihuahua, they are the two eyes and the nose; for the muffin, three blueberries. The average color is beige and brown for both, too. To a model that uses only the features of the early layers, these two are the same photo.
Note This collection was made with similar framing (front view, white background) to show a “confusing pair.” So the resemblance may stand out more than in randomly taken photos. The same effect is widely known in real chihuahua and muffin photos, but how strong it is varies from photo to photo.
If you lower the resolution to 7 × 7, it gets hard even for people to tell them apart. If a model learned only from small photos, the same thing happens to the model.
The clues that separate the two are subtler: the tiny white glints reflected in the pupils, the moist sheen of the nose, fine fur texture vs crumbly bread texture, ears on top of the head vs the pleats of a paper cup, and whether the three dots are always left-right symmetric (blueberries go wherever they like). To see these, you need the features of the later layers and a wide variety of photos.
The “Dark spot” view finds round dark blobs using the difference between two copies of the photo blurred by different amounts (DoG). This is the same kind of low-level feature that the early layers of a CNN find. To a model that looks only as far as this layer, a chihuahua and a muffin are the same photo. In Code 1, too, the “dark area” of the chihuahua-like and muffin-like pictures we made ourselves came out the same: 5.81% and 5.83%.
We shrink the same photo to 7 × 7, 14 × 14, and 28 × 28. Resolution is the amount of information you give the model.
It starts at 7 × 7. Even to the human eye, the two are almost impossible to tell apart. Raise it to 14, 28, and 56, and note what starts to show up first. Usually the outline of the chihuahua’s ears and the vertical pleats of the muffin cup appear first, and the glints in the eyes and the fur texture appear last.
Lowering the resolution reduces the number of values (the number of features), and the small clues vanish first. Low-level features (the three dots) survive even at low resolution, but the high-level features that separate the two only show up at high resolution.
| Resolution | No. of features | Test accuracy | Most confused pairs (true→predicted: count) |
|---|---|---|---|
| 8 × 8 | 64 | 96.2% | 8→1: 4, 4→1: 2, 3→9: 2 |
| 4 × 4 | 16 | 89.8% | 8→1: 14, 1→8: 6, 1→9: 3 |
| 2 × 2 | 4 | 53.4% | 0→8: 20, 2→4: 17, 1→9: 16 |
We shrank handwritten digits by averaging cells and tested them with the same classifier (logistic regression). As the resolution drops, pairs with similar shapes (8 and 1, 0 and 8) get confused first. The same goes for the chihuahua and the muffin. If a model learns only from small photos, it never even receives the clues that separate the two.
Resolution is the number of cells in the grid. Fewer cells make computation cheap, but the small clues vanish. Real models also fix an input size (e.g., 224 × 224) and shrink photos to fit, so for problems where small differences matter (tiny defects, distant road signs), the choice of resolution has a big effect on performance.
Apply 4-1’s “one variable > threshold” rule to photos, and the computer picks a background cell, out of 784, that happened to fit well. Extract patterns from feature maps, and it gets new photos right too.
In 4-1, the fish were sorted with a single-line rule: “one variable > threshold.” What happens if we apply the same method to the 784 cells of a photo? We find the rule and the patterns on 80 “Training” photos, and check them on 80 “New photos” not used in training.
① In the same way, look for a “one pixel > threshold” rule across all 784 cells.
② Make feature maps with filters, then summarize the pattern over each whole map.
The “New photos” were made by shifting the same 12 images differently from the training set and changing their brightness, so this test is easier than one with completely different photos. The two filters in ② were picked by a person; a CNN learns dozens to hundreds of filters like these from data.
Instead of real photos, Code 1 uses code to draw 28 × 28 “chihuahua-like” and “muffin-like” pictures. Both have a beige circle and 3 black dots; the only differences are the ears (top) and the paper-cup pleats (bottom).
Results: the pixel rule dropped from 73.8% on training to 61.3% on new pictures, and the cell it picked was on the bottom edge of the picture. The low-level feature, dark area, was the same for both kinds (5.81% vs 5.83%), while part patterns (strength of the vertical pleats at the bottom, edge strength at the top) got 96.3% right even on new pictures. We reach the same conclusion as in the real-photo hands-on.
The pixel rule picking a background cell is a small example of shortcut learning. It grabbed an easy clue that just happened to appear together with the right answer in the training photos. To a person, it’s obvious that the cell “has nothing to do with chihuahuas,” but the model only knows that the cell predicts the answer well.
The clues that separate the two (glints, fur texture, ears, cup pleats) only show up in the later layers. How does a model that never learned those clues go wrong?
When you stack layers while shrinking the photo with pooling, one cell in a deeper layer sees a wider area of the original photo. So early layers find small lines, deeper layers find eyes and ears, which are combinations of lines, and even deeper layers find the whole face. This figure is a simplified rendering of the tendency Zeiler and Fergus (2014) showed by visualizing the layer-by-layer responses of a trained CNN.
Shortcut learning. A model grabs the easiest clue that gets the answer right. If the muffins in the training photos were always on white plates, it may learn “white background”; if the chihuahuas were always indoors, it may learn “indoor lighting.” This works well on the training data but falls apart when conditions change [R5]. The pixel rule in Section 5 is a small example of this.
Unfamiliar photos (distribution shift). Under conditions not seen during training, such as a chihuahua in profile, a chocolate chip muffin, or dim lighting, accuracy can drop sharply. A test score is only a score on “photos similar to the training photos” [R6].
Overconfidence. A softmax probability of 0.99 does not mean “99% likely to be right.” A model can output high probabilities even when it is wrong, so for important decisions you need to check separately whether the probabilities match the actual accuracy (calibration) [R7].
So what you need. Data with plenty of confusing pairs, photos under varied conditions (background, angle, lighting), enough resolution, data augmentation (4-3), and the habit of checking what the model based its decision on.
| Matchup | Difficulty | What they look alike in | Decisive difference (features) | Layers that mainly decide |
|---|---|---|---|---|
| Cat vs Human | Easy | A face, two eyes | Fur texture across the middle of the face, pointed ears, stripes, nose shape | Splits from layers 1–2 |
| Cat vs Dog | Medium | Fur, two eyes, upright ears | Muzzle length, nose size, face outline | Layer 3 and beyond (shapes of parts) |
| Chihuahua vs Muffin | Hard | A round brown blob, three black dots | Glints in the eyes, fur texture vs bread texture, ears vs paper cup, symmetry | Later layers (fine texture + overall arrangement) |
The harder the pair, the more you need: more photos (especially confusing ones), enough resolution, later layers, and data augmentation such as CutMix.
Q1. What is the best reason why cat vs human is an easy matchup?
Q2. In Attentive CutMix, if you paste 10 cells of cat patches onto a dog picture, what is the label of the mixed picture?
Q3. Which best explains, in this page’s words, why chihuahua vs muffin is hard?
This pair is only separated once you reach the right end of the layer-by-layer figure, the stage of “judging by the whole arrangement.” That takes a lot of data and a deep model, and it also leaves more room for the model to lean on the wrong clues. Along with performance numbers, looking directly at the photos it got wrong is the most important habit in image classification.
We connect the four episodes into a single flow. Click a box to jump to the explanation in that episode.
| Concept | One-line definition | Key formula | What happens without it |
|---|---|---|---|
| Pixel matrix | A table that writes a photo as a number from 0 to 255 in each cell | X ∈ {0…255}H×W×3 | The computer has no way to compute with photos |
| Feature · target | One row of the table = a sample, a column = a feature, the answer column = the target | (x, y), x ∈ ℝᵈ | You can’t decide what to look at or what to predict |
| Linear classifier (perceptron · linear SVM) | Draws a single plane in feature space | w · x + b > 0 | No way to set a boundary. Still, this alone doesn’t separate pixel photos well |
| Convolution filter | A stamp that finds patterns with a small table of numbers | Σ K·X + b | Each pixel is looked at separately, so no meaning is found |
| Feature map | A new matrix recording where a pattern is and how strong it is | F = ReLU(X∗K) | The next layer has no ingredients to combine |
| Pooling | Keeps only the strongest response and shrinks the size | max(2×2) | Lots of computation, and wobbles even when something moves one cell |
| Fully connected + softmax | Gathers the features into scores and turns them into probabilities | ezk/Σezj | The features are found, but no answer can be chosen |
| Data augmentation | Increases training examples by altering or mixing photos | CutMix, flipping, cropping | Gets only the memorized photos right and fails on new ones |
4-1 covered rules and boundaries built on meaningful variables; 4-2, that a photo is a matrix of numbers and that filters find patterns; 4-3, how to stack layers to change the coordinates and learn by mixing data; and 4-4, the difficulties and limits that still remain. When you meet another classification problem, start by asking: “Do the columns of this data have meaning? If not, what patterns create meaning?”
Both code samples use only libraries that come preinstalled in Colab and built-in data. Click “Download notebook (.ipynb)” and open it in Colab with File → Upload notebook, or copy the code and paste it into a new notebook cell.
Uses code to draw 28 × 28 chihuahua-like and muffin-like pictures, then compares a single-pixel rule, a dark-spot filter, and two part patterns. To use your own data, replace draw() with code that loads your photos, and adjust the regions in pattern() to fit your photos.
Shrinks 8 × 8 handwritten digits to 4 × 4 and 2 × 2, and shows, for each resolution, the accuracy of the same classifier and the most confused digit pairs.
These are prompts to paste into an AI assistant such as ChatGPT, Qwen, or Claude. Click “Copy” and the code you selected is attached after the prompt. Replace the text inside 〔 〕 with your own situation.
An AI’s answer is only a starting point. Always check any papers, figures, or library functions it suggests against the originals and the official documentation. If you used AI help for a competition entry or a paper, disclose that you did and to what extent, following the rules of the organizers or the journal.
This is the same dictionary as the yellow dotted underlines in the text. The same terms are used throughout the series. Click a section name to jump to where the term first appears.
Analogies are a first step toward understanding, but they can also plant misunderstandings. Analogies to the human eye and brain are marked by strength. Direct There is evidence that it actually does the same thing · Partial Only some properties are similar · None No known counterpart
| Concept | Everyday analogy | Human eye/brain analogy | Where the analogy breaks down |
|---|---|---|---|
| Low-level features | A silhouette seen from far away | Partly People, too, judge first by outlines and blobs when they only glance briefly | People immediately bring in context (a plate, a leash) and memory. A model that looks only at the early layers has no such backup |
| High-level features | A face you recognize up close | Partly Higher visual areas have parts that respond to complex shapes such as faces | A model’s high-level features are not necessarily things a person can name, like “eye” or “ear” |
| Resolution | The number of squares on graph paper | Partly The eye, too, sees only the center of the visual field in detail | The eye moves its gaze to where it needs to look closely, but a model sees only one photo shrunk to a fixed size |
| Shortcut learning | A student who memorized the answers by the smudges on the corners of the test sheets | None | The student knows they memorized, but a model doesn’t know which clues it is using |
| Overconfidence | A beginner driver who says, “I’m 99% sure!” | None | A model’s probability is a calculated value, not a feeling. With calibration, it can be matched to the actual accuracy |
E-1 About the Author · E-2 Academic References · E-3 Figure and Data Sources
A guide for instructors, on-the-job training (OJT) leads, and tutors. Times are estimates, so adjust them to your actual class.
| Audience | College students and working adults who have finished 4-1 to 4-3. Practitioners who want to know “where it goes wrong” before bringing image AI into their work |
|---|---|
| Prerequisites | Pixel distance and filters from 4-2; CNNs and data augmentation from 4-3 |
| Learning Goals | ① Explain the difference between low-level features and high-level features with examples ② Explain, using experimental results, how resolution and pixel rules affect classification ③ Distinguish shortcut learning, distribution shift, and overconfidence, and describe how to respond to each |
| Estimated Time | Reading 40–50 min · Demo 25 min · Colab hands-on 25 min (Code 1 15 min, Code 2 10 min) |
Intro 5 min (Section 1) → Sections 2·3 numbers and low-level features 15 min → Section 4 resolution 10 min → Section 6 limits 15 min → Check questions 5 min.
Swap Section 1 for “confusing pairs” from your own work and find them, 15 min → Discuss why the pixel rule in Section 5 picks the background, 15 min → Apply the three failure types in Section 6 to your own data, 25 min → Adapt Code 1 to the framing of your own photos and run it, 35 min.
Beginners: Sections 1·2·3·6 only. Intermediate learners: change pattern() in Code 1 to test how well the ear pattern alone separates them, and research and summarize calibration from Section 6.
| Section | Questions to pause and ask | Interaction tips |
|---|---|---|
| 1 Problem | “What clues do people use to tell them apart?” | Show the image large and point to the glints, ears, and cup |
| 2 In numbers | “Who is the chihuahua’s closest friend?” | Look at the smallest value in each row of the distance table |
| 3 Low-level features | “If the three dots are the same, what will the model use to tell them apart?” | Compare the positions of the numbered spots in the “Dark spot” view |
| 4 Resolution | “What starts to show up first?” | Click in the order 7 → 14 → 28 → 56 |
| 5 Rules vs patterns | “Does the cell the rule picked have anything to do with chihuahuas?” | After “Find pixel rule automatically,” look at the highlighted cell |
| 6 Limits | “If the test score is 95%, will it be 95% in the field, too?” | Pick which of the three failures is most dangerous for your work |
| 7 Series wrap-up | “Do the columns of this data have meaning?” | Click the boxes in the flowchart to move between the four episodes |
| Misconception | Correct explanation | Scene to show |
|---|---|---|
| It gets confused because the model is stupid | By numerical yardsticks, they really are alike. It needs the data and the architecture to learn high-level features | Table in Section 2 |
| Higher resolution is always better | Computation and memory go up, and more data is needed. Match it to the size of the clues the problem needs | Section 4 and Code 2 |
| High accuracy means it looked at the right clues | Shortcut clues such as the background can also produce high scores | The pixel rule in Section 5 |
| A probability of 0.99 means it’s almost certain | A model can output high probabilities even when it’s wrong. Calibration is needed | Overconfidence in Section 6 |
| Collecting more data solves everything | If you only add data under the same conditions, the unfamiliar-photo problem remains. Diversity matters | Distribution shift in Section 6 |
Chihuahua 0.299×39 + 0.587×37 + 0.114×43 ≈ 38.3, blueberry 0.299×37 + 0.587×31 + 0.114×37 ≈ 33.5. Nearly the same.
Because both photos have a round blob and three dark spots in a triangular arrangement, so the responses of the early layers are almost the same.
8→1 (14 times). When the cells are reduced to 16, the two loops of an 8 and the vertical stroke of a 1 end up with similar brightness distributions.
Shortcut learning. It grabbed an easy clue that just happened to appear together with the right answer.
Whether the field photos have the same conditions as the training and test photos (distribution shift), and whether the model’s probabilities match the actual accuracy (calibration). You also need to look directly at the photos it gets wrong.
In Code 1, remove the cup pleats from the muffin-like pictures (delete the cup part) and run it again, see how the part patterns’ accuracy on new pictures changes, and explain it in connection with shortcut learning from Section 6.
Add a case to Code 2 that applies blur (Gaussian) at the 8 × 8 resolution, and compare which lowers accuracy more: “reducing the number of cells” or “blurring.”
| Beginners | You can skip the code results table in Section 4 and ② in Section 5. Make sure Sections 2·3·6 are well understood |
|---|---|
| Advanced | Have learners research and present cases of shortcut learning (medical imaging, self-driving, etc.). Check the papers they find in the original |
| Learn more | 4-1 to 4-3 · 3-3 Images and CNNs · Sangsun Ahn, “Data Science for Business” course materials |
| Instructor materials | Grading criteria for the check questions and sample answers for the assignments are available on the answer page for educators (4-4) |
You’ve read “4-4 Chihuahua vs Muffin” all the way through. The lab crew each have a final word for you.