{'fraction_non_alphanumeric': 0.03876357560568087, 'fraction_numerical': 0.012698412698412698, 'mean_word_length': 5.000250626566416, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
New Directions in Distributed Deep Learning: Bringing the Network at Forefront of IoT Design

In this paper, we first highlight three major challenges to large-scale adoption of deep learning at the edge: (i) Hardware-constrained IoT devices, (ii) Data security and privacy in the IoT era, and (iii) Lack of network-aware deep learning algorithms for distributed inference across multiple IoT devices. We then provide a unified view targeting three research directions that naturally emerge from the above challenges: (1) Federated learning for training deep networks, (2) Data-independent deployment of learning algorithms, and (3) Communication-aware distributed inference. We believe that the above research directions need a network-centric approach to enable the edge intelligence and, therefore, fully exploit the true potential of IoT.


I. INTRODUCTION
An estimated one trillion Internet-of-Things (IoT) devices are expected to impact several market segments by 2035 [1]. Such a rapid growth in IoT devices necessitates new breakthroughs in Machine Learning (ML) and Artificial Intelligence (AI) in order to fully exploit the compute power offered by a trillion devices. Specifically, there are three major challenges to rapid adoption of deep learning at the edge: • Hardware-constrained IoT devices: Typically, IoT devices are memory-limited (e.g., only a few hundred KB memory is available) and run at low operating frequencies for high energy efficiency. Since challenges like hardware constraints have been surveyed in [24], our focus here is on the new research directions from a deep learning perspective. • Data security and privacy: With data at the edge becoming increasingly personal, it is now extremely important for the AI utilizing this data to operate locally on user devices. Therefore, instead of sending the private data to the cloud, new techniques are needed to enable both on-device training and inference of deep learning models without compromising data privacy.
This preprint is for personal use only. The official article will appear in proceedings of Design Automation Conference (DAC), 2020. This work was presented at the DAC 2020 special session on Edge-to-Cloud Neural Networks for Machine Learning Applications in Future IoT Systems.
• Network-aware deep learning: By very definition, IoT refers to a network of devices. Yet, most of the techniques proposed to date, especially for inference, focus on reducing the computational requirements of deep neural networks for a single device and do not take the network into account. Hence, new research that can effectively exploit the benefits of the network is crucial.
From a deep learning standpoint, model compression aims to reduce the size of deep networks in order to meet the hardware constraints of IoT devices without sacrificing accuracy [8], [10], [12]. However, in practice, additional challenges like data privacy and network considerations often severely limit the widespread deployment of deep learning on IoT devices [5]. More specifically, the above fundamental challenges manifest themselves in training and inference, which are both integral parts of any learning-based system. We next explain how these challenges are closely intertwined with the emerging directions in training and inference of deep neural networks at the edge.
Data privacy and network of devices in regards to training: To prevent sending private data to the cloud and exploit the network of devices, a new distributed training paradigm called Federated Learning (FL) [16], [17] has emerged recently. FL first trains ML models on-device using the local data. Then, the model (instead of private data) is sent to the cloud for a global update; this global model is subsequently sent back to the edge devices. There are several challenges in this problem space such as (i) statistical heterogeneity that happens when data is not independently and identically distributed (non-IID) across users, and (ii) systems heterogeneity when the devices that are training have different computational and communication capabilities. Therefore, FL aims to alleviate the data privacy issues while exploiting a vast network of devices to train the models. A good review of these problems is given in [19].
Hardware constraints and data privacy in regards to inference: It might appear that for resource-constrained inference, data privacy is not a big challenge as deep learning inference, by definition, means that we are not sending the data to the cloud. Indeed dataset or some alternate data; for many applications (e.g., image processing on medical images, speech recognition, etc.), such datasets are private. Complex deep learning models can result from training on huge private datasets. Hence, the industries deploying such models at the edge must compress them without accessing the original training dataset or any alternate dataset 1 . Ultimately, running ML applications on edge devices can be significantly accelerated using such data-independent model compression techniques [4] because the users trying to deploy a model on IoT devices will not have to rely on the private datasets of third parties.
Hardware constraints and network of devices in regards to inference: As mentioned earlier, existing model compression techniques target efficient inference on a single device and not across a network of devices [10], [12], [26]. This automatically opens up a new class of research problems -communicationaware model compression [3]. For instance, modern smart home/cities applications can have many connected IoT sensors with, say, only 500KB total memory per node. To achieve high accuracy, the compressed deep networks often grow in size. Consequently, due to strict memory constraints, such models must be distributed across multiple nodes; this generates significant communication among the devices. Hence, the massive communication cost arising from this distributed inference presents a major (and so far largely ignored) im- 1 It is possible for the industry deploying a model at the edge to collect alternate datasets for model compression. However, this may not always be possible, or can be very time consuming/expensive and, thus, infeasible. pediment that prevents the effective utilization of the compute power of a network of IoT devices. Therefore, compressing models must not only account for hardware constraints, but also for the communication costs resulting from distributed inference. In other words, since IoT consists of connected devices, this massive network must be exploited to obtain true edge intelligence [5]. Fig. 1 presents a unified view of the above challenges, as well as a few new research directions: (i) FL-based training for preserving privacy while exploiting a network of devices (see Fig. 1(a), Section II), (ii) Data-independent model compression for addressing hardware constraints without compromising data privacy (see Fig. 1(b), Section III), and (iii) Communication-aware model compression to deploy deep learning models across a network of IoT devices (see Fig. 1(c), Section IV). Note that, existing computation-aware model compression techniques like [10], [12], [26] only account for hardware constraints and do not consider the other grand challenges in IoT era (see Fig. 1(d)). In this vision paper, we summarize our latest research while highlighting the importance of the above problems. We hope that these ideas will inspire future research in the field.

II. FEDERATED LEARNING (FL)
Large amounts of data are increasingly generated on edge devices nowadays. However, since data on personal devices is highly sensitive, in order to preserve privacy, FL has become the de facto distributed training paradigm across a network of devices without sharing the data [16], [17]. A typical FL framework is shown in Fig. 2 random subset of local devices for some number of steps. Then, the model is sent to a server for a global update; in an established approach called FedAvg [17], the models from local devices are averaged at the server. Finally, this global model is sent back to the devices of individual users. We next explain a new technique called FedMAX that can be used to mitigate activation-divergence, a new phenomenon which happens due to heterogeneity in data distributions [7].

Activation-Divergence and FedMAX
Since the data across users may not be independently and identically distributed (non-IID), local training updates can take the global model in different directions. As a result, when data is non-IID, the feature activation at the final layers of a model (e.g., at the output of fully-connected or averagepool layer 2 ) can diverge across different users. Indeed, this makes the global model achieve lower accuracy. To address this activation-divergence issue, a prior based on the Principle of Maximum Entropy can be used [13]; this prior assumes minimal information about the local activations and aims to make activations for same classes similar across multiple devices. Since we exploit the Principle of Maximum Entropy, we call this approach FedMAX [7].
To demonstrate the effectiveness of FedMAX, we first show the test accuracy of both IID and non-IID scenarios on three different datasets: FEMNIST* [6], CIFAR-10 and CIFAR-100 in Fig. 2(b)(c). For each dataset, we train a CNN consisting of about 600K parameters. As evident, our approach significantly outperforms the prior FedAvg technique for all three datasets. Another important observation in Fig. 2(c) is that for all three datasets, FedMAX for 600 communication rounds achieves comparable or even better accuracy than FedAvg for 3000 communication rounds. Therefore, by relying on more localized training, FedMAX significantly reduces communication (by up to 5×) compared to prior techniques without losing accuracy.
A clear application for training on private datasets is in medical domain where the data is extremely sensitive. Hence, we also report experiments on two large medical datasets: APTOS (Retina images) [25] and Chest X-ray [14], which represent a real-life FL scenario. Since these are imbalanced datasets, we use the F1-macro score to measure the performance of the model. Also, pretrained ResNet50 [11] models are fine tuned for these datasets. As shown in Fig. 2(d), the performance of FedMAX on the Chest X-ray dataset is close to FedAvg. One possible reason is that since the Chest X-ray dataset has only two classes, it can be unsuitable for making the activations more similar among labels across different clients. However, for the APTOS dataset, FedMAX outperforms FedAvg for both IID and non-IID settings. More experiments and details on FedMAX are given in [7]. Therefore, by creating new, smarter loss functions, we can better exploit the network of devices for model training without compromising data privacy.

III. DATA-INDEPENDENT MODEL COMPRESSION
When deep learning models are trained on private datasets, the industries trying to deploy such models on edge devices cannot use the original datasets for model compression. Below, we describe our recent research targeting this problem [4], [5].

Dream Distillation
In Knowledge Distillation (KD) [12], given a pretrained teacher model, a student model is trained using either the same dataset or using some unlabeled data (see Fig. 1(d)). For instance, to conduct KD on CIFAR-10 when real data is not available, alternate datasets such as CIFAR-100 or tiny-Imagenet can be used to train a student model via KD [18]. Prior work [12], [18] shows that the resulting student shows reasonably good accuracy on the original intended task, i.e., the CIFAR-10 test set classification. For many situations, however, it may not be possible to obtain even the alternate datasets. Then, how can we compress a deep network without using the original training set or any alternate data, without losing significant accuracy? We answer this question in our recent work on Dream Distillation [4], a new technique which does not require real data for KD.
Suppose our teacher network is a large Wide Resnet (WRN40-4, 8.9M parameters), and the student model is a small Wide Resnet (WRN16-1, 100K parameters). The teacher network achieves ∼ 95% accuracy on CIFAR-10 test set. On the other hand, the student WRN16-1 model trained via Attention Transfer-based KD (ATKD) [26] with WRN40-4 teacher achieves about 91% accuracy. Most importantly, we assume that neither alternate data, nor original training set is available; rather, as explained below, only a small amount of metadata is given: 1) We use k-means algorithm to cluster the real activations at the average-pool layer of the teacher network for just 10% of the real CIFAR-10 images. These clustercentroids are used as metadata (see Fig. 3(a) for centroids of the airplane class in CIFAR-10). 2) Since the centroids represent the average activations in a cluster, they reduce the privacy-concerns as only the mean activations are used as metadata; the activations from real images are not used. Hence, this metadata does not contain identifying information about the real images. 3) Metadata also contains principal components for each cluster; this is illustrated in the Fig. 3(a) by the orthogonal principal components.
We use the teacher network and the above metadata to generate a large number of synthetic images which contain sufficient knowledge about the classes (even though they look far from real). Such images can be used to effectively distill knowledge from the teacher to the student without explicitly training the student network on any real data. Another prior work for data-independent model compression is Data-Free Knowledge Distillation (DFKD) [20] which also uses metadata. However, DFKD claims that using metadata from a single layer makes the problem under-constrained and, thus, leads to poor accuracy (e.g., DFKD achieves 68-77% accuracy on MNIST). As a result, for more complex datasets like CIFAR-10, DFKD would achieve even lower accuracy. In contrast, our goal is to specifically demonstrate that metadata from a single layer is, in fact, sufficient to train accurate student models [4].
Recently, deep learning visualization and interpretability [23] has received a lot of interest due to works like DeepDream [2]. The objective of feature visualization is to generate an image that can maximize a certain objective (e.g., generate an image that can maximally activate a given hidden unit at a certain hidden layer, i.e., a neuron or a channel). DeepDream called these generated images as the Dreams of the deep network. Since our approach exploits these "dreams" for KD, we call our approach Dream Distillation, as if we are distilling teacher's dreams! In Dream Distillation, the first step is called Dream Generation where we create custom objectives from the metadata. To this end, we add a small amount of Gaussian noise to the cluster-centroids along the principal component directions to create target activations. The resulting distributions of target activations and real activations are very similar (see Fig. 3(b)). Next, we generate 50, 000 images such that the average-pool activations of generated images layer are as close as possible to the target activations. Finally, these synthetic images are used for KD between teacher and student networks. More details on the approach are given in [4].
Some examples of synthetic images created by our Dream Generation technique are shown in Fig. 3(c). We note that for classes like {horse, truck, deer, dog}, some key features (e.g., animal faces, wheels, etc.) are clearly visible. However, for classes like {ship, airplane, bird, cat}, the images are significantly more subtle. For instance, the teacher network mostly generates a striped pattern for cats (instead of more obvious features such as cat faces, etc.). Given how different these synthetic images are from natural images, we next investigate if these images be used for distilling knowledge from teacher to the student.
To evaluate the effectiveness of Dream Distillation, we conduct KD using four datasets containing 50, 000 images: (i) Random noise images, (ii) Dream Distillation images, (iii) CIFAR-100 images as an alternate dataset, and (iv) Real CIFAR-10 dataset. We use three student models: WRN16-1 (100K parameters), WRN40-2 (2.2M parameters), and WRN40-4 (8.9M parameters). For the last case, both the teacher model and the student model are the same. Fig. 3(d) shows the test accuracy for all student models. Clearly, Dream Distillation performs comparable to the alternate dataset CIFAR-100. More specifically, using synthetic images generated by our model, WRN16-1 student achieves ∼ 79% accuracy, while using CIFAR-100 images, it achieves ∼ 81% accuracy on CIFAR-10 test set. Interestingly, our WRN40-4 student trained via Dream Distillation achieves 88.5% accuracy on CIFAR-10 test set without ever seeing any real data! Hence, the synthetic images generated via our method can transfer significant amount of relevant knowledge about the real data without requiring any real or alternate datasets. Therefore, Dream Distillation can allow industries to more rapidly compress and deploy deep learning models without access to third-party proprietary data.

