BZ processing platform

The automated BZ platform is designed so that it can be used as a programmable chemical processing system, exploiting the excitability and bistability of the oscillating chemical reaction. We demonstrate programmability by performing different processing tasks in our BZ platform, such as memory and pattern recognition. Our digital-chemical processing system consists of four components (see Fig. 1, Methods and Supplementary Methods 1). (i) The BZ reactor cell grid can be customized to the desired geometry depending on the experiment. In addition, by changing the size of the opening gap between neighbouring cells, it is possible to control the global propagation of the BZ excitation. When the gap size is large enough, the whole BZ medium generates coherent excitation wave patterns. (ii) A magnetic stirrer array consisting of 25 motors to control the stirrer bars within the BZ reactor cells. (iii) A control interface connected to a computer and the magnetic stirrer array. The rotation speed of each stirrer can be individually controlled; therefore, the local oscillations of the BZ reaction at a given cell can be individually addressed. (iv) The BZ reaction in the cells was monitored by a camera mounted above the grid, and the camera was connected to a computer enabling real-time analysis of the BZ. Each cell was classified as excited (blue) or non-excited state (red) as a function of time (see Supplementary Methods 2).

Description of the BZ reaction

Ferroin, [Fe(Bpy) 3 ]2/3+, was chosen as the sole catalyst since this gives simple oscillations and the colour changes between the reduced form (red) and the oxidized form (blue) which are distinct and easily tracked optically. The other chemical components used were sulfuric acid, malonic acid and potassium bromate (see Methods and Supplementary Methods 3 for a description of how the solutions were prepared). To control the reaction, we exploit the fact that bulk oscillations of the BZ reaction break down and may become chaotic with short-lived or completely suppressed oscillations when they are not stirred37,38. Thus, the excitation of an individual BZ cell in the grid can be controlled by activating a stirrer placed in the cell (see Supplementary Methods 4).

To stir cells and drive patterns in the resulting oscillations, the platform described in Fig. 1 is used, where each cell contained a stirring bar and was directly placed above a motor with a pair of opposing magnets attached to its shaft. Using this mechanism, the stirring could be turned on and BZ oscillatory excitation waves generated only in specific cells. Defining which cells were stirred and which were not (i.e. input pattern) could then impact the formation of excitation wave patterns on the chemical system. This is because the stirred cells are more likely to generate oscillatory excited waves, which propagated to neighbouring cells and eventually formed a globally synchronized wave pattern. The speed of stirrers in the grid could be individually controlled and input patterns with different stirrer speeds could result in different global wave patterns of BZ reaction. Once a cell oscillates by being stirred, it will continue to oscillate long after the stirring is stopped (see Supplementary Video 2). Moreover, the speed of each motor could be dynamically changed at any time, meaning that the platform can be programmable on demand.

Using grids of discrete but fluidically connected cells, we control the propagation of wave patterns from a cell to a neighbouring cell. The basic starting design for the platform comprised a 7 × 7 grid, where only the middle 5 × 5 cells were used. To control the interaction between cells, we first fabricated a prototype array of BZ cell grid using a 3D printer which had a v-shaped opening between cells. The BZ reaction volume used was 70 ml, which filled the arena to three quarters of its height, well above the v-shaped opening. With this design, it was found that oscillations did not propagate to neighbouring cells and the platform acted similarly to a display screen, where only the cells that were enabled flashed in blue, while the other ones remained red (Fig. 2a and Supplementary Video 3). To facilitate improved interaction between cells, we removed the v-shaped part of the opening, leaving only the corners of each cell to define it (Fig. 2b). This way the fluid from an activated cell would propagate to its neighbours when stirred, and we could, for example, activate a cell that was disabled by stirring (and therefore activating) its neighbours.

Fig. 2: Controlling the oscillating cells. In this figure, some frames are accompanied by a matrix of x’s and o’s. This matrix indicates if in that given frame a motor was enabled (marked with a x) or disabled (marked with a o). a With a v-shaped opening between cells, the oscillations generated at a given cell do not propagate to neighbouring cells. This way, the BZ reaction within each cell can be individually controlled, and the user can define which cells oscillate and which cells do not oscillate. b To increase the transfer of liquid between cells, the gap between cells was fully opened. This way we achieve the objective of enabling a cell which was disabled just by enabling its surrounding cells. c Once the cells are weakly connected, they will generate coherent patterns. (Note: the oscillations in the top-left image have been contrast-enhanced, Supplementary Movie 3 shows the unedited oscillations. See Supplementary Note 1 for more details.). Full size image

Pattern recognition using the BZ platform

