This repository holds the necessary scripts and instructions to train Neurotransmitter prediction on the MaleCNS volume.
The contents of the scripts directory are detailed below, and determine what can be used to replicate our results.
These will be kept as fixed as possible, once defined.
As of 2025-02-04 the following scripts are still under active development:
03_inference.py
The notebooks directory contains benchmarks and test that may have breaking changes at any moment.
This has been tested on a Linux machine.
Install pixi.
To run a script: pixi run python scripts/<script_name.py>
To update the setup for your own purposes, all configuration change should be made in the YAML files in the config directory.
We use hydra to read the configuration and itake it into account.
The purpose of this script is to create train/val splits for training a model to predict neurortansmitter type from a volume cropped around a synapse.
To avoid leaking information, we split the data along body IDs, ensuring that no body ID appears in both the training and validation sets. We then split the body IDs, stratified by neurotransmitter type, into training and validation sets.
We propagate this split to the synapses. The split is reproducible, as we set a random seed.
Some things to keep in mind: - While the final (synapse) data is not perfectly stratified by type, it is close enough for our purposes. - The dataset is heavily imbalanced; for example the "nitric oxide" neurotransmitter only has 4 neurons total. Only one of them is in the validation set. - We are assuming Dale's law.
Design decisions:
- The neurotransmitters included as of 2025-01-16 are acetylcholine, dopamine, gaba, glutamate, histamine, octopamine and serotonin
- The ground truth data used as of 2025-01-16 comes from this repository, and was filtered by confidence level 3. The notebook used for filtering can be found in notebooks/construct-malecns-neurotransmitter-groundtruth.ipynb
This training script uses gunpowder to train the classifier.
As of 2025-01-16, the classifier trained was a 3D VGG model as implemented here.
This script is used to both validate the results of a trained checkpoint and to run inference brain-wide.