Data Science for Electron Microscopy
Lecture 7: Gaussian Processes 2
FAU Erlangen-Nürnberg
Initially, we have no idea about the gold distribution. We can learn the gold distribution by drilling at different locations. However, this drilling is costly. Thus, we want to minimize the number of drillings required while still finding the location of maximum gold quickly.
\(Z= \frac{\mu_t(x) - f(x^+) - \epsilon}{\sigma_t(x)}\)
MacKay’s Question (1998)
“How can Gaussian processes possibly replace neural networks? Have we thrown the baby out with the bathwater?”
Key Insight
Neural networks can automatically discover meaningful representations in high-dimensional data
Key Insight
GPs with expressive kernels can discover rich structure without human intervention
Core Concept
Transform the inputs of a base kernel with a deep architecture to create scalable expressive closed-form kernels
\[k(\mathbf{x}_i, \mathbf{x}_j | \boldsymbol{\theta}) \rightarrow k(g(\mathbf{x}_i, \mathbf{w}), g(\mathbf{x}_j, \mathbf{w}) | \boldsymbol{\theta}, \mathbf{w})\]
Where:
Deep Kernel Learning
Infinite Hidden Units
The GP with base kernel provides an infinite number of basis functions in the final layer
Maximize the marginal likelihood:
\[\log p(\mathbf{y} | \boldsymbol{\gamma}, X) \propto -[\mathbf{y}^{\top}(K_{\boldsymbol{\gamma}}+\sigma^2 I)^{-1}\mathbf{y} + \log|K_{\boldsymbol{\gamma}} + \sigma^2 I|]\]
Gradients via chain rule: \[\frac{\partial \mathcal{L}}{\partial \mathbf{w}} = \frac{\partial \mathcal{L}}{\partial K_{\boldsymbol{\gamma}}} \frac{\partial K_{\boldsymbol{\gamma}}}{\partial g(\mathbf{x},\mathbf{w})} \frac{\partial g(\mathbf{x},\mathbf{w})}{\partial \mathbf{w}}\]
\[k_{\text{RBF}}(\mathbf{x}, \mathbf{x}') = \exp\left(-\frac{1}{2} \frac{\|\mathbf{x}-\mathbf{x}'\|^2}{\ell^2}\right)\]
Properties:
\[k_{\text{SM}}(\mathbf{x}, \mathbf{x}' | \boldsymbol{\theta}) = \sum_{q=1}^Q a_q \frac{|\Sigma_q|^{1/2}}{(2\pi)^{D/2}} \exp\left(-\frac{1}{2} \|\Sigma_q^{1/2} (\mathbf{x}-\mathbf{x}')\|^2\right) \cos\langle \mathbf{x}-\mathbf{x}', 2\pi \boldsymbol{\mu}_q \rangle\]
Properties:
The Scalability Challenge
Standard GPs: \(\mathcal{O}(n^3)\) complexity Goal: Linear scaling \(\mathcal{O}(n)\)
\[K_{\boldsymbol{\gamma}} \approx M K^{\text{deep}}_{U,U} M^{\top} := K_{\text{KISS}}\]
Where:
Key Finding
Deep Kernel Learning consistently outperforms both: - Standalone deep neural networks - Gaussian processes with expressive kernels
Visualization
The learned metric correlates faces with similar rotation angles, overcoming Euclidean distance limitations
Key Benefit
Scalability enables learning from large datasets where expressive representations matter most
Challenge
Recover step function with sharp discontinuities
DKL provides posterior predictive distributions useful for:
Deep Kernel Learning Successfully Combines:
Scalable, expressive, and principled machine learning approach that consistently outperforms both paradigms alone
We have already covered
Today we see both in action inside the microscope.
\[\begin{equation} \operatorname{EI}(\mathbf{x}) = \big(\mu(\mathbf{x}) - y^{+} - \xi\big)\,\Phi\!\left(\dfrac{\mu(\mathbf{x})-y^{+}-\xi}{\sigma(\mathbf{x})}\right) + \sigma(\mathbf{x})\,\phi\!\left(\dfrac{\mu(\mathbf{x})-y^{+}-\xi}{\sigma(\mathbf{x})}\right) \end{equation}\]
Figure 1: DKL workflow for 4D-STEM: learning (a), prediction (b), and measurement (c). Features are HAADF-STEM image patches; targets are scalarized diffraction patterns from patch centers.
Key idea
CNN‑based embedding → GP kernel → BO acquisition
Two 4D datasets demonstrate the approach:
Intelligent sampling reduces beam damage through:
Tip
DKL recovers CoM‑magnitude map with nanometre detail from <1 % of pixels → 30‑fold dose reduction
Nanobeam electron diffraction (NBED) approach:
Note
Key insight: DKL learns to measure near boundaries where strain is highest, even without prior knowledge of material structure
DKL active learning on MnPS3 with DPC CoM scalarizer. Shows exploration pathway, predictions, and uncertainty at key steps. Periodic interference from sulfur vacancy generation. Scale bars: 5 and 2 nm.
MnPS₃ beam-sensitive material:
DKL autonomous exploration:
Tip
Key insight: DKL discovers ordered vacancy superstructures while protecting beam-sensitive specimens
Active learning for 4D-STEM imaging:
Future opportunities:
Note
Key insight: Active learning transforms 4D-STEM into an autonomous discovery platform for quantum materials research
©Philipp Pelz - FAU Erlangen-Nürnberg - Data Science for Electron Microscopy