Linear decoding of visual stimulus category from two-photon population activity in four mouse visual areas (V1, LM, AL, RL), using the MICrONS Phase 3 functional dataset. We ask whether decodability varies systematically along the putative cortical hierarchy, and whether any such differences survive controls for population size and behavioural state.
Main result. On the finest contrast — discriminating three natural video categories (Cinematic / Sports1M / Rendered) — LM is the best decoder in 9/10 sessions, beating V1 by Δ = +0.031 (significant in 10/10 sessions) and AL/RL by Δ ≈ +0.05 (9–10/10), Bonferroni-corrected. This inverts the naive expectation of a strict V1 → higher-area gradient of categorical abstraction. Coarse contrasts (natural vs. parametric; Monet2 vs. Trippy) are at ceiling in every area and cannot distinguish the hierarchy at all.
Pairwise area differences in balanced accuracy (behaviour-cleaned features, mean across 10 sessions). The right panel — the fine natural contrast — carries the effect: LM beats every other area. Parenthesised counts give the number of sessions significant after Bonferroni correction.
Full report (PDF) — 11 pages, 14 figures.
| Folder | Contents |
|---|---|
category_decoding/ |
Trial-mean decoding across areas: natural vs. parametric, Monet2 vs. Trippy, and the three-way natural contrast. Neuron-count-matched subsampling, permutation nulls, paired area statistics. Produces the main result. |
time_resolved_decoding/ |
Per-frame clip-category decoding on a single session, LR vs. linear SVM, with temporal averaging. |
extra/ |
Superseded single-session pipeline. Not part of the report; see the folder README. |
utils/, reader.py |
Data access and shared helpers. |
docs/DATASET.md |
HDF5 schema and MicronsReader API. |
documents/ |
Report source and PDF. |
| Question | Chance | Where | |
|---|---|---|---|
| Q1a | Natural vs. parametric stimuli | 0.50 | 01_category_decoding/ |
| Q1b | Parametric discrimination (Monet2 vs. Trippy) | 0.50 | 01_category_decoding/ |
| Q1c | Natural discrimination (Cinematic vs. Sports1M vs. Rendered) | 0.33 | 01_category_decoding/ |
| Q2 | Time-resolved, per-frame clip-category decoding | 0.33 | 02_time_resolved_decoding/ |
Trial-mean decoding — balanced accuracy at matched neuron count (mean ± SD, 10 sessions):
| V1 | LM | AL | RL | |
|---|---|---|---|---|
| Q1a (chance 0.50) | 0.959 ± 0.016 | 0.951 ± 0.015 | 0.918 ± 0.020 | 0.936 ± 0.022 |
| Q1b (chance 0.50) | 0.994 ± 0.006 | 0.988 ± 0.009 | 0.979 ± 0.019 | 0.980 ± 0.015 |
| Q1c (chance 0.33) | 0.647 ± 0.033 | 0.677 ± 0.036 | 0.621 ± 0.061 | 0.622 ± 0.058 |
All 120/120 (session × area × question) cells decode significantly above the shuffle-label null. Q1a and Q1b saturate; Q1c is the only contrast that separates the areas, and there LM leads.
Time-resolved decoding — peak balanced accuracy, Session 5_6 (chance 33.3%):
| Window | Clf. | V1 | LM | AL | RL | Avg. |
|---|---|---|---|---|---|---|
| w = 1 | LR | 41.4% | 44.2% | 47.4% | 42.6% | 43.9% |
| w = 1 | SVM | 40.2% | 43.5% | 44.6% | 41.2% | 42.5% |
| w = 5 | LR | 46.5% | 48.4% | 50.2% | 48.5% | 48.4% |
| w = 5 | SVM | 44.2% | 46.6% | 47.5% | 47.2% | 46.4% |
Per-frame decoding is significant everywhere (p < 10⁻⁹; 0/50 shuffles exceeded the true accuracy) but stays below 50%. Five-frame temporal averaging adds a uniform ≈ +4.5 points in every area, consistent with category information being distributed over time rather than locked to stimulus onset; cross-area differences shrink under averaging, suggesting broadly distributed representation.
Behavioural confounds. Regressing out pupil (4 features) and treadmill velocity before trial-averaging costs ≈ 0.03 accuracy on Q1a (largest in AL, −0.038): part of the coarse natural-vs-parametric contrast reflects covariation of arousal and locomotion with stimulus class. For Q1b and Q1c the effect is below 0.01 and inconsistent in sign — the LM advantage is not a behavioural artefact. All headline results are reported on cleaned features as the conservative estimate.
Confusion structure. Cinematic ↔ Rendered is the dominant error in every area (off-diagonals 0.19–0.23); Sports1M is the most reliably classified class (diagonal 0.64–0.71), plausibly because of its distinctive fast coherent motion. LM's advantage is spread across all three classes rather than driven by one.
- Data. 10 of 14 MICrONS sessions, selected at a matched imaging rate (~6.30 Hz; sessions 9_3, 9_4, 9_6 excluded at 8.62–9.62 Hz; 7_4 excluded as experimentally corrupted). 464 trials per session: 128 Cinematic, 128 Sports1M, 128 Rendered, 40 Monet2, 40 Trippy.
- Preprocessing. First 3 frames (≈475 ms) discarded for response-onset lag; per-neuron trial means computed per anatomical area. "Clean" features are residuals after regressing each neuron on 4 pupil channels and treadmill velocity.
- Decoder.
StandardScaler → LogisticRegression(ℓ2, C = 1, balanced class weights); balanced accuracy under 5-fold stratified cross-validation. - Population-size control. Areas differ in recorded neuron count, which inflates accuracy independently of coding quality. Cross-area comparisons are therefore made at the matched count Nmin (287–468, session-dependent) over 50 random subsamples.
- Statistics. Shuffle-label nulls (100 permutations per cell); paired Wilcoxon signed-rank across sessions, Bonferroni-corrected within question.
- Time-resolved. Session 5_6 (8,592 neurons; 384 natural trials; 72 timepoints; 468 neurons per area). Per-frame response vectors decoded independently at each timepoint with LR and linear SVM. GroupKFold by clip hash prevents the same clip appearing in both train and test folds. Temporal averaging tested at w = 5 frames.
Linear decoders cannot recover nonlinearly-formatted information: higher accuracy in LM means category information is more linearly accessible there, not that LM "represents" categories more than V1. Class counts are imbalanced (384 natural vs. 80 parametric trials), and Nmin varies across sessions, so within-session contrasts are matched but cross-session pooling is not.
git clone https://github.com/annanotaro/Microns-visual-decoding
cd Microns-visual-decodinguv sync # or: pip install -r requirements.txt
cp .env.example .env # point DATA_PATH at microns.h5
python main_runner.py --question 1Data is pulled from NeuroBLab/MICrONS on
first run. See docs/DATASET.md for the HDF5 schema and reader API.
Research project supervised by Prof. Alessandro Sanzeni, Bocconi University, March–April 2026.
Gaia Grossi · Max David · Leo Arthur Morvan · Anna Notaro · Beatrice Porta
Anna Notaro: 01_category_decoding/ in full — decoding pipeline, neuron-count-matched
subsampling, behavioural regression, and the cross-area statistical comparisons (Figures 1–4).
Stringer et al., Nature 2019 · Goltstein et al., Nature Neuroscience 2021 · Chen et al., PLOS Computational Biology 2024 · Ding et al., Nature 2025 (MICrONS functional connectomics)
