Representations of facial features and surface quality in monkey area TE compared to neural network models.
The 1 match
- [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
- import sys
- import argparse
- import os
- import shutil
- import time
- import numpy as np
- import sys
- import torch
- import torch.nn as nn
- import torch.nn.parallel
- import torch.backends.cudnn as cudnn
- import torch.distributed as dist
- import torch.optim
- import torch.utils.data
- import torch.utils.data.distributed
- import torchvision.transforms as transforms
- import torchvision.datasets as datasets
- import torchvision.models as models
- from torchvision.utils import save_image, make_grid
- from tensorboardX import SummaryWriter
- from PIL import Image
- import general as g
- import adain
- #####################################################################
- # purpuse of this file:
- # preprocess complete ImageNet (train + val) with AdaIN style
- # transfer to speed-up later training.
- #####################################################################
- parser = argparse.ArgumentParser(description='Preprocess ImageNet to create Stylized-ImageNet')
- parser.add_argument('--workers', default=4, type=int, metavar='N',
- help='number of data loading workers (default: 4)')
- parser.add_argument('--batch-size', default=256, type=int,
- metavar='N', help='mini-batch size (default: 256)')
- parser.add_argument('--print-freq', '-p', default=1, type=int,
- metavar='N', help='print frequency (default: 10)')
- def main():
- global args
- args = parser.parse_args()
- # Data loading code
- traindir = os.path.join(g.IMAGENET_PATH, 'train')
- valdir = os.path.join(g.IMAGENET_PATH, 'val')
- #############################################################
- # START STYLE TRANSFER SETUP
- #############################################################
- style_dir = g.ADAIN_PREPROCESSED_PAINTINGS_DIR
- assert len(os.listdir(style_dir)) == 79395
- do_style_preprocessing = False
- num_styles = len(os.listdir(style_dir))
- print("=> Using "+str(num_styles)+" different style images.")
- all_styles = [[] for _ in range(num_styles)]
- for i, name in enumerate(sorted(os.listdir(style_dir))):
- all_styles[i] = os.path.join(style_dir, name)
- transfer_args = g.get_default_adain_args()
- transferer = adain.AdaIN(transfer_args)
- print("=> Succesfully loaded style transfer algorithm.")
- style_loader = adain.StyleLoader(style_transferer = transferer,
- style_img_file_list = all_styles,
- rng = np.random.RandomState(seed=49809),
- do_preprocessing = do_style_preprocessing)
- style_transfer = style_loader.get_style_tensor_function
- print("=> Succesfully created style loader.")
- #############################################################
- # CREATING DATA LOADERS
- #############################################################
- class MyDataLoader():
- """Convenient data loading class."""
- def __init__(self, root,
- transform = transforms.ToTensor(),
- target_transform = None,
- batch_size = args.batch_size,
- num_workers = args.workers,
- shuffle = False,
- sampler = None):
- self.dataset = datasets.ImageFolder(root = root,
- transform = transform,
- target_transform = target_transform)
- self.loader = torch.utils.data.DataLoader(
- dataset = self.dataset,
- batch_size = batch_size,
- shuffle = shuffle,
- sampler = sampler,
- num_workers = num_workers,
- pin_memory = True)
- default_transforms = transforms.Compose([
- transforms.Resize(256),
- transforms.CenterCrop(g.IMG_SIZE),
- transforms.ToTensor()])
- val_loader = MyDataLoader(root = valdir,
- transform = default_transforms,
- shuffle = False,
- sampler = None)
- train_loader = MyDataLoader(root = traindir,
- transform = default_transforms,
- shuffle = False,
- sampler = None)
- print("=> Succesfully created all data loaders.")
- print("")
- #############################################################
- # PREPROCESS DATASETS
- #############################################################
- print("Preprocessing validation data:")
- preprocess(data_loader = val_loader,
- input_transforms = [style_transfer],
- sourcedir = valdir,
- targetdir = os.path.join(g.STYLIZED_IMAGENET_PATH, "val/"))
- print("Preprocessing training data:")
- preprocess(data_loader = train_loader,
- input_transforms = [style_transfer],
- sourcedir = traindir,
- targetdir = os.path.join(g.STYLIZED_IMAGENET_PATH, "train/"))
- def preprocess(data_loader, sourcedir, targetdir,
- input_transforms = None):
- """Preprocess ImageNet with certain transformations.
- Keyword arguments:
- sourcedir -- a directory path, e.g. /bla/imagenet/train/
- where subdirectories correspond to single classes
- (need to be filled with .JPEG images)
- targetdir -- a directory path, e.g. /bla/imagenet-new/train/
- where sourcedir will be mirrored, except
- that images will be preprocessed and saved
- as .png instead of .JPEG
- input_transforms -- a list of transformations that will
- be applied (e.g. style transfer)
- """
- counter = 0
- current_class = None
- current_class_files = None
- # create list of all classes
- all_classes = sorted(os.listdir(sourcedir))
- for i, (input, target) in enumerate(data_loader.loader):
- # apply manipulations
- for transform in input_transforms:
- input = transform(input)
- for img_index in range(input.size()[0]):
- # for each image in a batch:
- # - determine ground truth class
- # - transform image
- # - save transformed image in new directory
- # with the same class name
- # the mapping between old and new filenames
- # is achieved by looking at the indices of
- # the sorted(os.listdir()) results.
- source_class = all_classes[target[img_index]]
- source_classdir = os.path.join(sourcedir, source_class)
- assert os.path.exists(source_classdir)
- target_classdir = os.path.join(targetdir, source_class)
- if not os.path.exists(target_classdir):
- os.makedirs(target_classdir)
- if source_class != current_class:
- # moving on to new class:
- # start counter (=index) by 0, update list of files
- # for this new class
- counter = 0
- current_class_files = sorted(os.listdir(source_classdir))
- current_class = source_class
- target_img_path = os.path.join(target_classdir,
- current_class_files[counter].replace(".JPEG", ".png"))
- save_image(tensor = input[img_index,:,:,:],
- filename = target_img_path)
- counter += 1
- if i % args.print_freq == 0:
- print('Progress: [{0}/{1}]\t'
- .format(
- i, len(data_loader.loader)))
- if __name__ == '__main__':
- main()
preprocess_imagenet.py at commit 654e132, under MIT · at the source
Overview
- Graduate School of Frontier Sciences, The University of Tokyo, Kashiwa-shi, Japan
- National Institute of Advanced Industrial Science and Technology, Tsukuba-shi, Japan
- Research Fellowship for Young Scientists, Japan Society for the Promotion of Science, Chiyoda-ku, Japan
- Section on Neural Coding and Computation, National Institute of Mental Health, National Institute of Health, Bethesda, MD, United States
- Institute for the Advanced Study of Human Biology, Kyoto University, Kyoto-shi, Japan
- Biosciences Institute, Newcastle University, Newcastle upon Tyne, United Kingdom
- Advanced Neuroimaging Center, National Institutes for Quantum Science and Technology, Chiba-shi, Japan
- Department of Physiology, Dokkyo Medical University School of Medicine, Mibu, Japan
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
654e1324c455fbfb15ffec185a9c2543bf773b93, 11 June 2026Availability: 1 check, the latest on 26 September 2026: the link answers
- 26 September 2026: the link answers
14 files
- code/
__init__.py — Python, 1 line - code/
adain.py — Python, 254 lines - code/
create_stylized_imagenet — Shell, 14 lines.sh - code/
function.py — Python, 67 lines - code/
general.py — Python, 76 lines - code/
models/ — Shell, 12 linesdownload_models.sh - code/
net.py — Python, 145 lines - code/
preprocess_imagenet.py — Python, 211 lines, 1 match - code/
preprocess_style_imgs.py — Python, 77 lines - code/
sampler.py — Python, 26 lines - code/
torch_to_pytorch.py — Python, 321 lines - code/
train.py — Python, 141 lines - LICENSE — License, 21 lines
- README.md — Text, 53 lines
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://
BibTeX
@article{shioya2026repre
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/
url = {https://
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/
VL - 20
SP - 1783892
SN - 1662-5110
PB - Frontiers Media SA
DO - 10.3389/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.3389/
"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":
"volume": "20",
"page": "1783892",
"DOI": "10.3389/
"PMID": "42609469",
"PMCID": "PMC13478094",
"ISSN": "1662-5110",
"publisher": "Frontiers Media SA",
"URL": "https://
"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 communicationsIn 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 communicationsIn 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 reportsIn 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: iScienceIn 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 biologyIn 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 biologyIn 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 biologyIn 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 biologyIn 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 visionIn 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 communicationsIn 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.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 12 scripts, and 1 match between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:ee17157fa060cc5b…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
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.
