What this research found
Can a cortical neuron's excitatory or inhibitory identity be recovered from its electrical behaviour alone? Working from the Allen Cell Types Database, K-Dense assembled 1,755 mouse cortical neurons labelled spiny (putative excitatory) or aspiny (putative inhibitory) and trained classifiers on 43 purely electrophysiological features, withholding every morphological, transgenic-line, and cortical-layer field. The selected random forest reached an area under the ROC curve of 0.993 and misclassified only 56 of the 1,755 cells.
- Under stratified 5-fold cross-validation the random forest reached a mean AUROC of 0.9931 ± 0.0032, balanced accuracy of 0.9683 ± 0.0103, and macro-F1 of 0.9681 ± 0.0104, misclassifying 56 of 1,755 cells (3.2%).
- An L2-regularized logistic regression was statistically indistinguishable (AUROC 0.9919 ± 0.0054, balanced accuracy 0.9699 ± 0.0107). Two very different learning algorithms agreeing this closely argues the signal is not an artefact of one model's inductive bias.
- The action-potential upstroke-to-downstroke ratio under short-square stimulation was a top-five driver in both models — the leading random-forest feature at 0.128 Gini importance and a +5.37 standardized coefficient in the logistic regression — with higher values pointing to spiny cells.
- Membrane time constant was the second strongest random-forest feature (0.091 Gini importance) and also runs higher in spiny cells, matching the textbook contrast between slow-integrating pyramidal neurons and the fast, leaky membranes of fast-spiking interneurons.
- Errors were nearly symmetric across the two classes: 849 of 866 aspiny cells were called correctly (specificity 0.980) and 850 of 889 spiny cells were (sensitivity 0.956).
- The discriminative signal sits in spike waveform kinetics and passive membrane properties rather than in simple firing-rate statistics, which did not reach the top five for either model.
How it was done
Cell metadata and precomputed electrophysiology feature vectors were retrieved from the Allen Brain Map RMA API and joined on specimen identifier, yielding 1,813 mouse cells annotated spiny or aspiny; the intermediate sparsely spiny category was excluded. Features missing in more than 20% of cells were dropped — removing six slow-trough measures and leaving 43 covering spike waveforms, firing patterns, and passive membrane properties — and cells missing more than 20% of those features were removed, giving a balanced final cohort of 1,755 cells (889 spiny, 866 aspiny). A logistic regression and a random forest were then scored with stratified 5-fold cross-validation in which median imputation, standardization, and an inner 3-fold hyperparameter grid search were fit only within each training fold. Feature drivers were read from signed standardized coefficients and Gini importances, with agreement between the two models treated as the evidence.
Data sources
- Allen Cell Types Database — mouse electrophysiology feature table, accessed 11 July 2026 via the Allen Brain Map RMA API (1,755 cells, 43 features)
- Gouwens et al., Nature Neuroscience 22:1182–1195 (2019) — Allen morpho-electric classification of mouse visual cortex neurons
Limitations
The cohort covers only mouse cortical neurons recorded under Allen's standardized protocols, and intrinsic features depend on recording temperature, slice quality, and access resistance, so absolute values may not transfer to other laboratories or to human tissue. Feature attributions are correlational, and Gini importance is known to favour continuous and correlated predictors, of which this feature set contains many.
How this research was produced
K-Dense Web planned and ran this neuroscience investigation end to end — gathering the sources, carrying out the analysis, producing the figures, and drafting the report. The full session transcript, including every intermediate step, is available to view.


