OSCR

Representations of facial features and surface quality in monkey area TE compared to neural network models.

Code ↔ Paper

1 match 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 1 match
  1. [1] § Materials and methods › Model acquisition ↔ code/preprocess_imagenet.py, lines 41–135 · score 0.61 · AdaIN, stylized ImageNet, painting, style transfer, Transformer, trained

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 · 211 lines · 7.7 KB · MIT · 1 match

  1. import sys
  2. import argparse
  3. import os
  4. import shutil
  5. import time
  6. import numpy as np
  7. import sys
  8. import torch
  9. import torch.nn as nn
  10. import torch.nn.parallel
  11. import torch.backends.cudnn as cudnn
  12. import torch.distributed as dist
  13. import torch.optim
  14. import torch.utils.data
  15. import torch.utils.data.distributed
  16. import torchvision.transforms as transforms
  17. import torchvision.datasets as datasets
  18. import torchvision.models as models
  19. from torchvision.utils import save_image, make_grid
  20. from tensorboardX import SummaryWriter
  21. from PIL import Image
  22. import general as g
  23. import adain
  24. #####################################################################
  25. # purpuse of this file:
  26. # preprocess complete ImageNet (train + val) with AdaIN style
  27. # transfer to speed-up later training.
  28. #####################################################################
  29. parser = argparse.ArgumentParser(description='Preprocess ImageNet to create Stylized-ImageNet')
  30. parser.add_argument('--workers', default=4, type=int, metavar='N',
  31. help='number of data loading workers (default: 4)')
  32. parser.add_argument('--batch-size', default=256, type=int,
  33. metavar='N', help='mini-batch size (default: 256)')
  34. parser.add_argument('--print-freq', '-p', default=1, type=int,
  35. metavar='N', help='print frequency (default: 10)')
  36. def main():
  37. global args
  38. args = parser.parse_args()
  39. # Data loading code
  40. traindir = os.path.join(g.IMAGENET_PATH, 'train')
  41. valdir = os.path.join(g.IMAGENET_PATH, 'val')
  42. #############################################################
  43. # START STYLE TRANSFER SETUP
  44. #############################################################
  45. style_dir = g.ADAIN_PREPROCESSED_PAINTINGS_DIR
  46. assert len(os.listdir(style_dir)) == 79395
  47. do_style_preprocessing = False
  48. num_styles = len(os.listdir(style_dir))
  49. print("=> Using "+str(num_styles)+" different style images.")
  50. all_styles = [[] for _ in range(num_styles)]
  51. for i, name in enumerate(sorted(os.listdir(style_dir))):
  52. all_styles[i] = os.path.join(style_dir, name)
  53. transfer_args = g.get_default_adain_args()
  54. transferer = adain.AdaIN(transfer_args)
  55. print("=> Succesfully loaded style transfer algorithm.")
  56. style_loader = adain.StyleLoader(style_transferer = transferer,
  57. style_img_file_list = all_styles,
  58. rng = np.random.RandomState(seed=49809),
  59. do_preprocessing = do_style_preprocessing)
  60. style_transfer = style_loader.get_style_tensor_function
  61. print("=> Succesfully created style loader.")
  62. #############################################################
  63. # CREATING DATA LOADERS
  64. #############################################################
  65. class MyDataLoader():
  66. """Convenient data loading class."""
  67. def __init__(self, root,
  68. transform = transforms.ToTensor(),
  69. target_transform = None,
  70. batch_size = args.batch_size,
  71. num_workers = args.workers,
  72. shuffle = False,
  73. sampler = None):
  74. self.dataset = datasets.ImageFolder(root = root,
  75. transform = transform,
  76. target_transform = target_transform)
  77. self.loader = torch.utils.data.DataLoader(
  78. dataset = self.dataset,
  79. batch_size = batch_size,
  80. shuffle = shuffle,
  81. sampler = sampler,
  82. num_workers = num_workers,
  83. pin_memory = True)
  84. default_transforms = transforms.Compose([
  85. transforms.Resize(256),
  86. transforms.CenterCrop(g.IMG_SIZE),
  87. transforms.ToTensor()])
  88. val_loader = MyDataLoader(root = valdir,
  89. transform = default_transforms,
  90. shuffle = False,
  91. sampler = None)
  92. train_loader = MyDataLoader(root = traindir,
  93. transform = default_transforms,
  94. shuffle = False,
  95. sampler = None)
  96. print("=> Succesfully created all data loaders.")
  97. print("")
  98. #############################################################
  99. # PREPROCESS DATASETS
  100. #############################################################
  101. print("Preprocessing validation data:")
  102. preprocess(data_loader = val_loader,
  103. input_transforms = [style_transfer],
  104. sourcedir = valdir,
  105. targetdir = os.path.join(g.STYLIZED_IMAGENET_PATH, "val/"))
  106. print("Preprocessing training data:")
  107. preprocess(data_loader = train_loader,
  108. input_transforms = [style_transfer],
  109. sourcedir = traindir,
  110. targetdir = os.path.join(g.STYLIZED_IMAGENET_PATH, "train/"))
  111. def preprocess(data_loader, sourcedir, targetdir,
  112. input_transforms = None):
  113. """Preprocess ImageNet with certain transformations.
  114. Keyword arguments:
  115. sourcedir -- a directory path, e.g. /bla/imagenet/train/
  116. where subdirectories correspond to single classes
  117. (need to be filled with .JPEG images)
  118. targetdir -- a directory path, e.g. /bla/imagenet-new/train/
  119. where sourcedir will be mirrored, except
  120. that images will be preprocessed and saved
  121. as .png instead of .JPEG
  122. input_transforms -- a list of transformations that will
  123. be applied (e.g. style transfer)
  124. """
  125. counter = 0
  126. current_class = None
  127. current_class_files = None
  128. # create list of all classes
  129. all_classes = sorted(os.listdir(sourcedir))
  130. for i, (input, target) in enumerate(data_loader.loader):
  131. # apply manipulations
  132. for transform in input_transforms:
  133. input = transform(input)
  134. for img_index in range(input.size()[0]):
  135. # for each image in a batch:
  136. # - determine ground truth class
  137. # - transform image
  138. # - save transformed image in new directory
  139. # with the same class name
  140. # the mapping between old and new filenames
  141. # is achieved by looking at the indices of
  142. # the sorted(os.listdir()) results.
  143. source_class = all_classes[target[img_index]]
  144. source_classdir = os.path.join(sourcedir, source_class)
  145. assert os.path.exists(source_classdir)
  146. target_classdir = os.path.join(targetdir, source_class)
  147. if not os.path.exists(target_classdir):
  148. os.makedirs(target_classdir)
  149. if source_class != current_class:
  150. # moving on to new class:
  151. # start counter (=index) by 0, update list of files
  152. # for this new class
  153. counter = 0
  154. current_class_files = sorted(os.listdir(source_classdir))
  155. current_class = source_class
  156. target_img_path = os.path.join(target_classdir,
  157. current_class_files[counter].replace(".JPEG", ".png"))
  158. save_image(tensor = input[img_index,:,:,:],
  159. filename = target_img_path)
  160. counter += 1
  161. if i % args.print_freq == 0:
  162. print('Progress: [{0}/{1}]\t'
  163. .format(
  164. i, len(data_loader.loader)))
  165. if __name__ == '__main__':
  166. main()

