Where Can Machine Learning Help Robotic State Estimation
Tim Barfoot 关于机器学习在机器人状态估计中应用的报告演讲。演讲时间2021年11月。视频链接: bilibili youtube
关键词:高斯过程回归、变分推理、期望最大化、深度神经网络、核方法、Koopman 嵌入、随机傅里叶特征
Barfoot’s lab
research insterests: localization, mapping, planning, control (on UGV)
state estimation is a core capability needed to enable downstream tasks such as planning and control.
Continuous-Time Trajectories
motion model:
x
˙
(
t
)
=
A
(
t
)
x
(
t
)
+
v
(
t
)
+
L
(
t
)
w
(
t
)
observation model:
y
k
=
C
k
x
(
t
k
)
+
n
k
\newcommand{\b}{\mathbf} \begin{aligned} \text{motion model:~~}&\dot{\b x}(t) = \b A(t)\b x(t) + \b v(t) + \b L(t)\b w(t) \\ \text{observation model:~~}&\b y_k = \b C_k \b x(t_k) + \b n_k \end{aligned}
motion model: observation model: x˙(t)=A(t)x(t)+v(t)+L(t)w(t)yk=Ckx(tk)+nk
w
(
t
)
∼
G
P
(
0
,
Q
δ
(
t
−
t
′
)
)
\mathbf w(t)\sim\mathcal{GP}\left(\mathbf 0, \mathbf Q \delta(t-t')\right)
w(t)∼GP(0,Qδ(t−t′)),
n
k
∼
N
(
0
,
R
)
\mathbf n_k\sim\mathcal N(\mathbf 0, \mathbf R)
nk∼N(0,R),
x
(
t
)
∼
G
P
(
x
~
(
t
)
,
P
~
(
t
,
t
′
)
)
\mathbf x(t) \sim \mathcal{GP}\left(\mathbf{\tilde x}(t), \mathbf{\tilde P}(t,t')\right)
x(t)∼GP(x~(t),P~(t,t′))
Stochastically integrate the motion model (in closed-form) to create a prior (kernel function)
x
(
t
)
∼
G
P
(
Φ
(
t
,
t
0
)
x
~
0
+
∫
t
0
t
Φ
(
t
,
s
)
v
(
s
)
d
s
,
Φ
(
t
,
t
0
)
P
~
0
Φ
(
t
′
,
t
0
)
⊤
+
∫
t
0
min
(
t
,
t
′
)
Φ
(
t
,
s
)
L
(
s
)
Q
L
(
s
)
⊤
Φ
(
t
′
,
s
)
⊤
d
s
)
\newcommand{\b}{\mathbf} \begin{aligned} \b x(t) \sim \mathcal{GP} \Big(&\Phi(t,t_0)\b{\tilde x_0} + \int_{t_0}^t \Phi(t,s)\b v(s) ds, \\ &\Phi(t,t_0)\b{\tilde P_0}\Phi(t',t_0)^\top + \int_{t_0}^{\min(t,t')}\Phi(t,s)\b L(s) \b Q \b L(s)^\top \Phi(t',s)^\top ds \Big) \end{aligned}
x(t)∼GP(Φ(t,t0)x~0+∫t0tΦ(t,s)v(s)ds,Φ(t,t0)P~0Φ(t′,t0)⊤+∫t0min(t,t′)Φ(t,s)L(s)QL(s)⊤Φ(t′,s)⊤ds)
Lie groups to handle 3D rotations
[@longBananaDistributionGaussian]
Gaussian variational inference
Use Greek letters to define non-linear model:
motion model:
ξ
k
=
f
(
ξ
k
−
1
,
ν
k
)
+
ω
k
observation model:
γ
k
=
g
(
ξ
k
)
+
η
k
\newcommand{\b}{\boldsymbol} \begin{aligned} \text{motion model:~~}& \b\xi_k = \mathrm{f}(\b\xi_{k-1}, \b\nu_k) + \b\omega_k \\ \text{observation model:~~}& \b\gamma_k = \mathrm{g}(\b\xi_k) + \b\eta_k \end{aligned}
motion model: observation model: ξk=f(ξk−1,νk)+ωkγk=g(ξk)+ηk
ξ
\xi
ξ - unknown state,
ν
\nu
ν - input,
ω
\omega
ω - process niose
γ
\gamma
γ - sensor measurement,
η
\eta
η - measurement noise
We can simply apply linearization:
motion model:
x
k
=
A
k
−
1
x
k
−
1
+
v
k
+
w
k
observation model:
y
k
=
C
k
x
k
+
n
k
\newcommand{\b}{\mathbf} \begin{aligned} \text{motion model:~~}& \b x_k = \b A_{k-1} \b x_{k-1} + \b v_k +\b w_k \\ \text{observation model:~~}&\b y_k = \b C_k \b x_k + \b n_k \end{aligned}
motion model: observation model: xk=Ak−1xk−1+vk+wkyk=Ckxk+nk
But it turns out there is another starting point we could think about which is called variation inference. The idea is that we actually want to think about this as an optimization problem, we’d like to set up some data likelihood objective, in this case the log likelihood of all of our measurements, and that could be given some parameters that are associated with our models.
KaTeX parse error: No such environment: split at position 37: …dsymbol} \begin{̲s̲p̲l̲i̲t̲}̲ -\log p(\b\gam…
where
θ
\theta
θ - extra unknown parameters,
q
(
ξ
)
q(\xi)
q(ξ) - approximate Gaussian posterior,
log
(
p
(
ξ
∣
γ
,
ν
,
θ
)
q
(
ξ
)
)
\log\left(\frac{p(\xi | \gamma,\nu,\theta)}{q(\xi)} \right)
log(q(ξ)p(ξ∣γ,ν,θ)) - true Bayesian posterior.
On rhs, the first term is Kullback-Leibler divergence, which basically talks about the difference between the full Bayesian posterior and our estimate. The second term is the upper bound term.
expectation minimization:
- e-step: hold θ \theta θ fixed, minimize V ( q ∣ θ ) V(q|\theta) V(q∣θ) for q ( ξ ) q(\xi) q(ξ)
- m-step: hold q ( ξ ) q(\xi) q(ξ) fixed, minimize V ( q ∣ θ ) V(q|\theta) V(q∣θ) for θ \theta θ
We improve our state estimation in the e-step and improve our models in the m-step.
KL散度 KL ( P ∣ ∣ Q ) = ∫ − ∞ ∞ p ( x ) log p ( x ) q ( x ) d x \text{KL}(P||Q) = \int_{-\infin}^\infin p(x)\log \frac{p(x)}{q(x)}dx KL(P∣∣Q)=∫−∞∞p(x)logq(x)p(x)dx . KL散度描述了用一个分布 Q Q Q替代另一个分布 P P P时所损失的信息量(熵), P P P和 Q Q Q越相近散度越小。它度量两个概率分布相似度,具有非负性、仿射变换不变性、非对易性等。链接
upper bound:
V
(
q
∣
θ
)
=
−
∫
q
(
ξ
)
log
(
p
(
ξ
,
γ
∣
ν
,
θ
)
q
(
ξ
)
)
d
ξ
=
E
q
[
−
log
p
(
ξ
,
γ
∣
ν
,
θ
)
]
+
1
2
log
∣
Σ
−
1
∣
\newcommand{\b}{\boldsymbol} V(q|\theta) = -\int q(\b\xi)\log\left(\frac{p(\b\xi, \b\gamma|\b\nu,\b\theta)}{q(\b\xi)} \right) d\b\xi \\ = \mathbb E_q [-\log p(\b\xi, \b\gamma|\b\nu,\b\theta)] + \frac{1}{2} \log |\b \Sigma^{-1}|
V(q∣θ)=−∫q(ξ)log(q(ξ)p(ξ,γ∣ν,θ))dξ=Eq[−logp(ξ,γ∣ν,θ)]+21log∣Σ−1∣
e-step (state estimation):
- find the best mean and (inverse) covariance q ( ξ ) = N ( μ , Σ ) q(\boldsymbol\xi) = \mathcal N(\boldsymbol\mu, \boldsymbol\Sigma) q(ξ)=N(μ,Σ)
- exactly sparse Gaussian variational inference [@barfootExactlySparseGaussian2020]
m-step (unsupervised parameter learning)
- without any groundtruth fot the trajectory, we can learn almost any parameter of the system:
x k = A x k − 1 + v k + w k y k = C x k + n k w k ∼ N ( 0 , Q ) n k ∼ N ( 0 , R ) \newcommand{\b}{\mathbf} \begin{aligned} \b x_k &= {\color{red}\b A} \b x_{k-1} + \b v_k +\b w_k \\ \b y_k &= {\color{red}\b C} \b x_k + \b n_k \\ \b w_k &\sim \mathcal N(0,{\color{red}\b Q}) \\ \b n_k &\sim \mathcal N(0,{\color{red}\b R}) \end{aligned} xkykwknk=Axk−1+vk+wk=Cxk+nk∼N(0,Q)∼N(0,R)
[@yoonUnsupervisedLearningLidar2021]
Kernel Embedding
Every low-demensional nonlinear system can always be lifted up and written as some linear differential equation in higher demensional space (maybe infinte dimensional).
ξ
˙
=
f
(
ξ
)
⇒
x
˙
=
A
x
\newcommand{\b}{\mathbf} \dot\xi = f(\xi) \Rightarrow \dot{ \b x} = \b A \b x
ξ˙=f(ξ)⇒x˙=Ax
In state estimation:
ξ
k
=
f
(
ξ
k
−
1
,
ν
k
)
+
ω
k
γ
k
=
g
(
ξ
k
)
+
η
k
\newcommand{\b}{\boldsymbol} \begin{aligned} \b\xi_k & = \mathrm{f}(\b\xi_{k-1}, \b\nu_k) + \b\omega_k \\ \b\gamma_k & = \mathrm{g}(\b\xi_k) + \b\eta_k \end{aligned}
ξkγk=f(ξk−1,νk)+ωk=g(ξk)+ηk
apply restrict class to control-affine systems:
ξ
k
=
f
0
(
ξ
k
−
1
)
+
∑
i
f
i
(
ξ
k
−
1
)
ν
k
,
i
+
ω
k
γ
k
=
g
(
ξ
k
)
+
η
k
\newcommand{\b}{\boldsymbol} \begin{aligned} \b\xi_k & = \mathrm{f}_0(\b\xi_{k-1}) + \sum_i \mathrm{f}_i(\b\xi_{k-1})\b\nu_{k,i} + \b\omega_k \\ \b\gamma_k & = \mathrm{g}(\b\xi_k) + \b\eta_k \end{aligned}
ξkγk=f0(ξk−1)+i∑fi(ξk−1)νk,i+ωk=g(ξk)+ηk
embed as a high-dimensional, time-invariant bilinear system [@bruderAdvantagesBilinearKoopman2021]
x
k
=
A
x
k
−
1
+
B
u
k
+
H
(
u
k
⊗
x
k
−
1
)
+
ω
k
y
k
=
C
x
k
+
n
k
\newcommand{\b}{\mathbf} \begin{aligned} & \b x_k = \b A \b x_{k-1} + \b B \b u_k + \b H (\b u_k \otimes \b x_{k-1}) + \b\omega_k \\ &\b y_k = \b C \b x_k + \b n_k \end{aligned}
xk=Axk−1+Buk+H(uk⊗xk−1)+ωkyk=Cxk+nk
rearrange as a high-dimensional, time-varying, linear system. [@guoKoopmanLinearizationDataDriven2022]
Let
A
k
−
1
=
A
+
H
(
u
k
⊗
1
)
,
v
k
=
B
u
k
⇒
x
k
=
A
k
−
1
x
k
−
1
+
v
k
+
w
k
y
k
=
C
k
x
k
+
n
k
\newcommand{\b}{\mathbf} \begin{aligned} \text{Let~~}\b A_{k-1} & = \b A + \b H(\b u_k \otimes \b 1), \b v_k = \b B \b u_k \\ \Rightarrow \b x_k & = \b A_{k-1} \b x_{k-1} + \b v_k +\b w_k \\ \b y_k & = \b C_k \b x_k + \b n_k \end{aligned}
Let Ak−1⇒xkyk=A+H(uk⊗1),vk=Buk=Ak−1xk−1+vk+wk=Ckxk+nk
Solve the batch linear-Gaussian state estimation equations
(
A
−
⊤
Q
−
1
A
−
1
+
C
⊤
R
−
1
C
)
⏟
P
^
−
1
x
^
=
A
−
⊤
Q
−
1
v
+
C
⊤
R
−
1
y
\newcommand{\b}{\mathbf} \underbrace{(\b A^{-\top} \b Q^{-1} \b A^{-1} + \b C^\top \b R^{-1} \b C)}_{\b{\hat P}^{-1}} \b{\hat x} = \b A^{-\top} \b Q^{-1} \b v + \b C^\top \b R^{-1} \b y
P^−1
(A−⊤Q−1A−1+C⊤R−1C)x^=A−⊤Q−1v+C⊤R−1y
collapse the high-dimensial estimate to the original space using the Representer Theorem
Others
- Match UAV images to Satelite images.
- Learning features for long-term visual localization, match images across severe lighting change.
- Semantically segmenting classes.
参考文献
[1] LONG A W. WOLFE K C. MASHNER M J. 等. The
Banana Distribution is Gaussian: A Localization Study with Exponential
Coordinates[J]. 8.
[2] BARFOOT T D. FORBES J R. YOON D. Exactly Sparse
Gaussian Variational Inference with Application to Derivative-Free Batch
Nonlinear State Estimation[M/OL]. arXiv, 2020[2022-07-05].
http://arxiv.org/abs/1911.08333.
[3] YOON D J. ZHANG H. GRIDSETH M. 等. Unsupervised
Learning of Lidar Features for Use in a Probabilistic Trajectory
Estimator[M/OL]. arXiv, 2021[2022-07-05].
http://arxiv.org/abs/2102.11261.
[4] BRUDER D. FU X. VASUDEVAN R. Advantages of
Bilinear Koopman Realizations for the Modeling and Control of Systems
With Unknown Dynamics[J/OL]. IEEE Robotics and Automation Letters,
2021, 6(3): 4369-4376.
DOI:10.1109/LRA.2021.3068117.
[5] GUO Z C. KOROTKINE V. FORBES J R. 等. Koopman
Linearization for Data-Driven Batch State Estimation of Control-Affine
Systems[J/OL]. IEEE Robotics and Automation Letters, 2022, 7(2):
866-873.
DOI:10.1109/LRA.2021.3133587.