Internal:TAPAS
Architecture search of a network that meets the expectations of a user is an expensive empirical process. Users usually start with a network that has worked well for them in the past or some state of the art network, train it for the required amount of time which could be a few hours, days or even weeks, and then check the accuracy that they have achieved. If it is sufficient they keep the network and move on with their experiments, otherwise, they will need to go back to configure its hyper-parameters which might include the network architecture itself, for each dataset that they encounter. A process that is clearly not scalable for a big number of datasets.
As a consequence, the concept of performance prediction for architecture search has emerged, to reduce the networks’ exploration cost by predicting their accuracy without having to train them.Current approaches to infer about the accuracy of a network is either by using partial learning curves,which requires partial training of each network, or by maintaining a database of previously trained experiments for the specific dataset to use as the ground-truth. Both approaches require a lot of time spent in pre-processing (partially training, or building the experiments database for each specific dataset) before one can have reliable accuracy predictions.
The Train-less Accuracy Predictor for Architecture Search (TAPAS) is an architecture search tool that can reliably predict the accuracy of a network on previously unseen datasets, allowing for out of the box real-time network explorations. It does so by incorporating the dataset’s difficulty in the predictions and maintaining history about previously performed experiments.
To Do
| Month | Deliverables |
|---|---|
| 1st | Literature Review & Initial Design |
| 2nd | Develop Data Characterization component & investigate suitable Probe Network for CNF data |
| 3rd | Develop portable and efficient lifelong database of experiments & integrate with MetaQNN for its initialization |
| 4th | Develop incremental training that can utilize multiple GPUs |
| Progress Report | |
| 5th | Design and implement the Trainless Accuracy Predictor (TAP) & encoded architecture representations it is trained on |
| 6th | Integrate with algorithm to automate the generation of new Neural Network Architectures |
| 7th | Train & Validate on well-known image datasets |
| 8th | Fine-Tune hyperparameters to improve prediction accuracy |
| Start preparing a paper that presents the findings of this effort | |
| Progress Report | |
| 9th | Train & Validate on CNF datasets from different halls |
| 10th | Optimize framework for the CNF datasets |
| 11th | Refactor interface for ease-of-use, provide detailed documentation & pack it in docker container for portability |
| 12th | Deploy framework & fix any issues that might arise from running on the destination hardware |
| Submit the paper | |
| Final Report |
Methodology

This section includes a detailed overview of the main building blocks of the TAPAS framework. TAPAS’ goal is to estimate the accuracy of a CNN architecture at low cost without training the actual architecture. This can be accomplished by characterizing the user-provided dataset as well as preserving knowledge from previous experiments into a database of experiments. The main components of TAPAS framework, which are depicted in Figure 1, are (i) Dataset characterization(DC), (ii) Lifelong database of experiments (LDE) and (iii) Train-less accuracy predictor (TAP).
Dataset Characterization
It is a well-known fact that the same CNN can yield different results depending on the dataset it is trained on, for instance, MNIST[2] and CIFAR-100[3] which are easy and hard respectively.Therefore, it is important to analyse the difficulty of a dataset. Each dataset is assigned a Data Characterization Number (DCN), which is an estimation of the dataset’s difficulty. The DCN is the accuracy obtained by training a Probe Network, for just 10 epochs, using the respective dataset. The calculation cost of DCN is low because: (i) Probe Networks and modest-sized networks, (ii) it is performed only once at the entry of the dataset, (iii) few epochs of training are sufficient, since DCN is a rough estimation of the dataset’s difficulty and thus tolerant to approximations.
Lifelong database of experiments
LDE is a continuously growing database that stores every new experiment that takes place within the TAPAS framework. Each experiment includes: (i) the CNN architecture description, (ii) the Dataset’sDCN and (iii) the achieved accuracy.
Since the LDE is empty at the very beginning, we need to initialize it. This is achieved by training architectures, which are produced by the MetaQNN Framework[4], layer-by-layer using an incremental method described in [5], The usage of MetaQNN and the incremental method will be presented briefly in the Implementation Section.
Once the LDE is initialized, DCN can the be used to filter the datasets that will be used in the next step of TAPAS using the following relation:
||DCN(ˆD)−DCN(Dj))|| ≤ τ ,j∈[1,Nd] ,
where Dj are the different datasets, with j = 1,...,Nd, ˆDis the input dataset and τ is a predefined threshold.
Train-less accuracy predictor
TAP is designed to perform fast and reliable CNN accuracy predictions. Instead of analysing the whole CNN, TAP predicts the accuracy of a sub-network L1:i+1 assuming that the accuracy of the sub-network L1:i is known. The main components of TAP are: (i) A compact encoding vector that represents the main network characteristics, (ii) A quickly trainable network of LSTMs and (iii) a layer-by-layer prediction mechanism.
Neural network architecture encoding
To implement this layer-by-layer prediction mechanism, we need a layer-by-layer encoding vector as shown in Figure 2. Assuming that we have a network with 1≤a < b <≤ Nl. The encoding vector includes two types of information as depicted in Figure 2:
- For the i-th layer, we store information about: (i) the Layer type which is one-hot encoding that identifies either convolution, pooling, batch normalization, dropout, or fully-connected,(ii) the ratio between the output height and input height of each layer which accounts for different strides or paddings, (iii) the ratio between the output depth and input depth which accounts for modifications of the number of kernels and (iv) the number of weights which specifies the total of learnable parameters in Li.
- For L1:i sub-network, we store information about: (i) the total number of layers, counting from input to Li, (ii)Inference FLOPs and (iii)Inference memory which are an accurate estimations of the computational cost and memory requirements of the sub-network, and(iv) the Accuracy which is set either to 1/Nc for the first layer where Nci s the number of classes of the dataset, or zero for prediction purposes or a specific value Ai∈[0,1] that is extracted from the previous layer prediction. For each feature on the encoding vector we perform standardization of its data.

Implementation
We have implemented TAPAS in Python 3.7, using Keras[6] and Tensorflow [7] as the Deep Learning frameworks. MetaQNN uses Caffe[8] as its underlying deep learning framework, so we had to convert the networks it produces to Keras using the MMdnn[9] tool.
Dataset Characterization

The Dataset Characterization (DC) component consists of a probe network[10] (as Keras model)good enough to give an estimation about the difficulty of a dataset and simple enough to train fast.The default network that was used is depicted in fig. 3, however, the user can choose to replace that with any desired network by providing a Keras model using the respective API.
Once the network is defined as the user needs to specify the number of classes for the specific dataset,and provide two numpy arrays containing the dataset features and labels so that the DCN can be computed. TAPAS will split the provided dataset into training and validation set and compute the DCN based on the validation accuracy. It will also transform the labels into a one-hot encoded format if they are not already. Optionally, the user can also provide explicitly a validation set. Once the DCN is calculated it is kept as the DCN of the current session unless a new dataset is provided.
Lifelong database of experiments
The Lifelong database of experiments (LDE) is a class that holds all the experiments that have been performed in the past in a python list.
An experiment is implemented as another class that holds information like the network architecture–in the encoded vector format–, the DCN of the dataset used, the accuracy that was achieved, as well as the hyper-parameters that were employed. An experiment also provides an interface to return its architecture layers concatenated in order to make it easier for the later steps of training and predicting.The LDE provides an interface that allows the addition and deletion of experiments, sorting of the experiments by DCN or achieved accuracy, storing and loading the experiments to/from the disk (using python’s function pickle) and retrieving a specific experiment or all experiments with a DCN in the range defined in the methodology section. It can also optionally return the retrieved experiments in the concatenated format required for training the TAP as described below.
As part of the initialization step, we utilize the MetaQNN software and implement the incremental training technique from [5]. MetaQNN is a software that uses reinforcement learning to produce good neural networks for a given dataset. It incorporates the logic needed to create transitions between layers that make sense not just some random combination of layers. It implements convolution,pooling, batch normalization, dropout and fully connected layers. For each dataset, MetaQNN ran for about a day and a half using 28 GPUs and produced approximately 20.000 neural network models(per dataset). However, only about 20% of them are different providing with≈4000 networks per dataset.

Once we have those networks produced by MetaQNN we use Mmdnn to create Keras models and pass them to TAPAS to perform incremental training. The incremental training interface accepts a list of Keras models, a training, and an (optional)validation set. The first step is to calculate the DCN for the given dataset (if it hasn’t been done before) using the specified probe net. Then the models are partitioned by iterating the Keras model using its .layers variable and creating one partition each time one of the five expected layer types is found. As a classifier, we consider only the final fully connected layer that has softmax as its activation function and always employ flattening before running the attaching the classifier and training it until its accuracy does not increase beyond a threshold. When we reach this point, the weights of the partitions added up to this point are frozen (by setting the attribute .trainable of the Keras model layers to false) and the next partition is added to the network and trained for just afew epochs to initialize its weights. Once this is done, we unfreeze all the weights and train the partitions added so far until there is no significant improvement in terms of accuracy. The whole process continues until all partitions have been trained in this way. The process is demonstrated in fig. 4. Once the incremental training method completes, all models are encoded into layer encoding vectors and one experiment is created and stored in the LDE for each network along with the other required information. In order to train all the produced networks, incremental training took about half a day per dataset using 50 GPUs in the Wahab cluster.
Train-less Accuracy Predictor

The Train-less Accuracy Predictor (TAP) is a Recurrent Neural Network that consists of two layers of LSTMs of 50 and 100 neurons respectively and a Fully-Connected layer with a single out put and sigmoid activation. It accepts two inputs, the first is a concatenation of the encoded vectors produced from consecutive pairs of the layers of the network that goes to the first LSTM. The second input is the DCN which is concatenated with the output of the second LSTM and then fed into the fully-connected layer. We implemented it using Keras’ functional API as opposed to sequential as it is the only way to have more than one inputs in Keras. Figure 5 displays the prediction and training process described in the following paragraphs.
The TAP is trained by retrieving the already trained suitable experiments from the LDE in concatenated form, having the accuracy of the first encoded vector as known and trying to predict the accuracy of the second one. We implement the input as two-time sequences (1 per encoded vector) of 12 features each (as shown in fig.2 with the layer type on hot encoded). We use RMSprop, with a learning rate of 10e−3, HeNormal weight initialization, mean absolute error, a batch size of 512 and train for 50 epochs as it is a very fast process. We always perform feature-wise standardization to avoid the domination of high values during training and keep the produced scaler to apply it to the prediction datasets before trying to perform any predictions. Once the TAP is trained it can be stored to disk for later use on datasets with DCNs similar to the one the TAP was trained on. As a result,the user has to choose at the initialization of TAPAS whether to build a TAP from scratch or load an existing one.
To perform a prediction for a network the TAP has to predict the accuracy for each layer of the network. Again the concatenated form of the layers of a network is used, using the prediction made for layer i to predict the accuracy of layer i+1. The accuracy of the first layer of the network is setto1N, where N is the number of classes as a random guess accuracy. Once a TAP has been trained the user can call the predict method from the TAPAS class to perform predictions. The method accepts a list of neural networks as Keras model objects, the number of classes, the dataset’s DCN (which can be calculated using the respective method from TAPAS class) and the threshold to be used in the LDE filtering process. This method will convert the neural networks into their encoded vector forms, concatenate their layers in pairs, perform feature-wise standardization using the scaler produced before training, apply the predictions layer by layer and return a numpy array with the overall accuracy of each network. All of those experiments with their predicted accuracies, their DCNs and hyper-parameters are also stored in the LDE before the results are reported.
Experiments
Datasets