preprocess_imagenet.py at commit 654e132, under MIT · at the source

Overview

Authors: Keisuke Shioya1, Kazuko Hayashi2,3, Bing Li4, Narihisa Matsumoto2, Keiji Matsuda2, Kenichiro Miura5, Mark A. G. Eldridge4,6, Richard C. Saunders4, Barry J. Richmond4, Yuji Nagai7, Naohisa Miyakawa7, Takafumi Minamimoto7, Shun Katakami1, Masato Okada1, Kenji Kawano2,8, Yasuko Sugase-Miyamoto2
  1. Graduate School of Frontier Sciences, The University of Tokyo, Kashiwa-shi, Japan
  2. National Institute of Advanced Industrial Science and Technology, Tsukuba-shi, Japan
  3. Research Fellowship for Young Scientists, Japan Society for the Promotion of Science, Chiyoda-ku, Japan
  4. Section on Neural Coding and Computation, National Institute of Mental Health, National Institute of Health, Bethesda, MD, United States
  5. Institute for the Advanced Study of Human Biology, Kyoto University, Kyoto-shi, Japan
  6. Biosciences Institute, Newcastle University, Newcastle upon Tyne, United Kingdom
  7. Advanced Neuroimaging Center, National Institutes for Quantum Science and Technology, Chiba-shi, Japan
  8. Department of Physiology, Dokkyo Medical University School of Medicine, Mibu, Japan
