Historical research workflow¶
This workflow reproduces the paper's data preparation, multi-species training, and benchmarks. It is specific to the original Jean Zay / Slurm setup and is not the supported user fine-tuning API. The job scripts still contain fixed Slurm accounts, partitions, and environment module names; adapt them to your cluster before submitting jobs. No cluster execution is verified here.
Install the package in the environment used for submission and on compute
nodes, because submitted jobs run python -m morphodeep.research. Set
MORPHODEEP_WORK, MORPHODEEP_SCRATCH, and MORPHODEEP_STORE to the
appropriate data directories. The default for each is ~/MorphoDeep.
morphodeep research --help shows the historical options. The --job flag
retains its legacy meaning: it runs the selected processing action directly;
without it, the code prepares and submits a Slurm job. Do not use this route
for user-supplied fine-tuning pairs; use morphodeep finetune instead.
Original data preparation and training¶
DATA PREPARATION¶
1. Extract segmentation and Raw Images data (for all species)¶
python -m morphodeep.research --microscope SPIM --specie PM --phallusia_data
python -m morphodeep.research --microscope CONF --specie AT --arabidopsis_data
python -m morphodeep.research --microscope CONF --specie LP --plantseg_data
python -m morphodeep.research --microscope CONF --specie OV --plantseg_data
python -m morphodeep.research --microscope CONF --specie SS --seastar_data
python -m morphodeep.research --microscope CONF --specie CE --celegans_data
You can also follow this examples to preformat your images as follow :
GT_3D/
├── <microscope>-<specie>/
│ ├── membrane/
│ │ ├── dataset1
│ │ │ ├── filename3D_1_M.tiff
│ │ │ ├── filename3D_2_M.tiff
│ │ │ ├── ...
│ │ ├── dataset2
│ │ │ ├── filename3D_1_S.tiff
│ │ │ ├── filename3D_2_S.tiff
│ │ │ ├── ...
│ └── segmented/
│ ├── dataset1
│ │ ├── filename3D_1_S.tiff
│ │ ├── filename3D_2_S.tiff
│ │ ├── ...
│ ├── dataset12
│ │ ├── filename3D_1_S.tiff
│ │ ├── filename3D_2_S.tiff
│ │ ├── ...
├── ...
2. Generate all Ground Truth¶
example :python -m morphodeep.research --ground_truth --microscope CONF --specie SS
3. Create Split Train,Test Valid data¶
example :python -m morphodeep.research --setdata --microscope CONF --specie SS
3.b To transfert your data in 128 patches¶
example : python -m morphodeep.research --setdata --img_size 128
4. Train Semantic Networks¶
example : python -m morphodeep.research --train --microscope SPIM --specie PM
5. Compute accuracy and plot loss evolution¶
example : python -m morphodeep.research --plot --microscope CONF --specie AT
6. Benchmark Test data (from figures path)¶
example : python figures/Benchmark.py --predict
7. Benchmark on external data¶
example : python figures/Benchmark.py --predict -f BenchmarkGeneralisation/EXTERNAL_DATA_3D/external_data_3D.txt
2D¶
Everything is by default in 3D, add --mode 2D to comptue evertyhing in 2D
Convert in 2D DATA (and generate txt files)¶
We extract all the 2D images from the previous 3D database
example :python -m morphodeep.research --mode 3D --microscope ALL --specie all --extract_2D [-wh <test;train;valid>]
And finally same steps as in 3D with the mode 2D parameter¶
Generate 2D Ground Truth for all species Predict Cellpose (on test data) Predict PlantSseg (on test data) Train Semantic Networks Compute accuracy and plot loss evolution Benchmark test and external data
Additional paper commands¶
NO LOSSES ..¶
python -m morphodeep.research --train -i 128 -n FJUNNET --job python -m morphodeep.research --train -i 128 -n JUNNETS --job python -m morphodeep.research --train -i 256 -n JUNNETS --job python -m morphodeep.research --train -i 128 -n SUNNET --job
SUNNET
python -m morphodeep.research --plot -i 128 -n FJUNNET --job python -m morphodeep.research --plot -i 128 -n JUNNETS --job
python Benchmark.py --predict -i 128 -n FJUNNET --job python Benchmark.py --predict -i 128 -n JUNNETS --job
CELLPOSE¶
python Benchmark.py -t 2D -m cellpose4 -i 256