Skip to content

Package squeeze_and_excitation Doesn't Exist #9276

Open

Description

@ericspod

Describe the bug
The Quicknat class, layers, and tests were introduced in #6306. These rely on the package squeeze_and_excitation which doesn't exist on PyPI so was never installed. The test that is conditioned on it being installed never runs so this hasn't been noticed. Squeeze-and-excitation layers are present in PyTorch now so these types and the associated tests should be updated.

Activity

  1. ericspod commented on Nov 12, 2026

    @ericspod
    MemberAuthor

    CC @vgonzalezd @KumoLiu this was noticed recently in work for #9112.

  2. BakaryGibba commented on Nov 13, 2026

    @BakaryGibba

    Hi @ericspod, I'd like to take this one if nobody is on it yet.

    PyTorch and torchvision only ship a channel squeeze-and-excitation layer, and MONAI already has that as ChannelSELayer. The missing pieces are the spatial (sSE) and concurrent (scSE) variants from Roy et al. 2018, which is what Quicknat imports from squeeze_and_excitation. My plan:

    • add SpatialSELayer and ChannelSpatialSELayer to monai/networks/blocks/squeeze_and_excitation.py, supporting 1D/2D/3D and following the original definitions (sSE: 1x1 conv to one channel + sigmoid; scSE: element-wise max of cSE and sSE);
    • use them in Quicknat.get_selayer and remove the optional_import;
    • drop the skipUnless in test_quicknat.py so the CSE/SSE/CSSE cases actually run, and add unit tests for the new blocks.

    Does that approach work for you, or would you prefer a different direction?

  3. ericspod commented on Nov 13, 2026

    @ericspod
    MemberAuthor

    Thanks @BakaryGibba, please do go ahead with this one, I think your approach sounds good but we can always review and adjust in the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions