OSCR

Higher visual areas act like domain-general filters with strong selectivity and functional specialization.

Code ↔ Paper

5 matches between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

The 5 matches
  1. [1] § Methods › Response-optimized encoding model › Architectural details ↔ code/readouts.py, lines 266–390 · score 0.74 · outer products, feature vector, spatial filter, sum, dimensions, maps
  2. [2] § Methods › Response-optimized encoding model ↔ code/models_brain.py, lines 149–263 · score 0.74 · inner batch, ReLU, convolutional layer, rotations, equivariance, steerable
  3. [3] § Methods › Response-optimized encoding model › Architectural details ↔ code/models_brain.py, lines 149–263 · score 0.73 · feature fields, ReLU, convolutional layer, stride, rotations, equivariant
  4. [4] § Methods › Baseline models › Task-optimized models ↔ code/Demo training model .ipynb, lines 34–95 · score 0.53 · trained model, patience, Adam, PyTorch, factorized, batch
  5. [5] § Methods › Natural scenes dataset ↔ preprocess/extract_cortical_voxel.py, lines 130–165 · score 0.51 · func1pt8mm, voxel responses, masks, NSD, word, ROIs

Paper

Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

Python · 266 lines · 8.6 KB · MIT · 2 matches

  1. import os
  2. import torch
  3. import torch.nn as nn
  4. import torch.nn.functional as F
  5. from torch.nn import init
  6. from torch.distributions.uniform import Uniform
  7. import pickle
  8. from collections import namedtuple
  9. from itertools import chain, repeat
  10. import numpy as np
  11. from e2cnn import gspaces
  12. from e2cnn import nn
  13. from skimage.transform import resize
  14. from neuralpredictors.layers.readouts import SpatialXFeatureLinear
  15. import torchvision.models as models
  16. from train_utils import *
  17. from model_utils import *
  18. class C8NonSteerableCNN(torch.nn.Module):
  19. def __init__(self, n_feats = 48):
  20. super(C8NonSteerableCNN, self).__init__()
  21. self.block1 = torch.nn.Sequential(
  22. torch.nn.Conv2d(3,
  23. n_feats*8,
  24. kernel_size=5,
  25. padding = 1,
  26. bias=False),
  27. torch.nn.BatchNorm2d(n_feats*8),
  28. torch.nn.ReLU(inplace = True)
  29. )
  30. self.block2 = torch.nn.Sequential(
  31. torch.nn.Conv2d(n_feats*8,
  32. n_feats*8,
  33. kernel_size=5,
  34. padding = 2,
  35. bias=False),
  36. torch.nn.BatchNorm2d(n_feats*8),
  37. torch.nn.ReLU(inplace = True)
  38. )
  39. self.pool1 = torch.nn.AvgPool2d(kernel_size = 2, stride = 2)
  40. self.block3 = torch.nn.Sequential(
  41. torch.nn.Conv2d(n_feats*8,
  42. n_feats*8,
  43. kernel_size=3,
  44. padding = 1,
  45. bias=False),
  46. torch.nn.BatchNorm2d(n_feats*8),
  47. torch.nn.ReLU(inplace = True)
  48. )
  49. self.block4 = torch.nn.Sequential(
  50. torch.nn.Conv2d(n_feats*8,
  51. n_feats*8,
  52. kernel_size=3,
  53. padding = 1,
  54. bias=False),
  55. torch.nn.BatchNorm2d(n_feats*8),
  56. torch.nn.ReLU(inplace = True)
  57. )
  58. self.pool2 = torch.nn.AvgPool2d(kernel_size = 2, stride = 2)
  59. self.block5 = torch.nn.Sequential(
  60. torch.nn.Conv2d(n_feats*8,
  61. n_feats*8,
  62. kernel_size=3,
  63. padding = 1,
  64. bias=False),
  65. torch.nn.BatchNorm2d(n_feats*8),
  66. torch.nn.ReLU(inplace = True)
  67. )
  68. self.block6 = torch.nn.Sequential(
  69. torch.nn.Conv2d(n_feats*8,
  70. n_feats*8,
  71. kernel_size=3,
  72. padding = 1,
  73. bias=False),
  74. torch.nn.BatchNorm2d(n_feats*8),
  75. torch.nn.ReLU(inplace = True)
  76. )
  77. self.pool3 = torch.nn.AvgPool2d(kernel_size = 2, stride = 2)
  78. self.block7 = torch.nn.Sequential(
  79. torch.nn.Conv2d(n_feats*8,
  80. n_feats*8,
  81. kernel_size=3,
  82. padding = 1,
  83. bias=False),
  84. torch.nn.BatchNorm2d(n_feats*8),
  85. torch.nn.ReLU(inplace = True)
  86. )
  87. self.block8 = torch.nn.Sequential(
  88. torch.nn.Conv2d(n_feats*8,
  89. n_feats*8,
  90. kernel_size=3,
  91. padding = 1,
  92. bias=False),
  93. torch.nn.BatchNorm2d(n_feats*8),
  94. torch.nn.ReLU(inplace = True)
  95. )
  96. self.pool4 = torch.nn.AvgPool2d(kernel_size = 2, stride = 1)
  97. def forward(self, input: torch.Tensor):
  98. x = self.block1(input)
  99. x = self.block2(x)
  100. x = self.pool1(x)
  101. x = self.block3(x)
  102. x = self.block4(x)
  103. x = self.pool2(x)
  104. x = self.block5(x)
  105. x = self.block6(x)
  106. x = self.pool3(x)
  107. x = self.block7(x)
  108. x = self.block8(x)
  109. x = self.pool4(x)
  110. return x
  111. class C8SteerableCNN(torch.nn.Module):
  112. def __init__(self, n_feats = 48):
  113. super(C8SteerableCNN, self).__init__()
  114. from e2cnn import nn
  115. # the model is equivariant under rotations by 45 degrees, modelled by C8
  116. self.r2_act = gspaces.Rot2dOnR2(N=8)
  117. # the input image is a scalar field, corresponding to the trivial representation
  118. in_type = nn.FieldType(self.r2_act, 3*[self.r2_act.trivial_repr])
  119. # we store the input type for wrapping the images into a geometric tensor during the forward pass
  120. self.input_type = in_type
  121. # convolution 1
  122. # first specify the output type of the convolutional layer
  123. # we choose 24 feature fields, each transforming under the regular representation of C8
  124. out_type = nn.FieldType(self.r2_act, n_feats*[self.r2_act.regular_repr])
  125. self.block1 = nn.SequentialModule(
  126. # nn.MaskModule(in_type, 224, margin=1),
  127. nn.R2Conv(in_type, out_type, kernel_size=5, padding=1, bias=False),
  128. nn.InnerBatchNorm(out_type),
  129. nn.ReLU(out_type, inplace=True)
  130. )
  131. # convolution 2
  132. # the old output type is the input type to the next layer
  133. in_type = self.block1.out_type
  134. # the output type of the second convolution layer are 32 regular feature fields of C8
  135. out_type = nn.FieldType(self.r2_act, n_feats*[self.r2_act.regular_repr])
  136. self.block2 = nn.SequentialModule(
  137. nn.R2Conv(in_type, out_type, kernel_size=5, padding=1, bias=False),
  138. nn.InnerBatchNorm(out_type),
  139. nn.ReLU(out_type, inplace=True)
  140. )
  141. self.pool1 = nn.SequentialModule(
  142. nn.PointwiseAvgPoolAntialiased(out_type, sigma = 0.66, stride=2)
  143. )
  144. in_type = self.block2.out_type
  145. out_type = nn.FieldType(self.r2_act, n_feats*[self.r2_act.regular_repr])
  146. self.block3 = nn.SequentialModule(
  147. nn.R2Conv(in_type, out_type, kernel_size=3, padding=1, bias=False),
  148. nn.InnerBatchNorm(out_type),
  149. nn.ReLU(out_type, inplace=True)
  150. )
  151. # convolution 5
  152. # the old output type is the input type to the next layer
  153. in_type = self.block3.out_type
  154. # the output type of the fifth convolution layer are 96 regular feature fields of C8
  155. out_type = nn.FieldType(self.r2_act, n_feats*[self.r2_act.regular_repr])
  156. self.block4 = nn.SequentialModule(
  157. nn.R2Conv(in_type, out_type, kernel_size=3, padding=1, bias=False),
  158. nn.InnerBatchNorm(out_type),
  159. nn.ReLU(out_type, inplace=True)
  160. )
  161. self.pool2 = nn.PointwiseAvgPoolAntialiased(out_type, sigma = 0.66, stride=2)
  162. in_type = self.block4.out_type
  163. out_type = nn.FieldType(self.r2_act, n_feats*[self.r2_act.regular_repr])
  164. self.block5 = nn.SequentialModule(
  165. nn.R2Conv(in_type, out_type, kernel_size=3, padding=1, bias=False),
  166. nn.InnerBatchNorm(out_type),
  167. nn.ReLU(out_type, inplace=True)
  168. )
  169. self.block6 = nn.SequentialModule(
  170. nn.R2Conv(in_type, out_type, kernel_size=3, padding=1, bias=False),
  171. nn.InnerBatchNorm(out_type),
  172. nn.ReLU(out_type, inplace=True)
  173. )
  174. self.pool3 = nn.PointwiseAvgPoolAntialiased(out_type, sigma = 0.66, stride=2)
  175. in_type = self.block6.out_type
  176. out_type = nn.FieldType(self.r2_act, n_feats*[self.r2_act.regular_repr])
  177. self.block7 = nn.SequentialModule(
  178. nn.R2Conv(in_type, out_type, kernel_size=3, padding=1, bias=False),
  179. nn.InnerBatchNorm(out_type),
  180. nn.ReLU(out_type, inplace=True)
  181. )
  182. self.block8 = nn.SequentialModule(
  183. nn.R2Conv(in_type, out_type, kernel_size=3, padding=1, bias=False),
  184. nn.InnerBatchNorm(out_type),
  185. nn.ReLU(out_type, inplace=True)
  186. )
  187. self.pool4 = nn.PointwiseAvgPoolAntialiased(out_type, sigma = 0.66, stride=1)
  188. def forward(self, input: torch.Tensor):
  189. # wrap the input tensor in a GeometricTensor
  190. # (associate it with the input type)
  191. from e2cnn import nn
  192. x = nn.GeometricTensor(input, self.input_type)
  193. x = self.block1(x)
  194. x = self.block2(x)
  195. x = self.pool1(x)
  196. x = self.block3(x)
  197. x = self.block4(x)
  198. x = self.pool2(x)
  199. x = self.block5(x)
  200. x = self.block6(x)
  201. x = self.pool3(x)
  202. x = self.block7(x)
  203. x = self.block8(x)
  204. x = self.pool4(x)
  205. x = x.tensor
  206. return x

