🧠

ML Architecture & Parameter Selection Case Study

Technical Deep Dive

Competitive Powertrain Benchmarking · VECTO CO2v Estimation

1. Problem Formulation & Engineering Objective

In the heavy-duty commercial vehicle industry, declared CO2 emissions (CO2v, measured in g/km) are determined through the European Commission's official VECTO (Vehicle Energy Consumption calculation Tool) simulation software.

Running VECTO for thousands of candidate vehicle configurations requires proprietary 3D CAD files, transmission loss maps, aerodynamic wind tunnel drag coefficients ($C_d \cdot A$), and full rolling resistance tyre test maps. Our objective is to construct a fast, transparent, non-linear surrogate model that predicts certified VECTO CO2v emissions in sub-milliseconds using only macro engineering parameters (chassis mass, engine swept volume, rated power, rated speed, vehicle segment, and axle configuration).

Target Variable: CO2v (g/km)

The headline VECTO certified whole-truck emission figure. Unlike engine-only bench cycles (g/kWh), CO2v reflects the entire vehicle system: driveline friction, aerodynamics, mass, and standard EU duty cycles.

Surrogate Speedup

Enables real-time What-If parametric exploration, fleet trade-off optimization, and competitor capability forecasting without requiring confidential component test data.

2. Target Leakage Guard & Banned Features

A critical failure mode in automotive machine learning is target leakage: using features that are themselves downstream calculations of the target or direct CO2 measurements. In our pipeline, powerbench/features.py strictly enforces an automated architectural guard via assert_no_leakage():

Banned Feature Nature of Measurement Why It Is Strictly Prohibited
WHTC_CO2_gkwh Engine dynamometer transient cycle CO2 (g/kWh) Directly feeds the VECTO calculation that produces CO2v. Using it would mean predicting whole-vehicle CO2 from engine CO2, invalidating the model for early-stage vehicle sizing.
WHSC_CO2_gkwh Engine dynamometer steady-state cycle CO2 (g/kWh) Same as WHTC: engine-level CO2 test result that is only known after physical engine dynamometer type-approval.
COL_CO2_gtkm / COL_CO2_gkm Payload-specific mission simulation Calculated simultaneously with CO2v inside VECTO for long-haul duty cycles; mathematically collinear with target.
MS_SpecificCO2Emissions Member-State registered CO2 figure Downstream administrative registration entry containing mixed measurement units.

3. Algorithm Selection: Why HistGradientBoostingRegressor?

We benchmarked multiple model families on the 756k-vehicle dataset. Histogram-based Gradient Boosting (HistGradientBoostingRegressor) was selected based on four empirical and engineering requirements:

1. Non-Linear Physical Scaling

Vehicle aerodynamic drag scales with velocity squared ($v^2$) and frontal area, while engine brake-specific fuel consumption follows an island efficiency map (non-linear with engine displacement and RPM). Linear Regression achieves only $R^2 \approx 0.312$, whereas HistGradientBoosting achieves $R^2 = 0.595 \pm 0.006$.

2. Native Handling of Missing Values

Real-world regulatory filings contain missing optional fields (e.g. engine rated speed or axle configuration on certain vocational variants). HGB evaluates missing values natively at split time without ad-hoc imputation artifacts.

3. Fast $O(N \cdot K)$ Histogram Binning

By binning continuous features into 256 integer bins, tree construction is up to $20\times$ faster than standard Exact Gradient Boosting, allowing on-the-fly cross-validation and fast model training during interactive pipeline updates.

4. Sub-Millisecond Inference for What-If Simulator

Once trained, tree traversal requires only integer comparisons, enabling real-time $(< 2\text{ ms})$ interactive predictions in the Streamlit UI as the engineer drags parameter sliders.

Empirical Cross-Validation Performance (5-Fold CV)

Model Configuration Feature Set CV R² (Mean ± Std) CV MAE (g/km) Median Baseline MAE Error Reduction
HistGradientBoosting (Selected) Rich (2019-2020) 0.595 ± 0.006 27.8 g/km 49.4 g/km −43.7%
Linear Regression Rich (2019-2020) 0.312 ± 0.008 39.6 g/km 49.4 g/km −19.8%
HistGradientBoosting (Selected) Base (All Years) 0.448 ± 0.018 45.2 g/km 62.2 g/km −27.3%
Linear Regression Base (All Years) 0.245 ± 0.012 54.1 g/km 62.2 g/km −13.0%

4. Hyperparameter Tuning & Selection Rationale

Every hyperparameter in powerbench/modeleval.py and 3-ml-prediction/train_co2v.py was selected based on automotive physics and sample density constraints:

max_iter = 300 Tree Boosting Iterations

Allows the gradient descent procedure sufficient iterations to resolve fine-grained interaction terms (e.g. the joint interaction between rated RPM and displacement) while early-stopping prevents overfitting on noise in rare vocational subclasses.

learning_rate = 0.08 Shrinkage Factor

Conservative shrinkage reduces the variance of individual tree contributions. A step size of 0.08 prevents the model from taking excessively aggressive updates when encountering outlier chassis configurations.