To initialize the LDE, we first need to pick a set of datasets with well-distributed DCNs (difficulties)to prepare a more suitable training set for the TAP. The datasets used for this case are shown in fig. 6 ranked by their DCN. The paper contained more datasets, however, most of them were produced by sub-sampling the ImageNet dataset without reporting how the sub-sampling was performed. Before we train any networks to initialize the LDE using these datasets all the images are resized to 32x32pixels (using bilinear interpolation) which allows us to test and compare them in an all to all fashion.
Performance Evaluation
We evaluate the performance of TAPAS in three scenarios as reported in the paper:
- prediction based on experiments on a single dataset
- predictions based on experiments on all datasets
- prediction based on experiments on unseen datasets
For the sake of space, we only report the results for the CIFAR-10 dataset. If interested one can see the results for other datasets by accessing the webpage https://www.cs.odu.edu/~pthomadakis/cs822/results.html. To perform our experiments we created 2 extra versions of the LDE for each dataset on top of the LDE that contains all the experiments, specifically:
1. An LDE that contains a single dataset for scenario 1
2. An LDE that contains all datasets but one to simulate unseen datasets for scenario 3
In the first scenario, we use an LDE that only holds networks trained on a single dataset. Then we train the TAP using the LDE with or without filtering, the results of this experiment are shown in the first row of fig. 6. We can see that there is no significant difference between the two cases, this happens because the TAP prediction performance is not strongly affected as the training and prediction only involve one dataset.
In the second scenario, the LDE consists of all the datasets presented above. Again, we train the TAP using the LDE with or without DCN-based filtering and report the results in the second row of fig.6. In this case, the effect of LDE filtering is more clear as it can be noticed that when the filtering is applied, the predictions follow the same pattern as the predictions in the first scenario. On the other hand, the case where we do not employ filtering is way different.
In the last scenario, we examine the performance of TAPAS on unseen datasets by performing eight leave one out cross-validation benchmarks. In other words, we include the networks trained for all datasets except the one for which we perform predictions. The third row of fig.6 shows the performance of TAPAS for this scenario. For the left-most figure, the DCN of the unseen dataset is not taken into account either as an input to the TAP or as a way to perform LDE filtering. We can see some improvement in the next plot where DCN is used as input to the TAP reducing how spread the predictions are. However, when the LDE filtering is performed we get an unexpected behavior shown in the right-most plot of this row, probably because the DCN-based filtering ended up removing most of the networks and only keeping those that performed quite well.
The results reported in the paper are provided in fig. 7 to allow easy comparison between our results and the expected results

References
- ↑ Roxana Istrate, Florian Scheidegger, Giovanni Mariani, Dimitrios S. Nikolopoulos, ConstantineBekas, and Adelmo Cristiano Innocenza Malossi. Tapas: Train-less accuracy predictor forarchitecture search. InAAAI, 2018.
- ↑ Yann LeCun and Corinna Cortes. MNIST handwritten digit database. 2010
- ↑ Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, 2009
- ↑ Bowen Baker, Otkrist Gupta, Nikhil Naik, and Ramesh Raskar. Designing neural networkarchitectures using reinforcement learning.ICLR 2016, 11 2016
- ↑ 5.0 5.1 Roxana Istrate, A. Cristiano I. Malossi, Costas Bekas, and Dimitrios Nikolopoulos. Incrementaltraining of deep convolutional neural networks. InAutoML@PKDD/ECML 2017, 09 2017
- ↑ François Chollet. keras.https://github.com/fchollet/keras, 2015
- ↑ Martín Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro,Greg S. Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian Goodfellow,Andrew Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal Jozefowicz, Lukasz Kaiser,Manjunath Kudlur, Josh Levenberg, Dan Mané, Rajat Monga, Sherry Moore, Derek Murray,Chris Olah, Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, PaulTucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda Viégas, Oriol Vinyals, Pete Warden,Martin Wattenberg, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. TensorFlow: Large-scalemachine learning on heterogeneous systems, 2015. Software available from tensorflow.org.
- ↑ Yangqing Jia, Evan Shelhamer, Jeff Donahue, Sergey Karayev, Jonathan Long, Ross Girshick,Sergio Guadarrama, and Trevor Darrell. Caffe: Convolutional architecture for fast featureembedding.arXiv preprint arXiv:1408.5093, 2014
- ↑ Microsoft. Mmdnn.https://github.com/microsoft/MMdnn, 2019
- ↑ Florian Scheidegger, Roxana Istrate, Giovanni Mariani, Luca Benini, Constantine Bekas, andAdelmo Cristiano Innocenza Malossi. Efficient image dataset classification difficulty estimation for predicting deep-learning accuracy.ArXiv, abs/1803.09588, 2018