Back to paper library
arXiv 2017CVPR 2018Efficient modelsPaper notes

ShuffleNet

Channel Shuffling Network

Original paper

ShuffleNet: An Extremely Efficient Convolutional Neural Network for Mobile Devices

Paper authors

Xiangyu Zhang · Xinyu Zhou · Mengxiao Lin · Jian Sun

Publication
CVPR 2018Conference
First submitted to arXiv
arXiv:1707.01083
Cite this paper · BibTeX

The citation identifies the linked source version. It cites the original paper and its authors.

@misc{lightweightshufflenet2017,
  title = {{ShuffleNet: An Extremely Efficient Convolutional Neural Network for Mobile Devices}},
  author = {Xiangyu Zhang and Xinyu Zhou and Mengxiao Lin and Jian Sun},
  year = {2017},
  eprint = {1707.01083},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1707.01083}
}
On this page

The competition for lightweight networks had only just begun.

ShuffleNet joined the race at just this point.

MobileNet had reduced cost with depthwise separable convolution, but 1×1 convolutions still consumed most of the multiply-adds in networks with budgets of a few dozen to a little over 100 MFLOPs. This paper asks how to fit more channels into the same budget, and whether the theoretical savings translate into speed on a phone.

Defining the Problem

Computation and Speed Do Not Always Match

The authors face the same practical question as earlier lightweight-network studies:

  • How can we keep accuracy high while building an efficient network for mobile devices with very limited computing power?

The paper focuses on small networks around 10–150 MFLOPs. Its FLOP figures count floating-point multiply-adds by the authors' convention; they are not device latency. MobileNet, and SENet in the paper's later revision, had already moved toward lower-cost designs, but the authors saw room to improve accuracy at these tight budgets.

The Cost of 1×1 Convolutions

Table 2 from the earlier MobileNet-V1 paper, not a ShuffleNet experiment. In that model, 1×1 convolution accounts for 94.86% of multiply-adds and 74.59% of parameters; depthwise 3×3 accounts for 3.06%/1.06%.

Since pointwise convolution dominates, making only the 3×3 operation cheap is insufficient. ShuffleNet therefore applies group convolution to 1×1 layers: each group reads a subset of input channels, reducing multiplications per output channel. Repeating the same grouping across layers, however, limits information exchange between groups.

Solving the Problem

Group Convolution and Cross-Group Flow

Paper Figure 1: (a) two layers keep the same groups, so each group sees only its own data; (b) the second layer receives channels from different groups; (c) a regular channel permutation implements the cross-group connections in (b).

First count the cost at one spatial position. Suppose a 1×1 convolution has 128 input and 128 output channels. Without grouping it uses 128×128=16,384128\times128=16{,}384 multiplications. With eight groups, each group has 16 input and 16 output channels, for 8×16×16=2,0488\times16\times16=2{,}048 multiplications overall, one eighth of the original. A whole output feature map also multiplies this by the number of spatial positions. This example is not a whole-network FLOP count.

But there is no free lunch. In Figure 1(a), the second grouped layer uses the same partition, so outputs from the red group cannot use information from the green or blue groups. Grouping does not destroy channel values; it restricts which features later layers can combine. The shuffle in (b) and (c) rearranges channels between the layers so every new group receives data from different old groups.

Channel Shuffle

The paper's shuffle is deterministic. If the preceding layer has gg groups of nn channels, reshape the channel axis to (g,n)(g,n), transpose those two axes, and flatten it again. For a contiguous NCHW tensor, the following teaching example implements that permutation. It assumes a positive integer group count and a channel count divisible by groups; it omits input validation.

python
import torch

def shuffle_channel(x: torch.Tensor, groups: int) -> torch.Tensor:
    batch_size, num_channels, height, width = x.size()
    channels_per_group = num_channels // groups

    x = x.view(batch_size, groups, channels_per_group, height, width)
    x = x.permute(0, 2, 1, 3, 4).contiguous()
    x = x.view(batch_size, num_channels, height, width)
    return x

For example, label three channel groups AAA, BBB, and CCC. Transposing the group axes yields ABC, ABC, ABC, so each group in the next layer can see channels from all three old groups. Despite the name, this is a regular shuffle, not a random one. The point is to let the groups exchange information. The permutation adds no trainable parameters. Figure 1(c) is about the information path between successive grouped layers.

Where Does the Shuffle Go?

Paper Figure 2: (a) a reference bottleneck unit; (b) the first grouped 1×1 convolution is followed by shuffle, 3×3 depthwise convolution and a second grouped 1×1, then addition to the shortcut; (c) at stride 2 the shortcut uses average pooling and the paths are concatenated along channels.

