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

ParameterValue
bin_frames7
context_bin_frames67
decodershrinkage LDA (Ledoit-Wolf, equal priors)
cv5-fold grouped (30-bin chunks within session)
null_shifts50
context_permutations200

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

Decoding accuracy vs null
Figure 1. Decoding accuracy vs null. Each dot is an animal (red: above its own null, p < 0.05). Grey bars span the null mean to its 95th percentile; dotted line = chance.
Average confusion matrices
Figure 2. Average confusion matrices. Row-normalised confusion matrices averaged across animals (classes present in at least one animal).

Tables

Table 1. Decoding performance (group level)

Group p: exact one-sided Wilcoxon of (observed − null mean) across animals. Download CSV

analysisn_animalsmean_accuracymean_chancemean_nullanimals_p<0.05group_p
behavior (BL+SS)60.4520.2690.35260.0156
behavior (SD)60.2650.1410.20540.0156
context (BL/SD/SS, leave-one-day-out)60.4680.3330.33640.0312

Table 2. Decoding performance per animal

Balanced accuracy with circular-shift (behavior) or within-day label permutation (context) nulls. Download CSV

analysissubjectn_classesn_binschancebalanced_accuracynull_meannull_95p
behavior (SD)4703512400.20.3040.2570.3150.098
behavior (SD)6445712710.1430.3240.2380.3060.0196
behavior (SD)6597912650.1110.2150.1510.1850.0196
behavior (SD)6669812920.1250.3110.2550.3040.0392
behavior (SD)6672712090.1430.2110.1740.2090.0588
behavior (SD)6675812590.1250.2230.1520.1950.0196
behavior (BL+SS)4703526660.20.3810.2930.3380.0196
behavior (BL+SS)6445427180.250.4280.330.3750.0196
behavior (BL+SS)6597624410.1670.3810.2770.3220.0196
behavior (BL+SS)6669327300.3330.5530.450.510.0196
behavior (BL+SS)6672327010.3330.5020.4110.4370.0196
behavior (BL+SS)6675326630.3330.4680.3520.3880.0196
context (BL/SD/SS, leave-one-day-out)470334350.3330.60.3440.460.00995
context (BL/SD/SS, leave-one-day-out)644534350.3330.5080.3330.460.00995
context (BL/SD/SS, leave-one-day-out)659734060.3330.4960.340.4450.00498
context (BL/SD/SS, leave-one-day-out)666934350.3330.3240.3340.4250.592
context (BL/SD/SS, leave-one-day-out)667234350.3330.3770.3280.4120.159
context (BL/SD/SS, leave-one-day-out)667534350.3330.5010.3390.4140.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

  1. Ledoit O. & Wolf M. (2004) A well-conditioned estimator for large-dimensional covariance matrices. J Multivar Anal 88:365–411.
  2. Glaser J.I. et al. (2020) Machine learning for neural decoding. eNeuro 7:ENEURO.0506-19.2020.
  3. Frost N.A. et al. (2021) Dynamic patterns of correlated activity in the prefrontal cortex encode information about social behavior. PLoS Biol 19:e3001235.
  4. Padilla-Coreano N. et al. (2022) Cortical ensembles orchestrate social competition through hypothalamic outputs. Nature 603:667–671.
  5. Behavioral state-dependent oscillatory activity in prefrontal cortex induced by chronic social defeat stress (2022) Front Neurosci. doi:10.3389/fnins.2022.885432
  6. Gründemann J. et al. (2019) Amygdala ensembles encode behavioral states. Science 364:eaav8736.