A Plain-Language Monograph · Automotive Companion

Graph Neural Networks in the Vehicle

A car is not one machine. It is a moving negotiation between dozens of parts, a stream of sensors talking over a network, and a single agent surrounded by other agents who all have their own plans. Every one of those is a graph, and that is why Graph Neural Networks have quietly become an automotive workhorse.

By Majid Mazouchi.

Reading this with the companion This page assumes you already know the basics, message passing, aggregation, readout, from the first monograph (Graph Neural Networks, Explained Simply). Here we put that machinery to work entirely inside the world of vehicles.

01Why a car is secretly several graphs

The word "graph" sounds abstract until you notice the car is already full of them. There are three worth separating, because each one supports a different kind of GNN and a different automotive problem.

THE CAR SEES ego other road users THE CAR IS gway sensors and ECUs THE CAR IS IN roads and other cars
Figure 1. Three graphs, one vehicle. The car sees a scene graph of surrounding road users. The car is an internal network of sensors and control units. The car is in a road and fleet network. Rust marks the ego vehicle or its hub in each view. The rest of this page walks through what a GNN does with each.

02The scene as a graph (interactive)

This is the flagship automotive use of GNNs, and it lives in self-driving and driver-assistance stacks: predicting what every road user will do next. The setup is exactly the message passing you already know. Each agent (your car, other cars, pedestrians) is a node. An edge connects two agents that are close enough to affect each other. The features on a node are things like position, speed, and heading.

Why a graph and not a simple list? Because driving is interactive. What the car ahead does depends on the pedestrian it sees, and what you should do depends on that car. A model that predicts each agent in isolation will happily forecast two cars driving through the same point at the same instant. Message passing fixes this by letting every agent's prediction be informed by its neighbors, and by its neighbors' neighbors.

Below is a frozen intersection seen from above. Your car (rust) is approaching from the south behind a lead car (teal). A pedestrian (ochre) is stepping into the lead car's path. Press Run interaction round and watch the predicted paths (the dotted rays) update. Then toggle the pedestrian off and run it again to see how much the ego's own prediction depended on someone two cars ahead.

Trajectory prediction by message passing

Faint dotted line = naive prediction (ignore everyone). Solid dotted ray = prediction after accounting for neighbors. Thin gray links = the interaction graph.

ego (you) other vehicle pedestrian
Round 0

Here is the lesson hiding in that demo. With the pedestrian on, the first round makes the lead car brake hard, since it is the pedestrian's direct neighbor. Your ego car eases off only on the next round, once that slowdown reaches it: the message had to travel one extra hop, pedestrian to lead car, then lead car to you. You end up easing for a hazard you may not even be able to see, purely because information propagated through the graph. Turn the pedestrian off and the lead car keeps full speed, so your car holds its ordinary following prediction and barely changes from round to round. That two-hop reach is the receptive field idea from the first monograph, now keeping you from rear-ending the car ahead.

The real systems Production motion-forecasting models work this way. Influential designs represent each agent and each lane segment as nodes in a graph and pass messages between them, so the same network reasons about agent-to-agent and agent-to-road interactions at once. The hand-tuned nudges in the demo are replaced by learned functions, but the wiring is identical.

03The same idea, worked by hand

Strip the geometry away and the negotiation becomes simple arithmetic, the vehicle version of the worked example from the first page. Two cars approach a merge. Each outputs a single go value between 0 (yield) and 1 (proceed). Your car is a little more committed, so it starts at 0.9; the merging car starts at 0.8.

The message-passing rule says: lower your own intent in proportion to how strongly your one conflicting neighbor also intends to go.

new_go(me) = own_go(me) - 0.5 × go(neighbor)

Round one, both cars look at each other's starting intent:

ego: 0.9 - 0.5 × 0.8 = 0.50 merge: 0.8 - 0.5 × 0.9 = 0.35

Round two, each uses the other's updated value (the new message):

ego: 0.9 - 0.5 × 0.35 = 0.73 merge: 0.8 - 0.5 × 0.50 = 0.55

After a couple of rounds the values settle into a stable, consistent decision: the ego (which started keener) ends up clearly higher and proceeds, while the merging car settles lower and yields. Notice that no central referee decided this. The outcome emerged from the two nodes exchanging messages until they agreed, which is precisely what a GNN layer does across a whole scene of agents at once.

04The map is a graph too

The road itself is naturally a graph, and modern self-driving stacks treat it as one rather than as a picture. A high-definition map is broken into short lane segments. Each segment is a node, and edges encode the relationships that matter for driving: this lane continues into that one, this lane is left-adjacent to that one, this lane yields to that one at a junction.