IV. COMMUNICATION-AWARE MODEL COMPRESSION
In the IoT era, the network of edge devices must be exploited via distributed learning to obtain high-accuracy, lowlatency intelligence. Most of the model compression literature focuses on computational aspects such as energy, memory, and latency of inference on a single device [10], [12]. As a result of this lack of network-aware algorithms, the prior art for communication-aware deployment of deep learning models (across multiple devices) is significantly limited. For instance, a recent distributed inference method called SplitNet aims to split a deep learning model into disjoint subsets without considering the strict memory-and FLOP-budgets for IoT devices [15]. Consequently, the disjoint models obtained by SplitNet may not satisfy the strict memory constraints of edge devices. Similarly, MoDNN [21] aims to reduce the number of FLOPS during distributed inference. However, MoDNN assumes that the entire model can fit on each device, and does not consider any model compression.
The assumption that the entire model can fit on each IoTdevice is optimistic because many IoT devices are significantly memory-constrained. In fact, in such memory-constrained scenarios, the model itself must be distributed across multiple devices which can lead to heavy inter-device communication at each layer of the deep network. Therefore, a new paradigm is needed to not only reduce memory and computation of deep networks, but also to minimize communication for efficient distributed inference. In other words, the network of IoT devices must be exploited to improve the accuracy without increasing the communication latency. Towards this communication-aware model compression, we present our recent idea on Network-of-Neural Networks (NoNN) [3], [5].

