OSCR

Sparseness facilitates image encoding across visuo-frontal networks in freely moving macaque.

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] § 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

  1. """
  2. Convolutional Autoencoder Training Script
  3. -----------------------------------------
  4. This script trains a deep convolutional autoencoder on PNG images.
  5. Steps:
  6. 1. Load and preprocess image datasets for training and testing.
  7. 2. Build a convolutional autoencoder using TensorFlow Keras.
  8. 3. Train the model using mean squared error loss.
  9. 4. Save the trained model and training history for later analysis.
  10. """
  11. # ==============================
  12. # Imports
  13. # ==============================
  14. import tensorflow as tf
  15. from tensorflow.keras.optimizers import SGD, RMSprop
  16. from sklearn.neighbors import KDTree
  17. from sklearn.decomposition import PCA
  18. import numpy as np
  19. import matplotlib as mpl
  20. import copy
  21. import glob
  22. import math
  23. import os
  24. from PIL import Image
  25. from pathlib import Path
  26. from mpl_toolkits.mplot3d import Axes3D
  27. import matplotlib.patches as mpatches
  28. import scipy.io as sio
  29. # ==============================
  30. # Configuration
  31. # ==============================
  32. sid = 'session1' # Session or experiment identifier
  33. # ==============================
  34. # Load image file paths
  35. # ==============================
  36. train_path = './training/'
  37. test_path = './testing/'
  38. # Collect all PNG files from the training and testing directories
  39. train_list = [file for file in Path(train_path).glob('*.png')]
  40. test_list = [file for file in Path(test_path).glob('*.png')]
  41. # ==============================
  42. # Load and preprocess image data
  43. # ==============================
  44. # Convert images to numpy arrays and normalize pixel values to [0, 1]
  45. train_data = np.array([np.array(Image.open(fname)) for fname in train_list]) / 255.0
  46. test_data = np.array([np.array(Image.open(fname)) for fname in test_list]) / 255.0
  47. # Reshape to include channel dimension (for grayscale)
  48. train_data = train_data.reshape(train_data.shape[0], train_data.shape[1], train_data.shape[2], 1)
  49. test_data = test_data.reshape(test_data.shape[0], test_data.shape[1], test_data.shape[2], 1)
  50. # ==============================
  51. # Define Autoencoder Model
  52. # ==============================
  53. """
  54. Architecture Overview:
  55. Encoder:
  56. - Sequential blocks of Conv2D and MaxPooling2D layers to downsample features.
  57. Bottleneck:
  58. - Dense layers to form a compact encoded representation (128-D vector).
  59. Decoder:
  60. - Mirror of the encoder using UpSampling2D and Conv2D layers to reconstruct images.
  61. """
  62. model = tf.keras.models.Sequential([
  63. # --- Encoder ---
  64. tf.keras.layers.Conv2D(8, (3, 3), activation='relu', padding='same',
  65. kernel_initializer='he_normal', input_shape=(256, 256, 1)),
  66. tf.keras.layers.Conv2D(8, (3, 3), activation='relu', padding='same', kernel_initializer='he_normal'),
  67. tf.keras.layers.MaxPooling2D(pool_size=(2, 2), padding='same'), # 256 -> 128
  68. tf.keras.layers.Conv2D(16, (3, 3), activation='relu', padding='same', kernel_initializer='he_normal'),
  69. tf.keras.layers.Conv2D(16, (3, 3), activation='relu', padding='same', kernel_initializer='he_normal'),
  70. tf.keras.layers.MaxPooling2D(pool_size=(2, 2), padding='same'), # 128 -> 64
  71. tf.keras.layers.Conv2D(32, (3, 3), activation='relu', padding='same', kernel_initializer='he_normal'),
  72. tf.keras.layers.Conv2D(32, (3, 3), activation='relu', padding='same', kernel_initializer='he_normal'),
  73. tf.keras.layers.MaxPooling2D(pool_size=(2, 2), padding='same'), # 64 -> 32
  74. tf.keras.layers.Conv2D(64, (3, 3), activation='relu', padding='same', kernel_initializer='he_normal'),
  75. tf.keras.layers.Conv2D(64, (3, 3), activation='relu', padding='same', kernel_initializer='he_normal'),
  76. tf.keras.layers.MaxPooling2D(pool_size=(2, 2), padding='same'), # 32 -> 16
  77. tf.keras.layers.Conv2D(64, (3, 3), activation='relu', padding='same', kernel_initializer='he_normal'),
  78. tf.keras.layers.Conv2D(64, (3, 3), activation='relu', padding='same', kernel_initializer='he_normal'),
  79. tf.keras.layers.MaxPooling2D(pool_size=(2, 2), padding='same'), # 16 -> 8
  80. tf.keras.layers.Conv2D(8, (3, 3), activation='relu', padding='same', kernel_initializer='he_normal'),
  81. # --- Bottleneck (Dense encoded vector) ---
  82. tf.keras.layers.Flatten(),
  83. tf.keras.layers.Dense(512, activation='relu', kernel_initializer='he_normal'),
  84. tf.keras.layers.Dense(128, activation='relu', kernel_initializer='he_normal', name='encoded_vector'),
  85. tf.keras.layers.Dense(512, activation='relu', kernel_initializer='he_normal'),
  86. tf.keras.layers.Reshape((8, 8, 8)), # Restore spatial dimensions
  87. # --- Decoder (mirror of encoder) ---
  88. tf.keras.layers.Conv2D(8, (3, 3), activation='relu', padding='same', kernel_initializer='he_normal'),
  89. tf.keras.layers.UpSampling2D(size=(2, 2)), # 8 -> 16
  90. tf.keras.layers.Conv2D(64, (3, 3), activation='relu', padding='same', kernel_initializer='he_normal'),
  91. tf.keras.layers.Conv2D(64, (3, 3), activation='relu', padding='same', kernel_initializer='he_normal'),
  92. tf.keras.layers.UpSampling2D(size=(2, 2)), # 16 -> 32
  93. tf.keras.layers.Conv2D(64, (3, 3), activation='relu', padding='same', kernel_initializer='he_normal'),
  94. tf.keras.layers.Conv2D(64, (3, 3), activation='relu', padding='same', kernel_initializer='he_normal'),
  95. tf.keras.layers.UpSampling2D(size=(2, 2)), # 32 -> 64
  96. tf.keras.layers.Conv2D(32, (3, 3), activation='relu', padding='same', kernel_initializer='he_normal'),
  97. tf.keras.layers.Conv2D(32, (3, 3), activation='relu', padding='same', kernel_initializer='he_normal'),
  98. tf.keras.layers.UpSampling2D(size=(2, 2)), # 64 -> 128
  99. tf.keras.layers.Conv2D(16, (3, 3), activation='relu', padding='same', kernel_initializer='he_normal'),
  100. tf.keras.layers.Conv2D(16, (3, 3), activation='relu', padding='same', kernel_initializer='he_normal'),
  101. tf.keras.layers.UpSampling2D(size=(2, 2)), # 128 -> 256
  102. tf.keras.layers.Conv2D(8, (3, 3), activation='relu', padding='same', kernel_initializer='he_normal'),
  103. tf.keras.layers.Conv2D(8, (3, 3), activation='relu', padding='same', kernel_initializer='he_normal'),
  104. # Final reconstruction layer (grayscale output)
  105. tf.keras.layers.Conv2D(1, (3, 3), activation='sigmoid', padding='same', kernel_initializer='he_normal')
  106. ])
  107. # ==============================
  108. # Compile Model
  109. # ==============================
  110. model.compile(
  111. optimizer='adam',
  112. loss='mean_squared_error',
  113. metrics=['mean_squared_error']
  114. )
  115. # Display model architecture summary
  116. model.summary()
  117. # ==============================
  118. # Train Model
  119. # ==============================
  120. history = model.fit(
  121. train_data, train_data, # Autoencoder: input = target
  122. epochs=300,
  123. batch_size=64,
  124. shuffle=True,
  125. verbose=1,
  126. validation_data=(test_data, test_data)
  127. )
  128. # ==============================
  129. # Save Model and Training History
  130. # ==============================
  131. model_filename = f'frame_encoder_{sid}_128_arch7b'
  132. history_filename = f'./training_history_{sid}_arch7b.mat'
  133. # Save model to disk
  134. model.save(model_filename)
  135. print(f"Model saved as {model_filename}")
  136. # Save training loss history as MATLAB .mat file
  137. loss = history.history['loss']
  138. val_loss = history.history['val_loss']
  139. sio.savemat(history_filename, dict(loss=loss, val_loss=val_loss))
  140. print(f"Training history saved as {history_filename}")

