Skip to content

2.4.0

Latest

Choose a tag to compare

@clemsgrs clemsgrs released this 20 Nov 12:25
· 26 commits to main since this release

This release adds whole-slide inference. soma predict runs trained segmentation and detection bundles over whole slides, and soma evaluate scores the segmentation label maps against annotation rasters. It also adds two training controls for annotation-efficiency studies: training on a listed subset, and uniform ROI sampling beyond the pool size. Finally, it moves to hs2p 6.1.1 without changing existing cache keys or experiment ids.

Added

  • Whole-slide segmentation. soma predict CONFIG and soma.predict_slides(...) write one label TIFF per slide and bundle. The map is streamed row by row, so no slide's map is ever held in memory. Bundles that share an encoder share one forward pass, and ensemble: true writes the argmax of the mean softmax. The config resolves to <out>/plan.yaml, which a later call replays or resumes. devices splits the slides across one process per device. (#725)
  • Whole-slide detection points. soma predict also takes detection bundles. It writes one parquet per slide with every peak in level-0 pixels (x, y, class, score). A per-class NMS removes duplicates across tile seams. An overlap whose margin is smaller than the NMS distance is refused before anything is written. (#731)
  • Scoring whole-slide label maps. soma evaluate scores a soma predict segmentation output against the cohort's annotation rasters. It streams both rasters window by window and prints one row of counts per slide. In Python, use soma.evaluation.SlideLabelMaps. Detection points cannot be scored yet. (#727)
  • Slide readers for whole slides. soma predict reads the slides with the reader the bundles were trained with, unless the config sets extraction.tiling.backend. A config reader that differs from the bundles' reader gives a warning. soma evaluate gains --backend and --mask-backend, which replace the readers recorded in plan.yaml. (#730)
  • Detection class scheme in bundles. A detection bundle's preprocessing.json now records its class_scheme, and soma predict copies it into every points file. soma predict refuses detection bundles trained with an earlier release: retrain them, or add class_scheme to their preprocessing.json by hand. (#735)
  • Training on a subset. cohort.train_subset names a text file of sample ids, one per line. For a run that samples ROIs from whole slides, these are ROI ids. Each fold trains on the listed ids of its train split only; tune and test do not change. A subset run gets its own experiment id and shares the caches of the full run. Runs without a subset keep their experiment ids. (#737)
  • Uniform ROI sampling beyond the pool size. With loaders.sampler: uniform, draws_per_epoch may now exceed the number of training ROIs. Each ROI is then drawn ⌊d/N⌋ or ⌈d/N⌉ times per epoch. A budget within the pool gives the same batches as before. (#736)

Changed

  • Grid bundles name their encoder. The preprocessing.json of every grid bundle now records its encoder recipe, for cached runs as well as live ones. A bundle copied out of its run can therefore still predict from pixels. The new soma.pipeline.build.bundle_encoder_stage builds the encoder stage from that recipe, and ModelBundle.path records where a bundle was loaded from. A cached bundle written by an earlier release still works from inside its run directory, or with run_dir=. (#722)
  • hs2p 6.1.1. soma now requires hs2p>=6.1.1. hs2p's new tiling.grid field (default contour) is left out of cache keys and experiment ids at its default. Caches and runs made with hs2p 6.1.0 therefore stay hits and resume in place. grid: slide gets its own keys. (#724)

Documentation

  • The OCELOT, MIDOG and MONKEY benchmark pages show the split sizes (patches or ROIs, tiles, area and annotated objects), with a few text fixes. (#726)
  • ADR 0010 now says that a project protocol lives in its own repository, which pins a soma release. examples/ holds small usage examples only. (#733)