File size: 1,967 Bytes
b2d66ae
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
---
license: mit
library_name: pytorch
tags: [chemistry, thermodynamics, activity-coefficients, excess-gibbs-energy, screening-properties]
---

# HANNA: binary activity coefficients

HANNA is a hard-constraint neural network that predicts the excess Gibbs energy, and from it thermodynamically consistent activity coefficients, of liquid mixtures from SMILES, temperature and composition. This repository contains the **unchanged** binary ensemble (ten members), the ChemBERTa encoder and the input scalers that HANNA uses, so that screening-properties (the property package of the ScreeningTool process-screening framework) can download them on first use.

**All credit goes to the original authors.**

- Code and weights: [marco-hoffmann/HANNA](https://github.com/marco-hoffmann/HANNA), based on the prototype by [tspecht93/HANNA](https://github.com/tspecht93/HANNA) (MIT licence, see `LICENSE`).
- Publications: Specht et al., *Chemical Science* 2024, [10.1039/D4SC05115G](https://pubs.rsc.org/en/Content/ArticleLanding/2024/SC/D4SC05115G), and the follow-up in *Nature Communications* (2026), [s41467-026-71430-y](https://www.nature.com/articles/s41467-026-71430-y).
- The `models/ChemBERTa` encoder is the copy distributed with HANNA, derived from [DeepChem/ChemBERTa-77M-MTR](https://huggingface.co/DeepChem/ChemBERTa-77M-MTR). Please also credit the ChemBERTa authors.

## Files

| File | Content |
| --- | --- |
| `models/HANNA/ensemble/HANNA_parameters_binary{0-9}.pt` | ensemble state dicts (load with `weights_only=True`) |
| `models/ChemBERTa/` | SMILES encoder and tokenizer (transformers format) |
| `utils/scalers/*.pkl` | scikit-learn scalers for temperature and embeddings |

The scalers are pickles. screening-properties checks their SHA-256 at a pinned revision before loading them.

In screening-properties, HANNA predictions are fitted to NRTL parameters and accepted only up to a user-chosen maximum held-out ln γ error (`settings.max_error`).