Local sensing
A fish changes speed with the light at its current position. It turns through repulsion, alignment, attraction, and small fluctuations. There is no gradient sensor in an individual fish.
Local rules. Collective sensing.
Each fish senses only the light where it is. Together, their movements carry information about where it is darker. Explore how a collective can be described as an inferential system.
The school is sampling the light field.
A fish changes speed with the light at its current position. It turns through repulsion, alignment, attraction, and small fluctuations. There is no gradient sensor in an individual fish.
Positions and speed differences contain directional information. A local model asks: which darkness gradient could account for these differences? Spatial geometry shapes its uncertainty.
The coral arrow is a Bayesian readout of the school. It never steers the fish. The paper investigates how well this description relates to the collective’s physical dynamics.
The schooling rules use a 100 × 100 reflecting arena, social zones of 3, 20, and 25 units, equal alignment and attraction weights, speeds from 7.5 to 25 units per time unit, and a 0.1 time step. Neighbors closer than one unit are excluded, as in the source implementation. Turning never uses the inferred or actual gradient.
The opening Gentle preset lowers the existing turn cap from 2 to 0.2 radians per update and uses half-speed playback. Heading noise remains at 0.005 radians. These choices favor gradual turns without adding acceleration or physical inertia; they are not calibrated to real fish trajectories. Wall reflections can still turn fish abruptly. Original restores the original turn cap and playback speed. Rendered fish interpolate between simulation states for smoother playback; pausing shows the exact current state used by the inference readout.
The readout uses centered speed residuals, four moving observation windows, a spatially correlated Gaussian likelihood, and empirical-Bayes noise precision (c = 0.35; a₀ = 2; b₀ = 4). It combines current-frame evidence with a weak prior. It does not include the paper’s temporal replay filter or fitted heading model. The ellipse is a nominal 95% Gaussian region under this working model, not a demonstrated coverage guarantee.
For a clearer starting scene, shade movement and background variation start at zero. Adding variation introduces a small, smooth Fourier field, rather than the paper’s stochastic field process. Darkness is normalized over the displayed grid for the speed response. Social interactions off removes attraction and alignment in every branch, while retaining short-range repulsion and wall avoidance. This is an educational adaptation, not a reproduction of the published quantitative results. A single run does not establish a group-size advantage.
The arena arrows show direction at a fixed length: coral is inferred, and the pale dashed arrow is the actual local gradient. The shaded envelope starts at the same origin. Its color follows the posterior probability density for each direction, calculated analytically from the Gaussian mean and full covariance by integrating over gradient magnitude. No samples are used to render it. Stronger shading means higher directional density; a broad or two-sided envelope is possible when the gradient is poorly determined. The radial fade only softens the display edges. This is a density display, not a 95% boundary. The separate gradient-space plot retains the 95% ellipse and shows magnitude as well as direction; its axes rescale with the posterior.
Based on Collective Sensing as Emergent Bayesian Inference, Conor Heins, IWAI 2026, and the collective sensing model of Berdahl and colleagues (2013). Model equations, simplifications, and running instructions are documented alongside this page.