Teaching an AI the Physics of Battery Aging

A working prototype that watches a battery's health, raises an alarm when something goes wrong, and predicts how many charge cycles it has left — built and tested on real laboratory battery data.

23 real batteries 1.99% health-estimate error 0 false alarms Lifetime predicted within ~5–10% Trains in ~2 min on a laptop CPU
The problem

Batteries age quietly — until they don't

Every rechargeable battery slowly loses capacity as it is charged and discharged. For an electric vehicle this matters three ways: you want to know the battery's health right now, you want to notice early if it starts aging abnormally fast (a sign something is broken, like degraded cooling), and you want to predict when it will reach end of life so maintenance can be planned instead of improvised.

The catch: health ("state of health", or SOH) can't be measured directly on the road. It has to be inferred from things that can be measured — voltages and currents during charging.

A plain neural network can learn this from data, but it knows nothing about how batteries actually behave, so its outputs are jittery and it can't reason about the future. This project instead uses a physics-informed neural network: an AI that is also taught the rules of battery aging.

The idea

Two networks: a doctor and a textbook

Think of a doctor examining a patient. Reading today's vital signs tells you how the patient is doing now. Medical knowledge about how a condition progresses tells you what to expect next. This prototype trains both parts.

The estimator — "reading the vitals"

A small neural network looks at 16 simple statistics from a short window of each charge (average voltage, charge time, and so on) and estimates the battery's current health.

The aging law — "the textbook"

A second network learns how fast health declines depending on how the battery is used and how worn it already is. It is built so it can never predict that a battery heals itself — health only goes down. That physical rule is wired into its structure, not just hoped for.

The two are trained together so they must agree: the health estimates the first network produces, cycle after cycle, have to be consistent with the aging speed the second network describes. That consistency requirement is the "physics" in physics-informed — and it is also what makes the alarm and the lifetime forecast possible.

The data

Real batteries, cycled until worn out

The model was trained and tested on the public XJTU dataset: 23 real lithium-ion cells charged and discharged in a laboratory until their capacity fell to 80% of new — the usual definition of end of life. Some were charged gently (the "2C" group, lasting about 390 cycles) and some aggressively (the "3C" group, lasting 120–300 cycles).

Four batteries were completely hidden during training and used only for testing — so every result below is the model meeting a battery it has never seen.

Result 1 · Monitoring

Tracking health with 2% error

On the four unseen batteries, the physics-informed model estimated health with an average error of 1.99% — and, just as important, its estimates are smooth and steady, while a standard neural network trained the usual way (orange dashes below) is noticeably jumpier. Smoothness matters: a jittery health signal causes false alarms downstream.

SOH estimation on four held-out batteries
Black dots: true measured health. Blue: the physics-informed model. Orange: a plain neural network without physics. Each panel is one battery the model never saw during training.
Result 2 · Diagnostics

Catching a fault, with zero false alarms

To test fault detection, we took a healthy test battery and artificially made it age faster from cycle 219 onward — a small extra loss of 0.05% health per cycle, the kind of slow drift a failing cooling system might cause. The question: does the system notice, and does it stay quiet when nothing is wrong?

The trick is that the model has learned what healthy aging looks like. When the real battery starts deviating from the healthy pattern, the gap between measurement and model — the residual — starts drifting. A classic statistical watchdog (a CUSUM detector) accumulates that drift and raises the alarm when it becomes unmistakable.

cycle 346
alarm raised (fault began at 219)
~6%
extra health lost when alarm fired
0
false alarms in ~1,080 healthy cycles
Fault detection demonstration
Top: healthy battery (black), the same battery with the injected fault (red), and what the model expects from healthy physics (blue). Bottom: the watchdog statistic stays flat at zero through 280+ healthy cycles, then climbs steeply once the fault takes hold and crosses the alarm threshold (green line).
Result 3 · Prognostics

Predicting remaining life

Because the aging law is a genuine equation — "health declines at this rate, given this usage and this current state" — it can be run forward in time like a weather forecast: start from today's health estimate, apply the law cycle after cycle, and see when the trajectory crosses the 80% end-of-life line. No future measurements are needed or assumed.

For the gently-charged group, the predicted remaining life was accurate to within 14–39 cycles (roughly 5–10% of the battery's life), and always on the cautious side — predicting end of life slightly early, which is the safe direction for maintenance planning.

Degradation forecasts and RUL predictions
Left: forecasts launched at 30%, 50% and 70% of one battery's life all land close to the true end of life near cycle 392. Right: predicted vs. true remaining life for every test battery and launch point.
Honest limitation: for the aggressively-charged group the forecasts ran 44–115 cycles long. Those batteries vary enormously from cell to cell (identical twins lasting 121 vs. 297 cycles), and a law learned from fleet averages cannot know which twin it is looking at. The fix — letting the law adapt to each individual cell as its own data accumulates — is the well-understood next step, not a mystery.
Under the hood

What it took to make the physics behave

Getting physics and machine learning to cooperate was the actual engineering work. Three lessons stood out:

Training curves
Left: the pieces of the training objective settling down. Right: validation error for the physics-informed model vs. the plain baseline.
Bottom line

What this proves — and what it doesn't

One compact, laptop-trainable model now covers the full health-management loop for a battery: monitor (2% health tracking), diagnose (fault flagged, no false alarms), and predict (lifetime within 5–10% for a homogeneous fleet). The physics ingredient earned its keep in all three: it smooths the estimates, defines "healthy" for the alarm, and provides the equation that makes forecasting possible at all.

It does not yet prove production readiness: the data is laboratory cycling, not road telemetry; the fault was synthetic; there is no uncertainty band around the forecasts; and cell-to-cell variation needs per-cell adaptation. Each of these is a known, planned extension — this prototype is the evidence that the foundation works.