Editing Measured Nanoscale Sound Maps Without Erasing What the Simulator Misses

Microwave impedance microscopy (MIM) scans a sharp metal tip over a piezoelectric chip and records, at roughly 1 GHz, how the local electrical response changes as sound waves pass beneath it. It resolves acoustic waves at tens of nanometres, far below the optical diffraction limit. Physicists use these maps to ask counterfactual questions. How would this wave pattern look at a different drive frequency? What if a defect sat somewhere else, or a lattice parameter were tuned? Today those questions are answered in one of two ways. One is to re-simulate an idealized, usually isotropic model. That discards the anisotropy, substrate leakage and tip blurring that make real maps differ from simulations. The other is to fabricate and measure again.

This note proposes a generative model of acoustic fields that can edit a real measurement. The edit moves the parts a simulator understands along a learned direction in the model's latent space (its compressed internal code). A separate learned operator transports the parts the simulator does not explain, so they move consistently with the edit. The test is direct and falsifiable: from a map measured at one frequency, predict the map measured at another frequency, then compare against the real held-out scan.

Core Claim

Image editing has run into the reconstruction-editability trade-off. If an image is inverted so precisely that every pixel is reproduced, its latent code is pushed off the generator's well-behaved region and edits break. If it is inverted loosely, edits work but detail is lost. We claim this trade-off has a physical meaning for scanning-probe acoustics. The "detail" that a loose inversion loses is mostly unmodeled physics, such as anisotropic elastic constants, leaky bulk modes and tip convolution. Freezing that detail during an edit corresponds to the ghosting that StyleRes documented in faces. When pose changes, the high-detail features stay pinned to their old pixel positions.

StyleRes fixed this for faces by learning to transform the residual features along with the latent edit. We propose the physical analogue. We decompose a measured MIM map into a decoded in-distribution base and a residual. Edits move the base along linear latent directions. A transport network, trained on pairs from a higher-fidelity simulator, predicts how the residual should change for the same edit. We expect this to beat both naive frequency rescaling of the measured map and simulator refits on held-out measured frequencies. We also expect the gain to vanish when the residual is frozen.

Relation to Prior Work

The closest work is WaveDiffusion. It trains a joint latent diffusion model on seismic wavefields and velocity maps, and reports that denoising pulls latents toward physically consistent pairs, with the average wave-equation residual dropping from 0.013 to 0.002. It motivates using diffusion priors for wave physics. It also constrains our design, because physical consistency occupies a narrow region of latent space. That makes unconstrained latent arithmetic dangerous. WaveDiffusion generates fields; it does not invert or edit a measurement, and it works at kilometre scale rather than nanometres.

The measurement side supplies our data regime and our strongest naive analysis. Johnston et al. used one MIM tip as both acoustic source and receiver in LiTaO₃ domains. They swept 700–1300 MHz and extracted leaky surface acoustic wave velocities of 6.24–6.38 km/s by 2D Fourier transforms under isotropic assumptions. Zhang et al. imaged topological edge states in AlN phononic crystals near 1.045 GHz with transmission-mode MIM, at 10–100 nm resolution. Neither paper uses learned inversion. Both treat departures from isotropic simulation as an open problem rather than as signal to keep.

Three lines of work supply the method. InterFaceGAN finds attribute directions by fitting linear classifiers in latent space. It removes entanglement by projecting one direction off another, and it documents the "distance effect": large steps along a direction degrade samples. We reuse its direction-finding and projection. StyleRes supplies the residual-transport idea and its cycle-consistency training. There and Back Again shows that deterministic inversion of a diffusion model leaves image "ghosts" correlated with the source, mostly in smooth regions. Smooth regions are common in acoustic maps between wavefronts, so we expect this effect to be strong here. Its fix is to replace about 4% of inversion steps with stochastic noising, and we adopt it for the base inversion. The edit-aware inversions ENM and DCI re-optimize the inversion for each target edit. We deliberately avoid that design. Exploring many frequencies or defect positions from one scan requires a single inversion that supports many edits.

Research Program

The prior is a latent diffusion model, meaning a generator that learns to turn random noise into samples by repeated denoising. It is trained on simulated GHz acoustic potential maps for two families. The first is LiTaO₃ triangular domains driven by a point source. The second is AlN snowflake-lattice phononic crystals with interdigital-transducer excitation. Simulations are labelled with drive frequency, the lattice parameter δr, and defect position.

Training uses a "low-fidelity" simulator that is isotropic, lossless and has no tip model. A second, "high-fidelity" simulator adds anisotropic elastic tensors, substrate leakage and a convolution kernel for tip radius. This split is deliberate. It mimics the gap between simulation and a real scan, and it gives us supervision for the residual.

Attribute directions $\mathbf{n}_k$ are fitted with linear probes on inverted latents. Each is projected against the directions that encode domain or lattice geometry, so that a frequency edit cannot silently change the crystal. An edit is written

