Study S08 · generated 2026-10-13T21:32:09+00:00 · 936.0 s
Population decoding of behavior and context
Cross-validated linear decoders with temporally structured null models.
Question
How much information about ongoing defeat behavior and about the CSDS context (baseline, defeat, sensory contact) is carried by the population activity of the imaged neurons?
Background & rationale
Decoding quantifies the information a population carries about a variable, without assuming single-neuron tuning (Glaser et al. 2020). Linear classifiers trained on calcium ensembles decode social behaviors and social rank in prefrontal cortex (Frost et al. 2021; Padilla-Coreano et al. 2022), and LFP-based decoders separate social behavioral states in CSDS mice (Front Neurosci 2022). Because behavior and neural activity are both autocorrelated, valid null models must preserve temporal structure. Circular shifting of the label sequence and blocked cross-validation are the standard safeguards (Gründemann et al. 2019).
Methodology
Features. Inferred spike probability was averaged in 7-frame bins (1.05 s). Each bin took its majority behavior label, and bins whose majority covered < 70% were discarded.
Behavior decoding. Separately for defeat sessions (days 1–9 without day 7) and for BL + SS sessions, per animal, classes with ≥ 30 bins were decoded by linear discriminant analysis with Ledoit–Wolf covariance shrinkage (equal class priors; features z-scored within training folds). Shrinkage LDA is a regularised linear decoder that is robust when neurons outnumber effective samples. Cross-validation was 5-fold grouped by 30-bin (≈ 31.5 s) chunks of recording time within each session, so a test bin's temporal neighbours fall in the same fold except at chunk edges. Performance is balanced accuracy, whose chance is 1/K for K classes.
Null distribution. The full bin-wise label sequence (including unlabelled bins) was circularly shifted relative to the neural data (≥ 30 bins; 50 shifts), which keeps bout structure and the true time axis. Bins whose shifted label is an eligible class were decoded with the same cross-validation. Per-animal p = (1 + #null ≥ observed)/(1 + #null), so the smallest attainable p is 1/51 ≈ 0.02. Group-level: one-sided exact Wilcoxon of (observed − null mean) across animals.
Context decoding. BL vs SD vs SS (days 1–9 without day 7) were decoded from 10-s population vectors with leave-one-day-out cross-validation, testing generalisation to an unseen day. The null permuted the three condition labels among the sessions of each day (200 permutations), destroying context information while preserving day effects.
Parameters
| Parameter | Value |
|---|---|
bin_frames | 7 |
context_bin_frames | 67 |
decoder | shrinkage LDA (Ledoit-Wolf, equal priors) |
cv | 5-fold grouped (30-bin chunks within session) |
null_shifts | 50 |
context_permutations | 200 |
Highlights
significant
Decoding behavior (BL+SS)
45% (chance 27%)
6/6 animals above their own null; group p = 0.016.
significant
Decoding behavior (SD)
26% (chance 14%)
4/6 animals above their own null; group p = 0.016.
significant
Decoding context (BL/SD/SS, leave-one-day-out)
47% (chance 33%)
4/6 animals above their own null; group p = 0.031.
Results
Behavior (BL+SS). Mean balanced accuracy 45.2% vs chance 26.9% and temporally structured null 35.2%. 6/6 animals decoded above their individual null (group p = 0.016).
Behavior (SD). Mean balanced accuracy 26.5% vs chance 14.1% and temporally structured null 20.5%. 4/6 animals decoded above their individual null (group p = 0.016).
Context (BL/SD/SS, leave-one-day-out). Mean balanced accuracy 46.8% vs chance 33.3% and temporally structured null 33.6%. 4/6 animals decoded above their individual null (group p = 0.031).
Per-animal values are in Table 2 and Figure 1. Average confusion matrices (Figure 2) show which behaviors are most confusable.
Figures
Tables
Table 1. Decoding performance (group level)
| analysis | n_animals | mean_accuracy | mean_chance | mean_null | animals_p<0.05 | group_p |
|---|---|---|---|---|---|---|
| behavior (BL+SS) | 6 | 0.452 | 0.269 | 0.352 | 6 | 0.0156 |
| behavior (SD) | 6 | 0.265 | 0.141 | 0.205 | 4 | 0.0156 |
| context (BL/SD/SS, leave-one-day-out) | 6 | 0.468 | 0.333 | 0.336 | 4 | 0.0312 |
Table 2. Decoding performance per animal
| analysis | subject | n_classes | n_bins | chance | balanced_accuracy | null_mean | null_95 | p |
|---|---|---|---|---|---|---|---|---|
| behavior (SD) | 4703 | 5 | 1240 | 0.2 | 0.304 | 0.257 | 0.315 | 0.098 |
| behavior (SD) | 6445 | 7 | 1271 | 0.143 | 0.324 | 0.238 | 0.306 | 0.0196 |
| behavior (SD) | 6597 | 9 | 1265 | 0.111 | 0.215 | 0.151 | 0.185 | 0.0196 |
| behavior (SD) | 6669 | 8 | 1292 | 0.125 | 0.311 | 0.255 | 0.304 | 0.0392 |
| behavior (SD) | 6672 | 7 | 1209 | 0.143 | 0.211 | 0.174 | 0.209 | 0.0588 |
| behavior (SD) | 6675 | 8 | 1259 | 0.125 | 0.223 | 0.152 | 0.195 | 0.0196 |
| behavior (BL+SS) | 4703 | 5 | 2666 | 0.2 | 0.381 | 0.293 | 0.338 | 0.0196 |
| behavior (BL+SS) | 6445 | 4 | 2718 | 0.25 | 0.428 | 0.33 | 0.375 | 0.0196 |
| behavior (BL+SS) | 6597 | 6 | 2441 | 0.167 | 0.381 | 0.277 | 0.322 | 0.0196 |
| behavior (BL+SS) | 6669 | 3 | 2730 | 0.333 | 0.553 | 0.45 | 0.51 | 0.0196 |
| behavior (BL+SS) | 6672 | 3 | 2701 | 0.333 | 0.502 | 0.411 | 0.437 | 0.0196 |
| behavior (BL+SS) | 6675 | 3 | 2663 | 0.333 | 0.468 | 0.352 | 0.388 | 0.0196 |
| context (BL/SD/SS, leave-one-day-out) | 4703 | 3 | 435 | 0.333 | 0.6 | 0.344 | 0.46 | 0.00995 |
| context (BL/SD/SS, leave-one-day-out) | 6445 | 3 | 435 | 0.333 | 0.508 | 0.333 | 0.46 | 0.00995 |
| context (BL/SD/SS, leave-one-day-out) | 6597 | 3 | 406 | 0.333 | 0.496 | 0.34 | 0.445 | 0.00498 |
| context (BL/SD/SS, leave-one-day-out) | 6669 | 3 | 435 | 0.333 | 0.324 | 0.334 | 0.425 | 0.592 |
| context (BL/SD/SS, leave-one-day-out) | 6672 | 3 | 435 | 0.333 | 0.377 | 0.328 | 0.412 | 0.159 |
| context (BL/SD/SS, leave-one-day-out) | 6675 | 3 | 435 | 0.333 | 0.501 | 0.339 | 0.414 | 0.00498 |
Limitations
- Linear decoders give a lower bound on information. Non-linear decoders or decoders exploiting correlations could extract more (Frost et al. 2021).
- Behavior classes are imbalanced and partly confounded with locomotion.
- Context decoding across days can exploit any feature that differs between sessions recorded in the same order each day (BL → SD → SS), including within-day drift. Generalisation across days mitigates but does not eliminate this.
References
- Ledoit O. & Wolf M. (2004) A well-conditioned estimator for large-dimensional covariance matrices. J Multivar Anal 88:365–411.
- Glaser J.I. et al. (2020) Machine learning for neural decoding. eNeuro 7:ENEURO.0506-19.2020.
- Frost N.A. et al. (2021) Dynamic patterns of correlated activity in the prefrontal cortex encode information about social behavior. PLoS Biol 19:e3001235.
- Padilla-Coreano N. et al. (2022) Cortical ensembles orchestrate social competition through hypothalamic outputs. Nature 603:667–671.
- Behavioral state-dependent oscillatory activity in prefrontal cortex induced by chronic social defeat stress (2022) Front Neurosci. doi:10.3389/fnins.2022.885432
- Gründemann J. et al. (2019) Amygdala ensembles encode behavioral states. Science 364:eaav8736.