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, not stored by OSCR: 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
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.108352 [code]
Analysis of dendritic input currents during place field dynamics.
Journal: eLife
In common: NEURON, Matplotlib, NumPy, 6 references
[2] doi:10.1038/s41467-026-74460-8 [code]
Spike-based alignment learning solves the weight transport problem.
Journal: Nature communications
In common: TensorFlow, SciPy, Matplotlib, 1 other tool, computational modeling (no new data), 4 references
[3] doi:10.1073/pnas.2533168123 [code]
Dendritic morphology and synaptic nonlinearities enhance functional complexity in human cortical neurons.
Journal: Proceedings of the National Academy of Sciences of the United States of America
In common: NEURON, SciPy, Matplotlib, 1 other tool, 4 references
[4] doi:10.1016/j.isci.2026.117010 [code]
Deep learning-assisted mapping of dendritic spines using sequential 2D two-photon calcium imaging.
Journal: iScience
In common: TensorFlow, SciPy, Matplotlib, 1 other tool, 4 references
[5] doi:10.7554/elife.89629 [code]
Active dendrites enable robust spiking computations despite timing jitter.
Journal: eLife
In common: NEURON, Matplotlib, NumPy, 4 references
[6] doi:10.1126/sciadv.aec3961 [code]
Linking functional and structural dendritic spine remodeling during fear learning and extinction in vivo.
Journal: Science advances
In common: NEURON, SciPy, Matplotlib, 1 other tool, 3 references
[7] doi:10.1038/s41598-026-51212-8 [code]
Uncertainty aware machine learning for bridging simulation and experiment in high throughput materials characterization.
Journal: Scientific reports
In common: Keras, TensorFlow, Matplotlib, 1 other tool, none (in silico), computational, computational modeling (no new data), 1 reference
[8] 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: NEURON, Keras, TensorFlow, 3 other tools
[9] 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: NEURON, Keras, TensorFlow, 3 other tools
[10] doi:10.3389/fnbeh.2026.1871826 [code]
Effects of repetitive scanning ultrasound on the intraneuronal dendritic signalling of CA1 pyramidal neurons.
Journal: Frontiers in behavioral neuroscience
In common: NEURON, none (in silico), 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.

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.