Train Stochastic Non Linear Coupled ODEs to Classify and Generate
Stefano Gagliani, Feliciano Giuseppe Pacifico, Lorenzo Chicchi, Duccio Fanelli, Diego Febbe, Lorenzo Buffoni, Raffaele Marino
TL;DR
The paper addresses the need for interpretable, dynamical alternatives to opaque neural networks by proposing a universal framework of coupled ODEs that can classify and generate data through attractor dynamics. It develops both deterministic and stochastic formulations, deriving that small-noise dynamics around planted attractors are Gaussian with covariances given by Lyapunov equations, and demonstrates how trainable coupling and noise improve robustness to perturbations. A complete generative pipeline is introduced, combining an encoder, dynamical latent evolution toward attractor-centered Gaussians, and a decoder, with losses that enforce attractor convergence, reconstruction, and centroid separation, enabling conditional generation and latent-space disentanglement. The approach yields a transparent, neuroscience-inspired alternative to deep networks, with practical demonstrations on MNIST and CelebA that show competitive generation quality and improved robustness via dynamic, sample-efficient training of the network’s interaction structure. Overall, the work contributes a principled, fully dynamical platform for joint classification and generation and outlines clear directions for scaling and extension to more complex data.
Abstract
A general class of dynamical systems which can be trained to operate in classification and generation modes are introduced. A procedure is proposed to plant asymptotic stationary attractors of the deterministic model. Optimizing the dynamical system amounts to shaping the architecture of inter-nodes connection to steer the evolution towards the assigned equilibrium, as a function of the class to which the item - supplied as an initial condition - belongs to. Under the stochastic perspective, point attractors are turned into probability distributions, made analytically accessible via the linear noise approximation. The addition of noise proves beneficial to oppose adversarial attacks, a property that gets engraved into the trained adjacency matrix and therefore also inherited by the deterministic counterpart of the optimized stochastic model. By providing samples from the target distribution as an input to a feedforward neural network (or even to a dynamical model of the same typology of the adopted for classification purposes), yields a fully generative scheme. Conditional generation is also possible by merging classification and generation modalities. Automatic disentanglement of isolated key features is finally proven.
