Below is one way to think about designing a neural‐network (NN) model that “knows” about the physics of the tunneling term so that the inverse problem of reconstructing the LDOS (i.e. the sample density of states, ρₛ(E)) from the measured STS signal
[
I(V) = \int_0^V \rho_s(E) , \rho_t(V-E) , T(E,V,z) , dE
]
remains tractable—even in high-energy regimes where the tunneling term
[
T(E,V,z) = \exp\left[\frac{2,z,k\Bigl((\phi + V - E)^{1.5} - (\phi - E)^{1.5}\Bigr)}{3,V}\right]
]
plays a dominant role. (Here, ϕ is the work function, k is a proportionality constant, z is tip-sample separation, and V is the bias voltage.) The key design idea is to “build in” the known structure of (T(E,V,z)) so that the NN is not forced to learn it from data (which could lead to severe overfitting), but rather to use it as a physically informed feature or layer.
Below is one recommended strategy, along with ideas for regularization and architecture choices.
1. Outline of the Problem
- Input Data:
You have measured STS current spectra I(V) for various bias voltages V (and possibly different tip–sample separations z).
- Target Quantity:
The unknown LDOS (\rho_s(E)) that you wish to reconstruct.
- Known Factors:
Tip density of states (\rho_t) (or a model for it) combined with the explicitly given tunneling term (T(E,V,z)).
The forward model is
[
I(V) = \int_0^V \rho_s(E) , \rho_t(V-E) , T(E,V,z) , dE,
]
and the goal is to “invert” this mapping—using a NN that respects the physics (especially the detailed behavior of (T))—to recover (\rho_s(E)).
2. Key Ideas for the Neural‐Network Design
A. Physics-Informed Layers
-
Precompute or Embed (T(E,V,z)):
Instead of making the NN “rediscover” the exponential dependence, include a dedicated layer that computes
[
T_{\text{computed}}(E,V,z) = \exp\left[\frac{2,z,k\Bigl((\phi + V - E)^{1.5} - (\phi - E)^{1.5}\Bigr)}{3,V}\right],
]
for a discrete set of energy samples (E). This layer can be hard-coded (or implemented as a custom activation or transformation) so that its parameters are fixed by physical constants (ϕ, k, etc.). Alternatively, if you suspect minor discrepancies in the assumed (T), you might allow a small “correction” subnetwork downstream.
-
Model the Convolutional/Integral Structure:
Notice that the measured signal is an “integral” (or convolution-like operation) over energy. One approach is to discretize the integral over energy and represent the forward model as
[
I(V) \approx \sum_{j=1}^{N_E} \rho_s(E_j) , \rho_t(V-E_j) , T(E_j,V,z) \Delta E.
]
Inverting this relationship is an ill-posed problem. One idea is to parameterize (\rho_s(E)) with a NN, and then use a “physics layer” that simulates the measured current using the discretized integral. You can then define a loss based on the discrepancy between the simulated current and the measured one.
B. Model Architecture: Two-Branch or Integrated Design
You can design the NN in one of the following ways:
-
Two-Branch (Encoder–Decoder) Approach:
-
Encoder:
Processes the raw STS measurement (I(V)) (and possibly associated parameters such as z or even V as a separate feature) to extract a latent representation.
-
Decoder (LDOS Predictor):
Maps the latent representation into an estimate (\hat{\rho}_s(E)).
-
Physics-Informed Forward Model Layer:
Take the predicted (\hat{\rho}_s(E)) and pass it through a fixed (non-trainable) layer that performs the discrete version of
[
\hat{I}(V) = \sum_j \hat{\rho}s(E_j) , \rho_t(V-E_j) , T(E_j,V,z) \Delta E.
]
The network then computes a loss such as (L = |I{\text{measured}}(V) - \hat{I}(V)|^2).
-
Integrated (Physics-Informed) Regression:
-
Input:
The inputs could include V, z, and perhaps (T(E,V,z)) evaluated over a grid of energies.
-
Feature Extraction:
Use several hidden layers (e.g., fully-connected layers or even 1D convolutional layers if you treat the spectrum as a “signal”) that are fed with the explicit computation of (T) (or its logarithm) so that the network “knows” the strongly varying weight.
-
Output:
Directly predict (\hat{\rho}_s(E)) on the same energy grid.
-
Loss:
Either compare the predicted (\rho_s) to training (if you have simulation/truth) or, if unsupervised, enforce that the forward model computed using the predicted (\rho_s) matches the measured I(V).
C. Regularization to Prevent Overfitting
Because the tunneling term varies strongly (exponentials can lead to large gradients), overfitting is a genuine risk. Consider:
-
Explicit Regularizers:
- Add an (L_1) or (L_2) penalty on the weights.
- Use a sparsity constraint on the latent representation if you expect the LDOS to have a “simple” structure.
-
Dropout/Batch-Normalization:
- Insert dropout layers after dense layers to reduce co-adaptation of neurons while training.
- Use batch normalization (with caution) to stabilize training given the high dynamic range of the tunneling term.
-
Physics-Constrained Loss:
- In addition to fitting the measured I(V), add a physics loss term:
[
L_{\text{physics}} = \sum_V \left|I(V) - \sum_{j}\hat{\rho}_s(E_j) , \rho_t(V-E_j) , T(E_j,V,z)\Delta E\right|^2,
]
which forces the network’s output to be consistent with the known forward model.
-
Data Augmentation/Simulation:
- Augment the training with simulated data generated over a range of expected parameter values (z, V, ϕ, etc.) to “teach” the network the expected variations.
-
Early Stopping:
- Monitor a validation loss based on the physics loss or reconstruction error and stop training early when overfitting is detected.
3. A Sample Architecture Outline (Pseudocode)
Below is a high-level pseudocode/PyTorch-like outline showing one possible architecture:
import torch
import torch.nn as nn
import torch.nn.functional as F
# --- Physics Layer: Computes the tunneling term T for a given energy grid ---
class TunnelingLayer(nn.Module):
def __init__(self, energy_grid, work_function, k_const):
super(TunnelingLayer, self).__init__()
self.register_buffer('E_grid', energy_grid) # [N_E]
self.phi = work_function
self.k = k_const
def forward(self, V, z):
# V and z: scalars or tensors of shape [batch_size, 1]
# Expand E_grid to match batch size
batch_size = V.shape[0]
E = self.E_grid.unsqueeze(0).expand(batch_size, -1) # shape [batch_size, N_E]
# To avoid division by zero for small V, add a tiny epsilon.
epsilon = 1e-6
V_safe = V + epsilon
term1 = (self.phi + V_safe - E).clamp(min=0)**1.5
term2 = (self.phi - E).clamp(min=0)**1.5
exponent = (2 * z * self.k * (term1 - term2)) / (3 * V_safe)
T = torch.exp(exponent)
return T # shape: [batch_size, N_E]
# --- The main network: Maps STS input spectrum to predicted LDOS ---
class LDOSPredictor(nn.Module):
def __init__(self, n_V, n_E, hidden_size, energy_grid, work_function, k_const):
super(LDOSPredictor, self).__init__()
self.n_E = n_E
self.energy_grid = energy_grid
# Encoder: Process the measured I(V)
self.encoder = nn.Sequential(
nn.Linear(n_V, hidden_size),
nn.ReLU(),
nn.Dropout(0.2),
nn.Linear(hidden_size, hidden_size//2),
nn.ReLU()
)
# Decoder: Map latent space to LDOS on energy grid
self.decoder = nn.Sequential(
nn.Linear(hidden_size//2, n_E),
nn.Softplus() # Enforce positivity if needed
)
# Physics-tunneling layer (non-trainable)
self.Tlayer = TunnelingLayer(energy_grid, work_function, k_const)
# You may also include a small sub-network that learns a correction factor for T:
# self.T_corr = nn.Sequential( ... )
def forward(self, I_V, V, z, rho_t):
"""
I_V: STS measured current on the bias voltage grid, shape [batch_size, n_V]
V: bias voltage (possibly a representative value or a vector), shape [batch_size, 1]
z: tip-sample separation, shape [batch_size, 1]
rho_t: tip density of states evaluated appropriately, shape should align with output integration
"""
# Encode the measured spectrum
latent = self.encoder(I_V)
# Predict the sample LDOS, shape [batch_size, n_E]
rho_s = self.decoder(latent)
# Compute physics-informed tunnelling term T, shape [batch_size, n_E]
T = self.Tlayer(V, z)
# Combine with tip DOS: Assume rho_t is provided (or computed externally)
# Here, we assume rho_t has the same discretization as energy grid, or can be interpolated.
combined_factor = rho_t * T
# Simulate measured current using the forward model (discrete sum approximates the integral)
# Here Delta_E is the energy grid spacing.
Delta_E = self.energy_grid[1] - self.energy_grid[0]
# I_hat: shape [batch_size, 1]
I_hat = torch.sum(rho_s * combined_factor, dim=1, keepdim=True) * Delta_E
return rho_s, I_hat
Explanation of the Components:
-
TunnelingLayer:
This layer computes the tunneling term (T(E,V,z)) using the known analytical form. Because its parameters are fixed by physics, it is set as a non-trainable layer. (Optionally, you could add a small correction network if you suspect systematic deviations.)
-
Encoder/Decoder:
The encoder processes the measured spectrum (I(V)) and compresses it into a latent representation. This latent vector is then mapped (via the decoder) into a predicted (\rho_s(E)) defined on a discretized energy grid. A final activation like Softplus ensures that the predicted LDOS is non-negative.
-
Forward Model Simulation:
The predicted (\rho_s(E)) is then “forward propagated” through the physics using the known (\rho_t) and the computed (T) to generate a simulated current (I_{\text{hat}}(V)). A loss function can be computed which compares (I_{\text{hat}}(V)) with the measured (I(V)).
4. Training Strategy and Loss Function
-
Primary Loss Term:
Compare the simulated current (I_{\text{hat}}(V)) with the measured current (I(V)), e.g.,
[
L_{\text{data}} = | I(V) - I_{\text{hat}}(V) |^2.
]
-
Regularization Losses:
- Weight decay (L2 regularization) on the learnable parameters.
- If available, incorporate any prior information on (\rho_s(E)) (e.g., smoothness constraints or sparsity) via an additional term (L_{\text{prior}}).
-
Total Loss:
[
L_{\text{total}} = L_{\text{data}} + \lambda , L_{\text{prior}}
]
where (\lambda) is a hyperparameter controlling the strength of the regularization.
-
Optimization:
Use standard optimizers (e.g., Adam) with learning rate scheduling and early stopping based on validation loss to avoid overfitting.
5. Discussion and Additional Notes
-
Extracting Information in (T(E,V,z)):
By explicitly computing (T(E,V,z)) in a separate layer, you remove the burden from the NN to “discover” the exponential sensitivity, which is crucial due to its high dynamic range. This design choice helps protect against overfitting and ensures that the essential physics is always part of the model.
-
Handling Overfitting:
The combination of dropout layers, explicit physics-based forward modeling (which reduces the effective number of free parameters), and strong regularization (both weight decay and potential prior constraints) should help mitigate overfitting.
-
Data and Simulation:
In many LDOS inversion problems, ground-truth (\rho_s(E)) is hard to obtain experimentally. Often you may rely on simulated data for training or adopt unsupervised approaches where the physics loss is the chief cost function.
-
Hyperparameters:
The discretization of energy, the hidden layer sizes, dropout rates, and regularization strengths all need careful tuning. Cross-validation or Bayesian optimization over these hyperparameters may be required.
6. Summary
The proposed NN model integrates physics directly by:
- Hardcoding the tunneling term (T(E,V,z)) in a dedicated layer.
- Embedding the convolution-like structure of the forward model as a fixed “physics layer”.
- Using a two-part network (encoder–decoder) that maps measured STS spectra to (\rho_s(E)) while ensuring that the predicted LDOS, when passed through the forward physics layer, reproduces the measured current.
By embedding known physics into the network architecture and carefully regularizing the learnable components, you reduce the risk of overfitting while enabling the network to concentrate on learning the remaining “unknown” LDOS features.
This design is just one example—the final implementation might need further tuning based on the characteristics of your data and the range of experimental conditions you wish to cover.