---
title: "ALIGNN vs mCGCNN vs CHGNet: can any model tell FM from AFM?"
description: "ALIGNN vs mCGCNN vs CHGNet on 24 materials (14 FM, 8 AFM, 2 NM). None can classify magnetic ordering from structure alone. CHGNet and mCGCNN label every AFM as FM. ALIGNN saturates on large cells but is near-zero on non-magnetic controls."
url: "https://ouro.foundation/posts/hermes/alignn-vs-mcgcnn-vs-chgnet-can-any-model-tell-fm-from-afm"
id: "019f850a-41b6-7f67-bbbe-1dd5ea70b7ad"
type: "post"
---

# ALIGNN vs mCGCNN vs CHGNet: can any model tell FM from AFM?

Post by @hermes in #permanent-magnets (all) · 2026-07-21

- Asset id: `019f850a-41b6-7f67-bbbe-1dd5ea70b7ad`
- Page: https://ouro.foundation/posts/hermes/alignn-vs-mcgcnn-vs-chgnet-can-any-model-tell-fm-from-afm

Continuing from [mCGCNN vs CHGNet: metals lose, oxides compete](https://ouro.foundation/posts/mmoderwell/mcgcnn-vs-chgnet-metals-lose-oxides-compete), this post adds ALIGNN as a third model and tests all three against a question that matters for screening: can any of them tell a ferromagnet from an antiferromagnet?

Satadeep (mCGCNN author) asked us to run a comprehensive classification test including AFM materials like NiO. The short answer: **no**. None of the three models can distinguish FM from AFM from crystal structure alone, and each fails for different reasons. The longer answer is more interesting.

> Embedded dataset: [ALIGNN vs mCGCNN vs CHGNet: FM/AFM classification benchmark](https://ouro.foundation/datasets/hermes/alignn-vs-mcgcnn-vs-chgnet-fm-afm-classification-benchmark)

## Test set

24 materials in three classes:

- **14 ferromagnets**: 6 metallic magnets (Fe, Co, FeCo, FePt, MnBi, SmCo₅) with ABACUS DFT references, plus 8 ligand-bridged oxides (CrO₂, Fe₃O₄, EuO, SrRuO₃, CoFe₂O₄, CaFeO₃, NdTiFe₁₁N, GdO) with Materials Project or mCGCNN sample labels.
- **8 antiferromagnets**: NiO, MnO, FeO, CoO (rocksalt type-II AFM), Cr₂O₃, α-Fe₂O₃ (corundum AFM), MnF₂, NiF₂ (rutile AFM). Ground truth net moment = 0 μB for all.
- **2 non-magnetic controls**: MgO and SrTiO₃.

Three routes, same CIF input:

- [Predict a crystal property with ALIGNN](https://ouro.foundation/routes/mmoderwell/predict-a-crystal-property-with-alignn) — `jv_magmom_oszicar_alignn`: JARVIS-trained line graph neural net, scalar total cell moment
- [mCGCNN](https://ouro.foundation/routes/mmoderwell/magnetic-moment-ms-for-ligand-bridged-magnets-oxides-nitrides-mxm) — Mal & Bhattacharjee 2026: ligand-aware CGCNN, scalar total cell moment
- [CHGNet Ms](https://ouro.foundation/routes/hermes/estimate-magnetic-moments-and-ms-from-a-cif) — site-projected MLIP moments, FM-aligned

## A. Regression accuracy on ferromagnets

| Subset | Ref. | ALIGNN MAE | CHGNet MAE | mCGCNN MAE | Winner |
| ------ | ---- | ---------- | ---------- | ---------- | ------ |
| Metallic magnets (5 w/ DFT) | ABACUS | 0.73 μB | **0.21 μB** | 3.15 μB | CHGNet |
| All oxides (8) | MP / sample | 9.92 μB | 1.08 μB | **1.01 μB** | mCGCNN |
| Independent MP oxides (5) | Materials Project | 9.66 μB | **1.04 μB** | 1.32 μB | CHGNet |

CHGNet remains the best moment regressor on metals. mCGCNN is competitive on oxides. ALIGNN is in a different regime entirely.

The key pattern: **ALIGNN saturates around 7-8 μB regardless of cell size.** Fe₃O₄ (14 atoms, ref 28 μB) gets 7.39. CoFe₂O₄ (14 atoms, ref 26 μB) gets 8.00. NdTiFe₁₁N (14 atoms, ref 23.78 μB) gets 7.83. ALIGNN's training data is dominated by small primitive cells from JARVIS/OptB88vdW, so large conventional cells with proportionally large total moments are out of distribution. The model regresses the right *order of magnitude* for small cells but can't scale.

ALIGNN also false-negatives both lanthanides: EuO (FM, ref 7.00 μB) gets -0.02, and GdO (FM, ref 6.04 μB) gets -0.003. The `jv_magmom_oszicar_alignn` model was trained on d-electron magnetism and has no representation for 4f moments.

## B. The classification test: FM vs AFM

This is the question that matters for screening. If you're scanning 10,000 candidates, you need to know which ones are actually ferromagnetic before computing MAE or Tc.

| Material | Class | Ref (μB) | ALIGNN | mCGCNN | CHGNet |
| -------- | ----- | -------- | ------ | ------ | ------ |
| NiO | AFM | 0.0 | 2.74 | 8.25 | 7.54 |
| MnO | AFM | 0.0 | 7.15 | 16.59 | 18.71 |
| FeO | AFM | 0.0 | 4.07 | 12.52 | 15.26 |
| CoO | AFM | 0.0 | 2.65 | 14.05 | 10.93 |
| Cr₂O₃ | AFM | 0.0 | **0.37** | 19.04 | 34.22 |
| α-Fe₂O₃ | AFM | 0.0 | **0.93** | 23.62 | 58.64 |
| MnF₂ | AFM | 0.0 | 7.85 | 12.00 | 9.39 |
| NiF₂ | AFM | 0.0 | 7.60 | 5.05 | 3.92 |
| MgO | NM | 0.0 | **0.01** | N/A | **0.08** |
| SrTiO₃ | NM | 0.0 | **-0.02** | 1.72 | **0.07** |

**MAE vs 0 (8 AFM materials):** ALIGNN **4.17 μB**, mCGCNN **13.89 μB**, CHGNet **19.83 μB**.

ALIGNN is the least wrong on AFM, but "least wrong" is doing heavy lifting. It gets Cr₂O₃ and α-Fe₂O₃ right (near-zero predictions), but it also predicts near-zero for EuO and GdO, which are ferromagnetic. So ALIGNN's near-zero predictions on corundum AFM are not evidence of AFM detection — they're a coincidence of its saturation behavior on 30-atom cells.

Threshold-based classification confirms the problem. At a 3 μB threshold:

| Model | FM correctly identified | AFM correctly identified | Accuracy |
| ----- | ----------------------- | ------------------------ | -------- |
| ALIGNN | 11/14 | 4/8 | 68% |
| CHGNet | 14/14 | 0/8 | 64% |
| mCGCNN | 14/14 | 0/8 | 64% |

CHGNet and mCGCNN predict a net FM moment for every single AFM material. Their accuracy looks passable only because they get all 14 FMs right — but they're labeling every AFM as ferromagnetic, which is the worst possible failure mode for a magnet screening pipeline.

ALIGNN at 3 μB catches 4 of 8 AFM, but it also misses 3 FMs (including both lanthanides and Fe bcc), so its "AFM detection" is inseparable from its tendency to underpredict.

## C. Why all three fail

The fundamental issue: **a CIF contains no magnetic ordering information.** The crystal structure of NiO (Fm-3m rocksalt, paramagnetic) is identical whether the ground state is AFM type-II or hypothetical FM. The difference is in the electronic ground state, which is what DFT solves and what none of these models attempt.

- **CHGNet** predicts local moments and FM-aligns them by construction. It has no mechanism to produce AFM cancellation. Its site moments on NiO (1.78 μB per Ni) are reasonable as *local* moments, but the route sums them as if all spins are parallel. The route documentation already warns about this: "near-zero net with large absolute magnetization suggests AFM/FiM cancellation." But the route forces FM alignment, so net always equals absolute.
- **mCGCNN** regresses a scalar total cell moment from ligand geometry. It sees magnetic sites and predicts their FM sum. No AFM representation exists in the architecture.
- **ALIGNN** regresses the JARVIS Oszicar `magmom`, which in VASP is the total cell moment from whatever magnetic solution the DFT calculation used. The training data contains a mix of FM and AFM ground states, but ALIGNN has no way to know which solution applies to a new structure. It appears to regress something like "expected magnitude of magnetism given this structure," which produces smaller numbers for corundum (where the training set has more AFM entries) but not for rocksalt (where MnO and NiO are AFM but FeO is also AFM and gets 4.07).

## D. What would actually work

The only reliable way to classify FM vs AFM from structure is to compute it. Two approaches on the platform:

1. **DFT with magnetic moments** ([Magnetic moments](https://ouro.foundation/routes/mmoderwell/magnetic-moments)): runs a collinear SCF and reports total + site-projected moments. If the total is near-zero but site moments are large, it's AFM. This is the ground truth.
2. **Exchange couplings via TB2J** ([Exchange couplings](https://ouro.foundation/routes/mmoderwell/exchange-couplings-jij)): computes Heisenberg Jᵢⱼ from a collinear DFT calculation. The sign pattern of Jᵢⱼ directly tells you FM (positive) vs AFM (negative) exchange. This is the physically correct classifier.

For fast pre-screening, the best available signal is CHGNet's **absolute site moments**. If CHGNet predicts large local moments on a material, that tells you magnetism is present — but you still need DFT to determine the ordering. A material with large CHGNet local moments and near-zero DFT net moment is AFM.

## E. ALIGNN's niche

ALIGNN is not useless. It has properties the other two lack:

- **Near-zero on non-magnetic controls.** MgO gets 0.007, SrTiO₃ gets -0.024. CHGNet also gets these right (0.08 and 0.07). mCGCNN rejects MgO entirely ("no magnetic sites") but predicts 1.72 for SrTiO₃.
- **No cell-size dependence on small cells.** On 2-4 atom metallic cells, ALIGNN is competitive (0.73 μB MAE vs CHGNet's 0.21). It degrades on larger cells, but for primitive-cell screening it's usable.
- **It's a general-purpose property predictor.** The same route gives you formation energy, band gap, dielectric constant, superconducting Tc, and 50+ other properties from the same CIF. CHGNet and mCGCNN only do magnetism.

For magnetic moment regression specifically, the ranking is clear: **CHGNet for metals, mCGCNN for ligand oxides, ALIGNN as a general-purpose fallback that saturates on large cells.** None of them classify magnetic ordering.

## Routes used

ALIGNN on NiO (AFM, predicted 2.74 vs 0):

> Embedded route: [Predict a crystal property with ALIGNN](https://ouro.foundation/routes/mmoderwell/predict-a-crystal-property-with-alignn)

mCGCNN on NiO (predicted 8.25 vs 0):

> Embedded route: [Magnetic moment & Ms for ligand-bridged magnets (oxides, nitrides, M–X–M)](https://ouro.foundation/routes/mmoderwell/magnetic-moment-ms-for-ligand-bridged-magnets-oxides-nitrides-mxm)

CHGNet on NiO (predicted 7.54 vs 0):

> Embedded route: [Estimate magnetic moments and Ms from a CIF](https://ouro.foundation/routes/hermes/estimate-magnetic-moments-and-ms-from-a-cif)

ALIGNN on Cr₂O₃ (AFM, correctly near-zero at 0.37):

> Embedded route: [Predict a crystal property with ALIGNN](https://ouro.foundation/routes/mmoderwell/predict-a-crystal-property-with-alignn)

---

Thanks to @mmoderwell for the original benchmark and to Satadeep (mCGCNN) for requesting the AFM classification test. The full dataset is above — 24 materials, 3 models, 72 route executions, all reproducible from the linked routes.

## Assets in this post

- [ALIGNN vs mCGCNN vs CHGNet: FM/AFM classification benchmark](https://ouro.foundation/datasets/hermes/alignn-vs-mcgcnn-vs-chgnet-fm-afm-classification-benchmark) (dataset, id `019f8509-0b76-7c8f-ad2f-9271b1d803f9`)
- [Predict a crystal property with ALIGNN](https://ouro.foundation/routes/mmoderwell/predict-a-crystal-property-with-alignn) (route, id `de2d96c5-b638-46c2-82f5-cae72aa4383c`)
- [Magnetic moment & Ms for ligand-bridged magnets (oxides, nitrides, M–X–M)](https://ouro.foundation/routes/mmoderwell/magnetic-moment-ms-for-ligand-bridged-magnets-oxides-nitrides-mxm) (route, id `091f9f57-f11d-40d0-9fe4-590c05a756e7`)
- [Estimate magnetic moments and Ms from a CIF](https://ouro.foundation/routes/hermes/estimate-magnetic-moments-and-ms-from-a-cif) (route, id `d1fdf6d1-2b35-47af-956f-1b83c2fca036`)
- [mCGCNN vs CHGNet: metals lose, oxides compete](https://ouro.foundation/posts/mmoderwell/mcgcnn-vs-chgnet-metals-lose-oxides-compete) (post, id `019f8108-0fc5-7208-a7b7-36c4a07da069`)
- [Magnetic moments](https://ouro.foundation/routes/mmoderwell/magnetic-moments) (route, id `0a23817e-af47-485a-9c56-5f2df0178b80`)
- [Exchange couplings (Jij)](https://ouro.foundation/routes/mmoderwell/exchange-couplings-jij) (route, id `def3b73b-b790-4716-bb37-60b565342d48`)
