Skip to content

Make SegNeuron inference usable and preserve the original code in legacy - #7

Merged
yanchaoz merged 2 commits into
mainfrom
codex/segneuron-reliability
Sep 16, 2026
Merged

yanchaoz merged 2 commits into
mainfrom
codex/segneuron-reliability

Conversation

@yanchaoz

Copy link
Copy Markdown
Owner

SegNeuron's inference and FRMC scripts currently contain hard-coded paths, require labels for unlabeled inference, and do not save the instance output. This change adds usable CLI inputs and outputs, preserves the published MNet and ELF multicut method, and documents the working commands.

  • Preserve all 107 files from ccb0ba2c5e28e0d2c454e7320c341e71f4eb148c byte-for-byte in legacy/, including the original code, README, notebook and dependency export. The snapshot is marked vendored to keep the active diff reviewable.
  • Add uint8 ZYX TIFF/NPY inference on CPU or an explicit CUDA device, correct small/odd/non-square tiling, strict checkpoint loading, input/checkpoint hashes and overwrite protection.
  • Keep FRMC foreground fusion, watershed settings and the ELF multicut solver; add input validation, positive uint32 label output, and optional same-grid neuron-GT metrics.
  • Repair the narrow training startup defects: undefined provider, extra loop argument, missing model_type, inclusive random-index bound, Python 3.10 configuration imports and iteration count. Respect caller GPU selection.
  • Replace the machine-specific requirements export with small inference/training dependencies and a pinned ELF 0.8.1 environment; update README while retaining research context and dataset citations.

Validation:

  • 20 local CPU tests passed; real-ELF integration runs separately in Linux CI with SEGNEURON_REQUIRE_ELF=1, so unavailable backend tests fail rather than skip.
  • The official checkpoint (3767a3793cbbdbf98041b8c4c270b92d2355213d11605568c003322bb759bef5) ran on real Synapse178 crops of 18×128×128 and 21×129×145; outputs retain exact input shapes and finite probabilities in [0,1].
  • All 107 archived files match the original Git blob hashes.
  • Linux CI validates both the CPU workflow and actual ELF multicut, including partition equivalence to the archived implementation over four beta values: https://github.com/yanchaoz/SegNeuron/actions/runs/35102984484

This validates runtime behavior and compatibility on the stated examples. Full GPU retraining, paper-benchmark reproduction, and segmentation-accuracy evaluation on expert neuron ground truth have not been run.

@yanchaoz
yanchaoz marked this pull request as ready for review September 16, 2026 13:40
@yanchaoz
yanchaoz merged commit ea6f0c9 into main Sep 16, 2026
4 checks passed
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