OSCR

Going deeper with morphologically detailed neural networks by simulation-based gradient propagation

Code ↔ Paper

The paper beside its authors' code: matches between them have not been computed for this paper yet.

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 · 75 lines · 2.7 KB · Apache-2.0

  1. import os
  2. import numpy as np
  3. import tensorflow as tf
  4. from resnet20 import make_resnet
  5. import foolbox
  6. dataset = 'mnist'
  7. learning_rate = 0.01
  8. lr_str = '1e-2'
  9. batch_size = 64
  10. epochs = 60
  11. load_trained = False
  12. attack_method = 'fgsm'
  13. base_model = 'res'
  14. def attack_model(model, method, bounds, x_test, y_test, epsilons):
  15. fmodel = foolbox.TensorFlowModel(model, bounds)
  16. clean_acc = foolbox.accuracy(fmodel, x_test, y_test)
  17. print(f"clean acc:{clean_acc:f}")
  18. if method == 'fgsm':
  19. attack = foolbox.attacks.FGSM()
  20. elif method == 'pgd':
  21. attack = foolbox.attacks.PGD()
  22. else:
  23. raise NotImplementedError(f'Unknown attack method: {method}')
  24. raw_advs, clipped_advs, success = attack(fmodel, x_test, y_test, epsilons=epsilons)
  25. robust_acc = 1 - success.numpy().mean(axis=-1)
  26. for eps, acc in zip(epsilons, robust_acc):
  27. print(f"eps:{eps:f} acc:{acc:f}")
  28. return clipped_advs
  29. def prepare_data(dataset):
  30. if dataset == 'mnist':
  31. from tensorflow.keras.datasets import mnist
  32. (x_train, y_train), (x_test, y_test) = mnist.load_data()
  33. x_train = x_train.astype('float32') / 255
  34. y_train = y_train.astype('int32')
  35. x_test = x_test.astype('float32') / 255
  36. y_test = y_test.astype('int32')
  37. x_train = np.expand_dims(x_train, -1)
  38. y_train = y_train.flatten()
  39. x_test = np.expand_dims(x_test, -1)
  40. y_test = y_test.flatten()
  41. else:
  42. raise NotImplementedError(f"Unknown dataset: {dataset}")
  43. return (x_train, y_train), (x_test, y_test)
  44. if __name__ == '__main__':
  45. (x_train, y_train), (x_test, y_test) = prepare_data(dataset)
  46. model = make_resnet(x_train.shape[1:], 10, 3, 1e-5)
  47. # model.summary()
  48. optim = tf.keras.optimizers.SGD(learning_rate, momentum=0.9, nesterov=True)
  49. model.compile(loss=tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True), optimizer=optim, metrics=["acc"])
  50. if not load_trained:
  51. model.fit(x_train, y_train, batch_size=batch_size, epochs=epochs, validation_data=(x_test, y_test))
  52. model.save_weights(f"resnet20_{dataset}_{epochs:d}epochs_sgd{lr_str}.h5")
  53. else:
  54. model.load_weights(f"resnet20_{dataset}_{epochs:d}epochs_sgd{lr_str}.h5")
  55. model.evaluate(x_test, y_test, batch_size=batch_size)
  56. epsilons = [0.02 * (i + 1) for i in range(10)]
  57. adv_img_list = attack_model(model, attack_method, (0, 1), tf.convert_to_tensor(x_test), tf.convert_to_tensor(y_test), epsilons)
  58. if not os.path.isdir(f"./{dataset}"):
  59. os.makedirs(f"./{dataset}")
  60. for adv_img, eps in zip(adv_img_list, epsilons):
  61. save_name = f"./{dataset}/{attack_method}{base_model}{eps:.2f}_test.npz"
  62. np.savez(save_name, x_test=adv_img.numpy(), y_test=y_test)

attack_resnet20.py at commit 8bdab07, under Apache-2.0 · at the source

Overview

Authors: Gan He1, Kai Du1, Tiejun Huang1,2
  1. National Key Laboratory for Multimedia Information Processing, School of Computer Science, Peking University, Beijing, China
  2. Beijing Academy of Artificial Intelligence, Beijing, China
