Safe Domain Adaptation for Physics: Overcoming Nuisances, Label Shifts, and Simulation Priors
Authors: Ivan Kharuk
Organizations: Institute for Nuclear Research of the Russian Academy of Sciences · Moscow Institute of Physics and Technology · Institute for Nuclear Research of the Russian Academy of Sciences, 60th October Anniversary Prospect 7a, Moscow, 117312, Russia · Moscow Institute of Physics and Technology, Institutsky lane, 9, Dolgoprudny, Moscow region, 141700, Russia
Domain adaptation is widely used to make neural networks trained on simulations applicable to experimental data. Its premise is that the two domains differ only in nuisances, and that the quantity of interest is distributed identically in both. In physics neither assumption holds: simulations can be wrong about the physics, and the distribution of the target quantity - an energy spectrum, a redshift distribution - is often the measurement itself. We study the consequences of such mismatches on a toy air-shower benchmark in which a detector-response nuisance, a physical simulation shift, and an energy-spectrum shift can be switched on separately or together. Standard adversarial adaptation handles the conditional shifts, but once the two spectra differ it aligns them, replacing an uncontrolled bias by one anchored on the simulation prior. We present adaptive domain adaptation, which reweights the simulated events so as to focus domain adaptation on the genuine physical mismatch alone. Since the predicted spectrum depends on model training configuration, we provide a label-free model selection rule for selecting the near-the-best operation point.
Figures & tables
Figure 1: An example of an event. (a): station locations and registered signal, (b): example of two waveforms registered by stations, with time axis in arbitrary units (a.u.).
Figure 2: Data flow during training and the network architecture. The labelled training set Dtr forms the regression batch (blue), which is processed by the transformer encoder and read by the regression head. The DA-source Dda and the target Dtgt are combined in equal proportion into the domain-adaptation batch (orange), which is processed by the same encoder and read by the domain-adaptation layer. The two paths meet in the combined loss.
Figure 3: (a) The true target spectrum, Beta(2,5) , and the Beta(4,6) spectrum used for the DA-source where a label shift is present. (b) A source (Gaussian) and target (Laplacian) waveform carrying the same integrated charge but a different pulse shape. (c) The true target spectrum and the target spectrum reconstructed without domain adaptation (baseline) and with DANN.
Figure 4: Pure lateral-distribution mismatch. (a) The predicted target spectrum with no adaptation and with DANN at the adopted recipe, against the true Beta(2,5) target. (b) Per-seed predicted target spectra at the optimal λ and at a poorly-chosen (too-large) λ .
Figure 5: Reconstructed target spectra against the true Beta(2,5) target. (a) Waveform and LDF mismatch with matched spectra, DA-source and target both Beta(2,5) : single event critic and disentangled two-critic scheme. (b, c) LDF and spectrum mismatch, true target Beta(2,5) and DA-source Beta(3,5) , at LDF slope +0.5E (b) and −0.2E (c), comparing ADA and DANN predictions.
Figure 6: Target per-event error MAEtgt against the DA-source − target spectrum-mean difference, for event ADA and DANN with the no-adaptation baseline, at LDF slope (a) +0.5E , (b) +0.2E and (c) −0.2E . Each operating point is chosen by the label-free rule of section 5 ; bands are ±1 std over the seeds.
Figure 7: Waveform-plus-spectrum mismatch for event ADA, DANN, staged DA, and waveform ADA with the no-adaptation baseline, against the difference between the DA-source and target spectrum means: (a) the target recovery WDtgt and (b) the calibration slope κ .
Figure 8: Iterative domain adaptation applied to staged DA. (a) Target recovery WDtgt against the iteration round, for three DA-source spectra at mean differences +0.11 , +0.21 and +0.31 . (b) Predicted target spectra across rounds for the largest mismatch, Δ=+0.31 .
Figure 9: Target recovery WDtgt against the DA-source—target spectrum-mean difference for event ADA and DANN for the triple mismatch at LDF slope (a) +0.2E and (b) −0.2E .
Figure 10: Iterative ADA under the triple mismatch. (a) Target recovery WDtgt against the iteration round, for a badly-mismatched prior ( α=−0.2 , DA-source Beta(3,2) ) and a mild one ( α=+0.2 , flat DA-source); round 1 is single-pass ADA and the dotted lines are the corresponding no-adaptation baselines. (b) Predicted target spectra across rounds for the −0.2E case, converging from the initial prior towards the true Beta(2,5) .
candidate label-free signal
kind
ρ
marginal separability LRacc
marginal latent
+0.3
conditional discrepancy (CMMD)
conditional latent
+0.77
augmentation consistency
prediction stability
−0.4 to −0.7
cross-seed spread
prediction stability
+1.00
Table 1: Label-free selection signals ranked (Spearman ρ ) against the true target recovery WDtgt on the waveform-and-LDF case of section 4.1 , oriented so that a positive value means the signal ranks recovery correctly. The no-DA baseline is excluded from the ranking.
knowledge of the target spectrum
domain shift
recommended scheme
—
none detected
no adaptation; the network already interpolates
trustworthy
any
DANN with an event-wise critic
approximate
localized
staged DA or ADA with localized critic
approximate
not localized
ADA with an event-wise critic
Table 2: Practical guidance on the choice of the adaptation scheme.
Unsupervised domain adaptation is a widespread set of methods that leverages the knowledge of a labeled source domain to train a model to perform well on a related unlabeled target domain. They generally introduce an auxiliary adaptation-related task that can be integrated into the multitask paradigm, which aims to merge multiple single-task models into a unified architecture. In this paper, we propose to associate domain adaptation and multitask balancing in the realistic context of an extreme class imbalance. Therefore, we propose a combined framework to cover and validate these approaches, and evaluate its performance in the physics-based context of the Cherenkov Telescope Array Observatory (CTAO). Along with a comparative study of some relevant adaptation techniques, we highlight the impact of extreme label shift and extend the investigations on importance weighting to rectify it. The complete code and results are published and available as open-source resources on Zenodo.
Michaël Dell'aiera, Thomas Vuillaume, Alexandre Benoit
CNRS LAPP, Annecy, 74940, France · Université Savoie Mont Blanc LISTIC, Annecy, 74940, France
Neural operator models trained on simulation data often lose accuracy when applied to experimental measurements due to the sim-to-real gap. Standard fine-tuning with limited real data can reduce this gap, but it may also damage the core physics-relevant representations learned during pretraining. Although knowledge-preserving adaptation has been widely investigated in vision or language tasks, it remains unclear whether these methods are suitable for neural operators whose architectures and protected knowledge are fundamentally different. Neural operators need to preserve core-scale physical structures rather than semantic or visual features. We propose PhysGuard, a physics-preserving framework for accurate sim-to-real adaptation of neural operators. Specifically, PhysGuard uses the empirical Fisher Information Matrix computed on simulation data to identify physics-critical parameter directions, then restricts fine-tuning updates to directions that do not interfere with them. A layer-wise Gram-matrix formulation makes this efficient for models with millions of parameters, while an adaptive threshold automatically determines the protected subspace size. A spectral probe experiment shows that the dominant Fisher directions are strongly associated with low-frequency output structures. Experiments on benchmark across four neural operator architectures and different physical systems show that PhysGuard performs strongly on most evaluation metrics compared to baselines. The benefits are most evident under severe domain shift, where it reduces low-frequency error by up to 32% compared to standard fine-tuning while maintaining adaptability. Our code is available at https://github.com/Data-Driven-Computational-Geotechnics/PhysGuard.
Changjian Zhou, Junfeng Fang, Negin Yousefpour +3
Faculty of Engineering and IT, University of Melbourne · School of Computing, National University of Singapore · Artificial Intelligence Research Institute, IFLYTEK Co., Ltd.
A fundamental challenge in science and engineering is the simulation-to-experiment gap. While we often possess prior knowledge of physical laws, these physical laws can be too difficult to solve exactly for complex systems. Such systems are commonly modeled using simulators, which impose computational approximations. Meanwhile, experimental measurements more faithfully represent the real world, but experimental data typically consists of observations that only partially reflect the system's full underlying state. We propose a data-driven distribution alignment framework that bridges this simulation-to-experiment gap by pre-training a generative model on fully observed (but imperfect) simulation data, then aligning it with partial (but real) observations of experimental data. While our method is domain-agnostic, we ground our approach in the physical sciences by introducing Adversarial Distribution Alignment (ADA). This method aligns a generative model of atomic positions -- initially trained on a simulated Boltzmann distribution -- with the distribution of experimental observations. We prove that our method recovers the target observable distribution, even with multiple, potentially correlated observables. We also empirically validate our framework on synthetic, molecular, and experimental protein data, demonstrating that it can align generative models with diverse observables. Our code is available at https://kaityrusnelson.com/ada/.
Kai Nelson, Tobias Kreiman, Sergey Levine +1
University of California, Berkeley · Lawrence Berkeley National Laboratory (LBNL)