Factor Graphs and Smoothing

The Bundle Adjustment and Pose Graph Optimization problems introduced in the preceding sections can be interpreted as particular MAP (Maximum A Posteriori) estimation problems.

In Bundle Adjustment, the unknown variables typically include camera poses and observed 3D points; in Pose Graph Optimization, only the poses and the relative constraints between them are optimized. Both problems can be represented in a unified way using the factor graph formalism.

In many computer vision and robotics problems, it is useful to keep all unknown variables and all available observations in the problem simultaneously, rather than recursively estimating only the current state. This formulation is called smoothing and underlies many modern localization, mapping, and sensor fusion algorithms.

Factor graphs represent the estimation problem, whereas smoothing is an inference strategy in which all graph variables are optimized simultaneously rather than progressively marginalized, as in recursive filters.

From a probabilistic perspective, the goal is to determine the most probable configuration of the variables


\begin{displaymath}
\mathbf{x}
=
\{\mathbf{x}_1,\mathbf{x}_2,\ldots,\mathbf{x}_n\}
\end{displaymath}

given a collection of observations $\mathbf{z}$:


\begin{displaymath}
\hat{\mathbf{x}}
=
\arg\max_{\mathbf{x}}
p(\mathbf{x}\mid\mathbf{z}).
\end{displaymath}

The variables can represent poses, landmarks, calibration parameters, or, more generally, any unknown quantity in the problem.

In sequential problems, the posterior distribution can be factored as


\begin{displaymath}
p(\mathbf{x}_{0:k}\mid\mathbf{z}_{1:k})
\propto
p(\mathbf{x}...
...hbf{x}_{i-1})
\prod_{i=1}^{k}
p(\mathbf{z}_i\mid\mathbf{x}_i).
\end{displaymath}

This factorization can be represented by a factor graph, a bipartite graph consisting of variable nodes and factor nodes. Variable nodes represent the quantities to be estimated, while factor nodes represent the probabilistic constraints associated with observations and prior information.

Figure 10.4: Example of a factor graph for an estimation problem. Circular nodes represent the problem variables, while square nodes represent the factors associated with observations and constraints.
Image fig_factor_graph

minimization of a sum of weighted residuals:

Assuming independent Gaussian errors, maximum likelihood estimation (MLE), and more generally MAP estimation in the presence of prior factors, reduces to minimizing a sum of weighted residuals:

\begin{displaymath}
\hat{\mathbf{x}}
=
\arg\min_{\mathbf{x}}
\sum_i
\mathbf{e}_i...
...thbf{x})^\top
\mathbf{\Sigma}_i^{-1}
\mathbf{e}_i(\mathbf{x}),
\end{displaymath}

where $\mathbf{e}_i(\mathbf{x})$ is the residual associated with factor $i$ and $\mathbf{\Sigma}_i$ is its covariance.

Factor graphs therefore provide a unified formalism for Bundle Adjustment, Pose Graph Optimization, Visual-Inertial Odometry, SLAM, and, more generally, sensor fusion problems.

Unlike recursive filters, which continually marginalize past states, smoothing techniques explicitly retain a set of variables and allow new observations to correct estimates that have already been made.

For Gaussian errors, inference on factor graphs ultimately reduces to solving a nonlinear least-squares optimization problem.

Paolo medici
2026-10-19