<?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 Sudhanshu Mishra on Medium]]></title>
        <description><![CDATA[Stories by Sudhanshu Mishra on Medium]]></description>
        <link>https://medium.com/@sudhanshu.mishra.8826?source=rss-4409c3835e6d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*7e7ycQVnPPkkD2EiQAoLNA.jpeg</url>
            <title>Stories by Sudhanshu Mishra on Medium</title>
            <link>https://medium.com/@sudhanshu.mishra.8826?source=rss-4409c3835e6d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 02:35:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sudhanshu.mishra.8826/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[Optimising Docker Images (Part 1): Why & How]]></title>
            <link>https://medium.com/@sudhanshu.mishra.8826/optimising-docker-images-part-1-why-how-587420c74198?source=rss-4409c3835e6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/587420c74198</guid>
            <category><![CDATA[containerization]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[system-design-interview]]></category>
            <category><![CDATA[system-design-concepts]]></category>
            <dc:creator><![CDATA[Sudhanshu Mishra]]></dc:creator>
            <pubDate>Sat, 28 Jan 2023 16:13:31 GMT</pubDate>
            <atom:updated>2023-01-28T16:14:36.932Z</atom:updated>
            <content:encoded><![CDATA[<h4>About the Series:</h4><p>In this series of blog we will be covering detailed architecture of Docker, Various Optimisation Strategies, and their Impacts.</p><p><strong>Part 1: Introduction to docker and Why should you focus on Optimising Docker Containers</strong></p><p><strong>Part 2: Underlying Architecture of Docker and Why it behaves the way it does (Upcoming)</strong></p><p><strong>Part 3: Optimisation techniques with Detailed Examples (Upcoming)</strong></p><h4>What is Docker ?</h4><p>Docker is an open-source platform that allows developers to create, deploy, and run applications in a containerised environment. Containers are lightweight, portable units that package an application and its dependencies together, making it easy to move and run the application on any system that supports Docker. This eliminates the need to worry about compatibility issues and configuration differences between different environments. Docker also provides a centralised way to manage and distribute containers, making it easier to collaborate and share resources among teams. With Docker, developers can focus on writing code, while the platform handles the underlying infrastructure and dependencies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/457/1*lygitHAQ9bytj-B14111ag.png" /></figure><blockquote>“Hello, my name is Sudhanshu Mishra and I am a software engineer based in New Delhi, India. I have several years of experience in the tech industry, having written my first production-grade software in 2018. Throughout my career, I have held various roles and worked with multiple companies on freelance, contract, and full-time projects. I have a deep understanding of what it takes to build a robust, scalable product that can handle high traffic. You can trust that my expertise and experience make me a reliable source of information and guidance.”</blockquote><blockquote>You can reach out to me on <a href="https://www.linkedin.com/in/sudhanshumishra8826/"><em>LinkedIn</em></a> &amp; <a href="https://twitter.com/Sudhanshu_221?t=wSJI4MQFpb-Li7uULI7wug&amp;s=09"><em>Twitter</em></a></blockquote><h4>Why should I optimise my Docker Containers ?</h4><p>Optimising the size of your Docker container can bring several benefits:</p><ol><li>Reduced network transfer costs: Smaller containers require less bandwidth and time to transfer over the network, which can be especially important when deploying containers across multiple machines or regions.</li><li>Faster deployment: Smaller containers take less time to download and start up, which can speed up the overall deployment process.</li><li>Reduced storage costs: Smaller containers take up less disk space, which can help to reduce storage costs.</li><li>Improved security: Smaller containers have fewer components, which can reduce the attack surface and make them less vulnerable to security threats.</li><li>Better resource utilisation: Smaller containers use fewer resources, which can help to improve the overall performance and efficiency of the host system.</li><li>Better compatibility: Smaller containers are more likely to be compatible with a wider range of systems and environments, which can help to ensure that the application can be deployed and run smoothly in different situations.</li></ol><p>By optimising your container size, you can improve the performance, security, and scalability of your applications.</p><h4><strong>How does Docker Image Size effects scaling an application</strong></h4><p>Consider that our existing servers are set to violate the SLA as our application, which is currently serving at 50K RPM, increases to 70K RPM. This auto-scaling group monitors the run-time statistics of the containers and attempts to scale up a new container as soon as one of the conditions is satisfied.</p><blockquote>Container Spawning Time = Total time to download docker image + time taken for application boot up scripts + measuring health of newly spawned container.</blockquote><p>From this equation, we can obviously deduce one thing. Let’s assume that downloading Docker images took two minutes, start up scripts took thirty seconds, and the application health check took another thirty seconds if auto-scaling is triggered to raise one container if CPU consumption exceeds 80.</p><p>Therefore, a lot of things could happen in this three minutes:</p><p>The server can crash if its CPU usage reaches 100%, delaying several user requests in the process.<br>Peak usage on all servers causes a sharp increase in response times, which is negative for the user experience.</p><p>For More Deeper Understanding with Examples, Check this <a href="https://levelup.gitconnected.com/effects-of-docker-image-size-on-autoscaling-w-r-t-single-and-multi-node-kube-cluster-29c4f689cd99"><em>blog</em></a>.</p><h4>Next:</h4><p><strong>Part 2: Underlying Architecture of Docker and Why it behaves the way it does (Upcoming)</strong></p><p><strong>Part 3: Optimisation techniques with Detailed Examples (Upcoming)</strong></p><h4>Reference:</h4><p><a href="https://levelup.gitconnected.com/effects-of-docker-image-size-on-autoscaling-w-r-t-single-and-multi-node-kube-cluster-29c4f689cd99">Effects of Docker Image Size on AutoScaling w.r.t Single and Multi-Node Kube Cluster</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=587420c74198" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Style Transfer on Images]]></title>
            <link>https://medium.com/@sudhanshu.mishra.8826/style-transfer-on-images-70bff2301e34?source=rss-4409c3835e6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/70bff2301e34</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[convolution-neural-net]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[style-transfer]]></category>
            <dc:creator><![CDATA[Sudhanshu Mishra]]></dc:creator>
            <pubDate>Mon, 27 May 2019 08:29:58 GMT</pubDate>
            <atom:updated>2019-05-27T08:29:58.392Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S7BvwS5tdCobSEO7fQFl9Q.jpeg" /></figure><p>The problem tackled in this report is Transferring the style of on image to contents of another image and thus creating a third image having the style similar to first image and content similar to second one.</p><p>Recently there had been many researches on this complex problem and several ways have been explored but very few of them actually work.</p><p>For achieving this I have used approaches from two different research papers and implemented them.</p><h3>Code available at :</h3><p><a href="https://github.com/SudhanshuMishra8826/Style-Transfer-On-Images">SudhanshuMishra8826/Style-Transfer-On-Images</a></p><h3>Style transfer on Images using “Leon A. Gatys ‘s paper on A Neural Algorithm of Artistic Style”</h3><p>In this approach we used a VGG network with function to combine both the style and content loss and then by optimizing this loss in one iteration we will reduce the style and content loss thus making the produced image better.</p><p>Link to Research paper: <a href="https://arxiv.org/pdf/1508.06576.pdf">https://arxiv.org/pdf/1508.06576.pdf</a></p><h3>Process:</h3><p><strong>Convolutional Neural Network (CNN).</strong> A given input image is represented as a set of filtered images at each processing stage in the CNN. While the number of different filters increases along the processing hierarchy, the size of the filtered images is reduced by some down-sampling mechanism (e.g. max-pooling) leading to a decrease in the total number of units per layer of the network.</p><p><strong>Content Reconstructions.</strong> We can visualize the information at different processing stages in the CNN by reconstructing the input image from only knowing the network’s responses in a particular layer. We reconstruct the input image from layers ‘conv11’ (a), ‘conv21’ (b), ‘conv31’ ©, ‘conv41’ (d) and ‘conv51’ (e) of the original VGG-Network. We find that reconstruction from lower layers is almost perfect (a,b,c). In higher layers of the network, detailed pixel information is lost while the high-level content of the image is preserved (d,e).</p><p><strong>Style Reconstructions</strong>. On top of the original CNN representations we built a new feature space that captures the style of an input image. The style representation computes correlations between the different features in different layers of the CNN. We recon-struct the style of the input image from style representations built on different subsets of CNN layers ( ‘conv11’ (a), ‘conv11’ and ‘conv21’ (b), ‘conv11’, ‘conv21’ and ‘conv31’ ©,‘conv11’, ‘conv21’, ‘conv31’ and ‘conv41’ (d), ‘conv11’, ‘conv21’, ‘conv31’, ‘conv41’and ‘conv51’ (e)). This creates images that match the style of a given image on an increasing scale while discarding information of the global arrangement of the scene.</p><h3>Major Disadvantage:</h3><p>The overall process is very slow and takes too much time for a single image thus creating real time applications is not possible using this approach.</p><ul><li>For processing a single image on non gpu accelerated systems it take 4 to 5 hours. On my system it took 5 hours.</li><li>For processing a single image on gpu accelerated systems it takes 1–2 minutes . On Google colab it took 1 minute.</li></ul><p>Even on gpu accelerated system the results are not real time thus implementing this approach in real-time applications (webcams) is not a good idea.</p><h3>Steps For Execution:</h3><h4>Using Google Colab (Recommended because fast and simple):</h4><ol><li>Open <a href="https://colab.research.google.com/drive/1dyNIUmj98xy5TSW9cgzzTv7mPyvSahpO#scrollTo=o86SxoacBs_z">https://colab.research.google.com/drive/1dyNIUmj98xy5TSW9cgzzTv7mPyvSahpO#scrollTo=o86SxoacBs_z</a> in your browser.</li><li>Upload your Style and Content Image by clicking the upload button in the console.</li><li>Change the name of content image from “night.jpg” to your Content image name (Second Cell)</li><li>Change the Name of Style image from “starry_night.jpg” to your style Image name (Third Cell)</li><li>Click on Runtime dropdown and chose run all button.</li><li>Scroll Down to the bottom of the page and see the result image</li></ol><p><strong>Note:</strong></p><p><strong>Google Colab</strong> is a free cloud service which now supports free GPU, Programmers use it to improve Python programming language coding skills. develop deep learning applications using popular libraries such as Keras, TensorFlow, PyTorch, and OpenCV.</p><h3>Code available at :</h3><p><a href="https://github.com/SudhanshuMishra8826/Style-Transfer-On-Images/tree/master/Algo1">SudhanshuMishra8826/Style-Transfer-On-Images</a></p><h4>Using Terminal directly (Slow):</h4><ol><li>Extract the attached Zip1 file.</li></ol><p>2. Change the Style and Content image file path as your desired images.</p><p>3. For Style change in line 21.</p><p>4. For Content change in line 16.</p><p>5. Run the code by using command “python StyleTransferAlgo1.py”.</p><h3>Test Results:</h3><p>I tested using <em>The Starry Night </em>painting by <strong>Vincent van Gogh</strong> (suggested) as style image and an Picture of a valley in a hilly area as content image.</p><p><strong>Style Image:</strong></p><p><a href="https://artsandculture.google.com/asset/the-starry-night/bgEuwDxel93-Pg?hl=en-GB&amp;avm=2">https://artsandculture.google.com/asset/the-starry-night/bgEuwDxel93-Pg?hl=en-GB&amp;avm=2</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fkjysSiQ9sMkeXb_vHcALA.jpeg" /></figure><p><strong>Content Image:</strong></p><p><a href="https://www.flickr.com/photos/jeffdai/24778020652/">https://www.flickr.com/photos/jeffdai/24778020652/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VdKEaj5jo0DxJnGS1C656g.jpeg" /></figure><p><strong>Result Image:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*t7w9PH_gN8fJoO9QFSmRrg.png" /></figure><h3>Style transfer on Images using “Justin Johnson”s paper on “Perceptual Losses for Real-Time Style Transfer and Super Resolution ”</h3><p>In this approach we used a FeedForward network with Perceptual Loss function and by optimizing this perceptual loss we will be making the produced image better.</p><p>“Perceptual Loss” is the loss in order of higher level features of the image instead of pixel by pixel loss.</p><p>Link to Research paper: <a href="https://cs.stanford.edu/people/jcjohns/papers/eccv16/JohnsonECCV16.pdf">https://cs.stanford.edu/people/jcjohns/papers/eccv16/JohnsonECCV16.pdf</a></p><h3>Process:</h3><p>We train feed-forward transformation networks for image transformation tasks, but rather than using per-pixel loss functions depending only on low-level pixel information, we train our networks using perceptual loss functions that depend on high-level features from a pretrained loss network. During training, perceptual losses measure image similarities more robustly than per-pixel losses, and at test-time the transformation networks run in real-time.</p><p>I have implemented this approach for rendering video frames also so, we can also apply style transfer on live video captured from the webcams.</p><h3>Major Advantage:</h3><p>The overall process is very fast and takes hardly 1 second for a single image thus creating real time applications is possible using this approach.</p><h3>Major Disadvantage:</h3><p>This process will need the model to be trained on any new style image if that is requited , this process is a bit tedious but after this the weights can be directly used and the process is accelerated in comparison to previous process.</p><p>This approach is much suitable for developing applications like Prisma app as the no of style images there will be fixed.</p><h3>Code Available at:</h3><p><a href="https://github.com/SudhanshuMishra8826/Style-Transfer-On-Images/tree/master/Algo2">SudhanshuMishra8826/Style-Transfer-On-Images</a></p><h3>Steps For Execution (for single static image):</h3><ol><li>Open Zip2 and extract all the files</li><li>Install all dependencies using requirement.txt file</li><li>Open styleTransfer.py file</li><li>Change the content image path as per your desire in line no 8</li><li>Change the style model path if required (by default <strong>Starry Night</strong> image by <strong>Vincent Van Gough</strong> is used) in line no 6 (few models of popular images are there available in Models folder.<strong>(Skippable Step)</strong></li><li>Run the program using “Python styleTransfer.py” Command in the terminal</li></ol><h3>Steps For Execution (for WebCam / Video):</h3><ol><li>Open Zip2 and extract all the files</li><li>Install all dependencies using requirement.txt file</li><li>Open styleTransferOnVideos.py file</li><li>Change the style model path if required (by default <strong>Starry Night</strong> image by <strong>Vincent Van Gough</strong> is used) in line no 8 (few models of popular images are there available in Models folder.<strong>(Skippable Step)</strong></li><li>Run the program using “Python styleTransferOnVideos.py” Command in the terminal</li><li>Style transferred webcam window will appear on the screen.</li></ol><h3>Test Results:</h3><p>I tested using <em>The Starry Night </em>painting by <strong>Vincent van Gogh</strong> (suggested) as style image and an Picture of a valley in a hilly area as content image.</p><p><strong>Style Image:</strong></p><p><a href="https://artsandculture.google.com/asset/the-starry-night/bgEuwDxel93-Pg?hl=en-GB&amp;avm=2">https://artsandculture.google.com/asset/the-starry-night/bgEuwDxel93-Pg?hl=en-GB&amp;avm=2</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fkjysSiQ9sMkeXb_vHcALA.jpeg" /></figure><p><strong>Content Image:</strong></p><p><a href="https://www.flickr.com/photos/jeffdai/24778020652/">https://www.flickr.com/photos/jeffdai/24778020652/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VdKEaj5jo0DxJnGS1C656g.jpeg" /></figure><p><strong>Result:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/1*n2Df_XN_Swr3L1SfVVeX1g.png" /></figure><p><strong>Summary:</strong></p><p>In my point of view both the approaches have their own advantages and disadvantages like the first one is slow but will directly work for all images where as second one is fast but it is not directly feasible with any image.</p><p>It will surely depend on the type of application that is being developed that which algorithm should be used.</p><p>In my personal opinion i like the second approach more as it is simple and fast and gives real-time result.</p><h3><strong>Find out more such projects on my github :</strong></h3><p><a href="https://github.com/SudhanshuMishra8826">SudhanshuMishra8826 - Overview</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=70bff2301e34" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>