Crossing Gradient-flows for Overlapping Objects Segmentation
Implementation of Improving Gradient Flow methods for instance segmentation of crossing objects by J. Mabon & J.C. Olivo-Marin, submitted to ISBI 2026.
@inproceedings{mabon2026crossgoose,
author = {Mabon, J. and Olivo-Marin, J. C.},
title = {Improving Gradient Flow Methods for Instance Segmentation of Crossing Objects},
booktitle = {2026 IEEE International Symposium on Biomedical Imaging},
address = {London, United Kingdom},
month = {April},
year = {2026}
}Setup the environment with conda/mamba:
mamba create -f env.yaml -y
mamba activate crossgoose# Get the data
mkdir -p data/BBBC010_v2_images
wget "https://data.broadinstitute.org/bbbc/BBBC010/BBBC010_v2_images.zip" -O images.zip
unzip images.zip -d data/BBBC010_v2_images
rm images.zip
wget "https://data.broadinstitute.org/bbbc/BBBC010/BBBC010_v1_foreground_eachworm.zip" -O labels.zip
unzip labels.zip -d data
rm labels.zip
# Make a dataset
python main.py make_dataset --config configs/dataset.yaml
# Make a dataset with synthetic data
python main.py make_synth_dataset --config configs/synth_dataset.yamlpython train.py fit --config configs/model.yamlpython main.py eval_models --config configs/eval.yaml- Trajectory-based training: new
TrajectorySamplerandtrain_on_trajectoriesoption to learn from full point trajectories instead of just (u0, ut) pairs - Time-error weighting:
time_error_weightingoption to balance loss contribution across time steps - CPLike flow function: new
FlowFunctionvariant that uses onlyetembedding (CellPose-like) - Improved GridFlow:
- new
from_labels()method for direct label array loading keep_largest_component()to handle non-contiguous masks- threaded
query_multiple_labels_threaded()for faster queries
- new
- 2-channel image support: model now handles both grayscale and multi-channel images (
grayscaleflag in dataset) - Enhanced point sampling:
RandomOnCellV2with improved random sampling within instances - Augmentation updates: fixed patching and transforms for multi-channel images
- New configs: multiple versioned configs (1.3.0 through 1.3.5) for reproducibility
- Shared embedding architecture: new
shared_embeddingoption to use the same embedding for both u0 and ut, reducing model parameters - Embedding visualization: added notebook and utilities to view learned embeddings
- Model configuration: added
model_sharedemb.yamlconfig for shared embedding training
- GridFlow optimization: major refactor of flow computation with
BatchGridFlowfor faster precomputing - Data pipeline refactor: moved sampling to dataloader, reorganized
crossgoose/data/module structure - Threading improvements: added threaded point sampling for faster data loading
- Configuration updates: new model config system (
model2.yaml), updated defaults - Bug fixes: fixed normalization vector, gridflow augmentation, and removed CUDA flow compute
