MorphVAE: Generating Neural Morphologies from 3D-Walks using Variational Autoencoder with Spherical Latent Space
This repository stores the code related to the ICML2021 paper.
Data processing
- Download data: Prior to running the notebooks you will need to download the associated morphologies as well as processed data. You can find the data here. Please download and unpack into the same repository.
- Create Toy data: Generates toy data and their random walk representation.
- Create data iterators: Creates the data iterators for model fitting. Note, the random walk representation has been pre-generated and uploaded in the data repository. If you want to generate them yourself, you can find the code in the ./utils/rw_utils.py
- Create image stacks: Creates an image stack for each neuron to be fed into the TREES Toolbox
- Density maps on toy data and real data: Analysis pipeline of density map projections for each data set. Creation (1D, 2D and 3D projections), 2D t-SNE visualisation and 5-NN classification.
Model fitting
Training:
- Train vae on toy data
- Train vae from scratch on Farrow data
- Train with shuffled labels
- Pre-train vae with scaling data augmentation (basis for the finetuning of the real world data)
Finetune pre-tained models (on toy data) on real data:
- Finetune vae on EXC data -mtype labels
- Finetune van on Farrow data
- pre-tained on scaled Farrow data (from scratch)
- pre-trained on scaled toy data
- Finetune van on INH data - rna labels
Analysis
Classification:
- Classification analysis - how many labels are needed: Analysis on toy data
- K-nearest neighbour classification on neuron rep: 5-NN classification and confusion matrices for each data set
Sample new neurons:
- Cluster walks and sample neurons: Sample a new walk representation from existing neutron, cluster those walks and reconstruct a new neuron on all data sets
- Sample neurons: Sample new neurons for each data set
Plotting
- Plot M1 data
- Plot Farrow data
- Plot latent space of walks: 2D embedding of walk representation learned under each data set
- Plot t-SNE of neural representation: 2D embeddings of the neural representation learned by each model on each data set.
Misc
If you use or refer to this work please use the following citation:
@InProceedings{pmlr-v139-laturnus21a,
title = {MorphVAE: Generating Neural Morphologies from 3D-Walks using a Variational Autoencoder with Spherical Latent Space},
author = {Laturnus, Sophie C. and Berens, Philipp},
booktitle = {Proceedings of the 38th International Conference on Machine Learning},
pages = {6021--6031},
year = {2021},
editor = {Meila, Marina and Zhang, Tong},
volume = {139},
series = {Proceedings of Machine Learning Research},
month = {18--24 Jul},
publisher = {PMLR},
pdf = {http://proceedings.mlr.press/v139/laturnus21a/laturnus21a.pdf},
url = {https://proceedings.mlr.press/v139/laturnus21a.html},
}