Skip to content

SSL crappify to SEMANTIC_SEG transfer: model outputs full-image binarization despite SKIP_UNMATCHED_LAYERS=true #165

@Ranim-Benkhlifa

Description

@Ranim-Benkhlifa

Hi BiaPy developers,

I am working on a 3D semantic segmentation task in BiaPy v3.6.8 and would like to ask whether SSL (crappify) to SEMANTIC_SEG transfer is fully supported in this version.

I pretrained a resunet with crappify (SSL converges well, reconstructions look meaningful) and tried to use the checkpoint as initialization for the downstream task, with the same architecture and same normalization. My labels are binary masks of the target class only.

The downstream model trains but the final prediction is a binarization of the entire image (all cellular structures as foreground) instead of segmenting only the target class. The same config trained from scratch produces a correct segmentation so the issue is specifically the checkpoint loading.

Following issue #132 and inspection of config.py and misc.py for v3.6.8, I use:

MODEL:
LOAD_CHECKPOINT: true
LOAD_CHECKPOINT_ONLY_WEIGHTS: true
LOAD_MODEL_FROM_CHECKPOINT: true # required for SKIP_UNMATCHED_LAYERS to activate
SKIP_UNMATCHED_LAYERS: true

Is this the intended combination, or am I missing something? I also noticed master replaces these flags with MODEL.ITEMS_TO_LOAD_FROM_CHECKPOINT , is that newer mechanism required for this use case, suggesting v3.6.8 may not fully support it?

Environment: BiaPy v3.6.8, Python 3.11.14, PyTorch 2.9.1, Apptainer/Singularity on HPC.

Thanks a lot!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions