SENet (Hu, Shen and Sun, 2018) added squeeze-and-excitation blocks (E7-10) to existing architectures, rescaling each residual branch's channels by gates computed from global context. SE-ResNet-50 cut ResNet-50's top-1 error from 24.8% to 23.3% for 0.26% more compute, and an SE-ResNeXt ensemble won the last ImageNet classification challenge (ILSVRC 2017) with 2.25% top-5 error. This page covers where SE goes in a network, its cost by stage and reduction ratio, and how to trim it. In the exercises you add SE to a residual branch, then compute its overhead across ResNet-50 and reproduce the paper's parameter counts for every reduction ratio: 10% more parameters but only 0.3% more compute, with 62% of the extra parameters in the last stage.
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.
Add a volume knob to every block
SENet takes a good network, such as ResNet, and adds a small squeeze-and-excitation unit to every block. Each unit looks at the whole picture, decides which of the block’s channels matter for this image, and turns them up or down before the block’s result is added back. It costs almost no extra computation and made every network it was added to more accurate. A network built this way won the final ImageNet competition in 2017.
Architecture explorer: shapes, parameters and compute
stage
output C × H × W
parameters
multiply–adds
stem
64 × 56 × 56
9.5 k
118.01 M
stage2
256 × 56 × 56
241.2 k
667.97 M
stage3
512 × 28 × 28
1.35 M
1.03 G
stage4
1024 × 14 × 14
7.89 M
1.47 G
stage5
2048 × 7 × 7
16.54 M
810.81 M
head
1000 × 1 × 1
2.05 M
2.05 M
Total: 28,088,024 parameters (28.09 M), 4.09 G multiply–adds per image at 224 × 224.
ResNet-50
25.56 M parameters
4.09 G MACs
SE-ResNet-50
28.09 M parameters
4.09 G MACs
Bars show each row's share of the total. Convolutions dominate compute because they run at every position; fully connected layers dominate parameters in older designs (AlexNet, VGG). Changing the input size changes the compute of every convolution but not its parameters. Parameter counts include biases and BatchNorm scale and shift and match torchvision's implementations.
Why engineers care
SE is a drop-in upgrade: add it to an existing backbone for a reliable accuracy gain at almost no compute cost. MobileNetV3 and EfficientNet use it, so it runs on phones, drones and satellites.
📝 Quick check (Level 0)
0/3 answered
1. SENet adds SE units to…
2. The SE unit rescales…
3. SENet won…
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.
By hand
SE-ResNet block: y = ReLU(x + s ⊙ F(x)), where F is the residual branch and s = σ(W₂ ReLU(W₁·avg(F(x)))) holds the channel gates.
Parameters per block (reduction r = 16, with biases): C²/8 + C/16 + C.
256 channels: 8,464; 2,048 channels: 526,464.
Across ResNet-50 (blocks 3, 4, 6, 3 with 256, 512, 1,024, 2,048 channels): 2,530,992 extra parameters (+9.9%), giving 28.1 M in total.
Compute: about 13.6 M extra multiply–adds (+0.3%), most of it in the pooling and rescaling of large early maps, not in the small FC layers.
Where the parameters are:
the last stage’s three 2,048-channel blocks hold 62% of the extra parameters;
removing SE there leaves +3.7%.
📝 Quick check (Level 1)
0/3 answered
1. SE parameters for one 2,048-channel block (r = 16):
2. SE's compute overhead on ResNet-50:
3. SE rescales…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 25 minUndergraduate students and practising engineers.
SE networks in code
Exercise 1.
The SE-gated residual equalled ReLU(x + s ⊙ F(x)).
A gate near zero turned the block into an identity.
Per-block SE parameter counts grew with the square of the channel count.
Practice.
Placement: after the last BN of the residual branch, before the addition. The paper’s alternatives, SE before the branch or on the identity path, worked about as well, but SE after the addition was worse.
Reduction ratio: r = 16 is the default; accuracy was nearly the same from r = 2 to 16 and slightly worse at 32.
Libraries: timm provides seresnet50, seresnext50_32x4d and related models. torchvision’s regnet_y_* models (E8-21) include SE.
Trimming: for a parameter budget, drop SE in the last stage first.
class SEBottleneck(Bottleneck): def forward(self, x): out = self.bn3(self.conv3(self.relu(self.bn2(self.conv2(self.relu(self.bn1(self.conv1(x)))))))) s = torch.sigmoid(self.fc2(torch.relu(self.fc1(out.mean((2, 3)))))) return torch.relu(self.shortcut(x) + out * s[:, :, None, None])
🐍 Exercise 1: SE on a residual branch
Implement the SE gate, an SE-gated residual block and the per-block parameter count.
📝 Quick check (Level 2)
0/3 answered
1. The worst SE placement in the paper:
2. To trim SE's parameters, drop it first in…
3. torchvision models that include SE:
Level 3: Advanced
★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.
Theory
What SE adds to a network.
Convolutions are local, and every channel is treated the same regardless of image content.
SE makes the channel weighting a function of the whole image, a form of dynamic, input-conditioned computation.
The gates in early layers were similar across classes (general features); in later layers they became class-specific.
In the last stage, gates were often nearly constant (saturated), which is why removing SE there cost little.
Parameters versus compute. SE’s fully connected layers act once per image on C numbers, so their compute is tiny. Their parameters grow as C²/r, largest where C is largest. The pooling and the rescaling act on every activation, so they are the main compute cost, though still small.
Generality. SE improved ResNet, ResNeXt, Inception, Inception-ResNet, MobileNet and ShuffleNet on ImageNet, and also detection on COCO. It became a standard component of later designs (MobileNetV3, EfficientNet, RegNetY).
📝 Quick check (Level 3)
0/3 answered
1. Late-stage SE gates were often…
2. SE's compute is mainly in…
3. SE improved…
Level 4: Expert
★★★★★ Expert⏱ 30 minResearchers: original papers and open problems.
What does SE cost a whole network?
History.
J. Hu, L. Shen and G. Sun (2018) introduced SENet at CVPR; a later journal version added S. Albanie and E. Wu.
An ensemble of SE-ResNeXt networks won ILSVRC 2017 classification with 2.251% top-5 error, the last year of the challenge.
SE was adopted in MobileNetV3, EfficientNet and RegNetY.
Exercise 2. This is a calculation, not a training run. It adds an SE block to each of ResNet-50’s 16 bottlenecks and computes the extra parameters and multiply–adds for several reduction ratios and by stage. It compares the totals with the paper’s SE-ResNet-50 sizes.
reduction r
SE-ResNet-50 parameters (M)
paper
SE multiply–adds (M)
2
45.70
45.7
31.2
4
35.64
35.7
21.1
8
30.60
30.7
16.1
16
28.09
28.1
13.6
32
26.83
26.9
12.3
stage (channels)
SE parameters (r = 16)
share
256
25,392
1%
512
133,248
5%
1,024
792,960
31%
2,048
1,579,392
62%
The calculation reproduces the paper’s parameter counts for every reduction ratio, within 0.1 M.
SE costs 10% more parameters but only 0.33% more compute at r = 16; the paper reports 0.26% by its own counting.
The last stage holds most of the SE parameters. Removing SE there leaves an overhead of 3.7%, which the paper found cost little accuracy.
🐍 Exercise 2 (research): what does SE cost a whole network?
Compute SE's parameter and compute overhead across ResNet-50 by reduction ratio and by stage, and compare with the paper.
SE in AI, robotics and aerospace
Drop-in accuracy: adding SE to an existing detector backbone is a low-risk way to gain accuracy for aerial or driving perception.
Efficient networks: SE inside MobileNetV3 and EfficientNet runs on embedded processors aboard drones and small satellites.
Parameter budgets: stage-wise trimming of SE helps fit models into tight memory for onboard upload.
References
J. Hu, L. Shen, G. Sun (2018). “Squeeze-and-excitation networks.” Proc. CVPR.
J. Hu, L. Shen, S. Albanie, G. Sun, E. Wu (2019). “Squeeze-and-excitation networks.” IEEE TPAMI 42(8).
I. Radosavovic et al. (2020). “Designing network design spaces.” Proc. CVPR.
SE adds 10% parameters and 0.33% compute to ResNet-50; 62% of its parameters are in the last stage.
Practice
Show:
Level 0
Problem 1Level 0
Default SE reduction ratio?
16.
Problem 2Level 0
Number of SE blocks in SE-ResNet-50?
3 + 4 + 6 + 3 = 16.
Problem 3Level 0
Year SENet won ILSVRC classification?
2017.
Level 1
Problem 4Level 1
SE parameters for one 256-channel block (r = 16)?
256·16 + 16 + 16·256 + 256 = 8464.
Problem 5Level 1
SE parameters for one 2,048-channel block?
2·2,048·128 + 128 + 2,048 = 526464.
Problem 6Level 1
SE parameters for one 512-channel block?
2·512·32 + 32 + 512 = 33312.
Problem 7Level 1
SE parameters in the last stage (3 blocks × 2,048 channels)?
3·526,464 = 1579392.
Level 2
Problem 8Level 2
Total SE parameters in SE-ResNet-50 (r = 16)?
2530992.
Problem 9Level 2
SE-ResNet-50 parameters in millions (r = 16)?
25.557 + 2.531 = 28.09.
Problem 10Level 2
SE-ResNet-50 parameters in millions at r = 2?
45.70.
Problem 11Level 2
Share of SE parameters in the last stage, two decimals?
1,579,392/2,530,992 ≈ 0.62.
Problem 12Level 2
SE multiply–adds in millions at r = 16?
13.6.
Problem 13Level 2
Parameter overhead in percent with SE removed from the last stage?
951,600/25,557,032 ≈ 3.7%.
Level 3
Problem 14Level 3
Show that an SE-ResNet block with all gates at 0 is the identity on non-negative inputs.
With s = 0, y = ReLU(x + 0·F(x)) = ReLU(x). For x ≥ 0 elementwise, ReLU(x) = x. Inputs to a ResNet block are outputs of an earlier ReLU and so non-negative, hence y = x. ∎
Problem 15Level 3
Explain why SE’s compute overhead is small although its parameter overhead is 10%.
The SE fully connected layers run once per image on a vector of C numbers, so their 2C²/r multiply–adds are tiny next to the convolutions, which run at every pixel. The per-pixel parts, global averaging and channel rescaling, each cost one operation per activation, far less than a convolution’s k²·C per output. Parameters, however, count the FC weights once each, and at C = 2,048 those reach half a million per block. ∎
Problem 16Level 3
Explain why dropping SE from the last stage costs little accuracy.
The paper found the last stage’s gates nearly saturated, close to constant across images, so they act almost like fixed per-channel scales that the following layers can absorb. Removing them loses little adaptive behaviour while saving 62% of SE’s parameters. ∎
Problem 17Level 3
Advise whether to add SE to a ResNet-50 backbone in a satellite image classifier with a tight parameter budget.
Yes, selectively. SE typically gains about 1.5 points of top-1 accuracy for under 0.5% more compute. Add it to stages 1–3 (+3.7% parameters) and skip the last stage, or use r = 32 everywhere (+5%). Verify the gain on the satellite validation set, and check that the onboard runtime supports the pooling-and-rescale pattern efficiently. ∎
Level 4
Problem 18Level 4
SENet’s winning ILSVRC 2017 top-5 error, in percent?
2.251.
Problem 19Level 4
SE-ResNet-50 parameters in millions at r = 32 (exercise 2)?
26.83.
Problem 20Level 4
SE-ResNet-50 compute overhead reported in the paper, in percent?
0.26.
Coding practice
🐍 Code 1 (Level 0): SE parameters
Two FC layers with biases, squeeze to C/r.
🐍 Code 2 (Level 1): stage parameters
n blocks × SE parameters.
🐍 Code 3 (Level 0): overhead
extra/base.
🐍 Code 4 (Level 1): SE multiply–adds
FC layers plus pooling and rescaling.
🐍 Code 5 (Level 0): identity gate
Is the block an identity at this gate value?
Topic test
A timed test drawn at random from this topic's question bank. Each attempt gets new questions. For a longer test across the whole chapter, see the chapter test, or mix topics in the question bag.
SENet: topic test
10 questions, drawn at random from a bank of 21. Every attempt is different.
⏱ Time limit: 15 minutes. The test submits itself when time runs out.
Levels covered: 0, 1, 2, 3, 4. No hints or solutions until you submit.