  Scanning Tunneling microscopy (STM) is a widely used tool for atomic imaging
of novel materials and its surface energetics. However, the optimization of the
imaging conditions is a tedious process due to the extremely sensitive
tip-surface interaction, and thus limits the throughput efficiency. Here we
deploy a machine learning (ML) based framework to achieve optimal-atomically
resolved imaging conditions in real time. The experimental workflow leverages
Bayesian optimization (BO) method to rapidly improve the image quality, defined
by the peak intensity in the Fourier space. The outcome of the BO prediction is
incorporated into the microscope controls, i.e., the current setpoint and the
tip bias, to dynamically improve the STM scan conditions. We present strategies
to either selectively explore or exploit across the parameter space. As a
result, suitable policies are developed for autonomous convergence of the
control-parameters. The ML-based framework serves as a general workflow
methodology across a wide range of materials.
