Limits of Recovering Lattice Disorder from Diffraction
A study of jitter, vacancies, and ambiguity in inverse mapping
Introduction
Reconstructing lattice structure is important because properties such as electrical conductivity, mechanical strength, and thermal behavior are fundamentally determined by how atoms are arranged. In many experimental settings, diffraction measurements provide the only practical way to access this structure.
Diffraction-based reconstruction is therefore an inverse problem: we observe patterns in Fourier space and attempt to infer the underlying atomic arrangement. However, real materials are rarely perfect. They contain both positional disorder (e.g., thermal motion or strain) and defects such as vacancies, and these different mechanisms can affect material behavior in distinct ways. Ideally, one would like to distinguish between such sources of disorder, but it is not clear whether diffraction data alone contains enough information to do so reliably. As a result, different structural configurations can produce similar diffraction patterns. Even with perfect measurements, the inverse problem may be fundamentally ambiguous.
This raises a central question: what aspects of structural disorder are actually recoverable from diffraction data, and what becomes intrinsically ambiguous?
In this project, we construct a controlled synthetic setting where both positional jitter and vacancy levels are varied, and use machine learning models to probe the limits of this inverse mapping.
Problem Setup
To study the limits of recovering disorder from diffraction, we construct a controlled synthetic system based on a 2D lattice. This allows us to vary different types of disorder independently and observe their effect on the resulting diffraction patterns.
We begin with a regular square lattice of points on a fixed grid. Two forms of disorder are introduced:
- Positional jitter (σ): each lattice point is randomly displaced from its ideal location. This models effects such as thermal motion or strain, where atoms remain present but are no longer perfectly ordered.
- Vacancy (v): each lattice point is randomly removed with a given probability. This represents defects such as missing atoms.
These two mechanisms affect the lattice in fundamentally different ways: jitter perturbs positions while preserving occupancy, whereas vacancy alters the structure by removing points entirely.
For each generated lattice, we compute the corresponding diffraction pattern by taking the 2D Fourier transform and using its magnitude (intensity). This mirrors the structure of real diffraction measurements, where phase information is not directly observed and only intensity patterns are available.
By systematically varying σ and v across a range of values, we generate a dataset of diffraction images corresponding to different disorder configurations. This dataset forms the basis for the learning problem.
We consider two formulations:
- Regression: predict the exact values of σ and v from the diffraction pattern.
- Classification: assign each sample to a coarse disorder regime based on discretized levels of σ and v, including a joint formulation where both parameters are classified simultaneously.
This setup allows us to test not only how well models can recover disorder parameters, but more importantly, whether the underlying mapping from diffraction to structure is sufficiently informative to distinguish different types of disorder.
Before applying any models, it is useful to understand how different types of disorder affect the diffraction pattern.
We begin by varying each parameter independently. In the first case, only positional jitter (σ) is increased while keeping vacancy fixed at zero. In the second case, only vacancy (v) is increased while keeping jitter fixed at zero.
These two forms of disorder produce distinct visual signatures:
- Increasing jitter (σ):
The diffraction peaks gradually broaden and lose sharpness. The overall structure of the pattern is preserved, but fine details become smeared as positional uncertainty increases. - Increasing vacancy (v):
The diffraction peaks weaken and become less structured. Rather than broadening, the pattern loses intensity and contrast as lattice points are removed.
These effects reflect the underlying physics: jitter introduces uncertainty in position, while vacancy reduces the number of coherent contributors to the diffraction signal.
However, when both σ and v are present simultaneously, their effects begin to overlap. Peak broadening and intensity reduction can combine in ways that make different configurations appear visually similar.
The following figures illustrate these trends, showing diffraction patterns across increasing levels of jitter and vacancy.
Regression Attempts: Random Forest and CNN
Having established how different types of disorder affect diffraction patterns, we now attempt to recover the underlying parameters directly using regression models.
The task is to predict the continuous values of positional jitter (σ) and vacancy (v) from the diffraction images.
We begin with a Random Forest (RF) model applied to flattened diffraction patterns. This provides a simple baseline to test whether the mapping from diffraction to disorder is learnable using standard machine learning methods.
The results show that:
- σ (jitter) is recovered reasonably well, with predictions closely tracking the true values across the full range.
- v (vacancy) is harder to estimate, with noticeable bias:
- lower vacancy levels tend to be overestimated
- higher vacancy levels tend to be underestimated
This suggests that while jitter leaves a consistent and separable signature in the diffraction pattern, vacancy introduces effects that are less uniquely identifiable, especially at higher disorder levels.
To better capture spatial structure in the diffraction images, we next train a Convolutional Neural Network (CNN). Unlike RF, the CNN operates directly on the 2D image, allowing it to learn spatial features such as peak shapes and distributions.
The CNN improves overall performance:
- Predictions for both σ and v are more tightly clustered around the true values
- The systematic bias in vacancy estimation is reduced, though not eliminated
Despite this improvement, a key observation remains:
Even with a more expressive model, the mapping from diffraction to disorder is not perfectly recoverable.
There is still overlap in predicted values, particularly for vacancy, indicating that some configurations of jitter and vacancy produce indistinguishable diffraction patterns.
Get Suvo Ganguli’s stories in your inbox
Join Medium for free to get updates from this writer.
The following figures show the regression performance for both models.
Classification Formulation
The regression results suggest that while approximate recovery is possible, precise estimation of disorder parameters — particularly vacancy — remains challenging. This raises a natural question: rather than predicting exact values, can we reliably distinguish between broader regimes of disorder?
To explore this, we reformulate the problem as a classification task.
We discretize both parameters into three levels:
Positional jitter (σ):
- Low
- Medium
- High
Vacancy (v):
- Low (no vacancy)
- Medium
- High
Each sample is assigned a joint class label based on the combination of σ and v levels. The resulting classes (0–8) correspond to:
- 0–2: low vacancy, increasing σ (low → high)
- 3–5: medium vacancy, increasing σ
- 6–8: high vacancy, increasing σ
We train both a Random Forest and a CNN on this classification task. Compared to regression, classification reduces sensitivity to small numerical differences and focuses instead on whether distinct regimes are separable in the diffraction space.
This formulation provides a clearer test of the underlying question:
Are different disorder mechanisms distinguishable at all, even at a coarse level?
The results, shown in the confusion matrices below, reveal how well each model can separate these joint disorder states and where ambiguity persists.
Results and Interpretation
The confusion matrices provide a clearer picture of what aspects of disorder are recoverable from diffraction data.
A first observation is that positional jitter (σ) is consistently well separated across all regimes (with only minor confusion between adjacent levels). In both the Random Forest and CNN models, predictions for σ tend to remain within the correct group of classes, with only minor confusion between adjacent levels. This suggests that jitter leaves a distinct and robust signature in the diffraction pattern, even as overall disorder increases.
In contrast, vacancy (v) is significantly harder to distinguish. Most of the misclassifications occur between classes that differ primarily in vacancy level while having similar σ. This is visible in the confusion matrices as mixing within blocks of classes corresponding to the same σ but different vacancy levels. In other words, the model often identifies the correct level of positional disorder but struggles to determine how many lattice points are missing.
Comparing the two models:
- The Random Forest shows substantial confusion across neighboring classes, particularly at medium and high vacancy levels.
- The CNN improves separation, with stronger concentration along the diagonal, indicating better overall classification performance.
However, even with the CNN, confusion between adjacent vacancy levels persists. This is especially evident at higher disorder, where the diffraction patterns become increasingly similar despite differences in the underlying structure.
These results point to an important conclusion:
The difficulty is not simply a limitation of the model, but a property of the inverse problem itself.
While positional jitter produces clear and separable changes in peak structure, vacancy alters the diffraction pattern in a way that is less uniquely identifiable. As a result, different combinations of σ and v can produce similar measurements, leading to unavoidable ambiguity.
In this sense, diffraction provides a strong signal for certain types of disorder, but only a partial and sometimes ambiguous view of others.
Discussion and Conclusion
This study set out to examine a simple but fundamental question: how much of structural disorder can be recovered from diffraction data?
By constructing a controlled setting with two distinct forms of disorder — positional jitter and vacancy — we were able to probe the limits of this inverse problem using both regression and classification approaches.
The results show a clear asymmetry:
- Positional disorder (σ) is reliably recoverable across all regimes. Its effect on diffraction — primarily peak broadening — produces a strong and separable signal.
- Vacancy (v) is only partially recoverable. While coarse distinctions are possible, especially at low disorder, the signal becomes increasingly ambiguous as disorder increases.
Importantly, these limitations persist even when using more expressive models such as CNNs. While CNNs improve performance by leveraging spatial structure in the diffraction patterns, they do not eliminate the underlying ambiguity.
This suggests that the challenge is not solely algorithmic. Instead, it reflects a more fundamental property of the inverse mapping from diffraction to structure:
Different configurations of disorder can produce similar diffraction patterns, making parts of the reconstruction problem inherently non-unique.
In practical terms, this has implications for how diffraction data is interpreted. While certain aspects of structure can be inferred with confidence, others — particularly those related to defects and missing elements — may require additional information or complementary measurements.
More broadly, this study highlights an important principle:
In inverse problems, improving the model does not always resolve ambiguity if the information is not present in the data.
Understanding these limits is as important as improving predictive performance, especially in settings where measurements are indirect and information may be fundamentally incomplete.








