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

arXiv: https://arxiv.org/abs/2407.18011 · HTML: https://mlsanity.com/paper/2407.18011/

## Key facts

- Cited by 17 papers in the map (data through 14 Oct 2026).
- Builds on 18 of its 82 references that are in the map.
- First posted on arXiv 25 Jul 2024.

## Builds on (most cited first, 18 of 18)

- [PyTorch: An Imperative Style, High-Performance Deep Learning Library](https://mlsanity.com/paper/1912.01703/) (2019)
- [Deep Sets](https://mlsanity.com/paper/1703.06114/) (2017)
- [ChemCrow: Augmenting large-language models with chemistry tools](https://mlsanity.com/paper/2304.05376/) (2023)
- [Physics-informed neural networks with hard constraints for inverse design](https://mlsanity.com/paper/2102.04626/) (2021)
- [Adapted Large Language Models Can Outperform Medical Experts in Clinical Text Summarization](https://mlsanity.com/paper/2309.07430/) (2023)
- [ChemRL-GEM: Geometry Enhanced Molecular Representation Learning for Property Prediction](https://mlsanity.com/paper/2106.06130/) (2021)
- [ChemBERTa-2: Towards Chemical Foundation Models](https://mlsanity.com/paper/2209.01712/) (2022)
- [Meta-learning PINN loss functions](https://mlsanity.com/paper/2107.05544/) (2021)
- [Imposing Hard Constraints on Deep Networks: Promises and Limitations](https://mlsanity.com/paper/1706.02025/) (2017)
- [Theory-guided hard constraint projection (HCP): a knowledge-based data-driven scientific machine learning method](https://mlsanity.com/paper/2012.06148/) (2020)
- [Machine Learning in Thermodynamics: Prediction of Activity Coefficients by Matrix Completion](https://mlsanity.com/paper/2001.10675/) (2020)
- [A smile is all you need: Predicting limiting activity coefficients from SMILES with natural language processing](https://mlsanity.com/paper/2206.07048/) (2022)
- [Gibbs-Duhem-Informed Neural Networks for Binary Activity Coefficient Prediction](https://mlsanity.com/paper/2306.07937/) (2023)
- [Thermodynamics-Consistent Graph Neural Networks](https://mlsanity.com/paper/2407.18372/) (2024)
- [SPT-NRTL: A physics-guided machine learning model to predict thermodynamically consistent activity coefficients](https://mlsanity.com/paper/2209.04135/) (2022)
- [Hybridizing Physical and Data-driven Prediction Methods for Physicochemical Properties](https://mlsanity.com/paper/2202.08804/) (2022)
- [PUFFIN: A Path-Unifying Feed-Forward Interfaced Network for Vapor Pressure Prediction](https://mlsanity.com/paper/2307.02903/) (2023)
- [Physics-constrained indirect supervised learning](https://mlsanity.com/paper/2004.14293/) (2020)

## Built on by (most cited first, 17 of 17)

- [GraphXForm: Graph transformer for computer-aided molecular design](https://mlsanity.com/paper/2411.01667/) (2024)
- [GRAPPA -- A Hybrid Graph Neural Network for Predicting Pure Component Vapor Pressures](https://mlsanity.com/paper/2501.08729/) (2025)
- [Molecular Machine Learning in Chemical Process Design](https://mlsanity.com/paper/2508.20527/) (2025)
- [Hierarchical Matrix Completion for the Prediction of Properties of Binary Mixtures](https://mlsanity.com/paper/2410.06060/) (2024)
- [Federated Learning from Molecules to Processes: A Perspective](https://mlsanity.com/paper/2506.18525/) (2025)
- [Thermodynamically consistent machine learning model for excess Gibbs energy](https://mlsanity.com/paper/2509.06484/) (2025)
- [Graph Neural Networks embedded into Margules model for vapor-liquid equilibria prediction](https://mlsanity.com/paper/2502.18998/) (2025)
- [Tethering Broken Themes: Aligning Neural Topic Models with Labels and Authors](https://mlsanity.com/paper/2410.18140/) (2024)
- [Superstudent intelligence in thermodynamics](https://mlsanity.com/paper/2506.09822/) (2025)
- [Batch Distillation Data for Developing Machine Learning Anomaly Detection Methods](https://mlsanity.com/paper/2510.18075/) (2025)
- [Differentiable Thermodynamic Phase-Equilibria for Machine Learning](https://mlsanity.com/paper/2603.11249/) (2026)
- [MLPROP -- an open interactive web interface for thermophysical property prediction with machine learning](https://mlsanity.com/paper/2504.05970/) (2025)
- [DeepEOSNet: Capturing the dependency on thermodynamic state in property prediction tasks](https://mlsanity.com/paper/2509.17018/) (2025)
- [Clapeyron Neural Networks for Single-Species Vapor-Liquid Equilibria](https://mlsanity.com/paper/2602.18313/) (2026)
- [A Systematic Evaluation of Molecular Mixture Behavior Prediction](https://mlsanity.com/paper/2605.29698/) (2026)
- [Predicting Activities in Aqueous Electrolyte Solutions with Hybrid Machine Learning](https://mlsanity.com/paper/2607.19114/) (2026)
- [ElectrolyteFM: Unifying Electrolyte Property Prediction through Cross-Property Knowledge Learning](https://mlsanity.com/paper/2609.39340/) (2026)

## Abstract (arXiv)

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.
