Code to train and test models from the paper: Fengtong Du, Miguel Angel Núñez-Ochoa, Marius Pachitariu, Carsen Stringer. A simplified minimodel of visual cortical neurons, bioRxiv
We recommend using a clean Python environment to avoid dependency conflicts.
Create and activate a new environment:
conda create -n minimodel-env python=3.10 -y
conda activate minimodel-env
Clone the repository:
git clone https://github.com/MouseLand/minimodel.git
cd minimodel
Install the required dependencies and minimodel module:
pip install -e .
mouse_pipeline.ipynb
: This notebook demonstrates how to use the minimodel module to train and test models on the mouse dataset. It includes data loading, fullmodel training and evaluation, and minimodel training and evaluation.
The project structure is organized as follows:
minimodel/
: Directory containing the main minimodel module code.notebooks/
: Directory for Jupyter notebooks of training and testing models.data/
: Directory for storing image and recording files.checkpoints/
: Directory for storing model checkpoints.
setup.py
: Setup script for installing the minimodel module.
You can download the mouse dataset from Janelia's Figshare or use the following command:
wget https://janelia.figshare.com/ndownloader/articles/28797638/versions/2
This will download a zip file containing the mouse dataset. Unzip the file and place it in the notebooks/data/
directory.
The monkey data used to train our models comes from Cadena et al. (2019). To access and load this dataset, refer to the official GitHub repository: Cadena2019PlosCB.
To convert the monkey data into the format compatible with our models, run the notebook monkey_data.ipynb.
To evaluate the CNN Baseline model from Willeke et al. (2022) on our dataset, follow these steps:
-
Use this notebook to convert our data to the Sensorium competition format: sensorium_format.ipynb
-
Train the model using the official Sensorium notebook: 1a_model_training_sensorium.ipynb
We offer the model weights for the 16-320 fullmodels of all mice, as well as minimodels for some example neurons. You can download them from the following link: https://github.com/MouseLand/minimodel/releases/tag/V1.0.0. After downloading, place them in the notebooks/checkpoints/
directory.