  The rise of electron microscopy has expanded our ability to acquire nanometer
and atomically resolved images of complex materials. The resulting vast
datasets are typically analyzed by human operators, an intrinsically
challenging process due to the multiple possible analysis steps and the
corresponding need to build and optimize complex analysis workflows. We present
a methodology based on the concept of a Reward Function coupled with Bayesian
Optimization, to optimize image analysis workflows dynamically. The Reward
Function is engineered to closely align with the experimental objectives and
broader context and is quantifiable upon completion of the analysis. Here,
cross-section, high-angle annular dark field (HAADF) images of ion-irradiated
$(Y, Dy)Ba_2Cu_3O_{7-\delta}$ thin-films were used as a model system. The
reward functions were formed based on the expected materials density and atomic
spacings and used to drive multi-objective optimization of the classical
Laplacian-of-Gaussian (LoG) method. These results can be benchmarked against
the DCNN segmentation. This optimized LoG* compares favorably against DCNN in
the presence of the additional noise. We further extend the reward function
approach towards the identification of partially-disordered regions, creating a
physics-driven reward function and action space of high-dimensional clustering.
We pose that with correct definition, the reward function approach allows
real-time optimization of complex analysis workflows at much higher speeds and
lower computational costs than classical DCNN-based inference, ensuring the
attainment of results that are both precise and aligned with the human-defined
objectives.
