TL;DR
Materials scientists want to predict a crystal's properties, such as its formation energy or band gap, without running a costly quantum calculation for every candidate. Xie and Grossman represent a crystal as a graph whose nodes are atoms and whose edges are bonds, and train a graph convolutional network on that graph using density functional theory (DFT) results as labels. The model predicts eight properties with errors close to DFT's own error against experiment, and its atom-level outputs point to chemically sensible rules for designing perovskites.
Builds on: Graph Convolutional Network, Message Passing Neural Network, Convolutional Neural Network, Crystal Lattice, Periodic Boundary Conditions · Leads to: later graph-network models for molecules and materials, which keep the atoms-and-bonds graph as their input
Why it mattered
Most machine-learning models need a fixed-length list of numbers as input, and a crystal has no natural one: it can contain anything from one to two hundred atoms, from many elements, in a repeating cell. Before this paper, the usual fixes were hand-made feature lists tailored to each property, or complicated coordinate transformations that made the model hard to read.
The paper's aim was a representation that works for any crystal and keeps the chemistry visible. It trained on about 46,700 inorganic crystals from the Materials Project database, covering 87 elements and 216 space groups, and reports that 90 percent of the crystals are binary, ternary or quaternary compounds. Its code is public at github.com/txie-93/cgcnn, and the work appeared in Physical Review Letters.
The problem
Two bottlenecks stood in the way.
- Fixed-length inputs. A feature vector has to be built for each crystal before a standard model can read it. Hand-built vectors work for one property and have to be redesigned for the next, which the authors call case-by-case design.
- Interpretability. Symmetry-invariant transformations of atomic positions handle any crystal, but after several non-linear layers it is hard to say which atom or which bond caused a prediction. A designer who gets a number cannot learn much from it.
The paper's answer is to keep the crystal's own connectivity as the input. The graph view of a crystal already fixes the size problem, because a graph can have any number of nodes, and it keeps each atom and bond as a separate object the model can talk about.
How it works
Take the rock-salt crystals sodium chloride (NaCl) and potassium chloride (KCl). The supplement uses them to show the whole method in miniature, and that is the version traced here. We need one graph, one convolution, one pooling step and one output.
- Turn the crystal into a graph. Each atom becomes a node with a feature vector that encodes its element: group number, period, electronegativity and so on, one-hot encoded. Each bond becomes an edge with a feature vector that encodes the distance between the two atoms. Check: in NaCl every sodium has six chlorine neighbours and every chlorine has six sodium neighbours, so the graph has six edges per node.
- Give each atom a starting feature. In the toy version, chlorine's feature is the one-hot vector (1, 0, 0), sodium's is (0, 1, 0), and potassium's is (0, 0, 1). Check: each node has exactly one entry equal to one.
- Convolve once. The convolution updates an atom from its own feature and from its neighbours' features, combined with weights the network learns. For one sodium atom with six chlorine neighbours, the update in the supplement gives . The comes from summing six neighbour vectors that are each , and the term is the atom's own feature multiplied by its self weight. Check: the sodium's new feature depends only on the chlorine neighbours and its own feature, which is what a local rule should do.
- Pool the atoms into one crystal vector. Average the atom features over the whole cell, so the crystal's vector does not depend on how many atoms the cell contains or on which atom is listed first. For NaCl the eight atoms average to . Check: double the cell with the same atoms and each coefficient stays the same, because the average is unchanged.
- Predict. Because this toy model has no hidden layers, the pooled number is the prediction. Choose weights so the NaCl score is and the KCl score is . One choice is and , with the others zero. Then NaCl gives , and KCl gives . Check: the two crystals end up on opposite sides of zero, so the model separates them.
Real crystals need many convolutions, hidden layers and a continuous output, but the walkthrough shows the three ideas that carry over: the atom and bond features, the local update, and the pooling that makes the result a single vector for the whole crystal.
flowchart LR A["Crystal structure"] --> B["Crystal graph: atoms as nodes, bonds as edges"] B --> C["R convolutions update each atom from its neighbours"] C --> D["Pooling averages atom features into one crystal vector"] D --> E["Hidden layers and output give the predicted property"]
The math
A crystal graph is an undirected multigraph. Node has a feature vector describing its atom, and edge has a feature vector describing the -th bond between atoms and . Multiple edges between the same pair are allowed, because a periodic crystal can connect two atoms through several images of the cell.
Step 3 in symbols: the convolution
The general update has the form over the neighbours of . The first convolution the authors try sums over neighbours before multiplying by a weight matrix, with meaning concatenation, a convolution weight, a self weight, a bias and an activation:
The weakness of this form is that one shared treats every neighbour alike, whatever the bond length. The second, better convolution gives each neighbour its own learned gate. It builds the neighbour vector and then computes
where is element-wise multiplication and is the sigmoid. The gate takes values between 0 and 1 for each neighbour and feature, so a weak bond can be switched down without a separate rule for which bonds count.
- sigma(x)
The authors add the atom's own vector back in, which they say makes deeper networks easier to train because information can pass through unchanged.
Step 4 in symbols: pooling
After convolutions the atom vectors are for , where is the number of atoms in the primitive cell. The crystal vector is the normalised sum
This satisfies two invariances the authors require: permuting the atom indices does not change the sum, and using a larger cell of the same crystal gives the same average.
Step 5 in symbols: the prediction and loss
Two fully connected hidden layers and an output layer map to the prediction . Training minimises a cost between the prediction and the DFT value over the weights , using backpropagation and stochastic gradient descent:
Here is the whole network and is the crystal. For a continuous property the cost is an error such as the absolute difference; for metal versus semiconductor the output uses a softmax and a cross-entropy cost.
Interpretability
If the last hidden layer is replaced by a single linear map to a scalar for each atom, the crystal prediction becomes an average of these local scalars, . Each can then be read as that atom's contribution to the property, which is how the perovskite analysis works. The paper reports that this simplification costs some accuracy.
Results
The main result is the accuracy of the gated convolution on formation energy per atom. On the test set of 9,350 crystals the best mean absolute error (MAE) is 0.039 eV/atom, against 0.136 eV/atom for the simpler convolution. The authors compare this with the DFT error against experiment, which Kirklin and colleagues put at 0.081 to 0.136 eV/atom, and conclude that the model is a reliable estimate of DFT.
Table 1 of the paper, all with the gated convolution and about 28,000 training crystals for most rows:
| Property | Unit | Model MAE | DFT MAE against experiment |
|---|---|---|---|
| Formation energy | eV/atom | 0.039 | 0.081 to 0.136 |
| Absolute energy | eV/atom | 0.072 | not given |
| Band gap | eV | 0.388 | 0.6 |
| Fermi energy | eV | 0.363 | not given |
| Bulk modulus | log(GPa) | 0.054 | 0.050 |
| Shear modulus | log(GPa) | 0.087 | 0.069 |
| Poisson ratio | none | 0.030 | not given |
The elastic moduli, which had only 2,041 training crystals, have higher errors. The authors say that with about 10,000 training crystals, the accuracy of DFT against experiment can be expected for these properties too.
Other results:
- Classification. Metal versus semiconductor reaches an area under the ROC curve of 0.95. At a threshold of 0.5, metal accuracy is 0.80, semiconductor accuracy is 0.95 and overall accuracy is 0.90.
- Generalisation. On 1,585 newly uploaded crystals with elastic data, the model gives an MAE of 0.077 log(GPa) for bulk moduli and 0.114 log(GPa) for shear moduli.
- Perovskites. With linear pooling, the perovskite model's test MAE for total energy above hull is 0.130 eV/atom, against 0.099 eV/atom with the full pooling layer. The site energies it learns show that large atoms from groups 13 to 15 are stable on the A site, in addition to the known stable region of groups 1 to 3.
- Screening. The authors searched for perovskites with a synthesisability cutoff of 0.2 eV/atom above hull. Among 378 perovskites in the data set, 33 pass, which is about 8.7 percent. Among 18,928 perovskites in the database, the base rate of potentially synthesisable compounds is 228, about 1.2 percent. The ratio of these two rates is about 7, which the paper reports as its efficiency gain.
The limits are the paper's own. The accuracy depends on how much data is available, and the elastic results are weaker for that reason. The interpretable variant trades accuracy for readability. The 0.2 eV/atom cutoff is a heuristic that the authors justify with nitride examples, not a physical law, and the perovskite search is only as good as the DFT values it learns from.
Reading guide
- Abstract and the first two paragraphs. The motivation: a representation that works for any crystal and keeps the chemistry visible. Read with Crystal Lattice open, since the unit cell defines the crystal graph.
- Crystal graph and convolution (main text, Eqs. 1 to 5). The core of the method. Eq. 1 needs Graph Convolutional Network and Message Passing Neural Network; Eq. 5 uses Sigmoid Function and Activation Function.
- Pooling and training. Needs Stochastic Gradient Descent and the periodic-cell idea in Periodic Boundary Conditions.
- Figure 2 and Table 1. The accuracy results. Read against Density Functional Theory, which provides the labels.
- Perovskite section and Figure 3. The interpretability example. Read with Perovskite Crystal Structure for the structure.
- Supplement I.2. The NaCl and KCl example traced in the walkthrough above, worth reading slowly.
- Supplement I.3 and I.4. Hyperparameter search and pooling choices. Optional on a first read.
For the graph-network background, read Graph Neural Network before the paper; for a related graph-network paper that is closer to the classic recipe, read Semi-Supervised Classification with Graph Convolutional Networks.
Check yourself
QuestionWhy does the crystal graph need edges that can repeat, unlike a molecular graph?Show answer
A crystal is periodic: the same pair of atoms can be bonded through several translated copies of the cell, so the graph has more than one edge between the same pair of nodes. A molecule has one bond between a given pair, so the paper says a molecular graph does not need this.
QuestionIn the NaCl walkthrough, one sodium atom has six chlorine neighbours and its own feature contributes w_s2. What is its updated feature after one convolution, and why is the coefficient 6 rather than 1?Show answer
The updated feature is . The coefficient is 6 because the convolution sums one neighbour vector per bond, and each of the six chlorine neighbours contributes the one-hot vector (1, 0, 0), whose first entry multiplies . The single comes from the atom's own feature multiplied by its self weight.
QuestionUsing the NaCl pooled score 3 w_c1 + 3 w_c2 + 0.5 w_s1 + 0.5 w_s2, suppose w_c2 is 1/3 and all other weights are zero. What score does NaCl get, and why must pooling average rather than sum?Show answer
The score is . Pooling averages so that the crystal vector does not grow with the number of atoms in the cell: a sum would give a 2 by 2 by 2 supercell of the same crystal a different score, while the average gives the same one.
QuestionA team uses the paper's linear-pooling variant to find perovskites and wants to know which atom in a candidate crystal lowers its energy most. Why does this variant support that question, and what does it cost?Show answer
Linear pooling makes the prediction a sum of per-atom scalars, so each atom's contribution can be read off directly. The cost is accuracy: the paper reports a test MAE of 0.130 eV/atom with linear pooling against 0.099 eV/atom with the full pooling layer.
Sources
- Xie, T. and Grossman, J. C. (2017). Crystal Graph Convolutional Neural Networks for an Accurate and Interpretable Prediction of Material Properties. arXiv:1710.10324. Published in Physical Review Letters 120, 145301.
- Official implementation: txie-93/cgcnn.