The wave propagation patterns described were found to be reproducible between parallel experiments, which indicates that the BZ platform can consistently convert an input pattern into a wave propagation pattern. Detection and interpretation of such propagating patterns were relatively easy with simple input patterns, but they increasingly become more complicated to human interpreters as the input patterns become complex. However, the complex patterns generated were neither random nor impossible to distinguish between them, because the BZ system generates consistent outputs in response to the same input pattern, and this is the basis for programmability. To prove programmability we were able to show that the global patterns being generated in the BZ reactor grid depend on the history of different patterns being inputted during execution as a function of time (see Fig. 3). Depending on the concentration of potassium bromate, the number of oscillations that can occur without physical actuation can be up to eight repetitions (see Supplementary Information). This property can be used for short-term information storage, where the BZ platforms act similar to a volatile memory. By pairing the system programmability using the mechanical stirrers, and the system memory via the BZ medium, the platform keeps processing and memory residing in the same space.

Fig. 3: Programming the platform by introducing different input patterns during execution. a For every frame in a video, the centre of mass (CoM) of a BZ oscillation was calculated using the blue channel of the frame, and then as these CoMs translated between frames, we plotted their translations using straight lines. Thus, each of the plots in this figure represents how the BZ oscillations moved across the arena. b In these four rows an experiment was performed where the same input pattern was applied to the BZ medium for 30 min. c In the following rows, two different experiments were performed where the pattern inputted to the BZ medium changed dynamically. In the first case, it iterated in a loop where every minute-long iteration inputted each of the four patterns in a sequence where each pattern was inputted for 15 s. d In the second case, each pattern was inputted only once: initially 0 for 10 min, then nothing for 5 min, and then 1, 2 and 3 for 5 min each. Full size image

To exploit the ability that the BZ system generates consistent outputs in response to the same input pattern, we adapt the ‘reservoir computing’ scheme39 using the BZ platform (Fig. 4a). Namely, the system’s output is interfaced with a neural network (NN), which is used to classify different input patterns based on the wave they generate. The generated wave propagation patterns were input into an NN after being processed using image processing in order to identify the BZ oscillations (see Supplementary Methods 5 and Supplementary Video 4). Thus, this NN decodes the BZ outputs into human-readable data. To capture the temporal dynamics of the wave propagation patterns, a sliding window over 30 time points was used to create a dataset with 750 features (25 cells × 30 time points). We then use 20 different input patterns representing digital numbers, letters and random configurations (see Supplementary Methods 4), where the dataset was split to 30% between train and test set, and this gave correct answers with 80.5% accuracy against the test dataset. When using the same dataset but with 20 time points (thus 500 features), a split of 10% between the train and test set, and a deep convolutional network (see Methods), the accuracy increases up to 92.5%. This result suggests that the BZ system produces consistent patterns upon a specific input pattern that can be distinguished by a machine learning algorithm (which may be too complicated for human eye). In other words, the BZ system satisfies the echo state property of reservoir computing40; i.e. each cell within its reservoir neighbours produces a nonlinear response signal which is combined into a desired output signal by means of linear combinations of these response signals in the BZ grid. In contrast, when using the reservoir system without the BZ reaction, but replaced with pure water, the output NN is not capable of classifying the patterns because the dynamics of the water are not sufficient to project input patterns into a higher dimensional space (see Supplementary Methods 4).

Fig. 4: Pattern classification and data encoding by BZ reaction and machine learning. a Schematic showing the full working pipeline of our system. Initially the user selects an input pattern, and this pattern is binarized in a 5-by-5 matrix. This matrix is used as a source for the PWM generator, and this will eventually generate a global oscillation. These oscillations are then decoded when needed for pattern recognition. b Flow diagram of the pattern recognition process comparing the BZ oscillations produced by a digital encoder and by the BZ platform. The A path uses the BZ medium as described above. The B path uses a digital encoder that has been trained beforehand in order to digitally produce BZ oscillations from motor patterns. Once the oscillations are generated using the BZ platform or the digital encoder, they are correctly decoded using a decoder as shown in (a). Both in (a) and (b), a snapshot of an oscillation is shown. The vertical axis of this snapshot represents each of the 25 cells, while the horizontal axis represents time. This snapshot was made juxtaposing consecutive frames to better represent the temporal domain of the BZ oscillations. Full size image

Experimental benchmark of the chemical encoder

To prove that during the pattern recognition process our BZ platform acts like a chemical processor, a similar experiment is performed, but in this case the BZ platform is replaced by a digital encoder that has been trained to digitally produce BZ oscillations from input motor patterns (Fig. 4b). The digital encoder uses the different motor patterns as inputs, and then digitally generates a BZ oscillation. Finally, this BZ oscillation is classified using the same NN that was just used as part of the ‘reservoir computer’. The digital encoder is implemented following the architecture of an Autoencoder Neural Network (see Methods), and we estimate that, based on our architecture, it would require 60 million of logic gates for a forward pass through the network (see Supplementary Methods 6–8). Assuming that our BZ platform using 1 min of window data encodes similarly to the digital encoder, then it decodes the equivalent of 1 million logic gates per oscillation.

This is effectively the same process detailed in Fig. 4a, but by-passing the BZ medium and using a digital encoder instead. The NN correctly labelled the different BZ oscillations, both the ones generated through the BZ medium, and the ones generated with the digital encoder. This unequivocally means that our platform is acting like a chemical processor because it is developing the same role as a digital encoder; specifically, we can consider this to be acting like a chemical encoder.