SqueezeNet (Iandola et al., 2016) matched AlexNet's ImageNet accuracy with 50 times fewer parameters: 1.25 million, under 5 MB, and under 0.5 MB after Deep Compression. It followed three strategies: use 1 × 1 filters instead of 3 × 3 where possible, squeeze the channels feeding each 3 × 3 filter, and downsample late so that feature maps stay large. Its building block is the Fire module, a 1 × 1 squeeze layer followed by parallel 1 × 1 and 3 × 3 expand layers. This page covers Fire modules, the three strategies and model compression. In the exercises you build a Fire module, then explore SqueezeNet's design space: the formula reproduces torchvision's 1,248,424 parameters exactly, and model size grows fivefold with the squeeze ratio.
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.
AlexNet accuracy in a tiny file
AlexNet needs about 240 MB to store its weights. SqueezeNet reaches the same accuracy in under 5 MB, and under half a megabyte after compression, small enough to fit in a microcontroller’s flash or to send to a car over the air. Its trick is a module that first squeezes the number of channels with cheap 1 × 1 filters, then expands again with a mix of 1 × 1 and 3 × 3 filters.
Architecture explorer: shapes, parameters and compute
stage
output C × H × W
parameters
multiply–adds
conv1
96 × 54 × 54
14.2 k
167.66 M
fire2
128 × 54 × 54
11.9 k
34.34 M
fire3
128 × 54 × 54
12.4 k
35.83 M
fire4
256 × 27 × 27
45.3 k
131.38 M
fire5
256 × 27 × 27
49.4 k
35.83 M
fire6
384 × 27 × 27
104.9 k
76.14 M
fire7
384 × 27 × 27
111.0 k
80.62 M
fire8
512 × 13 × 13
189.0 k
137.36 M
fire9
512 × 13 × 13
197.2 k
33.23 M
classifier
1000 × 1 × 1
513.0 k
86.53 M
Total: 1,248,424 parameters (1.25 M), 818.92 M multiply–adds per image at 224 × 224.
AlexNet
61.10 M parameters
714.19 M MACs
SqueezeNet 1.0
1.25 M parameters
818.92 M 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
Smaller models mean less memory, cheaper over-the-air updates for vehicle and satellite fleets, and on-chip storage that saves energy. SqueezeNet put model size on the agenda alongside accuracy.
📝 Quick check (Level 0)
0/3 answered
1. SqueezeNet matches AlexNet with about … fewer parameters.
2. A Fire module first…
3. Smaller models help with…
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.
By hand
Fire module: squeeze 1 × 1 from c_in to s channels, then expand 1 × 1 to e₁ and 3 × 3 to e₃ channels, concatenated.
Parameters with biases: c_in·s + s + s·e₁ + e₁ + 9·s·e₃ + e₃.
fire2 (96 → 16 → 64 + 64) has 11,920, against 110,720 for a 3 × 3 convolution 96 → 128.
Three strategies:
Replace 3 × 3 filters by 1 × 1 (9 times fewer weights each).
Squeeze the channels feeding the 3 × 3 filters.
Downsample late, so most layers see large activation maps (for accuracy).
Design space:
expand widths e_i = 128 + 128·⌊i/2⌋ for fire modules i = 0…7, giving 128, 128, 256, 256, 384, 384, 512, 512;
squeeze width s = SR·e_i, with squeeze ratio SR = 0.125;
half the expand filters are 3 × 3.
Size: 1,248,424 parameters is 4.76 MB in 32-bit floats and 1.19 MB in 8-bit integers. AlexNet’s 61.1 million is 49 times larger, and 261 times larger than SqueezeNet at 6 bits per weight.
📝 Quick check (Level 1)
0/3 answered
1. fire2 parameters:
2. Squeeze width of a module with e = 512, SR = 0.125:
3. Late downsampling aims at…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 25 minUndergraduate students and practising engineers.
SqueezeNet in code
Exercise 1.
A Fire module turned 96 channels into 128, all non-negative after ReLU.
Its 11,920 parameters matched the formula, a tenth of a plain 3 × 3 convolution with the same input and output channels.
Practice.
torchvision has squeezenet1_0 (1.25 M parameters, about 0.82 G multiply–adds) and squeezenet1_1, which downsamples earlier and needs 2.4 times less compute at similar accuracy.
The classifier is a 1 × 1 convolution to 1,000 channels followed by global average pooling, with no fully connected layers.
Deep Compression (pruning, quantisation and Huffman coding; Han et al., 2016) shrank SqueezeNet to 0.47 MB with no loss of accuracy.
model = torchvision.models.squeezenet1_1(weights="IMAGENET1K_V1") # 1.24 M parameters
🐍 Exercise 1: a Fire module
Implement a Fire module and count its parameters.
📝 Quick check (Level 2)
0/3 answered
1. SqueezeNet 1.1 vs 1.0:
2. SqueezeNet's classifier is…
3. Deep Compression brought SqueezeNet to…
Level 3: Advanced
★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.
Theory
Why small models matter.
Distributed training communicates gradients proportional to model size.
Over-the-air updates to vehicles and devices cost bandwidth.
Models that fit in on-chip SRAM avoid energy-hungry off-chip DRAM access, which costs orders of magnitude more energy per access than arithmetic.
Design-space exploration. The paper treated a few hyperparameters as a “metaarchitecture” and swept them:
Squeeze ratio SR: accuracy rose up to about 0.75 and then levelled off, while size grew roughly in proportion.
3 × 3 share: accuracy levelled off at about 50%, so more 3 × 3 filters added size but not accuracy.
Bypass connections, simple identity shortcuts around some Fire modules, improved accuracy without extra parameters.
Parameters versus compute. SqueezeNet has few parameters but not few operations (0.82 G multiply–adds, more than AlexNet’s 0.71 G), because late downsampling keeps feature maps large. Later designs (MobileNet, ShuffleNet) targeted compute and latency directly.
📝 Quick check (Level 3)
0/3 answered
1. Off-chip DRAM access compared with arithmetic is…
2. SqueezeNet's compute vs AlexNet's:
3. Simple bypass connections in SqueezeNet…
Level 4: Expert
★★★★★ Expert⏱ 30 minResearchers: original papers and open problems.
Where do SqueezeNet’s parameters go?
History.
F. Iandola, S. Han, M. Moskewicz, K. Ashraf, W. Dally and K. Keutzer (2016) introduced SqueezeNet.
S. Han, H. Mao and W. Dally (2016) introduced Deep Compression.
SqueezeNet influenced embedded vision and later compact designs such as SqueezeDet, for detection in self-driving cars.
Exercise 2. This is a calculation, not a training run. It implements SqueezeNet’s design space and counts parameters as the squeeze ratio and the share of 3 × 3 expand filters vary, holding the other at its default:
squeeze ratio (3 × 3 share 0.5)
parameters
MB, 32-bit
0.125 (default)
1,248,424
4.8
0.25
1,967,080
7.5
0.5
3,404,392
13.0
0.75
4,841,704
18.5
1.0
6,279,016
24.0
3 × 3 share (squeeze ratio 0.125)
parameters
MB, 32-bit
0.01
766,888
2.9
0.5 (default)
1,248,424
4.8
0.99
1,729,960
6.6
The default point reproduces torchvision’s count exactly.
The squeeze ratio is the main size knob, a fivefold change across its range. The 3 × 3 share matters less, about 2.3-fold, because squeezed inputs make even 3 × 3 filters cheap.
Accuracy is not computed here. In the paper it rose with both knobs and levelled off around a squeeze ratio of 0.75 and a 3 × 3 share of 50%, so the default deliberately trades some accuracy for a four times smaller model.
🐍 Exercise 2 (research): where do the parameters go?
Implement SqueezeNet's design space and count parameters as the squeeze ratio and 3 × 3 share vary.
Small models in AI, robotics and aerospace
Fleet updates: small models reduce bandwidth for over-the-air updates to vehicles, drones and satellites.
Microcontrollers: SqueezeNet-sized models with 8-bit weights fit in the flash memory of embedded processors used in sensors and small robots.
Energy: keeping weights on-chip saves energy, which matters for battery-powered and solar-powered platforms.
References
F. N. Iandola et al. (2016). “SqueezeNet: AlexNet-level accuracy with 50x fewer parameters and less than 0.5MB model size.” arXiv:1602.07360.
S. Han, H. Mao, W. J. Dally (2016). “Deep compression: compressing deep neural networks with pruning, trained quantization and Huffman coding.” Proc. ICLR.
B. Wu, F. Iandola, P. Jin, K. Keutzer (2017). “SqueezeDet: unified, small, low power fully convolutional neural networks for real-time object detection for autonomous driving.” CVPR workshops.
Across its range the squeeze ratio changed model size fivefold, the 3 × 3 share about 2.3-fold.
Practice
Show:
Level 0
Problem 1Level 0
Number of Fire modules in SqueezeNet?
fire2 to fire9: 8.
Problem 2Level 0
SqueezeNet’s default squeeze ratio?
0.125.
Problem 3Level 0
Number of design strategies in the SqueezeNet paper?
3.
Level 1
Problem 4Level 1
Parameters of fire2 (96 → 16 → 64 + 64, with biases)?
1,552 + 1,088 + 9,280 = 11920.
Problem 5Level 1
Parameters of fire9 (512 → 64 → 256 + 256)?
32,832 + 16,640 + 147,712 = 197184.
Problem 6Level 1
Expand width of fire module i = 4?
128 + 128·2 = 384.
Problem 7Level 1
SqueezeNet’s size in MB (2²⁰ bytes) at 32 bits per weight, two decimals?
1,248,424·4/2²⁰ ≈ 4.76.
Level 2
Problem 8Level 2
Parameters of SqueezeNet 1.0?
1248424.
Problem 9Level 2
Parameters at squeeze ratio 1.0 (exercise 2)?
6279016.
Problem 10Level 2
Parameters with 1% 3 × 3 filters?
766888.
Problem 11Level 2
Ratio of AlexNet’s parameters (61,100,840) to SqueezeNet’s, one decimal?
≈ 48.9.
Problem 12Level 2
Ratio of parameters at squeeze ratio 1.0 to 0.125, two decimals?
6,279,016/1,248,424 ≈ 5.03.
Problem 13Level 2
Ratio of fire2’s parameters to a 3 × 3 conv 96 → 128 with bias (110,720), three decimals?
11,920/110,720 ≈ 0.108.
Level 3
Problem 14Level 3
Show that a Fire module’s 3 × 3 expand cost does not depend on its input width.
The 3 × 3 expand filters read only the s squeezed channels, so they have 9·s·e₃ weights and, at resolution H, H²·9·s·e₃ multiply–adds. The input width c_in appears only in the 1 × 1 squeeze layer, c_in·s. ∎
Problem 15Level 3
Explain why SqueezeNet has fewer parameters but more compute than AlexNet.
Parameters count each weight once; compute counts each weight once per output position. SqueezeNet removes AlexNet’s huge fully connected layers, which hold most of its parameters but are applied only once, and keeps large feature maps by downsampling late. So its convolutions run at many positions, giving about 0.82 G multiply–adds against AlexNet’s 0.71 G. ∎
Problem 16Level 3
Explain why the squeeze ratio affects size more than the 3 × 3 share.
The squeeze width s multiplies every term of the expand layers (s·e₁ + 9·s·e₃) and also sets the squeeze layer’s c_in·s, so raising SR scales most of the module. The 3 × 3 share only shifts weights between s·e₁ and 9·s·e₃ with s fixed at a small value, which changes the total by at most a factor of about 9 on part of the module. In practice that is 2.3-fold against fivefold. ∎
Problem 17Level 3
Advise how to fit an image classifier into 1 MB of microcontroller flash.
Start from a compact architecture such as SqueezeNet 1.1 or MobileNet at reduced width, about 1 million parameters or fewer. Quantise to 8 bits, which gives about 1 MB, or prune and quantise further. Use global pooling instead of fully connected layers. Check activation memory too, since RAM is often tighter than flash, and measure accuracy after quantisation on the device’s real images. ∎
Level 4
Problem 18Level 4
SqueezeNet’s size after Deep Compression, in MB?
0.47.
Problem 19Level 4
Parameters at squeeze ratio 0.75 (exercise 2)?
4841704.
Problem 20Level 4
Compute reduction factor of SqueezeNet 1.1 over 1.0?
2.4.
Coding practice
🐍 Code 1 (Level 1): Fire parameters
Squeeze plus both expand layers.
🐍 Code 2 (Level 0): model size
params·bits/8 in MB (2²⁰ bytes).
🐍 Code 3 (Level 0): expand width
base + incr·⌊i/freq⌋.
🐍 Code 4 (Level 0): squeeze width
round(SR·e).
🐍 Code 5 (Level 1): compression ratio
Storage of model a over model b.
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.
SqueezeNet: 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.