Diff-Kalman: Difference-Driven Learning for Structure-Preserving Kalman Filtering
Abstract
State estimation is a critical challenge in modeling dynamic systems. Classical Kalman filters can struggle with nonlinear dynamics, model mismatch, and inaccurate noise statistics. Although learning-aided methods improve adaptability, many focus on the update step or learn high-dimensional filtering quantities, complicating optimization and leaving prediction modeling underexplored. To address this, we propose Diff-Kalman, which leverages state differences to predict state increments and scaling matrices for correcting both the prediction and update phases of the Kalman filter. Diff-Kalman combines traditional dynamic models with neural networks to adaptively correct system behavior. In the prediction phase, Diff-Kalman utilizes a Transformer-based architecture with self-attention to extract localized patterns from historical states, followed by cross-attention to predict future state increments. These increments are then fused with increments predicted by the dynamic model, while a GRU-based Scaling Predictor (GSP) dynamically adjusts the prior covariance. In the update phase, another GSP dynamically adjusts the Kalman gain, improving estimation accuracy and robustness. Experimental results on linear MOT trajectories and nonlinear Lorenz dynamics show that Diff-Kalman improves estimation accuracy compared with representative baselines. The code is publicly available at https://github.com/heu-gj/Diff-Kalman.