Skip to content

Drop mean std - #9

Merged
schilling40 merged 2 commits into
mainfrom
drop_mean_std
Oct 1, 2026
Merged

schilling40 merged 2 commits into
mainfrom
drop_mean_std

Conversation

@schilling40

Copy link
Copy Markdown
Collaborator

Drop the mean/std step

The cochlea-net pipelines no longer compute a global mean and standard deviation before the prediction. The first step of the SGN, IHC and synapse pipelines now only creates mask.zarr.

Why the step can go

Every production U-Net of cochlea-net (synapse AnisotropicUNet, SGN/IHC UNet3d) starts with InstanceNorm3d(affine=False). This layer standardizes each input block by the mean and std of the block itself. A global (x - m) / s is one affine map for the whole block, so the layer cancels it. Only eps and float rounding remain. The measured relative difference of the predictions is 6e-6 to 2e-5. The later steps read only predictions.zarr and mask.zarr. Each run saves one pass over the volume.

Changes

  • The input guards of apply_SGN, apply_IHC and apply_synapses no longer require mean_std.json. They still require mask.zarr.
  • mean_std_{SGN,IHC,synapses}.template are renamed to mask_*. Only the job name changes. The pipelines, the README and the template comments use the new names.

Compatibility and merge order

  • Merge this change before the cochlea-net change. With the old guards, the jobs of the new cochlea-net stop because mean_std.json is missing.
  • The jobs also run with the current cochlea-net. Its first step still writes mean_std.json, and the prediction applies it.
  • Archived jobs keep their mean_std_* names.

Follow-up

The mask_* jobs keep the resources of the mean/std step, for example 128G and 40 min for mask_SGN. Adapt them after the reportseff data of the first runs.

schilling40 and others added 2 commits October 1, 2026 18:24
The U-Nets of cochlea-net start with an InstanceNorm, which cancels a
global mean and standard deviation. cochlea-net stops writing
mean_std.json, so the apply jobs must not require it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The first step of the SGN, IHC and synapse pipelines now only creates
mask.zarr. Update the pipelines, the README and the comments which name
the step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@schilling40
schilling40 merged commit 166b2c4 into main Oct 1, 2026
2 checks passed
@schilling40
schilling40 deleted the drop_mean_std branch October 1, 2026 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant