Tree-Ensemble Corrections for Large-Step Engine State Estimators

Engine control units estimate quantities they cannot measure cheaply, such as boost pressure or exhaust gas flow, by running a simplified physics model alongside a Kalman filter. A Kalman filter is a predict-then-correct loop that blends model predictions with sensor readings. These models must finish every update before a hard deadline, so engineers simplify them aggressively. One effective trick is to treat the fastest dynamics as instantaneous algebraic constraints. This turns a "stiff" ordinary differential equation (ODE), meaning one whose rates differ by orders of magnitude so that only tiny time steps stay stable, into a differential-algebraic equation (DAE). The trick allows much larger time steps, but it adds two problems. The simplification leaves a systematic gap between model and engine, and solving the algebraic constraint at each step takes a variable number of iterations, which threatens the deadline.

We propose closing both gaps with gradient boosted decision trees (GBDTs). A GBDT is a sum of many shallow decision trees, each fit to the errors left by the trees before it. We train one small ensemble to predict the per-step state error of the large-step DAE model, so it can be added inside the filter's prediction step. We train a second ensemble to predict the solution of the algebraic constraint, which gives the iterative solver a good starting point so that a fixed, small iteration cap suffices. Trees suit this setting because their worst-case cost is a fixed number of comparisons and additions. They need no floating-point matrix multiplies and handle the 5–10 operating variables of an engine air path without the exponential memory of grid lookup tables. Their known weakness, flat predictions outside the training range, can be detected exactly by checking each input against the split thresholds the trees saw during training.

Core Claim

A depth-limited GBDT correction placed inside a large-step DAE Kalman filter can lower state-estimation error relative to an engine model richer than the filter's own. It can do so while keeping a provable, measured worst-case execution time below the step budget, and it beats both a small neural network and a calibration lookup map given the same timing and memory budget on embedded-class hardware. The proposal departs from prior work in three ways. It puts real decision trees, rather than neural networks run through the boosting procedure, inside a dynamic closed-loop estimator rather than an offline predictor. It treats execution-time determinism as a first-class measured outcome. And it pairs the tree surrogate with an exact out-of-range test that triggers a principled fallback.

Grounding in Prior Work

The starting point and main constraint come from Real-time performance of DAE and ODE based estimators evaluated on a diesel engine. That work makes intercooler pressure algebraic and runs an extended Kalman filter on production ECU hardware. It raises the stable step from 15 ms (ODE filter) to 125 ms (DAE filter), with accuracy similar to the ODE filter at a 10 ms step on the World Harmonized Transient Cycle (WHTC), a standard transient engine test cycle. The same work flags that the algebraic loop adds variable iteration time, which is exactly the problem our warm-start ensemble targets. Note what that result implies. The DAE filter already matches the small-step ODE filter, so our gain cannot come from beating the ODE model. It must come from modeling error that both share relative to the real engine, and from making the DAE step's timing deterministic.

Two lines of work supply the residual-learning idea but use neural learners. Ensemble learning for Physics Informed Neural Networks: a Gradient Boosting approach fits a sequence of frozen neural networks to the leftover error of a physics-informed network. On a stiff boundary-layer problem it cuts relative error from 12.56% to 0.43%. It is an offline PDE solver with roughly threefold training overhead and no tree learners. We borrow its stage-wise idea but run it with trees, online, inside a filter. Concorde and SynPerf feed analytical bounds into a small multi-layer perceptron (MLP) to predict CPU and GPU performance, reaching about 2% and 6.1% error. They show that "physics features plus a light learned correction" works, but both use MLPs and do offline batch prediction with no deadline.

Two papers constrain the design. Accelerate Coastal Ocean Circulation Model with AI Surrogate needs a fallback to the numerical solver whenever its transformer surrogate violates mass conservation. We adopt the fallback principle, but trigger it with an exact range test rather than a post-hoc residual. Optimization with Gradient-Boosted Trees and Risk Control. documents that tree ensembles go flat outside their training domain and adds a convex risk penalty to keep an optimizer inside it. That work is static and offline, with an 8,800-tree ensemble. We need the same protection inside a 125 ms loop with ensembles orders of magnitude smaller. On tabular data, LongPMInd chose LightGBM over neural networks for efficiency and generalization, but also reports that boosted trees smooth out extreme peaks. That is a direct risk for transient pressure spikes, and we measure it explicitly.

Research Program

The filter's prediction step becomes

$$x_{k+1} = F_h(x_k, z_k, u_k) + G(x_k, u_k), \qquad 0 = g(x_k, z_k, u_k).$$

The symbols are as follows. $x_k$ is the air-path state at step $k$, $u_k$ the actuator and speed inputs, and $z_k$ the algebraic variables such as intercooler pressure. $F_h$ is the simplified DAE model integrated with step $h$, $g$ is the algebraic constraint, and $G$ is the boosted-tree correction. $G$ is trained on one-step targets $x^{\mathrm{ref}}_{k+1} - F_h(x^{\mathrm{ref}}_k, z^{\mathrm{ref}}_k, u_k)$ taken from a reference trajectory. One-step training normally risks drift when rolled out, but here the filter's measurement update re-anchors the state every step. The estimation setting is therefore a comparatively safe home for a tree surrogate. A second ensemble $Z(x_k, u_k)$ predicts $z_k$ and seeds the Newton solve for $g$, which is then capped at a fixed number of iterations.

Three design questions are studied. The first is smoothness. The extended Kalman filter linearizes the prediction step, but constant-leaf trees have zero derivative almost everywhere and jump at split boundaries. We compare three options: constant leaves with the correction's Jacobian ignored, linear-model leaves (piecewise-linear trees) whose Jacobian is used, and constant leaves whose jumps are softened by averaging across shrinkage-scaled boosting rounds. The second is the out-of-range guard. During training we record, for each feature, the range covered by data. At run time, any input outside it scales $G$ toward zero and inflates the filter's process noise, so the filter trusts sensors more where the trees are blind. The third is timing. The ensembles are compiled to branch-only C with fixed tree count and depth, and worst-case execution time is measured on embedded-class processors together with the capped Newton solve.

The reference data come from a reconstructed mean-value diesel air-path model driven through the WHTC. "Truth" is a richer model than the filter's: a small-step ODE with an intercooler that has finite volume and added unmodeled effects such as heat-transfer and turbocharger-efficiency maps the filter's model lacks. This creates a genuine discrepancy for the trees to learn. If engine test-bench data are available, they replace the synthetic truth in a confirmatory run.

Baselines

The do-nothing reference is the uncorrected DAE filter at 125 ms with an uncapped Newton solve, exactly as in Real-time performance of DAE and ODE based estimators evaluated on a diesel engine. A second reference is the ODE filter at a 10 ms step, which that paper treats as the accuracy reference. The paper reports step-length limits of 15 ms and 125 ms and states only that RMSE is "similar" at those settings. No reported RMSE value was found on Lacuna for the WHTC estimators, so both references will be re-run on our reconstructed model, and the comparison is made against our own reproduction. Beating these references means statistically lower state RMSE than the uncorrected DAE filter on held-out WHTC segments, at no more than its step size, with zero deadline misses.

The strongest learned competitor is an MLP correction of the kind used in Concorde and SynPerf. It is trained on the same one-step targets with the same inputs, and uses its exact analytic Jacobian in the filter. For fairness, both learners get the same training trajectories and the same hyperparameter-search budget in trials. Both are constrained to the same measured worst-case execution time and memory on the same processor, and the MLP is sized to fill that budget. The industry baseline is a calibration lookup map: a multilinear interpolation grid over the two or three most important inputs, chosen by the trees' own Shapley attributions so the map gets the best possible axes, with memory matched to the tree ensemble.

Ablations isolate the key ingredients. Removing the warm-start ensemble while keeping the iteration cap tests whether the cap alone is safe. Removing the out-of-range guard tests whether flat extrapolation actually hurts. Swapping linear leaves for constant leaves tests whether filter linearization needs tree derivatives. The proposal's tree correction counts as winning if it reaches lower RMSE than the MLP and the map at equal worst-case time, or equal RMSE at clearly lower worst-case time.

Why not just…?

Why not just use an ECU lookup map? Maps are what production controllers already use, are trivially deterministic, and are easy to certify. Their weakness is dimension. A map over $d$ inputs with $n$ breakpoints needs $n^d$ entries, and air-path discrepancy plausibly depends on five or more variables at once (speed, fuel, both actuator positions, two pressures). The matched-memory comparison settles this directly. If a three-input map already captures most of the error that the tree ensemble removes, the trees are not worth their certification cost. We would report that and narrow the claim to the warm-start role.

Why not just use a small neural network? This is the real threat. The MLPs in Concorde and SynPerf are accurate on tabular physics features, and an MLP gives smooth Jacobians the filter likes. The case for trees rests on three measurable claims: integer-like branch evaluation is cheaper on processors without fast floating point; out-of-range inputs can be detected exactly from split thresholds, whereas an MLP extrapolates silently; and tabular data favors trees, as in LongPMInd. The equal-budget comparison and an out-of-envelope test set decide it. If the MLP wins on in-range accuracy and ties on timing, the contribution reduces to the guard and warm start, which we would apply to the MLP as well.

Why not just run the small-step ODE filter on faster hardware? Faster hardware removes the step-size problem but not the modeling error. The ODE and DAE filters share the same simplified physics, which is why their accuracy is already similar. Including the 10 ms ODE filter as a reference shows how much of the remaining error is model mismatch rather than discretization. If the gap between the ODE filter and the richer truth is negligible, there is nothing for a correction to fix, and the experiment will say so.

Why not just use boosted physics-informed networks? Ensemble learning for Physics Informed Neural Networks: a Gradient Boosting approach solves an offline boundary-value problem with several sequentially trained networks. It neither produces a step-wise correction that can be called inside a filter nor offers a worst-case timing bound, so it answers a different question.

Decisive Checks

The first check is accuracy. State RMSE on boost and intake-manifold pressure across held-out WHTC segments, compared against the uncorrected DAE filter, the 10 ms ODE filter, the MLP and the map, with confidence intervals over training seeds and segment splits. The second check is timing. We report the full distribution and maximum of per-step execution time over millions of steps, including the capped Newton solve, and count deadline misses, with and without the warm start. The third check is extrapolation. We test on synthetic transients that push one or more inputs outside the training envelope and compare error growth for the guarded trees, the unguarded trees and the MLP. The fourth check is peaks. We measure error on the top percentile of pressure transients, the regime where LongPMInd reports boosted trees underestimate. A further test checks whether training with a quantile or tail-weighted loss removes this bias without hurting average error. The proposal fails cleanly if the matched-budget MLP or map equals the trees on all four checks.