Notes on MobileNetV3 and the Lottery Ticket Hypothesis

MobileNetV3: Engineering Refinements on Top of NAS

After reading the MobileNetV3 paper, my overall impression is that it doesn’t pack the punch of those earlier classic works — but if performance is good and it deploys, that’s a good thing. Let’s start with the experimental results:

Line plots of Pixel 1 latency versus ImageNet top-1 accuracy, split into small models (20–40ms) and large models (40–150ms); MobileNetV3 small/large sit above MnasNet, ProxylessNAS, and MobileNetV2 to form the optimal frontier
Figure 1: The trade-off between Pixel 1 latency and top-1 ImageNet accuracy. All models use input resolution 224; V3-Large and V3-Small use width multipliers 0.75, 1, and 1.25 to trace the optimal frontier. Latencies were measured on a single large core of the same device using TFLite.

The overall idea is to obtain a seed architecture from MnasNet and then fine-tune it. The Large version directly takes MnasNet’s search result, while the Small version modifies the objective function — lowering the weight on latency and increasing the importance of accuracy — and re-runs the search.

The objective function used by MnasNet is:

ACC(m)×[LAT(m)TAR]wACC(m) \times \left[\frac{LAT(m)}{TAR}\right]^{w}

where the magnitude of w controls the importance of latency.

NetAdapt Fine-Tuning

The second step uses NetAdapt to fine-tune the seed architecture. NetAdapt’s main goal is to find the best accuracy subject to a latency constraint, taking a trained seed architecture as input:

  1. Start with a seed network architecture found by platform-aware NAS.
  2. For each step:
    1. Generate a set of new proposals. Each proposal represents a modification of the architecture that yields at least a δ\delta reduction in latency compared to the previous step.
    2. For each proposal, reuse the pre-trained model from the previous step and populate the newly proposed architecture, truncating and randomly initializing missing weights as appropriate; fine-tune each proposal for TT steps to get a coarse estimate of the accuracy.
    3. Select the best proposal according to some metric.
  3. Iterate the previous step until the target latency is reached.

Starting from the seed architecture, NetAdapt generates a batch of candidate architectures whose latency drops by at least delta. The seed’s weights are then aligned to each candidate by truncation or random initialization, fine-tuned, and the one with the best accuracy is kept:

ΔAccΔlatency\frac{\Delta Acc}{|\Delta latency|}

This process is repeated multiple times, eventually yielding the model with the best accuracy at the target latency.

Changes to the Head, Tail, and Activation Function

After obtaining the above model, some manual adjustments were made, mainly to the head, the tail, and the activation function.

Head change: halve the number of output channels of the initial convolution.

Tail change, as shown below:

Diagram comparing the original last stage with the efficient last stage: the efficient version moves Avg-Pool earlier, right after the 1x1 expansion, dropping three expensive layers
Figure 2: Comparison of the original last stage and the efficient last stage. The more efficient last stage drops three expensive layers at the end of the network with no loss of accuracy.

The activation function is changed to:

h-swish[x]=xReLU6(x+3)6\text{h-swish}[x] = x \, \frac{\text{ReLU6}(x+3)}{6}

The resulting overall architecture is as follows:

InputOperatorexp size#outSENLs
2242×3224^2 \times 3conv2d-16-HS2
1122×16112^2 \times 16bneck, 3x31616-RE1
1122×16112^2 \times 16bneck, 3x36424-RE2
562×2456^2 \times 24bneck, 3x37224-RE1
562×2456^2 \times 24bneck, 5x57240RE2
282×4028^2 \times 40bneck, 5x512040RE1
282×4028^2 \times 40bneck, 5x512040RE1
282×4028^2 \times 40bneck, 3x324080-HS2
142×8014^2 \times 80bneck, 3x320080-HS1
142×8014^2 \times 80bneck, 3x318480-HS1
142×8014^2 \times 80bneck, 3x318480-HS1
142×8014^2 \times 80bneck, 3x3480112HS1
142×11214^2 \times 112bneck, 3x3672112HS1
142×11214^2 \times 112bneck, 5x5672160HS1
142×11214^2 \times 112bneck, 5x5672160HS2
72×1607^2 \times 160bneck, 5x5960160HS1
72×1607^2 \times 160conv2d, 1x1-960-HS1
72×9607^2 \times 960Pool, 7x7---HS-
12×9601^2 \times 960conv2d 1x1, NBN-1280-HS1
12×12801^2 \times 1280conv2d 1x1, NBN-k---
Table 1: Specification for MobileNetV3-Large. SE denotes whether there is a Squeeze-And-Excite in that block; NL denotes the type of non-linearity used, where HS is h-swish and RE is ReLU; NBN denotes no batch normalization; s denotes stride.
InputOperatorexp size#outSENLs
2242×3224^2 \times 3conv2d, 3x3-16-HS2
1122×24112^2 \times 24bneck, 3x31616RE2
562×2456^2 \times 24bneck, 3x37224-RE2
282×2428^2 \times 24bneck, 3x38824-RE1
282×4028^2 \times 40bneck, 5x59640HS1
142×4014^2 \times 40bneck, 5x524040HS1
142×4014^2 \times 40bneck, 5x524040HS1
142×4014^2 \times 40bneck, 5x512048HS1
142×4814^2 \times 48bneck, 5x514448HS1
142×9614^2 \times 96bneck, 5x528896HS2
72×967^2 \times 96bneck, 5x557696HS1
72×967^2 \times 96bneck, 5x557696HS1
72×967^2 \times 96conv2d, 1x1-576HS1
72×5767^2 \times 576Pool, 7x7---HS7
12×5761^2 \times 576conv2d 1x1-1280-HS1
12×12801^2 \times 1280conv2d 1x1-k-HS-
Table 2: Specification for MobileNetV3-Small; notation is the same as in Table 1.

