Sparseness facilitates image encoding across visuo-frontal networks in freely moving macaque.
One block of code here has a permanent identifier (oscr:b:…), listed with the matches below: citable for good, with a page of its own. Select a match and press Cite to copy it. What a block identifier is.
The 1 match
- [1] § Methods › Autoencoder ↔ create_cae_model.py, lines 64 to 134 · score 0.57 · encoded representation, compact, reconstruct, bottleneck, layer, Encoder · block
oscr:b:5JAFVN4K2F087-1· Report a mismatch
Paper
Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
Python · 174 lines · 7.2 KB · CC-BY-4.0 · 1 match
- """
- Convolutional Autoencoder Training Script
- -----------------------------------------
- This script trains a deep convolutional autoencoder on PNG images.
- Steps:
- 1. Load and preprocess image datasets for training and testing.
- 2. Build a convolutional autoencoder using TensorFlow Keras.
- 3. Train the model using mean squared error loss.
- 4. Save the trained model and training history for later analysis.
- """
- # ==============================
- # Imports
- # ==============================
- import tensorflow as tf
- from tensorflow.keras.optimizers import SGD, RMSprop
- from sklearn.neighbors import KDTree
- from sklearn.decomposition import PCA
- import numpy as np
- import matplotlib as mpl
- import copy
- import glob
- import math
- import os
- from PIL import Image
- from pathlib import Path
- from mpl_toolkits.mplot3d import Axes3D
- import matplotlib.patches as mpatches
- import scipy.io as sio
- # ==============================
- # Configuration
- # ==============================
- sid = 'session1' # Session or experiment identifier
- # ==============================
- # Load image file paths
- # ==============================
- train_path = './training/'
- test_path = './testing/'
- # Collect all PNG files from the training and testing directories
- train_list = [file for file in Path(train_path).glob('*.png')]
- test_list = [file for file in Path(test_path).glob('*.png')]
- # ==============================
- # Load and preprocess image data
- # ==============================
- # Convert images to numpy arrays and normalize pixel values to [0, 1]
- train_data = np.array([np.array(Image.open(fname)) for fname in train_list]) / 255.0
- test_data = np.array([np.array(Image.open(fname)) for fname in test_list]) / 255.0
- # Reshape to include channel dimension (for grayscale)
- train_data = train_data.reshape(train_data.shape[0], train_data.shape[1], train_data.shape[2], 1)
- test_data = test_data.reshape(test_data.shape[0], test_data.shape[1], test_data.shape[2], 1)
- # ==============================
- # Define Autoencoder Model
- # ==============================
- """
- Architecture Overview:
- Encoder:
- - Sequential blocks of Conv2D and MaxPooling2D layers to downsample features.
- Bottleneck:
- - Dense layers to form a compact encoded representation (128-D vector).
- Decoder:
- - Mirror of the encoder using UpSampling2D and Conv2D layers to reconstruct images.
- """
- model = tf.keras.models.Sequential([
- # --- Encoder ---
- tf.keras.layers.Conv2D(8, (3, 3), activation='relu', padding='same',
- kernel_initializer='he_normal', input_shape=(256, 256, 1)),
- tf.keras.layers.Conv2D(8, (3, 3), activation='relu', padding='same', kernel_initializer='he_normal'),
- tf.keras.layers.MaxPooling2D(pool_size=(2, 2), padding='same'), # 256 -> 128
- tf.keras.layers.Conv2D(16, (3, 3), activation='relu', padding='same', kernel_initializer='he_normal'),
- tf.keras.layers.Conv2D(16, (3, 3), activation='relu', padding='same', kernel_initializer='he_normal'),
- tf.keras.layers.MaxPooling2D(pool_size=(2, 2), padding='same'), # 128 -> 64
- tf.keras.layers.Conv2D(32, (3, 3), activation='relu', padding='same', kernel_initializer='he_normal'),
- tf.keras.layers.Conv2D(32, (3, 3), activation='relu', padding='same', kernel_initializer='he_normal'),
- tf.keras.layers.MaxPooling2D(pool_size=(2, 2), padding='same'), # 64 -> 32
- tf.keras.layers.Conv2D(64, (3, 3), activation='relu', padding='same', kernel_initializer='he_normal'),
- tf.keras.layers.Conv2D(64, (3, 3), activation='relu', padding='same', kernel_initializer='he_normal'),
- tf.keras.layers.MaxPooling2D(pool_size=(2, 2), padding='same'), # 32 -> 16
- tf.keras.layers.Conv2D(64, (3, 3), activation='relu', padding='same', kernel_initializer='he_normal'),
- tf.keras.layers.Conv2D(64, (3, 3), activation='relu', padding='same', kernel_initializer='he_normal'),
- tf.keras.layers.MaxPooling2D(pool_size=(2, 2), padding='same'), # 16 -> 8
- tf.keras.layers.Conv2D(8, (3, 3), activation='relu', padding='same', kernel_initializer='he_normal'),
- # --- Bottleneck (Dense encoded vector) ---
- tf.keras.layers.Flatten(),
- tf.keras.layers.Dense(512, activation='relu', kernel_initializer='he_normal'),
- tf.keras.layers.Dense(128, activation='relu', kernel_initializer='he_normal', name='encoded_vector'),
- tf.keras.layers.Dense(512, activation='relu', kernel_initializer='he_normal'),
- tf.keras.layers.Reshape((8, 8, 8)), # Restore spatial dimensions
- # --- Decoder (mirror of encoder) ---
- tf.keras.layers.Conv2D(8, (3, 3), activation='relu', padding='same', kernel_initializer='he_normal'),
- tf.keras.layers.UpSampling2D(size=(2, 2)), # 8 -> 16
- tf.keras.layers.Conv2D(64, (3, 3), activation='relu', padding='same', kernel_initializer='he_normal'),
- tf.keras.layers.Conv2D(64, (3, 3), activation='relu', padding='same', kernel_initializer='he_normal'),
- tf.keras.layers.UpSampling2D(size=(2, 2)), # 16 -> 32
- tf.keras.layers.Conv2D(64, (3, 3), activation='relu', padding='same', kernel_initializer='he_normal'),
- tf.keras.layers.Conv2D(64, (3, 3), activation='relu', padding='same', kernel_initializer='he_normal'),
- tf.keras.layers.UpSampling2D(size=(2, 2)), # 32 -> 64
- tf.keras.layers.Conv2D(32, (3, 3), activation='relu', padding='same', kernel_initializer='he_normal'),
- tf.keras.layers.Conv2D(32, (3, 3), activation='relu', padding='same', kernel_initializer='he_normal'),
- tf.keras.layers.UpSampling2D(size=(2, 2)), # 64 -> 128
- tf.keras.layers.Conv2D(16, (3, 3), activation='relu', padding='same', kernel_initializer='he_normal'),
- tf.keras.layers.Conv2D(16, (3, 3), activation='relu', padding='same', kernel_initializer='he_normal'),
- tf.keras.layers.UpSampling2D(size=(2, 2)), # 128 -> 256
- tf.keras.layers.Conv2D(8, (3, 3), activation='relu', padding='same', kernel_initializer='he_normal'),
- tf.keras.layers.Conv2D(8, (3, 3), activation='relu', padding='same', kernel_initializer='he_normal'),
- # Final reconstruction layer (grayscale output)
- tf.keras.layers.Conv2D(1, (3, 3), activation='sigmoid', padding='same', kernel_initializer='he_normal')
- ])
- # ==============================
- # Compile Model
- # ==============================
- model.compile(
- optimizer='adam',
- loss='mean_squared_error',
- metrics=['mean_squared_error']
- )
- # Display model architecture summary
- model.summary()
- # ==============================
- # Train Model
- # ==============================
- history = model.fit(
- train_data, train_data, # Autoencoder: input = target
- epochs=300,
- batch_size=64,
- shuffle=True,
- verbose=1,
- validation_data=(test_data, test_data)
- )
- # ==============================
- # Save Model and Training History
- # ==============================
- model_filename = f'frame_encoder_{sid}_128_arch7b'
- history_filename = f'./training_history_{sid}_arch7b.mat'
- # Save model to disk
- model.save(model_filename)
- print(f"Model saved as {model_filename}")
- # Save training loss history as MATLAB .mat file
- loss = history.history['loss']
- val_loss = history.history['val_loss']
- sio.savemat(history_filename, dict(loss=loss, val_loss=val_loss))
- print(f"Training history saved as {history_filename}")
create_cae_model.py, under CC-BY-4.0 · at the source
Overview
- Department of Neurobiology and Anatomy, McGovern Medical School, University of Texas – Houston, Houston, TX USA
- Houston Methodist Research Institute, Houston, TX USA
- Rice Neuroengineering Initiative, Rice University, Houston, TX USA
- Brain and Mind Research Institute, Weill Cornell Medical College, Cornell University, New York, NY USA
Abstract
The abstract is not reproduced here: the paper's license (CC BY-NC-ND) does not allow it. Read it in the paper, at the publisher or on Europe PMC.
Repository
Its files are read in the Code ↔ Paper reader above, with 1 match between paragraphs and lines of code.
Zenodo 17554171
Availability: 1 check, the latest on 29 September 2026: the link answers (HTTP 200)
- 29 September 2026: the link answers (HTTP 200)
4 files
- create_cae_model.py, Python, 174 lines, 1 match
- encode_frame.py, Python, 83 lines
- lft_spness.m, MATLAB, 58 lines
- pop_spness.m, MATLAB, 61 lines
Code availability statement
The paper has a code availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:
- it points to the authors' code: Zenodo 17554171
Read it in the paper: doi.org/10.1038/s41467-026-71051-5.
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;
- 4 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
Datasets cited
- zenodo:18686896, at Zenodo; found in “Data availability”
Data availability statement
The paper has a data availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:
- it points to a dataset: Zenodo 18686896
- it says that the data are available on request
Read it in the paper: doi.org/10.1038/s41467-026-71051-5.
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, 29 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 3 authors, 2 keywords, 13 MeSH terms, 1 funder, 33 references.
Cite
This paper
Parajuli, A., Franch, M., & Dragoi, V. (2026). Sparseness facilitates image encoding across visuo-frontal networks in freely moving macaque. Nature communications, 17(1), 5176. https://
BibTeX
@article{parajuli2026spa
author = {Parajuli, Arun and Franch, Melissa and Dragoi, Valentin},
title = {{Sparseness facilitates image encoding across visuo-frontal networks in freely moving macaque}},
journal = {Nature communications},
year = {2026},
month = apr,
volume = {17},
number = {1},
pages = {5176},
publisher = {Nature Publishing Group},
issn = {2041-1723},
doi = {10.1038/
url = {https://
pmid = {41980952},
pmcid = {PMC13253833}
}
RIS
TY - JOUR
AU - Parajuli, Arun
AU - Franch, Melissa
AU - Dragoi, Valentin
TI - Sparseness facilitates image encoding across visuo-frontal networks in freely moving macaque
T2 - Nature communications
J2 - Nat Commun
PY - 2026
DA - 2026/
VL - 17
IS - 1
SP - 5176
SN - 2041-1723
PB - Nature Publishing Group
DO - 10.1038/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1038/
"type": "article-journal",
"title": "Sparseness facilitates image encoding across visuo-frontal networks in freely moving macaque",
"container-title": "Nature communications",
"author": [
{
"family": "Parajuli",
"given": "Arun"
},
{
"family": "Franch",
"given": "Melissa"
},
{
"family": "Dragoi",
"given": "Valentin"
}
],
"container-title-short":
"volume": "17",
"issue": "1",
"page": "5176",
"DOI": "10.1038/
"PMID": "41980952",
"PMCID": "PMC13253833",
"ISSN": "2041-1723",
"publisher": "Nature Publishing Group",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
4,
14
]
]
}
}
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/s41586-024-07084-x
- Visuo-frontal interactions during social learning in freely moving macaques.Journal: NatureIn common: non-human primate, 9 references, 2 authors
- [2] doi:10.1038/s41593-024-01575-w [code]
- Population coding of strategic variables during foraging in freely moving macaques.Journal: Nature neuroscienceIn common: non-human primate, systems, 3 references, author Valentin Dragoi
- [3] doi:
- Dual-feature selectivity enables bidirectional coding in visual cortical neuronsJournal: eLifeIn common: non-human primate, systems, 6 references
- [4] doi:10.7554/elife.109861
- Dual-feature selectivity enables bidirectional coding in visual cortical neurons.Journal: eLifeIn common: non-human primate, systems, 6 references
- [5] doi:10.1038/s41467-023-36583-0 [code]
- Abstract representations emerge naturally in neural networks trained to perform multiple tasks.Journal: Nature communicationsIn common: Keras, TensorFlow, Pillow, 4 other tools, 2 references
- [6] doi:10.1038/s41467-025-60731-3
- Unsupervised learning of temporal regularities in visual cortical populations.Journal: Nature communicationsIn common: non-human primate, systems, 2 references, author Valentin Dragoi
- [7] doi:10.1016/j.neuron.2025.11.021 [code]
- Spontaneous behavior is a succession of self-directed tasks.Journal: NeuronIn common: TensorFlow, Pillow, scikit-learn, 3 other tools, systems, 2 references
- [8] doi:10.1038/s41586-026-10448-0 [code]
- Plasticity and language in the anaesthetized human hippocampus.Journal: NatureIn common: TensorFlow, SciPy, Matplotlib, 1 other tool, author Melissa Franch
- [9] doi:10.7554/elife.79322 [code]
- Functional interactions among neurons within single columns of macaque V1.Journal: eLifeIn common: scikit-learn, SciPy, Matplotlib, 1 other tool, non-human primate, systems, 3 references
- [10] doi:10.1101/2025.07.16.665209 [code]
- Dual-feature selectivity enables bidirectional coding in visual cortical neuronsJournal: bioRxiv (preprint)In common: Pillow, SciPy, Matplotlib, 1 other tool, systems, 3 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, 4 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:2f2000767bab4271…
Add the badge to the code's README
If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.
Markdown
<!-- oscr-badge:start -->
[](https://openscicode.org/badge/doi/10.1038/s41467-026-71051-5)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.1038/s41467-026-71051-5.svg
:target: https://openscicode.org/badge/doi/10.1038/s41467-026-71051-5
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1038/s41467-026-71051-5"><img src="https://openscicode.org/badge/doi/10.1038/s41467-026-71051-5.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge 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: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.
Report a mismatch between the code and the paper · Report a code error (signed in)
Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.
Report a reproduction failure (signed in)
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