Running a GNN over this lane graph gives two things at once. The connectivity edges support routing and lane-level planning (which sequence of lanes actually gets you there). The adjacency and conflict edges support behavior prediction (a car in a left-turn-only lane is probably turning left). Crucially, the lane graph and the agent scene graph from section 02 can be fused into one combined graph, so an agent's predicted path is shaped by both the cars around it and the road geometry it is constrained to follow.

05The car as its own network

Shift from the world outside to the wiring inside. A modern vehicle is a network of electronic control units (ECUs) and sensors talking over buses like CAN and automotive Ethernet. That is a graph whether you model it as one or not: nodes are the controllers and sensors, edges are the communication links between them.

Camera Radar Lidar Brake ECU Telematics Steering ECU Powertrain ECU Gate way
Figure 2. A simplified in-vehicle network. Sensors and control units are nodes; the central gateway routes between them. A GNN reads the normal pattern of who-talks-to-whom and how. The dashed rust link flags an anomaly: the externally connected telematics node suddenly behaving like a safety-critical controller, the signature of an intrusion.

Because the legitimate traffic on this network follows learnable patterns (which node talks to which, how often, with what timing and payloads), a GNN can learn what "healthy" looks like and flag deviations. This is the basis of graph-based intrusion detection for the CAN bus: a spoofed or injected message shows up as an edge or a node behaving unlike anything in the learned normal graph. The same structural view also helps diagnostics, tracing which controller is the likely source when a fault cascades across the bus.

06The battery pack as a graph

For an electric vehicle, the traction battery is its own graph and a high-value one. A pack is hundreds or thousands of cells arranged in modules. Each cell is a node; edges follow the electrical series-parallel wiring and the physical neighbors a cell exchanges heat with.

That structure is exactly what you need for two hard problems. First, state estimation: a cell's true state of charge and state of health depend on its neighbors, because current and temperature are shared along the connections, so a GNN can estimate per-cell condition more accurately than treating cells independently. Second, and more safety-critical, thermal propagation: if one cell overheats, the risk to the rest of the pack travels along the thermal-neighbor edges. A GNN that respects the pack's physical layout can predict how a local hot spot would spread, which is the difference between flagging one warm cell and anticipating a pack-level event.

07Raising the fidelity: graphs that obey physics

So far the graphs have carried statistics. The real prize, for engineering work, is letting them carry physics. The key observation is that message passing and physical coupling are the same operation seen from two directions. When heat flows between touching cells, each cell's temperature changes in proportion to the difference with its neighbors, which is exactly a sum-over-neighbors message. When two masses are linked by a spring, the force each feels depends on the other's position, which is again a message along an edge. The graph Laplacian that a GNN applies is the discrete diffusion operator, and a round of message passing is a force exchange.

That equivalence is why GNNs make such natural high-fidelity surrogates. Two levers raise the fidelity:

graph + features encoder processor M message rounds decoder predicted next state data loss match sensors physics residual obey the equation update weights
Figure 3. A physics-informed GNN, in the encode, process, decode shape used by learned simulators. The novelty is the second loss term: the prediction is fed into the governing equation and penalized when it does not balance. Data keeps it honest to reality; physics keeps it honest to the laws, which is what raises fidelity and cuts the data you need.

Simulation: heat moving through a battery pack

Here is the diffusion idea made literal. Each square is a cell in a pack; edges join physical neighbors. Every time step applies the discrete heat equation, which is one message-passing layer: a cell warms or cools toward its neighbors, gains heat from any internal source, and loses heat to cooling. Click any cell to toggle it as a hot source (a shorted or aging cell), set the cooling level, and press play to watch the field evolve.

Thermal diffusion on the pack graph

Click cells to toggle a heat source (ringed). Each step = one Laplacian message-passing update.

Cooling

max 25°C

Run it with cooling strong and the hot cell stays a contained spot: heat in roughly equals heat out. Switch cooling to off and the same source bleeds into its neighbors, then theirs, until a wide region climbs together. That spreading front is thermal propagation, and predicting it is a safety problem. A physics-informed GNN trained on this operator can run the prediction in a single fast pass instead of a slow finite-element solve, while the residual term keeps its forecast obeying the heat balance, so it stays trustworthy outside the exact conditions it was trained on.

08Mechanics: a suspension as a graph of forces

Diffusion is one kind of physics on a graph; Newtonian mechanics is another, and it covers the parts of a vehicle that move. Take one corner of the car, the classic quarter-car model. It is a tiny graph of three nodes: the body mass, the wheel mass, and the road. Two edges carry forces: the suspension spring and damper between body and wheel, and the tire between wheel and road. Solving the dynamics means repeatedly passing forces along those edges, which is message passing with Newton's second law as the update rule.