Follow the main path of (b): a grouped 1×1 convolution changes channel width and is followed by BN and ReLU; channels are shuffled; a depthwise 3×3 processes spatial information; another grouped 1×1 restores the channel count. The authors put no ReLU after depthwise convolution and no extra shuffle after the second grouped 1×1. ReLU follows addition to the shortcut. This differs from the ordinary bottleneck in (a).

For downsampling in (c), a 3×3 average pool with stride 2 brings the shortcut to the same spatial size. The two paths are concatenated across channels, not added, allowing the output width to grow. The shuffle appears after the first grouped pointwise convolution, not after depthwise convolution.

Network Architecture

Paper Table 1: a 224×224 input passes through Conv1, MaxPool, then Stages 2, 3 and 4. The first unit of each stage downsamples with stride 2. Group counts g=1,2,3,4,8g=1,2,3,4,8 use different widths while total cost stays around 133–143 MFLOPs.

Conv1 reduces 224×224 to 112×112, then MaxPool to 56×56. Stages 2, 3, and 4 output 28×28, 14×14, and 7×7, respectively. The first unit of each stage downsamples; the others retain the size. Table 1 gives 3/7/3 further repeats in those stages. For example, at g=3g=3 their output channel counts are 240/480/960. Global pooling and classification finish the network.

As group count rises, the authors also widen channels to keep the comparison near 140 MFLOPs. Thus the different gg settings in Table 2 do more than change grouping at a fixed width. The paper also leaves the first pointwise layer of Stage 2 ungrouped because it has few input channels. These conditions matter when reading the ablations.

Discussion

Effect of Group Convolution

Paper Table 2: single-crop ImageNet top-1 error, so lower is better. The 1×, 0.5× and 0.25× models use about 140, 38 and 13 MFLOPs.

For the 1× model, error falls from 33.6% at g=1g=1 to its best 32.4% at g=8g=8, a 1.2 percentage-point difference. The 0.5× model is best at g=4g=4: 45.1→41.6%, or 3.5 points lower; error rises again to 42.3% at g=8g=8. The 0.25× model reaches 52.7% at g=8g=8, 4.4 points below its 57.1% at g=1g=1.

More groups also mean fewer input channels per filter. The authors suggest that more feature channels help small models, but the rebound for 0.5× means “more groups is always better” is not the finding.

Effect of Channel Shuffle

Paper Table 3: model width and group count are held fixed while shuffle is changed; all six settings show lower error with shuffle.

Across all six settings, shuffle lowers top-1 error by 1.3 to 5.8 percentage points. At 1× and g=8g=8, error drops from 37.6% to 32.4%, a 5.2-point difference. At 0.5× and g=8g=8, it drops from 48.1% to 42.3%, or 5.8 points. This ablation directly supports cross-group flow in the paper's models and training conditions.

Comparison with MobileNet

Paper Table 5: each pair compares MobileNet and ShuffleNet at similar cost. The columns report MFLOPs and top-1 error. The SE row is an added configuration in the revised paper.

ShuffleNet 2× (g=3g=3) records 26.3%/524 MFLOPs, against 29.4%/569 MFLOPs for 1.0 MobileNet-224. Error is 3.1 points lower at slightly lower theoretical cost. Among smaller models, ShuffleNet 0.5× (g=4g=4) records 41.6%/38 MFLOPs, against 49.4%/41 MFLOPs for 0.25 MobileNet-224, a 7.8-point reduction. The 7.8-point result belongs to that small-model comparison, not the full MobileNet.

Actual Inference Speed

Paper Table 8: historical measurements on one Qualcomm Snapdragon 820 processor with a single thread; 224×224, 480×640 and 720×1280 have separate latency columns.

ShuffleNet 0.5× (g=3g=3) has 43.2% top-1 error, close to AlexNet's 42.8%. At 224×224, they take 15.2/184.0 ms respectively, so ShuffleNet is about 12.1 times faster, against roughly 19 times fewer multiply-adds. At 480×640, they take 87.4/1156.7 ms, about 13.2 times apart, consistent with the paper's “about 13 times” description. The authors also observe that in their implementation a fourfold theoretical cost reduction often yields only about a 2.6-fold speedup.

Larger group counts such as g=4,8g=4,8 often improve classification but were less efficient in their implementation; the authors favored g=3g=3 as an accuracy–latency balance. Table 8 does not enumerate each gg comparison; that observation comes from the paper's speed evaluation text. Latency and memory must be measured again on a different phone, library, or GPU.

Conclusion

Many lightweight models aimed at mobile devices have a large gap between their expected cost and their actual inference time on hardware. ShuffleNet uses grouped 1×1 convolutions to reduce computation and channel shuffle to keep information flowing between groups. The paper's small-network results show that this can preserve useful accuracy under a tight budget.

This design is worth thinking about. Perhaps we can start from the same question when designing an even more efficient network: which operations are actually expensive on the device? The Snapdragon 820 measurements are a reminder to check final speed on the target hardware.