Equality-Constrained Neural Networks for Environmental Process Modeling: Application to Ozone Inactivation of Cryptosporidium
Abstract
Abstract Environmental engineering process models often combine governing mass balance relationships with rate expressions whose dependence on environmental conditions is incompletely understood. We present a mechanistically constrained machine-learning framework in which a feedforward neural network represents an unknown process-rate function, while parameter estimation is performed subject to an exact process constraint rather than treating the network as an unconstrained black-box predictor. Two computational strategies for enforcing the constraint were examined: reduced-space elimination of the constrained variable and simultaneous full-space optimization with log-transformed reparameterization. The latter proved to be more robust and was adopted for model development. To support reliable optimization across multiple neural-network architectures, a nested warm-start strategy was developed that exploits the hierarchical structure of the candidate architectures. The framework was applied to a dataset comprising 225 observations of ozone inactivation of Cryptosporidium collected using waters from 16 utilities spanning a range of water-quality conditions. Although larger architectures achieved progressively better in-sample fits, leave-one-agency-out cross-validation revealed poor transferability across utilities and produced rankings that differed markedly from those obtained using the small-sample-corrected Akaike information criterion (AICc). The architecture favored by AICc was among the poorest performers under blocked cross-validation, whereas the best cross-validated model ranked near the bottom of the AICc ordering. Cross-validation error was concentrated among utilities operating under temperature conditions poorly represented in the remaining dataset, and a mechanistic analysis identified a specific extrapolation failure in the constrained model when confronted with observations outside its training domain. These results demonstrate how mechanistically constrained neural networks can be integrated with environmental process models while preserving the physical consistency. More broadly, they show that information-criterion-based model selection may be misleading for grouped environmental datasets and that block-based cross-validation should be preferred when models are intended for transfer across sites, utilities, or operating conditions. A comparison against classical Chick–Watson kinetics showed that, at the present data scale, this simple fixed-form model generalized better across held-out utilities than the neural-network formulation despite a far poorer in-sample fit, indicating that the flexible model’s advantage is currently limited by data coverage rather than by the modeling approach itself and that a richer, more broadly sampled training set is the most promising route to realizing its potential for reduced predictive uncertainty.
// Source
Authors: Charles Nathan Haas
Institutions: Drexel University