Inverse modeling of porous flow through deep neural networks: the case of coffee percolation
Antoniorenee Barletta, Salvatore Cuomo, Nadaniela Egidi, Josephin Giacomini, Pierluigi Maponi
TL;DR
The paper tackles the inverse problem of espresso extraction by pairing a physics-based multiphysics percolation forward model with a data-driven surrogate and a learned right-inverse. By ensuring local invertibility via the Constant Rank Theorem and training a differentiable forward surrogate $\hat{f}_{\phi}$, the authors construct a neural inverse $g_{\theta}$ that maps observed cup chemistry to plausible brewing parameters while enforcing physics-consistent reconstructions. They demonstrate high forward accuracy ( $R^2>0.99$ across eight chemical species) and strong inverse performance, including precise granulometry classification and near-perfect temperature and composition reconstructions, with robust off-grid generalization aided by targeted data augmentation. This framework enables personalized recipe optimization and potential integration into smart coffee machines, addressing practical needs for consistent, customizable brews. The approach blends rigorous mathematical guarantees with scalable data-driven inversion to navigate the ill-posedness of inverse extraction problems in a computationally efficient way.
Abstract
This work addresses the inverse problem of espresso coffee extraction, in which one aims to reconstruct the brewing conditions that generate a desired chemical profile in the final beverage. Starting from a high-fidelity multiphysics percolation model, describing fluid flow, solute transport, solid, liquid reactions, and heat exchange within the coffee bed, we derive a reduced forward operator mapping controllable brewing parameters to the concentrations of the main chemical species in the cup. From a mathematical standpoint, we formalize the structural requirements for the local solvability of inverse problems, providing a minimal analytical condition for the existence of a (local) inverse map: continuous differentiability of the forward operator and a locally constant, nondegenerate Jacobian rank. Under these assumptions, the Constant Rank Theorem ensures that the image of the forward operator is a smooth embedded manifold on which well-defined local right-inverses exist. Extensive experiments, including off-grid validation, show that the learned inverse map accurately reconstructs brewing temperature, grind size, and powder composition. The resulting framework combines rigorous analytical guarantees with modern data-driven methods, providing a principled and computationally efficient solution to the inverse extraction problem and enabling personalised brewing, recipe optimisation, and integration into smart coffee-machine systems.
