A from-scratch, fully readable image classifier. Every one of its 21 middle neurons is a named formula a person can compute by hand from the pixels - there is no learned black-box hidden layer anywhere in it. Loadable with numpy and safetensors, no PyTorch.
| metric | value |
|---|---|
| held-out accuracy | 84.62% |
| matched plain control (same parameter count, same data, same recipe) | 84.86% |
| accuracy with the concept layer ZEROED | 9.98% |
| accuracy with the concept layer SHUFFLED across images | 9.55% |
| concepts that pass their own honesty audit | 20 of 21 |
| parameters | 15977 |
| middle layer | 21 named concepts |
Zeroing and shuffling are the two ablations that separate a readable model from a decorative one: with the concept layer set to zero only the answer bias remains, and with it shuffled the layer keeps its statistics but loses per-image content. Both collapse accuracy to about 10%, so the named layer is what does the work, and the answer layer reads per-image content rather than the layer average.
| # | concept | formula |
|---|---|---|
| 0 | is_bright |
mean(pixel) > 0.50 |
| 1 | is_dark |
mean(pixel) < 0.20 |
| 2 | has_high_contrast |
std(pixel) > 0.30 |
| 3 | has_low_contrast |
std(pixel) < 0.12 |
| 4 | top_half_heavier |
mean(top 14 rows) - mean(bottom 14 rows) > 0.05 |
| 5 | bottom_half_heavier |
mean(bottom 14) - mean(top 14) > 0.05 |
| 6 | left_half_heavier |
mean(left 14 cols) - mean(right 14 cols) > 0.05 |
| 7 | centre_heavier |
mean(centre 14x14) - mean(border) > 0.05 |
| 8 | left_right_symmetric |
`mean |
| 9 | top_bottom_symmetric |
`mean |
| 10 | has_vertical_edges |
`mean |
| 11 | has_horizontal_edges |
`mean |
| 12 | vertical_edges_dominate |
`mean |
| 13 | has_fine_texture |
`mean |
| 14 | has_flat_region |
`mean |
| 15 | mostly_ink |
fraction(pixel>0.5) > 0.55 |
| 16 | mostly_empty |
fraction(pixel>0.5) < 0.10 |
| 17 | is_thin_structure |
0.10 < fraction(pixel>0.5) < 0.35 |
| 18 | has_top_edge_ink |
mean(top 5 rows) > 0.35 |
| 19 | has_bottom_edge_ink |
mean(bottom 5 rows) > 0.35 |
| 20 | has_diagonal_structure |
`mean |
Each concept is a 0/1 claim about the image, computed directly from the pixels. The model is trained to match each one, and then audited on whether its neuron actually fires on its own name (AUROC against the formula) - which is what the honesty row above reports.
The explainer ships with the weights. Download the repo, then:
pip install numpy safetensors
python explain_image.py
It prints the answer with the concepts that produced it, each concept's formula, the ones that argued against it, and the arithmetic that shows the contributions add up to the
score exactly - because the answer really is logits = concepts @ answer.W + answer.b, so every term is a named concept's exact contribution rather than an approximation.
model.safetensors (float32), config.json (concepts, formulas, supports, measured numbers), explain_image.py, MANIFEST.json (sha256 of every file).
Fashion-MNIST at 15977 parameters. It classifies 28x28 grayscale clothing images; it cannot describe an image in words and it does not generalise to photographs. The readable architecture is here measured at parity with a plain model of the same size in the mean, with a tighter spread across random seeds (8 seeds: standard deviation 0.49 points against the plain control's 1.26, a 2.6x tighter spread - earlier 3-seed figures were smaller-sample estimates and are superseded by these).