Network-of-Neural Networks (NoNN)
NoNN refers to a new distributed inference paradigm which enables new memory-and communication-aware student architectures obtained from a single large teacher model. Specifically, a NoNN consists of a collection of multiple, disjoint student modules which focus only on a part of teacher's knowledge. Individual students are deployed on separate edge devices to collaboratively perform the distributed inference.
Key differences between traditional KD and NoNN are shown in Fig. 4. As evident, NoNN relies on concepts from network science [22] to partition teacher's final convolution layer. Specifically, features for various classes are learned at different filters in CNNs. These activation patterns reveal how teacher's knowledge gets distributed at the final convolution layer. Therefore, such activation patterns can be used to create a filter activation network [3] that represents how the teacher's knowledge about various classes is organized into filters (see Fig. 4(b)). We then partition this network via community detection [22] (more details are given in [3]); these disjoint partitions of teacher's knowledge are used to train individual student modules.
Since we train completely separate students to mimic parts of teacher's knowledge, our NoNN results in a highly parallel student architecture as shown in Fig. 4(b). Moreover, we can   select significantly smaller individual student modules (subject to some memory/FLOP budgets). Consequently, the NoNN incurs significantly lower memory, computations, and communication. In other words, our individual student modules adhere to the memory-and FLOP-constraints of IoT devices, and do not communicate until the final fully connected layer.
To better illustrate these ideas, we now discuss a proofof-concept for NoNN using the CIFAR-10 dataset. Assuming each IoT-device has a memory budget of 500KB, each student module in NoNN must have less than 500K parameters 3 . Again, we choose our teacher model as Wide Resnet WRN40-4 (8.9M parameters), and the NoNN consists of two student modules, each based on a Wide Resnet structure (denoted as NoNN-2S) [3]. Our NoNN-2S model has ∼ 860K total parameters, where each student module has ∼ 430K parameters. We further use TVM 4 to deploy all models on Raspberry-Pi (RPi) devices in order to demonstrate the effectiveness of NoNN for distributed inference. We connect RPi's via a point-to-point wired connection to represent a network of edge devices.
The results for the teacher model deployed on one RPi and our NoNN-2S model deployed on two RPi's are shown in Table I (top). The NoNN-2S model clearly outperforms the teacher network by a very large margin (13× to 20× improvement) in memory, FLOPS, and energy with only 1% loss of accuracy. Overall, our experiments show great agreement between theory and practice. Specifically, while the theoretical improvement (per student) in FLOPS is about 15×, we achieved 14× better energy consumption in practice. We thoroughly demonstrate the effectiveness of NoNN on five well-known image classification tasks and also show results for a higher number of students in [3]. A hardware prototype of NoNN is further presented in [9].
Finally, we note that a horizontally-split deep network will lead to heavy communication cost. To demonstrate this, we train and deploy a NoNN-8S model across a network of eight RPi's. We then distribute an ATKD-based compressed model (WRN40-2, 2.2M parameters, 95.03% accuracy) [26] on four and eight RPi's for comparison 5 . Table I (bottom) summarizes the results of distributed inference using NoNN-8S and split-ATKD. As evident, while achieving a similar accuracy of 95.02%, NoNN-8S is 27-33× faster than the split-ATKD models, even though FLOPS per device for split-ATKD are significantly lower. Therefore, when the compressed models cannot fit within the memory budget of IoT devices, communication can indeed significantly degrade the inference latency. This clearly underscores the importance and superiority of our communication-aware model compression.

V. CONCLUSION
In this paper, we have highlighted three major challenges to large-scale adoption of deep learning at the edge: (i) Hardware constraints of IoT devices, (ii) Data privacy in the IoT era, and (iii) The lack of network-aware deep learning algorithms as most inference techniques focus on single devices. Since these challenges are closely intertwined with deep learning training and inference, we have then provided a unified view of emerging research directions occurring at their intersection. Specifically, we have discussed: (1) FL for training deep networks, (2) Data-independent deployment of learning, and (3) Communication-aware distributed inference. Ultimately, our vision aims to bring the network at the forefront of IoT in order to truly enable intelligence at the edge.