ResNet let us go deeper safely, but researchers still scaled networks by intuition—more layers here, wider channels there. EfficientNet (Tan & Le, Google, 2019) asked: what is the optimal way to scale? Their answer, compound scaling, balances depth, width, and input resolution with a single coefficient—reaching higher accuracy with far fewer FLOPs and parameters.
Learning Objectives
By the end of this lesson, students should be able to:
- Explain the three scaling dimensions: depth, width, and resolution.
- Describe compound scaling and its single coefficient φ.
- Identify the MBConv (inverted residual) block at EfficientNet’s core.
- Compare the EfficientNet-B0 to B7 family and their accuracy/FLOP trade-offs.
- Load EfficientNet via
torchvisionortimm. - Explain why EfficientNet is a strong default backbone today.
Compound scaling uniformly scales network depth (d = αφ), width (w = βφ), and resolution (r = γφ) with a single user coefficient φ, where α·β²·γ² ≈ 2. Instead of scaling one dimension arbitrarily, all three grow in balance, giving better accuracy per unit of compute.
Why Balance Beats One Dimension
Scaling only depth (like very deep ResNets) hits diminishing returns; only width captures fine features but misses high-level ones; only resolution needs matching capacity to use the extra pixels. EfficientNet showed that increasing all three proportionally is consistently more efficient. Starting from a NAS-designed baseline (EfficientNet-B0), scaling φ produces B1–B7.
| Model | Input res | Params | ImageNet top-1 | Relative cost |
|---|---|---|---|---|
| EfficientNet-B0 | 224 | ~5.3M | ~77.1% | 1× |
| EfficientNet-B3 | 300 | ~12M | ~81.6% | ~4× |
| EfficientNet-B4 | 380 | ~19M | ~82.9% | ~9× |
| EfficientNet-B7 | 600 | ~66M | ~84.3% | ~37× |
For comparison: EfficientNet-B0 matches ResNet-50’s accuracy with roughly a fifth of the parameters.
Key Innovation
- Compound scaling coefficient φ
- MBConv (inverted residual) blocks
- Squeeze-and-Excitation attention
- NAS-designed B0 baseline
What It Improves
- Accuracy per FLOP
- Accuracy per parameter
- Principled (not ad-hoc) scaling
- A whole family from one recipe
Loading EfficientNet in PyTorch
Reality: EfficientNet optimizes accuracy per FLOP, not necessarily wall-clock latency. Its depthwise convolutions can be memory-bandwidth bound on some hardware; for raw mobile speed, MobileNet or hardware-specific models may win.
Each EfficientNet variant was trained at a specific resolution (B0=224, B3=300, B7=600). Feeding B7 a 224×224 image throws away its main advantage. Always use the model’s intended resolution via weights.transforms() or timm’s default_cfg.
Knowledge Check
- Short Answer: Name the three dimensions compound scaling balances. Answer: Depth, width, and resolution.
- True/False: EfficientNet was introduced in 2019 by Google. Answer: True.
- Multiple Choice: Compound scaling uses: (a) one coefficient φ, (b) three separate networks, (c) no scaling, (d) random search each time. Answer: (a).
- Short Answer: What is EfficientNet’s core building block called? Answer: MBConv (inverted residual).
- True/False: EfficientNet-B0 needs more parameters than ResNet-50 for similar accuracy. Answer: False—far fewer.
- Multiple Choice: Which variant uses the largest input resolution? (a) B0, (b) B3, (c) B4, (d) B7. Answer: (d), 600.
- Short Answer: Which attention mechanism sits inside MBConv blocks? Answer: Squeeze-and-Excitation.
- True/False: EfficientNet always has the lowest latency of any model. Answer: False (it optimizes FLOPs, not always wall-clock).
- Multiple Choice: The B0 baseline was found via: (a) hand tuning, (b) neural architecture search, (c) genetic art, (d) VGG rules. Answer: (b).
- Short Answer: Give one reason to match a model’s intended input resolution. Answer: Accuracy drops / advantage lost if resolution mismatches training.
Key Takeaways
- EfficientNet scales depth, width, and resolution together via one coefficient φ.
- Compound scaling yields better accuracy per FLOP and per parameter.
- The MBConv (inverted residual) + Squeeze-Excitation block is its core.
- The B0–B7 family trades accuracy for compute along one recipe.
- Next: MobileNet takes efficiency to phones and edge devices.
Exercise: Fine-tune EfficientNet-B0 and ResNet-50 on the same small dataset; compare accuracy, parameter count, and training time to make the efficiency argument concrete.
Discussion: Why might a “fewer FLOPs” model still be slower on a given GPU? Introduce the idea of memory bandwidth vs compute—a bridge to the MobileNet lecture.