---
abstract: 'While going deeper has been witnessed to improve the performance of convolutional neural networks (CNN), going smaller for CNN has received increasing attention recently due to its attractiveness for mobile/embedded applications. It remains an active and important topic how to design a small network while retaining the performance of large and deep CNNs (e.g., Inception Nets, ResNets). Albeit there are already intensive studies on compressing the size of CNNs, the considerable drop of performance is still a key concern in many designs. This paper addresses this concern with several new contributions. First, we propose a simple yet powerful method for compressing the size of deep CNNs based on parameter binarization. The striking difference from most previous work on parameter binarization/quantization lies at different treatments of $1\times 1$ convolutions and $k\times k$ convolutions ($k>1$), where we only binarize $k\times k$ convolutions into binary patterns. The resulting networks are referred to as pattern networks. By doing this, we show that previous deep CNNs such as GoogLeNet and Inception-type Nets can be compressed dramatically with marginal drop in performance. Second, in light of the different functionalities of $1\times 1$ (data projection/transformation) and $k\times k$ convolutions (pattern extraction), we propose a new block structure codenamed the pattern residual block that adds transformed feature maps generated by $1\times 1$ convolutions to the pattern feature maps generated by $k\times k$ convolutions, based on which we design a small network with $\sim 1$ million parameters. Combining with our parameter binarization, we achieve better performance on ImageNet than using similar sized networks including recently released Google MobileNets.'
author:
- |
    Zhe Li$^{1,2}$    Xiaoyu Wang$^2$    Xutao Lv$^2$    Tianbao Yang$^1$\
    $^1$The University of Iowa                $^2$Snap Research\
    [{zhe-li-1,tianbao-yang}@uiowa.edu   fanghuaxue@gmail.com   xutao.lv@snap.com]{}
bibliography:
- 'ms.bib'
title: 'SEP-Nets: Small and Effective Pattern Networks'
---

Introduction
============

Deep convolutional neural networks have already achieved tremendous success on a variety of computer vision tasks such as image classification [@Alexnet12; @vggnet15; @googlenet15; @ResNet_cvpr16], object detection [@RCNN14; @sermanet2013overfeat; @fastrcnn15; @ren2015faster], segmentation [@long2015fully; @he2017mask], video analysis [@xu2015discriminative; @zha2015exploiting; @gan2015devnet], human pose estimation [@toshev2014deeppose] among many others. The performance on these different tasks are dramatically boosted by sophisticated neural network structures such as AlexNet [@Alexnet12], NIN (Network In Network) [@lin2013network], VGG-Net [@vggnet15], Inception Network [@googlenet15], and ResNet [@ResNet_cvpr16]. It is clear that the networks are going deeper and deeper from AlexNet to ResNets.

On the other hand, due to the need in mobile/embedded applications, there is a new trend of going smaller while retaining the performance of large and deep CNNs. While Inception Nets and ResNets have tried to reduce the model size by reducing the size of convolution kernels, using $1\times 1$ convolutions and trimming the fully connected layers, they are still too large to meet the demanding requirement for mobile and embedded devices (e.g., FPGA). For example, ResNet-101 has 200MB and GoogLeNet has 50MB. However, FPGAs often have less than 10MB of on-chip memory and no off-chip memory or storage [@iandola2016squeezenet]. To further reduce the model size, various compressing techniques have been introduced to deep CNNs, including parameter quantization, binarization, sharing, pruning, hashing, Huffman coding, etc [@cai2017deep; @courbariaux2016binarized; @han2015adeep; @han2015learning; @chen2015compressing; @hubara2016binarized; @courbariaux2015binaryconnect; @rastegari2016xnor; @ott2016recurrent; @zhou2016dorefa; @lin2016overcoming]. There also emerge few studies recently attempting to design small and compact networks, including the SqueezeNets [@iandola2016squeezenet] and the MobileNets [@howard2017mobilenets]. Nevertheless, the performance drop of smaller networks is still a critical concern for many designs. For example, the authors of [@iandola2016squeezenet] have designed an extremely small network with less than 0.5MB and achieved 57.5% top-1 accuracy on ImageNet, which is considerably less than state-of-the-art results of deep CNNs (e.g., 68.65% of GoogLeNet according to our implementation).

In this paper, we address this concern by proposing several new techniques in the two aforementioned directions for reducing the model size. [**First**]{}, we consider parameter binarization - a simple and effective method for reducing the model size. While many previous works try to quantize or binarize all weights in deep CNNs, we propose a novel treatment of $1\times 1$ kernels and $k\times k$ kernels (e.g., $k=3, 5$). In particular, we only binarize $k\times k$ convolutional kernels (with $k>1$). This design is motivated by the difference between $1\times 1$ convolutions and $k\times k$ convolutions and the community’s prior knowledge about them. Unlike $k\times k$ convolutions that explicitly extract features in a spatial manner, $1\times 1$ convolutions serve as data projection and transformation. In this sense, $1\times 1$ convolutions need to preserve the information as much as possible and $k\times k$ convolutions is only required to extract abstract patterns from images. In addition, many works in computer vision have used binary convolutions to extracted features from images [@whitehill2006haar; @st2016fast], while sparse projection has been reported with performance drop compared with dense projection [@xu2016efficient]. The different treatments of $1\times 1$ and $k\times k$ kernels also has several benefits in terms of computation: (i) $1\times 1$ convolutions using floating points is cheaper and simpler than $k\times k$ convolutions; (ii) this splitting is very suitable for FPGAs where logic blocks can efficiently handle the binarized convolutions and DSP units can handle the $1\times 1$ convolutions. [**Second**]{}, we propose a simple new design of small networks by stacking up several layers of a novel module, which is built on a new block codenamed pattern residual block. The idea of the pattern residual block is to add transformed feature maps generated by $1\times 1$ convolutions to the pattern feature maps generated by $k\times k$ convolutions, which resembles but generalizes the skip connection in ResNets. The new pattern residual block is well suited to the design of small networks for increasing the model capacity and more importantly to the binarized pattern networks for offsetting the effect of pattern binarization. Using 5.2MB, our designed small network (termed as **SEP-Net**) achieves $65.8\%$ top-1 accuracy, beating that of the SqueezeNet (4.8MB, 60.4%) and the MobileNet (5.2MB, 63.7%) with simlar sizes. Leveraging our pattern binarization, we reduce our model size to 4.2MB while maintaining 63.7% top-1 accuracy. By further quantizing $1\times 1$ filters using $8$ bits, we achieve 63.5% top-1 accuracy with a model size 1.3MB.

Related Work
============

In this section, we briefly review the related work on designing modern network structures and techniques for reducing neural network model size. Since introduced in [@lin2013network], the $1\times 1$ convolutions have been extensively used in modern networks such as Inception Nets and ResNets, which can reduce the number of parameters comparing with large convolutional kernels. In these network designs, the $1\times 1$ convolutions mainly serve as data projection for reducing the channels of feature maps. Inception Nets also concatenate the $1\times 1$ convolved feature maps and the $k\times k$ convolved feature maps in the inception modules. In this paper, we will innovatively leverage the power of $1\times 1$ convolutions to improve the performance of binarized networks. In addition, we will utilize the data transformation capability of $1\times 1$ convolutions to design a new residual block. Recently, there emerge intensive studies on compressing the size of CNNs. Various techniques have been introduced to CNNs to either reduce the number of parameters or reduce the size of parameter representations. These include weight pruning [@han2015deep; @han2015learning], weight binarization [@hubara2016binarized; @courbariaux2015binaryconnect; @rastegari2016xnor], weight ternarization [@ott2016recurrent; @yin2016training; @mellempudi2017ternary; @li2016ternary; @lin2015neural], weight quantization [@courbariaux2016binarized; @cai2017deep] and designing small and compact networks [@lin2013network; @iandola2016squeezenet]. There are several differences between the proposed weight binarization and previous work on weight binarization [@hubara2016binarized]. First, unlike previous work that binarize all weights, we only binarize the weights of $k\times k$ filters ($k>1$). Second, our focus is not to reduce the computational costs of training by binarization but instead to reduce the costs for deploying the model, which is clearly different from some previous works focusing on training, e.g., BinaryConnect [@courbariaux2015binaryconnect], Binarized Neural Networks [@hubara2016binarized], XNOR-Nets [@rastegari2016xnor]. Our approach is to directly binarize fully trained deep CNNs and fine-tune the $1\times 1$ filters. The benefit of this two-step approach is that it will not suffer from difficulties of training binarized networks and therefore enjoy less performance drop.

The design of small and compact networks is the focus of several recent works. Xu et al. [@juefei2016local] exploited the local binary convolutional operators in deep CNNs. They utilize traditional local binary operators in place of $k\times k$ ($k>1$) convolutions. The difference from our work is that the binary convolutional filters in their work are randomly generated and fixed during training of the networks. In addition, the performance of their networks on large scale ImageNet data is not shown. The SqueezeNet explored several strategies to reduce the number of parameters including (i) replacing $k\times k$ convolutions ($k>1$) by $1\times 1$ convolutions; (ii) decreasing the number of input channels to $3\times 3$ filters; and (iii) postponing the down sampling to late layers in the network [@iandola2016squeezenet]. They designed Fire module that consists of $1\times 1$ convolutional layers to squeeze the size of feature maps and an expand layer that has a mix of 1x1 and 3x3 convolution filters. The MobileNets approximate the standard $k\times k$ ($k>1$) convolutions by depth-wise convolutions and $1\times 1$ convolutions, and also introduce two hyper-parameters to balance between latency and accuracy [@howard2017mobilenets]. The small pattern networks explored in this paper share some similarities to these previous small networks in that much computation burden will shift to the $1\times 1$ convolutions but also bear some subtle differences. Most importantly, the present work has achieved the best performance on ImageNet data with the same network size among the MobileNets and SqueezeNets.