create_cae_model.py, under CC-BY-4.0 · at the source

Overview

  1. Department of Neurobiology and Anatomy, McGovern Medical School, University of Texas – Houston, Houston, TX USA
  2. Houston Methodist Research Institute, Houston, TX USA
  3. Rice Neuroengineering Initiative, Rice University, Houston, TX USA
  4. Brain and Mind Research Institute, Weill Cornell Medical College, Cornell University, New York, NY USA
Institutions: Houston Methodist (United States); Cornell University (United States); Weill Cornell Medicine (United States); Rice University (United States)
Journal: Nature communications, volume 17, issue 1, article 5176
Dates: received 18 October 2024; accepted 9 March 2026; published online 14 April 2026
Type: Research article · Language: English
License: CC BY-NC-ND
Identifiers: DOI 10.1038/s41467-026-71051-5 · PMID 41980952 · PMCID PMC13253833 · OpenAlex W7154247971
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: behavior only (modality), non-human primate (organism), systems (subfield)
Methods: Smoothing, state filtering, decompositions, Machine learning, Single-unit activity, calcium imaging, Physiology & signal measures
Keywords: Visual system, Neural circuits
MeSH: Prefrontal Cortex*, Visual Cortex*, Visual Perception*, Action Potentials, Animals, Autoencoder, Eye Movements, Macaca mulatta, Male, Nerve Net, Neurons, Photic Stimulation, Wakefulness (* major topic)
Topic: Visual perception and processing mechanisms (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Citations: not cited yet (Europe PMC); 43 references in the paper

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

License: CC-BY-4.0
State: the link answers, verified on 29 September 2026
Evidence: files inventoried
Languages: Python (2), MATLAB (2)
Size: 5 files, 4 scripts
Software Heritage: not checked
Found in: “Code availability”
Holds: README
Not found: license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: NumPy (2 files), Pillow (2 files), TensorFlow (2 files), Keras (1 file), Matplotlib (1 file), scikit-learn (1 file), SciPy (1 file)
Availability: 1 check, the latest on 29 September 2026: the link answers (HTTP 200)
  • 29 September 2026: the link answers (HTTP 200)
4 files

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:

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

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://doi.org/10.1038/s41467-026-71051-5

BibTeX

@article{parajuli2026sparseness,
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/s41467-026-71051-5},
url = {https://doi.org/10.1038/s41467-026-71051-5},
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/04/14
VL - 17
IS - 1
SP - 5176
SN - 2041-1723
PB - Nature Publishing Group
DO - 10.1038/s41467-026-71051-5
UR - https://doi.org/10.1038/s41467-026-71051-5
LA - en
ER -

CSL-JSON

{
"id": "10.1038/s41467-026-71051-5",
"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": "Nat Commun",
"volume": "17",
"issue": "1",
"page": "5176",
"DOI": "10.1038/s41467-026-71051-5",
"PMID": "41980952",
"PMCID": "PMC13253833",
"ISSN": "2041-1723",
"publisher": "Nature Publishing Group",
"URL": "https://doi.org/10.1038/s41467-026-71051-5",
"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 one
In 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: Nature
In 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 neuroscience
In 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 communications
In 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 biology
In 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 communications
In 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: eLife
In 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 control
Journal: eLife
In 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 biology
In 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 advances
In 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.

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.