Abstract
Amortized simulation-based neural posterior estimation provides a novel machine learning based approach for solving parameter estimation problems. It has been shown to be computationally efficient and able to handle complex models and data sets. Yet, the available approach cannot handle the in experimental studies ubiquitous case of missing data, and might provide incorrect posterior estimates. In this work, we discuss various ways of encoding missing data and integrate them into the training and inference process. We implement the approaches in the BayesFlow methodology, an amortized estimation framework based on invertible neural networks, and evaluate their performance on multiple test problems. We find that an approach in which the data vector is augmented with binary indicators of presence or absence of values performs the most robustly. Indeed, it improved the performance also for the simpler problem of data sets with variable length. Accordingly, we demonstrate that amortized simulation-based inference approaches are applicable even with missing data, and we provide a guideline for their handling, which is relevant for a broad spectrum of applications.
Introduction
In fields ranging from epidemiology to neuroscience, Bayesian inference serves as the gold standard for parameter estimation in mechanistic models. However, traditional methods like Markov Chain Monte Carlo (MCMC) often face prohibitive computational costs. Amortized Simulation-Based Inference (SBI) has emerged as a transformative alternative. By leveraging neural networks to learn the mapping between simulated data and model parameters, SBI allows for near-instantaneous inference once the model is trained.
Despite its promise, a significant hurdle remains: real-world experimental data is rarely complete. Sensors malfunction, participants miss sessions, and data points are lost at random. Standard neural architectures typically require fixed-size, complete inputs. While some methods handle variable-length sequences (missing data at the end), they struggle with intermediate "gaps." Simply omitting these gaps loses temporal context, while naive imputation (e.g., zero-filling) can introduce significant bias. This research addresses this gap by integrating robust missing-data encoding strategies into the BayesFlow framework.
Methodology: Encoding Missingness
The researchers explored three primary strategies for encoding missing data within the BayesFlow architecture, which utilizes Conditional Invertible Neural Networks (cINNs):
- Constant Insertion (E1): Missing values are replaced with a pre-defined dummy constant (e.g., -1.0).
- Binary Augmentation (E2): This strategy involves replacing missing values with a constant and augmenting the input with a secondary "mask" channel of binary indicators (1 for present, 0 for missing).
- Time Labels (E3): Only available data points are passed to the network, but they are accompanied by their specific time-point indices as positional encodings.
The critical innovation lies in the training process. Since SBI relies on a simulator, the authors can explicitly model missingness patterns during training. The network "learns" to reconstruct the posterior distribution $\pi(\theta|x_{avail})$ by practicing on simulated data with artificial gaps.
Evaluation and Results
The strategies were benchmarked against five synthetic models: a simple conversion reaction ($A \to B$), a sinusoidal model, the non-linear FitzHugh-Nagumo (FHN) neuron model, and both deterministic and stochastic SIR epidemiological models.
The Superiority of Binary Masking
Strategy E2 (Augmentation) emerged as the most robust. Even when the dummy value used for imputation was "ambiguous"—meaning it could naturally occur in the real data—the binary mask allowed the network to distinguish between actual signal and missingness markers. In contrast, Strategy E1 failed significantly in these ambiguous scenarios.
Performance in Inference
During the inference phase, the trained BayesFlow network receives incomplete experimental data, encodes it using the chosen strategy, and directly samples from the approximated posterior.
Interestingly, the E2 strategy even outperformed standard BayesFlow implementations for handling variable-length data. By sampling missingness on a per-sample basis during training, the authors reduced loss function variance, leading to faster and more stable convergence. Conversely, Strategy E3 (Time labels) struggled with oscillatory models, likely because LSTMs have difficulty mapping irregular time indices to the phase of a cycle compared to the fixed-grid approach of E2.
Discussion and Conclusion
This work demonstrates that amortized SBI is fully compatible with the "messy" data common in experimental science. The binary augmentation strategy (E2) provides a simple yet powerful way to handle missingness, even in "Missing Not At Random" (MNAR) scenarios where the probability of data loss depends on the parameters themselves.
While highly effective, the E2 strategy does double the input data size, which may pose scaling challenges for extremely high-dimensional datasets. Future research could explore the integration of Transformer architectures to potentially improve the performance of time-labeling strategies. Nevertheless, these findings provide a clear guideline for researchers to apply amortized inference to real-world datasets with missing entries, ensuring both speed and accuracy in parameter estimation.
Summary updated