The simulation below integrates the real coupled equations of motion. Hit a bump and watch the force travel up from the road, through the tire into the wheel, then through the suspension into the body. The trace on the right plots how the body settles. Change the damper setting and feel the trade every chassis engineer knows: soft rides smooth but floats, firm controls the body but transmits more of the road.

Quarter-car dynamics on a three-node graph

Forces pass along edges (suspension, tire). The link glows when its force is large.

Damper

body 0.0 cm

Now scale that picture up. A full vehicle is the same graph repeated: a sprung body node coupled through four suspension edges to four wheel nodes, each tied to the road, with the body's pitch and roll linking the corners. That is a 7 degree-of-freedom graph, and richer multibody or finite-element models are simply larger graphs with more nodes. The reason this matters for fidelity is that a GNN trained to predict the per-node accelerations becomes a learned simulator: it can stand in for an expensive solver, run in milliseconds, and, because it operates on the graph, generalize to a new suspension layout or a different vehicle variant without being rebuilt from scratch.

state at t pos, vel GNN step forces on edges integrate a to v to x state at t + 1 feed the new state back, one timestep at a time
Figure 4. A learned simulator rollout. One message-passing step plays the role of one physics timestep: the GNN predicts the forces, an integrator turns them into the next positions and velocities, and the loop repeats. Train it once against a high-fidelity solver and it becomes a fast, reusable surrogate for that physics.

09Predicting failure before it happens

This is the prognostics and health management view, and it is where the graph picture earns its keep on the powertrain. Model the drivetrain as a graph: components (battery, inverter, motor, gearing, bearings) and their sensors (current, vibration, temperature, resolver) are nodes, and edges encode physical and signal coupling, who directly influences whom.

A fault rarely announces itself cleanly at one sensor. Bearing wear, for example, shows first as vibration, then leaves a fingerprint in the motor current as drag changes the load, then slowly raises temperature through friction. Looked at one channel at a time, these are three weak, separate anomalies that are easy to dismiss. A GNN reads the whole neighborhood at once and recognizes the joint pattern as a single root cause. From there, a graph-level readout can pool the component embeddings into one number: a health index or an estimate of remaining useful life.

Covered in depth elsewhere The companion monograph works this powertrain fault-propagation example step by step, with its own figure. If prognostics is your main interest, that section pairs directly with this one.

10Beyond one car: fleets and traffic

Zoom out past the single vehicle and the graphs only get larger. A city's road network is the obvious one: intersections or road sensors are nodes, road segments are edges, and the quantity flowing is traffic. Predicting congestion is then a spatio-temporal GNN problem, because the state at each node depends both on its neighbors in space (upstream traffic) and on its own recent history in time. This is how modern travel-time and congestion forecasts are produced over road graphs.

Two more fit the same mold. A fleet of vehicles sharing a model of normal behavior is a graph where one unit's emerging fault pattern can be recognized faster because the fleet has seen it before, which connects directly to the inductive learning idea: train across many vehicles, deploy on a new one. And vehicle-to-everything (V2X) communication literally builds a live graph of nearby vehicles and infrastructure exchanging messages, a real network on which cooperative perception and coordination can run.

11Why GNNs fit vehicles so well

It is worth naming why this keeps working across such different problems. Three properties of GNNs line up unusually well with vehicles.

12The catch: doing this in a moving car

None of this is free, and the honest engineering constraints are worth stating plainly.

Latency and compute A trajectory prediction that arrives 300 milliseconds late is useless. Running message passing fast enough on automotive-grade hardware, within a tight power and thermal budget, is a real constraint that shapes how many layers and how large a graph you can afford.
Safety and assurance Anything touching steering, braking, or thermal safety lives under functional-safety expectations (the ASIL framework). A learned model that is hard to fully verify sits uneasily there, so GNNs are often paired with deterministic checks and fallbacks rather than trusted blindly.
Building the graph is a design decision A GNN only ever reasons over the edges you give it. Choosing the interaction radius for a scene, or which couplings count in a powertrain, is a modeling choice that quietly determines what the model can and cannot notice. Get the graph wrong and the cleverest architecture cannot recover.

Seen together, the through-line is simple. A vehicle is surrounded by things that influence each other, built from parts that influence each other, and embedded in a network of roads and other vehicles that influence each other. Influence flowing along connections is the one thing a Graph Neural Network is built to read, which is why, from the perception stack to the battery pack to the service bay, it keeps turning out to be the right tool.


By Majid Mazouchi.