{"id":16556789,"url":"https://github.com/alexklibisz/deep-calcium","last_synced_at":"2025-03-21T10:32:30.279Z","repository":{"id":22945218,"uuid":"93633726","full_name":"alexklibisz/deep-calcium","owner":"alexklibisz","description":"Fast, Simple Calcium Imaging Segmentation with Fully Convolutional Networks (https://arxiv.org/abs/1707.06314)","archived":false,"fork":false,"pushed_at":"2022-12-08T00:00:48.000Z","size":101260,"stargazers_count":28,"open_issues_count":18,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-18T00:38:59.684Z","etag":null,"topics":["calcium-imaging","deep-learning","neurofinder","unet"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexklibisz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-07T12:39:12.000Z","updated_at":"2023-11-02T08:17:19.000Z","dependencies_parsed_at":"2022-08-07T10:16:27.460Z","dependency_job_id":null,"html_url":"https://github.com/alexklibisz/deep-calcium","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexklibisz%2Fdeep-calcium","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexklibisz%2Fdeep-calcium/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexklibisz%2Fdeep-calcium/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexklibisz%2Fdeep-calcium/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexklibisz","download_url":"https://codeload.github.com/alexklibisz/deep-calcium/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244778035,"owners_count":20508841,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["calcium-imaging","deep-learning","neurofinder","unet"],"created_at":"2024-10-11T20:05:45.977Z","updated_at":"2025-03-21T10:32:26.492Z","avatar_url":"https://github.com/alexklibisz.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# deep-calcium\n\nDeep Learning Models for Calcium Imaging Data\n\n## Installation and example\n\nInstall the package and make predictions on Neurofinder using a pre-trained UNet2DS model.\n\n**Note: This assumes python3.5 and pip3.**\n\n```\n# Install from Github repo. Need to upgrade pip.\n$ pip install --upgrade --user -I pip\n$ pip install --user git+https://github.com/alexklibisz/deep-calcium.git\n\n# Download the model from Github releases.\n$ wget https://github.com/alexklibisz/deep-calcium/releases/download/v0.0.1-weights/unet2ds_model.hdf5\n\n\n# Download the example script and evaluate predictions on the first training dataset.\n# This will download and preprocess the dataset to ~/.deep-calcium-datasets, requiring ~3.1GB of disk space.\n$ wget https://raw.githubusercontent.com/alexklibisz/deep-calcium/dev/examples/neurons/unet2ds_nf.py\n$ CUDA_VISIBLE_DEVICES=\"0\" python unet2ds_nf.py evaluate neurofinder.00.00 --model unet2ds_model.hdf5\n```\n\nYou should see output similar to this:\n\n```\n$ INFO:predict:Loaded model from unet2ds_model.hdf5.\n$ INFO:predict:neurofinder.00.00: prec=0.976, reca=1.000, incl=0.084, excl=0.109, comb=0.988\n$ INFO:predict:Saved /home/kzh/.deep-calcium/checkpoints/neurons_unet2ds_nf/neurofinder.00.00_mp.png\n$ INFO:predict:Mean prec=0.976, reca=1.000, comb=0.988\n$ INFO:evaluation:Evaluation without TTA.\n$ INFO:predict:Loaded model from unet2ds_model.hdf5.\n$ INFO:predict:neurofinder.00.00: prec=0.919, reca=1.000, incl=0.106, excl=0.133, comb=0.958\n$ INFO:predict:Saved /home/kzh/.deep-calcium/checkpoints/neurons_unet2ds_nf/neurofinder.00.00_mp.png\n$ INFO:predict:Mean prec=0.919, reca=1.000, comb=0.958\n```\n\n## Models for Neuron Segmentation\n\n| \u003cimg src=\"media/suli_fig_neurons_outlined_pred_01.png\" height=\"140px\" width=\"auto\"/\u003e | \n|---| \n| *Ground truth and predicted neurons are outlined in blue and red, respectively.  Intersecting outlines become purple.* |\n\n**U-Net2DS: [U-Net](https://arxiv.org/abs/1505.04597) segmenting 2D Summary Images**\n\n- Model described in the paper: [Fast, Simple Calcium Imaging Segmentation with Fully Convolutional Networks](https://arxiv.org/abs/1707.06314) by Aleksander Klibisz, Derek Rose, Matthew Eicholtz, Jay Blundon, Stanislav Zakharenko.\n- See notebooks for [figures](https://github.com/alexklibisz/deep-calcium/blob/36bd9d1824b6a44c9eac3bb6ce8e25f913c6a6d5/notebooks/dlmia_workshop_figures.ipynb) and [supplementary material](https://github.com/alexklibisz/deep-calcium/blob/36bd9d1824b6a44c9eac3bb6ce8e25f913c6a6d5/notebooks/dlmia_workshop_supplementary.ipynb).\n- Usage with new data: see [this example](https://github.com/alexklibisz/deep-calcium/blob/examples/neurons/unet2ds_sj.py) to understand how to use a trained model with new data.\n- Trained on data from the [Neurofinder challenge](http://neurofinder.codeneuro.org/) with results below.\n\n| Date | Summary | Mean F\u003csub\u003e1\u003c/sub\u003e Score | All Scores | Model \u0026 Weights | Training Artifacts | Commit |\n|---|---|---|---|---|---|---|\n|6/16/17|UNet with a single batchnorm layer at the input. Images scaled to [0,1]. |0.5356|[Github](https://github.com/alexklibisz/deep-calcium/blob/dev/media/nf_scores_unet2ds_0.5356.png)|[Google Drive](https://drive.google.com/open?id=0B1ctKflTHUcoMjR4ZHJZNF9CdWM)|[Google Drive](https://drive.google.com/open?id=0B1ctKflTHUcoekR2c05qVjhVR2c)|[0bda9d4](https://github.com/alexklibisz/deep-calcium/commit/0bda9d4b9cad71fb3685671c2e699c88d9195a24)|\n|7/12/17|Same as 6/16/17, but with 8x test-time augmentation. |0.5422|[Github](https://github.com/alexklibisz/deep-calcium/blob/dev/media/nf_scores_unet2ds-tta_0.5422.png)|[Google Drive](https://drive.google.com/open?id=0B1ctKflTHUcoMjR4ZHJZNF9CdWM)|[Google Drive](https://drive.google.com/open?id=0B1ctKflTHUcoekR2c05qVjhVR2c)|[f1b33bf](https://github.com/alexklibisz/deep-calcium/commit/f1b33bfe48425d0d7a33f7f74ded19905a24b88f)|\n|7/13/17|UNet with batchnorm between each conv and ReLU. Mean subtraction and normalization on each summary image. Mask-summary erosion to eliminate merged neurons in ground-truth mask.|0.5611|[Github](https://github.com/alexklibisz/deep-calcium/blob/dev/media/nf_scores_unet2ds_0.5611.png)|[Github](https://github.com/alexklibisz/deep-calcium/releases/tag/v0.0.1-weights)|[Google Drive](https://drive.google.com/open?id=0B1ctKflTHUcoakJZUFBseVdkdFk)|[2b15d1b](https://github.com/alexklibisz/deep-calcium/blob/2b15d1b07a780ff4b2477524f255e41533fc6205/deepcalcium/models/neurons/unet_2d_summary.py)|\n|7/13/17|Same as 7/13/17, but with 8x test-time augmentation. Replaced UNet2DS submission with this one. |0.5689|[Github](https://github.com/alexklibisz/deep-calcium/blob/dev/media/nf_scores_unet2ds-tta_0.5689.png)|[Github](https://github.com/alexklibisz/deep-calcium/releases/tag/v0.0.1-weights)|[Google Drive](https://drive.google.com/open?id=0B1ctKflTHUcoakJZUFBseVdkdFk)|[2b15d1b](https://github.com/alexklibisz/deep-calcium/blob/2b15d1b07a780ff4b2477524f255e41533fc6205/deepcalcium/models/neurons/unet_2d_summary.py)|\n\n## Models for Spike Segmentation\n\n| \u003cimg src=\"media/suli_fig_spikes_pred_00.png\" height=\"140px\" width=\"auto\"/\u003e | \n|---| \n| *Ground truth spikes marked in blue, predicted spike segments in red. |\n\n**U-Net1D: 1-dimensional [U-Net](https://arxiv.org/abs/1505.04597) segmenting calcium traces**\n\n- Model described in: [Segmenting Neurons and Spikes in Calcium Imaging Data Using Deep Learning](https://drive.google.com/file/d/0B1ctKflTHUcoM1hWUGRJU1JmdTg/view?usp=sharing) ([poster](https://drive.google.com/file/d/0B1ctKflTHUcoYlNRUkJUek9tVms/view?usp=sharing))\n- Currently used for non-public internal data only. It might be adaptable for [Spikefinder data](http://spikefinder.codeneuro.org/). Spikefinder is predicting a continuous output (number of action potentials at each time step). U-Net1D predicts a binary output (spike or no-spike at each time step).\n- Trained weights are available on the releases page.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexklibisz%2Fdeep-calcium","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexklibisz%2Fdeep-calcium","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexklibisz%2Fdeep-calcium/lists"}