TL;DR
HANNA is a novel machine learning framework that predicts the excess Gibbs energy of liquid mixtures directly from molecular structures while embedding thermodynamic laws as hard architectural constraints. By combining deep learning with a geometric projection method and a differentiable surrogate solver, it outperforms industry-standard physics models and generalizes seamlessly from binary to multi-component mixtures.
What Problem Does This Paper Address?
In chemical engineering, predicting how liquid mixtures behave—such as vapor-liquid equilibria (VLE) or liquid-liquid equilibria (LLE)—is essential for designing separation processes like distillation and extraction. At the heart of these calculations is the excess Gibbs energy ($g^\text{E}$), which determines activity coefficients.
Traditional physics-based models like NRTL or UNIQUAC rely on fitting parameters to experimental data for every specific pair of chemicals, making them useless for unstudied systems. Group-contribution methods like UNIFAC try to solve this by breaking molecules down into functional groups, but they fail if a group hasn't been explicitly parameterized beforehand.
Recent machine learning (ML) models offer flexibility but often suffer from a fatal flaw: they violate basic laws of thermodynamics (like the Gibbs-Duhem equation), leading to unphysical predictions. Furthermore, simultaneously modeling VLE and LLE with a single parameter set has historically been a massive challenge.
Methods
The authors introduce HANNA, a neural network architecture designed to predict $g^\text{E}$ while strictly obeying thermodynamic constraints.
Key methodological innovations include:
- Molecular Embeddings: HANNA takes SMILES strings (chemical text representations) and processes them using ChemBERTa-2, a pretrained transformer, to generate numerical molecular features.
- Hard Physical Constraints: Thermodynamic consistency—including boundary conditions at infinite dilution and permutation invariance (the order of inputs doesn't change the output)—is hard-coded directly into the neural network's layers. Activity coefficients are derived via automatic differentiation of the predicted $g^\text{E}$.
- Geometric Projection: To scale from simple binary pairs to multi-component mixtures, HANNA uses the Muggianu geometric projection method. This allows the model to predict properties of ternary or quaternary mixtures using only parameters learned from binary data.
- Differentiable Surrogate Solver: Training an ML model on LLE data normally requires iteratively solving non-linear flash equations, which is computationally grueling and breaks gradient tracking. The authors bypassed this by training a fast, differentiable neural network "surrogate solver" that mimics the convex envelope method to find phase splits instantly during training.
- Gibbs Loss & Lipschitz Regularization: A specialized "Gibbs loss" penalizes mathematically impossible phase behaviors based on stability criteria, while Lipschitz regularization ensures the model's predictions remain smooth and robust outside the training data.
Datasets
HANNA was trained and evaluated using data from the Dortmund Data Bank (DDB), the world's largest factual database for thermodynamic properties.
- Scale: The final dataset comprised 824,481 data points covering 46,543 unique systems and 4,114 unique components, showcasing vast chemical diversity (including complex structures like ionic liquids).
- Data Types: Training utilized binary mixture data across four categories: VLE (both full TPXY and pressure-only TPX data), activity coefficients at infinite dilution (ACI), LLE phase compositions, and excess enthalpies (HE). Evaluation was extended to unseen ternary and quaternary systems.
Key Insights and Ideas
- Physics as an Architectural Constraint: Instead of using soft penalties (loss functions) to encourage physical behavior, embedding thermodynamic laws as hard constraints guarantees that the model can never output thermodynamically impossible results.
- Binary Data is Enough: Because multi-component space can be mapped geometrically from binary subsystems without introducing new parameters, models do not need complex multi-component experimental data to generalize effectively to ternary or quaternary systems.
- Bypassing the Flash Bottleneck: The use of a machine learning surrogate solver to replace iterative thermodynamic solvers proves that deep learning can be trained end-to-end on complex phase equilibrium data without sacrificing training speed.
Key Results
HANNA was compared directly against modified UNIFAC (Dortmund), the reigning industry standard.
- Higher Accuracy: On a shared evaluation horizon, HANNA consistently achieved lower mean absolute errors (MAE). For binary ACI data, the median MAE dropped significantly from 0.18 (mod. UNIFAC) to 0.11 (HANNA).
- Better Phase Split Detection: For binary LLE systems, modified UNIFAC correctly identified miscibility gaps 74% of the time, whereas HANNA achieved 89% accuracy.
- Broader Applicability: Unlike UNIFAC, which is constrained by predefined group tables, HANNA can be applied to any molecule with a known SMILES string. This allowed HANNA to make accurate predictions for a "full horizon" dataset twice the size of UNIFAC's capability, including excellent performance on tricky ionic liquids.
- ML Benchmarks: HANNA comfortably outperformed other recent ML models from literature (like SolvGNN and GE-GNN), which are typically limited to a single temperature (298 K) or restricted to binary systems.
Limitations and Future Work
Despite its success, the authors highlight a few limitations:
- Small Molecule Anomalies: In less than 1% of binary LLE cases, HANNA erroneously predicted two separate phase regions at high temperatures. This issue primarily affects systems with water, methanol, or ethanol, likely because the ChemBERTa-2 tokenizer maps these tiny molecules to the same tokens as larger functional groups.
- Simplifying Assumptions: The model currently neglects the pressure dependence of liquid-phase activity coefficients, meaning it could lose accuracy at exceptionally high pressures.
- Scope Restrictions: HANNA was not trained on polymers or strong electrolytes, meaning it should not yet be applied to those systems.
Future Directions: The team plans to extend HANNA by incorporating solid-liquid equilibria (SLE) data to broaden its temperature range, exploring alternative molecular embeddings like SELFIES, and testing hybrid projection strategies that incorporate ternary data directly into training.
Summary updated