Dataset¶
The first thing soma needs is a pair of CSV manifests:
dataset.csvdescribes the samples, labels, and optional metadata.splits.csvassigns each sample to a fold and split.
These files are the contract between your data and the pipeline. They are validated when the dataset and splits are loaded, and they define which samples are used for training, tuning, and testing.
Dataset format¶
dataset.csv- Required columns:
sample_id,image_path,label.Optional columns:mask_path(pre-computed tissue mask),patient_id(required fordataset_type="patient").Any additional columns are carried along as per-sample metadata.
Dense-supervision manifests (dataset_type="segmentation" / "detection")
replace the scalar label with a per-sample supervision file:
Segmentation uses
mask_path— a per-sample label mask.Detection uses
points_path— a per-sample point file (soma.dataset.DetectionManifest), a CSV of object centroids withx, y, classcolumns (headerlessx,y,class— OCELOT’s format — or a 2-columnx,yfor a single class). Points are stored in level-0 pixels; an optional per-samplelevel0_spacingcolumn records their frame. See Detection for the full column contract.
Splits format¶
splits.csv- Required columns:
sample_id,split.Optional column:fold(integer). Omit it for a single train/tune/test split; include it with distinct values (0, 1, 2, …) for cross-validation.Valid split names:train,tune, or any name starting withtest(e.g.test,test_external).Every fold must contain at least one test split.
Practical notes¶
Keep
sample_idstable across both files.Use
patient_idwhen you want patient-level evaluation or aggregation.Prefer explicit test split names when you have more than one held-out cohort.
Keep at least one held-out test split in every fold so comparisons are reproducible.
For a quick example of how these manifests fit into a full run, see Getting started.