Skip to content

Add shared UResNet for segmentation, PPN, and fragmentation - #190

Open
francois-drielsma wants to merge 4 commits into
mainfrom
feature/uresnet-multi
Open

francois-drielsma wants to merge 4 commits into
mainfrom
feature/uresnet-multi

Conversation

@francois-drielsma

Copy link
Copy Markdown
Member

Description

Add uresnet_multi to run semantic segmentation, point proposal, and Graph-SPICE fragmentation from a single UResNet backbone, with model/loss registration, full-chain integration, documentation, and training/inference configs.

Support four semantic coupling modes:

  • hard: construct separate graphs for predicted semantic classes.
  • independent: construct graphs without semantic conditioning and pool voxel probabilities for final fragment classes.
  • fragment_first: classify fragments using pooled backbone features.
  • soft: condition edge scores on semantic probabilities.

Final fragment classes are propagated to member voxels to ensure semantic coherence, while preserving raw voxel predictions. Extract reusable Graph-SPICE heads and unbalanced UResNet+PPN losses, preserving standalone interfaces and checkpoint parameter paths.

Motivation and Context

Enable S3DF comparisons of shared-backbone reconstruction against the existing UResNet+PPN and Graph-SPICE baseline, including the effect of semantic coupling on fragmentation.

Type of Change

  • New feature
  • Documentation update
  • Code quality improvement

How Has This Been Tested?

  • Broader regression suite: 590 passed, one GPU-only test skipped; one unrelated local ancestor config test deselected.
  • Real-data training/inference coverage: eight tests passed across all four modes.
  • After the embedding inheritance fix: all 101 Graph-SPICE/shared-model tests passed.
  • Targeted pylint checks for overriding argument signatures passed.
  • Pre-commit checks, including Black, isort, flake8, YAML and whitespace checks, passed.

Focused regression command inside the SPINE Docker image, with the repository on PYTHONPATH:

python -m pytest -q test/test_model/test_graph_spice test/test_model/test_uresnet/test_multi --disable-warnings --maxfail=2

Model tests ran on CPU using ghcr.io/deeplearnphysics/spine:latest under Linux/amd64 emulation, with PyTorch 2.5.1+cu121 and MinkowskiEngine.

Checklist

  • Code follows project style guidelines
  • Changes reviewed and documented
  • Comments added for non-obvious behavior
  • Feature and regression tests added and passing
  • Corresponding documentation and example configs added

Additional Notes

S3DF training and baseline comparisons remain to be run; no reconstruction-quality or runtime improvement is claimed yet. Configs are under config/uresnet/multi/. Inputs require upstream deghosting, and pooled/learned fragment semantics require clustering during training and inference.

@codecov

codecov Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (8fb63b1) to head (10bb48d).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##              main      #190    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files          440       449     +9     
  Lines        39336     40142   +806     
==========================================
+ Hits         39336     40142   +806     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/spine/model/factories.py 100.00% <ø> (ø)
src/spine/model/full_chain/providers/multi.py 100.00% <100.00%> (ø)
src/spine/model/full_chain/registry.py 100.00% <ø> (ø)
src/spine/model/graph_spice/__init__.py 100.00% <100.00%> (ø)
src/spine/model/graph_spice/embedder.py 100.00% <100.00%> (ø)
src/spine/model/graph_spice/kernel.py 100.00% <100.00%> (ø)
src/spine/model/graph_spice/model.py 100.00% <100.00%> (ø)
src/spine/model/manager.py 100.00% <100.00%> (ø)
src/spine/model/uresnet/multi/__init__.py 100.00% <100.00%> (ø)
src/spine/model/uresnet/multi/loss.py 100.00% <100.00%> (ø)
... and 3 more

... and 16 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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