Cellular Automata, evolutionary strategies and morphogenesis: a CBR approach
The modeling of complex systems constitutes a highly valuable tool for solving problems of very diverse nature, and cellular automata are capable of simulating their evolution in a visual and relatively simple way. Automata evolve according to a set of rules, and it is in finding the optimal rules where different artificial intelligence techniques can be of great help. In recent years, evolutionary strategies have proven to be an efficient method for solving this type of problem, due to their ability to find robust solutions in relatively large search spaces.
This work is based on both elements: evolutionary strategies and cellular automata, with the aim of discovering self-organization patterns and emergent computation arising solely from local interactions between automaton cells; that is, the goal is to achieve global coordination from strictly local information. The fusion of both techniques is used to build a Case-Based Reasoning (CBR) engine capable of solving problems in the context of artificial morphogenesis. Experimental results show that the CBR engine reduces the number of generations required by up to 80%, while maintaining competitive fitness scores.
All the code associated with this project is available on this GitHub repository: GitHub/sergiio8/TFG_CS
The core challenge is to discover the transition rules that determine a specific behavior of the cellular automaton. These rules are encoded as an array (a lookup table), where each index represents a specific neighborhood configuration, and its value corresponds to the next state of the central cell.
These arrays serve as the chromosomes in our evolutionary strategy, where the goal is to optimize the gene sequence to achieve specific morphogenetic patterns.
Figure: Mapping of neighborhood configurations to the lookup table array (the chromosome).
The system integrates cellular automata with an evolutionary strategy capable of exploring intractable rule spaces.
We use CellPyLib to configure neighborhoods and boundaries.
Figure: von Neumann and Moore neighborhoods.
Figure: Periodic boundary conditions in 2 dimensions.
We employ the (μ + λ) strategy with adaptive mutation to avoid premature convergence and epistasis.
Figure: Diagram of the (μ+λ) strategy.
Equation: Dynamic adjustment of the number of mutated genes according to fitness (exploration vs exploitation).
In 2D scenarios, accuracy is insufficient. Therefore, we employ a convex combination of metrics to guide morphogenesis:
SSIM: Evaluates global structure and visual contrast.
Jaccard Index: Measures pixel-by-pixel positional accuracy.
Mutual Information: Captures statistical dependency between images.
Fitness formula: fitness = α·SSIM + β·Jaccard + γ·MI (where α+β+γ=1)
To automate system parameterization, a CBR architecture has been implemented that provides the framework with a "memory" based on prior experience. Instead of treating each artificial morphogenesis problem independently, the system reuses previous parameterizations and successful transition rules.
We designed a similarity function for the Retrieve phase that combines four critical descriptors:
Once the most similar case has been retrieved, the engine applies Transfer Learning techniques to accelerate optimization:
The validation of the framework began with three one-dimensional problems of varying complexity:
A classical benchmark where the ability to reach a uniform state from random configurations is analyzed. The rule found by our algorithm was compared with the handcrafted Gacs-Kurdymov-Levin (GKL) rule, obtaining competitive results and strong generalization capability.
A fundamental low-level morphogenesis problem. The (μ + λ) strategy proved superior to the classical algorithm, achieving fitness scores above 90% and overcoming premature convergence thanks to adaptive mutations.
Simulation of the even-skipped gene pattern in seven stripes. The system successfully inferred the local genomic rule governing cellular differentiation from the macroscopic phenotype, resolving the conflict caused by initial noise.
Density Classification Problem automaton
French Flag Problem automaton
Drosophila embryogenesis automaton
Fitness evolution with a classical genetic algorithm
Fitness evolution with the (μ+λ) strategy
The transition to two-dimensional environments increases topological complexity, requiring an evaluation framework based on structural (SSIM), spatial (Jaccard), and statistical (Mutual Information) metrics.
We addressed the formation of a horizontal stripe pattern from initial noise, achieving fitness scores above 75%.
We tackled the morphogenesis of a central circle from an initial seed. This case revealed emergent behavior: the automaton learns to "wait" (initial oscillations) depending on the total number of timesteps so that the circle does not overflow the canvas dimensions, achieving fitness scores above 80%.
Video: Evolution of the automaton toward the Hungary flag.
Video: Formation of the Japan flag pattern.
The CBR engine was evaluated against a collection of 12 problems. Below, we present the analysis of 6 successful cases illustrating the system's ability to reuse experience and accelerate convergence through transfer learning.
The evaluation focused on measuring how the injection of seed rules obtained through topological retrieval and transfer learning affects the evolutionary lifecycle. The selected cases (Poland, Italy, Benin, Switzerland, Bangladesh, Colombia) represent diverse morphogenetic challenges where the CBR engine demonstrated superior efficiency both in fitness and number of generations compared to random resolution and expert heuristics. Savings of up to 80% in the number of generations were achieved in the Colombia case.
Poland Flag
Italy Flag
Benin Flag
Switzerland Flag
Bangladesh Flag
Colombia Flag
Figure: Evolution of Max Fitness for Colombia using a random approach.
Figure: Evolution of Max Fitness for Colombia using a heuristic approach.
Figure: Evolution of Max Fitness for Colombia using a CBR approach.
Maximum fitness achieved by approach.
Generations required to converge.