Hodgkin and Huxley simulator
I found the link to the Hodgkin and Huxley model while reading Baker, Peña, Jayamohan and Jérusalem’s opinion piece in Biology Letters, Mechanistic models versus machine learning, a fight worth fighting for the biological community?. They use Hodgkin and Huxley as their “paradigm” case of the mechanistic approach, and call it one of the most successful mathematical models of a complex biological process ever formulated. There’s a lot of interesting maths and some great graphs in the original paper, so I thought it would be fun to try it out myself and rebuilt the model to see what it looks like. OK, I should be clear up front, I’m not a UX dev, I got Claude to build this for me, and it did a pretty good job. It doesn’t just show the static results, it allows various parameters to be tweaked to see the dynamic behaviour of the model in real time.
The argument the Baker et al. paper is making
Baker and colleagues are not arguing that machine learning is bad. Their distinction is more interesting. Machine learning has what they call inductive capability: it finds patterns that are present in the data it was shown. Mechanistic models have deductive capability: combining causal principles lets you extrapolate to behaviours that were never in the original data at all.
What H&H fitted, and what they got for free
Every parameter in the 1952 model comes from one kind of experiment, the so-called “voltage clamp”. They held the membrane at a fixed potential, then watched the sodium and potassium currents, they then fitted rate equations to the curves. They came up with six empirical equations and seven constants to model what they observed, all of it calibrated on clamped membranes that are never allowed to fire.
Then they let the equations go and asked what a free membrane would do. They saw the action potential, with the right height and the right duration. They also got a threshold, which appears nowhere as a parameter; a refractory period; and the conduction velocity of the propagating impulse, which they obtained by guessing a speed, integrating, watching the solution run away to infinity, and guessing again, for about three weeks on a hand-cranked calculator.
The velocity they deduced this way was 18.8 m/sec. The velocity measured in the actual fibre was 21.2 m/sec, so they landed within about 11% of a real squid, from equations fitted to a different experiment. Pretty good! Well, good enough for the Nobel committee anyway.
That is the deduction Baker is pointing at. A classifier trained on voltage clamp recordings would classify voltage clamp recordings.
The part that complicates the story
Hodgkin and Huxley are explicit that this is not really a purely mechanistic model. The equations are an empirical description of the permeability changes, not a claim about what the membrane is made of or how it works in detail. They point out that a different set of equations would have fitted the same data equally well, and say plainly that the success of their model is no evidence in favour of the physical picture they had in mind while writing it. It’s a model, it fits the data and I suspect it fitted their intuition and biological understanding as well. It’s a powerful tool, but not a literal description of the underlying biology.
So the m³h and n⁴ that make the model work are not mechanism. They are the smallest powers that gave the right delay before the conductance rises, chosen for the shape of the curve. The paper says as much: a fifth or sixth power would have fitted the potassium data better, and was not judged worth the extra complication. That would have been the equivalent of over-fitting in machine learning terms.
What they established was narrower than mechanism but still powerful. It was that permeability changes of roughly this shape are sufficient to account for everything a nerve does.
Where the paper puts the limit
Back to Baker and colleagues, they are honest about the challenges. They call it quixotic to try to calibrate Hodgkin-Huxley-type models to every neuron, because new ion channel types are being discovered to this day. Mechanistic models get their deductive power through specificity.
Their proposed resolution is not one or the other. It is a division of labour: learn the components you cannot parameterise, keep the mechanistic scaffold that does the extrapolating. A machine learning layer over a mechanistic frame, or mechanistically derived quantities fed in as features.
Baker RE, Peña JM, Jayamohan J, Jérusalem A. 2018. Mechanistic models versus machine learning, a fight worth fighting for the biological community? Biol. Lett. 14: 20170660. doi:10.1098/rsbl.2017.0660
Hodgkin AL, Huxley AF. 1952. A quantitative description of membrane current and its application to conduction and excitation in nerve. J. Physiol. 117: 500–544. PMC1392413
