Estimate vehicle CO₂ ratings from fuel-consumption data
This example learns the relationship between vehicle specifications, standardized fuel-consumption ratings and reported carbon-dioxide emissions. It can support catalogue screening, engineering comparison and data-quality checks while keeping certification decisions with approved test procedures.
1. Industrial challenge
Vehicle programmes, fleet teams and sustainability functions often need an early estimate or an independent plausibility check before a complete certification record is available. This approximation model maps categorical vehicle descriptors and standardized fuel-consumption ratings to estimated co2_emissions in grams per kilometre.
2. Data set
The updated co2_emissions.csv contains 7,385 records, eleven inputs and one target. The prepared file uses semicolon delimiters and contains no missing values.
| Variable | Meaning | Type, unit or range |
|---|---|---|
brand | Vehicle manufacturer | Categorical; 42 brands |
model | Commercial model designation | Categorical; 2,053 values |
vehicle_class | Vehicle body/class category | Categorical; 16 classes |
engine_size | Engine displacement | 0.9 to 8.4 L |
cylinders | Engine cylinder count | 3 to 16 |
transmission | A automatic, AM automated manual, AS automatic select shift, AV continuously variable, M manual | 5 categories |
fuel_type | D diesel, E ethanol/E85, N natural gas, X regular gasoline, Z premium gasoline | 5 categories |
fuel_consumption_city | Standardized city fuel consumption | 4.2 to 30.6 L/100 km |
fuel_consumption_hwy | Standardized highway fuel consumption | 4.0 to 20.6 L/100 km |
fuel_consumption_comb(l/100km) | Combined fuel consumption | 4.1 to 26.1 L/100 km |
fuel_consumption_comb(mpg) | Combined fuel economy | 11 to 69 mpg |
co2_emissions | Reported CO₂ emissions rating | Target; 96 to 522 g/km |



The curved inverse pattern against mpg is expected because mpg and L/100 km are reciprocal representations of fuel economy. Including both variables gives the network redundant information and should be reviewed in a production feature set.
3. Model
The network receives eleven logical variables. One-hot encoding expands the five categorical inputs—especially the 2,053-value model field—to 2,127 input features. Numeric variables use mean-and-standard-deviation scaling, while categorical features use minimum–maximum scaling.
A hidden layer with three tanh neurons feeds one identity output neuron. The result is unscaled to g CO₂/km. The saved project applies no output bounding.

4. Training strategy
The model minimizes normalized squared error with L2 regularization of 0.01 and the quasi-Newton method. The recorded run contains 152 epochs: training error falls from 0.974 to 0.00559, while selection error falls from 0.180 to 0.00135.

The smooth convergence supports optimization of the configured network. The unusually low selection error should still be interpreted alongside duplicate overlap and the strong deterministic relationship between fuel consumption, fuel type and CO₂ rating.
5. Model selection
No separate neuron-selection or input-selection task is stored in the regenerated output. The example therefore keeps the configured three-neuron hidden layer and does not claim it as an independently selected optimum.
model identifiers and one of the two equivalent combined-consumption measures.6. Testing analysis
The final network is evaluated on 1,477 testing records. Neural Designer reports a determination coefficient of 0.9945. The conventional SSE-based R² is 0.9944.
Transparent baseline comparison
A linear benchmark was fitted on the same training rows using only combined L/100 km and fuel-type indicators, then evaluated on the same testing rows.
| Model | Testing R² | MAE (g/km) | RMSE (g/km) |
|---|---|---|---|
| Neural network | 0.9944 | 2.47 | 4.36 |
| Linear consumption + fuel baseline | 0.9921 | 3.06 | 5.20 |
The network reduces MAE by 19.2% relative to this strong transparent baseline. That improvement is real on the configured split, but it is modest enough that interpretability and unseen-category handling should influence the production choice.

7. Model deployment
A defensible application is a catalogue or homologation-data consistency check, not a replacement for the official test. Vehicle data is validated, passed to the model, compared with the recorded rating and routed for review when the residual exceeds a documented tolerance.
Representative testing case: Toyota Camry
This input combination is a real testing record and does not occur in the training subset. Its absolute error is close to the overall testing MAE, making it more representative than a specially selected near-perfect prediction.
| Vehicle input | Value |
|---|---|
| Brand / model | TOYOTA CAMRY |
| Vehicle class | Mid-size |
| Engine | 2.5 L, 4 cylinders |
| Transmission | AS — automatic select shift |
| Fuel | X — regular gasoline |
| City / highway | 9.5 / 6.6 L/100 km |
| Combined consumption | 8.2 L/100 km (34 mpg) |
| Result | g CO₂/km |
|---|---|
| Reported rating | 189 |
| Model estimate | 191.1 |
| Residual | +2.1 (+1.1%) |
| Empirical p95 absolute-error reference | ±6.3 |
Operational interpretation: the estimate is 2.1 g/km from the recorded value, inside the model’s empirical 95th-percentile absolute-error reference. A workflow could accept this row as internally consistent while sending larger residuals for source-data and engineering review. The p95 value is a screening tolerance reference, not a formal prediction interval.
Local sensitivity at a real vehicle reference
The regenerated directional-output task now starts from a valid vehicle record. The HTML table reproduces the reference values used by Neural Designer.
| Reference input | Value |
|---|---|
| Vehicle | ACURA RLX HYBRID, mid-size |
| Engine | 3.5 L, 6 cylinders |
| Transmission / fuel | AM / Z — automated manual / premium gasoline |
| City consumption | 8.0 L/100 km |
| Highway consumption | 7.5 L/100 km |
| Combined consumption | 7.7 L/100 km (37 mpg) |
| Model estimate at reference | 181.1 g CO₂/km |

The curve shows the model response when only fuel_consumption_city changes and every other input remains fixed. Interpret it only inside the observed city-consumption range of 4.2 to 30.6 L/100 km; the chart extends beyond that domain for visualization. Because city, highway, combined L/100 km and mpg are mathematically related, this is a local sensitivity analysis rather than a feasible vehicle-configuration scenario. Operational comparisons should update the linked consumption fields consistently or compare complete observed configurations.
8. Scope and limitations
- The prepared extract does not contain model year, so temporal validation and year-to-year regulatory or powertrain shifts cannot be tested.
- There are 1,112 exact duplicate rows. Random splitting places 293 exact testing rows in training and 462 testing input combinations in training.
- The
modelfield has 2,053 categories. New vehicle names require an explicit unknown-category policy or a model based on transferable engineering variables. - City, highway and combined consumption are strongly related, while combined mpg is a reciprocal representation of combined L/100 km. This multicollinearity increases redundancy.
- Fuel consumption and fuel type already determine most of the reported CO₂ rating. The neural network should be compared with a transparent emissions-factor or linear calculation before deployment.
- The target represents standardized/model-specific ratings, not real-world driving emissions. Driver behaviour, load, weather, traffic, maintenance and route conditions are outside the model.
- The highest-emission observations are sparse, and the goodness-of-fit chart shows underprediction at the extreme tail.
- Production validation should hold out complete model families and future model years, document unit and category mappings, and monitor data and residual drift.
References
- Natural Resources Canada. Fuel consumption ratings: official context and variable units for model-specific fuel-consumption ratings and estimated CO₂ emissions.
- Kaggle. CO₂ Emission by Vehicles: prepared dataset used by this example.
- Neural Designer testing analysis: goodness-of-fit and error interpretation.
- Neural Designer model deployment: directional outputs and deployment concepts.