models_brain.py at commit 93cfba6, under MIT · at the source

Overview

Authors: Meenakshi Khosla1,2, Leila Wehbe3,4
ORCID iDs: Leila Wehbe
  1. Department of Cognitive Science, University of California,San Diego, CA USA
  2. Department of Computer Science and Engineering, University of California,San Diego, CA USA
  3. Machine Learning Department, Carnegie Mellon University,Pittsburgh, PA USA
  4. Neuroscience Institute, Carnegie Mellon University,Pittsburgh, PA USA
Institutions: University of California San Diego (United States); Carnegie Mellon University (United States)
Journal: Nature communications, volume 17, issue 1, article 7484
Dates: received 29 November 2022; accepted 20 May 2026; published online 12 June 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1038/s41467-026-73938-9 · PMID 42285966 · PMCID PMC13408694 · OpenAlex W4220765743
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: human (organism)
Methods: Statistics, Preprocessing, Connectivity, Machine learning, fMRI & imaging
Keywords: Neural encoding, Perception
MeSH: Visual Cortex*, Brain Mapping, Humans, Magnetic Resonance Imaging, Models, Neurological, Neural Networks, Computer, Photic Stimulation (* major topic)
Topic: Face Recognition and Perception (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Citations: not cited yet (Europe PMC); 94 references in the paper

Abstract

Neuroscientific studies rely heavily on a-priori hypotheses, which can bias results toward existing theories. Here, we use a hypothesis-neutral approach to study category selectivity in higher visual cortex. Using only stimulus images and their associated fMRI activity, we constrain randomly initialized neural networks to predict voxel activity. Despite no category-level supervision, units in the trained networks act as detectors for semantic concepts like ‘faces’ or ‘words’, providing solid empirical support for categorical selectivity. Importantly, this selectivity is mostly maintained when training the networks without images that contain the preferred category, strongly suggesting that selectivity is not domain-specific machinery, but sensitivity to generic patterns that characterize preferred categories. The ability of the models’ representations to transfer to perceptual tasks further reveals the functional role of their selective responses. Finally, our models show selectivity only for a limited number of categories, all previously identified, suggesting that the essential categories are already known.

Reproduced under the paper's license (CC BY), from the paper cited above.

Repository

Its files are read in the Code ↔ Paper reader above, with 5 matches between paragraphs and lines of code.

mkhosla-ucsd/response-optimized-modeling

License: MIT
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: 93cfba61d9389d85e69f1a821cf827612a1ebb54, 6 June 2025
Languages: Python (11), Jupyter (2)
Size: 28 files, 13 scripts
Software Heritage: not archived
Found in: “Code availability”
Holds: README, license file, 2 notebooks
Not found: CITATION.cff, environment file, tests, continuous integration, documentation
Tools: PyTorch (11 files), NumPy (10 files), SciPy (4 files), Matplotlib (2 files), Pillow (2 files), scikit-image (2 files), NiBabel (1 file), pandas (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
15 files

Code availability

The code used in this paper can be found at https://github.com/mkhosla-ucsd/response-optimized-modeling/.

Reproduced under the paper's license (CC BY), from the paper cited above.

Tracing map

Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.

What the map holds:

  • 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 13 scripts, each with its path and the digest of its content;
  • 5 matches between paragraphs of the paper and lines of the code (method lexical-v1);
  • neither the text of the paper nor the code itself.

Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.

Data

Datasets cited

Data availability

We use the open 7T fMRI Natural Scenes Dataset (NSD)32. The preprocessed dataset used in our study is available at 10.6084/m9.figshare.31849762. Source data are provided with this paper.

Reproduced under the paper's license (CC BY), from the paper cited above.

Versions

The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.

Version 2, 28 September 2026

  • Funding: added Carnegie Mellon University; University of California, San Diego

Version 1, 27 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 2 authors, 2 keywords, 7 MeSH terms, 65 references.

Cite

This paper

Khosla, M., & Wehbe, L. (2026). Higher visual areas act like domain-general filters with strong selectivity and functional specialization. Nature communications, 17(1), 7484. https://doi.org/10.1038/s41467-026-73938-9

BibTeX

@article{khosla2026higher,
author = {Khosla, Meenakshi and Wehbe, Leila},
title = {{Higher visual areas act like domain-general filters with strong selectivity and functional specialization}},
journal = {Nature communications},
year = {2026},
month = jun,
volume = {17},
number = {1},
pages = {7484},
publisher = {Nature Publishing Group},
issn = {2041-1723},
doi = {10.1038/s41467-026-73938-9},
url = {https://doi.org/10.1038/s41467-026-73938-9},
pmid = {42285966},
pmcid = {PMC13408694}
}

RIS

TY - JOUR
AU - Khosla, Meenakshi
AU - Wehbe, Leila
TI - Higher visual areas act like domain-general filters with strong selectivity and functional specialization
T2 - Nature communications
J2 - Nat Commun
PY - 2026
DA - 2026/06/12
VL - 17
IS - 1
SP - 7484
SN - 2041-1723
PB - Nature Publishing Group
DO - 10.1038/s41467-026-73938-9
UR - https://doi.org/10.1038/s41467-026-73938-9
LA - en
ER -

CSL-JSON

{
"id": "10.1038/s41467-026-73938-9",
"type": "article-journal",
"title": "Higher visual areas act like domain-general filters with strong selectivity and functional specialization",
"container-title": "Nature communications",
"author": [
{
"family": "Khosla",
"given": "Meenakshi"
},
{
"family": "Wehbe",
"given": "Leila"
}
],
"container-title-short": "Nat Commun",
"volume": "17",
"issue": "1",
"page": "7484",
"DOI": "10.1038/s41467-026-73938-9",
"PMID": "42285966",
"PMCID": "PMC13408694",
"ISSN": "2041-1723",
"publisher": "Nature Publishing Group",
"URL": "https://doi.org/10.1038/s41467-026-73938-9",
"language": "en",
"issued": {
"date-parts": [
[
2026,
6,
12
]
]
}
}

The tracing map gets a citation of its own once an author has validated it and it has a DOI.

Similar papers

The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.

[1] doi:10.1523/jneurosci.0038-26.2026 [code]
Multidimensional Feature Tuning in Category Selective Areas of Human Visual Cortex.
Journal: The Journal of neuroscience : the official journal of the Society for Neuroscience
In common: Pillow, NiBabel, PyTorch, 4 other tools, 15 references
[2] doi:10.1038/s42003-026-10843-3 [code]
Self-supervised learning yields representational signatures of category-selective cortex.
Journal: Communications biology
In common: 13 references
[3] doi:10.1038/s41467-026-76098-y [code]
A single computational objective can produce specialization of streams in visual cortex.
Journal: Nature communications
In common: scikit-image, Pillow, NiBabel, 5 other tools, 8 references
[4] doi:10.1162/imag.a.1309 [code]
Probing the content of semantic representations in body-selective regions.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: Pillow, NiBabel, PyTorch, 4 other tools, 8 references
[5] doi:10.1038/s41597-026-07248-6 [code]
A large-scale fMRI dataset for vision-language semantic association.
Journal: Scientific data
In common: scikit-image, Pillow, NiBabel, 5 other tools, 6 references
[6] doi:10.1038/s42003-026-10169-0 [code]
Shared representations in brains and models reveal a two-route cortical organization during scene perception.
Journal: Communications biology
In common: Pillow, NiBabel, PyTorch, 4 other tools, 5 references
[7] doi:10.1162/imag.a.1246 [code]
A 3.5-minute-long reading-based fMRI localizer for the language network.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: NiBabel, pandas, SciPy, 2 other tools, 6 references
[8] doi:10.7554/elife.107933 [code]
Modality-agnostic decoding of vision and language from fMRI.
Journal: eLife
In common: scikit-image, Pillow, NiBabel, 5 other tools, 3 references
[9] doi:10.1162/nol.a.271 [code]
Compositional Complexity in Text and Images.
Journal: Neurobiology of language (Cambridge, Mass.)
In common: Pillow, NiBabel, PyTorch, 4 other tools, 4 references
[10] doi:10.1016/j.dcn.2026.101703 [code]
Visual Word Form Area demonstrates individual and task-agnostic consistency but inter-individual variability.
Journal: Developmental cognitive neuroscience
In common: NiBabel, pandas, SciPy, 2 other tools, 5 references

Contribute

The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.

Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.

Request its removal

To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).

Discussion, reproductions, activity

Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.

Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.

Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.