Neural field


In machine learning, a neural field, is a mathematical field that is fully or partially parametrized by a neural network. Initially developed to tackle visual computing tasks, such as rendering or reconstruction, neural fields emerged as a promising strategy to deal with a wider range of problems, including surrogate modelling of partial differential equations, such as in physics-informed neural networks.
Differently from traditional machine learning algorithms, such as feed-forward neural networks, convolutional neural networks, or transformers, neural fields do not work with discrete data, but map continuous inputs to continuous outputs. This makes neural fields not only discretization independent, but also easily differentiable. Moreover, dealing with continuous data allows for a significant reduction in space complexity, which translates to a much more lightweight network.

Formulation and training

According to the universal approximation theorem, provided adequate learning, sufficient number of hidden units, and the presence of a deterministic relationship between the input and the output, a neural network can approximate any function to any degree of accuracy.
Hence, in mathematical terms, given a field, with and, a neural field, with parameters, is such that:

Training

For supervised tasks, given examples in the Training, validation, and [test data sets|training dataset], the neural field parameters can be learned by minimizing a loss function . The parameters that satisfy the optimization problem are found as:Notably, it is not necessary to know the analytical expression of, for the previously reported training procedure only requires input-output pairs. Indeed, a neural field is able to offer a continuous and differentiable surrogate of the true field, even from purely experimental data.
Moreover, neural fields can be used in unsupervised settings, with training objectives that depend on the specific task. For example, physics-informed neural networks may be trained on just the residual.

Spectral bias

As for any artificial neural network, neural fields may be characterized by a spectral bias, possibly leading to a poor representation of the ground truth. In order to overcome this limitation, several strategies have been developed. For example, SIREN uses sinusoidal activations, while the Fourier-features approach embeds the input through sines and cosines.

Conditional neural fields

In many real-world cases, however, learning a single field is not enough. For example, when reconstructing 3D vehicle shapes from Lidar data, it is desirable to have a machine learning model that can work with arbitrary shapes. The solution is to include additional parameters, the latent variables , to vary the field and adapt it to diverse tasks.

Latent code production

When dealing with conditional neural fields, the first design choice is represented by the way in which the latent code is produced. Specifically, two main strategies can be identified:
  • Encoder: the latent code is the output of a second neural network, acting as an encoder. During training, the loss function is the objective used to learn the parameters of both the neural field and the encoder.
  • Auto-decoding: each training example has its own latent code, jointly trained with the neural field parameters. When the model has to process new examples, a small optimization problem is solved, keeping the network parameters fixed and only learning the new latent variables.
Since the latter strategy requires additional optimization steps at inference time, it sacrifices speed, but keeps the overall model smaller. Moreover, despite being simpler to implement, an encoder may harm the generalization capabilities of the model. For example, when dealing with a physical scalar field , an auto-decoder-based conditional neural field can map a single point to the corresponding value of the field, following a learned latent code. However, if the latent variables were produced by an encoder, it would require access to the entire set of points and corresponding values, leading to a less robust model.

Global and local conditioning

In a neural field with global conditioning, the latent code does not depend on the input and, hence, it offers a global representation. However, depending on the task, it may be more useful to divide the domain of in several subdomains, and learn different latent codes for each of them. This is called local conditioning.

Conditioning strategies

There are several strategies to include the conditioning information in the neural field. In the general mathematical framework, conditioning the neural field with the latent variables is equivalent to mapping them to a subset of the neural field parameters:In practice, notable strategies are:
  • Concatenation: the neural field receives, as input, the concatenation of the original input with the latent codes. For feed-forward neural networks, this is equivalent to setting as the bias of the first layer and as an affine transformation.
  • Hypernetworks: a hypernetwork is a neural network that outputs the parameters of another neural network. Specifically, it consists of approximating with a neural network, where are the trainable parameters of the hypernetwork. This approach is the most general, as it allows to learn the optimal mapping from latent codes to neural field parameters. However, hypernetworks are associated to larger computational and memory complexity, due to the large number of trainable parameters. Hence, leaner approaches have been developed. For example, in the Feature-wise Linear Modulation, the hypernetwork only produces scale and bias coefficients for the neural field layers.

    Meta-learning

Instead of relying on the latent code to adapt the neural field to a specific task, it is also possible to exploit gradient-based meta-learning. In this case, the neural field is seen as the specialization of an underlying meta-neural-field, whose parameters are modified to fit the specific task, through a few steps of gradient descent. An extension of this meta-learning framework is the CAVIA algorithm, that splits the trainable parameters in context-specific and shared groups, improving parallelization and interpretability, while reducing meta-overfitting. This strategy is similar to the auto-decoding conditional neural field, but the training procedure is substantially different.

Applications

Thanks to the possibility of efficiently modelling diverse mathematical fields with neural networks, neural fields have been applied to a wide range of problems: