Repository navigation
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 CONFIGandsoma.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, andensemble: truewrites the argmax of the mean softmax. The config resolves to<out>/plan.yaml, which a later call replays or resumes.devicessplits the slides across one process per device. (#725) - Whole-slide detection points.
soma predictalso 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 evaluatescores asoma predictsegmentation output against the cohort's annotation rasters. It streams both rasters window by window and prints one row of counts per slide. In Python, usesoma.evaluation.SlideLabelMaps. Detection points cannot be scored yet. (#727) - Slide readers for whole slides.
soma predictreads the slides with the reader the bundles were trained with, unless the config setsextraction.tiling.backend. A config reader that differs from the bundles' reader gives a warning.soma evaluategains--backendand--mask-backend, which replace the readers recorded inplan.yaml. (#730) - Detection class scheme in bundles. A detection bundle's
preprocessing.jsonnow records itsclass_scheme, andsoma predictcopies it into every points file.soma predictrefuses detection bundles trained with an earlier release: retrain them, or addclass_schemeto theirpreprocessing.jsonby hand. (#735) - Training on a subset.
cohort.train_subsetnames 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_epochmay 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.jsonof 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 newsoma.pipeline.build.bundle_encoder_stagebuilds the encoder stage from that recipe, andModelBundle.pathrecords where a bundle was loaded from. A cached bundle written by an earlier release still works from inside its run directory, or withrun_dir=. (#722) - hs2p 6.1.1. soma now requires
hs2p>=6.1.1. hs2p's newtiling.gridfield (defaultcontour) 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: slidegets its own keys. (#724)