<?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 Sam Sterckval on Medium]]></title>
        <description><![CDATA[Stories by Sam Sterckval on Medium]]></description>
        <link>https://medium.com/@samsterckval?source=rss-d6fce4a2765e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*mB4YFuj44HKVwOnXm-GmQQ.jpeg</url>
            <title>Stories by Sam Sterckval on Medium</title>
            <link>https://medium.com/@samsterckval?source=rss-d6fce4a2765e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 11:50:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@samsterckval/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[Google Coral Edge TPU vs NVIDIA Jetson Nano: A quick deep dive into EdgeAI performance]]></title>
            <link>https://medium.com/@samsterckval/google-coral-edge-tpu-vs-nvidia-jetson-nano-a-quick-deep-dive-into-edgeai-performance-bc7860b8d87a?source=rss-d6fce4a2765e------2</link>
            <guid isPermaLink="false">https://medium.com/p/bc7860b8d87a</guid>
            <category><![CDATA[edge-ai]]></category>
            <category><![CDATA[edge-computing]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Sam Sterckval]]></dc:creator>
            <pubDate>Mon, 15 Apr 2019 10:54:01 GMT</pubDate>
            <atom:updated>2019-05-06T22:00:28.983Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently I’ve been reading, testing, and writing a bit about edge computing (like <a href="https://blog.raccoons.be/edgy-with-coral-edge-tpu">here</a>, and <a href="https://blog.raccoons.be/nvidia-jetson-nano">here</a>), with the main focus on edge AI. With cool new hardware hitting the shelves recently, I was eager to compare performance of the new platforms, and even test them against high performance systems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BdagUTpzm1trtmOE1Sy2qQ.png" /></figure><p><strong>The Hardware</strong></p><p>The main devices I’m interested in are the new NVIDIA Jetson Nano(128CUDA)and the Google Coral Edge TPU (USB Accelerator), and I will also be testing an i7-7700K + GTX1080(2560CUDA), a Raspberry Pi 3B+, and my own old workhorse, a 2014 macbook pro, containing an i7–4870HQ(without CUDA enabled cores).</p><p><strong>The Software</strong></p><p>I will be using <a href="https://arxiv.org/abs/1801.04381">MobileNetV2</a> as a classifier, pre trained on the imagenet dataset. I use this model straight from Keras, which I use with TensorFlow backend. With the floating point weights for the GPU’s, and an 8-bit quantised tflite version of this for the CPU’s and the Coral Edge TPU. (If it is unclear why I don’t use an 8-bit model for the GPU’s, keep on reading, I will talk about this). First, the model and an image of a magpie are loaded. I then execute 1 prediction as a warmup (because I noticed the first prediction was always a lot slower then all the next ones). I let it sleep for 1s, so that all threads are certainly finished. Then the script goes for it, and does 250 classifications of that same image. By using the same image for all classifications, we assure that it will stay close to the databus throughout the test. After all, we are interested in inference speeds, not the ability to load random data faster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/224/1*-GHc6bwGr9N4nQ3tR5Zgig.jpeg" /><figcaption>Magpie, If you’re from GB, don’t forget to salute!</figcaption></figure><p><strong>Straight to the performance point</strong></p><p>Nobody likes waiting, and let’s be honest, most of you will mainly be interested in the results, so here we go :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r9IQczcoCGd0N3naNtU2dg.png" /></figure><p>The scoring with the quantized tflite model for CPU was different, but it always seemed to return the same prediction as the others, so I guess that’s something weird in the model, and I’m pretty sure it doesn’t affect performance.</p><p>Now, because the results are so different for different platforms, it’s kind of hard to visualise, so here are a few graphs, choose your favourite…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jG_4RmP_9ldVRLLNJJqU5g.png" /><figcaption>Linear scale, FPS</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HL5VvzvSWvyJXLjYLH9X_Q.png" /><figcaption>Logarithmic scale, FPS</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ihim2_Vai99pNI9LkoRoZA.png" /><figcaption>Linear scale, inference time (250x)</figcaption></figure><p><em>Update coming soon : I am still trying to get MobileNetV2 working with TensorRT FP16 optimisation, for now only MobileNetV1 works, but we can already see a speedup of about 3.</em></p><p><strong>Analysis</strong></p><p>Straight away, there are 3 bars in the first graph that jump into view. (Yes, the first graph, linear scale fps, is my favourite, because it shows the difference in the high performance results) Of these 3 bars, 2 of them where achieved by the Google Coral Edge TPU USB accelerator, and the 3rd one was a full blown NVIDIA GTX1080 assisted by an Intel i7–7700K. Look a bit closer, and you’ll see the GTX1080 actually got beaten by the Coral. Let that sink in for a few seconds, and then prepare to be blown away, because that GTX1080 draws a maximum of <strong>180W</strong>, which is absolutely HUGE compared to the Corals <strong>2.5W</strong>.</p><p>You managed to stand up again already? Ok, let’s go on:</p><p>Next thing we see, is that the NVIDIA Jetson Nano isn’t scoring well at all. Although it has a CUDA enabled GPU, it’s really not much faster then my old i7–4870HQ. But that’s the catch, ‘not much <strong>faster</strong>’, it still is faster then a 50W, quad-core, hyperthreading CPU. From a few years back, true, but still. The Jetson Nano never could have consumed more then a short term average of 12.5W, because that’s what I’m powering it with. That’s a 75% power <strong>reduction</strong>, with a 10% performance <strong>increase.</strong></p><p>Clearly, the Raspberry Pi on it’s own isn’t anything impressive, not with the floating point model, and still not really anything useful with the quantised model. But hey, I had the files ready anyway, and it was capable of running the tests, so more is always better right? And still kind of interesting because it shows the difference between the ARM Cortex A53 in the Pi, and the A57 in the Jetson Nano.</p><p><strong>NVIDIA Jetson Nano</strong></p><p>So the Jetson Nano isn’t pumping out impressive FPS rates with the MobileNetV2 classifier, but as I already stated, that doesn’t mean it isn’t a great piece of useful engineering. It’s cheap, it doesn’t need a shitload of energy to run, and maybe the most important property is that it runs TensorFlow-gpu (or any other ML platform) like any other machine you’ve always been using before. As long as your script isn’t diving too deep into CPU architectures, you can run the exact same script you would on an i7+CUDA GPU, also for training! I do still feel like NVIDIA should preload L4T with TensorFlow, but I’ll try not to rage about this any longer. After all, they have a nice <a href="https://docs.nvidia.com/deeplearning/dgx/install-tf-xavier/index.html">explanation</a> on how to install it (don’t be fooled though, TensorFlow 1.12 is <strong>not</strong> supported, only 1.13.1).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*DXXg-BnIEJ7N4iOjwj_thw.png" /><figcaption>Source:NVIDIA</figcaption></figure><p><strong>Google Coral Edge TPU</strong></p><p>Ok I have a big love for nicely engineered and high efficiency specific electronic devices, so I’m maybe not perfectly objective. But this thing… It’s a thing of absolute beauty!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*Jryu97esXxkonWBj4t62fw.jpeg" /><figcaption>Penny for scale, source:Google</figcaption></figure><p>The Edge TPU is what we call an “ASIC” (Application Specific Integrated Circuit), which means that it has a combination of small electronic parts such as FET’s and capacities burned directly on the silicon layer, in such a way that it does exactly what it needs to do to speed up inference.</p><p>Inference, yes, the Edge TPU is not able to perform backwards propagation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LUG7VruXK4T79l2iJHG3iQ.png" /><figcaption>Coral USB Accelerator</figcaption></figure><p>The logic behind this sounds more complex than it is though. (Actually creating the hardware, and making it work, is a whole different thing, and is very, very complex. But the logic functions are much simpler). Next image shows the basic principle around which the Edge TPU has been designed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*l4AtQE8zmxX_f85DoddoDA.png" /><figcaption>Source:Google</figcaption></figure><p>A net like MobileNetV2 is consisting mostly of convolutions with activation layers behind. A convolution is stated as :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-IQZ0rtRVBaIzp3YG4kOkg.png" /><figcaption>Convolution</figcaption></figure><p>Which means nothing more then multiplying each element(pixel) of the image with every pixel of the kernel, and then adding these results up, to create a new ‘image’(feature map). That is exactly what the main component of the Edge TPU was meant for. Multiplying everything at the same time, then adding it all up at insane speeds. There is no ‘CPU’ behind this, it just does that whenever you pump data into the buffers on the left. If you’re really interested in how this works, look up “Digital Circuit” and “FPGA”, and you’ll probably find enough information to keep you busy for the next few months. Sometimes rather complex to start with, but really really interesting!</p><p>But this is exactly why the Coral is in such a different league when comparing performance/Watt numbers, it is a bunch of electronics, designed to do exactly the bitwise operations needed, basically no overhead at all.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*hBE6Jjos6SI5UfU7MIw3eQ.png" /><figcaption>Internal schematic of a Google Cloud TPU — Source:Google</figcaption></figure><p><strong>Why no 8-bit model for GPU?</strong></p><p>A GPU is inherently designed as a fine grained parallel float calculator. So using floats is exactly what it was created for, and what it is good at. The Edge TPU has been designed to do 8-bit stuff, and CPU’s have clever ways of being faster with 8-bit stuff than full bitwidth floats because they have to deal with this in a lot of cases.</p><p><strong>Why MobileNetV2?</strong></p><p>I could give you a lot of reason’s why MobileNetV2 is a good model, but the main reason is, it’s one of the pre-compiled models that Google made available for the Edge TPU.</p><p><strong>What else is available on the Edge TPU?</strong></p><p>It used to be just MobileNet and Inception in their different versions, but as of the end of last week, Google pushed an update which allowed us to <a href="https://coral.withgoogle.com/web-compiler/">compile</a> custom TensorFlow Lite models. But the limit is, and will probably always be, TensorFlow Lite models. That is different with the Jetson Nano, that thing runs anything you can imagine.</p><p><strong>Raspberry Pi + Coral vs the rest</strong></p><p>Why does the Coral seem so much slower when connected to a Raspberry Pi? Answer is simple and straight forward : Raspberry Pi has only USB 2.0 ports, the rest has USB 3.0 ports. And since we can see the i7–7700K is faster with the Coral then the Jetson Nano, but still doesn’t seem to score as well as the Coral Dev Board did when NVIDIA tested it, we can conclude the bottleneck is data rate, and not the Edge TPU.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/1*nsvF5XZd-GDwPmgJe3XOBA.png" /><figcaption>Source:NVIDIA</figcaption></figure><p><strong>Fading away</strong></p><p>Ok, I’m the last one left in the office by now, I think this has been long enough for me, and probably for you as well. I have been absolutely blown away by the power of the Google Coral Edge TPU. But to me, the most interesting setup here was the NVIDIA Jetson Nano in combination with the Coral USB Accelerator. I will most certainly use that setup, it feels like a dream to work with.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TxsjFf9RdIGFAeLIHTDlNQ.png" /></figure><p>I hope you had an interesting read. If there are any remarks or questions, do not hesitate to contact me. As usual, this is also where I tell you I will probably write something new soon, so yeah, keep your eyes open and all that. Cheers!</p><figure><a href="https://usejournal.com/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=tech&amp;utm_content=guest_post_image"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PYxBP_WV7LI6zc-zdUkNqQ.png" /></a></figure><p>📝 Read this story later in <a href="https://usejournal.com/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=tech&amp;utm_content=guest_post_read_later_text">Journal</a>.</p><p>👩‍💻 Wake up every Sunday morning to the week’s most noteworthy stories in Tech waiting in your inbox. <a href="https://usejournal.com/newsletter/noteworthy-in-tech/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=tech&amp;utm_content=guest_post_text">Read the Noteworthy in Tech newsletter</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc7860b8d87a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Falling into AI, and the enablers called PowerAI and Brainjar]]></title>
            <link>https://medium.com/@samsterckval/falling-into-ai-and-the-enablers-called-powerai-and-brainjar-f08e7a885096?source=rss-d6fce4a2765e------2</link>
            <guid isPermaLink="false">https://medium.com/p/f08e7a885096</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[ibm]]></category>
            <category><![CDATA[brainjar]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Sam Sterckval]]></dc:creator>
            <pubDate>Sun, 17 Mar 2019 11:08:57 GMT</pubDate>
            <atom:updated>2019-04-01T06:39:28.522Z</atom:updated>
            <content:encoded><![CDATA[<p>A few months ago, during my last year of engineering studies, I was handed the opportunity to start a small AI driven project. It sounded hugely interesting, so I grabbed the opportunity with both hands. But then the doubt feelings started to rise, I had barely any knowledge about AI at all…</p><p><strong>The start</strong></p><p>At this point in time, the biology department of Vrije Universiteit Brussel was doing tests with different kind of bacteria in petri dishes (please do not ask me which or why, although they tried to explain it multiple times, I seemed to have not exactly the strongest understanding capabilities in biology). The main idea of the test was to contaminate some petri dish with a bacteria, and observe how fast new cell colonies would form, thus counting the amount of cell colonies in a petri dish.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*vp7YB1sVOY7cfYKwRhtNCw.png" /><figcaption>Example of a petri dish with a decent number of cell colonies</figcaption></figure><p>This was done by hand, counting each colony and putting a blue dot above it so they would remember which was already counted. As you might expect, very time consuming, and not very interesting work. They estimated their own precision to be around 80%, I had a feeling that this could be done better by a machine (things still seemed simple in my head back then).</p><p><strong>Getting to know AI</strong></p><p>I knew the first thing I had to do was gathering more knowledge about AI, and especially Convolutional Neural Networks, since these are the goto architecture for object detection and image recognition. So I spend a few days watching YouTube videos and reading papers about them, until I felt it was the time to start experimenting with Keras and Tensorflow to get familiar with these frameworks.</p><p><strong>Problems arising</strong></p><p>At the same time, I started to realise that I needed a lot of data to make this work, like, a LOT more than I expected, and an even bigger contrast to what was available, the latter being none… This seemed a disaster for the project, since I only had a few weeks to finish it, and still a lot of other work to do simultaneously. So I decided to make a small iOS app to allow the biology department to make pictures the same way it would later be done to predict the number of colonies in the dish, this meant, of-course, learning iOS app development and Swift. Luckily there is a lot of content out there to make this a quick job.</p><p><strong>Moving on with AI</strong></p><p>Meanwhile I was starting to get the hang of Keras, and started to have an understanding of what to look for in a model, but there was still a lot more to learn, and with the examples and tests getting exponentially more complex, I started to hit a rather unpleasant wall, namely the processing power of my own computer. I was trying out different things in Keras, with some needing training of up to 2 days, which was starting to become a real pain in the … with all the other stuff for other courses that also had to be done on the same computer, which was clearly unusable during training periods. This is where Brainjar and IBM jumped to the rescue.</p><p><strong>Brainjar</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/843/1*oNjP1bPyLw_GVb1OCK0b-Q.png" /></figure><p>Brainjar, a company focussing on artificial intelligence, were so kind to invite me into their office, and give me a space to work on the project, between a whole team of AI specialists. This was a wonderful experience since it not only brought me a lot of knowledge, but also an insight of a professional environment, which is always welcome for a student.</p><p>The extra knowledge was awesome, but didn’t fix my computing power deficit… Luckily, Brainjar also brought me into contact with IBM, from which they where using a PowerAI machine. After a quick pitch of the project to IBM, they seemed interested, and allowed me to use the PowerAI to enable me to train and test a bit more than with my own computer.</p><p><strong>PowerAI</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*dG222j4Sq-jbK29pMS7vAQ.png" /></figure><p>Clearly I was siked and feeling curious about that supercomputer called PowerAI (the name alone already made me feel like a 5 year old that received a new toy). Once I started testing on it, I was blown away by the power it was packing. Tests taking up multiple days on my MacBook, suddenly only took me a few hours to train on this powerhouse. Keras has built-in support to train on multiple GPU’s, which meant no worries at all to port anything I was doing. This huge power increase meant I quickly got to the point where I decided to actually take on the project itself.</p><p><strong>Choosing a model</strong></p><p>My first idea was to train a model, and implement it on the edge in the form of a CoreML model in an iOS app. Apple’s coremltools state that Keras models can be converted, so that sounded like a good plan. Which meant I needed a lightweight model (we don’t want to wait too long for a result, and we don’t want to drain a whole battery for every picture we want to analyse). After a bit of looking around, I decided to go for the SqueezeDet architecture, described in the <a href="https://arxiv.org/abs/1612.01051"><strong>arXiv:1612.01051</strong></a><strong> </strong>paper.</p><p><strong>First real tests</strong></p><p>Since having a dataset with petri dishes was still a long way down the road, I started my first tests with the KITTI dataset used for the benchmarking of the model. I did a few different training runs, to quickly find out that it reached a pretty decent accuracy after even as few as 10 training runs. And since I was planning on using a different dataset anyway, I usually did trainings of 10–15 runs only. Having the PowerAI meant I could do these in about 1h, literally during lunch…</p><p><strong>Porting to CoreML</strong></p><p>All was going well at this point in time, too well I guess, because the next phase in the project was one of the more heartbreaking moments I had lately. I got the model trough coremltools, which seemed to tell me all was well, but when I ran an image through the ported model, it seemed that half of the returned feature vector values were empty. I spend the next 2h trying a million different things, supposing I was the one to blame and made a stupid mistake somewhere down the line(somewhere deep down I still think I am the one to blame…). After a while I gave up as I realised that I only had a few days left to find an alternative. I told myself it could be due to the “fire” layers, which split and concatenate the intermediate data in the model, which might not be working so well when porting to CoreML.</p><p><strong>What now?</strong></p><p>What could I do? Try a different model, like YOLO, which had been proven to work as a CoreML model. Or I could switch things up, and run the model as a cloud service, and have the app send the image to the cloud and receive the result. I chose the latter one, since I am still far from confident with AI. This meant the implementation of the model was also much closer to the one from omni:us Engineering, who made a Keras implementation of the SqueezeDet model, found on their github <a href="https://github.com/omni-us/squeezedet-keras">https://github.com/omni-us/squeezedet-keras</a>.</p><p>Quickly I got to the point where I was able to successfully achieve predictions on a server, through a small and simple Flask script to interface with it from anywhere through HTTP.</p><p><strong>Disaster</strong></p><p>With the technical stuff mostly working, I had 1 week left before the end of the project, so I ran back to our biology department to see if they had any luck with making pictures. But when I arrived, it became clear that the short time in which this all had to happen was not realistic. They had sub-10 petri dishes ready since the start of the project, which would clearly not be enough to train the model. I did some tests with some data augmentation, but nothing got me any kind of decent results.</p><p>Unfortunate, but I guess life is not all sunshine and rainbows. And with the deadline being around the corner, I decided to end the official project with only the ability to find cars in an image, which still got me through the class easily, but I felt kind of disappointed by not having a real result yet. Nevertheless, I will not drop this, and I will have contact with the biology department from the moment they have more pictures, to still try and get a real result out of this. When that time hits, I will follow this up with the numbers and some examples!</p><p><strong>Conclusion</strong></p><p>This project was the whole package. The excitement, the knowledge, the challenge, the struggle, the hype and the disappointment… At the end, I had mostly great fun in learning about AI, working together with Brainjar, and experiencing the joy of working with tools like the IBM PowerAI. In total this project took me about 12 days, with 15 KITTI training runs on the SqueezeDet model taking up to 2 days on my own MacBook, this wouldn’t even have been close to possible without the shear power brought to this project by IBM. And having the guys from Brainjar around me to help me find my rookie mistakes, and assisting me in learning about AI, was a big reason this project got to the point it is, and boy did they make it fun!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/225/1*RmcwIsUDpomEiYe7LS9i7Q.png" /></figure><p>So I would love to end this with a big shoutout and thank you to IBM and Brainjar! I hope we meet again soon!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f08e7a885096" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>