Inferensys

Difference

Factor Graph Optimization vs Recursive Bayesian Estimation

A technical comparison of smoothing (factor graphs, iSAM2) and filtering (EKF, UKF, particle filters) for SLAM back-ends. Covers global consistency, computational cost, memory growth, and when to choose each for large-scale robotic state estimation.
Performance engineer optimizing AI latency on laptop, latency charts visible, technical optimization session.
THE ANALYSIS

Introduction

A CTO's guide to choosing between global optimization and recursive efficiency for robotic state estimation.

Factor Graph Optimization (FGO) excels at producing globally consistent maps and trajectories by solving the full nonlinear least-squares problem over a graph of robot poses and landmark observations. Implementations like iSAM2 exploit the sparsity of this graph to achieve real-time performance, making FGO the gold standard for large-scale SLAM where loop closures and batch accuracy are critical. For example, in a warehouse deployment, FGO can correct an entire fleet's trajectory history upon a single loop closure event, ensuring a drift-free map.

Recursive Bayesian Estimation, typified by the Extended Kalman Filter (EKF), takes a fundamentally different approach by marginalizing out past states to maintain a fixed computational and memory footprint. This incremental strategy results in a highly efficient, constant-time update cycle that is ideal for real-time, low-latency state estimation on embedded hardware. The trade-off is a vulnerability to linearization errors that can cause filter divergence, making it less robust to large-scale loop closures compared to iterative smoothing methods.

The key trade-off: If your priority is global map consistency and the ability to correct historical drift in post-processing or real-time for large environments, choose Factor Graph Optimization. If you prioritize a strict, deterministic compute budget per frame and minimal memory usage for high-rate sensor fusion on a resource-constrained humanoid, choose a Recursive Bayesian Estimator like an UKF.

HEAD-TO-HEAD COMPARISON

Head-to-Head Feature Comparison

Direct comparison of key metrics and features for large-scale SLAM state estimation.

MetricFactor Graph Optimization (iSAM2)Recursive Bayesian Estimation (EKF/UKF)

Global Consistency (ATE)

< 0.1% of trajectory length

Drift accumulates unboundedly

Computational Complexity

O(n) for updates, O(n log n) for batch

O(k^2.4) to O(k^3) where k = state size

Memory Footprint

Grows with trajectory (sparse linear algebra)

Fixed (bounded covariance matrix)

Loop Closure Handling

Outlier Robustness

M-estimators & Switchable Constraints

Susceptible to linearization errors

Real-Time Suitability

Incremental smoothing (iSAM2)

Excellent (predict/update cycle)

Uncertainty Representation

Full marginal covariances (information matrix)

Gaussian approximation (covariance matrix)

Factor Graph Optimization vs Recursive Bayesian Estimation

TL;DR Summary

A quick decision matrix for Sensor Integration Engineers choosing between global consistency and incremental efficiency for large-scale SLAM.

01

Choose Factor Graphs for Global Consistency

Best for large-scale, offline mapping and loop closure. Factor graphs (like iSAM2) exploit sparsity to optimize the entire robot trajectory and map simultaneously. This eliminates drift accumulation, making it ideal for surveying, 3D scanning, and generating high-fidelity digital twins where metric accuracy is paramount. Trade-off: Higher computational cost and memory usage compared to recursive filters.

02

Choose Recursive Filters for Real-Time Efficiency

Best for resource-constrained, online state estimation. Recursive Bayesian filters (EKF, UKF) process data sequentially with fixed memory, providing a current state estimate with minimal latency. This is critical for high-speed control loops in autonomous navigation, drone flight stabilization, and real-time object tracking where immediate action is required. Trade-off: Susceptible to linearization errors and catastrophic failure from incorrect data association.

03

Choose Factor Graphs for Multi-Sensor Fusion

Best for asynchronous, multi-modal sensor integration. Factor graphs naturally model measurements from cameras, LiDAR, IMUs, and GPS as independent constraints at their exact timestamps. This 'add-a-factor' flexibility simplifies the fusion of high-rate IMU data with low-rate visual loop closures without complex synchronization logic. Trade-off: Requires a sophisticated solver backend to manage the growing graph structure in real-time.

04

Choose Recursive Filters for Fixed-Cost Deployment

Best for safety-certified, embedded systems. The fixed computational complexity and bounded memory of an EKF make its runtime behavior highly predictable. This is essential for ISO 26262 or DO-178C certification in automotive and aerospace applications, where worst-case execution time (WCET) analysis is mandatory. Trade-off: Requires careful manual tuning of process and measurement noise covariances to prevent divergence.

HEAD-TO-HEAD COMPARISON

Computational Performance Benchmarks

Direct comparison of key metrics and features for large-scale SLAM state estimation.

MetricFactor Graph Optimization (iSAM2)Recursive Bayesian Estimation (EKF/UKF)

Global Consistency (ATE)

0.02m (loop-closure optimized)

0.15m (drift accumulation)

Memory Complexity

O(n) for sparse graphs

O(k^2) fixed covariance

Incremental Update Latency

5-50ms (variable relinearization)

< 1ms (constant time)

Robustness to Outliers

Handles Loop Closures

Fixed Computational Budget

Typical Use Case

Offline mapping, large-scale SLAM

Real-time flight control, short-duration tracking

Contender A Pros

Factor Graph Optimization: Pros and Cons

Key strengths and trade-offs at a glance.

01

Global Consistency via Full Batch Optimization

Superior accuracy through iterative relinearization: Factor graphs (e.g., iSAM2) solve the full SLAM problem over a sparse graph, allowing past states to be corrected when loop closures are detected. This matters for large-scale mapping where drift accumulation in recursive filters would permanently corrupt the map.

02

Sparsity Exploitation for Scalability

Efficient handling of high-dimensional problems: By exploiting the inherent sparsity of the underlying information matrix, factor graph solvers can perform incremental updates in near-constant time per variable. This matters for humanoid robots navigating complex environments, where maintaining a dense covariance matrix (as in recursive Bayesian estimation) would be computationally prohibitive.

03

Robustness to Poor Initialization

Graceful recovery from linearization errors: Unlike Extended Kalman Filters, which can diverge catastrophically if the initial state estimate is poor, factor graph optimization can re-linearize and converge to the global minimum. This matters for 'kidnapped robot' scenarios or when a robot is deployed without a precise initial pose.

CHOOSE YOUR PRIORITY

When to Choose Factor Graphs vs Recursive Filters

Factor Graphs for Global Accuracy

Strengths: Factor graphs (iSAM2) exploit sparsity to perform full batch optimization over all historical poses and landmarks. This yields globally consistent maps without linearization drift, making them the gold standard for offline mapping and large-scale SLAM where loop closures are critical.

Trade-off: Computational cost grows with the graph size, though incremental solvers mitigate this. Not ideal for hard real-time constraints on embedded processors.

Recursive Filters for Global Accuracy

Verdict: Recursive filters (EKF/UKF) marginalize out past states, fixing linearization points permanently. This causes irreversible consistency loss, making them unsuitable for large-scale mapping where global loop closures are required. Use only if the trajectory is short and drift is acceptable.

ARCHITECTURAL COMPARISON

Technical Deep Dive: Bayes Tree and Incremental Smoothing

A deep technical comparison of the probabilistic graphical models and inference engines powering modern SLAM. We dissect the sparsity-exploiting, nonlinear least-squares optimization of factor graphs against the recursive, fixed-memory efficiency of Bayesian filters for large-scale state estimation.

Yes, factor graph optimization (FGO) is generally more accurate for large-scale SLAM. FGO solves the full nonlinear least-squares problem over all historical poses and landmarks, iteratively relinearizing to avoid linearization error accumulation. Recursive filters (like EKF-SLAM) commit to a single linearization point and marginalize out past states, making them vulnerable to catastrophic divergence from linearization errors. However, modern incremental solvers like iSAM2 achieve this global accuracy with competitive speed by exploiting the Bayes tree's sparsity.

THE ANALYSIS

Verdict: Factor Graphs Are the Default, Filters Are the Exception

A data-driven comparison of global optimization versus incremental estimation for large-scale SLAM, helping CTOs choose the right state estimation backbone.

Factor graph optimization (FGO) excels at producing globally consistent maps and trajectories because it revisits and re-linearizes the entire history of robot poses and landmark observations. For example, in a large-scale warehouse deployment, iSAM2 can exploit the sparsity of the underlying factor graph to achieve near real-time performance while maintaining centimeter-level accuracy over a 500,000-pose trajectory, a feat that would cause a recursive filter to accumulate prohibitive drift.

Recursive Bayesian estimation (RBE), such as an Extended or Unscented Kalman Filter, takes a fundamentally different approach by marginalizing out past states to maintain a fixed computational budget. This results in a constant-time update per new measurement, making it highly predictable for safety-critical real-time control loops on embedded hardware. However, this marginalization permanently linearizes the past, making the system vulnerable to catastrophic failure from a single bad data association that cannot be corrected later.

The key trade-off: If your priority is global map quality, long-term autonomy, and the ability to perform loop closures to correct historical drift, choose factor graph optimization. If you prioritize a strict, deterministic execution cycle measured in microseconds for low-level flight control or a simple filtering task with no memory requirement, choose a recursive filter. In modern robotics, FGO is the default architecture for localization and mapping, while RBE is the specialized exception for high-rate, memoryless estimation.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.