$$\mathbf{z}' = \mathbf{z} + \alpha\,\mathbf{n}_f, \qquad \hat{y}' = D(\mathbf{z}') + T_\theta\big(r, \alpha\mathbf{n}_f\big).$$

Here $\mathbf{z}$ is the inverted latent of a measured map $y$, $D$ is the decoder, $r = y - D(\mathbf{z})$ is the residual left after inversion, $\alpha$ is the edit strength, and $T_\theta$ is the transport network. $T_\theta$ is trained on high-fidelity simulated pairs at two parameter values. The losses are a cycle-consistency term (editing forward then back must recover $r$) and an agreement term with the true high-fidelity residual at the target parameter.

After each edit, a few denoising steps re-project $D(\mathbf{z}')$ toward the prior's high-density region. Following WaveDiffusion's observation, we expect this to restore physical consistency. We will measure it rather than assume it.

The analysis maps the trade-off explicitly. We vary how much of the map the base latent must explain, from a heavily regularized inversion to a near-exact one. For each setting we record reconstruction error at the source frequency and prediction error at held-out frequencies. That traces a curve for the acoustic domain, analogous to the one the image literature describes only qualitatively.

Baselines

The naive reference point uses only physics. For a weakly dispersive surface wave, the wavelength scales as $v/f$. We therefore spatially rescale the measured map from $f_1$ to $f_2$ by the factor $f_1/f_2$ about the source point and keep the domain boundaries fixed. This is what an experimentalist would do by hand, and it uses the same single input scan. It fails wherever boundary resonances or anisotropy break simple scaling. Our method must beat it on held-out measured maps, not merely on simulations.

The strongest physics competitor is a simulator refit. We fit the high-fidelity simulator's free parameters (elastic tensor corrections, leakage, tip radius) to the measured $f_1$ map by gradient-based optimization, then forward-simulate at $f_2$. This is the "exact physics" alternative a reviewer would favour. It gets the same simulator code and a compute budget matched to our training plus inference. Beating it means lower normalized error on held-out measured maps, at comparable or lower per-scan cost.

The strongest generative competitor applies the same diffusion prior with a plain deterministic inversion and the same linear direction, but no residual at all. We also include a frequency-conditioned version of the model in which the frequency label is simply swapped at generation time. Both use identical training data and tuning budget.

Two ablations isolate the key ingredient. One keeps the residual but freezes it, adding $r$ unchanged after the edit; this is the analogue of the ghosting failure. The other omits the stochastic first steps of inversion.

For the reference numbers, WaveDiffusion reports an average wave-equation residual of 0.002 and a velocity FID of 260.33 on OpenFWI. These are generation metrics, not edit-prediction metrics. On held-out-frequency prediction from MIM maps, or edit prediction on OpenFWI, no reported result was found on Lacuna. We will establish all baseline numbers ourselves under one protocol.

Why not just…?

Why not just re-simulate with the changed parameter? If the simulator were faithful this would win outright, and the refit baseline is designed to test that. The file's evidence is that it is not faithful. Johnston et al. rely on isotropic assumptions, and the measured maps deviate from isotropic simulation through anisotropy and leaky modes. A refit can recover some of this but is ill-posed and sensitive to tip radius. Our residual transport is useful exactly to the extent that the refit leaves structured error. If refit error on held-out frequencies equals ours, the proposal's central claim fails, and we will report that.

Why not just rescale the measured map by the frequency ratio? This may be competitive for open-domain propagation, where scaling is close to exact. We therefore report results separately for open regions and for the boundary-dominated interiors of closed domains and lattice corners. We predict the advantage concentrates in the latter. If it does not, the generative machinery is unnecessary for frequency edits.

Why not just invert exactly and add the latent direction, as in image editing? InterFaceGAN's distance effect and the ghost correlations in There and Back Again both predict failure. WaveDiffusion's sparse physical subspace predicts that the failure will show up as physically inconsistent fields. The plain-inversion baseline and the frozen-residual ablation test this directly.

Why not just use an edit-aware inversion like ENM or DCI? These methods re-optimize for each target. That defeats sweeping many counterfactuals from one scan. ENM reports 38.8 s per image versus 18.2 s for DDIM inversion in its setting, and that cost recurs for every target. We include ENM-style per-target inversion as an upper-bound reference and report its accuracy against total cost.

Proposed Experiments

The first stage is a controlled test on OpenFWI, where ground truth exists. We train the prior on CurveVel and CurveFault data generated with one source wavelet and attenuation-free physics. The "measurements" are produced with added attenuation and a blur kernel. The edit is a change of source frequency or a shift of a fault, and the true target is forward-simulated. We report held-out normalized mean squared error, SSIM, and wave-equation residual. We also report the full reconstruction-versus-edit-error curve for every baseline. CurveFault-B is the hard case: OpenFWI reports supervised inversion SSIM of only about 0.60 there, which signals where learned priors are weakest.

The second stage uses real near-field data. These are existing or newly acquired MIM frequency sweeps on LiTaO₃ domains across 700–1300 MHz and transmission-mode scans of AlN crystals across δr variants. The file lists no public benchmark for these measurements, so this requires lab collaboration. For every sweep, we invert one frequency and predict each other frequency. We score against the measured held-out maps with normalized correlation and error. We also add a physics check: velocities extracted by 2D Fourier transform from predicted maps should match velocities extracted the same way from measured maps, which Johnston et al. report as 6.24–6.38 km/s.

Three outcomes would be decisive. The proposal is supported if our method beats both rescaling and simulator refit on boundary-dominated regions of held-out measured maps. It is also supported if the frozen-residual ablation loses most of that gain, which would show the transported residual carries real, edit-dependent physics. And it is supported if the residual wave-equation error after editing stays near the unedited level for moderate edit strengths. The proposal fails if refit matches it, or if the gain appears only on simulations.