<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[ChainIntel - Medium]]></title>
        <description><![CDATA[Towards a distributed and decentralized Artificial Intelligence - Medium]]></description>
        <link>https://medium.com/chainintel?source=rss----c765ef1cd24b---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>ChainIntel - Medium</title>
            <link>https://medium.com/chainintel?source=rss----c765ef1cd24b---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 08:57:25 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/chainintel" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Fast Inference on IDN with Multiple Size Models]]></title>
            <link>https://medium.com/chainintel/fast-inference-on-idn-with-multiple-size-models-8a895965f92d?source=rss----c765ef1cd24b---4</link>
            <guid isPermaLink="false">https://medium.com/p/8a895965f92d</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[idn]]></category>
            <dc:creator><![CDATA[Surat Teerapittayanon]]></dc:creator>
            <pubDate>Wed, 14 Nov 2018 15:01:01 GMT</pubDate>
            <atom:updated>2018-11-14T15:01:01.353Z</atom:updated>
            <content:encoded><![CDATA[<p>We have seen in <a href="https://blog.chainintel.com/fast-inference-for-deep-learning-models-f29a1ade2e03">Fast Inference for Deep Learning Models</a> that we can augment branches on the model to allow samples to exit early. In this article, we will discuss another way to enable fast inference with your DNN model in a distributed p2p network setting of IDN.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BfRpB8rDeGSGsFgu" /><figcaption>“plasma ball digital wallpaper” by <a href="https://unsplash.com/@joshriemer?utm_source=medium&amp;utm_medium=referral">Josh Riemer</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In a distributed p2p network setting, a computation can be done on different peers at the same time in parallel. How can we make use of this benefit of the distributed p2p network setting for fast inference? One may try to divide up the model in various ways to try to reduce the computation of each piece. Depending on how one divides up the model, the amount of communication between different piece will vary.</p><p>In this article, we are exploring a different way. Instead of dividing up the model, we make a copy of it and let each peer run them at the same time. Just making a copy of the model will not help with our cause to lower inference time as each model will still do the same amount of computation as the original model.</p><p>In order to help with fast inference, we need to make some of the copies execute faster than the others so that we can get the result of the faster model and exit the inference early, lowering the overall inference time.</p><p>In order to do that, we create an overlay model where a Bernoulli random variable (which takes the value 1 with probability p and the value 0 with probability 1- p) is associated with each neuron and filter of the original model.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1123a5574f093159f2202a5abde4ff28/href">https://medium.com/media/1123a5574f093159f2202a5abde4ff28/href</a></iframe><p>To generate a smaller model, we just specify the parameter p. Those random variables for each neuron or filter are then drawn with the specified parameter p. The smaller p means that less random variables get a value of 1 and the resulting model has a smaller size. The larger p means that more random variables get a value of 1 and the resulting model will have a larger size.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/0*fOmkgALtPsqo0Gd9" /></figure><p>The figure shows the result of 4 different size models generated from the original AlexNet-style model with p=0.2, 0.4, 0.8 and 1.0.</p><p>Here is the characteristics of these generated models:<br>- AlexNet(p=1.0) (132 MFLOPs, 3.7M params, 15MB)<br>- AlexNet(p=0.8) (86 MFLOPs, 2.4M params, 9.6MB)<br>- AlexNet(p=0.4) (24 MFLOPs, 0.7M params, 2.8MB)<br>- AlexNet(p=0.2) (5 MFLOPs, 0.2M params, 0.8MB)</p><p>Notice that AlexNet(p=1.0) is the original model as p=1.0 will retain all neurons and filters of the original model.</p><p>These models are then jointly trained on FashionMNIST dataset. We then use those models to run inference on 10,000 test samples of FashionMNIST. For each test sample, all 4 models execute the inference in parallel. Confidence level is evaluated as the result from each model becomes available and if the confidence level is above a certain threshold for that sample, it is exited. The optimization scheme as presented in <em>Finding the Thresholds for BranchyNet Early Exits</em> is used to find a threshold for each model’s result. The star in red is the accuracy and average inference time per sample in microseconds using the found thresholds of 0.85, 0.79 and 0.72 for AlexNet(p=0.2), AlexNet(p=0.4) and AlexNet(p=0.8), respectively. Comparing this to the original AlexNet model, we achieve about 7x speed up in average inference time.</p><p>We will be releasing the pytorch library to generate and train different size models from your original model. Please stay tuned! As always, please let us know what you think! Thank you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8a895965f92d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/chainintel/fast-inference-on-idn-with-multiple-size-models-8a895965f92d">Fast Inference on IDN with Multiple Size Models</a> was originally published in <a href="https://medium.com/chainintel">ChainIntel</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Finding the Thresholds for Fast Inference]]></title>
            <link>https://medium.com/chainintel/finding-the-thresholds-for-fast-inference-ff96797fda7?source=rss----c765ef1cd24b---4</link>
            <guid isPermaLink="false">https://medium.com/p/ff96797fda7</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Surat Teerapittayanon]]></dc:creator>
            <pubDate>Mon, 12 Nov 2018 15:01:02 GMT</pubDate>
            <atom:updated>2018-11-12T15:01:02.151Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1JYsGuCpWjceYCcO" /><figcaption>“closeup photo of gray tree branch with leaves and snow” by <a href="https://unsplash.com/@alisaanton?utm_source=medium&amp;utm_medium=referral">Alisa Anton</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Finding the Thresholds for BranchyNet Early Exits</h3><p>Previously, we discussed augmenting deep neural network models for fast inference with branches in <a href="https://blog.chainintel.com/fast-inference-for-deep-learning-models-f29a1ade2e03">Fast Inference for Deep Learning Models</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1019/0*xMOn6IeDdFIT88Rv" /></figure><p>To recap, one can add exit branches to existing models to exit the inference execution early, resulting in fast inference. In the figure shown, the main branch is the original model and the early exit branch is the additional augmented layer to the original model.</p><p>To do fast inference with this augmented model, we pass a sample through to Exit 1 and get a confidence value. To decide whether a sample should exit at a branch, we look at the confidence of the softmax output of that branch, i.e.,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/322/0*hbVlrD2Ox_XJSnBx.png" /></figure><p>If the confidence value is high enough according to a set threshold, we exit the sample, otherwise the sample continues up to the main branch exit and the final result is the average of the outputs from both exits.</p><p>If the confidence is higher than a threshold T, we exit the inference. The issue remaining is how to pick this threshold or a set of thresholds when there are multiple augmented branches. In this article, we will discuss a method to find such threshold or set of thresholds.</p><p>The goal for us is to minimize the inaccuracy of an exit branch while maintaining the overall accuracy of the augmented model.</p><p>Let E be the number of exits at a branch and O of which is predicted incorrectly by that branch. Given a set of N test samples and I of which is predicted incorrectly by the augmented model, we then want to minimize</p><p>(O / E) + (I / N) * (1 - E / N)</p><p>We want to exit samples as early as we can in order to achieve fast inference, so we start the optimization with the earlier branches first, find the threshold for that branch, freeze it and then optimize the later branches.</p><p>With this, we have the following result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/581/0*OLOGL444OHrb1I2D" /></figure><p>The figure above shows the result of this optimization on <a href="https://en.wikipedia.org/wiki/AlexNet">AlexNet</a>-style CNN model with 8 layers 2 augmented branches on <a href="https://github.com/zalandoresearch/fashion-mnist">FashionMNIST</a> dataset. The blue brute-force curve is obtained by trying many different set of thresholds. The red star is our resulting set of thresholds of 0.98 for the first branch and 0.96 for the second branch. The purple Original dot is the original model before branch augmentation. With branch augmentation and a way of finding exit thresholds, we can cut the average inference time in half.</p><p>We will be releasing a Pytorch library for everyone to augment your model and optimize for the suitable set of thresholds soon. Please stay tuned and let us know what you think or if you have ideas to share. Thank you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff96797fda7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/chainintel/finding-the-thresholds-for-fast-inference-ff96797fda7">Finding the Thresholds for Fast Inference</a> was originally published in <a href="https://medium.com/chainintel">ChainIntel</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[IDN: Intelligence Delivery Network]]></title>
            <link>https://medium.com/chainintel/idn-intelligence-delivery-network-491986a34362?source=rss----c765ef1cd24b---4</link>
            <guid isPermaLink="false">https://medium.com/p/491986a34362</guid>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Surat Teerapittayanon]]></dc:creator>
            <pubDate>Fri, 09 Nov 2018 05:47:31 GMT</pubDate>
            <atom:updated>2018-11-09T05:47:30.844Z</atom:updated>
            <content:encoded><![CDATA[<p>Moving the execution of deep neural networks (DNNs) closer to end devices, enabling <strong>fast</strong>, <strong>robust</strong> and <strong>scalable </strong>DNN inference.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GcCFBBzVuG06qXJr" /><figcaption>“photo of outer space” by <a href="https://unsplash.com/@nasa?utm_source=medium&amp;utm_medium=referral">NASA</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>The applications of deep neural networks (DNN) have experienced unprecedented growth in recent years. But there is a problem: the inference computations of large DNN models are too intensive to run on a single end device. To solve this problem, this article introduces a novel platform called Intelligence Distribution Network (IDN) that is specifically designed to make DNN inference <strong>fast</strong>, <strong>robust</strong> and <strong>scalable</strong>. With IDN, it is possible to spread the inference computation over a distributed computing hierarchy of multiple devices, edges, and the cloud, allowing the application to support larger models and improve fault tolerance.</p><blockquote>Web developers can integrate intelligence into their web applications with ease and without being limited by compute resources.</blockquote><figure><a href="https://en.wikipedia.org/wiki/Peer-to-peer"><img alt="" src="https://cdn-images-1.medium.com/max/887/1*rSDnpTZJWbbO2CBs8j6ceg.png" /></a><figcaption>Image from <a href="https://en.wikipedia.org/wiki/Peer-to-peer">https://en.wikipedia.org/wiki/Peer-to-peer</a></figcaption></figure><p>At its core, IDN is a distributed peer-to-peer network of computing devices that moves the execution of deep neural network inference closer to the end devices. By leveraging and combining the capabilities of spare computing resources of nearby devices, edges, and the cloud, IDN provides high-performance low-latency inference to meet the growing demand from Artificial Intelligence (AI) applications.</p><p>IDN’s peer-to-peer network transparently distributes and routes the model execution from the target inference application to nearby participating nodes, which in turn cooperate to distribute the load in order to render a response quickly and efficiently. By shifting the execution of deep learning inference from the cloud to the edge and end devices, everyone with spare computing resources can become a node in the IDN network and therefore, a participant in the our society’s transition towards Artificial Intelligence (AI) by hosting DNN models and performing inference computation. By moving intelligence algorithms closer to the end user and making it more accessible, IDN lives up to its name as an Intelligence Distribution Network.</p><blockquote>Website visitors can participate and share compute resources for DNN inference.</blockquote><p>Here is how IDN achieves its core benefits: making inference 1) fast, 2) robust, and 3) scalable.</p><p>IDN enables <strong>fast inference </strong>by moving the execution closer to the end devices running the AI applications. Beyond this gain from latency reduction, IDN can further speedup inference by augmenting the target model with branches via BranchyNet. BranchyNet augments DNN models with branches at various points in the network to enable fast inference by terminating the execution early when enough confidence is accumulated, therefore making additional computation unnecessary (see <a href="https://blog.chainintel.com/fast-inference-for-deep-learning-models-f29a1ade2e03">Fast Inference for Deep Learning Models</a> for more details).</p><p>IDN enables <strong>robust inference</strong> by sending inference requests to multiple peers simultaneously in parallel. Further, when a peer is known to be inactive, the inference request can be rerouted to another available peer automatically. Because of this built-in redundancy, if any request or response is lost or corrupted, the inference result can still be obtained from other nodes. This enables robust and reliable inference for your applications.</p><p>IDN enables <strong>scalable inference </strong>by<strong> </strong>being able to<strong> </strong>send inference requests from the end device to unlimited number of nearby peers. Any available peer near your end device can be a host for your application’s inference computations. By not having every inference request hitting your server, IDN enables improved scalability for your applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I5ssGyXQs1KZ9VDPEc51GA.png" /></figure><p><strong>Inference on IDN<br></strong>1) Computation is distributed across multiple devices over peer <strong>devices</strong>, <strong>edges</strong> and the <strong>cloud<br></strong>2) Peers can execute computation in <strong>parallel<br></strong>3) There are <strong>multiple </strong>output<strong> </strong>(<strong>exit</strong>)<strong> </strong>points<br>4) Each output returns a <strong>confidence value<br></strong>5) Each output can be <strong>progressively enhanced</strong> by combining it with previous output<br>6) The inference can <strong>terminate early</strong> if the output has high enough confidence</p><p>Below is an example of how you can use IDN to move the execution of your DNN models closer to end devices to realize these important gains.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3cf283fe7dc1a825243cf7ec5f92caaf/href">https://medium.com/media/3cf283fe7dc1a825243cf7ec5f92caaf/href</a></iframe><p>Consider a scenario in which you define 1) a model descriptor describing the identity of the model, 2) the path where the model can be accessed, and 3) the type of the model. Here, we use <a href="https://ipfs.io/">ipfs</a> to host our model, the type of the model is exported from <a href="https://pytorch.org/">torch</a>, and we specify that the model should be run using NVIDIA CUDA GPU. In addition to torchjs/cuda model type, other model types can be used as well, including <a href="https://github.com/mil-tokyo/webdnn">WebDNN</a>, which allows nodes to execute the inference computation entirely on the browsers.</p><p>With IDN, everyone will be able to tap into the power of Artificial Intelligence via their browsers. Web developers can integrate intelligence into their web applications with ease without being limited by compute resources. Website visitors can participate and share compute resources for DNN inference.</p><p>Once the model is defined, IDN sends initModel requests to peers, which triggers them to download the model and prepare it for inference requests. After the model is initialized, we can now send inference requests to the peers and wait for the response event to come back. The response event consists of outputs, the confidences for those outputs, and a finish callback function to terminate the ongoing computation early.</p><p>Below is an example of videos processed on IDN with the ResNet18 model. The video is a 224-by-224 4s-long 30fps video passed through ResNet18 model before each frame was rendered and displayed.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FkmkBiFK7JCo%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DkmkBiFK7JCo&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FkmkBiFK7JCo%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/21753cee9af67a7dfc651e633c8ae8e3/href">https://medium.com/media/21753cee9af67a7dfc651e633c8ae8e3/href</a></iframe><p>As the example video demonstrates, we see initial promising results of inference execution using IDN. With 3 nearby peers, we see a comparable result of executing the inference locally.</p><p>This post is edited by our editor in chief Marcus Comiter.</p><p>If you have comments or ideas, please let us know below. Please tell us how this could be useful in your project or how you could use it. We are writing more content on IDN and will be releasing an IDN library for everyone to experiment with in the near future. Please stay tuned. Thank you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=491986a34362" width="1" height="1" alt=""><hr><p><a href="https://medium.com/chainintel/idn-intelligence-delivery-network-491986a34362">IDN: Intelligence Delivery Network</a> was originally published in <a href="https://medium.com/chainintel">ChainIntel</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TorchJS: Running PyTorch Models in NodeJS]]></title>
            <link>https://medium.com/chainintel/torchjs-running-pytorch-models-in-nodejs-348022b0d291?source=rss----c765ef1cd24b---4</link>
            <guid isPermaLink="false">https://medium.com/p/348022b0d291</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[pytorch]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Surat Teerapittayanon]]></dc:creator>
            <pubDate>Thu, 08 Nov 2018 05:04:27 GMT</pubDate>
            <atom:updated>2018-11-08T05:04:26.953Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7VH5J_3AFJjg5PfI" /><figcaption>“fish-eye photography of city” by <a href="https://unsplash.com/@serjosoza?utm_source=medium&amp;utm_medium=referral">sergio souza</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>A New Way to deploy Pytorch Deep Learning Model.</p><p>With the recent release of <a href="https://pytorch.org/">PyTorch</a> 1.0 and <a href="https://pytorch.org/docs/master/jit.html">Torch Script</a>, we now have an easy way to export and run a PyTorch model in C++. This will help shorten the time to production of DNN models tremendously.</p><p>On one hand, there is no denied that Python is one of the top language for machine learning due to its ease of use and powerful libraries. One of those includes PyTorch which has made the development and experimentation of DNN models easy.</p><p>On the other hand, NodeJS has been widely used to serve web API requests, due to its vastly available web libraries, ease of setup and use and asynchronous performance.</p><p>This post will discuss how one can export and run a PyTorch model with NodeJS. This could be useful when you have a NodeJS server serving APIs which run DNN inference using the PyTorch models that one has just developed in Python.</p><p>Let’s get started. First, we need to install the necessary tools:</p><blockquote>sudo apt install g++ cmake unzip</blockquote><p>Once the tools are installed, we can now install the <a href="https://www.npmjs.com/package/@idn/torchjs">@idn/torchjs</a> package:</p><blockquote>npm install @idn/torchjs</blockquote><p>Once the package is installed, we now need to export a model from PyTorch. Below is an example code to export a PyTorch model. In this case, we export the pretrained ResNet18 from the torchvision package.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b8db272bd34cb05155098dc92175b8a4/href">https://medium.com/media/b8db272bd34cb05155098dc92175b8a4/href</a></iframe><p>Once the model is exported, we can now load and run it in NodeJS.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e875b0c63747888b5b21dac4782e6499/href">https://medium.com/media/e875b0c63747888b5b21dac4782e6499/href</a></iframe><p>If you try this on machines without CUDA, please comment out line 8 to run the model on CPU.</p><p>This post is edited by Marcus Comiter.</p><p>This post is inspired by <a href="http://blog.christianperone.com/2018/10/pytorch-1-0-tracing-jit-and-libtorch-c-api-to-integrate-pytorch-into-nodejs/">PyTorch 1.0 tracing JIT and LibTorch C++ API to integrate PyTorch into NodeJS</a> by Christian S. Perone. You can visit the page to read more about the detail.</p><p>Please checkout <a href="https://www.npmjs.com/package/@idn/torchjs">@idn/torchjs</a> npm module and let us know what you think! Thank you for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=348022b0d291" width="1" height="1" alt=""><hr><p><a href="https://medium.com/chainintel/torchjs-running-pytorch-models-in-nodejs-348022b0d291">TorchJS: Running PyTorch Models in NodeJS</a> was originally published in <a href="https://medium.com/chainintel">ChainIntel</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A new era of decentralized neuromorphic computing.]]></title>
            <link>https://medium.com/chainintel/brain-for-machines-ede15d1f24c1?source=rss----c765ef1cd24b---4</link>
            <guid isPermaLink="false">https://medium.com/p/ede15d1f24c1</guid>
            <category><![CDATA[news]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[decentralization]]></category>
            <dc:creator><![CDATA[Anvay Rane]]></dc:creator>
            <pubDate>Wed, 04 Oct 2017 21:02:17 GMT</pubDate>
            <atom:updated>2017-10-04T21:24:57.033Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>“<em>Once there was an arms race to put a man on the moon, now there is an tech race to put an artificial brain on a chip.”</em></blockquote><h3>Why it all began</h3><p>Evolution of Artificial Intelligence from perceptron towards deep neural networks was so rapid that even machines themselves were left behind. CPUs and GPUs though designed to process millions of computation within seconds are now becoming bottlenecks for further evolution of Artificial Intelligence.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fm8UkOzjZ7ug7vlyV1EvkQ.png" /><figcaption>Figure 1. Evolution of Artificial Intelligence</figcaption></figure><p>Companies such as Google, Nvidia, Intel, IBM have walked the extra mile to innovate specialized hardware for computation of neural networks. Google fabricated the Tensor Processing Unit ( TPU ), an application specific integrated circuit ( ASIC ) designed inherently to process tensor/vector computations. Application specific integrated circuit ( ASIC ) is a customized circuit, designed with the sole purpose of performing a specific task effectively. We have seen heavy usage of ASIC in bitcoin mining network for proof of work hash function computation. Even the GPU Giant, Nvidia have designed Tesla V100 hardware units specialized for training of neural networks surpassing their own GPU hardware by 12x increase in performance. What’s next?</p><h3>Loihi, not just a volcano anymore</h3><p>Intel has surprised the community of artificial intelligence researchers, by not only stepping their foot forward but by taking a giant leap in the area of artificial intelligence specialized hardware or rather, Neuroware. Intel announced on their blog post about Loihi, a first of its kind self learning chip. Inspired from communication between neurons of human brain using spiking and plastic synapses, Loihi comprises 130,000 artificial neurons and 130 million synapses. Loihi research chip is fabricated in way to mimic the human brain’s basic mechanics, enabling faster and more efficient machine learning with lower power consumption. Lower power consumption clearly relates to increase in battery life enabling Internet of Things ( IoT ) devices to harness machine learning power locally and efficiently. Loihi would enable real-time computation with ease due to its compact design and capability to self-train. Self-training on the chip alleviates the dependence on cloud for inference and pushes machines to be autonomous. Applications of such neurowares are huge, ranging from autonomous vehicles to voice-enabled devices such as Alexa, Google Home. Devices embedded with neurowares can train locally on personalized user datasets for inference tailored specific for that user. Possibilities could be limitless, neurowares could help establish a better future.</p><h3>I won’t believe it until i see it</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/394/1*MWCjwViQIUKLGgsq1ixR-A.png" /><figcaption><a href="https://newsroom.intel.com/editorials/intels-new-self-learning-chip-promises-accelerate-artificial-intelligence/">https://newsroom.intel.com/editorials/intels-new-self-learning-chip-promises-accelerate-artificial-intelligence/</a></figcaption></figure><p>Oh yeah, its pretty legit. Technews is all flooded with articles about Loihi. Intel did provide a sneak peak picture of how Loihi looks like. Intel also mentions collaborating with researchers from Caltech for over a decade for neuromorphic hardware research. At core, Loihi is a neuromorphic chip architecture with innovative usage of asynchronous spiking. Intel are not the inventors of the Neuromorphic chips. Neuromorphic chips have been around since the 80s lurking in the back, while CPUs wins all the glory. The sudden rise in popularity of neuromorphic chips is due to their synergy with artificial neural networks.</p><h3>And then there is some biology</h3><p>The ideology behind neuromorphic architecture is the asynchronous nature of neuron spiking. A very high-level introduction to few Biology 101 terms is required to capture the essence behind neuromorphic chips, we promise to keep it simple.</p><p>A <strong>neuron</strong> is an electrically excitable cell that receives, processes, and transmit information through electrical signals.<br>A <strong>synapse</strong> is a structure that permits a neuron to pass an electrical signal to another neuron.</p><p>A neuron is said to <strong>spike</strong> when, electrical signals it receives ( from other neurons ) exceed a certain voltage threshold. Spiking of neuron can be viewed as an <strong>asynchronous event</strong> transmitting signals to inform other neurons that a certain criteria is meet, ie voltage threshold.</p><p>Neurons co-operate through spiking, forming the basic functionality of the human brain. Visualization of interconnections of neurons through synapses can be seen below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*-J8q7r5jjnt8p6vvj-qz_Q.jpeg" /><figcaption><a href="http://www.mind.ilstu.edu/curriculum/connectionism_intro/connectionism_overhead.php">http://www.mind.ilstu.edu/curriculum/connectionism_intro/connectionism_overhead.php</a></figcaption></figure><p>Similar structure representation can be observed in Neuromorphic architecture.<strong> Neuromorphic architecture involves independent silicon neurons which co-operate to solve a problem by communicating through asynchronous events in a distributed manner.</strong> Independent silicon neurons add up incoming signals from asynchronous events to fire out new asynchronous event signals. Each of these neurons also host localized memory. With such a separation and distribution of computation and memory, massive parallelization can be attained. Apart from parallelized execution, asynchronous firing of the neuron helps reducing the energy consumption of neuromorphic chips compared to CPUs. ie. energy is only consumed when a neuron is fired.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QCRFPn50i9fYyzCaN_jdtA.png" /><figcaption>Figure 2. High-level visualization of Neuromorphic architecture.</figcaption></figure><p>Each neuron spikes when the input satisfies the threshold of that neuron. Neurons propagate their spiking through synapses connecting with other neurons. Output is determined sheerly by the combination of neuron spikes.</p><p>The above tries to explain a very high-level representation of Neuromorphic architecture. Such specialized hardware provide companies leading edge in the artificial intelligence specific market. Neurowares eliminate the centralized Von-Neumann architecture (CPU) bottlenecks elegantly by decentralizing memory and computation.</p><h3>Wave of decentralization</h3><p>From decentralized hardware architecture to decentralized Artificial intelligent networks, decentralization movement is rapidly gaining mass as its rolls down from a niche technology to the mainstream. Decentralized protocols will disrupt the disruptors based on centralized systems today. Decentralization is a process of distributing power away from centralized authority to individuals participating in the network. Bitcoin and Ethereum are two prominent examples of such decentralized networks. Such networks maintain a tightly coupled relationship with the miner-nodes. Miner-nodes are computing hardware that execute the protocol functionality for cryptocurrency rewards.</p><p>Coupling Artificial Intelligence in such a decentralized way, would democratize the access of artificial intelligence models. Monopolization of Artificial Intelligent services by big companies is inevitable, until there is an availability of an open source decentralized Artificial intelligence platform. For a decentralized Artificial Intelligence to practically exist, the miner-nodes should be optimized to solve huge number of matrix computations. Such a decentralized AI network could exist today with the sheer power of GPU and CPU miner-nodes.</p><h3>Neuromorphic miner-node</h3><p>Apart from numerous advantages decentralized networks provide to mold and reshape the society we have today, such networks poses a peculiar property of incentivizing the work. In case of Bitcoin network, the more hash power a miner-node provides for securing the network and processing the transactions, more chance the miner node has to earn the reward block. Miner-node owners have fabricated specialized ASIC hardware to stay ahead in the game of earning the reward block. Similar trend from CPU to ASIC in the bitcoin network, could be replicated in decentralized artificial intelligent networks. Miner-nodes would shift from CPU/GPU to more enhanced processing units more geared towards executing neural networks to earn higher reward. Such enhanced processing units could be Tensor Processing Units ( TPU ), Nvidia hardware geared towards artificial intelligence inference or Neurowares such as Loihi depending upon the availability in the market. With neuromorphic nodes, decentralized artificial intelligence would be able to distribute artificial intelligent services efficiently and fairly.</p><p>Appreciate your time for reading the article. Do follow me if the content seemed interesting and valuable to you. Subscribe ChainIntel publication to stay updated on decentralized artificial intelligence movement.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ede15d1f24c1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/chainintel/brain-for-machines-ede15d1f24c1">A new era of decentralized neuromorphic computing.</a> was originally published in <a href="https://medium.com/chainintel">ChainIntel</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fast Inference for Deep Learning Models]]></title>
            <link>https://medium.com/chainintel/fast-inference-for-deep-learning-models-f29a1ade2e03?source=rss----c765ef1cd24b---4</link>
            <guid isPermaLink="false">https://medium.com/p/f29a1ade2e03</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[distributed-systems]]></category>
            <category><![CDATA[distributed-computing]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Surat Teerapittayanon]]></dc:creator>
            <pubDate>Sun, 01 Oct 2017 05:35:29 GMT</pubDate>
            <atom:updated>2017-10-01T06:01:09.716Z</atom:updated>
            <content:encoded><![CDATA[<p>Neural networks have shown to provide significant improvement in prediction accuracy by stacking multiple hidden layers, hence we see the trend towards more and more usage of deep learning. The ImageNet challenge exemplifies this trend towards deep neural networks, from Alex-Net ( 8 layers ), VGG-Net ( 19 layers ) to ResNet ( 152-layers ) within a period of 4 years. Such improvement in accuracy by increasing the depth of neural network comes with the cost of additional execution time and power consumption.</p><p><strong>Even if we disregard the additional execution time during training of the neural network, overlooking this addition in execution time during inference could result in negative user-experience. Improving inference can be envisioned as how accurately we can infer and how quickly can we infer.</strong></p><p>Deeper layered networks help to improve the former argument for inference, while adding negative impact for the later. This article elaborates the idea of BranchyNet for fast inference through early-exits.</p><p>Let’s say we participate in an experimental math competition. We are given 3 mathematical problems to solve, each with an increasing level of difficulty.</p><p><strong>Problem 1: <em>Finding a square root of 4. (difficulty x)<br></em>Problem 2:<em> Finding a square root of 1000. (difficulty y)<br></em>Problem 3: <em>Finding a square root of 13371337.</em> (<em>difficulty z)</em></strong></p><p>For simplicity we assume that solving a problem of difficulty x takes t_x seconds, of difficulty y takes t_y seconds and of difficulty z takes t_z seconds and t_x&lt;t_y&lt;t_z. The total time taken for human (t_h) to solve the entire set of mathematical problems would be the summation of the difficulty of the problems in terms of time (t_x+t_y+t_z).</p><p>Now, we train a deep neural network to participate in this experimental math competition as well. The neural network has to be designed such that it can solve the hardest problem of difficulty z (assuming it also take t_z seconds). The time taken for the neural network to solve each problem is equal to the time required to complete execution through all the layers of the neural network. The total time taken for the neural network (t_n)would be equal to the number of mathematical problems multiplied by the time taken to solve each problem (3t_z).</p><p>Since the time required by the neural network (3t_z) is greater than the time taken by human (t_x+t_y+t_z) to solve the same set of mathematical problems, human will be the winner in this case.</p><p>The above example is purely based on assumptions, it may not necessarily be true in the real world given how fast machines can compute compare to human brain. What we are trying to convey with the help of the math competition example is that the deep neural network performs the same amount of work to predict any result regardless of the input and the total time is directly proportional to the number of layers. Each layer extracts different high-level features to aid in prediction of the input label.</p><p><strong>Confidence of predicting an input label is unevenly distributed between layers depending upon the features extracted. </strong>For instance, in digit recognition, certain features such as no curved lines would provide high confidence that the digit we are trying to predict is 1,4 or 7 and not 0, 2, 3, 5, 6, 8, or 9.<strong> Even though the neural network is highly confident about the prediction label of the input at earlier layers of the network, it still has to process through all the layers of the network before predicting the label due to its current structure. BranchyNet relaxes the rigid structure of the neural network by allowing early exits for high confident predictions.</strong></p><p>The BranchyNet architecture comprises of a single entry point and multiple exit points. An entry point can be viewed as an input layer and exit points can be viewed as an output layer. A branch is a subset of contiguous layers, which do not overlap with other branches, followed by an exit point. The original neural network can be viewed as a main branch and layers branching out from the main branch can be viewed as side branches. Each branch must resolve to an exit and can be numbered increasingly based on its distance from the entry point.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*i4f7gse6-Vw5sVCePsYyig.png" /><figcaption>Figure 1. BranchyNet with 2 branches added to AlexNet.</figcaption></figure><p>The above figure depicts BranchyNet with 2 side branches added to the AlexNet main branch. The boxes indicate the exit points, we have 2 early exits and one exit of the main AlexNet branch. BranchyNet can be used for fast inference when the input label is predicted at earlier layers of the neural network with high confidence. If the classifier at the exit point has sufficient confidence about the label of an input sample, the sample can exit and no further computation on the input sample through deeper layers is needed. <strong>An entropy is used to determine the confidence of a classifier at an exit point for the sample input.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/378/1*d7g0SnfzCVAxBdJKISRkBA.gif" /></figure><p>where y is a vector containing predicted probabilities for all possible class labels.</p><p>Predicted probability for a class label is the measure of the likelihood that the input can be classified as the class label. A simple example would be classifying a digit number for the class labels ( 1, 2, 3, 4, 5, 6, 7, 8 , 9, 0 ). The predicted probability vector [ 0.05, 0.05, 0.1, 0.05, 0.05, 0.1, 0.45, 0.05, 0.05, 0.05 ] corresponds to the predicted probability for each class label ( 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 ).</p><p><strong>Entropy measures the amount of information conveyed in the predicted probability vector of each exit branch. The higher the entropy the more information the neural network has about a particular input. The more information the neural network has the more confidence it is about that particular input.</strong></p><p>During inference time, an entropy at an exit point is compared to the corresponding threshold set for that particular exit point. If the entropy is lesser than the threshold value, then the sample input is allowed to exit at the particular exit point. A high-level execution of the inference phase of the BranchyNet can be viewed as follows. We have a vector T denoting threshold for each exit, i.e., T[1] is the threshold for exit 1. The inference phase begins with the lowest exit points. The input sample is fed through the branch of the lowest exit point and the entropy is compared to the threshold value. If the entropy is lower than the threshold value, then the sample input can exit the network at that exit point. If not the next lowest exit point is chosen and the procedure is continued similarly until the highest or the final exit point is reached.</p><p>An important hyperparameter apart from the threshold in BranchyNet, is the weights in joint optimization during the training of the BranchyNet. BranchyNet involves usage of a loss function as an optimization objective, i.e., for classification specific task, we can use softmax cross entropy loss function. Each exit branch is designed to minimize this loss function. To train the entire BranchyNet, we form a joint optimization problem with the weighted sum of the loss functions on each exit branch. The earlier branches helps increasing the accuracy of the later branches due to the added regularization which prevents over-fitting. Giving more weight to the earlier branches allows the earlier layers to learn more discriminative features and allows more samples to exit the network early; thus, reducing the average time taken by a network to infer a label for an input sample.</p><p>The BranchyNet architecture synergizes well with the distributed execution of artificial intelligence models for inference. Since each branch (subset of layers) can be executed independently, the branches can be distributed on different nodes to execute in parallel. In case of an early exit, the remaining execution of the branches could be deterred by communication between nodes. This distributed nature of BranchyNet allows data scientists to deploy deeper models with very little trade off in time. Deeper models would enable more sophisticated feature extraction to solve more complex problems using Artificial Intelligence.</p><p>Let’s look at an example of how a 10-layered deep BranchyNet would be executed. The 10-layered deep BranchyNet has 4 different branches, 3 side branches and 1 main branch. We consider 4 nodes for executing these 4 different branches for simplicity. Node 1 executes the main branch till layer 3 and then communicates the output of layer 3 to Node 2. Node 1 in parallel continues executing the branch with exit 1. Node 2 executes the main branch from layer 4. Similarly Node 2 would communicate the output of layer 6 to Node 3, and in parallel continue to execute the branch with the exit 2. If a node can exit early, i.e., high confidence is obtained by a node at an exit, the result would immediately be communicated back to the client, thereby deterring the further execution of the BranchyNet and resulting in a faster response time. Early exit for higher confidence inputs and parallel execution of branches contribute to heavy reduction of the inference time. The execution time of the layers could further be reduced by parallelizing the execution of each neural network layer itself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Be6yrBLqYzIUQkbgT8u6JA.png" /><figcaption>Figure 2. Execution of 10-layered BranchyNet.</figcaption></figure><p>Heavy reduction in inference time of Artificial Intelligence models increases their adoption for more real-time prediction tasks. Inference using BranchyNet could utilize paired execution by local nodes (Nodes on which an application is running, can be a Computer, Mobile or IoT device) and remote network nodes. Local nodes would execute the lowest branches and would predict an output locally in case of early exit, the remote nodes would begin execution of the latter branches simultaneously as the local node, thereby reducing time of inference in case of no local early exit. The time taken in case of no early exit locally would be the difference between execution time required for the layers of the exit branch and execution time of layers on the local node.</p><p>If you are interested to learn more about BranchyNet, the research paper is available at <a href="https://arxiv.org/abs/1709.01686">https://arxiv.org/abs/1709.01686</a>.</p><p>Please let me know if you have any feedback or suggestion on the topic. I am happy to discuss.</p><p>I am working on a tool for developers to easily augment a trained deep neural network model with branches for fast inference and will share about the progress in a later post.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f29a1ade2e03" width="1" height="1" alt=""><hr><p><a href="https://medium.com/chainintel/fast-inference-for-deep-learning-models-f29a1ade2e03">Fast Inference for Deep Learning Models</a> was originally published in <a href="https://medium.com/chainintel">ChainIntel</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Distributed Decentralized Artificial Intelligence Framework for DApps]]></title>
            <link>https://medium.com/chainintel/distributed-decentralized-artificial-intelligence-framework-for-dapps-75fefdc554c5?source=rss----c765ef1cd24b---4</link>
            <guid isPermaLink="false">https://medium.com/p/75fefdc554c5</guid>
            <category><![CDATA[decentralization]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Team ChainIntel]]></dc:creator>
            <pubDate>Fri, 29 Sep 2017 18:35:18 GMT</pubDate>
            <atom:updated>2017-09-26T09:53:58.134Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>“Let’s chain the world, one block at a time.” — <a href="https://www.chainintel.com/">ChainIntel</a></blockquote><p><em>Visit us at </em><a href="https://www.chainintel.com/"><em>https://www.chainintel.com/</em></a><em> for more technical details.</em></p><p>Today, it is very hard or rather impossible to imagine our lives without interacting with an Artificial Intelligence based application for our day-to-day activities. Artificial intelligence (AI) technologies are being deployed for an increasing variety of use cases across almost every industry vertical from retail, healthcare, automation to agriculture. Some of the biggest uses of AI can be seen in robotics, autonomous driving, image recognition, and natural language processing. Statista forecasts that the revenue generated from the direct and indirect application of AI softwares will grow from $1.38 billion in 2016 to $59.75 billion by 2025.</p><p>Technological giants are in an arms race to gather huge amount of data, best talent, and processing power to stay ahead of the curve in developing cutting edge AI models. Everyone else, without access to enormous computing resource, a team of like-minded AI evangelists, and gigantic datasets, risks being sidelined from the opportunity to shape the path of one of the most significant technologies ever created by humans.</p><p>A n open-source distributed decentralized AI agent with utmost intelligence serving the society as a whole and operating beyond the influence of shut-down threat of any single organization is possible through collaboration from programmers and researchers around the world along with an enormous computing power and dataset. Companies and individual developers around the world would be able to leverage such an open-source distributed decentralized AI agent to build smarter applications at the most competitive price for necessary computation. Imagine a self driving car reconfiguring itself using the best possible pre-trained models when it enters a new state by connecting to the single distributed global AI agent or network.</p><p>Imagine the input data that each device collects over time being securely pre-processed locally before being sent out for further computation at other participating nodes in the network, ensuring confidential data privacy for users; on the other hand, a user could opt in to donate a certain type of data to the network. In the latter case, his / her data will be accumulated in a shared pool of training data used for open-source research to propel humanity leap in AI. No longer will user data be collected by AI giants such as Google, Apple, Facebook, and Microsoft to train their own neural networks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lrkkS-T1n6PlfdQEbN6Blg.jpeg" /></figure><p>Though farfetched it may not necessary mean impossible, due to the availability of huge computation resource and data storage in the form of decentralized networks such as Ethereum and IPFS. A platform that would incentivize people to collaborate to build such an open-source distributed decentralized AI agent would be the ultimate way to democratize the power of AI to the world. At ChainIntel, we believe in such a vision of a decentralized and fairer future. We are excited and passionate about the synergy between distributed AI and decentralized blockchain technologies.</p><p>To realize this vision of a distributed decentralized AI future, as a first step, we are building technologies to allow distributed AI model execution, where some parts of a deep neural network run on local devices and other parts run on a set of active nodes in the ChainIntel P2P network. Users would be able to leverage the power of such a huge compute resource to execute existing AI models deployed on the ChainIntel P2P network. Decentralized Applications or commonly known as DApps would be able to seamlessly integrate AI-enabled capabilities such as user recommendation, speech recognition, speech understanding, face recognition, image recognition, anomaly detection, semantic analysis, autonomous driving, smart home, and many more.</p><p>W e are about to release the first concrete result of our passionate pursuit: the ChainIntel JS SDK. We plan to support multiple types of clients such as desktop, mobile, or web clients, CPU or GPU clients to run such workload and multiple deep learning frameworks such as Keras, Caffe, Chainer, TensorFlow.</p><p>Next time, we will dive into the technical aspects underpinning our work.</p><p>Follow us on Medium for our latest updates. Any question or concern is welcome, we will try our best to reply. We are open for contributions, connect with us at <a href="http://team@chainintel.com/">team@chainintel.com</a>.</p><p><em>Visit us at </em><a href="https://www.chainintel.com/"><em>https://www.chainintel.com/</em></a><em> for more technical details.</em></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2F9dcad4%3Fas_embed%3Dtrue&amp;url=https%3A%2F%2Fupscri.be%2F9dcad4%2F&amp;image=https%3A%2F%2Fupscri.be%2Fmedia%2Fform.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/62a0cf993d24af90cfbb49cd3c963699/href">https://medium.com/media/62a0cf993d24af90cfbb49cd3c963699/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=75fefdc554c5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/chainintel/distributed-decentralized-artificial-intelligence-framework-for-dapps-75fefdc554c5">Distributed Decentralized Artificial Intelligence Framework for DApps</a> was originally published in <a href="https://medium.com/chainintel">ChainIntel</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>