Table of Contents
Fetching ...

HANNA: Hard-constraint Neural Network for Consistent Activity Coefficient Prediction

Thomas Specht, Mayank Nagda, Sophie Fellenz, Stephan Mandt, Hans Hasse, Fabian Jirasek

TL;DR

HANNA addresses the challenge that purely data-driven neural networks often violate thermodynamic laws when predicting activity coefficients. It introduces a hard-constraint neural network that learns the Gibbs excess energy $g^\text{E}$ for binary mixtures from SMILES-based component embeddings, and derives the logarithmic activity coefficients $\ln \gamma_i$ through thermodynamic relations, ensuring strict thermodynamic consistency. By encoding unity for pure components, the Gibbs-Duhem constraint, and permutation-equivariance directly in the architecture, HANNA achieves thermodynamically compliant predictions and strong extrapolation to unseen binary mixtures. Trained on 317,421 data points from the Dortmund Data Bank, HANNA outperforms UNIFAC on the UNIFAC horizon and remains applicable to any binary mixture with SMILES inputs, with open-source availability for broad use and extension.

Abstract

We present the first hard-constraint neural network for predicting activity coefficients (HANNA), a thermodynamic mixture property that is the basis for many applications in science and engineering. Unlike traditional neural networks, which ignore physical laws and result in inconsistent predictions, our model is designed to strictly adhere to all thermodynamic consistency criteria. By leveraging deep-set neural networks, HANNA maintains symmetry under the permutation of the components. Furthermore, by hard-coding physical constraints in the network architecture, we ensure consistency with the Gibbs-Duhem equation and in modeling the pure components. The model was trained and evaluated on 317,421 data points for activity coefficients in binary mixtures from the Dortmund Data Bank, achieving significantly higher prediction accuracies than the current state-of-the-art model UNIFAC. Moreover, HANNA only requires the SMILES of the components as input, making it applicable to any binary mixture of interest. HANNA is fully open-source and available for free use.

HANNA: Hard-constraint Neural Network for Consistent Activity Coefficient Prediction

TL;DR

HANNA addresses the challenge that purely data-driven neural networks often violate thermodynamic laws when predicting activity coefficients. It introduces a hard-constraint neural network that learns the Gibbs excess energy for binary mixtures from SMILES-based component embeddings, and derives the logarithmic activity coefficients through thermodynamic relations, ensuring strict thermodynamic consistency. By encoding unity for pure components, the Gibbs-Duhem constraint, and permutation-equivariance directly in the architecture, HANNA achieves thermodynamically compliant predictions and strong extrapolation to unseen binary mixtures. Trained on 317,421 data points from the Dortmund Data Bank, HANNA outperforms UNIFAC on the UNIFAC horizon and remains applicable to any binary mixture with SMILES inputs, with open-source availability for broad use and extension.

Abstract

We present the first hard-constraint neural network for predicting activity coefficients (HANNA), a thermodynamic mixture property that is the basis for many applications in science and engineering. Unlike traditional neural networks, which ignore physical laws and result in inconsistent predictions, our model is designed to strictly adhere to all thermodynamic consistency criteria. By leveraging deep-set neural networks, HANNA maintains symmetry under the permutation of the components. Furthermore, by hard-coding physical constraints in the network architecture, we ensure consistency with the Gibbs-Duhem equation and in modeling the pure components. The model was trained and evaluated on 317,421 data points for activity coefficients in binary mixtures from the Dortmund Data Bank, achieving significantly higher prediction accuracies than the current state-of-the-art model UNIFAC. Moreover, HANNA only requires the SMILES of the components as input, making it applicable to any binary mixture of interest. HANNA is fully open-source and available for free use.
Paper Structure (7 sections, 1 equation, 4 figures)

This paper contains 7 sections, 1 equation, 4 figures.

Figures (4)

  • Figure 1: Scheme of HANNA, the first hard-constraint NN for predicting activity coefficients in binary mixtures. Technical details on the architecture are given in Section \ref{['Data_Splitting_Training']}.
  • Figure 2: System-specific MAE of the predicted logarithmic activity coefficients $\text{ln} \gamma_i$ from HANNA and UNIFAC. Left: results for those data from the test set that can also be predicted with UNIFAC (UNIFAC horizon). Right: results for the complete test set (complete horizon).
  • Figure 3: Histograms and cumulative fractions (lines) showing the system-specific MAE for predicting logarithmic activity coefficients $\text{ln} \gamma_i$. Left: comparison of HANNA with UNIFAC on those test data that can be predicted with UNIFAC (UNIFAC horizon). The shown range covers 97.8% of the predictions of HANNA and 93.2% of the predictions of UNIFAC. Right: results of HANNA on the complete test set. The shown range covers 97.7% of the predictions.
  • Figure 4: From left to right: Gibbs excess energies $\frac{g^\text{E}}{RT}$, resulting logarithmic activity coefficients $\text{ln} \gamma_i$, and isothermal vapor-liquid phase diagrams for five systems from the test set plotted as a function of $x_1$ as predicted with HANNA (lines) and comparison to experimental test data from the DDB DDB2023 (symbols). No data for any of the depicted systems were used for training or hyperparameter optimization.