VerifiedarXiv:1905.1194626 min
Vision · Architecture

EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks

Scale a convolutional network's depth, width and input resolution together by fixed ratios, and it reaches higher accuracy for the same compute than scaling any one of them.

EfficientNet sets depth to 1.2φ, width to 1.1φ and input resolution to 1.15φ, so each step of the coefficient φ roughly doubles the FLOPS. Applied to a small network found by architecture search, the rule gives eight models, B0 to B7. B7 matched the best ImageNet accuracy of 2019, 84.3% top-1, with 8.4 times fewer parameters than the previous record holder.

Explaining the paperEfficientNet: Rethinking Model Scaling for Convolutional Neural NetworksTan, Le · Google Brain · ICML 2019 · arXiv:1905.11946 ↗

This page counts what each dimension costs, rebuilds B0 to B7 layer by layer from the official code (their coefficients do not follow one φ each), opens up the MBConv block that does the computing, and separates the scaling rule's share of the gains from the share of the baseline and the training recipe.

Three ways to make a ConvNet bigger

An image classifier is usually designed at one size and then enlarged when more compute is available. In 2019 there were three standard ways to enlarge a convolutional network (ConvNet). ResNet grew by depth, from 18 layers to 200. Wide ResNets and MobileNets grew by width, the number of channels in each layer. GPipe, the ImageNet record holder when this paper appeared, used input images of 480 by 480 pixels instead of the usual 224.

The three dimensions are easiest to see in the shapes of the tensors. A ConvNet layer takes a feature map of shape ⟨H,W,C⟩\langle H, W, C\rangle (height, width in pixels, channels) and produces another. The paper groups layers into stages, where every layer in a stage has the same type and the stage repeats it LiL_i times, and writes a whole network as

N=⨀i=1…sFiLi(X⟨Hi,Wi,Ci⟩)\mathcal{N} = \bigodot_{i=1\ldots s} \mathcal{F}_i^{L_i}\big(X_{\langle H_i, W_i, C_i\rangle}\big)
(1)

where Fi\mathcal{F}_i is the layer type of stage ii, the circle-dot means composition (stage 1 first), and ⟨Hi,Wi,Ci⟩\langle H_i, W_i, C_i\rangle is the input shape of stage ii. EfficientNet-B0, the baseline this paper builds, has nine stages. Its input is ⟨224,224,3⟩\langle 224, 224, 3\rangle; a 3×3 convolution with stride 2 turns that into ⟨112,112,32⟩\langle 112, 112, 32\rangle, and seven stages of MBConv layers (described below) shrink the spatial size to 7×7 while the channels grow to 320. A final 1×1 convolution to 1280 channels, an average over the 7×7 positions and a fully connected layer produce 1000 class scores.

Scaling keeps every layer type Fi\mathcal{F}_i fixed and changes only the numbers around it. Depth multiplies every LiL_i by a coefficient dd, width multiplies every CiC_i by ww, and resolution multiplies HiH_i and WiW_i by rr. The paper scales all stages by the same three coefficients, so finding the best enlarged network under a compute budget reduces to choosing three numbers:

max⁡d,w,r Accuracy(N(d,w,r))s.t. N(d,w,r)=⨀i=1…sF^i d⋅L^i(X⟨r⋅H^i, r⋅W^i, w⋅C^i⟩)s.t. Memory(N)≤target_memorys.t. FLOPS(N)≤target_flops\begin{aligned} &\max_{d,w,r}\ \mathrm{Accuracy}\big(\mathcal{N}(d,w,r)\big) \\ &\text{s.t.}\ \mathcal{N}(d,w,r) = \bigodot_{i=1\ldots s} \hat{\mathcal{F}}_i^{\,d\cdot \hat{L}_i}\big(X_{\langle r\cdot\hat{H}_i,\, r\cdot\hat{W}_i,\, w\cdot\hat{C}_i\rangle}\big) \\ &\phantom{\text{s.t.}}\ \mathrm{Memory}(\mathcal{N}) \le \text{target\_memory} \\ &\phantom{\text{s.t.}}\ \mathrm{FLOPS}(\mathcal{N}) \le \text{target\_flops} \end{aligned}
(2)

Hats mark the baseline's values. For B0, L^\hat{L} runs 1, 2, 2, 3, 3, 4, 1 over the seven MBConv stages, 16 layers in all. Setting d=2d = 2 gives 32 layers, w=2w = 2 doubles every channel count (32 to 64 in the stem, 320 to 640 in the last stage), and r=2r = 2 means 448×448 input images. FLOPS here means the number of multiply-add operations needed to classify one image; the paper counts a multiply and the add that follows it as one operation, which is how B0 comes out at 0.39 billion. Accuracy is ImageNet top-1: the fraction of the 50,000 validation images for which the class with the highest score, out of 1000, is the correct one.

Equation (2) is too expensive to solve directly, since every candidate is a network that has to be trained on ImageNet. The paper first studies one dimension at a time.

Scaling one dimension at a time

