  Diffraction is the most common method to solve for unknown or partially known
crystal structures. However, it remains a challenge to determine the crystal
structure of a new material that may have nanoscale size or heterogeneities.
Here we train an architecture of hierarchical random forest models capable of
predicting the crystal system, space group, and lattice parameters from one or
more unknown 2D electron diffraction patterns. Our initial model correctly
identifies the crystal system of a simulated electron diffraction pattern from
a 20 nm thick specimen of arbitrary orientation 67% of the time. We achieve a
topline accuracy of 79% when aggregating predictions from 10 patterns of the
same material but different zone axes. The space group and lattice predictions
range from 70-90% accuracy and median errors of 0.01-0.5 angstroms,
respectively, for cubic, hexagonal, trigonal and tetragonal crystal systems
while being less reliable on orthorhombic and monoclinic systems. We apply this
architecture to a 4D-STEM scan of gold nanoparticles, where it accurately
predicts the crystal structure and lattice constants. These random forest
models can be used to significantly accelerate the analysis of electron
diffraction patterns, particularly in the case of unknown crystal structures.
Additionally, due to the speed of inference, these models could be integrated
into live TEM experiments, allowing real-time labeling of a specimen.