Journal: Frontiers in neural circuits, volume 20, article 1783892
Dates: received 8 January 2026; accepted 5 June 2026; published online 3 August 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.3389/fncir.2026.1783892 · PMID 42609469 · PMCID PMC13478094 · OpenAlex W7172277679
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: computational modeling (no new data) (modality), non-human primate (organism)
Methods: Spectral & time-frequency, Statistics, Smoothing, state filtering, decompositions, Machine learning, Single-unit activity, calcium imaging, Physiology & signal measures
Keywords: facial information processing, temporal visual cortex, neural network models, representation similarity analysis, texture bias
MeSH: Facial Expression*, Facial Recognition*, Neural Networks, Computer*, Temporal Lobe*, Animals, Convolutional Neural Networks, Macaca mulatta, Male, Neurons, Photic Stimulation (* major topic)
Topic: Face Recognition and Perception (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Funding: Intramural NIH HHS (ZIA MH002032)
Citations: not cited yet (Europe PMC); 45 references in the paper

Abstract

The shape and spacing of facial features are essential for the perception of emotional expressions and the identification of individuals. The surface quality of faces, such as skin texture, eye twinkle, and hair gloss, is valuable for estimating health status. A previous fMRI study in monkeys revealed that regions selective for faces overlapped regions selective for object gloss in the central inferior temporal (IT) cortex, suggesting that the surface quality of faces is processed in area TE. However, the representation of facial surface quality has not been directly examined in this area. To understand neural processing of surface quality in face images, neuronal activity was recorded in area TE of three monkeys while face images with different expressions, identities, and surface qualities were presented. The surface qualities included gloss modulations - high-gloss and low-gloss, and “style-transfer” where facial texture was replaced with fabric. These representations were compared to those in several models, including Convolutional Neural Networks and Vision Transformer. Our results revealed that the style-transferred face images strongly modulated activity in TE neurons and that some neurons were tuned to monkey facial expressions, whereas others were more influenced by surface quality. In contrast, the models showed relatively large contributions of surface-quality representation, particularly to the separation between the original and style-transferred faces, compared with those of facial expression and identity. This trend was observed even in models trained on the stylized ImageNet dataset, which was designed to reduce reliance on texture-based classification. These results suggest a strong influence of image style transfer on both TE neurons and models, the diversity of the facial representations by TE neurons, and the tendency of models to emphasize the style-transferred images regardless of training. These findings highlight a potential limitation in current artificial vision models and underscore the value of examining biological representations to inspire more robust and adaptable visual recognition in future model designs.

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 1 match between paragraphs and lines of code.

rgeirhos/Stylized-ImageNet

License: MIT
State: the link answers, verified on 26 September 2026
Evidence: files inventoried
Commit: 654e1324c455fbfb15ffec185a9c2543bf773b93, 11 June 2026
Languages: Python (10), Shell (2)
Size: 18 files, 12 scripts
Software Heritage: not archived
Found in: the end of the paper
Holds: README, license file, environment (requirements.txt)
Not found: CITATION.cff, tests, continuous integration, documentation
Tools: PyTorch (7 files), Pillow (4 files), NumPy (3 files)
Availability: 1 check, the latest on 26 September 2026: the link answers
  • 26 September 2026: the link answers
14 files

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;
  • 12 scripts, each with its path and the digest of its content;
  • 1 match 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

No dataset and no data link were found in the paper.

Data availability statement

The raw data supporting the conclusions of this article will be made available by the authors, without undue reservation.

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 1, 27 September 2026: the first record

Recorded: type, language, journal, volume, pages, dates, 16 authors, 5 keywords, 10 MeSH terms, 1 funder, 36 references.

Cite

This paper

Shioya, K., Hayashi, K., Li, B., Matsumoto, N., Matsuda, K., Miura, K., Eldridge, M. A. G., Saunders, R. C., Richmond, B. J., Nagai, Y., Miyakawa, N., Minamimoto, T., Katakami, S., Okada, M., Kawano, K., & Sugase-Miyamoto, Y. (2026). Representations of facial features and surface quality in monkey area TE compared to neural network models. Frontiers in neural circuits, 20, 1783892. https://doi.org/10.3389/fncir.2026.1783892

BibTeX

@article{shioya2026representations,
author = {Shioya, Keisuke and Hayashi, Kazuko and Li, Bing and Matsumoto, Narihisa and Matsuda, Keiji and Miura, Kenichiro and Eldridge, Mark A. G. and Saunders, Richard C. and Richmond, Barry J. and Nagai, Yuji and Miyakawa, Naohisa and Minamimoto, Takafumi and Katakami, Shun and Okada, Masato and Kawano, Kenji and Sugase-Miyamoto, Yasuko},
title = {{Representations of facial features and surface quality in monkey area TE compared to neural network models}},
journal = {Frontiers in neural circuits},
year = {2026},
month = aug,
volume = {20},
pages = {1783892},
publisher = {Frontiers Media SA},
issn = {1662-5110},
doi = {10.3389/fncir.2026.1783892},
url = {https://doi.org/10.3389/fncir.2026.1783892},
pmid = {42609469},
pmcid = {PMC13478094}
}

RIS

TY - JOUR
AU - Shioya, Keisuke
AU - Hayashi, Kazuko
AU - Li, Bing
AU - Matsumoto, Narihisa
AU - Matsuda, Keiji
AU - Miura, Kenichiro
AU - Eldridge, Mark A. G.
AU - Saunders, Richard C.
AU - Richmond, Barry J.
AU - Nagai, Yuji
AU - Miyakawa, Naohisa
AU - Minamimoto, Takafumi
AU - Katakami, Shun
AU - Okada, Masato
AU - Kawano, Kenji
AU - Sugase-Miyamoto, Yasuko
TI - Representations of facial features and surface quality in monkey area TE compared to neural network models
T2 - Frontiers in neural circuits
J2 - Front Neural Circuits
PY - 2026
DA - 2026/08/03
VL - 20
SP - 1783892
SN - 1662-5110
PB - Frontiers Media SA
DO - 10.3389/fncir.2026.1783892
UR - https://doi.org/10.3389/fncir.2026.1783892
LA - en
ER -

CSL-JSON

{
"id": "10.3389/fncir.2026.1783892",
"type": "article-journal",
"title": "Representations of facial features and surface quality in monkey area TE compared to neural network models",
"container-title": "Frontiers in neural circuits",
"author": [
{
"family": "Shioya",
"given": "Keisuke"
},
{
"family": "Hayashi",
"given": "Kazuko"
},
{
"family": "Li",
"given": "Bing"
},
{
"family": "Matsumoto",
"given": "Narihisa"
},
{
"family": "Matsuda",
"given": "Keiji"
},
{
"family": "Miura",
"given": "Kenichiro"
},
{
"family": "Eldridge",
"given": "Mark A. G."
},
{
"family": "Saunders",
"given": "Richard C."
},
{
"family": "Richmond",
"given": "Barry J."
},
{
"family": "Nagai",
"given": "Yuji"
},
{
"family": "Miyakawa",
"given": "Naohisa"
},
{
"family": "Minamimoto",
"given": "Takafumi"
},
{
"family": "Katakami",
"given": "Shun"
},
{
"family": "Okada",
"given": "Masato"
},
{
"family": "Kawano",
"given": "Kenji"
},
{
"family": "Sugase-Miyamoto",
"given": "Yasuko"
}
],
"container-title-short": "Front Neural Circuits",
"volume": "20",
"page": "1783892",
"DOI": "10.3389/fncir.2026.1783892",
"PMID": "42609469",
"PMCID": "PMC13478094",
"ISSN": "1662-5110",
"publisher": "Frontiers Media SA",
"URL": "https://doi.org/10.3389/fncir.2026.1783892",
"language": "en",
"issued": {
"date-parts": [
[
2026,
8,
3
]
]
}
}

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.1038/s41467-026-76106-1 [code]
Facial expression discrimination emerges from partially overlapping neural subspaces of detection and identity.
Journal: Nature communications
In common: NumPy, non-human primate, 7 references
[2] doi:10.1038/s41467-026-74816-0 [code]
Hierarchical optimization predicts plasticity in the macaque inferior temporal cortex following object training.
Journal: Nature communications
In common: PyTorch, NumPy, non-human primate, 5 references
[3] doi:10.1038/s41598-026-53152-9 [code]
Layer-specific feature preference in a trained AlexNet model revealed by stylized image analysis.
Journal: Scientific reports
In common: Pillow, PyTorch, NumPy, 4 references
[4] doi:10.1016/j.isci.2026.116780
The representational geometry of naturalistic textures in macaque V1 and V2.
Journal: iScience
In common: non-human primate, 4 references
[5] 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, PyTorch, NumPy, 2 references
[6] doi:10.1371/journal.pcbi.1013138 [code]
Hierarchical recurrent temporal prediction as a model of the mammalian dorsal visual pathway.
Journal: PLoS computational biology
In common: PyTorch, NumPy, computational modeling (no new data), 2 references
[7] doi:10.1371/journal.pcbi.1014653 [code]
Noisy models of the ventral stream reveal the impact of recurrence and learned representations on information processing timescales.
Journal: PLoS computational biology
In common: Pillow, PyTorch, NumPy, computational modeling (no new data), 1 reference
[8] doi:10.1371/journal.pcbi.1014435 [code]
Predictive coding explains asymmetric connectivity in the brain: A neural network study.
Journal: PLoS computational biology
In common: Pillow, PyTorch, NumPy, computational modeling (no new data), 1 reference
[9] doi:10.1167/jov.26.8.1 [code]
MAME: Multidimensional adaptive metamer exploration with human perceptual feedback.
Journal: Journal of vision
In common: Pillow, PyTorch, NumPy, 1 reference
[10] doi:10.1038/s41467-026-74818-y [code]
Stable readout of visual representations mediates flexible generalization.
Journal: Nature communications
In common: NumPy, non-human primate, 2 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.