Abstract
Reconstructing continuous physical fields from sparse and noisy sensor data is a critical challenge in domains like meteorology and fluid dynamics. Traditional statistical methods often fail to scale, while standard deep learning models frequently produce physically inconsistent results. We present FieldFormer, a transformer-based framework that integrates a learnable, velocity-scaled local attention mechanism with physics-informed loss functions. By leveraging local neighborhood encoding and pre-computed offset tables, FieldFormer achieves high computational efficiency and superior accuracy. Evaluations on synthetic and real-world datasets demonstrate that FieldFormer outperforms existing baselines by over 40%, maintaining physical consistency even in complex, multi-variable systems.
1. Introduction
In many scientific and engineering applications, understanding the state of a "field"—a quantity varying across space and time—is essential. However, observational data is typically limited to a sparse set of scattered sensors. The task of "field imputation"—filling the gaps between these sensors—is inherently difficult.
Existing approaches generally fall into two categories: classical statistics and standard deep learning. Classical methods like Kriging or Gaussian Processes (GPs) often struggle with large-scale datasets and typically ignore the underlying physical laws governing the field. Conversely, deep learning models like Graph Neural Networks (GNNs) or global Transformers, while flexible, often generate "physically impossible" reconstructions because they lack the inductive biases necessary to respect Partial Differential Equations (PDEs).
FieldFormer addresses these limitations by creating a model that is both data-driven and physics-constrained, specifically designed to handle irregular and sparse observations efficiently.
2. Methodology
FieldFormer introduces a novel architecture that bridges the gap between neural networks and physical principles. The core of the model is a Transformer Encoder modified for local, physics-aware processing.
2.1 Local Neighborhood Encoding and Velocity Scaling
Physical laws are inherently local; the state of a point is primarily influenced by its immediate surroundings. FieldFormer adopts this "locality" by focusing on a local neighborhood for every query point rather than the entire global dataset.
To account for the fact that physical processes are often anisotropic (e.g., wind carrying pollutants faster in one direction), FieldFormer employs a learnable anisotropic metric. It learns "velocity scales" ($\gamma_x, \gamma_y, \gamma_t$) that adaptively stretch or compress the neighborhood search space, allowing the model to discover the underlying flow or diffusion directions in the data.
2.2 Computational Efficiency
To maintain efficiency, FieldFormer utilizes neighborhood offset tables. Searching for neighbors (kNN) during every training step is computationally expensive. By pre-computing these offsets, the model can gather neighbors in $O(1)$ amortized time, allowing it to scale linearly with the number of query points.
2.3 Physics-Informed Learning
FieldFormer treats itself as a "coordinate neural field." It uses automatic differentiation to calculate spatial and temporal derivatives. These derivatives are used to formulate a physics-informed loss, penalizing predictions that violate known PDEs or boundary conditions. To ensure stable training, the framework incorporates gradient-norm balancing, which dynamically adjusts the weights between the data-fitting loss and the physics-based loss.
3. Experiments and Results
The performance of FieldFormer was evaluated across three benchmarks: a 2D Periodic Heat Equation, 2D Shallow Water Equations (SWE), and a real-world pollution simulation over New Delhi.
FieldFormer consistently outperformed strong baselines, including Sinusoidal Neural Networks (SIREN) and Sparse Variational Gaussian Processes (SVGP), by more than 40%. In the New Delhi pollution simulation, FieldFormer achieved an RMSE of 0.013, significantly lower than SIREN (0.022) and SVGP (1.34). Beyond numerical accuracy, FieldFormer demonstrated superior physical consistency. While standard neural networks often produce jittery fields, FieldFormer's reconstructions maintained low PDE residuals, indicating that the predicted fields closely follow the governing physical laws.
4. Discussion and Conclusion
The success of FieldFormer highlights the importance of inductive biases in scientific machine learning. By forcing the Transformer to look only at local neighbors, the architecture bakes the "locality" of PDEs directly into the model. Furthermore, allowing for oriented elliptical neighborhoods is crucial for capturing directional transport.
While FieldFormer excels in many scenarios, challenges remain in handling highly non-local or chaotic systems and sharp discontinuities where Autograd-based losses can become unstable. Future research will focus on integrating uncertainty-aware inference and the automated discovery of physical parameters directly from sparse observations.
Summary updated