Our Approach {#approach}
============

In this section, we present the crucial ingredients of the designed **SEP-Net**: Pattern Binarization and Pattern Residual Block. It is notable that these two techniques are of their own interest and could be employed in design of other small neural network structures. Following those techniques, we present the detailed architecture of the designed **SEP-Net**.

Pattern Binarization
--------------------

Since fully connected layers have been removed in modern deep CNNs (including Inception Nets, ResNets), here we only consider parameterized convolutional layers. We adopt the following simple procedure to obtain a compressed network from any successful network structures including our designed SEP-Net as described later:

-   Step 1: train a full neural network such as GoogLeNet, ResNet and SEP-Net from scratch.

-   Step 2: binarize $k\times k$ ($k>1$) convolutional filters in the well-trained neural network model.

-   Step 3: fine-tune the scaling factors of all binarized $k\times k$ filters and the floating point representations of all $1\times 1$ filters by back-propagation on the same dataset.

The different treatments of $1\times 1$ filters and $k\times k$ filters is motivated by their complementary roles in CNNs. $k\times k$ filters serve as spatial pattern extraction from an input image/feature map, while $1\times 1$ filters mainly serve as data projection and transformation. To justify our choice, we also quantitatively analyze the effect of binarizing $1\times 1$ filters and $k\times k$ filters from the viewpoint of quantization error. In particular, if we let $W$ denote an $c\times k\times k$ convolutional filter. The binarization seeks to approximate it by $\alpha B$, where $B$ is a binary filter with entries from $\{1,-1\}$ and $\alpha$ is a scaling factor. From the viewpoint of minimizing the quantization error, $\alpha, B$ can be sought by solving the following problem: $$\begin{aligned}
\min_{\alpha\in\mathbb R, B\in\{1,-1\}^{c\times k\times k}} E(W, B, \alpha)\triangleq  \|W - \alpha B\|_F^2\end{aligned}$$ The optimal solutions have been studied in [@iandola2016squeezenet]. Actually, the optimal $B^*$ can be found by thresholding, i.e., $B^*_{i,j,l}=1$ if $W_{i,j,l}\geq 0$ and $B^*_{i, j, l}=-1$ if $W_{i, j, l}<0$. This binarization procedure is illustrated in Figure \[fig:binaryfilter-sep-net-detail\]. The optimal $\alpha_*$ can be computed by $\alpha_* = \frac{\sum_{i,j, l}|W_{i,j,l}|}{c\times k\times k}$. To quantitatively understand the effect of binarizing $1\times 1$ filters and $k\times k$ filters, we first train a fully GoogLeNet [@googlenet15], which is composed of $1\times 1$, $3\times 3$ and $5\times 5$ convolutions filters. Then we compute the quantization error for all filters, and obtain averaged quantization error for $1\times 1$, $3\times 3$ and $5\times 5$ filters, respectively. The result is reported in Table \[tab:qe\], from which we can clearly see that that quantization error for $1\times 1$ filters is by a order of magnitude larger than that of $3\times 3$ and $5\times 5$ filters. This justifies our choice of binarizing $k\times k$ filters ($k>1$) while retaining $1\times 1$ filters. We present more results on prediction performance by binarizing $1\times 1$, $3\times 3$ and $5\times 5$ filters.

  $1\times 1$   $3\times 3$   $5\times 5$
  ------------- ------------- -------------
  $0.0462$      $0.0029$      $0.0056$

  : Averaged Quantization Error of Different Sized Filters from GoogLeNet.[]{data-label="tab:qe"}

![A trained $3\times 3$ filter from GoogLeNet (Left), and its binarized version (Right)[]{data-label="fig:binaryfilter-sep-net-detail"}](figures/pattern-binarization.png)

Pattern Residual Block and the Architecture of **SEP-Net** {#sec:PRB}
----------------------------------------------------------

Pattern binarization is an effective method for compressing the size of a large and deep CNN. We can apply this technique to reducing the size of previous deep CNNs (e.g., GoogLeNets, Inception Nets and ResNets). However, due to that the original sizes of these deep CNNs are very large, the resulting pattern networks from these deep CNNs may not be small enough for deployment in mobile and embedded applications. To address this issue, we propose a new design of a small and effective network (**SEP-Net**).

#### Pattern Residual Block.

We first describe the building block of our design - a novel block codenamed pattern residual block (PRB). As shown in Figure \[fig:group-convolution\](a), the PRB consists of $1\times1$ convolutions and $k\times k$ convolutions (in particular $k=3$), which are executed in parallel and their feature maps are added together. In particular, if we let $x$ denote an input, the output of this building block can be expressed as $O(x) = C_{k\times k}(x) + C_{1\times 1}(x)$, where $C_{k\times k}$ denotes a $k\times k$ convolution ($k>1$) and $C_{1\times 1}$ represents $1\times 1$ convolution. If we consider $x$ a vector, $C_{1\times 1}(x)$ is equivalent to $Ax$, where $A$ is a linear mapping. Since this is a generalization of identity mapping, we find it particularly useful in building pattern networks. Especially when the pattern block ($3*3$ convolutions) is binarized, the additive $1\times 1$ convolutions is able to offset the change incurred by the binarization, which acts the residual between fully $3*3$ filtered maps and binarized $3*3$ filtered maps.

#### SEP-Net Module and SEP-Net.

Built on the PRB, we design a new module for our SEP-Net, which is shown in Figure \[fig:modules\](f). Our SEP-Net module consits of a dimension reduction layer ($1\times 1$ convolutions), 2 PRB blocks with different output channles, and a dimension recovery layer ($1\times 1$ convolutions). The last recovery layer enables us to add the skip connection as in ResNets, which is helpful for building up more layers. We also compare with other module designs of different networks in Figure \[fig:modules\]. In particular, comparing with the Fire module of the SqueezeNet, the SEP-Net module does not use the filter concatenation as introduced in Inception Net. Comparing with the ResNet bottleneck module, we replace the $3\times 3$ convolutional layers with the PRB blocks. Finally, we plot the architecture of our experimented SEP-Nets in Figure \[fig:experimented-sep\]. The detailed information of our experimented SEP-Nets (filter size, number of output channels, pad and stride of convolutional layers) is delayed to the supplement.

![image](figures/experimented-sep2.png)

#### Group-wise Convolution.

To further reduce the model size, we adopt group convolution [@Alexnet12] in our architecture. In particular, for each convolution (including both $1\times 1$ convolution and $3\times 3$ convolution), we split the input feature maps into $N$ groups and apply the corresponding convolution with a smaller number of channels to each group. The resulting feature maps in each group will be concatenated together. This simple design can effectively reduce the number of parameters by a factor of $N$. To see this, we can think about an example that maps an input feature map with $a$ channels to a feature map with $b$ channels. Using a single convolution $k\times k$, the size of the filter is $k*k*a*b$. If we use group convolution with $N$ groups, the size of each group filter is $k*k*\frac{a}{N}\times\frac{b}{N}$. As a result, the total size of all group filters is $k*k*a*b/N$. In our implementation, we utilize group convolutions with a factor of 4 for all $1 \times 1$ and $3 \times 3$ kernels, thus reducing number of parameters by 4 times compared to that without using group convolutions. In Figure \[fig:group-convolution\](b), we show 4 group convolutions that are applied to all $1\times 1$ and $3 \times 3$ convolutions. It is notable that if we set the number of groups equal to the number of input channels, it degenerates to depth-wise convolutions as used in Google’s MobileNets [@howard2017mobilenets].

As a final note, one could potentially train the pattern networks with binarized $k\times k$ filters from scratch, which might allow one to incorporate the domain knowledge into the design of binary patterns of $k\times k$ filters. Thus, it holds potential to benefit from traditional used binary filters for designing deep but small neural networks.

Experiment {#experimental-result}
==========

In this section, we first present experimental results on CIFAR-10 [@krizhevsky2009learning] and ImageNet dataset [@Imagenet09] to justify that pattern binarization could reduce the effective number of parameters dramatically and fine-tuning other parameters of the binarized network with fixed binarized pattern could achieve comparable performance to that of the original neural network models. Then, we show the designed **SEP-Net** structure could achieve better or comparable performance on ImageNet than using similar sized networks such as recently released Google MobileNets. We conduct all experiments using Caffe [@caffe14] open sourced library.

CIFAR-10
--------

We first conduct experiments on the CIFAR-10 dataset [@krizhevsky2009learning], which has 50,000 training images and 10,000 test images. Each image belongs to one of 10 classes and has RGB format with 32x32 size in the original data set. The data is preprocessed by Global Contrast Normalization (GCN) and ZCA whitening [@goodfellow2013maxout] and also padded by 4 pixels on each side of image. In the training phase, 32x32 crop is randomly sampled from the padded image while in the test phase we only test on the original image. We start the learning rate from 0.1 and divide by 10 at iteration 32k and 48k and the maximum number of iteration is 64K. The momentum is 0.9 and the weight decay is 0.0001. We train on one GPU using mini-batch SGD with a batch size 256. We report the test accuracy from the original paper and neural network models trained by us from scratch. Note that the minor difference of performance between our results and that reported in the original paper might be due to data augmentation. We apply pattern binarization to several recent successful network structures: ResNet-20, ResNet-32, ResNet-44, ResNet-56 [@ResNet_cvpr16]. We first binarize 3x3 kernels in all convolutional layers of the obtained **Full** Model. For presentation purpose, we term the model after pattern binarization without fine-tuning as (**BiPattern** model). Then we do fine-tuning other parameters of **BiPattern** model fixing binarized pattern on the original Cifar10 data set to obtain **Refined** model. We report test accuracy from the original paper denoted by **Ref**, and of the **Full** model, the **BiPattern** model and the **Refined** model in the Table \[cifar10-test-accuracy\]. We can see from Table \[cifar10-test-accuracy\] that the test accuracy of **Refined** models are very close to that of models, which justify that 3x3 filters could be replaced with binary pattern extractions without sacrificing performance.

[l|l|llll]{} Model & Acc &**Ref** & **Full** & **BiPattern** & **Refined**\
ResNet-20 &

  -------
  Top-1
  Top-5
  -------

&

  --------
  0.9125
  -
  --------

&

  --------
  0.9118
  0.9974
  --------

&

  --------
  0.1546
  0.5104
  --------

&

  --------
  0.8649
  0.9941
  --------

\
ResNet-32 &

  -------
  Top-1
  Top-5
  -------

&

  --------
  0.9249
  -
  --------

&

  --------
  0.9276
  0.9972
  --------

&

  --------
  0.2634
  0.6932
  --------

&

  --------
  0.9021
  0.9962
  --------

\
ResNet-44 &

  -------
  Top-1
  Top-5
  -------

&

  --------
  0.9283
  -
  --------

&

  --------
  0.9283
  0.9982
  --------

&

  --------
  0.4825
  0.8765
  --------

&

  --------
  0.9145
  0.9965
  --------

\
ResNet-56 &

  -------
  Top-1
  Top-5
  -------

&

  --------
  0.9303
  -
  --------

&

  --------
  0.9375
  0.9977
  --------

&

  --------
  0.5382
  0.9574
  --------

&

  --------
  0.9302
  0.9971
  --------

\

\
\
In Table \[cifar10-number-param\] we compare the effective number of parameters between full ResNet-20, ResNet-32, ResNet-44, ResNet-56 models and their corresponding binarized pattern networks. The effective number of parameters of the pattern network is referred to as the number of parameters that use floating point representations. In particular, we use one number to represent the binarized $3\times 3$ or $5\times5$ kernels by the scaling factor. From Table \[cifar10-number-param\] we can see that the number of parameters is reduced dramatically. For example the number of parameters in corresponding pattern network is reduced $86\%$ compared to original ResNet-56 model.

  Model       **Full Network**   **Pattern Network**
  ----------- ------------------ ---------------------
  ResNet-20   292K               55K
  ResNet-32   487K               78K
  ResNet-44   682K               100K
  ResNet-56   876K               123K

  : Comparison of the number of parameters between **Full** networks and **Pattern** networks. We use one number to represent a binarized $3\times3$ or $5\times5$ kernel.[]{data-label="cifar10-number-param"}

ImageNet
--------

We also carry out experiments on the ImageNet 2012 classification data set [@Imagenet09], which has 1.28 millions of training images and 50k validation images. Each image belongs to one of 1000 classes. We apply the same pattern binarization procedure used to ResNet on CIFAR-10 experiment to GoogLeNet [@googlenet15] and our customized Inception-net (denoted as C-InceptionNet) that removes all computationally expensive $5\times5$ convolutional kernels . For training GoogLeNet, we adopt the learning strategy from Caffe website and the learning rate follows a polynomial decay with the initial learning rate being $0.01$, momentum term $0.9$ and weight decay $0.0002$. We train GoogLeNet with a maximum number of iterations $600$K on one GPU and a batch size $128$. For training C-InceptionNet, we set initial learning rate as 0.1, divide learning rate 10 time after every 24 epochs, and train in total 90 epochs. At the end, we compare test accuracy of the **Full** model, the **BiPattern** model, and the **Refined** model corresponding to GoogLeNet and C-InceptionNet.

To illustrate the effect of binarizing different size filters, we report several results on GoogLeNet. We first binarize $3\times 3$ filters fixing $5 \times 5$ filters. Alternatively, we binarize $5 \times 5$ filters meanwhile fixing $3 \times 3$ filters. For comparison, we also conduct experiment by a) binarizing both $3 \times 3$ and $5 \times 5$ filters; b) binarizing only $1\times1 $ kernels. For C-InceptionNet, we only show the result of binarizing all $3\time 3$ filters. We present comparison results including test performance on **Refined** model using multicrop [@Alexnet12] in Table \[Imagenet-test accuracy\], from which we could see: i) for C-InceptionNet, the performance of the **Refined** model is competitive to the full model, just $0.8\%$ less than the full model on Top-1 accuracy; ii) for GoogLeNet, the performance of the **Refined** models of binarizing $k\times k$ filters ($k>1$) is significantly competitive to the full model; iii) binarizing $1\times1$ kernels suffers from more performance loss compared to binarizing $k\times k$ kernels ($k>1$), which justifies that our choice of binarizing $k \times k$ kernels ($k >1$) while retaining $1 \times 1$ kernels. All the performance numbers are based on a single center crop when performing testing except for the last column, which is included for future reference.

[l|l|lllll]{} Model & Acc & **Ref** & **Full** & **BiPattern** & **Refined** & **Multicrop**\
GoogLeNet &

  -------
  Top-1
  Top-5
  -------

&

  --------
  -
  0.8993
  --------

&

  --------
  0.6865
  0.8891
  --------

&

  ----------------------
  1x1 pattern:
  0.0013
  0.0075
  [2-8]{} 3x3 pattern:
  0.3706
  0.6290
  5x5 pattern:
  0.5141
  0.7619
  3x3 & 5x5 pattern:
  0.1428
  0.31738
  ----------------------

&

[@l@]{}\
0.6117\
0.8395\
\
0.6797\
0.8827\
\
0.6917\
0.8904\
\
0.6694\
0.8763

&

[@l@]{}\
0.636\
0.856\
\
0.6893\
0.8898\
\
0.6984\
0.8965\
\
0.6812\
0.8844

\

C-InceptionNet &

  -------
  Top-1
  Top-5
  -------

& &

  -------
  0.648
  0.863
  -------

&

  --------
  0.0476
  0.1464
  --------

&

  --------
  0.6400
  0.8550
  --------

&

  --------
  0.6521
  0.8626
  --------

\

In Table \[imagenet-num-parameter\], we compare the number of parameters of the full GoogLeNet and C-InceptionNet and their corresponding pattern networks. We can see that the pattern networks have dramatically less number of parameters that that of the full models. For example through binarizing $3\times3$ and $5\times5$ filters, we reduce the number of parameters by $44.6\%$ compared to that of the full GoogLeNet.

\[imagenet-num-parameter\]

  Model                     **Full Network**   **Pattern Network**                 
  ------------------------- ------------------ --------------------------- ------- --
                                               $3 \times 3$                4.43M   
                                               $5 \times 5$                6.43M   
                                               $3 \times 3$ $5 \times 5$   3.87M   
  Customized-InceptionNet   5.10M                                                  

Comparison with The-State-Of-Art
--------------------------------

Finally, we compare the proposed **SEP-Net** with the SqueezeNet and the recently released MobileNet in terms of model size and classification accuracy. We present the performance of several variations of our SEP-Net architectures: SEP-Net-R, SEP-Net-B, SEP-Net-BQ. Here SEP-Net-R is our SEP-Net with raw filters. SEP-Net-B denotes SEP-Net with pattern binarization. SEP-Net-BQ further quantizes all other parameters to 8 bits. As shown in Table \[tb:sepnet-mobilenet\], we have trained two extremely small SEP-Nets suited for mobile/embedded devices. One model has 1.3M parameters, while the other has 1.7M parameters. The two SEP-Nets share the same neural network structure as Figure \[fig:experimented-sep\]. The difference between the two SEP-Nets is: (1) in the SEP-Net with 1.7M parameters the last convolution layer uses a factor of 4 for group-wise convolution while the SEP-Net with 1.3M parameters uses a factor of 16 for the last layer group-wise convolution; (2) the output dimension of the last convolutional layers of the SEP-Net with 1.7M parameters is 400 while that of the SEP-Net with 1.3M parameters is 512. They produce $65.8\%$ and $66.7\%$ top 1 classification accuracy on the ImageNet dataset, respectively. Our small model outperforms MobileNet’s equivalent with the same model size. Our larger model increases number of parameters by 0.3M, boosting the performance by $2\%$.

For easy comparison to other small CNNs, we also present the memory size of different models. Our **SEP-Net-B** reduces the model size to 4.2MB with slightly decreased accuracy of $63.7\%$ that equals to the performance of the MobileNet with 5.2MB. Our **SEP-Net-BQ** further reduces the storage or memory cost to $1.3$MB while maintaining roughly the same performance. It indicates that our extremely compact model also works with standard compression techniques.

[l|ll|ll]{} Model & Parameter number & Size (bytes) & Top-1 Acc\
MobileNet &

  ------
  1.3M
  2.6M
  ------

&

  --------
  5.2MB
  10.4MB
  --------

&

  -------
  0.637
  0.684
  -------

\
SEP-Net-R &

  --------------
  1.3M (small)
  1.7M (large)
  --------------

&

  -------
  5.2MB
  6.7MB
  -------

&

  -------
  0.658
  0.667
  -------

\
\

SqueezeNet [@iandola2016squeezenet] & 1.2M & 4.8MB & 0.604\
MobileNet [@howard2017mobilenets] & 1.3M & 5.2MB & 0.637\
SEP-Net-R (Small) & [**1.3M**]{} & [**5.2MB**]{} & [**0.658**]{}\
SEP-Net-B (Small) & 1.1M & 4.2MB & 0.637\
SEP-Net-BQ (Small) & 1.1M & 1.3MB & 0.635\