Journal: Frontiers in computational neuroscience, volume 20, article 1904220
Dates: received 9 June 2026; accepted 18 August 2026; published online 10 September 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI · PMCID PMC13601319
Status: code verified (how the code is found and verified)
Categories: computational modeling (no new data) (modality), none (in silico) (organism), computational (subfield)
Methods: Single-unit activity, calcium imaging
Keywords: adversarial robustness, cable theory, dendritic computation, learning rule, multi-compartment model, synaptic plasticity
Citations: not cited yet (Europe PMC); 55 references in the paper

Abstract

Morphologically detailed dendrites possess powerful computational capabilities but are computationally expensive. Therefore, exploring how large-scale, detailed multi-compartment neural networks achieve learning proves challenging, presenting significant obstacles both in learning algorithms and simulation infrastructures. Here, we provide an extension to the DeepDendrite framework to enable the construction and data-driven training of multi-layer, detailed multi-compartment neural networks with highly modularized layer components. The gradient at each layer is computed by simulating gradient-mirror neurons in the feedback pathway simultaneously with the detailed neurons in the feedforward pathway, providing a simulation-based implementation of backpropagation in detailed neural networks. We demonstrate comparable results on classic image classification datasets with fully-connected and convolutional architectures. Furthermore, we analyze transfer attack robustness between artificial neural networks (ANNs), detailed neural networks and single-compartment networks. In conclusion, we provide a useful framework to investigate learning in multi-layer detailed neural networks, potentially offering further insights into exploiting the computational potential of dendrites at a large scale.

Reproduced under the paper's license (CC BY), from the paper cited above.

Repository

Its files are read in the Code ↔ Paper reader above.

MS-GEB/DeepDendrite-modularization

License: Apache-2.0
State: the link answers, verified on 28 September 2026
Evidence: files inventoried
Commit: 8bdab07ff685984ea80a5ca171b60820ccbed4a7, 11 September 2026
Languages: C/C++ (463), C (392), NEURON (345), C++ (297), Python (154), Shell (63), Java (9), Perl (3), CUDA (3)
Size: 3,849 files, 1,729 scripts
Software Heritage: not archived
Found in: “Code availability statement”
Holds: README, license file, environment (src/nrn_modify/src/neuronmusic/setup.py, src/nrn_modify/src/nrnpython/setup.py, src/nrn_modify/share/lib/python/neuron/crxd/geometry3d/setup.py, src/nrn_modify/share/lib/python/neuron/rxd/geometry3d/setup.py), tests, documentation
Not found: CITATION.cff, continuous integration
Tools: NEURON (450 files), NumPy (90 files), Matplotlib (30 files), SciPy (7 files), Keras (2 files), TensorFlow (2 files)
Availability: 1 check, the latest on 28 September 2026: the link answers
  • 28 September 2026: the link answers
1,731 files

Code availability statement

The source code for the modified DeepDendrite and the modularized layer APIs is available at https://github.com/MS-GEB/DeepDendrite-modularization.

Reproduced under the paper's license (CC BY), from the paper cited above.

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;
  • 1,729 scripts, each with its path and the digest of its content;
  • no match between paragraphs and code yet;
  • 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

Publicly available datasets were analyzed in this study. The MNIST dataset used in this study is available at http://yann.lecun.com/exdb/mnist. The CIFAR-10 dataset used in this study is available at https://www.cs.toronto.edu/~kriz/cifar.html. The source code for the modified DeepDendrite and the modularized layer APIs is available at https://github.com/MS-GEB/DeepDendrite-modularization.

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

Recorded: type, language, journal, volume, pages, dates, 3 authors, 6 keywords, 1 funder, 39 references.

Cite

This paper

He, G., Du, K., & Huang, T. (2026). Going deeper with morphologically detailed neural networks by simulation-based gradient propagation. Frontiers in computational neuroscience, 20, 1904220.

BibTeX

@article{he2026going,
author = {He, Gan and Du, Kai and Huang, Tiejun},
title = {{Going deeper with morphologically detailed neural networks by simulation-based gradient propagation}},
journal = {Frontiers in computational neuroscience},
year = {2026},
month = sep,
volume = {20},
pages = {1904220},
publisher = {Frontiers Media SA},
issn = {1662-5188},
pmcid = {PMC13601319}
}

RIS

TY - JOUR
AU - He, Gan
AU - Du, Kai
AU - Huang, Tiejun
TI - Going deeper with morphologically detailed neural networks by simulation-based gradient propagation
T2 - Frontiers in computational neuroscience
J2 - Front Comput Neurosci
PY - 2026
DA - 2026/09/25
VL - 20
SP - 1904220
SN - 1662-5188
PB - Frontiers Media SA
LA - en
ER -

