opensi·si

timm/models/senet.py ·

SENet (legacy)

Category: CNN · Code: timm/models/senet.py · Architectures: 9 · Pretrained weights: 9 (9 with ImageNet-1k results)

SENet, SE-ResNet and SE-ResNeXt from Cadene's pretrained models (legacy_*). The module is deprecated in favour of the SE variants of the ResNet class.

Papers

  • Squeeze-and-Excitation Networks

Usage

See the Quickstart for loading pretrained weights, image preprocessing and fine-tuning, and Feature Extraction for using the models as backbones.

>>> import timm
>>> model = timm.create_model('legacy_seresnext50_32x4d.in1k', pretrained=True)
>>> data_config = timm.data.resolve_model_data_config(model)

Model API support

Feature SENet
features_only=True feature maps ✓ (strides 2, 4, 8, 16, 32)
forward_intermediates() ✓
prune_intermediate_layers() ✓
Any input size, no changes needed ✓
set_input_size() –
dynamic_img_size=True –
set_grad_checkpointing() ✗
Layer-wise LR decay (group_matcher()) ✓
reset_classifier() ✓

✓ supported, ✓ (square) works for square sizes only, ✗ not supported, – not needed (the model already accepts any input size). Checked by running each feature on a randomly initialized model (SENet with legacy_seresnet18 at 224), other architectures of the same class are expected to behave the same. See the Model API page for details.

Architectures

Architecture Params (M) GMACs Input size Pretrained weights
legacy_senet154 115.09 20.77 224 1
legacy_seresnet18 11.78 1.82 224 1
legacy_seresnet34 21.96 3.67 224 1
legacy_seresnet50 28.09 3.88 224 1
legacy_seresnet101 49.33 7.61 224 1
legacy_seresnet152 66.82 11.33 224 1
legacy_seresnext26_32x4d 16.79 2.49 224 1
legacy_seresnext50_32x4d 27.56 4.26 224 1
legacy_seresnext101_32x4d 48.96 8.02 224 1

GMACs and parameter counts are for the default input size and classifier of each architecture, from the benchmark results.

Pretrained weights

Top-1 is ImageNet-1k validation accuracy from results-imagenet.csv at the listed eval size, - if the weight has no ImageNet-1k result (e.g. pretraining or image-text weights). Classes is the size of the pretrained classifier, none for weights without one.

Weight Input size Top-1 (%) Eval size Classes License Hub
legacy_senet154.in1k 224 81.320 224 1000 apache-2.0 original
legacy_seresnet18.in1k 224 71.742 224 1000 apache-2.0 original
legacy_seresnet34.in1k 224 74.788 224 1000 apache-2.0 original
legacy_seresnet50.in1k 224 77.650 224 1000 apache-2.0 original
legacy_seresnet101.in1k 224 78.370 224 1000 apache-2.0 original
legacy_seresnet152.in1k 224 78.662 224 1000 apache-2.0 original
legacy_seresnext26_32x4d.in1k 224 77.100 224 1000 apache-2.0 original
legacy_seresnext50_32x4d.in1k 224 79.080 224 1000 apache-2.0 original
legacy_seresnext101_32x4d.in1k 224 80.274 224 1000 apache-2.0 original

Source and license

Source: timm documentation, adapted for this site. Licensing and attribution follow the terms of the upstream project.