H IERARCHICAL R EPRESENTATIONS FOR E FFICIENT A RCHITECTURE S EARCH
A BSTRACT
We explore efﬁcient neural architecture search methods and show that a simple yet powerful evolutionary algorithm can discover new architectures with excellent performance.
Our approach combines a novel hierarchical genetic representation scheme that imitates the modularized design pattern commonly adopted by human experts, and an expressive search space that supports complex topologies.
Our algorithm efﬁciently discovers architectures that outperform a large number of manually designed models for image classiﬁcation, obtaining top-1 error of 3.6% on CIFAR-10 and 20.3% when transferred to ImageNet, which is competitive with the best existing neural architecture search approaches.
We also present results using random search, achieving 0.3% less top-1 accuracy on CIFAR-10 and 0.1% less on ImageNet whilst reducing the search time from 36 hours down to 1 hour.
I NTRODUCTION
Discovering high-performance neural network architectures required years of extensive research by human experts through trial and error.
As far as the image classiﬁcation task is concerned, state-ofthe-art convolutional neural networks are going beyond deep, chain-structured layout (Simonyan &
Zisserman, 2014; He et al., 2016a) towards increasingly more complex, graph-structured topologies (Szegedy et al., 2015; 2016; 2017; Larsson et al., 2016; Xie et al., 2016; Huang et al., 2016).
The combinatorial explosion in the design space makes handcrafted architectures not only expensive to obtain, but also likely to be suboptimal in performance.
Recently, there has been a surge of interest in using algorithms to automate the manual process of architecture design.
Their goal can be described as ﬁnding the optimal architecture in a given search space such that the validation accuracy is maximized on the given task.
Representative architecture search algorithms can be categorized as random with weights prediction (Brock et al., 2017), Monte
Carlo Tree Search (Negrinho & Gordon, 2017), evolution (Stanley & Miikkulainen, 2002; Xie &
Yuille, 2017; Miikkulainen et al., 2017; Real et al., 2017), and reinforcement learning (Baker et al., 2016; Zoph & Le, 2016;
Zoph et al., 2017; Zhong et al., 2017), among which reinforcement learning approaches have demonstrated the strongest empirical performance so far.
Architecture search can be computationally very intensive as each evaluation typically requires training a neural network.
Therefore, it is common to restrict the search space to reduce complexity and increase efﬁciency of architecture search.
Various constraints that have been used include: growing a convolutional “backbone” with skip connections (Real et al., 2017), a linear sequence of ﬁlter banks (Brock et al., 2017), or a directed graph where every node has exactly two predecessors (Zoph et al., 2017).
In this work we constrain the search space by imposing a hierarchical network structure, while allowing ﬂexible network topologies (directed acyclic graphs) at each level of the hierarchy.
Starting from a small set of primitives such as convolutional and pooling operations at the bottom level of the hierarchy, higher-level computation graphs, or motifs, are formed by using lower-level motifs as their building blocks.
The motifs at the top of the hierarchy are stacked multiple times to form the ﬁnal neural network.
This approach enables search algorithms to implement powerful hierarchical modules where any change in the motifs is propagated across the whole network immediately.
This is analogous to the modularized design patterns used in many handcrafted architectures, e.g. VGGNet (Simonyan & Zisserman, 2014), ResNet (He et al., 2016a), and
Inception (Szegedy et al., 2016) are all comprised of building blocks.
In our case, a hierarchical architecture is discovered through evolutionary or random search.
The evolution of neural architectures was studied as a sub-task of neuroevolution (Holland, 1975;
Miller et al., 1989; Yao, 1999; Stanley & Miikkulainen, 2002; Floreano et al., 2008), where the topology of a neural network is simultaneously evolved along with its weights and hyperparameters.
The beneﬁts of indirect encoding schemes, such as multi-scale representations, have historically been discussed in Gruau et al.
; Kitano (1990); Stanley (2007); Stanley et al. (2009).
Despite these pioneer studies, evolutionary or random architecture search has not been investigated at larger scale on image classiﬁcation benchmarks until recently (Real et al., 2017; Miikkulainen et al., 2017; Xie & Yuille, 2017; Brock et al., 2017; Negrinho & Gordon, 2017).
Our work shows that the power of simple search methods can be substantially enhanced using well-designed search spaces.
Our experimental setup resembles Zoph et al.
(2017), where an architecture found using reinforcement learning obtained the state-of-the-art performance on ImageNet.
Our work reveals that random or evolutionary methods, which so far have been seen as less efﬁcient, can scale and achieve competitive performance on this task if combined with a powerful architecture representation, whilst utilizing signiﬁcantly less computational resources.
To summarize, our main contributions are:
We introduce hierarchical representations for describing neural network architectures.
We show that competitive architectures for image classiﬁcation can be obtained even with simplistic random search, which demonstrates the importance of search space construction.
We present a scalable variant of evolutionary search which further improves the results and achieves the best published results 1 among evolutionary architecture search techniques.
A RCHITECTURE R EPRESENTATIONS
We ﬁrst describe ﬂat representations of neural architectures (Sect. 2.1), where each architecture is represented as a single directed acyclic graph of primitive operations.
Then we move on to hierarchical representations (Sect. 2.2) where smaller graph motifs are used as building blocks to form larger motifs.
Primitive operations are discussed in Sect.
2. F LAT A RCHITECTURE R EPRESENTATION
We consider a family of neural network architectures represented by a single-source, single-sink computation graph that transforms the input at the source to the output at the sink.
Each node of the graph corresponds to a feature map, and each directed edge is associated with some primitive operation (e.g. convolution, pooling, etc.)
that transforms the feature map in the input node and passes it to the output node.
Formally, an architecture is deﬁned by the representation ( G, o ) , consisting of two ingredients:
A set of available operations o = { o 1 , o 2 , . . . } .
An adjacency matrix G specifying the neural network graph of operations, where G ij = k means that the k -th operation
o k is to be placed between nodes
i and j .
The architecture is obtained by assembling operations o according to the adjacency matrix G :
[Equation]
in a way that the resulting neural network sequentially computes the feature map x i of each node i from the feature maps x j of its predecessor nodes j following the topological ordering:
[Equation]
Here, | G | is the number of nodes in a graph, and merge is an operation combining multiple feature maps into one, which in our experiments was implemented as depthwise concatenation.
An alternative option of element-wise addition is less ﬂexible as it requires the incoming feature maps to contain the same number of channels, and is strictly subsumed by concatenation if the resulting x i is immediately followed by a 1 × 1 convolution.
2. H IERARCHICAL A RCHITECTURE R EPRESENTATION
The key idea of the hierarchical architecture representation is to have several motifs at different levels of hierarchy, where lower-level motifs are used as building blocks (operations) during the construction of higher-level motifs
Consider a hierarchy of L levels where the (cid:96) -th level contains M (cid:96) motifs.
The highest-level (cid:96) =
L contains only a single motif corresponding to the full architecture, and the lowest level (cid:96) = 1 is the set of primitive operations.
We recursively deﬁne o ( (cid:96) )
m , the m -th motif in level (cid:96) , as the composition of lower-level motifs o
( (cid:96) − 1)
= (cid:8) o
( (cid:96) − 1), o ( (cid:96) − 1), ...,
[Equation]
according to its network structure G
[Equation]
A hierarchical architecture representation is therefore deﬁned by (cid:16)(cid:8) { G ( (cid:96) ) m } M (cid:96) m
=1 (cid:9) L (cid:96) =2 , o (1) (cid:17) , as it is determined by network structures of motifs at all levels and the set of bottom-level primitives.
The assembly process is illustrated in Fig.
2. P RIMITIVE O PERATIONS
We consider the following six primitives at the bottom level of the hierarchy ( (cid:96) = 1 , M (cid:96) = 6 ):
• 1 × 1 convolution of C channels • 3 × 3 depthwise convolution • 3 × 3 separable convolution of C channels • 3 × 3 max-pooling • 3 × 3 average-pooling • identity
If applicable, all primitives are of stride one and the convolved feature maps are padded to preserve their spatial resolution.
All convolutional operations are followed by batch normalization and
ReLU activation (Ioffe & Szegedy, 2015); their number of channels is ﬁxed to a constant C .
We note that convolutions with larger receptive ﬁelds and more channels can be expressed as motifs of such primitives.
Indeed, large receptive ﬁelds can be obtained by stacking 3 × 3 convolutions in a chain structure (Simonyan & Zisserman, 2014), and wider convolutions with more channels can be obtained by merging the outputs of multiple convolutions through depthwise concatenation.
We also introduce a special none op, which indicates that there is no edge between nodes i and j .
It is added to the pool of operations at each level.
E VOLUTIONARY A RCHITECTURE S EARCH
Evolutionary search over neural network architectures can be performed by treating the representations of Sect.
2 as genotypes.
We ﬁrst introduce an action space for mutating hierarchical genotypes (Sect. 3.1), as well as a diversiﬁcation-based scheme to obtain the initial population (Sect. 3.2).
We then describe tournament selection and random search in Sect.
3.3, and our distributed implementation in Sect.
M UTATION
A single mutation of a hierarchical genotype consists of the following sequence of actions:
Sample a target non-primitive level (cid:96) ≥ 2 . 2.
Sample a target motif m in the target level.
Sample a random successor node i in the target motif.
Sample a random predecessor node j in the target motif.
Replace the current operation o ( (cid:96) − 1) k between j and i with a randomly sampled operation o ( (cid:96) − 1) k (cid:48) .
In the case of ﬂat genotypes which consist of two levels (one of which is the ﬁxed level of primitives), the ﬁrst step is omitted and (cid:96) is set to 2 .
The mutation can be summarized as:
[Equation]
where (cid:96), m, i, j, k (cid:48) are randomly sampled from uniform distributions over their respective domains.
Notably, the above mutation process is powerful enough to perform various modiﬁcations on the target motif, such as:
Add a new edge : if o ( (cid:96) − 1) k
= none and o ( (cid:96) − 1) k (cid:48) (cid:54) = none .
Alter an existing edge : if o ( (cid:96) − 1)
k (cid:54) =
none and o ( (cid:96) − 1) k (cid:48) (cid:54)
=
none and o ( (cid:96) − 1) k (cid:48) (cid:54)
=
o ( (cid:96) − 1) k . 3.
Remove an existing edge : if o ( (cid:96) − 1)
k
(cid:54) =
none and if o ( (cid:96) − 1) k (cid:48)
=
none .
3. I NITIALIZATION
To initialize the population of genotypes, we use the following strategy:
Create a “trivial” genotype where each motif is set to a chain of identity mappings.
Diversify the genotype by applying a large number (e.g. 1000 ) of random mutations.
In contrast to several previous works where genotypes are initialized by trivial networks (Stanley & Miikkulainen, 2002; Real et al., 2017), the above diversiﬁcation-based scheme not only offers a while True do if HAS I DLE W ORKER () then genotype ← ASYNC T OURNAMENT S ELECT ( M ) genotype (cid:48)
← M UTATE ( genotype )
Q ← Q ∪ genotype (cid:48)
Algorithm Input: Training set validation set while True do if |Q| > 0 then genotype ← Q .pop() arch ← A SSEMBLE ( genotype ) model ← T RAIN ( arch, T ) fitness ← E VALUATE ( model, V )
M ← M ∪ ( genotype, fitness ) good initial coverage of the search space with non-trivial architectures, but also helps to avoid an additional bias introduced by handcrafted initialization routines. In fact, this strategy ensures initial architectures are reasonably well-performing even without any search, as suggested by our random sample results in Table 1.
3. S EARCH A LGORITHMS
Our evolutionary search algorithm is based on tournament selection (Goldberg & Deb, 1991).
Starting from an initial population of random genotypes, tournament selection provides a mechanism to pick promising genotypes from the population, and to place its mutated offspring back into the population.
By repeating this process, the quality of the population keeps being reﬁned over time.
We always train a model from scratch for a ﬁxed number of iterations, and we refer to the training and evaluation of a single model as an evolution step. The genotype with the highest ﬁtness (validation accuracy) among the entire population is selected as the ﬁnal output after a ﬁxed amount of time.
A tournament is formed by a random set of genotypes sampled from the current effective population, among which the individual with the highest ﬁtness value wins the tournament.
The selection pressure is controlled by the tournament size, which is set to 5% of the population size in our case.
We do not remove any genotypes from the population, allowing it to grow with time, maintaining architecture diversity.
Our evolution algorithm is similar to the binary tournament selection used in a recent large-scale evolutionary method (Real et al., 2017).
We also investigated random search, a simpler strategy which has not been sufﬁciently explored in the literature, as an alternative to evolution.
In this case, a population of genotypes is generated randomly, the ﬁtness is computed for each genotype in the same way as done in evolution, and the genotype with the highest ﬁtness is selected as the ﬁnal output.
The main advantage of this method is that it can be run in parallel over the entire population, substantially reducing the search time.
3. I MPLEMENTATION
Our distributed implementation is asynchronous, consisting of a single controller responsible for performing evolution over the genotypes, and a set of workers responsible for their evaluation.
Both parties have access to a shared tabular memory M recording the population of genotypes and their ﬁtness, as well as a data queue Q containing the genotypes with unknown ﬁtness which should be evaluated.
Speciﬁcally, the controller will perform tournament selection of a genotype from M whenever a worker becomes available, followed by the mutation of the selected genotype and its insertion into
Q for ﬁtness evaluation (Algorithm 1).
A worker will pick up an unevaluated genotype from Q whenever there is one available, assemble it into an architecture, carry out training and validation, and then record the validation accuracy (ﬁtness) in M (Algorithm 2).
Architectures are trained from scratch for a ﬁxed number of steps with random weight initialization.
We do not rely on weight inheritance as in (Real et al., 2017), though incorporating it into our system is possible.
Note that during architecture evolution no synchronization is required, and all workers are fully occupied.
E XPERIMENTS AND R ESULTS 4. E XPERIMENTAL S ETUP
In our experiments, we use the proposed search framework to learn the architecture of a convolutional cell, rather than the entire model.
The reason is that we would like to be able to quickly compute the ﬁtness of the candidate architecture and then transfer it to a larger model, which is achieved by using less cells for ﬁtness computation and more cells for full model evaluation.
A similar approach has recently been used in (Zoph et al., 2017; Zhong et al., 2017).
Architecture search is carried out entirely on the CIFAR-10 training set, which we split into two sub-sets of 40K training and 10K validation images.
Candidate models are trained on the training subset, and evaluated on the validation subset to obtain the ﬁtness.
Once the search process is over, the selected cell is plugged into a large model which is trained on the combination of training and validation sub-sets, and the accuracy is reported on the CIFAR-10 test set.
We note that the test set is never used for model selection, and it is only used for ﬁnal model evaluation.
We also evaluate the cells, learned on CIFAR-10, in a large-scale setting on the ImageNet challenge dataset (Sect. 4.3).
[Figure]
c on v 3 xc on v 3 x g l oba l poo l li nea r & s o ft m a x small CIFAR-10 model c e ll c e ll c e ll s ep . c on v 3 x 3 /s ep .
c on v 3 xs ep .
c on v 3 x 3 /s ep .
c on v 3 xs ep .
c on v 3 xs ep .
c on v 3 xi m age c on v 3 x g l oba l poo l li nea r & s o ft m a x large CIFAR-10 model
c
e ll c e ll c e ll c e ll c e ll c e ll s ep .
c on v 3 x 3 /s ep .
c on v 3 xs ep .
c on v 3 x 3 /s ep .
c on v 3 xs ep .
c on v 3 xs ep .
c on v 3 xi m age c on v 3 x 3 /c on v 3 x 3 /s ep .
c on v 3 x 3 /g l oba l poo l li nea r & s o ft m a x
ImageNet model c e ll c e ll c e ll c e ll c e ll c e ll c e ll
For CIFAR-10 experiments we use a model which consists of 3 × 3 convolution with c 0 channels, followed by 3 groups of learned convolutional cells, each group containing N cells.
After each cell (with c input channels) we insert 3 × 3 separable convolution which has stride 2 and 2 c channels if it is the last cell of the group, and stride 1 and c channels otherwise.
The purpose of these convolutions is to control the number of channels as well as reduce the spatial resolution.
The last cell is followed by global average pooling and a linear softmax layer.
For ﬁtness computation we use a smaller model with c 0 = 16 and N = 1 , shown in Fig.
2 (top-left).
It is trained using SGD with 0 .
9 momentum for 5000 steps, starting with the learning rate 0 .
1 , which is reduced by 10 x after 4000 and 4500 steps.
The batch size is 256, and the weight decay value is 3 · 10 − 4 .
We employ standard training data augmentation where a 24 × 24 crop is randomly sampled from a 32 × 32 image, followed by random horizontal ﬂipping.
The evaluation is performed on the full size 32 × 32 image.
A note on variance.
We found that the variance due to optimization was non-negligible, and we believe that reporting it is important for performing a fair comparison and assessing model capabilities.
When training CIFAR models, we have observed standard deviation of up to 0.2% using the exact same setup.
The solution we adopted was to compute the ﬁtness as the average accuracy over 4 training-evaluation runs.
For the evaluation of the learned cell architecture on CIFAR-10, we use a larger model with c 0 = 64 and N = 2 , shown in Fig.
2 (top-right).
The larger model is trained for 80 K steps, starting with a learning rate 0 .
1 , which is reduced by 10 x after 40 K, 60 K, and 70 K steps.
The rest of the training settings are the same as used for ﬁtness computation.
We report mean and standard deviation computed over 5 training-evaluation runs.
For the evaluation on the ILSVRC ImageNet challenge dataset (Russakovsky et al., 2015), we use an architecture similar to the one used for CIFAR, with the following changes.
An input 299 ×image is passed through two convolutional layers with 32 and 64 channels and stride 2 each.
It is followed by 4 groups of convolutional cells where the ﬁrst group contains a single cell (and has c 0 = 64 input channels), and the remaining three groups have N = 2 cells each (Fig. 2, bottom).
We use SGD with momentum which is run for 200 K steps, starting with a learning rate of 0 . 1 , which is reduced by 10 x after 100 K, 150 K, and 175 K steps.
The batch size is 1024 , and weight decay is 10 − 4 .
We did not use auxiliary losses, weight averaging, label smoothing or path dropout empirically found effective in (Zoph et al., 2017).
The training augmentation is the same as in (Szegedy et al., 2016), and consists in random crops, horizontal ﬂips and brightness and contrast changes.
We report the single-crop top-1 and top-5 error on the ILSVRC validation set.
4. A RCHITECTURE SEARCH ON CIFAR
[Figure]
We run the evolution on ﬂat and hierarchical genotypes for 7000 steps using 200 GPU workers.
The initial size of the randomly initialized population is 200 , which later grows as a result of tournament selection and mutation (Sect. 3).
For the hierarchical representation, we use three levels ( L = 3 ), with M 1 = 6 , M 2 = 6 , M 3 = 1 .
Each of the level-2 motifs is a graph with | G (2) | = 4 nodes, and the level-3 motif is a graph with | G (3)
| = 5 nodes.
Each level-2 motif is followed by a 1 × 1 convolution with the same number of channels as on the motif input to reduce the number of parameters.
For the ﬂat representation, we used a graph with 11 nodes to achieve a comparable number of edges.
The evolution process is visualized in Fig.
The left plot shows the ﬁtness of the genotype generated at each step of evolution: the ﬁtness grows fast initially, and plateaus over time.
The middle plot shows the best ﬁtness observed by each evolution step.
Since the ﬁrst 200 steps correspond to a random initialization and mutation starts after that, the best architecture found at step 200 corresponds to the output of random search over 200 architectures.
Fig. 3 (right) shows the number of parameters in the small network (used for ﬁtness computation), constructed using the genotype produced at each step.
Notably, ﬂat genotypes achieve higher ﬁtness, but at the cost of larger parameter count.
We thus also consider a parameter-constrained variant of the ﬂat genotype, where only the genotypes with the number of parameters under a ﬁxed threshold are permitted; the threshold is chosen so that the ﬂat genotype has a similar number of parameters to the hierarchical one.
In this setting hierarchical and ﬂat genotypes achieve similar ﬁtness.
To demonstrate that improvement in ﬁtness of the hierarchical architecture is correlated with the improvement in the accuracy of the corresponding large model trained till convergence, we plot the relative accuracy improvements in Fig. 4.
As far as the architecture search time is concerned, it takes 1 hour to compute the ﬁtness of one architecture on a single P100 GPU (which involves 4 rounds of training and evaluation).
Using 200 GPUs, it thus takes 1 hour to perform random search over 200 architectures and 1.5 days to do the evolutionary search with 7000 steps.
This is signiﬁcantly faster than 11 days using 250 GPUs reported by (Real et al., 2017) and 4 days using 450 GPUs reported by (Zoph et al., 2017). Search
[Table]
4. A RCHITECTURE E VALUATION ON CIFAR-10 AND I MAGE N ET
We now turn to the evaluation of architectures found using random and evolutionary search on
CIFAR-10 and ImageNet.
The results are presented in Table [Table]
First, we note that randomly sampled architectures already perform surprisingly well, which we attribute to the representation power of our architecture spaces.
Second, random search over 200 architectures achieves very competitive results on both CIFAR-10 and ImageNet, which is remarkable considering it took 1 hour to carry out.
This demonstrates that well-constructed architecture repre- sentations, coupled with diversiﬁed sampling and simple search form a simple but strong baseline for architecture search.
Our best results are achieved using evolution over hierarchical representations: 3 .
75% ± 0 .
12% classiﬁcation error on the CIFAR-10 test set (using c 0 = 64 channels), which is further improved to 3 .
63% ± 0 .
10% with more channels ( c 0 = 128 ).
On the ImageNet validation set, we achieve 20 .
3% top-1 classiﬁcation error and 5 . 2% top-5 error.
We put these results in the context of the state of the art in Tables 2 and 3.
We achieve the best published results on CIFARusing evolutionary architecture search, and also demonstrate competitive performance compared to the best published methods on both CIFAR-10 and ImageNet.
Our ImageNet model has 64M parameters, which is comparable to Inception-ResNet-v2 (55.8M) but larger than NASNet-A (22.6M)
[Table] [Table]
The evolved hierarchical cell is visualized in Appendix A, which shows that architecture search have discovered a number of skip connections.
For example, the cell contains a direct skip connection between input and output: nodes 1 and 5 are connected by Motif 4, which in turn contains a direct connection between input and output.
The cell also contains several internal skip connections, through Motif 5 (which again comes with an input-to-output skip connection similar to Motif 4).
C ONCLUSION
We have presented an efﬁcient evolutionary method that identiﬁes high-performing neural architectures based on a novel hierarchical representation scheme, where smaller operations are used as the building blocks to form the larger ones.
Notably, we show that strong results can be obtained even using simplistic search algorithms, such as evolution or random search, when coupled with a well-designed architecture representation.
Our best architecture yields the state-of-the-art result on CIFAR- 10 among evolutionary methods and successfully scales to ImageNet with highly competi tive performance A CKNOWLEDGEMENTS
The authors thank Jacob Menick, Pushmeet Kohli, Yujia Li, Simon Osindero and many other colleagues at DeepMind for helpful comments and discussions
A A RCHITECTURE V ISUALIZATION
Visualization of the learned cell and motifs of our best-performing hierarchical architecture.
Note that only motifs 1,3,4,5 are used to construct the cell, among which motifs 3 and 5 are dominating.
[Figure]
Motif
Motif Motif
Motif Motif Motif
Motif
[Figure] [Figure]
[Figure] [Figure]
[Figure] [Figure]