Foundations to Frontier
Tests
E. Deep Learning › E8 CNN Architectures (one page each)

SqueezeNet

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.

Level 0: Foundation

★☆☆☆☆ 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
stageoutput C × H × Wparametersmultiply–adds
conv196 × 54 × 54
14.2 k
167.66 M
fire2128 × 54 × 54
11.9 k
34.34 M
fire3128 × 54 × 54
12.4 k
35.83 M
fire4256 × 27 × 27
45.3 k
131.38 M
fire5256 × 27 × 27
49.4 k
35.83 M
fire6384 × 27 × 27
104.9 k
76.14 M
fire7384 × 27 × 27
111.0 k
80.62 M
fire8512 × 13 × 13
189.0 k
137.36 M
fire9512 × 13 × 13
197.2 k
33.23 M
classifier1000 × 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.
AlexNet61.10 M parameters714.19 M MACs
SqueezeNet 1.01.25 M parameters818.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. 1. SqueezeNet matches AlexNet with about … fewer parameters.
  2. 2. A Fire module first…
  3. 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:
    1. Replace 3 × 3 filters by 1 × 1 (9 times fewer weights each).
    2. Squeeze the channels feeding the 3 × 3 filters.
    3. 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. 1. fire2 parameters:
  2. 2. Squeeze width of a module with e = 512, SR = 0.125:
  3. 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. 1. SqueezeNet 1.1 vs 1.0:
  2. 2. SqueezeNet's classifier is…
  3. 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. 1. Off-chip DRAM access compared with arithmetic is…
  2. 2. SqueezeNet's compute vs AlexNet's:
  3. 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

  1. F. N. Iandola et al. (2016). “SqueezeNet: AlexNet-level accuracy with 50x fewer parameters and less than 0.5MB model size.” arXiv:1602.07360.
  2. S. Han, H. Mao, W. J. Dally (2016). “Deep compression: compressing deep neural networks with pruning, trained quantization and Huffman coding.” Proc. ICLR.
  3. 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.