Each dimension has a plausible reason to help. A deeper network composes more layers, so it can build more complex features out of simpler ones. A wider network has more channels per layer, more distinct patterns it can detect at each stage. A higher-resolution input carries finer detail: at 224 pixels a bird's eye may span a handful of pixels, at 448 four times as many.

Each also runs out. ResNet-1000 is about as accurate as ResNet-101. Very wide but shallow networks fail to build high-level features. Image resolution helps until the object is already well resolved. The paper's Figure 3 scales B0 in each dimension separately, up to w=5w = 5, d=8d = 8 and r=2.5r = 2.5 (560 pixels). In each case accuracy climbs quickly at first and flattens once it reaches about 80% top-1. The paper states this as

Observation 1: Scaling up any dimension of network width, depth, or resolution improves accuracy, but the accuracy gain diminishes for bigger models.

Figure 1 below plots the experiments where the paper puts single-dimension and compound scaling side by side at matched compute. Each baseline was enlarged to roughly four times its FLOPS: by depth alone (d=4d = 4), width alone (w=2w = 2), resolution alone (r=2r = 2), or all three at once. Compare the teal bar with the best amber bar on each baseline.

Figure 1 · single dimensions vs compound, same budget

EfficientNet-B0: compound 81.1% vs best single dimension (resolution r=2) 79.1%, a gap of 2.0 points

ImageNet top-1 for four baselines scaled to about 4× their FLOPS, from the paper's Table 3 and Table 7. The dashed line marks the unscaled baseline, amber bars scale one dimension, teal scales all three. Switch baselines with the buttons; MobileNetV1 has no depth-only row in the paper.

Compound scaling wins on every baseline, by 0.6 points on MobileNetV2, 0.7 on ResNet-50, 1.4 on MobileNetV1 and 2.0 on EfficientNet-B0. On B0 the three single dimensions land within 0.2 points of each other (78.9 to 79.1%), 2.0 points below compound scaling.

What each dimension costs in FLOPS

To share a budget among the three, you need the price of each. Take one regular convolution with a k×kk \times k kernel that maps a H×W×CinH \times W \times C_\text{in} feature map to H×W×CoutH \times W \times C_\text{out}. Every output value is a weighted sum over a k×k×Cink \times k \times C_\text{in} window, so the layer costs

MACs=H⋅W⋅k2⋅Cin⋅Cout\text{MACs} = H \cdot W \cdot k^2 \cdot C_\text{in} \cdot C_\text{out}

multiply-accumulates. Now apply the three coefficients. Depth dd multiplies the number of such layers, so the cost grows by dd. Width ww multiplies both CinC_\text{in} and CoutC_\text{out}, so the cost grows by w2w^2. Resolution rr multiplies both HH and WW, so the cost grows by r2r^2. Summed over a network made of such layers,

FLOPS∝d⋅w2⋅r2\text{FLOPS} \propto d \cdot w^2 \cdot r^2

Doubling the compute therefore takes d=2d = 2, or w=2≈1.41w = \sqrt{2} \approx 1.41, or r=2r = \sqrt{2} (a 317-pixel image instead of 224). Counting B0 layer by layer with those settings gives 2.03×, 1.93× and 2.03× its compute, close to the formula.

The formula assumes regular convolutions. Each of B0's MBConv layers also contains a depthwise convolution, which filters each channel on its own: it costs H⋅W⋅k2⋅CH \cdot W \cdot k^2 \cdot C, linear in the channel count, so it grows with ww instead of w2w^2. In B0 the depthwise convolutions are only 9.0% of the multiply-accumulates. The 1×1 convolutions that expand and project channels inside each MBConv layer take 43.1% and 39.5%, the 1×1 head another 5.2%, and all of those scale with w2w^2. So doubling B0's width costs 3.76×, a little less than 4×.

In Figure 2 the top bar is the formula, split on a log scale into the doublings each factor costs; the bottom bar is the counted total for the network the sliders describe. The presets reproduce the scalings of Figure 1.

Figure 2 · the FLOPS price of depth, width and resolution

26 MBConv layers · stem 40 ch · last stage 384 ch · head 1536 ch · final feature map 10×10

EfficientNet-B0 scaled by depth, width and resolution. The top bar is the estimate d⋅w2⋅r2d \cdot w^2 \cdot r^2 on a log₂ axis, so each factor's length is the number of doublings it costs; the bottom bar counts the scaled network layer by layer, and the teal tick marks the estimate on it. Drag the sliders to their ends, or pick a preset.

