Spotlight #59 – Life Science & Generative Art — Neural Networks, Morphogenesis & Minimal Surfaces

From a single neuron's voltage spike to the branching street plans of an entire city, this spotlight traces how complex, beautiful structure emerges from startlingly simple local rules. Biology discovered these tricks long before mathematicians gave them names.

I. LIF Neural Network — When Neurons Synchronise

🧠

LIF Neural Network — Emergent Activity Patterns

Watch excitatory and inhibitory populations interact, synchronise, and generate oscillating bursts.

The brain contains roughly 86 billion neurons, yet neuroscientists often model individual cells with just a handful of numbers. The Leaky Integrate-and-Fire (LIF) model captures the essential physics in a single differential equation:

dV/dt = -(V - V_rest) / τ_m  +  R · I(t)

Here V is the membrane voltage, V_rest is the resting potential (typically −65 mV), τ_m is the membrane time constant (5–20 ms), R is the membrane resistance, and I(t) is the total synaptic input current. The "leaky" part is the first term: left alone, the membrane voltage drifts back toward rest exponentially, like a capacitor discharging through a resistor — because that is literally what it is.

When V crosses a threshold V_thresh (around −50 mV), the neuron fires an action potential, then the voltage is reset to V_reset and held there for a brief refractory period τ_ref. The action potential itself — the sharp millisecond-wide spike — is not modelled explicitly; only its timing matters for downstream neurons.

Excitatory/Inhibitory Balance and Oscillations

Networks of LIF neurons display rich collective behaviour that no single neuron exhibits alone. The key variable is the ratio of excitatory (E) to inhibitory (I) synaptic inputs. When excitation dominates, the network can enter a runaway state where all neurons fire nearly simultaneously — a population burst. Inhibition prevents this by shunting excess charge. The balance point produces irregular asynchronous activity that closely resembles cortical recordings from awake animals.

Coupled E–I populations naturally produce gamma-band oscillations (30–80 Hz) through a feedback loop: excitatory neurons drive inhibitory ones; inhibition suppresses excitation; inhibition fades; excitation rises again. This mechanism, called pyramidal-interneuron gamma (PING), underpins theories of attention, working memory, and consciousness. The simulation lets you tune the E/I ratio and synaptic delays to push the network through qualitatively different regimes.

Try it: Set inhibitory weight to zero and watch synchronous bursts cascade. Then slowly increase inhibition until the network settles into quiet asynchronous firing. The transition between these regimes can be abrupt — a sign of a dynamical bifurcation.

Even this minimal model reproduces phenomena observed in cortical slice preparations: spontaneous oscillations, up-down state transitions, and the statistics of inter-spike intervals. It demonstrates that much of the brain's temporal structure arises from network geometry and synaptic timescales, not from any complexity in the individual neuron model.

II. Gray-Scott Reaction-Diffusion — How Patterns Self-Organise

🦠

Cell Growth & Morphogenesis — Gray-Scott Reaction-Diffusion

Explore the full parameter space: spots, stripes, worms, mazes, and self-replicating blobs.

In 1952, Alan Turing proposed that the stripes on a zebra and the spots on a leopard could arise from the interaction of just two chemical species — an activator that promotes its own production and an inhibitor that spreads faster and suppresses it. The Gray-Scott model is a modern formulation of this idea:

∂u/∂t = D_u · ∇²u  -  u·v²  +  F·(1 - u)
∂v/∂t = D_v · ∇²v  +  u·v²  -  (F + k)·v

Species u is fed continuously at rate F (the "feed rate") and is consumed when it meets v. Species v is produced by that reaction and removed at rate k (the "kill rate"). The Laplacian terms ∇² represent diffusion through space, and crucially D_u > D_v: u diffuses faster than v. This asymmetry is the engine of pattern formation.

The Parameter Space Zoo

What makes Gray-Scott remarkable is the sheer diversity of patterns accessible by adjusting just F and k. At low feed and kill rates, localised spots form and can self-replicate. Increasing k slightly shifts spots to stripes and then to "worm" patterns. Near the stability boundary, labyrinthine mazes emerge that closely resemble the surface topology of a mammalian brain. Still further, traveling waves, oscillating pulses, and the famous "mitosis" — a single blob pinching into two — appear.

This variety matters because reaction-diffusion systems are not hypothetical: stickleback fish stripes, coral reef topology, and the ridges of mammalian fingertips all fit quantitative predictions derived from Turing's equations. The simulation uses a finite-difference discretisation on a 2D grid, with the diffusion step handled by a simple explicit scheme and periodic boundary conditions. You can paint initial concentrations by hand and watch the system evolve.

Try it: Start from a uniform state and place a small circular blob of high-v concentration in the centre. With F = 0.037, k = 0.060, watch the blob perform successive mitotic divisions, producing a growing colony of self-similar spots.

III. Gyroid TPMS — Minimal Surfaces in Nature and Engineering

💠

Gyroid TPMS — Triply Periodic Minimal Surfaces

Visualise the gyroid's zero-mean-curvature surface and its biological and engineering applications.

A minimal surface is one where every point has zero mean curvature: the surface curves equally in two opposite directions, so the curvature cancels. Soap films form minimal surfaces because surface tension minimises area. The gyroid, discovered by Alan Schoen in 1970, is a triply periodic minimal surface (TPMS) — it tiles all of three-dimensional space with a structure that repeats in three independent directions, like a 3D crystal lattice. Its implicit equation is:

sin(x)·cos(y)  +  sin(y)·cos(z)  +  sin(z)·cos(x)  =  0

This single equation divides space into two interpenetrating but never-intersecting labyrinths. Neither chamber is simply connected: you could walk through either one indefinitely, turning and winding, without ever reaching a dead end or crossing into the other channel.

Why Biology Rediscovered the Gyroid

The gyroid appears in living systems whenever evolution selects for maximum surface area within a minimal volume. The wing scales of the Parides sesostris butterfly (an iridescent green morpho) contain a gyroid structure at the nanometre scale. This nanostructure forms a photonic crystal: its periodicity is comparable to visible-light wavelengths, so it selectively reflects green light through constructive interference rather than pigmentation. The colour does not fade because it arises from geometry, not chemistry.

Cell membranes can self-assemble into gyroid phases — lipid bilayers spontaneously adopt this geometry under certain conditions of temperature and hydration, and the inner mitochondrial membrane is thought to approach a minimal-surface topology in its cristae. In materials science, aerogel scaffolds and bone-replacement implants are being printed with gyroid lattices: the structure provides exceptional stiffness-to-weight ratio (close to theoretical limits for a given density) while allowing fluids and cells to perfuse through both channels. Engineers designing heat exchangers and electrodes are also adopting the gyroid because both of its labyrinths can carry independent flow streams with maximum interfacial contact.

Try it: Rotate the gyroid until you find a viewing angle along [111] — the surface looks like a pinwheel of three-fold rotational symmetry. This is the crystallographic direction along which the butterfly's wing scales are stacked.

IV. Generative City — Fractal Structure in Urban Growth

🌃

Generative City — Procedural Urban Growth

Grow a street network from a seed, governed by branching rules, population density, and land use.

The algorithm behind the generative city is a recursive subdivision process: begin with a region, place a road along its longest axis, split it into two parcels, recurse into each parcel, stop when parcels reach a minimum size. The result is a hierarchical tree of roads — arterials at the top, local streets at the leaves — that mirrors how real cities grow through incremental subdivision of undeveloped land.

Cities exhibit fractal structure at multiple scales: the street network has a fractal dimension typically between 1.6 and 1.9, meaning it fills space more than a simple curve but less than a plane. Block areas follow a power-law distribution, with a few very large blocks and many small ones. Building heights in the central business district also follow a power law — Zipf's law applied to height rather than city population. These statistics are not designed in; they emerge from the interaction of economic incentives, plot subdivision law, and topographic constraints.

L-Systems and Grammar-Based Growth

A more formal approach to procedural city generation uses L-systems — parallel rewriting grammars introduced by Aristid Lindenmayer in 1968 to model plant growth. A production rule like F → F[+F]F[-F]F replaces every road segment with a branching sub-tree. Applied repeatedly, this generates street networks with realistic branching angles, dead ends, and cul-de-sacs. The same grammar, with different branching angles and segment lengths, generates tree canopies, river deltas, lung bronchial trees, and lightning channels — all structures shaped by the same underlying optimisation principle: efficient coverage of space by a branching transport network.

Try it: Add a circular "water body" obstacle near the centre and re-generate the city. Watch the road network bend around it, creating the characteristic fan-and-grid hybrid found in cities built around lakes or harbours.

V. Computational Photography — Error Diffusion and Human Vision

🖼️

Computational Photography — Dithering, Stippling & ASCII

Convert photographs using Floyd-Steinberg error diffusion, Voronoi stippling, and block character mapping.

When you need to represent a continuous-tone image using only black or white pixels, the naive approach — rounding each pixel to the nearest value — produces flat, posterised regions with harsh contour artefacts. Error diffusion dithering, introduced by Floyd and Steinberg in 1976, eliminates this by spreading the quantisation error to neighbouring pixels. For each pixel scanned left-to-right, top-to-bottom, the algorithm computes the error between the original and quantised value and distributes it to four neighbours with specific weights:

Distribute error e from pixel (x, y):
  pixel(x+1, y  ) += e × 7/16
  pixel(x-1, y+1) += e × 3/16
  pixel(x,   y+1) += e × 5/16
  pixel(x+1, y+1) += e × 1/16

The pattern of weights is not arbitrary: they are chosen to distribute the error isotropically (roughly equally in all directions) while scanning in raster order. The result is a halftone pattern in which the density of black dots matches the local luminance — dark regions have dense dots, bright regions have sparse dots. Viewed from normal reading distance, the human visual system spatially integrates the dots and perceives smooth tones. The eye is acting as a low-pass filter.

Why Stippling Looks Natural

Pen-and-ink stippling achieves the same spatial integration with circular dots of uniform size placed at varying densities. The weighted Voronoi stippling algorithm (Adrian Secord, 2002) formalises this: place seed points randomly, compute the Voronoi diagram, move each seed to the weighted centroid of its Voronoi cell (where the weight is image luminance), and repeat via Lloyd's relaxation. Convergence produces an arrangement of dots whose local density mirrors image tone, with maximally even spacing — no ugly clumping or gaps. The perceptual quality is excellent because the resulting dot positions resemble the retinal photoreceptor distribution in the human fovea.

Try it: Load a portrait and compare Floyd-Steinberg with Bayer ordered dithering. Notice that Floyd-Steinberg preserves fine detail in hair and fabric, while Bayer produces a regular cross-hatch pattern. Then switch to stippling mode and reduce the point count until the image barely reads — you will be surprised how few dots are needed for recognition.

← Spotlight #58 Spotlight #60 →