  In the field of transmission electron microscopy, data interpretation often
lags behind acquisition methods, as image processing methods often have to be
manually tailored to individual datasets. Machine learning offers a promising
approach for fast, accurate analysis of electron microscopy data. Here, we
demonstrate a flexible two step pipeline for analysis of high resolution
transmission electron microscopy data, which uses a U-Net for segmentation
followed by a random forest for detection of stacking faults. Our trained U-Net
is able to segment nanoparticle regions from amorphous background with a Dice
coefficient of 0.8 and significantly outperforms traditional image segmentation
methods. Using these segmented regions, we are then able to classify whether
nanoparticles contain a visible stacking fault with 86% accuracy. We provide
this adaptable pipeline as an open source tool for the community. The combined
output of the segmentation network and classifier offer a way to determine
statistical distributions of features of interest, such as size, shape and
defect presence, enabling detection of correlations between these features.
