Is the network cheating?

An elementary cellular automaton draws a picture. A row of cells, each black or white, is updated over and over by one small rule, and each new row goes under the last, so the picture is the automaton's history with time running down. Some rules wipe the picture clean, some freeze it, some make it flash, some fill it with noise, and people have sorted the 256 rules by these behaviours since the 1980s, by looking. Convolutional neural networks, the workhorses of image recognition, have been trained to do the same from the pictures and score 98 to 100 percent. My question was what such a network is actually looking at, because a spacetime diagram carries more than its behaviour: it also carries the rule that drew it, written out in its pixels.

The answer is in a book chapter with Aisling Daly and Jan Baetens, in Advances in Cellular Automata, volume 2 (Springer, 2025). In one sentence:

A convolutional network that sorts elementary cellular automata by behaviour can read the rule straight off the pixels, and without precautions it does; a smaller network trained on altered pictures still gets the class right 98 times in 100, but the rule only 61 times: a shift towards the behaviour, not a clean break from the rule.

The tabs follow the chapter: the classes and the question, how a diagram gives its rule away, a network that reads the rule without any training, a smaller network built so that it cannot, the altered pictures that push it further, and how far all that gets.

The chapter's code is not public yet; it will be linked here. Until then, the networks you can run on this page are a retraining of the chapter's final network, done for this page with the chapter's data recipe, layers, training settings and alterations, keeping the best of three runs as the chapter kept the best of a few. Where its accuracies differ from the chapter's, both are given. The chapter's own numbers are quoted as published, the scan statistics come from the same retraining script, and the figures compute everything else in your browser.

The question

Elementary is the smallest interesting case: two states, and each cell updated from itself and its two neighbours. A rule is then a table of eight entries, one per neighbourhood from 000 to 111, so there are 28=2562^8 = 256 rules, each numbered by reading its table as a binary number. Wolfram's four classes are the best-known way of sorting them, but they are judgement calls: the same rule can land in different classes depending on who looks, and at which start. The chapter uses the five classes of Li and Packard (1990) instead, which give every rule exactly one class. A picture's class is then fixed by its rule, which is what a training set of labelled pictures needs.

  • Null, 24 rules: everything turns one colour.
  • Fixed point, 97 rules: the picture settles into a pattern that stays put, or shifts sideways.
  • Periodic, 89 rules: it repeats every two or three steps.
  • Locally chaotic, 10 rules: chaos, fenced in by walls that do not move.
  • Chaotic, 36 rules: noise everywhere, or differences that spread.

Two symmetries never change the class: reading the rule in a mirror, and swapping black and white. Rule 110 seen in a mirror is rule 124, with its colours swapped it is rule 137, with both it is rule 193, and all four are chaotic. Li and Packard count them as chaotic, though 110 is also famously complex. The two symmetries fold the 256 rules into 88 classes of equivalent rules. Click around the map; the rule you pick is ringed, its equivalents get a dashed ring.

the chapter's examples:

You can name most of these at a glance, and so, it seemed, could a convolutional network. Silverman (2019) trained one on Wolfram's classes and scored 100 percent on his test set; Comelli and colleagues (2021) trained one for eleven different classifications and reached 97.58 percent on Li and Packard's. The trouble is that a classification is easy if you know the rule, and the picture can tell you the rule. So the chapter makes a distinction. A feature of a diagram is microscopic if it fits inside one neighbourhood together with its next state, a window of 3 by 2 cells, and mesoscopic if it spans many cells and many steps: stripes, gliders, walls between regions that behave differently. A person classifies by the mesoscopic features. Which ones does the network use, and can it be pushed from the first kind to the second?