Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
a1da77e
feat(viscy-utils): add a segmenter-consistency loss
alxndrkalinin Oct 16, 2026
ebf3b2f
feat(dynacell): wire the segmenter-consistency term into the UNet and…
alxndrkalinin Oct 16, 2026
5ab832a
feat(dynacell): add a differentiable Cellpose-SAM wrapper
alxndrkalinin Oct 16, 2026
dc25ad5
feat(dynacell): add P1 segmenter-consistency fine-tune arms (nucleus)
alxndrkalinin Oct 16, 2026
3825b42
feat(dynacell): calibrate the P1 segcons weights
alxndrkalinin Oct 16, 2026
394211b
fix(dynacell): reject seg_consistency combined with seg_aux
alxndrkalinin Oct 16, 2026
d1dbdcd
refactor(viscy-utils): drop unused SegConsistencyLoss options and the…
alxndrkalinin Oct 16, 2026
5f81ff6
perf(viscy-utils): build the Otsu histogram without a host sync
alxndrkalinin Oct 16, 2026
88e892d
refactor(dynacell): simplify CellposeDense
alxndrkalinin Oct 16, 2026
671a3cf
test(dynacell): pin SegConsistencyLoss's focus port to the eval
alxndrkalinin Oct 16, 2026
0043b4e
refactor(dynacell): drop the segcons null-weight placeholder path
alxndrkalinin Oct 16, 2026
7ae9099
test(dynacell): skip cellpose tests without cellpose; fix a docstring
alxndrkalinin Oct 16, 2026
3314fa3
fix(dynacell): crop the segcons projection to 240 px, one cellpose tile
alxndrkalinin Oct 16, 2026
1141c54
fix(dynacell): shorten the pix2pix2d fork's EMA half-life
alxndrkalinin Oct 16, 2026
7d52315
fix(dynacell): keep CellposeDense in eval under train()
alxndrkalinin Oct 16, 2026
40af11d
fix(dynacell): reject a non-positive seg_consistency_weight
alxndrkalinin Oct 16, 2026
2691f98
docs(dynacell): drop the stale seg_consistency weight placeholder wor…
alxndrkalinin Oct 16, 2026
e722cff
test(dynacell): check every fork-checkpoint tensor in the control build
alxndrkalinin Oct 16, 2026
031d75f
feat(dynacell): recalibrate the segcons weights at the 240-px crop
alxndrkalinin Oct 16, 2026
797a85b
fix(dynacell): keep the global RNG unchanged when building CellposeDense
alxndrkalinin Oct 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# GENERATED by applications/dynacell/tools/generate_spotlight_v2_leaves.py -- edit the
# generator, not this file (plan: ~/.claude/plans/spotlight-v2.md).
# Spotlight-v2 `segcons` arm (predict) of the baseline leaf nucleus/fcmae_vscyto3d_scratch/ipsc_confocal/predict__a549_mantis_denv.yml.
# Inference is identical to the baseline's; only the checkpoint, store and names differ.
# Fine-tune arm: predict the end of the fine-tune; submit with `--ckpt last`.
# Everything else, and the rationale for it, is the baseline leaf's.
base:
- ../../../_internal/shared/model/predict_sets/a549_mantis_h2b_denv.yml
- ../../../_internal/shared/model/targets/nucleus.yml
- ../../../_internal/shared/model/model_overlays/fcmae_vscyto3d_predict.yml
- ../../../_internal/shared/model/launcher_profiles/mode_predict.yml
- ../../../_internal/shared/model/launcher_profiles/hardware_predict_any_gpu.yml
- ../../../_internal/shared/model/launcher_profiles/runtime_shared.yml
benchmark:
task: virtual_staining
organelle: nucleus
trained_on: ipsc_confocal
predict_set: a549_mantis_h2b_denv
model_name: fcmae_vscyto3d_scratch_segcons
experiment_id: nucleus__ipsc_confocal__fcmae_vscyto3d_scratch_segcons__a549_mantis_h2b_denv
dataset_ref:
target: h2b
model:
init_args:
ckpt_path: /hpc/projects/comp.micro/virtual_staining/models/dynacell/ipsc/nucleus/fcmae_vscyto3d_scratch_segcons/checkpoints/last.ckpt
data:
init_args:
normalizations:
- class_path: viscy_transforms.NormalizeSampled
init_args:
keys:
- Phase3D
level: fov_statistics
subtrahend: mean
divisor: std
augmentations: []
trainer:
callbacks:
- class_path: viscy_utils.callbacks.prediction_writer.HCSPredictionWriter
init_args:
output_store: /hpc/projects/virtual_staining/training/dynacell/nucleus/fcmae_vscyto3d_scratch_segcons/ipsc/a549__denv/prediction.zarr
launcher:
job_name: FCMAE_VSCyto3D_Scratch_PRED_NUCL_ON_A549_DENV_segcons
run_root: /hpc/projects/virtual_staining/training/dynacell/nucleus/fcmae_vscyto3d_scratch_segcons/ipsc/a549__denv
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# GENERATED by applications/dynacell/tools/generate_spotlight_v2_leaves.py -- edit the
# generator, not this file (plan: ~/.claude/plans/spotlight-v2.md).
# Spotlight-v2 `segcons` arm (predict) of the baseline leaf nucleus/fcmae_vscyto3d_scratch/ipsc_confocal/predict__a549_mantis_mock.yml.
# Inference is identical to the baseline's; only the checkpoint, store and names differ.
# Fine-tune arm: predict the end of the fine-tune; submit with `--ckpt last`.
# Everything else, and the rationale for it, is the baseline leaf's.
base:
- ../../../_internal/shared/model/predict_sets/a549_mantis_h2b_mock.yml
- ../../../_internal/shared/model/targets/nucleus.yml
- ../../../_internal/shared/model/model_overlays/fcmae_vscyto3d_predict.yml
- ../../../_internal/shared/model/launcher_profiles/mode_predict.yml
- ../../../_internal/shared/model/launcher_profiles/hardware_predict_any_gpu.yml
- ../../../_internal/shared/model/launcher_profiles/runtime_shared.yml
benchmark:
task: virtual_staining
organelle: nucleus
trained_on: ipsc_confocal
predict_set: a549_mantis_h2b_mock
model_name: fcmae_vscyto3d_scratch_segcons
experiment_id: nucleus__ipsc_confocal__fcmae_vscyto3d_scratch_segcons__a549_mantis_h2b_mock
dataset_ref:
target: h2b
model:
init_args:
ckpt_path: /hpc/projects/comp.micro/virtual_staining/models/dynacell/ipsc/nucleus/fcmae_vscyto3d_scratch_segcons/checkpoints/last.ckpt
data:
init_args:
normalizations:
- class_path: viscy_transforms.NormalizeSampled
init_args:
keys:
- Phase3D
level: fov_statistics
subtrahend: mean
divisor: std
augmentations: []
trainer:
callbacks:
- class_path: viscy_utils.callbacks.prediction_writer.HCSPredictionWriter
init_args:
output_store: /hpc/projects/virtual_staining/training/dynacell/nucleus/fcmae_vscyto3d_scratch_segcons/ipsc/a549__mock/prediction.zarr
launcher:
job_name: FCMAE_VSCyto3D_Scratch_PRED_NUCL_ON_A549_MOCK_segcons
run_root: /hpc/projects/virtual_staining/training/dynacell/nucleus/fcmae_vscyto3d_scratch_segcons/ipsc/a549__mock
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# GENERATED by applications/dynacell/tools/generate_spotlight_v2_leaves.py -- edit the
# generator, not this file (plan: ~/.claude/plans/spotlight-v2.md).
# Spotlight-v2 `segcons` arm (predict) of the baseline leaf nucleus/fcmae_vscyto3d_scratch/ipsc_confocal/predict__a549_mantis_zikv.yml.
# Inference is identical to the baseline's; only the checkpoint, store and names differ.
# Fine-tune arm: predict the end of the fine-tune; submit with `--ckpt last`.
# Everything else, and the rationale for it, is the baseline leaf's.
base:
- ../../../_internal/shared/model/predict_sets/a549_mantis_h2b_zikv.yml
- ../../../_internal/shared/model/targets/nucleus.yml
- ../../../_internal/shared/model/model_overlays/fcmae_vscyto3d_predict.yml
- ../../../_internal/shared/model/launcher_profiles/mode_predict.yml
- ../../../_internal/shared/model/launcher_profiles/hardware_predict_any_gpu.yml
- ../../../_internal/shared/model/launcher_profiles/runtime_shared.yml
benchmark:
task: virtual_staining
organelle: nucleus
trained_on: ipsc_confocal
predict_set: a549_mantis_h2b_zikv
model_name: fcmae_vscyto3d_scratch_segcons
experiment_id: nucleus__ipsc_confocal__fcmae_vscyto3d_scratch_segcons__a549_mantis_h2b_zikv
dataset_ref:
target: h2b
model:
init_args:
ckpt_path: /hpc/projects/comp.micro/virtual_staining/models/dynacell/ipsc/nucleus/fcmae_vscyto3d_scratch_segcons/checkpoints/last.ckpt
data:
init_args:
normalizations:
- class_path: viscy_transforms.NormalizeSampled
init_args:
keys:
- Phase3D
level: fov_statistics
subtrahend: mean
divisor: std
augmentations: []
trainer:
callbacks:
- class_path: viscy_utils.callbacks.prediction_writer.HCSPredictionWriter
init_args:
output_store: /hpc/projects/virtual_staining/training/dynacell/nucleus/fcmae_vscyto3d_scratch_segcons/ipsc/a549__zikv/prediction.zarr
launcher:
job_name: FCMAE_VSCyto3D_Scratch_PRED_NUCL_ON_A549_ZIKV_segcons
run_root: /hpc/projects/virtual_staining/training/dynacell/nucleus/fcmae_vscyto3d_scratch_segcons/ipsc/a549__zikv
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# GENERATED by applications/dynacell/tools/generate_spotlight_v2_leaves.py -- edit the
# generator, not this file (plan: ~/.claude/plans/spotlight-v2.md).
# Spotlight-v2 `segcons` arm (predict) of the baseline leaf nucleus/fcmae_vscyto3d_scratch/ipsc_confocal/predict__ipsc_confocal.yml.
# Inference is identical to the baseline's; only the checkpoint, store and names differ.
# Fine-tune arm: predict the end of the fine-tune; submit with `--ckpt last`.
# Everything else, and the rationale for it, is the baseline leaf's.
base:
- ../../../_internal/shared/model/predict_sets/ipsc_confocal.yml
- ../../../_internal/shared/model/targets/nucleus.yml
- ../../../_internal/shared/model/model_overlays/fcmae_vscyto3d_predict.yml
- ../../../_internal/shared/model/launcher_profiles/mode_predict.yml
- ../../../_internal/shared/model/launcher_profiles/hardware_predict_any_gpu.yml
- ../../../_internal/shared/model/launcher_profiles/runtime_shared.yml
benchmark:
task: virtual_staining
organelle: nucleus
trained_on: ipsc_confocal
predict_set: ipsc_confocal
model_name: fcmae_vscyto3d_scratch_segcons
experiment_id: nucleus__ipsc_confocal__fcmae_vscyto3d_scratch_segcons__ipsc_confocal
model:
init_args:
ckpt_path: /hpc/projects/comp.micro/virtual_staining/models/dynacell/ipsc/nucleus/fcmae_vscyto3d_scratch_segcons/checkpoints/last.ckpt
data:
init_args:
normalizations:
- class_path: viscy_transforms.NormalizeSampled
init_args:
keys:
- Phase3D
level: fov_statistics
subtrahend: mean
divisor: std
augmentations: []
trainer:
callbacks:
- class_path: viscy_utils.callbacks.prediction_writer.HCSPredictionWriter
init_args:
output_store: /hpc/projects/virtual_staining/training/dynacell/nucleus/fcmae_vscyto3d_scratch_segcons/ipsc/ipsc/prediction.zarr
launcher:
job_name: FCMAE_VSCyto3D_Scratch_PRED_NUCL_segcons
run_root: /hpc/projects/virtual_staining/training/dynacell/nucleus/fcmae_vscyto3d_scratch_segcons/ipsc/ipsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# GENERATED by applications/dynacell/tools/generate_spotlight_v2_leaves.py -- edit the
# generator, not this file (plan: ~/.claude/plans/spotlight-v2.md).
# Spotlight-v2 `segcons` arm (fit) of the baseline leaf nucleus/fcmae_vscyto3d_scratch/ipsc_confocal/train.yml.
# Recipe delta vs that leaf: the segcons_ctrl fork + model seg_consistency (SegConsistencyLoss, Cellpose-SAM cpsam, slab halfwidth 1, 240-px crop (one cellpose tile), per-tile activation checkpointing) + seg_consistency_weight (gradient-norm calibrated at the fork checkpoint).
# Everything else, and the rationale for it, is the baseline leaf's.
base:
- ../../../_internal/shared/model/train_sets/ipsc_confocal.yml
- ../../../_internal/shared/model/targets/nucleus.yml
- ../../../_internal/shared/model/data_overlays/fcmae_vscyto3d_fit.yml
- ../../../_internal/shared/model/model_overlays/fcmae_vscyto3d_fit.yml
- ../../../_internal/shared/model/launcher_profiles/mode_fit.yml
- ../../../_internal/shared/model/launcher_profiles/hardware_4gpu.yml
- ../../../_internal/shared/model/launcher_profiles/runtime_shared.yml
benchmark:
task: virtual_staining
organelle: nucleus
train_set: ipsc_confocal
model_name: fcmae_vscyto3d_scratch_segcons
experiment_id: nucleus__ipsc_confocal__fcmae_vscyto3d_scratch_segcons
data:
init_args:
augmentations:
- class_path: viscy_transforms.RandWeightedCropd
init_args:
keys:
- Phase3D
- Nuclei
w_key: Nuclei
spatial_size:
- 20
- 600
- 600
num_samples: 4
trainer:
logger:
init_args:
name: FCMAE_VSCyto3D_Scratch_iPSC_Nucleus_segcons
save_dir: /hpc/projects/comp.micro/virtual_staining/models/dynacell/ipsc/nucleus/fcmae_vscyto3d_scratch_segcons
callbacks:
- class_path: lightning.pytorch.callbacks.LearningRateMonitor
init_args:
logging_interval: step
- class_path: lightning.pytorch.callbacks.ModelCheckpoint
init_args:
monitor: loss/validate
filename: epoch={epoch}-step={step}-loss={loss/validate:.3f}
auto_insert_metric_name: false
every_n_epochs: 1
save_top_k: 5
save_last: true
dirpath: /hpc/projects/comp.micro/virtual_staining/models/dynacell/ipsc/nucleus/fcmae_vscyto3d_scratch_segcons/checkpoints
max_epochs: 20
launcher:
job_name: FCMAE_VSCyto3D_Scratch_Nucleus_segcons
run_root: /hpc/projects/comp.micro/virtual_staining/models/dynacell/ipsc/nucleus/fcmae_vscyto3d_scratch_segcons
model:
init_args:
ckpt_path: /hpc/projects/comp.micro/virtual_staining/models/dynacell/ipsc/nucleus/fcmae_vscyto3d_scratch_v2/checkpoints/latest-epoch=199-step=62400.ckpt
lr: 4.0e-05
warmup_steps: 312
seg_consistency:
class_path: viscy_utils.losses.SegConsistencyLoss
init_args:
segmenter:
class_path: dynacell.cellpose_dense.CellposeDense
init_args:
model_name: cpsam
checkpoint_tiles: 1
slab_halfwidth: 1
crop_size: 240
seg_consistency_weight: 0.032
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# GENERATED by applications/dynacell/tools/generate_spotlight_v2_leaves.py -- edit the
# generator, not this file (plan: ~/.claude/plans/spotlight-v2.md).
# Spotlight-v2 `segcons_ctrl` arm (predict) of the baseline leaf nucleus/fcmae_vscyto3d_scratch/ipsc_confocal/predict__a549_mantis_denv.yml.
# Inference is identical to the baseline's; only the checkpoint, store and names differ.
# Fine-tune arm: predict the end of the fine-tune; submit with `--ckpt last`.
# Everything else, and the rationale for it, is the baseline leaf's.
base:
- ../../../_internal/shared/model/predict_sets/a549_mantis_h2b_denv.yml
- ../../../_internal/shared/model/targets/nucleus.yml
- ../../../_internal/shared/model/model_overlays/fcmae_vscyto3d_predict.yml
- ../../../_internal/shared/model/launcher_profiles/mode_predict.yml
- ../../../_internal/shared/model/launcher_profiles/hardware_predict_any_gpu.yml
- ../../../_internal/shared/model/launcher_profiles/runtime_shared.yml
benchmark:
task: virtual_staining
organelle: nucleus
trained_on: ipsc_confocal
predict_set: a549_mantis_h2b_denv
model_name: fcmae_vscyto3d_scratch_segcons_ctrl
experiment_id: nucleus__ipsc_confocal__fcmae_vscyto3d_scratch_segcons_ctrl__a549_mantis_h2b_denv
dataset_ref:
target: h2b
model:
init_args:
ckpt_path: /hpc/projects/comp.micro/virtual_staining/models/dynacell/ipsc/nucleus/fcmae_vscyto3d_scratch_segcons_ctrl/checkpoints/last.ckpt
data:
init_args:
normalizations:
- class_path: viscy_transforms.NormalizeSampled
init_args:
keys:
- Phase3D
level: fov_statistics
subtrahend: mean
divisor: std
augmentations: []
trainer:
callbacks:
- class_path: viscy_utils.callbacks.prediction_writer.HCSPredictionWriter
init_args:
output_store: /hpc/projects/virtual_staining/training/dynacell/nucleus/fcmae_vscyto3d_scratch_segcons_ctrl/ipsc/a549__denv/prediction.zarr
launcher:
job_name: FCMAE_VSCyto3D_Scratch_PRED_NUCL_ON_A549_DENV_segcons_ctrl
run_root: /hpc/projects/virtual_staining/training/dynacell/nucleus/fcmae_vscyto3d_scratch_segcons_ctrl/ipsc/a549__denv
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# GENERATED by applications/dynacell/tools/generate_spotlight_v2_leaves.py -- edit the
# generator, not this file (plan: ~/.claude/plans/spotlight-v2.md).
# Spotlight-v2 `segcons_ctrl` arm (predict) of the baseline leaf nucleus/fcmae_vscyto3d_scratch/ipsc_confocal/predict__a549_mantis_mock.yml.
# Inference is identical to the baseline's; only the checkpoint, store and names differ.
# Fine-tune arm: predict the end of the fine-tune; submit with `--ckpt last`.
# Everything else, and the rationale for it, is the baseline leaf's.
base:
- ../../../_internal/shared/model/predict_sets/a549_mantis_h2b_mock.yml
- ../../../_internal/shared/model/targets/nucleus.yml
- ../../../_internal/shared/model/model_overlays/fcmae_vscyto3d_predict.yml
- ../../../_internal/shared/model/launcher_profiles/mode_predict.yml
- ../../../_internal/shared/model/launcher_profiles/hardware_predict_any_gpu.yml
- ../../../_internal/shared/model/launcher_profiles/runtime_shared.yml
benchmark:
task: virtual_staining
organelle: nucleus
trained_on: ipsc_confocal
predict_set: a549_mantis_h2b_mock
model_name: fcmae_vscyto3d_scratch_segcons_ctrl
experiment_id: nucleus__ipsc_confocal__fcmae_vscyto3d_scratch_segcons_ctrl__a549_mantis_h2b_mock
dataset_ref:
target: h2b
model:
init_args:
ckpt_path: /hpc/projects/comp.micro/virtual_staining/models/dynacell/ipsc/nucleus/fcmae_vscyto3d_scratch_segcons_ctrl/checkpoints/last.ckpt
data:
init_args:
normalizations:
- class_path: viscy_transforms.NormalizeSampled
init_args:
keys:
- Phase3D
level: fov_statistics
subtrahend: mean
divisor: std
augmentations: []
trainer:
callbacks:
- class_path: viscy_utils.callbacks.prediction_writer.HCSPredictionWriter
init_args:
output_store: /hpc/projects/virtual_staining/training/dynacell/nucleus/fcmae_vscyto3d_scratch_segcons_ctrl/ipsc/a549__mock/prediction.zarr
launcher:
job_name: FCMAE_VSCyto3D_Scratch_PRED_NUCL_ON_A549_MOCK_segcons_ctrl
run_root: /hpc/projects/virtual_staining/training/dynacell/nucleus/fcmae_vscyto3d_scratch_segcons_ctrl/ipsc/a549__mock
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# GENERATED by applications/dynacell/tools/generate_spotlight_v2_leaves.py -- edit the
# generator, not this file (plan: ~/.claude/plans/spotlight-v2.md).
# Spotlight-v2 `segcons_ctrl` arm (predict) of the baseline leaf nucleus/fcmae_vscyto3d_scratch/ipsc_confocal/predict__a549_mantis_zikv.yml.
# Inference is identical to the baseline's; only the checkpoint, store and names differ.
# Fine-tune arm: predict the end of the fine-tune; submit with `--ckpt last`.
# Everything else, and the rationale for it, is the baseline leaf's.
base:
- ../../../_internal/shared/model/predict_sets/a549_mantis_h2b_zikv.yml
- ../../../_internal/shared/model/targets/nucleus.yml
- ../../../_internal/shared/model/model_overlays/fcmae_vscyto3d_predict.yml
- ../../../_internal/shared/model/launcher_profiles/mode_predict.yml
- ../../../_internal/shared/model/launcher_profiles/hardware_predict_any_gpu.yml
- ../../../_internal/shared/model/launcher_profiles/runtime_shared.yml
benchmark:
task: virtual_staining
organelle: nucleus
trained_on: ipsc_confocal
predict_set: a549_mantis_h2b_zikv
model_name: fcmae_vscyto3d_scratch_segcons_ctrl
experiment_id: nucleus__ipsc_confocal__fcmae_vscyto3d_scratch_segcons_ctrl__a549_mantis_h2b_zikv
dataset_ref:
target: h2b
model:
init_args:
ckpt_path: /hpc/projects/comp.micro/virtual_staining/models/dynacell/ipsc/nucleus/fcmae_vscyto3d_scratch_segcons_ctrl/checkpoints/last.ckpt
data:
init_args:
normalizations:
- class_path: viscy_transforms.NormalizeSampled
init_args:
keys:
- Phase3D
level: fov_statistics
subtrahend: mean
divisor: std
augmentations: []
trainer:
callbacks:
- class_path: viscy_utils.callbacks.prediction_writer.HCSPredictionWriter
init_args:
output_store: /hpc/projects/virtual_staining/training/dynacell/nucleus/fcmae_vscyto3d_scratch_segcons_ctrl/ipsc/a549__zikv/prediction.zarr
launcher:
job_name: FCMAE_VSCyto3D_Scratch_PRED_NUCL_ON_A549_ZIKV_segcons_ctrl
run_root: /hpc/projects/virtual_staining/training/dynacell/nucleus/fcmae_vscyto3d_scratch_segcons_ctrl/ipsc/a549__zikv
Loading
Loading