<?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[Stories by Haseena Rahmath on Medium]]></title>
        <description><![CDATA[Stories by Haseena Rahmath on Medium]]></description>
        <link>https://medium.com/@haseenarahmath?source=rss-3de808dc8444------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*ZBD4Ilby_L3lOq71.jpg</url>
            <title>Stories by Haseena Rahmath on Medium</title>
            <link>https://medium.com/@haseenarahmath?source=rss-3de808dc8444------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 09:07:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@haseenarahmath/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Early Exit Neural Network]]></title>
            <link>https://medium.com/@haseenarahmath/early-exit-neural-network-8f0db74efafd?source=rss-3de808dc8444------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f0db74efafd</guid>
            <category><![CDATA[dynamic-inference]]></category>
            <category><![CDATA[adaptive-inference]]></category>
            <category><![CDATA[early-exit-dnn]]></category>
            <dc:creator><![CDATA[Haseena Rahmath]]></dc:creator>
            <pubDate>Mon, 20 Jun 2022 00:04:50 GMT</pubDate>
            <atom:updated>2022-06-20T00:12:41.466Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/824/1*lxp-O53GrIMFjEtofv900w.png" /></figure><p>If someone asks us to calculate the product of 2 and 3 or the product of 26787 and 68686 or the product of 763638629 and 633636386, we take comparatively less time to solve the first product, a little more time for the second product, and we take some more time to solve the third problem. That means, based on the difficulty, our solving time increases or decreases.</p><p>Let’s suppose we construct a neural network to solve the same problem. The neural network has to be designed and trained such that it can solve the hardest problem. The neural network takes the input, propagates it through all the layers up to the final layer, and delivers output. Whether the input samples are easy or hard, It takes the same amount of work to generate the results. Hence, it takes almost equal time to solve each problem.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ypd462RRbppGOdPSVxx65w.png" /></figure><p><strong>Can we construct an input pattern-aware deep neural network?</strong><br>The answer is <strong>YES</strong>!</p><p>We know that each layer in the neural network extracts different levels of features that eventually help in the result generation. If the shallow layers of the neural network can extract features, generate output, and exit early from the network for “easy” or “medium” input samples, it will speed up the inference process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s1BNrS77SJa8RiLDXHR-eg.png" /></figure><p>Early Exit Neural networks are an emerging family of neural networks that considers the natural variation of the input samples and delivers the output early from the intermediate layers of the network. They provide many exit points in the network and process less number of layers for “easy” input samples while it propagates “hard” input samples all the layers of the network.</p><p><strong>How Can We Construct An Early Exit Neural Network?</strong></p><p>Early Exit Neural networks consist of a single entry point and multiple exit points. Exit points are constructed by attaching exit branches to the standard deep neural network, as shown in the Figure below. The Figure illustrates an early exit DNN with two side branches. AlexNet is the main or backbone of the network. The green boxes indicate the exit points. It has three exit points: 2 early exits and one final exit of the main branch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*nRwHGKkTcEYhNKHw-2zQ7Q.png" /></figure><p><strong>How does it work?</strong></p><p>The input layer receives the input sample and passes it to the intermediate layers. When the input sample reaches the exit point, it calculates the output, and if it has enough confidence about it, then the inference process stops there and returns the result. Otherwise, the input sample propagates to the next intermediate layer. This process continues up to the final output layer, where it always returns results. It speedup up the inference when the input sample is processed at earlier layers of the DNN with high confidence. At each exit point, predetermined exit policies decide whether to stop or continue processing input samples further through the network. Entropy or the maximum probability of the softmax output can be considered for determining the confidence of an exit branch.</p><p>Entropy measures the amount of information accumulated for the prediction on 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 has about that input sample. During inference time, entropy at the exit point is compared with the predefined threshold value of that exit point. If the entropy is below the threshold value, then the input sample is allowed to exit at the particular exit point. Otherwise, the inference process continues to the next exit point, and the procedure is continued in a similar manner until the final output layer is reached. The below figure depicts the entire inference process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/1*yCFBrcFDEjBf_T5zKLOlXw.png" /></figure><p><strong>How Can We Train An Early Exit Neural Network?</strong></p><p>There are many strategies that exist for training Early exit deep neural networks:</p><ul><li><strong>Joint Training Strategy </strong>[2] — Train the entire network as a single optimization problem</li><li><strong>Branch-Wise Training Strategy</strong>[3] — Train each exit branch along with the preceding layers of the backbone network.</li><li><strong>Separate Training Strategy</strong> [4] — Train the backbone network first and freezes its learned parameters. Then train each exit branches, which uses the frozen weight parameters of the backbone network.</li><li><strong>Knowledge distillation-based Training Strategy</strong> [5] — Final output layer of the backbone network acts as a teacher, and other attached exit points are considered as students.</li></ul><p><strong>Applications of Early Exit DNN</strong></p><p>The main benefits of early exit DNN are:</p><ul><li>It is well suited for fast inference in neural networks.</li><li>It can be deployed in resource-constrained applications such as mobile and IoT.</li><li>It can be trained in distributed environments.</li><li>It can be deployed in the multi-tiered platforms, such as Fog Computing or edge computing applications.</li></ul><p>Early exit approaches are extensively studied in computer vision(CV) applications and natural language processing (NLP) applications. Because of the emerging areas of the Mobile Cloud and Edge Computing, Early exit DNN are getting wide research attention in recent years. The research focuses on offloading of application segments from edge devices to nearby edge servers through the exploitation of WiFi/Cellular-based communication technologies. Multiple exits neural networks are an ideal choice for this paradigm.</p><p><strong>How Can We Implement It In Code?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/0*JQpfzwlsBEVHnhrZ" /></figure><p><strong>References</strong></p><ol><li>S. Teerapittayanon, B. McDanel, and H. T. Kung, “BranchyNet: Fast Inference via Early Exiting from Deep Neural Networks,” <em>ArXiv170901686 Cs</em>, Sep. 2017, Accessed: May 02, 2022. [Online]. Available: <a href="http://arxiv.org/abs/1709.01686">http://arxiv.org/abs/1709.01686</a></li><li>C.-Y. Lee, S. Xie, P. Gallagher, Z. Zhang, and Z. Tu, “Deeply-Supervised Nets,” in <em>Proceedings of the Eighteenth International Conference on Artificial Intelligence and Statistics</em>, San Diego, California, USA, May 2015, vol. 38, pp. 562–570. [Online]. Available: <a href="https://proceedings.mlr.press/v38/lee15a.html">https://proceedings.mlr.pressv38/lee15a.html</a></li><li>C. Hettinger, T. Christensen, B. Ehlert, J. Humpherys, T. Jarvis, and S. Wade, “Forward Thinking: Building and Training Neural Networks One Layer at a Time.” arXiv, Jun. 08, 2017. Accessed: May 18, 2022. [Online]. Available: <a href="http://arxiv.org/abs/1706.02480">http://arxiv.org/abs/1706.02480</a></li><li>S. Venkataramani, A. Raghunathan, J. Liu, and M. Shoaib, “Scalable-effort classifiers for energy-efficient machine learning,” in <em>Proceedings of the 52nd Annual Design Automation Conference</em>, San Francisco California, Jun. 2015, pp. 1–6. doi: 10.1145/2744769.2744904.</li><li>E. Baccarelli, S. Scardapane, M. Scarpiniti, A. Momenzadeh, and A. Uncini, “Optimized training and scalable implementation of Conditional Deep Neural Networks with early exits for Fog-supported IoT applications,” <em>Inf. Sci.</em>, vol. 521, pp. 107–143, 2020, doi: <a href="https://doi.org/10.1016/j.ins.2020.02.041.">https://doi.org/10.1016/j.ins.2020.02.041.</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f0db74efafd" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>