The figure opens on the compound setting of Table 7 (d = 1.4, w = 1.2, a 292-pixel input), where the estimate is 3.4× and the counted network 4.7× (Table 7 lists 0.4B to 1.8B). The baseline button empties both bars: B0 is 0.386 billion multiply-accumulates. From there, push depth to 1.1 and the counted bar jumps by more than the estimate, because B0 has stages of one and two layers, and a 1.1× multiplier rounds one layer up to two. The code always rounds the layer count up (the paper's footnote 3 mentions rounding), and on a network with stages this short the rounding is large. With width and resolution at their maximum the counted bar falls short of the estimate, because of the depthwise share.

Why the dimensions should grow together

The second experiment in Section 3 scales width while holding depth and resolution at four combinations: (d,r)=(1,1)(d, r) = (1, 1), (2,1)(2, 1), (1,1.3)(1, 1.3) and (2,1.3)(2, 1.3). With d=1d = 1 and r=1r = 1, widening the network saturates quickly. With d=2d = 2 and r=1.3r = 1.3 (36 layers at 299 pixels), the same widening reaches clearly higher accuracy at the same FLOPS.

Two mechanisms explain why. The first is the receptive field, the patch of input pixels one output value can depend on. A 3×3 layer working on a feature map that has been downsampled 8× widens the receptive field by 2×8=162 \times 8 = 16 input pixels; the field grows only by adding layers. At 224 pixels, suppose an object spans 100 pixels; at 448 it spans 200, while every layer's receptive field, measured in pixels, is unchanged. Unless depth grows too, the late layers' receptive fields cover a smaller fraction of the object than before. The second is the number of channels. A larger image resolves more distinct patterns (individual feathers rather than texture), and each pattern a stage can detect needs channels to represent it, so higher resolution with the same channel count runs out of places to put the extra detail.

An analogy: a document scanned at twice the resolution. To read the same word, a reader looking through a fixed-size window needs a larger window (more depth), and the sharper scan only helps if the reader can tell more letter shapes apart (more width). The analogy breaks in one place: a network is not required to recognize the same features at the higher resolution, and the extra pixels can carry information the low-resolution image did not contain.

Observation 2: In order to pursue better accuracy and efficiency, it is critical to balance all dimensions of network width, depth, and resolution during ConvNet scaling.

Earlier architecture-search papers (NASNet, AmoebaNet) had balanced width and depth by hand. This paper fixes the balance once, with the rule in equation (3) below, and applies the same ratios at every model size.

How compound scaling works

Compound scaling ties the three coefficients to one number, the compound coefficient ϕ\phi:

depth: d=αϕwidth: w=βϕresolution: r=γϕs.t. α⋅β2⋅γ2≈2,α≥1, β≥1, γ≥1\begin{aligned} &\text{depth: } d = \alpha^{\phi} \qquad \text{width: } w = \beta^{\phi} \qquad \text{resolution: } r = \gamma^{\phi} \\ &\text{s.t. } \alpha \cdot \beta^2 \cdot \gamma^2 \approx 2, \qquad \alpha \ge 1,\ \beta \ge 1,\ \gamma \ge 1 \end{aligned}depth: d=αϕwidth: w=βϕresolution: r=γϕs.t. α⋅β2⋅γ2≈2,α≥1, β≥1, γ≥1\begin{aligned} &\text{depth: } d = \alpha^{\phi} \\ &\text{width: } w = \beta^{\phi} \\ &\text{resolution: } r = \gamma^{\phi} \\ &\text{s.t. } \alpha \cdot \beta^2 \cdot \gamma^2 \approx 2, \\ &\alpha \ge 1,\ \beta \ge 1,\ \gamma \ge 1 \end{aligned}
(3)

α\alpha, β\beta and γ\gamma set the ratio between the dimensions, and ϕ\phi sets the overall size. Since FLOPS grow as d⋅w2⋅r2d \cdot w^2 \cdot r^2, a network scaled by (3) costs (αβ2γ2)ϕ(\alpha \beta^2 \gamma^2)^{\phi} times the baseline, and the constraint makes that about 2ϕ2^{\phi}: each unit of ϕ\phi doubles the compute.

The constants are found in two steps:

  1. Fix ϕ=1\phi = 1, a budget of twice B0's FLOPS, and grid-search α\alpha, β\beta, γ\gamma under the constraint, training each candidate. The best values for B0 are α=1.2\alpha = 1.2, β=1.1\beta = 1.1, γ=1.15\gamma = 1.15.
  2. Keep those constants and raise ϕ\phi to get larger models, with no further search.

The search runs only on the small model, where training a candidate is cheap. The paper notes that searching α,β,γ\alpha, \beta, \gamma directly around a large model could do better, at a cost it calls prohibitive. The constraint leaves two free numbers (pick α\alpha and β\beta, and γ\gamma is determined), so the grid is two-dimensional.

Check the found values against the constraint:

1.2×1.12×1.152=1.2×1.21×1.3225=1.9201.2 \times 1.1^2 \times 1.15^2 = 1.2 \times 1.21 \times 1.3225 = 1.920

So one unit of ϕ\phi multiplies the estimated FLOPS by 1.92. In doublings, depth takes log⁡21.2=0.263\log_2 1.2 = 0.263, width 2log⁡21.1=0.2752\log_2 1.1 = 0.275 and resolution 2log⁡21.15=0.4032\log_2 1.15 = 0.403, which is 28%, 29% and 43% of the budget. For comparison, scaling all three by one shared factor xx under the same budget gives x5=2x^5 = 2, x=1.149x = 1.149; the search moved depth up from that and width down.

A worked example at ϕ=3\phi = 3: d=1.23=1.728d = 1.2^3 = 1.728, w=1.13=1.331w = 1.1^3 = 1.331, r=1.153=1.521r = 1.15^3 = 1.521. The input becomes 224×1.521≈341224 \times 1.521 \approx 341 pixels. Each stage's layer count is multiplied by 1.728 and rounded up, turning 1, 2, 2, 3, 3, 4, 1 into 2, 4, 4, 6, 6, 7, 2 (31 layers). The channels become 24, 32, 56, 104, 152, 256, 424 after rounding to multiples of 8. The estimate says 1.923=7.081.92^3 = 7.08 times B0's FLOPS; counting the actual network gives 8.43 times, 3.25 billion multiply-accumulates; the excess comes from rounding layer counts up (31 layers is 1.94 times 16, not 1.728) and channel counts to multiples of 8.

Figure 3 · compound scaling of B0
released:

φ = 3.00: d = 1.2^φ = 1.728, w = 1.1^φ = 1.331, r = 1.15^φ = 1.521 · estimate (αβ²γ²)^φ = ×7.08, counted ×8.43 · layers per stage 2 4 4 6 6 7 2 · 16.5M params

Every MBConv layer is a bar, in network order: bar height is the side of its input feature map, bar width grows with the square root of its channel count, and colors mark the seven stages (grey: stem and head). The dashed box outlines B0. The slider sets ϕ\phi in equation (3); the buttons load the coefficients the released B0 to B7 use, with the ϕ\phi each coefficient implies.

Slide ϕ\phi from 0 to 7 and all three grow at once: more bars, taller bars, wider bars, with resolution contributing the most to the compute. At ϕ=7\phi = 7 the input is 596 pixels and the counted network is 103 times B0, against an estimate of 1.927=961.92^7 = 96.

The B1 to B7 coefficients in the code

The paper says EfficientNet-B1 to B7 are obtained by scaling B0 "with different ϕ\phi using Equation 3", and refers to Table 2 for details. Table 2 lists accuracy, parameters and FLOPS, but no ϕ\phi and no coefficients. Those are in the official code, as a table of (width, depth, resolution):

modelwidth wdepth dresolutionMBConv layersparamsFLOPStop-1
B01.01.0224165.3M0.39B77.1%
B11.01.1240237.8M0.70B79.1%
B21.11.2260239.2M1.0B80.1%
B31.21.43002612M1.8B81.6%
B41.41.83803219M4.2B82.9%
B51.62.24563930M9.9B83.6%
B61.82.65284543M19B84.0%
B72.03.16005566M37B84.3%

The first three columns come from efficientnet_builder.py, the layer counts from applying its rounding rules, and the last three from the paper's Table 2. Counting the networks layer by layer reproduces Table 2's parameters and FLOPS to within 5% for every model (for example 37.7B and 66.7M for B7), which also confirms that the paper's FLOPS are multiply-adds.

Invert each coefficient to get the ϕ\phi it implies: ϕd=log⁡d/log⁡1.2\phi_d = \log d / \log 1.2, and likewise for width with 1.1 and for resolution with 1.15. B2 (1.1, 1.2, 260) is ϕ=1\phi = 1 to rounding; its counted size, 0.994B, equals the 0.993B counted for the network equation (3) builds at ϕ=1\phi = 1 (both sit above the 1.92× estimate because of rounding, explained below). B3 is ϕ=2\phi = 2 by the same check. B1 is about ϕ=0.5\phi = 0.5 for depth and resolution with width left at 1.0. From B4 on, the three coefficients disagree: B7's depth implies ϕ=6.2\phi = 6.2, its width 7.3 and its resolution 7.0. The larger released models grow width and resolution faster than depth, compared with equation (3). Pick the B-model buttons in Figure 3 to read each model's implied values.

The rounding also explains why B2 costs 2.58 times B0, not the 1.92 times of one doubling. B0 has two stages with a single layer; multiplying by 1.2 and rounding up gives two layers each, and the 16 layers become 23, a 1.44× increase in depth instead of 1.2×.

EfficientNet-B0 from architecture search

Scaling never changes the layer types F^i\hat{\mathcal{F}}_i, so the quality of the baseline caps the quality of every scaled model. The authors built a new baseline with neural architecture search (NAS), an automated search in which a controller proposes network designs, each is trained briefly, and the controller is steered toward designs that score well. They reused the search space of MnasNet, an earlier mobile-network search by the same group, and its multi-objective reward:

ACC(m)×[FLOPS(m)/T]w,w=−0.07\mathrm{ACC}(m) \times \big[\mathrm{FLOPS}(m)/T\big]^{w}, \qquad w = -0.07

Here mm is a candidate model, TT = 400 million FLOPS is the target, and the exponent ww (a different symbol from the width coefficient, despite the shared letter) trades accuracy against size. A model at the target is scored by its accuracy. A model at twice the target is multiplied by 2−0.07=0.9532^{-0.07} = 0.953, so it scores the same as a model at the target only if its accuracy is about 5% higher (relative), which is the rule MnasNet used to pick −0.07: doubling latency usually brings about 5% relative accuracy. MnasNet optimized measured phone latency; this search optimizes FLOPS, since EfficientNet does not target a particular device.

The result, EfficientNet-B0, is the paper's Table 1:

stageoperatorinput resolutionchannelslayers
1Conv3×3224×224321
2MBConv1, k3×3112×112161
3MBConv6, k3×3112×112242
4MBConv6, k5×556×56402
5MBConv6, k3×328×28803
6MBConv6, k5×514×141123
7MBConv6, k5×514×141924
8MBConv6, k3×37×73201
9Conv1×1 & pooling & FC7×712801

The resolution column is each stage's input size, and the channel column its output channels. A stage whose next stage has a smaller resolution downsamples in its first layer with stride 2 (stages 1, 3, 4, 5 and 7). "MBConv6, k5×5" means an MBConv layer with expansion ratio 6 and a 5×5 depthwise kernel. B0 is slightly larger than MnasNet because its FLOPS target is larger: 5.3M parameters, 0.39B FLOPS, 77.1% top-1 on ImageNet.

Inside an MBConv layer

MBConv is the inverted residual block of MobileNetV2, with a squeeze-and-excitation step added. One layer with input H×W×CH \times W \times C does five things in order:

  1. A 1×1 convolution expands the channels by the expansion ratio, usually 6: CC to 6C6C. Followed by batch normalization and the SiLU activation x⋅σ(x)x \cdot \sigma(x) (also called Swish).
  2. A k×kk \times k depthwise convolution filters each of the 6C6C channels separately, with stride 2 if the layer downsamples. Batch norm and SiLU again.
  3. Squeeze-and-excitation (SE): average each channel over all positions (one number per channel), pass the 6C6C numbers through a small two-layer network that narrows to C/4C/4 and widens back, and multiply every channel by the sigmoid of its output, a factor between 0 and 1. The factors depend on the whole image, so the same layer can turn a channel down for one image and leave it on for another.
  4. A 1×1 convolution projects 6C6C back down to the stage's output channels, with batch norm and no activation. MobileNetV2 calls this the linear bottleneck: a nonlinearity on the narrow tensor would discard information that the next layer cannot recover.
  5. If the stride is 1 and the input and output channel counts match, the input is added back (a residual connection, as in ResNet).

"Inverted" refers to where the wide part sits. A ResNet bottleneck block narrows the channels, does its 3×3 convolution on the narrow tensor and widens back, with the skip connection between the wide ends. MBConv widens first, filters the wide tensor with a cheap depthwise convolution, and narrows back, with the skip between the narrow ends. A regular 3×3 convolution at 240 channels would cost 240 times as much as the depthwise one, which is why MBConv can afford to filter the expanded tensor at all.

A worked example from B0, the first layer of stage 4: input 56×56×24. The expansion makes 56×56×144 at a cost of 562⋅24⋅14456^2 \cdot 24 \cdot 144 = 10.8 million multiply-accumulates. The 5×5 depthwise convolution with stride 2 produces 28×28×144 for 2.8 million. SE squeezes 144 channels to ⌊24/4⌋=6\lfloor 24/4 \rfloor = 6 and back for 1,728. The projection to 28×28×40 costs 4.5 million. Of the 18.2 million total, the two 1×1 convolutions take 84%. Stride 2 and the change from 24 to 40 channels rule out the skip connection here; the second layer of the stage has one.

Figure 4 · one MBConv layer, operation by operation

B0 stage 4: 2 layers, kernel 5×5 · this layer 18.2M MACs, 14.7K weights · the two 1×1 convs take 84%

Output shape and share of the layer's multiply-accumulates for each operation: 1×1 convolutions, the depthwise convolution and squeeze-and-excitation. Pick a stage, B0 or B7, and the first or a repeated layer of the stage.

Stage 2 has expansion ratio 1, so it skips the expansion convolution and the depthwise convolution takes a larger share. Everywhere else the 1×1 convolutions dominate. That is why the w2w^2 estimate from the cost section is close for EfficientNet even though depthwise convolutions scale linearly. The SE step, which operates on one number per channel, is a fraction of a percent of the arithmetic.

Scaling and the block in code

The scaling logic of the official TensorFlow code fits in a few functions. Given the coefficients, it rounds channels to multiples of 8 (friendlier to hardware) and rounds layer counts up:

ALPHA, BETA, GAMMA = 1.2, 1.1, 1.15     # grid-searched once, on B0, at phi = 1

def coefficients(phi):
    return ALPHA ** phi, BETA ** phi, round(224 * GAMMA ** phi)  # d, w, res

def round_filters(c, w, div=8):          # channels: nearest multiple of 8
    new = max(div, int(c * w + div / 2) // div * div)
    if new < 0.9 * c * w:                # never round down by more than 10%
        new += div
    return new

def round_repeats(n, d):                 # layers per stage: always round up
    return math.ceil(n * d)

# B0 stages 2-8 of Table 1: (repeats, kernel, stride, expand, out_channels)
B0 = [(1, 3, 1, 1, 16), (2, 3, 2, 6, 24), (2, 5, 2, 6, 40), (3, 3, 2, 6, 80),
      (3, 5, 1, 6, 112), (4, 5, 2, 6, 192), (1, 3, 1, 6, 320)]

d, w, res = 1.4, 1.2, 300                # B3 as released in efficientnet_builder.py
stages = [(round_repeats(n, d), k, s, e, round_filters(c, w))
          for n, k, s, e, c in B0]
# repeats  2  3  3  5   5   6   2   (26 MBConv layers instead of 16)
# channels 24 32 48 96 136 232 384  (stem 32 -> 40, head 1280 -> 1536)

The stem and head are scaled for width too: B3's stem has 40 channels and its head 1536. Depth applies only to the seven MBConv stages; the stem, the head and the classifier stay single layers. The block itself, written out with the shapes:

def mbconv(x, k, stride, expand, c_out, survival_prob):  # x: H x W x c_in
    c_in = x.shape[-1]
    h = x
    if expand != 1:
        h = silu(bn(conv1x1(h, c_in * expand)))     # H x W x 6*c_in
    h = silu(bn(depthwise(h, k, stride)))           # H/s x W/s x 6*c_in
    s = mean(h, axis=(0, 1))                        # squeeze: one value per channel
    s = conv1x1(silu(conv1x1(s, int(c_in * 0.25))), h.shape[-1])
    h = h * sigmoid(s)                              # excite: rescale every channel
    h = bn(conv1x1(h, c_out))                       # linear projection, no SiLU
    if stride == 1 and c_in == c_out:
        h = x + drop_connect(h, survival_prob)      # stochastic depth on the branch
    return h

The first layer of each stage takes the stage's stride and input channels; the repeats use stride 1 and c_out channels in and out, so only the repeats have skip connections. Every weight in the block, including the SE layers, is trained by ordinary backpropagation of the classification loss. The scaling coefficients are fixed before training starts and receive no gradient.

How the models were trained

All models were trained on ImageNet (1.28 million images, 1000 classes) with settings borrowed from MnasNet: RMSProp with decay 0.9 and momentum 0.9, batch norm momentum 0.99, weight decay 1e-5, and an initial learning rate of 0.256 multiplied by 0.97 every 2.4 epochs. On top of those:

The authors held out 25,000 training images as a "minival" set, early-stopped on it, and report the early-stopped checkpoint's accuracy on the standard 50,000-image validation set. An appendix checks the test server too: B7 scores 84.26% on validation and 84.33% on the held-out test set.

Results on ImageNet and transfer tasks

Table 2 of the paper places each EfficientNet next to published models of similar accuracy. Figure 5 plots all of them; click a point or use the menu, and the readout pairs that model with the smallest EfficientNet at least as accurate.

Figure 5 · accuracy against size, Table 2

ResNeXt-101: 80.9%, 84M params, 32B FLOPS · smallest EfficientNet at least as accurate: B3 (81.6%), 7.0× fewer params, 17.8× fewer FLOPS

ImageNet top-1 against parameters or FLOPS (log axis). Teal: EfficientNet-B0 to B7, joined in order. Amber: the other models in Table 2. The dashed line joins the selected model to its EfficientNet counterpart.

Some of the pairs, with what they mean in practice:

These comparisons mix three changes at once: a searched baseline, the scaling rule and a stronger training recipe (the paper says so: "better architectures, better scaling, and better training settings"). The cleanest test of the rule alone is Table 7, the B0 rows of Figure 1: same baseline, same recipe, about 1.8B FLOPS, and compound scaling scores 81.1% against 79.0%, 78.9% and 79.1% for depth, width and resolution alone. The paper also shows class activation maps (a heat map of which pixels drove the prediction) for these models; the compound-scaled one covers more of each object, a qualitative picture rather than a measurement.

For transfer learning the authors fine-tune ImageNet-trained EfficientNets on eight datasets (CIFAR-10, CIFAR-100, Birdsnap, Stanford Cars, Flowers, FGVC Aircraft, Oxford-IIIT Pets, Food-101). Against publicly available models such as NASNet-A and Inception-v4 they are more accurate on six of the eight, tie on Flowers and trail by 0.2 points on FGVC Aircraft, with 4.7 times fewer parameters on average (up to 21 times). Against the best reported results, including GPipe and domain adaptive transfer learning, the paper counts five of eight wins. Three are strict (CIFAR-100 91.7% vs 91.3%, Birdsnap 84.3% vs 83.6%, Flowers 98.8% vs 97.7%), two are exact ties (FGVC Aircraft 92.9%, Food-101 93.0%), and the remaining three are losses of 0.1 to 0.5 points. Where parameter counts are known, the EfficientNets use 9.6 times fewer on average.

What later work changed

The rule budgets FLOPS, while training time also depends on memory traffic and on how well each operation uses the hardware. Two years later the same authors listed three problems with training EfficientNets in the EfficientNetV2 paper. Very large images are slow: B7 trains at 600 pixels, its activations fill accelerator memory, and the batch has to shrink. Depthwise convolutions do little arithmetic per byte of memory they read, so GPUs and TPUs run them far below peak, especially in the early high-resolution stages. And scaling every stage by the same factor is sub-optimal. EfficientNetV2 replaces the early MBConv layers with a fused version (one regular 3×3 convolution instead of the 1×1 expansion plus depthwise), caps the image size at 480, and adds layers mainly to later stages.

Bello et al. (2021) revisited ResNets with modern training and found that the best scaling strategy depends on the regime: add depth where overfitting can occur (long training runs), add width otherwise, and raise resolution more slowly than compound scaling does. Their ResNet-RS models run 1.7 to 2.7 times faster than EfficientNets on TPUs at similar accuracy. Both findings narrow the paper's claim without contradicting its Observation 2: the dimensions do interact, but one fixed ratio searched at ϕ=1\phi = 1 is a heuristic, and the released B4 to B7 already depart from it.

The question the paper asked, how to spend more compute on the same architecture, came back for language models as neural scaling laws and Chinchilla, which split a training budget between parameters and data instead of between depth, width and resolution. Image classification research moved largely to transformers after the Vision Transformer (2020); the same group's EfficientDet detectors (Tan, Pang & Le, 2020) use EfficientNet backbones and their own compound scaling rule.

Provenance Verified against primary literatureHow we verify
Tan & Le (2019), Sec. 3.3 and 4Equation (3): d = 1.2^phi, w = 1.1^phi, r = 1.15^phi, with 1.2 x 1.1^2 x 1.15^2 = 1.92, so each unit of phi multiplies the estimated FLOPS by 1.92, which the paper rounds to 2.
Official code, efficientnet_builder.pyLines 38-46 give (width, depth, resolution, dropout) for B0-B7, e.g. B7 = (2.0, 3.1, 600, 0.5); lines 173-176 give the B0 block strings that match Table 1. The paper itself never lists these numbers.
Official code, efficientnet_model.pyround_filters (lines 106-122) rounds channels to a multiple of 8 and never down by more than 10%; round_repeats (125-130) takes the ceiling of d x repeats. The SE squeeze is int(0.25 x block input channels) (line 254). Stochastic depth decays linearly from survival 1.0 at the first block to 0.8 at the last (lines 656-659); the paper reports only "survival probability 0.8".
Recount on this pageCounting B0-B7 layer by layer from the code gives 0.386 / 0.687 / 0.994 / 1.83 / 4.39 / 10.3 / 19.1 / 37.7 billion multiply-accumulates and 5.33 / 7.86 / 9.18 / 12.3 / 19.5 / 30.6 / 43.3 / 66.7 M parameters, against Table 2's 0.39-37B and 5.3-66M. The paper's FLOPS are therefore multiply-adds.
Tan et al. (2019), MnasNet, Sec. 3Objective ACC(m) x [LAT(m)/T]^w with w = -0.07, chosen because doubling latency usually brings about 5% relative accuracy. EfficientNet keeps the form and the exponent and swaps latency for FLOPS with T = 400M.
Zoph et al. (2018), NASNet, Table 2NASNet-A (6 @ 4032): 82.7% top-1, 88.9M parameters, 23.8B multiply-adds. Also the source for the units of the comparison FLOPS.
Tan & Le (2021), EfficientNetV2, Sec. 3.3Three bottlenecks in EfficientNet training: very large images are slow (memory forces small batches), depthwise convolutions are slow in early layers, and scaling every stage equally is sub-optimal. V2 caps the inference image size at 480.
Bello et al. (2021), Revisiting ResNetsThe best scaling strategy depends on the training regime: scale depth where overfitting can occur, width otherwise, and increase resolution more slowly than Tan & Le recommend. ResNet-RS runs 1.7-2.7x faster than EfficientNet on TPUs at similar accuracy.
Tan & Le (2019), Sec. 3.3 vs Figure 4The text says width scaling does better "with deeper (d=2.0) and higher resolution (r=2.0)"; the Figure 4 legend and caption give the last baseline as d=2.0, r=1.3 (36 layers at 299x299). This page follows the figure.
Tan & Le (2019), Introduction vs Table 2The introduction compares ResNet-50 76.3% to B4 83.0% (+6.7%); Table 2 lists 76.0% and 82.9%. Table 4 lists B1 at 78.8% and B7 at 84.4%, Table 2 79.1% and 84.3%; Table 7's B0 baseline is 77.3%, Table 2's 77.1%. This page quotes Table 2 unless it says otherwise.
correctionThree checkable points. (1) The paper says B1 to B7 come from equation (3) "with different phi" but never says which phi, and the coefficients in the official code are not powers of a single phi. B2 (w 1.1, d 1.2, 260px) is phi = 1 up to rounding and B3 is phi = 2, but B1 sits near phi = 0.5, and from B4 on the three coefficients imply three different values (B7: 6.2 from depth, 7.3 from width, 7.0 from resolution). Reading EfficientNet-Bn as phi = n does not match the released models; this page uses the code's numbers. (2) "Surpass their accuracy in 5 out of 8 datasets" (Sec. 5.3) counts two exact ties, FGVC Aircraft 92.9 = 92.9 and Food-101 93.0 = 93.0; Table 5 shows three strict wins. (3) The table inside Figure 5 lists NASNet-A at 80.7% top-1; Table 2 of the same paper and the NASNet paper give 82.7%, so 80.7 is a typo.

Questions you might still have

?

Why is the constraint alpha * beta^2 * gamma^2 = 2 and not alpha * beta * gamma = 2?
Because the constraint is on FLOPS, and FLOPS grow linearly with depth but with the square of width and of resolution. Doubling the channels of a convolution doubles both its input and its output channels, and doubling the image side doubles both height and width of every feature map. With the squares in place, each unit of phi multiplies the compute by about 2 (exactly 1.92 for 1.2, 1.1, 1.15).

?

How different are 1.2, 1.1 and 1.15 from scaling all three by the same factor?
If d, w and r all used one factor x, the budget x * x^2 * x^2 = 2 would give x = 2^(1/5) = 1.149. The grid search moved depth up to 1.2 and width down to 1.1, and left resolution at about that value. Measured in FLOPS, the split of one doubling is about 28% depth, 29% width and 43% resolution. The paper does not report the accuracy of the equal-factor version.

?

Can I reuse 1.2, 1.1 and 1.15 for my own network?
They were searched for EfficientNet-B0 at phi = 1, with B0's training recipe. The paper applies compound scaling to MobileNetV1, MobileNetV2 and ResNet-50 and it beats single-dimension scaling on all three, but it gives the coefficients it used only for MobileNetV1 (d 1.4, w 1.2, r 1.3). Later work on ResNets found that the best mix depends on dataset size and training length, so a small search on your own baseline is safer than copying the constants.

?

If EfficientNets need so few FLOPS, why are they not faster on GPUs?
FLOPS count arithmetic, not memory traffic. Depthwise convolutions do little arithmetic per byte they read, so accelerators run them far below peak, and the large input images of B5 to B7 (456 to 600 pixels) make activations big, which forces smaller training batches. The paper's latency numbers are CPU measurements. EfficientNetV2 was designed around exactly these costs.

?

Does compound scaling explain all of EfficientNet's lead over older models?
No. Table 7 isolates the rule on a fixed baseline: at about 1.8B FLOPS, compound scaling of B0 reaches 81.1% against 79.1% for the best single dimension, a 2.0-point gain. The rest of the gap to ResNets and to GPipe comes from the searched B0 architecture and the training recipe (SiLU, AutoAugment, stochastic depth), which the paper also says contribute.

?

What do the paper's FLOPS mean?
Multiply-adds, one multiplication and one addition counted once. Counting EfficientNet-B0 layer by layer gives 386 million multiply-accumulates, the paper's 0.39B. Under the other common convention, which counts the multiply and the add separately, B0 would be about 0.77 billion operations.

Footnotes & further reading

  1. The paper: Tan & Le, EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks (ICML 2019; arXiv v5, 2020).
  2. Official code: tensorflow/tpu, models/official/efficientnet; the coefficients are in efficientnet_builder.py and the block in efficientnet_model.py.
  3. The search space and reward: Tan et al., MnasNet: Platform-Aware Neural Architecture Search for Mobile (CVPR 2019).
  4. The block: Sandler et al., MobileNetV2: Inverted Residuals and Linear Bottlenecks (CVPR 2018), and Hu et al., Squeeze-and-Excitation Networks (CVPR 2018).
  5. Residual connections and depth scaling: He et al. (2016), in the ResNet explainer; the batch normalization in every MBConv layer is covered in the Batch Normalization explainer.
  6. NASNet-A's numbers: Zoph et al., Learning Transferable Architectures for Scalable Image Recognition (CVPR 2018), Table 2.
  7. The follow-up: Tan & Le, EfficientNetV2: Smaller Models and Faster Training (ICML 2021).
  8. Bello et al., Revisiting ResNets: Improved Training and Scaling Strategies (NeurIPS 2021).
  9. The previous record holder: Huang et al., GPipe: Efficient Training of Giant Neural Networks using Pipeline Parallelism (NeurIPS 2019).
  10. Training ingredients: Huang et al., Deep Networks with Stochastic Depth (ECCV 2016); Cubuk et al., AutoAugment (CVPR 2019); Ramachandran et al., Searching for Activation Functions (2017).