Paper commentary
MnasNet: Platform-Aware Neural Architecture Search for Mobile
MnasNet searches for phone models by measuring real latency during search
- Problem Earlier mobile models used FLOPS as a speed proxy, but FLOPS does not always track how long a model takes on a phone.
- Method MnasNet measures each candidate's latency on a phone and adds it to the search reward. A reinforcement learning controller updates from that reward.
- Results MnasNet-A1 reaches 75.2% top-1 accuracy with 78ms latency on a Pixel phone, more accurate and faster than MobileNetV2 and NASNet.
Why mobile CNN design needs measured latency
Designing a CNN for phones means trading accuracy against resource use, and the set of possible architectures is very large. Earlier mobile work often reduced cost through a computation count such as FLOPS, a proxy that does not always track how long a model takes to run. The authors give a concrete case: MobileNet and NASNet have nearly equal FLOPS, 575M and 564M, yet their latencies are 113ms and 183ms.
The authors therefore place measured latency inside the search objective. Each candidate is executed on a mobile phone, and that time becomes part of its score rather than a side estimate. They note that the variety of mobile hardware and software makes latency hard to approximate from computation counts, which is why direct measurement is preferred.
A reward that trades accuracy against latency
The reward for a model m is its accuracy multiplied by a latency ratio raised to a weight w, where the ratio is the measured latency LAT(m) divided by the target latency T. Written out, the objective is \(\mathrm{ACC}(m) \times [\mathrm{LAT}(m)/T]^{w}\), and w equals α when LAT(m) is at most T and β otherwise. This is the weighted product method, used to approximate Pareto optimal models so that one search returns several models along the trade-off curve instead of a single constrained maximum.
With α = 0 and β = −1, the reward equals accuracy below the target and is sharply penalized above it, so latency works as a hard constraint. With α = β = −0.07, the reward changes smoothly with latency, so the target acts as a soft constraint. The value −0.07 comes from a rule of thumb. Doubling latency was observed to bring about a 5% relative accuracy gain, and β was set so that two models on that trade-off receive similar rewards.
For a model with latency l and accuracy a, and a model with latency 2l and accuracy a(1 + 5%), the two rewards are matched, which gives β ≈ −0.07, and that value is used unless stated otherwise.
Layers that differ from block to block
Earlier automated searches usually found a few cell types and stacked them, which keeps the search small but forces the layers to look alike. The factorized hierarchical search space instead divides the network into predefined blocks, with input resolution falling and filter sizes rising from one block to the next, and searches each block separately.
Each block gets a sub search space with six choices: the convolution type (conv, depthwise conv or mobile inverted bottleneck conv), the kernel size (3x3 or 5x5), the Squeeze-and-excitation ratio (0 or 0.25), the skip operation, the output filter size Fi and the layer count Ni. The first four choices fix a layer's architecture, and the layer count decides how many identical copies the block contains.
The choices are relative to MobileNetV2: the layer count moves by {0, +1, -1}, and the filter size is scaled by {0.75, 1.0, 1.25}. Early stages receive particular attention because they process more data and therefore have a larger effect on latency than later stages.
If each block has S options and the network has B blocks, the total space is \(S^{B}\), compared with \(S^{B \cdot N}\) for a flat per-layer search with N layers per block. With S = 432, B = 5 and N = 3, the authors put the block-wise space at about 1013 and the flat per-layer space at 1039.
The cost of a depthwise separable kernel that maps an input of size H×W×M to an output of size H×W×N is counted as \(H \times W \times M \times (K \times K + N)\), where N there is the output filter size. Enlarging the kernel K therefore has to be offset by a smaller filter size N in the same layer or by less compute in other layers.
Sampling, scoring and updating the controller
The search agent is a reinforcement learning controller built on a recurrent neural network. It emits a sequence of actions a1:T, and the sequence is mapped to a CNN model in the search space.
At each step the controller samples a batch of models from its current parameters. For each one, training gives accuracy ACC(m), a phone gives latency LAT(m), and the reward R(m) is then computed. At the end of the step, θ is updated by Proximal Policy Optimization, which maximizes the expected reward. The loop repeats until a maximum number of steps is reached or θ converges.
The choice of reinforcement learning rests on convenience and on how easily the reward can be changed, and the authors say evolutionary search could also work.
Search cost and proxy training
Searching directly on full ImageNet or COCO would be expensive, so each sampled model is trained on the ImageNet training split for 5 epochs. A fixed validation set of 50K randomly selected training images is held out. The authors report that small proxy tasks such as CIFAR-10 did not work once latency entered the objective, because larger problems require scaling the model up.
The controller samples about 8K models, and only 15 top performers move on to full ImageNet training and one to COCO. Each architecture search takes 4.5 days on 64 TPUv2 devices. The authors keep the NASNet controller so that accuracy gains can be attributed to the search space, even though they call that controller inefficient. During search, each sampled model's latency is measured on the single-thread big CPU core of a Pixel 1 phone.
Full ImageNet training uses RMSProp with decay 0.9 and momentum 0.9, batch norm momentum 0.99, weight decay 1e-5 and dropout 0.2 on the last layer. The learning rate rises from 0 to 0.256 over the first 5 epochs and then decays by 0.97 every 2.4 epochs, with batch size 4K and 224×224 inputs. For COCO, the learned model is attached to SSD with an input size of 320×320.
ImageNet classification results
Table 1 places three MnasNet models beside manually designed and automatically searched mobile CNNs on ImageNet.
Against MobileNetV2 at 75ms, the authors report a 3.0% accuracy gain at similar latency on the Pixel phone. Read from the accuracy side, the authors state that the MnasNet models run faster than MobileNetV2 and NASNet at better accuracy.
MnasNet-A3 reaches 76.7% at 103ms and has higher accuracy than ResNet-50, with 4.8× fewer parameters and 10× fewer multiply-adds. Because squeeze-and-excitation is a recent addition that many mobile models lack, the authors also searched without it. MnasNet-B1 reached 74.5% at 77ms, against 72.0% at 75ms for MobileNetV2 and 74.0% at 183ms for NASNet.
The authors describe this no-SE variant as still ahead of both MobileNetV2 and NASNet.
Scaling a model down or up
Developers often trade accuracy for latency by scaling a model. A depth multiplier changes the number of channels in each layer, and the input image size can also be reduced. The authors scale MnasNet-A1 and MobileNetV2 with the same depth multipliers and input sizes, so the two curves are compared under identical knobs.
Across depth multipliers from 0.35 to 1.4, latency ranges from 20ms to 160ms, and MnasNet has higher accuracy than MobileNetV2 at each multiplier. Across input sizes from 96 to 224, the accuracy gain over MobileNetV2 reaches up to 4.1%.
The plots put top-1 accuracy against inference latency, so the comparison is at matched latency rather than matched parameter count.
Scaling down versus searching for a 22ms model
Some video applications need latency as low as 25ms, and the authors compare scaling a baseline with searching for a model under a 22ms target. Table 4 uses 224x224 images for all models.
MobileNetV2 (0.35x) reaches 60.3% at 21.4ms, and MnasNet-A1 (0.35x) reaches 64.1% at 22.8ms. The two searched models, MnasNet-search1 and MnasNet-search2, reach 64.9% at 22.0ms and 66.0% at 23.2ms. The 23.2ms model is above the 22ms target that its search used.
The authors say scaling already beats MobileNetV2 under the same scaling parameter, and that a search aimed at 22ms adds further accuracy.
COCO object detection with SSDLite
For COCO, MnasNet-A1 serves as the feature extractor of SSDLite, a resource-efficient version of SSD. The model is trained on trainval35k and evaluated on test-dev2017. Only one searched model was transferred to COCO. The comparison set includes YOLOv2, SSD300, SSD512, MobileNetV1 + SSDLite and MobileNetV2 + SSDLite.
Against SSD300, the authors report 7.4× fewer parameters and 42× fewer multiply-adds for the MnasNet model.
Its latency of 203ms is above the 200ms of MobileNetV2 + SSDLite in the same table, so the detection gain does not come with lower latency.
Hard versus soft latency targets
Figure 6 shows search results for the hard setting α = 0, β = −1 and the soft setting α = β = −0.07, both with target latency T = 75ms. The top panel shows the Pareto curve for 3000 sampled models, and the bottom panel shows the histogram of model latency.
Under the hard setting, the controller leans toward faster models to avoid the latency penalty. Under the soft setting, it samples many models near 75ms and also explores models under 40ms and over 110ms, which is how several Pareto points come from one search.
Reward and search space contributions
The authors start from NASNet's cell-based search space and replace its single-objective reward with the multi-objective reward. Within that cell-based space, the multi-objective search gives 100ms at 72.0% top-1, against 183ms at 74.0% for the single-objective search. Adding the factorized hierarchical search space on top gives MnasNet at 78ms and 75.2% top-1.
The reward change alone makes the model faster at a cost in accuracy, and the authors interpret the further accuracy gain as evidence for the search space.
Layer diversity in MnasNet-A1
The authors observe that MnasNet uses both 3x3 and 5x5 convolutions, whereas the earlier mobile models they compare with use only 3x3 convolutions.
Limitations
Each architecture search takes 4.5 days on 64 TPUv2 devices, and the authors acknowledge that the RNN controller is not efficient. Sampled models are trained for 5 epochs on the ImageNet training split, while the reported ImageNet results come from the full training schedule. The latencies reported in the paper come from Pixel phones, and search measures latency on a single-thread big CPU core of a Pixel 1 phone.
Only 15 searched models went to full ImageNet and one to COCO, so the detection result rests on a single searched model. The layer-diversity comparison uses single-type variants only, and no mixes of two layer types are reported.
Paper info
- Authors
- Tan, Mingxing, Chen, Bo, Pang, Ruoming, Vasudevan, Vijay, Sandler, Mark, Howard, Andrew, Le, Quoc V.
- Venue
- arXiv · Preprint
- First published
- 2018-7-31
- Added
- 2026-11-12
- Updated
- 2019-5-29
- Version
- v3
- arXiv
- 1807.11626
- Category
- cs.CV · cs.LG
- Original paper terms
- arXiv non-exclusive 1.0
- What we show
- Paper info and commentary
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Quote from the paper
Tan, Mingxing, Chen, Bo, Pang, Ruoming, Vasudevan, Vijay, Sandler, Mark, Howard, Andrew, Le, Quoc V. (2018). MnasNet: Platform-Aware Neural Architecture Search for Mobile. arXiv:1807.11626v3. https://arxiv.org/abs/1807.11626v3
BibTeX
@misc{mingxing2018mnasnet,
title = {{MnasNet: Platform-Aware Neural Architecture Search for Mobile}},
author = {Tan, Mingxing and Chen, Bo and Pang, Ruoming and Vasudevan, Vijay and Sandler, Mark and Howard, Andrew and Le, Quoc V.},
year = {2018},
eprint = {1807.11626},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/1807.11626v3}
}