Instructions to use Podtyazhki1337/3d-neurons-segmentation with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use Podtyazhki1337/3d-neurons-segmentation with Keras:
# !pip install -U keras tensorflow huggingface_hub # Keras needs TensorFlow installed to read "hf://" paths, so the tensorflow backend is selected here; # "jax" and "torch" also work for computation once TensorFlow is installed. import os os.environ["KERAS_BACKEND"] = "tensorflow" import keras model = keras.saving.load_model("hf://Podtyazhki1337/3d-neurons-segmentation") - Notebooks
- Google Colab
- Kaggle
XSoma3D a large scale neuronal dataset revealing cross species generalization in label free microscopy
Trained models of the XSoma3D benchmark of 3D neuronal soma segmentation in label-free microscopy (oblique illumination and Dodt gradient contrast, DGC) of rat, mouse and human brain slices.
| Resource | Link |
|---|---|
| Code (inference, reproduction, training) | https://github.com/podtyazhki1337/3d-neurons-segmentation |
| XSoma3D dataset (240 annotated stacks, train/val/test split) | https://doi.org/10.5281/zenodo.19812777 |
| Models | this repository |
Use
The neuroseg package of the code repository downloads the files of a model from this repository and runs the
inference pipeline of the manuscript (normalisation, network, post-processing selected on validation data):
git clone https://github.com/podtyazhki1337/3d-neurons-segmentation && cd 3d-neurons-segmentation
conda env create -f environments/nnunet.yml && conda activate neuroseg-nnunet # one environment per framework
python -m neuroseg.predict --method nnunet --model rat_dgc --input my_stack.tif --output segmented/
from neuroseg import load_model, read_volume
labels = load_model("cellpose_sam", "human_oblique").predict(read_volume("my_stack.tif"))
Reproduce the test-set results of the manuscript from the Zenodo data:
python -m neuroseg.download_data --out data
python -m neuroseg.reproduce --data data --method nnunet
Input: TIFF stacks (Z, Y, X) at the voxel size of the modality (DGC 1 × 0.115 × 0.115 µm, oblique 1 × 0.171 × 0.171 µm). Choose a model trained on the modality of the images.
Contents
<dataset> is one of human_neurons_dodt, mice_neurons_dodt, rat_neurons_dodt, human_neurons_oblique,
rat_neurons_oblique, mice_neurons_oblique (DODT = DGC).
| Folder | Method | Models |
|---|---|---|
nnunet/Dataset001–006_*/nnUNetTrainer_Comet__nnUNetPlans__3d_fullres/ |
nnU-Net v2 (3d_fullres, fold 0, checkpoint_best.pth) |
one per species–modality set |
nnunet/Dataset101–105, 108_*/… |
nnU-Net v2 | pooled training sets: rat + mouse DGC (101), rat + mouse oblique (102), all DGC (103), all oblique (104), all data (105), human DGC + oblique (108) |
unet3d/unet3d_<dataset>_{no_aug,light_aug}/ |
3D U-Net (Keras, best.weights.h5) |
without / with augmentation |
stardist3d/stardist_<dataset>_{noaug,lightaug}_final/ |
StarDist3D (weights_best.h5, thresholds.json) |
without / with augmentation |
cellpose/<dataset>_chunked/ |
Cellpose 3 | one per set |
cellpose_sam/<dataset>/ |
Cellpose-SAM fine-tuned from cpsam (cellpose 4) |
one per set |
cellpose_sam/Dataset101–105, 108_*/ |
Cellpose-SAM | pooled training sets, as for nnU-Net v2 (101–105, 108; manuscript Supplementary Table S12) |
microsam/checkpoints/microsam_vit_b_lm_finetuned_<short name>/ |
micro-SAM, fine-tuned vit_b_lm (best.pt) |
one per set |
The nnUNetTrainer_Comet trainer of the nnU-Net checkpoints only adds experiment logging to nnUNetTrainer;
neuroseg loads the checkpoints with the standard nnU-Net v2. The inference settings of every model
(post-processing, scaling) are listed in neuroseg/registry.py of the code repository, and the training settings
in Supplementary Table S1 of the manuscript.
Citation
If you use these models, please cite the associated publication (reference to be added on publication) and the XSoma3D dataset (https://doi.org/10.5281/zenodo.19812777).
- Downloads last month
- 374