We present a physics-guided deep-learning framework for gravity-field recovery, built on a Swin Transformer backbone and an Adaptive Multi-domain Attention Multiscale Feature Fusion (AMAMFF) module. The AMAMFF module uses a symmetric U-shaped decoder to preserve high-frequency details and combines channel attention, self-attention, spatial attention, and frequency-domain attention for dynamic fusion of multi-source geodetic inputs. To introduce physical guidance, we add a spectral Laplacian residual term to the training objective, where spectral derivatives are used to compute Laplacian consistency penalties. The final hybrid loss jointly optimizes data fidelity and physics-guided regularization for high-resolution gravity anomaly reconstruction.
3.2.1. Adaptive Multi-Domain Attention Multiscale Feature Fusion Module
We refer to the Adaptive Multi-domain Attention Multi-scale Feature Fusion module as AMAMFF. To mitigate the loss of high-frequency spatial details caused by the downsampling operations in the Swin Transformer backbone, we design a symmetric U-Net Multi-Scale Feature Fusion Module, as illustrated in
Figure 4.
This decoder structure adopts a U-Net-like architecture to bridge the gap between the deep semantic representations extracted by the encoder and the shallow geometric details required for high-resolution gravity field reconstruction.
The Channel Attention mechanism serves a critical role in handling the potential multicollinearity among multi-source inputs (e.g., VGG, DOV, and Geoid). In traditional inversion methods like Least Squares Collocation (LSC), highly correlated inputs can lead to ill-conditioned covariance matrices and unstable solutions. However, our deep learning framework addresses this through Adaptive Feature Recalibration. The Channel Attention module acts as an “Adaptive Soft Selector”. It learns a weight vector
through the global average pooling and fully connected layers (Equation (
6)). This allows the network to dynamically suppress redundant information and amplify informative features based on the local context. For instance, in regions with sharp topographic changes, the network can assign higher weights to the VGG channel (which is sensitive to high-frequency edges) while downweighting the smoother Geoid channel, and vice versa. This mechanism effectively converts the challenge of multicollinearity into an advantage of multi-view feature fusion.
The Swin Transformer backbone generates hierarchical feature maps
at four distinct stages. These features possess decreasing resolutions (ranging from
to
of the input size) and increasing channel dimensions (
). To facilitate efficient fusion, we first utilize
convolutional layers to project features from all stages into a unified hidden dimension
(set to 64 in our experiments), ensuring channel alignment:
where
denotes the projected standardized feature map at stage
i. The decoding process follows a bottom-up restoration pathway. As shown in
Figure 5, the reconstruction starts from the deepest bottleneck feature
. For each subsequent stage
i, the decoder feature
is generated by fusing the upsampled feature from the deeper layer (
) with the corresponding encoder feature (
) via lateral skip connections.
Before upsampling, the Stage 2 bottleneck feature F3 is first refined by a frequency-domain attention module. This module adaptively amplifies high-frequency components associated with gravity anomalies while suppressing noise. The procedure is as follows:
First, the features are transformed into the frequency domain using the Fast Fourier Transform (FFT):
Second, a lightweight adaptive-threshold network is employed to learn frequency-domain masks, enabling the soft gating and global scaling of distinct frequency components:
Finally, the optimized features are restored to the spatial domain via the inverse Fourier transform (IFFT):
Here, and denote the two-dimensional Fourier transform and its inverse, respectively, and are learnable parameters, and ⊙ denotes element-wise multiplication. The enhanced feature serves as the decoder’s initial input and is denoted as .
Attention modules: Prior to describing Feature Integration, we first define the three attention mechanisms employed.
- (1)
Channel Attention
Employing a squeeze-and-excitation architecture, spatial information is first compressed via global average pooling. Subsequently, two fully connected layers combined with a Sigmoid function generate the channel weight vector:
where
x denotes the input feature, GAP denotes global average pooling,
and
are learnable weights, and
is the Sigmoid function. The weighted feature is
- (2)
Self-Attention
This introduces a lightweight global context modeling module that aggregates long-range dependencies through a query–key–value mechanism:
where
,
, and
are the projection weight matrices, and
denotes the dimensionality of the keys.
- (3)
Spatial Attention
This generates spatial weight maps through convolutional layers to highlight important regions:
where
and
denote the results of average and max pooling along the channel dimension, respectively. The weighted output is
Specifically, the fusion operation consists of three steps:
- 1.
Upsampling: The deeper feature map is upscaled by a factor of 2 using a transposed convolution layer (ConvTranspose2d).
- 2.
Concatenation: The upsampled feature is concatenated with the skip-connected encoder feature along the channel dimension.
- 3.
Feature Integration: The concatenated tensor is processed by a fusion block consisting of a convolution, Batch Normalization (BN), and a GELU activation function to smooth aliasing effects and integrate contextual information.
Mathematically, this recursive fusion is defined as
where
represents the fusion block
where
is defined by the following conditional expression:
After iterative fusion, the final decoder feature map
reaches a resolution of
. To generate the final output, we apply a final
transposed convolution to upsample the feature map to the original input resolution (
). A linear regression head (implemented as a
convolution) is then applied to map the high-dimensional features to the single-channel predicted gravity anomaly map
:
Table 1 shows that the multi-domain attention modules in AMAMFF are not stacked merely to deepen the network but are tailored to the specific characteristics of gravity anomaly data. Channel attention reweights heterogeneous geophysical inputs, while spatial attention highlights local gravity features and self-attention captures long-range structural correlations. Frequency-domain attention suppresses nonphysical high-frequency noise by exploiting the spectral properties of the potential field. Applied sequentially, these modules progressively refine features rather than redundantly amplifying them, a distinction that appears in the comparative performance of the ST, ST-AMAMFF, and ST-AMAMFF-PINN models.
By leveraging this multi-scale fusion strategy, the network effectively recovers the fine-grained gravity signals associated with topographic variations while maintaining the global trends captured by the deep transformer layers.
3.2.2. Improvements to the Loss Function
To combine shipborne gravity measurements with prior geophysical knowledge, this study develops a hybrid loss function that integrates data-driven and physics-based constraints. The loss comprises a data term
and a physics term
, and its overall form is given by the following equation:
Among these,
is the hyperparameter that balances the two components. The data items use mean square error (MSE) to measure the discrepancy between predicted values and true values obtained from ship surveys:
where
represents the predicted residual map for the
i-th sample,
denotes the center pixel index, and
indicates the ground truth residual from the shipborne measurement. The physics term incorporates the frequency-domain relationship of the gravitational field as a physical constraint. Based on phase field theory [
41,
42], this ensures that the predicted results comply with physical laws. The residual map
of the predicted gravity anomaly is converted to the frequency domain:
where
represents the frequency domain coordinate and
denotes the two-dimensional Fourier transform. The vertical second derivative of gravity anomaly
can be approximated in the frequency domain as [
39,
41]
Therefore, the vertical gradient calculated from the predicted gravity anomaly is
The predicted vertical gradient in the spatial domain is obtained through the inverse Fourier transform:
where
denotes the inverse Fourier transform. Compare
with
in the input channel:
where
represents the coordinate position in the spatial domain.
Where
(Equation (
17) in original text) ensures data fidelity at shipborne observation points, while
constrains the solution space to the set of valid harmonic functions. By minimizing Equation (
16), the network is prevented from generating non-physical high-frequency artifacts that violate Laplace’s equation.
Sensitivity Analysis of the Physics-Guided Regularization Weight ()
The hyperparameter
in Equation (
16) balances data fidelity (
) and physical consistency (
). We conducted a sensitivity analysis by varying
from 0.01 to 1.0.
Small (<0.05): The model converges faster to the data but exhibits high-frequency noise in the derivatives, indicating insufficient physical regularization.
Large (>0.5): The total loss is dominated by the gradient constraint, leading to “over-smoothing”, where sharp peak signals (e.g., seamounts) are attenuated.
Optimal (): Empirical results show that provides the best trade-off, minimizing RMSE while maintaining sharp, physically consistent gradients.
3.2.3. Complete Model Architecture
The proposed framework is a physics-constrained deep learning architecture for reconstructing gravity anomalies and comprises four stages (
Figure 5). The first stage prepares multisource inputs and constructs the network input to reduce data heterogeneity through the fusion of diverse geophysical measurements. The DataEngine assembles nine channels: residuals of multisource geodetic data (geoid height, vertical gravity gradient, and deflection of the vertical), topography, seafloor topographic slope, and explicit geographic coordinates. Residuals from multi-route shipborne gravity surveys are used as training labels. To make these data suitable for deep learning, the spatial domain is partitioned into blocks for training–test separation, and each channel is standardized by Z-score normalization. Finally, input subgraph blocks are generated and upsampled when required to preserve local spatial context.
The framework centers on a Swin-UNet multi-scale fusion network augmented with an adaptive multi-domain attention mechanism (Swin-UNet with Adaptive Multi-Domain Attention for Multi-scale Fusion). The encoder employs a Swin Transformer backbone (Stage 0 to Stage 3) to extract multi-scale semantic features. It uses multi-head self-attention in windowed and shifted-window configurations and progressively reduces spatial resolution through patch-merging layers. We term the module the adaptive multi-domain attention fusion decoder. Using transposed-convolution upsampling and skip connections, it fuses deep semantic features with shallow terrain texture features across multiple scales to restore spatial detail. The module implements a hierarchical attention strategy. At the bottleneck, frequency-domain attention performs global frequency enhancement of features. During subsequent upsampling and fusion, attention combinations are applied adaptively by feature hierarchy: in the deep fusion stage (), channel attention followed by self-attention is applied sequentially to strengthen global context modeling, while in the shallow fusion stages ( and ), channel attention followed by spatial attention is applied sequentially to enhance local detail reconstruction. This hierarchical, adaptive attention mechanism improves the network’s ability to capture both local details and global dependencies in gravity field signals. A final regression head projects the fused features onto the residual gravity map.
To enforce geodetic consistency, the spectral physics-informed constraint module embeds domain knowledge directly into the forward pass. It applies a 2D Fast Fourier Transform (FFT) to the predicted anomaly and uses a spectral derivative operator—multiplication by the radial wavenumber —to compute the vertical gravity gradient () in the spectral domain. The spectral is then transformed back to the spatial domain using an inverse FFT.
The training process is governed by the Hybrid Loss Function and Optimization module and uses a dual-objective strategy optimized with AdamW. It combines a data-driven mean squared error (MSE) loss that rigorously compares the predicted center pixel with sparse ship-borne ground truth, and a physics-based MSE loss that aligns the spectrally derived value with the observed gravity anomaly input. This design forces the model to fit sparse observations while preserving a physically consistent structure across the entire field.