Conclusion
==========

In this paper, we view neural network operations as $1\times 1$ data transformation and $k\times k$ abstract pattern extraction. By converting $k\times k$ convolution kernels into binary patterns, we significantly reduced the model size as well as computational cost of modern neural network architectures such as InceptionNets and ResNets, without significantly sacrificing the network performances. Our binarization approach is extremely simple compared to previous literatures. We further proposed a small network architecture containing pattern residual blocks, which utilize binarized patterns to extract features and $1\times 1$ transformation to compute pattern residuals. The resulting concise neural network is small and effective compared to recent advances in compact neural network design. The effectiveness of our approach is demonstrated intensively on the CIFAR-10 dataset and the ImageNet dataset. We hope our investigation will inspire the community for advanced architecture design from a pattern point of view.

Appendix
========

We present the whole neural network structures for the designed **SEP-Net** with 1.7M parameters in Table \[label:sep-net-large-param\] and **SEP-Net** with less parameters in Table \[label:sep-net-less-param\].

  Layer Type                             \#Channel   Kernel size   Pad/Stride   \#Group
  -------------------------------------- ----------- ------------- ------------ ---------
  conv1\_base                            64          $5\times5$    1/2          1
  st/sep-module1\_svd1\_base             32          $1\times1$    0/1          1
  st/sep-module1\_slice1\_1x1\_0\_base   32          $1\times1$    0/1          4
  st/sep-module1\_slice1\_3x3\_0\_base   32          $3\times3$    1/1          4
  st/sep-module1\_slice2\_1x1\_0\_base   16          $1\times1$    0/1          4
  st/sep-module1\_slice2\_3x3\_0\_base   16          $3\times3$    1/1          4
  st/sep-module1\_svd2\_base             64          $1\times1$    0/1          1
  conv2\_base                            128         $3\times3$    1/2          1
  st/sep-module2\_svd1\_base             64          $1\times1$    0/1          1
  st/sep-module2\_slice1\_1x1\_0\_base   64          $1\times1$    0/1          4
  st/sep-module2\_slice1\_3x3\_0\_base   64          $3\times3$    1/1          4
  st/sep-module2\_slice2\_1x1\_0\_base   32          $1\times1$    0/1          4
  st/sep-module2\_slice2\_3x3\_0\_base   32          $3\times3$    1/1          4
  st/sep-module2\_svd2\_base             128         $1\times1$    0/1          1
  conv3\_base                            256         $3\times3$    1/2          4
  st/sep-module3\_svd1\_base             128         $1\times1$    0/1          1
  st/sep-module3\_slice1\_1x1\_0\_base   128         $1\times1$    0/1          4
  st/sep-module3\_slice1\_3x3\_0\_base   128         $3\times3$    1/1          4
  st/sep-module3\_slice2\_1x1\_0\_base   64          $1\times1$    0/1          4
  st/sep-module3\_slice2\_3x3\_0\_base   64          $3\times3$    1/1          4
  st/sep-module3\_svd2\_base             256         $1\times1$    0/1          1
  st/sep-module4\_svd1\_base             128         $1\times1$    0/1          1
  st/sep-module4\_slice1\_1x1\_0\_base   128         $1\times1$    0/1          4
  st/sep-module4\_slice1\_3x3\_0\_base   128         $3\times3$    1/1          4
  st/sep-module4\_slice2\_1x1\_0\_base   64          $1\times1$    0/1          4
  st/sep-module4\_slice2\_3x3\_0\_base   64          $3\times3$    1/1          4
  st/sep-module4\_svd2\_base             256         $1\times1$    0/1          1
  conv4\_base                            256         $3\times3$    1/2          1
  st/sep-module5\_svd1\_base             128         $1\times1$    0/1          4
  st/sep-module5\_slice1\_1x1\_0\_base   128         $1\times1$    0/1          4
  st/sep-module5\_slice1\_3x3\_0\_base   128         $3\times3$    1/1          4
  st/sep-module5\_slice2\_1x1\_0\_base   64          $1\times1$    0/1          4
  st/sep-module5\_slice2\_3x3\_0\_base   64          $3\times3$    1/1          4
  st/sep-module5\_svd2\_base             256         $1\times1$    0/1          1
  st/sep-module6\_svd1\_base             128         $1\times1$    0/1          1
  st/sep-module6\_slice1\_1x1\_0\_base   128         $1\times1$    0/1          4
  st/sep-module6\_slice1\_3x3\_0\_base   128         $3\times3$    1/1          4
  st/sep-module6\_slice2\_1x1\_0\_base   64          $1\times1$    0/1          4
  st/sep-module6\_slice2\_3x3\_0\_base   64          $3\times3$    1/1          4
  st/sep-module6\_svd2\_base             256         $1\times1$    0/1          1
  conv5\_base                            400         $3\times3$    1/2          4

  Layer Type                             \#Channel   Kernel size   Pad/Stride   \#Group
  -------------------------------------- ----------- ------------- ------------ ---------
  conv1\_base                            64          $5\times5$    1/2          1
  st/sep-module1\_svd1\_base             32          $1\times1$    0/1          1
  st/sep-module1\_slice1\_1x1\_0\_base   32          $1\times1$    0/1          4
  st/sep-module1\_slice1\_3x3\_0\_base   32          $3\times3$    1/1          4
  st/sep-module1\_slice2\_1x1\_0\_base   16          $1\times1$    0/1          4
  st/sep-module1\_slice2\_3x3\_0\_base   16          $3\times3$    1/1          4
  st/sep-module1\_svd2\_base             64          $1\times1$    0/1          1
  conv2\_base                            128         $3\times3$    1/2          1
  st/sep-module2\_svd1\_base             64          $1\times1$    0/1          1
  st/sep-module2\_slice1\_1x1\_0\_base   64          $1\times1$    0/1          4
  st/sep-module2\_slice1\_3x3\_0\_base   64          $3\times3$    1/1          4
  st/sep-module2\_slice2\_1x1\_0\_base   32          $1\times1$    0/1          4
  st/sep-module2\_slice2\_3x3\_0\_base   32          $3\times3$    1/1          4
  st/sep-module2\_svd2\_base             128         $1\times1$    0/1          1
  conv3\_base                            256         $3\times3$    1/2          4
  st/sep-module3\_svd1\_base             128         $1\times1$    0/1          1
  st/sep-module3\_slice1\_1x1\_0\_base   128         $1\times1$    0/1          4
  st/sep-module3\_slice1\_3x3\_0\_base   128         $3\times3$    1/1          4
  st/sep-module3\_slice2\_1x1\_0\_base   64          $1\times1$    0/1          4
  st/sep-module3\_slice2\_3x3\_0\_base   64          $3\times3$    1/1          4
  st/sep-module3\_svd2\_base             256         $1\times1$    0/1          1
  st/sep-module4\_svd1\_base             128         $1\times1$    0/1          1
  st/sep-module4\_slice1\_1x1\_0\_base   128         $1\times1$    0/1          4
  st/sep-module4\_slice1\_3x3\_0\_base   128         $3\times3$    1/1          4
  st/sep-module4\_slice2\_1x1\_0\_base   64          $1\times1$    0/1          4
  st/sep-module4\_slice2\_3x3\_0\_base   64          $3\times3$    1/1          4
  st/sep-module4\_svd2\_base             256         $1\times1$    0/1          1
  conv4\_base                            256         $3\times3$    1/2          4
  st/sep-module5\_svd1\_base             128         $1\times1$    0/1          1
  st/sep-module5\_slice1\_1x1\_0\_base   128         $1\times1$    0/1          4
  st/sep-module5\_slice1\_3x3\_0\_base   128         $3\times3$    1/1          4
  st/sep-module5\_slice2\_1x1\_0\_base   64          $1\times1$    0/1          4
  st/sep-module5\_slice2\_3x3\_0\_base   64          $3\times3$    1/1          4
  st/sep-module5\_svd2\_base             256         $1\times1$    0/1          1
  st/sep-module6\_svd1\_base             128         $1\times1$    0/1          1
  st/sep-module6\_slice1\_1x1\_0\_base   128         $1\times1$    0/1          4
  st/sep-module6\_slice1\_3x3\_0\_base   128         $3\times3$    1/1          4
  st/sep-module6\_slice2\_1x1\_0\_base   64          $1\times1$    0/1          4
  st/sep-module6\_slice2\_3x3\_0\_base   64          $3\times3$    1/1          4
  st/sep-module6\_svd2\_base             256         $1\times1$    0/1          1
  conv5\_base                            512         $3\times3$    1/2          16
