Boris N.
Slautin
*a,
Yu
Liu
b,
Jan
Dec
c,
Vladimir V.
Shvartsman
a,
Doru C.
Lupascu
a,
Maxim A.
Ziatdinov
d and
Sergei V.
Kalinin
*bd
aInstitute for Materials Science and Center for Nanointegration Duisburg-Essen (CENIDE), University of Duisburg-Essen, Essen, 45141, Germany. E-mail: boris.slautin@uni-due.de
bDepartment of Materials Science and Engineering, University of Tennessee, Knoxville, TN 37996, USA. E-mail: sergei2@utk.edu
cInstitute of Materials Science, University of Silesia, Katowice, PL 40-007, Poland
dPacific Northwest National Laboratory, Richland, WA 99354, USA
First published on 17th March 2025
We have developed a Bayesian optimization (BO) workflow that integrates intra-step noise optimization into automated experimental cycles. Traditional BO approaches in automated experiments focus on optimizing experimental trajectories but often overlook the impact of measurement noise on data quality and cost. Our proposed framework simultaneously optimizes both the target property and the associated measurement noise by introducing time as an additional input parameter, thereby balancing the signal-to-noise ratio and experimental duration. Two approaches are explored: a reward-driven noise optimization and a double-optimization acquisition function, both enhancing the efficiency of automated workflows by considering noise and cost within the optimization process. We validate our method through simulations and real-world experiments using Piezoresponse Force Microscopy (PFM), demonstrating the successful optimization of measurement duration and property exploration. Our approach offers a scalable solution for optimizing multiple variables in automated experimental workflows, improving data quality, and reducing resource expenditure in materials science and beyond.
Currently, the mainstay of automated experimentation (AE) workflows across numerous scientific and industrial fields are the sequential Bayesian optimization (BO) algorithms.12,13 The process is conducted within a domain-specific experimental object space. BO-guided workflows have an iterative structure with an automated selection of the next candidate to be explored from the object space at each step. This selection is based on a predefined policy and reward function and is independent of direct human choice. The examples of BO-driven optimization could involve searching for an optimal composition within a phase diagram for material optimization,14–16 adjusting parameters like pressure, temperature, laser fluence, etc. for pulsed laser deposition,17 micro-drilling,18 laser annealing,19 or selecting locations in the image plane for spectroscopic measurements in microscopy,20,21 and so on. The BO-based frameworks have proven to be effective in guiding experiments, ranging from single-modality explorations in combinatorial synthesis, scanning probe microscopy, or electron microscopy to the co-orchestration of multiple modalities in one experimental cycle.14,15,22–24
In many cases, BO methods are built on the Gaussian Processes (GPs) as surrogate models capable of interpolation and uncertainty prediction over the parameter space.13 However, the standard GP methods are purely data-driven, limiting their efficiency in many situations.25 Realistic physical systems are often associated with ample prior physical knowledge, such as laws and dependencies. Incorporating this knowledge into the BO cycle can significantly enhance optimization efficacy.26,27 The common way to incorporate physical knowledge lies in specifying the mean function or kernel (covariance function) of the GP or defining boundary conditions.26,28 To embed more complex pre-acquired knowledge expressed in the form of high-dimensional datasets, advanced approaches such as Deep Kernel Learning can be utilized.21,29,30 Recently it has been shown that the addition of the mean function as a probabilistic physical model in structural GP significantly increases the efficiency of exploration for materials synthesis,31 combinatorial library exploration, and physics discovery.25,32
One of the key but seldom explored aspects of automated experiments is measurement noise. For purely data-driven applications, the noise level can be treated as a prior reflecting the degree of trust in the experimentally obtained observables, or as an optimization hyperparameter. Multiple approaches have been developed to enhance BO for noisy functions by advancing acquisition functions that explicitly integrate noise into the optimization process. These methods have been applied to both single-objective33–35 and multi-objective BO,36–40 enabling more robust and accurate optimization under uncertain and noisy conditions.
In physical systems, noise is not just an abstract prior but a measurable quantity that depends on multiple factors, including experimental conditions and parameters. For instance, in imaging and spectroscopic techniques, the noise level might be influenced by exposure time, sensor sensitivity, environmental conditions, and other operational parameters. The noise level can be reduced by optimizing measurement parameters and by increasing the exposure time. However, increasing the duration of the experiment inescapably leads to the growth of the experiment times and hence costs. Thus, finding a trade-off between the cost of an experiment and the signal-to-noise ratio (SNR) is an optimization problem that needs to be solved in many experiments.
More generally, reducing the financial expense of experimentation lies among the ultimate goals of experiment automatization. Thus, the cost of the experiment is one of the primary criteria for estimating the efficiency of AE. In many cases, the financial expense of experimentation is directly proportional to the time it consumes. Globally, two realistic approaches to experimentation can be distinguished: (1) budget-constrained experiments – maximizing exploration or optimization efforts within a predefined budget limit (time) for the entire experiment; (2) unrestricted experiments, where an algorithm must determine the best possible experimental trajectory according to the real-time feedback and without strict time limitations. The time expenses are determined by the number of exploration steps and the duration of each iteration. Today, most BO approaches focus on optimizing the number of required exploration steps, with the duration of each step typically being predefined. More advanced multi-fidelity and orchestrated BO approaches navigate across different fidelities or modalities to balance the cost of each iteration with the potential outcomes, thereby enhancing the efficacy of exploration.41–43 However, the cost and duration of steps for each modality are typically assumed to be known as a constant. Optimizing not only the number of steps (experimental trajectory) but also the duration (cost) of each iteration should advance the efficiency of AE. Such a budget-limited approach requires optimizing the entire experimental trajectory, allowing for variation in costs between different steps during the experiment. In contrast, in unrestricted experiments, we can optimize the cost of the individual step and use the predefined parameters for further investigation.
As a special case for automated experiments, we consider the intra-step optimization of the measurement times in the presence of noise. The exposure time is typically defined by an operator before the measurements and remains constant throughout the experiment. At the same time, for many spectroscopical methods (XRD, Raman, etc.) the exposure time is a major parameter that determines the signal-to-noise (SNR) ratio and therefore the amount of the gained information after each iteration. It is important to note that the significance of optimizing measured noise increases with longer exposure times. For example, in Raman spectroscopy of high-quality crystals, the accumulation time may not exceed 0.1 seconds. While, for Raman measurements of lithiated electrode materials, where conductivity is much higher, accumulation times can extend to minutes or even tens of minutes.44 This extended duration makes noise optimization critical, as it can significantly impact the quality, reliability, and cost of the measurements. Precise measurements of scalar properties, such as the ultra-low DC electron conductivity of dielectric crystals, also follow this principle.
Here, we present a workflow for incorporating intra-step noise optimization into the BO GP cycle. The proposed workflow defines the optimal exposure time to balance the quality and cost of each iteration directly within the cycle of the automated investigation of the target property. We explore the two alternative approaches: a reward-driven noise optimization and a double-optimization acquisition function. We validate our method through simulations and real-world experiments using Piezoresponse Force Microscopy (PFM).
At each iteration, the optimization process can be broken down into three sequential steps: (1) GP modeling of f and its uncertainty distribution within the input space (x,t), (2) construction of the acquisition function that incorporates the cost of the experiment for noise optimization, and (3) selection of the next location to discover at the extremum to the selected acquisition function in (x,t) space (Fig. 1). While the third step remains similar to the classical BO approaches, the construction of the surrogate GP model and the acquisition function are detailed below.
K′ = K + diag(Noisef), | (1) |
To reflect the independence of the f(x) on t, the kernel function (covariance) of the primary model has been adjusted by deactivating the time dimension. In this scenario the kernel function solely depends on the distance between the projections of the measured points onto the x axis, ignoring their distribution relative to the t axis. The specified Matérn 5/2 kernel is expressed as:
![]() | (2) |
In many cases, optimizing the noise level is facilitated by our understanding of its nature and the availability of models to describe it. The noise in the system typically consists of time-independent and time-dependent components. For many spectroscopical measurements, decaying noise arises as signal averaging is performed over longer acquisition times, with the noise level decreasing, following as . In turn, the time-independent noise component can be represented by a thermal, instrumental, and readout noise, for instance. The expression for the total noise may be written as:
![]() | (3) |
Direct construction of traditional acquisition functions (such as Maximum Uncertainty, Expected Improvement, Upper Confidence Bound, etc.) based on GP predictions and uncertainties over the (x,t) space enable us to prioritize the location in x axis for measuring f(x) at the next step. At the same time, this approach is not suited for optimizing measurement duration.
To accomplish this goal, we proceed with the following derivation. From eqn (1), the total uncertainty includes the time-dependent noise component and the time-independent part:
![]() | (4) |
To optimize exposure time (and thereby reduce noise), it is necessary to introduce a cost model and a reward function (R) that balance the cost against the achievable noise level for a single measurement. In the simplest case, the cost of our measurements is determined solely by the exposure time and depends linearly on it: R(Cose(t),Noise) = R(t,Noise).
Given that our goal is to minimize noise while also minimizing cost (i.e., exposure time), our reward should decrease as either exposure time or noise increases. There are no strict rules to construct the reward function besides the principles mentioned above. In our experiments, we defined the reward function for noise optimization as follows:
R(t,Noise) = −α × t2 − β × Noise, | (5) |
Given the reward function, the acquisition function can be adjusted to capture the interdependency between the measurement cost (duration) and the noise level. Below, we outline two approaches for integrating noise optimization into the investigation of f(x) by incorporating the reward function into the acquisition function:
(1) Pure reward-driven noise optimization: in this approach, the reward serves as a weighting function for classical acquisition functions, which prioritizes certain exposure time. This method directly incorporates noise considerations into the reward mechanism.
(2) Double-optimization acquisition: this approach uses an artificial total acquisition function that integrates two ‘independent’ components: the first is an acquisition function tailored for optimizing f(x), and the second is a time acquisition function built around the noise reward function and the uncertainty in the noise model predictions. Each component addresses a distinct objective, enabling both noise and function optimization within a Bayesian framework.
In the pure reward-driven approach, the reward function acts as a weighting factor for the classical acquisition function defined over the entire (x,t) space:
![]() | (6) |
Optimizing exposure time within a Bayesian framework requires constructing an acquisition function that balances the reward with its associated uncertainty. Since the reward function is derived from the noise model, the uncertainty propagation rule can be used to calculate the uncertainty of the reward. Classical BO approaches with acquisition function (e.g., Expected Improvement, Upper Confidence Band, etc.) defined over (x,t) space (nominally, because R is independent on x) allow for the optimization of exposure time. Since we cannot reduce the Noisef(ti) for the chosen point (xi,ti), we construct a surrogate acquisition function, to optimize f(x) by extending the uncertainty of f predicted at a specific time
across the entire (x,t) space.
The double-optimization acquisition function, acqf(x,t), should integrate both components described above: the exposure time optimization acquisition function and the selected acquisition function for optimizing f(x). The final double-optimization acquisition function was constructed as a sum of the normalized acquisition functions for exposure time – acqt(x,t) and for f(x) – acqx(x,t).
acqf(x,t) = ½[Norm(acqt(x,t)) + Norm(acqx(x,t))] | (7) |
The efficiency of the method was evaluated both through simulations and in the actual exploration of the local domain structure using the Piezoresponse Force Microscopy (PFM) technique.
In the simulations the f(x) study was driven by the pure exploration strategy (Uncertainty Exploration, UE). The exponential factor γ is set to 5. In the double-optimization approach, the EI acquisition function is used for the exposure time optimization. All simulation experiments start with 3 seed measurements in the random locations within input space and contain 15 subsequent exploration BO-guided steps. Before noise optimization converged, 30 repeated measurements of f(xi)were simulated at each iteration. These measurements are used to determine the function value and assess the associated uncertainty at each measured point (xi,ti). The variance in the predicted time below 5 × 10−4 for the last three steps is used as a criterion of the noise model convergence. After the model has converged, f(xi) is estimated using 3 measurements, while the noise level is determined based on the model predictions for ti. The priors A0 and A1 in the noise mean function are sampled from a Uniform(0,15) distribution for both approaches.
The real automated experiment evaluation of the model efficiency was performed using PFM using an MFP-3D (Oxford Instruments, USA) scanning probe microscope. Silicon probes with the conductive Pt/Cr coating Multi75 E-G were used for the response acquisition. The Dual Amplitude Resonance Tracking (DART) mode of PFM has been used to acquire the ground truth profile. The resonance spectra were measured at a constant sampling rate of 10 kHz. Given the constant sampling rate, varying the sweep time led to changes in the number of acquired data points within the resonance curve, affecting the precision of the resonance fitting by eqn (8) and, thereby, surface displacement amplitude estimation. The microscope is operated automatically via the AESPM Python library using a control program written in a Jupyter notebook.46 The main calculations, including BO, are executed in Google Colab, which is connected to the microscope control notebook for real-time data exchange through a simple web server.
The objective of the real experiment was in the exploration of the piezoelectric response dependences (UE acquisition function) with simultaneous optimization of the sweep time (EI acquisition function). The double acquisition approach was used to guide the automated experiment. The experiment comprised 20 BO-guided steps, preceded by 3 preliminary seed measurements at random locations within the exploration space.
f(x) = (6x − 2)2![]() | (8) |
![]() | ||
Fig. 4 Ground truth (a) f(x) function and (b) noise model; (c) f(x) and (d) noise model defined over the exploration space. |
The ground truth noise model is defined by eqn (3) with parameters A0 = 0.1 and A1 = 2 (Fig. 4b). The reward function for optimizing exposure time is given by expression 5 with α = 0.1 and β = 2. The coefficients α and β indirectly determine the cost function. The optimization process is constrained within the input space x ∈ [0,1] and t ∈ [0.2,10].
The experiment simulates the exploration of the Forrester function by the iterative measurements of f(x). At each exploration step, the automated agent selects the next location to be explored and the “exposure” time, which determines the precision of defining f(x). The noise component is modeled as a normally distributed addition to the ground truth, with its standard deviation governed by the duration based on the ground truth noise model. Before the noise model converges, the algorithm estimates the noise level through repeated measurements at the exploration locations. Once the noise optimization converges, the noise estimation is derived from the optimized noise model. The idea and main goal of the experiment is to explore f(x) automatically, simultaneously optimizing the measurement duration.
The experiment simulation, driven by both the pure reward (Fig. 5a, c, e and g) and double acquisition approaches (Fig. 5b, d, f and h), demonstrated their ability to converge after only a few BO-based exploration steps. However, notable differences in the evolution of the exploration process are observed between the two methods. We repeated the experiment in simulation mode multiple times for both approaches. The discussion below focuses on the comparison of the most representative results; additional outcomes are published on GitHub (see Data availability).
In most of our experiments, even with only three seeding locations, the algorithm often succeeds in prioritizing duration ranges close to the true optimal time. However, the accuracy of this noise estimation heavily depends on the number of iterative measurements taken at each location. To ensure reliable estimation, we follow the empirical lower limit for parameter estimation of a normal distribution, using 30 measurements at each location.
The pure reward-driven approach demonstrates fast convergence after a few BO iteration steps (Fig. 5c). Typically, the reward-driven model converges to a duration slightly lower than the ground truth value due to the combined effects of reward and noise, as discussed earlier (Fig. 5a and c). Increasing the exponential factor, γ, further reduces this difference. It is important to note that, in the limit, the reward function can be substituted by a delta function with its peak at the optimal reward point. While the algorithm converges rapidly to the optimal exposure time, the estimation of the A0 and A1 parameters that define the noise model may not always align perfectly with the ground truth. The algorithm typically approximates the noise model accurately near the optimal exposure time, but predictions for both very high and very low durations may remain less accurate.
Experiments based on the double-acquisition method typically require a similar number of steps before the model converges to the optimal measurement duration (Fig. 5d and S1†). Incorporating noise prediction uncertainty into the optimization process in a double-acquisition-driven approach typically improves noise model parameter predictions. However, this doesn't always lead to a significant enhancement in the accuracy of the optimal duration prediction. Additionally, the double-acquisition method does not exhibit the optimum shift effect, often resulting in a slightly more accurate estimation of the ground truth duration.
Concurrently with exposure time optimization, both algorithms explore the Forrester function using the UE acquisition function, which is the main objective of the automated experiment. Important to note, that although we selected the uncertainty exploration, any other acquisition functions without restrictions can be employed for the f(x) exploration or optimization. The structure of the proposed approaches is capable of independent optimization of noise and function within the same cycle (Fig. 5e–h). The time dependencies of the acquisition function at different locations exhibit similar profiles. Similarly, the projections onto the x-axis of time-constant profiles show analogous patterns. This is clearly illustrated by the visualization of the acquisition function values across the exploration space (Fig. 5a and b).
In our experiments, both the pure reward-driven and double acquisition-based approaches achieved convergence to optimal duration in more than 90% of the attempts during the first 10 exploration steps independent of the seed locations. Beyond the simple exploration of the function f(x), the algorithm was also tested for optimization using the EI acquisition function (Fig. S2†). In these experiments, we observe that the noise model usually converges at a similar rate (Fig. S1†). No clear correlation was observed between the rate of measurement duration optimization and the optimization of the f(x) itself. This suggests that noise optimization does not interfere with the primary optimization process. It is important to note that both approaches successfully identify the optimal measurement duration with only 5 repetitive measurements at each point (Fig. S3†), which can be crucial for real-world experimentation. However, as the number of measurements per point decreases, the number of optimization steps required for convergence naturally increases.
![]() | (9) |
The predicted response dependencies after 20 exploration steps, along with the actual data extracted from the PFM scan, are shown in Fig. 6b. The predicted profile shape closely follows the real one measured by PFM, effectively reconstructing the actual profile. It is important to note that for accurate domain reconstruction, implementing structured GP as a surrogate model would be more appropriate than the GP with a modified Matérn 5/2 kernel used in this experiment. However, for our specific goals, the chosen model is more than adequate. The differences between the DART technique used for obtaining the ground truth profile and response estimation from full resonance hinder direct comparison of absolute values. Therefore, the primary objective of our experiment was to accurately reconstruct the shape of the ground truth profile rather than to match the absolute values.
The experiment trajectory clearly shows that, at each step, the algorithm selects spatial coordinates with the highest uncertainty, aligning with the UE acquisition function (Fig. 6e). The close match between the predicted profile and the PFM scan response confirms the successful progression of the experiment toward the reconstruction objective. From the analysis of the exploration trajectory (Fig. 6d and e), it is evident that in the early stages, the model actively explores along the t-axis. However, after 11 initial exploration steps, the model converges to a value of single spectrum measurement duration 0.41 s (Fig. 6c) representing the optimum for the chosen reward function (eqn (5)). This convergence toward the optimal value after initial exploration is typical for BO driven by the EI acquisition function.
Overall, the proposed approach demonstrates its ability to pursue the predefined primary objective—an exploration of the PFM response along the profile—while simultaneously optimizing the resonance curve measurement duration. For greater statistical significance, we repeated our experiment multiple times with different seed locations. In each case, the model successfully converges. The results of these experiments can be found in GitHub (see Data availability).
The efficiency of the proposed framework was validated through a simulation of the Forrester function exploration, a benchmark for optimization processes, and a real automated PFM experiment. In both cases, the framework successfully demonstrates its ability to simultaneously optimize measurement duration and the target property. Including measurement duration in the BO cycle was found to have no noticeable impact on the primary objective of optimizing the target function. When dealing with homoscedastic noise that is independent of x and a target function that is independent of exposure time, this addition does not result in an exponential increase in the required number of observations (curse of dimensionality). However, a moderate increase in computational complexity is expected due to the expanded dimensionality of the exploration space. Important to highlight, when expanding the number of ‘ordinary’ variables, the same limitations faced by traditional BO-based approaches – such as the curse of dimensionality, the complexity of constructing accurate surrogate models, and the challenges of optimizing the acquisition function – still apply.
The proposed workflow incorporates intra-step optimization within the automated experiment, enhancing global optimization efficiency by balancing knowledge acquisition with experimental costs. This approach is particularly valuable for automating spectroscopic measurements, such as Raman, XRD, etc., where exposure (or accumulation) time is a critical hyperparameter.
Footnote |
† Electronic supplementary information (ESI) available. See DOI: https://doi.org/10.1039/d4dd00391h |
This journal is © The Royal Society of Chemistry 2025 |