  The traditional Kalman filter (KF) is widely applied in control systems, but
it relies heavily on the accuracy of the system model and noise parameters,
leading to potential performance degradation when facing inaccuracies. To
address this issue, introducing neural networks into the KF framework offers a
data-driven solution to compensate for these inaccuracies, improving the
filter's performance while maintaining interpretability. Nevertheless, existing
studies mostly employ recurrent neural network (RNN), which fails to fully
capture the dependencies among state sequences and lead to an unstable training
process. In this paper, we propose a novel Kalman filtering algorithm named the
attention Kalman filter (AtKF), which incorporates a self-attention network to
capture the dependencies among state sequences. To address the instability in
the recursive training process, a parallel pre-training strategy is devised.
Specifically, this strategy involves piecewise linearizing the system via
lattice trajectory piecewise linear (LTPWL) expression, and generating
pre-training data through a batch estimation algorithm, which exploits the
self-attention mechanism's parallel processing ability. Experimental results on
a two-dimensional nonlinear system demonstrate that AtKF outperforms other
filters under noise disturbances and model mismatches.
