Towards Differentiable Resampling

Michael Zhu, Kevin Murphy, Rico JonschkowskiarXiv 2020

Introduction

Particle filters are fundamental to robotics and state estimation, providing a robust framework for tracking system states—such as a robot's position—by maintaining a set of weighted "particles." However, these filters frequently encounter the "degeneracy problem," where a small subset of particles accumulates nearly all the weight, rendering the rest of the distribution ineffective. To mitigate this, practitioners employ resampling, a process that discards low-weight particles and duplicates high-weight ones.

Despite its necessity, traditional resampling is a discrete, stochastic process that is inherently non-differentiable. This lack of differentiability prevents the use of backpropagation for end-to-end optimization of the entire state estimation pipeline. Previous attempts to circumvent this, such as gradient truncation or "soft" resampling, often introduce bias or yield suboptimal performance. This paper introduces the Particle Transformer, a neural network architecture designed to make resampling both differentiable and learnable.

The Particle Transformer Architecture

The authors propose a specialized architecture based on the Set Transformer, tailored to the unique requirements of particle filtering. The model is designed to be permutation invariant (the order of input particles does not matter) and scale equivariant (the output scales with the input data range).

The Particle Transformer architecture features weighted multi-head attention and a pointwise feed-forward structure to process particle sets.

A core innovation is the Weighted Multi-head Attention mechanism. Unlike standard attention, which treats all inputs equally, this generalized version incorporates particle weights directly. This allows the model to dynamically "focus" its representational capacity on high-probability regions of the state space. The architecture consists of an encoder that processes input points and weights, and a decoder that uses seed vectors to generate a new set of output particles.

Methods and Training

To train the Particle Transformer, the authors treat the output particles as a continuous probability distribution using Kernel Density Estimation (KDE). The loss function is defined as the KL-divergence between the predicted particle distribution and a target distribution. This differentiable objective allows the resampler to be plugged into a Differentiable Particle Filter (DPF) framework.

Once integrated, the entire stack—including the motion model, measurement model, and the Particle Transformer resampler—can be fine-tuned together using gradient descent. This enables the system to learn resampling strategies that are specifically optimized for the task at hand, such as robot localization in complex environments.

Key Results and Insights

The Particle Transformer was evaluated against traditional resampling methods (multinomial, systematic, and soft resampling) using both synthetic 5D Gaussian mixture models and simulated robot localization tasks in a maze environment.

Quantitative comparison showing the Particle Transformer achieving significantly lower test loss across various kernel bandwidths compared to traditional methods.

Performance Gains

In synthetic benchmarks, the Particle Transformer consistently outperformed all baselines. In the simulated maze localization task, the results were even more pronounced:

  • Error Rate: The localization error dropped to 1.2%, a significant improvement over the 4.9% achieved by the best traditional method (systematic resampling).
  • Precision: After end-to-end training, the Mean Squared Error (MSE) was reduced by an order of magnitude, from 3.9 to 0.38.

Beyond Simple Duplication

One of the most significant insights is that the Particle Transformer does more than just copy high-weight particles. It effectively interpolates within the state space, placing new particles in regions that were previously empty but are likely to contain the true state. This maintains higher particle diversity and prevents the filter from "collapsing" onto a single, potentially incorrect hypothesis, making the system more robust to modeling errors and ambiguous observations.

Limitations and Future Work

While the Particle Transformer is theoretically differentiable, training with Backpropagation Through Time (BPTT) over many steps remains challenging due to exploding gradients. The authors noted that while the architecture supports long-horizon gradient flow, they achieved the best resampler performance using a truncation window of $k=1$. Future research will focus on stabilizing these gradients to fully leverage the benefits of differentiability over longer sequences and testing the model on high-dimensional, real-world robotic hardware.

Summary updated

BibTeX
@misc{zhu2020towards,
  author = {Michael Zhu and Kevin Murphy and Rico Jonschkowski},
  title = {{Towards Differentiable Resampling}},
  year = {2020},
  eprint = {2004.11938},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2004.11938},
}
Figure