This repository contains Python code and supplementary materials for the paper:
De Matola, M. & Arcara, G. (2026). Convolutional Neural Networks and Neuroscience: A Tutorial Introduction for The Rest of Us. bioRxiv 2026.03.09.710521
The repository was created and is maintained by the first and corresponding author, Matteo De Matola.
↪️ Repository structure
cnns-tutorial/
├── docs/ # supplementary documents that may be of interest
├── files/ # supplementary files (e.g., images)
├── LICENSE.md # the license for this work (CC BY-NC-ND 4.0)
├── README.md # the file you are reading, the information you need
├── cnns-tutorial-env.yml # installation file
└── cnns-tutorial.ipynb # step-by-step implementation of the paper's contentsDe Matola & Arcara (2026) is a tutorial paper on convolutional neural networks (CNNs) and their use in neuroscience. The paper aims to demystify CNNs in the eyes of neuroscientific researchers that read about them or use them in their work, but did not receive enough technical training to understand their inner workings.
All the code is contained in cnns-tutorial.ipynb. This is a Jupyter Notebook: an interactive document that contains a mix of executable code and static text, which can be enriched with mathematical formulas, images and videos.
The notebook cnns-tutorial.ipynb includes Python code to implement all the steps of De Matola & Arcara (2026), plus static text and figures to explain them. The text is a reduced version of the one found in the paper, so you can either:
- Read the paper and come here to run the code cells, ignoring the text cells because they are a mere summary of the paper
- Read the paper and come here to revise its contents while seeing them in action, going through both text and code cells
- Ignore the paper and rely exclusively on the notebook. You will miss some in-depth explanations and theoretical considerations, but you will get all the main messages and skills
If you choose to ignore the paper but find the notebook useful for your published work, we still require you cite us (see Credits).
To run cnns-tutorial.ipynb, you can either use Google Colab or your own computer.
If you use Colab, you will not need any installations. Just hit the button and you will be all set.
If you use your own computer, you will need a Python installation and a few specific packages. Follow the instructions below to obtain them.
👉 Go straight to point 2 if you already have Python and Anaconda/Miniconda on your computer.
- Click on this link and follow the instructions until point 1 included (Install Jupyter in the base environment). Do not go any further than that.
- In this repository, click on the green
Codebutton, as in the image below. Once you have done that, click onDownload ZIP
- Once the download is complete, extract the folder in a directory of your choice
- Open a terminal (if Linux/MacOS) or Anaconda Prompt (if Windows) and run the following code (remember to insert your own directory in the first line):
cd <insert the directory where you have extracted the zipped folder>
conda env create -f cnns-tutorial.yml
python -m ipykernel install --user --name cnns-tutorial --display-name "cnns-tutorial"
Finally, run the command jupyter lab cnns-tutorial.ipynb. This should open cnns-tutorial.ipynb in a browser and you should be all set!
👉 Skip point 1 if you already have Python and Anaconda/Miniconda on your computer.
- Click on this link and follow the instructions until point 1 included (Install Jupyter in the base environment). Do not go any further than that.
- In a terminal (if Linux/MacOS) or Anaconda Prompt (if Windows), run the following code (remember to insert your own directory in the first line):
cd <insert the directory where you want to save this project>
git clone https://github.com/coneco-lab/cnns-tutorial.git
cd cnns-tutorial
conda env create -f cnns-tutorial.yml
python -m ipykernel install --user --name cnns-tutorial --display-name "cnns-tutorial"
Finally, run the command jupyter lab cnns-tutorial.ipynb. This should open cnns-tutorial.ipynb in a browser and you should be all set!
If you find this work useful, you can cite the corresponding paper:
De Matola, M. & Arcara, G. (2026). Convolutional Neural Networks and Neuroscience: A Tutorial Introduction for The Rest of Us. bioRxiv 2026.03.09.710521
❓ Matteo De Matola (UniTN, GitHub)
📫 matteo [dot] dematola [at] unitn [dot] it