The SE block is embedded into the block as follows:

MobileNetV3 block diagram: 1x1 expansion, 3x3 depthwise convolution, an SE branch of Pool plus two FC layers (ReLU, hard-σ), then a 1x1 projection with a residual connection
Figure 3: MobileNetV2 + Squeeze-and-Excite. Unlike the original SE, here the squeeze-and-excite is applied inside the residual layer, with different non-linearities chosen per layer.

The structure of the stride=2 block in MobileNetV2 is shown below. In V3, stride=2 and stride=1 are likewise distinguished by whether there is a residual connection, and the residual and SE modules do not conflict:

The two MobileNetV2 blocks: the stride=1 block has a 1x1 expansion, a 3x3 depthwise convolution, and a 1x1 linear projection with a residual Add; the stride=2 block has the same structure but no residual connection
Figure 4: The stride=1 and stride=2 blocks of MobileNetV2, distinguished by whether they carry a residual connection.

THE LOTTERY TICKET HYPOTHESIS: Finding a Trainable Sparse Sub-Network

The core idea of this paper is that an iterative, unstructured pruning procedure can find a small network, and this iterative pruning process is itself a way of training the large network.

The resulting small network is roughly 10%–20% of the size of the full large network. If this small network is given the same initialization as the large network, it can be trained faster to match the accuracy of the large network — this is the so-called “lottery.”

The overall training-and-iteration process is shown below. This process is typically iterated many times, and the key point is that it is reinitialized to theta_0 each time:

Identifying winning tickets. We identify a winning ticket by training a network and pruning its smallest-magnitude weights. The remaining, unpruned connections constitute the architecture of the winning ticket. Unique to our work, each unpruned connection’s value is then reset to its initialization from the original network before it was trained. This forms our central experiment:

  1. Randomly initialize a neural network f(x;θ0)f(x; \theta_0) (where θ0Dθ\theta_0 \sim \mathcal{D}_\theta).
  2. Train the network for jj iterations, arriving at parameters θj\theta_j.
  3. Prune p%p\% of the parameters in θj\theta_j, creating a mask mm.
  4. Reset the remaining parameters to their values in θ0\theta_0, creating the winning ticket f(x;mθ0)f(x; m \odot \theta_0).

Moreover, this effect becomes more pronounced as the degree of pruning increases: the more you prune, the harder the resulting small network is to train under random initialization, and the more important the initialization becomes — whereas keeping the same initialization as the pre-pruning network makes it easy to train.

Comparison with “Rethinking the Value of Network Pruning”

Another paper, “Rethinking the Value of Network Pruning,” argues that random initialization can in fact achieve very good performance, provided the learning rate is appropriate.

The two papers also differ in a few minor ways:

  1. That paper mainly uses structured pruning, with unstructured pruning only on smaller datasets — different from the lottery paper’s all-unstructured pruning.
  2. That paper mainly prunes large networks, whereas the lottery work is mainly done on small networks.
  3. The optimization approaches also differ; the optimization strategy used in the lottery paper is not exactly the mainstream configuration for classification tasks.

That paper finds that under structured pruning there is none of the difference observed in the lottery work — the structures obtained in the lottery setting show little difference across different initializations; under unstructured pruning, the main difference comes from differences in learning rate.

Test-accuracy-versus-prune-ratio curves for VGG-16 and ResNet-50 on CIFAR-10, split into (a) iterative pruning and (b) one-shot pruning, comparing winning tickets against random init at learning rates 0.1 and 0.01
Figure 5: Iterative/one-shot unstructured pruning of VGG-16 and ResNet-50 on CIFAR-10, compared against the Lottery Ticket Hypothesis, with each point averaged over 5 runs. Using the winning ticket as initialization only helps when the learning rate is small (0.01), yet that small learning rate itself yields lower accuracy than the widely used large learning rate (0.1).