Sparseness facilitates image encoding across visuo-frontal networks in freely moving macaque.
The 1 match
- [1] § Methods › Autoencoder ↔ create_cae_model.py, lines 64–134 · score 0.57 · encoded representation, compact, reconstruct, bottleneck, layer, Encoder
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 · 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.1371/journal.pone.0356243 [code]
- Functional organization and natural scene responses across mouse visual cortical areas revealed with encoding manifolds.Journal: PloS oneIn common: Keras, TensorFlow, Pillow, 4 other tools, 1 reference
- [2] 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
- [3] doi:10.3389/fnsys.2026.1822122 [code]
- Convergence-divergence circuits for multimodal integration of innate and learned opponent valences.Journal: Frontiers in systems neuroscienceIn common: Keras, TensorFlow, Pillow, 4 other tools, systems
- [4] doi:10.1038/s41467-026-72057-9 [code]
- Sex-specific behavioral feedback modulates sensorimotor processing and drives flexible social behavior.Journal: Nature communicationsIn common: Keras, TensorFlow, Pillow, 4 other tools, systems
- [5] doi:10.1371/journal.pcbi.1014615 [code]
- Toward reliable machine learning models for neural circuit inference: A diagnostic study of CNNs on spike trains.Journal: PLoS computational biologyIn common: Keras, TensorFlow, scikit-learn, 3 other tools, 1 reference
- [6] doi:10.1038/s41467-026-75347-4 [code]
- Sleep reveals dynamics integrating and segregating movement and stimulus representations in V1.Journal: Nature communicationsIn common: Pillow, scikit-learn, SciPy, 2 other tools, systems, 2 references
- [7] doi:10.7554/elife.99278 [code]
- Brain-wide arousal signals are segregated from movement planning in the superior colliculus of the macaque.Journal: eLifeIn common: Keras, TensorFlow, NumPy, behavior only, non-human primate, systems, 1 reference
- [8] doi: [code]
- Real-time closed-loop feedback system for mouse mesoscale cortical signal and movement controlJournal: eLifeIn common: Keras, TensorFlow, Pillow, 4 other tools
- [9] doi:10.1038/s42003-026-10957-8 [code]
- Brain defence by the extracellular matrix protein Cochlin.Journal: Communications biologyIn common: Keras, TensorFlow, Pillow, 4 other tools
- [10] doi:10.1126/sciadv.aee6952 [code]
- Wafer-scale SOT-MRAM for analog crossbar array applications.Journal: Science advancesIn common: Keras, TensorFlow, Pillow, 4 other tools
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:ace4bd5999dfd2e7…
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
[.
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.