CSL-JSON

{
"id": "pmcid:PMC13601319",
"type": "article-journal",
"title": "Going deeper with morphologically detailed neural networks by simulation-based gradient propagation",
"container-title": "Frontiers in computational neuroscience",
"author": [
{
"family": "He",
"given": "Gan"
},
{
"family": "Du",
"given": "Kai"
},
{
"family": "Huang",
"given": "Tiejun"
}
],
"container-title-short": "Front Comput Neurosci",
"volume": "20",
"page": "1904220",
"PMCID": "PMC13601319",
"ISSN": "1662-5188",
"publisher": "Frontiers Media SA",
"language": "en",
"issued": {
"date-parts": [
[
2026,
9,
25
]
]
}
}

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.7554/elife.79535 [code]
Ultrafast simulation of large-scale neocortical microcircuitry with biophysically realistic neurons.
Journal: eLife
In common: NEURON, Keras, TensorFlow, 3 other tools, none (in silico), computational, computational modeling (no new data), 9 references
[2] doi:10.1038/s41467-025-56297-9 [code]
Dendrites endow artificial neural networks with accurate, robust and parameter-efficient learning.
Journal: Nature communications
In common: Keras, TensorFlow, SciPy, 2 other tools, computational modeling (no new data), 11 references
[3] doi:10.1038/s41467-023-41553-7 [code]
A GPU-based computational framework that bridges neuron simulation and artificial intelligence.
Journal: Nature communications
In common: NEURON, TensorFlow, SciPy, 2 other tools, computational modeling (no new data), 9 references
[4] doi:10.1371/journal.pcbi.1010534 [code]
Computational models reveal how chloride dynamics determine the optimal distribution of inhibitory synapses to minimise dendritic excitability.
Journal: PLoS computational biology
In common: NEURON, SciPy, Matplotlib, 1 other tool, none (in silico), computational modeling (no new data), 8 references
[5] doi:10.7554/elife.103324 [code]
DendroTweaks, an interactive approach for unraveling dendritic dynamics.
Journal: eLife
In common: NEURON, SciPy, Matplotlib, 1 other tool, computational modeling (no new data), 6 references
[6] doi:10.1016/j.celrep.2026.117159 [code]
Cellular and subcellular specialization enables biology-constrained deep learning.
Journal: Cell reports
In common: NEURON, SciPy, Matplotlib, 1 other tool, 7 references
[7] doi:10.1038/s42003-026-11157-0 [code]
A NEST-based framework unlocks massively parallel simulation of networks of multi-compartment neurons with customizable subcellular dynamics.
Journal: Communications biology
In common: SciPy, Matplotlib, NumPy, computational, computational modeling (no new data), 6 references
[8] doi:10.7554/elife.108352 [code]
Analysis of dendritic input currents during place field dynamics.
Journal: eLife
In common: NEURON, Matplotlib, NumPy, 6 references
[9] doi:10.1371/journal.pcbi.1012754 [code]
The calcitron: A simple neuron model that implements many learning rules via the calcium control hypothesis.
Journal: PLoS computational biology
In common: SciPy, Matplotlib, NumPy, 7 references
[10] doi:10.1038/s41467-022-35747-8 [code]
Introducing the Dendrify framework for incorporating dendrites to spiking neural networks.
Journal: Nature communications
In common: SciPy, Matplotlib, NumPy, none (in silico), computational, computational modeling (no new data), 5 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.

Add the badge to the code's README

OSCR: the badge of this paper

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 -->
[![OSCR](https://openscicode.org/badge/repo/github.com/ms-geb/deepdendrite-modularization.svg)](https://openscicode.org/badge/repo/github.com/ms-geb/deepdendrite-modularization)
<!-- oscr-badge:end -->
reStructuredText
.. oscr-badge:start

.. image:: https://openscicode.org/badge/repo/github.com/ms-geb/deepdendrite-modularization.svg
   :target: https://openscicode.org/badge/repo/github.com/ms-geb/deepdendrite-modularization
   :alt: OSCR

.. oscr-badge:end
HTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/repo/github.com/ms-geb/deepdendrite-modularization"><img src="https://openscicode.org/badge/repo/github.com/ms-geb/deepdendrite-modularization.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->

On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".

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)

Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.

Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.