max_leaf_nodes = 31 Tree Complexity ($2^5 - 1$)

Restricts maximum tree depth to approximately 5 levels. In physical powertrain systems, 3-to-4-way interaction terms (e.g. Mass $\times$ Displacement $\times$ Vehicle Group) explain almost all variance; allowing deeper trees ($> 64$ leaves) leads to memorization of OEM-specific homologation codes rather than generalizable vehicle physics.

random_state = 42 Reproducibility Seed

Guarantees exact cross-validation fold splitting and feature permutation importance replication across platforms (Linux, macOS, Windows).

5. Permutation Feature Importance & Physical Interpretation

Permutation importance evaluates the drop in model $R^2$ when a single feature is randomly shuffled across 15,000 holdout vehicles (5 repeats). Below is the physical explanation for the observed ranking:

1. VehicleGroup (~0.599 Importance) 59.9% R² Drop

Physics: Vehicle Group (4, 5, 9, 10) sets the baseline aerodynamic frontal area, axle count, and standard VECTO mission cycle (e.g. Long Haul vs Regional Delivery weighting). Group 5 (4×2 tractor, ~40 t combined) operates on high-speed motorways where aerodynamic drag dominates, while Group 4 (rigid truck) operates at lower speeds.

2. CurbMassChassis_kg (~0.427 Importance) 42.7% R² Drop

Physics: Base chassis mass directly scales rolling resistance force ($F_{\text{roll}} = C_{rr} \cdot m \cdot g$) and kinetic energy required during acceleration cycles. Heavier chassis require higher instantaneous engine fueling across all VECTO mission profiles.

3. Engine_Displacement_ltr (~0.249 Importance) 24.9% R² Drop

Physics: Engine swept volume (5.1L to 16.4L) dictates internal mechanical friction, displacement-specific torque capacity, and thermodynamic sweet spot. Larger displacement line-haul diesels (12–13L) operate at higher brake thermal efficiency under full highway cruise loads compared to small engines running near redline.

4. Engine_RatedPower_kw (~0.232 Importance) 23.2% R² Drop

Physics: Rated power dictates the truck's hill-climbing capability and top-gear acceleration. High-power trucks (e.g. 500+ kW V8 engines) allow higher cruise speeds on highway gradients, impacting cumulative fuel consumption over standard European topographic profiles.

5. Engine_RatedSpeed_rpm (~0.084 Importance) 8.4% R² Drop

Physics: Reflects the manufacturer's powertrain downspeeding philosophy. Modern high-efficiency line-haul powertrains achieve rated power at lower engine speeds (e.g. ~1600 RPM vs ~2200 RPM), significantly reducing parasitic friction losses in the valvetrain, water pump, and oil pump.

6. Real-World Engineering Case Studies

How powertrain engineers apply this model to solve practical trade-offs:

Case A

Downspeeding & Displacement Right-Sizing in Long-Haul (Group 5)

Scenario: An OEM evaluates replacing a 10.8L engine rated at 1900 RPM with a 12.8L engine rated at 1600 RPM for a 40-tonne 4×2 tractor (Group 5, 8,200 kg curb mass).

Model Prediction & Physical Mechanism:

The surrogate model predicts a reduction in declared CO2v from ~742 g/km to ~718 g/km (−3.2% CO2v reduction). Even though displacement increases by 2.0L, the 300 RPM downspeeding lowers parasitic valvetrain friction and allows the engine to operate in its peak brake-thermal efficiency contour ($> 46\%$) during 85 km/h cruise.

Case B

Lightweighting vs Aerodynamic Penalty in Regional Delivery (Group 4)

Scenario: Engineering team evaluates a 500 kg chassis lightweighting program (curb mass drops from 7,500 kg to 7,000 kg on an 18-tonne rigid truck).

Model Prediction & Physical Mechanism:

The model predicts a CO2v decrease of ~14.6 g/km (−2.1% CO2v). In regional stop-and-go delivery cycles (Group 4), mass reduction provides double the CO2 benefit per kilogram compared to pure long-haul cruise, because braking energy dissipation is directly proportional to chassis mass.

7. Extrapolation Envelope Guard & Trust Boundaries

Gradient-boosted decision trees partition the training space with axis-aligned hyperplanes. Consequently, tree models cannot extrapolate linear trends outside the convex hull of their training data. To safeguard against unphysical predictions, powerbench/modeleval.py automatically records the 1st ($p_1$) and 99th ($p_{99}$) percentiles of each input feature:

Curb Mass ($p_1 \dots p_{99}$)

5,566 – 9,563 kg

Warns if inputs violate typical chassis boundaries.

Displacement ($p_1 \dots p_{99}$)

6.7 – 16.4 L

Prevents passenger-car engine inputs (< 5L).

Rated Power ($p_1 \dots p_{99}$)

185 – 427 kW

Flags excessive power ratings (> 566 kW).

When the user adjusts sliders in the interactive What-If Simulator outside these envelopes, the dashboard highlights an amber warning to communicate that the vehicle configuration lies in an extrapolation region with reduced empirical confidence.