{"id":7038,"date":"2020-08-03T10:10:58","date_gmt":"2020-08-03T08:10:58","guid":{"rendered":"https:\/\/www.codemotion.com\/magazine\/?p=7038"},"modified":"2022-01-05T20:05:27","modified_gmt":"2022-01-05T19:05:27","slug":"edge-machine-learning","status":"publish","type":"post","link":"https:\/\/www.codemotion.com\/magazine\/ai-ml\/machine-learning\/edge-machine-learning\/","title":{"rendered":"Getting started with edge machine learning"},"content":{"rendered":"\t\t\t\t<div class=\"wp-block-uagb-table-of-contents uagb-toc__align-left uagb-toc__columns-1  uagb-block-a55eed43      \"\n\t\t\t\t\tdata-scroll= \"1\"\n\t\t\t\t\tdata-offset= \"30\"\n\t\t\t\t\tstyle=\"\"\n\t\t\t\t>\n\t\t\t\t<div class=\"uagb-toc__wrap\">\n\t\t\t\t\t\t<div class=\"uagb-toc__title\">\n\t\t\t\t\t\t\tTable Of Contents\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"uagb-toc__list-wrap \">\n\t\t\t\t\t\t<ol class=\"uagb-toc__list\"><li class=\"uagb-toc__list\"><a href=\"#introduction\" class=\"uagb-toc-link__trigger\">Introduction<\/a><li class=\"uagb-toc__list\"><a href=\"#a-typical-ml-workflow\" class=\"uagb-toc-link__trigger\">A typical ML workflow<\/a><li class=\"uagb-toc__list\"><a href=\"#the-hardware-requirements-for-edge-ml\" class=\"uagb-toc-link__trigger\">The hardware requirements for edge ML\u00a0<\/a><li class=\"uagb-toc__list\"><a href=\"#tensorflow-lite-enabling-ml-at-the-edge\" class=\"uagb-toc-link__trigger\">TensorFlow Lite: enabling ML at the edge<\/a><li class=\"uagb-toc__list\"><a href=\"#how-to-deploy-a-tensorflow-lite-model\" class=\"uagb-toc-link__trigger\">How to deploy a TensorFlow Lite model<\/a><li class=\"uagb-toc__list\"><a href=\"#conclusions\" class=\"uagb-toc-link__trigger\">Conclusions<\/a><\/ol>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\n\n\n<p>In this six-article series from <a aria-label=\"undefined (opens in a new tab)\" style=\"user-select: auto;\" href=\"https:\/\/eu.mouser.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Mouser Electronics<\/a>, we explore why <span style=\"user-select: auto;\" id=\"urn:enhancement-965286fe\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/artificial_intelligence\">AI<\/span> is moving to the network edge and the <span style=\"user-select: auto;\" id=\"urn:enhancement-c8ec66cb\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/technology\">technology<\/span> that\u2019s making it possible. <a style=\"user-select: auto;\" href=\"https:\/\/www.codemotion.com\/magazine\/dev-hub\/machine-learning-dev\/the-cutting-edge-of-real-time-ai\/\">The first article<\/a> examined why <span style=\"user-select: auto;\" id=\"urn:enhancement-6c0bc5c6\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/artificial_intelligence\">AI<\/span> needs to move to the edge. Here, we dive in to the hardware and tools that are making edge machine learning a reality.&nbsp;<\/p>\n\n\n\n<div class=\"uagb-cta__outer-wrap uagb-block-96d7350c\"><div class=\"uagb-cta__content-wrap uagb-cta__block uagb-cta__icon-position-right uagb-cta__content-right uagb-cta__content-stacked-tablet uagb-cta__button-valign-middle uagb-cta__button-type-none \"><div class=\"uagb-cta__left-right-wrap\"><div class=\"uagb-cta__content\"><div class=\"uagb-cta__title-wrap\"><h4 class=\"uagb-cta__title\">RELATED CONTENT<\/h4><\/div><div class=\"uagb-cta-text-wrap\"><p class=\"uagb-cta__desc\"><a href=\"https:\/\/www.codemotion.com\/magazine\/dev-hub\/machine-learning-dev\/the-cutting-edge-of-real-time-ai\/\" target=\"_blank\" aria-label=\"undefined (opens in a new tab)\" rel=\"noreferrer noopener\">The cutting edge of real-time AI<\/a><\/p><\/div><\/div><div class=\"uagb-cta__link-wrapper uagb-cta__block-link-style\"><\/div><\/div><\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p><span id=\"urn:enhancement-8cb24e2e\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/artificial_intelligence\">Artificial intelligence<\/span> is primarily driven by <span id=\"urn:enhancement-3ba00002\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/machine_learning\">machine learning<\/span> models. Typically, these <span id=\"urn:enhancement-27f173ef\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/scientific_modelling\">models<\/span> are extremely processor-intensive, so they tend to be run in <span id=\"urn:enhancement-dc6d250e\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/data\">data<\/span> centres. However, as we <a href=\"https:\/\/www.codemotion.com\/magazine\/dev-hub\/machine-learning-dev\/the-cutting-edge-of-real-time-ai\/\" target=\"_blank\" aria-label=\"undefined (opens in a new tab)\" rel=\"noreferrer noopener\">saw already<\/a>, this causes issues for some <span id=\"urn:enhancement-8d5bd0e7\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/applications_of_artificial_intelligence\">AI applications<\/span>. Running your ML <span id=\"urn:enhancement-f092891e\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/conceptual_model\">model<\/span> in the core of the network creates four issues:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><strong><span id=\"urn:local-annotation-850970\" class=\"textannotation disambiguated\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/latency_engineering\">Latency<\/span><\/strong>. More and more AI applications need to work in real-time. These range from self-driving vehicles to real-time facial recognition. Real-time implies a maximum latency of the order of 1ms. Clearly, that\u2019s only possible if your ML models are running at the network edge.<\/li><li><strong>Not-spots<\/strong>. Many industrial AI applications have to run in environments with limited or no network access. Other times, local security policies may block access to outside networks. In both these cases, your only option is edge ML.<\/li><li><strong><span id=\"urn:local-annotation-194672\" class=\"textannotation disambiguated\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/computer_security\">Security<\/span> and <span id=\"urn:local-annotation-550574\" class=\"textannotation disambiguated\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/privacy\">privacy<\/span><\/strong>. AI applications often handle sensitive data. This ranges from biometric data (e.g. face pictures) to sensitive medical data. Laws like <span id=\"urn:local-annotation-514951\" class=\"textannotation disambiguated\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/european_general_data_protection_regulation\">GDPR<\/span> mean it is often easier (and more secure) to handle this sort of data locally, rather than send it across the network.&nbsp;<\/li><li><strong>Costs<\/strong>. All major cloud providers offer specialist virtual machines designed to run complex ML models at scale. However, these instances are generally quite expensive. Nowadays, it is often preferable to try and run your models at the edge, thus saving you money.<\/li><\/ol>\n\n\n\n<p>So, edge machine <span id=\"urn:enhancement-7a330114\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/learning\">learning<\/span> is definitely desirable. But how do you actually go about doing it? First, we need to understand what it takes to create a machine <span id=\"urn:enhancement-a4ff4a0a\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/learning\">learning<\/span> <span id=\"urn:enhancement-a3681d77\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/conceptual_model\">model<\/span>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">A typical ML workflow<\/h2>\n\n\n\n<p>There are three main forms of machine <span id=\"urn:enhancement-4d095dbb\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/learning\">learning<\/span>. These are <a href=\"https:\/\/en.wikipedia.org\/wiki\/Supervised_learning\" target=\"_blank\" aria-label=\"undefined (opens in a new tab)\" rel=\"noreferrer noopener\">supervised learning<\/a>, <a href=\"https:\/\/en.wikipedia.org\/wiki\/Unsupervised_learning\" target=\"_blank\" aria-label=\"undefined (opens in a new tab)\" rel=\"noreferrer noopener\">unsupervised learning<\/a> and <a href=\"https:\/\/en.wikipedia.org\/wiki\/Reinforcement_learning\" target=\"_blank\" aria-label=\"undefined (opens in a new tab)\" rel=\"noreferrer noopener\">reinforcement learning<\/a>. The most common is probably supervised <span id=\"urn:enhancement-9d87f053\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/learning\">learning<\/span>, so we will focus on this. In all cases, you are trying to teach a <span id=\"urn:enhancement-8f414c2f\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/computer\">computer<\/span> to identify interesting <span id=\"urn:enhancement-2b22b62b\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/pattern\">patterns<\/span> in <span id=\"urn:enhancement-fc9ef08e\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/data\">data<\/span>. In supervised <span id=\"urn:enhancement-fda127d\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/learning\">learning<\/span>, <a href=\"https:\/\/www.codemotion.com\/magazine\/dev-hub\/machine-learning-dev\/understanding-ai-training\/\">you provide a set of labelled data<\/a>. The <span id=\"urn:enhancement-c706ec1a\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/computer\">computer<\/span> learns to identify the <span id=\"urn:enhancement-26c4f4d2\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/data\">data<\/span> <span id=\"urn:enhancement-cc99d2fa\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/feature_machine_learning\">features<\/span> that match with each <span id=\"urn:enhancement-86207ee6\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/label\">label<\/span>. <a href=\"https:\/\/www.codemotion.com\/magazine\/dev-hub\/machine-learning-dev\/understanding-ai-inference\/\">You can then get the computer to correctly label new data it sees<\/a>. As a concrete example, you might provide your ML <span id=\"urn:enhancement-3f56a1f8\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/conceptual_model\">model<\/span> with a million photos containing cats. The <span id=\"urn:enhancement-27b85769\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/conceptual_model\">model<\/span> <span id=\"urn:enhancement-d4e8b0fc\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/learning\">learns<\/span> to identify cats and can now use <span id=\"urn:enhancement-9996631e\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/inference\">inference<\/span> to tell you whether a new photo also contains a cat.&nbsp;<\/p>\n\n\n\n<p>There are seven steps involved in training your <span id=\"urn:enhancement-a4e9bf04\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/conceptual_model\">model<\/span>:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><strong>Data ingestion<\/strong>. This consists of gathering all your raw labelled data in one location (typically a data lake in the cloud).<\/li><li><strong>Feature engineering<\/strong>. Here, you clean up your data in order to simplify the number of features. This includes removing features that only exist in some data, merging other features, and deleting irrelevant features.<\/li><li><strong>Model selection<\/strong>. Nowadays, there are many thousands of different ML models available. To get some idea of the number, take a look at the <a href=\"https:\/\/modelzoo.co\/\">Model Zoo<\/a>. Each model is optimised for a particular use. Data scientists use their knowledge and experience to select a suitable model for each dataset.<\/li><li><strong>Training<\/strong>. This is the key step where your model is trained. Training is an incremental process that can take some time. You typically use 70-75% of your data for training. The rest is then used for evaluation and optimisation.&nbsp;<\/li><li><strong>Evaluate<\/strong>. At this stage, you test whether your model performs well. There are a number of different metrics to assess the model. These include using a <a href=\"https:\/\/www.geeksforgeeks.org\/confusion-matrix-machine-learning\/\">confusion matrix<\/a> and the <a href=\"https:\/\/en.wikipedia.org\/wiki\/F1_score\">F1 score<\/a>. What you must avoid is over-fitting of your model. This happens when your model becomes too good at identifying the training data and loses the ability to recognise interesting features in other data.<\/li><li><strong>Hyperparameter tuning<\/strong>. This involves refining the model by tweaking the hyperparameters to improve accuracy. Common approaches include gradient-descent and Bayesian optimisation.<\/li><li><strong><span id=\"urn:local-annotation-56562\" class=\"textannotation disambiguated\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/software_deployment\">Deploy<\/span><\/strong>. The final step is to deploy your trained model. This is where things get interesting for edge ML. Traditionally, your model is deployed in a data centre or on a server. However, in edge ML, you are typically deploying it on a microcontroller.<\/li><\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">What forms of model are suitable for edge ML?<\/h3>\n\n\n\n<p>There are several categories of ML models that are ideal for running at the edge. These include:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong><span id=\"urn:local-annotation-687547\" class=\"textannotation disambiguated\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/image_recognition\">Image recognition<\/span><\/strong>. This is important for applications including facial recognition, self-driving cars, and automated pick-and-place machines. Usually, image recognition relies on neural networks. These need processors or microcontrollers that are able to cope with parallel operations such as <a href=\"https:\/\/eu.mouser.com\/new\/intel\/intel-neural-compute-stick-2\/\" target=\"_blank\" aria-label=\"undefined (opens in a new tab)\" rel=\"noreferrer noopener\">Intel\u2019s Neural Compute Stick<\/a>, used in this Facial Recognition project on <a href=\"https:\/\/eu.mouser.com\/applications\/empower-emotions-physical-world\/\" target=\"_blank\" aria-label=\"undefined (opens in a new tab)\" rel=\"noreferrer noopener\">Mouser\u2019s Open Source Project pages.<\/a><\/li><li><strong><span id=\"urn:local-annotation-329336\" class=\"textannotation disambiguated\" itemid=\"http:\/\/www.wikidata.org\/entity\/Q29397429\">Anomaly detection<\/span><\/strong>. Here you are trying to identify anomalies in your data. For instance, you might be listening to the sound of a pump engine in a mine. An impending issue, such as a failed bearing, will create an anomaly. Your model can detect this before it becomes a failure.<\/li><li><strong>Speech-to-text + <span id=\"urn:local-annotation-700978\" class=\"textannotation disambiguated\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/natural_language_processing\">NLP<\/span><\/strong>. Virtual assistants, like Alexa, rely on two technologies. Speech-to-text, converts your voice into text. Natural language processing (NLP) then parses this text to extract the meaning. Alexa devices usually offload this functionality to the cloud. The only part that is run locally is identifying the wake word (e.g. \u201cAlexa\u201d). However, this is a real limitation for virtual assistants.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">The hardware requirements for edge ML&nbsp;<\/h2>\n\n\n\n<p>So, now we come to the heart of this article: What are the <span id=\"urn:enhancement-2a349bea\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/requirement\">requirements<\/span> for deploying machine <span id=\"urn:enhancement-a0ba58d6\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/learning\">learning<\/span> at the edge? Well, firstly, you need to choose suitable hardware. Secondly, you need a machine learning framework that is optimised to run on that <span id=\"urn:enhancement-2316c57d\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/computer_hardware\">hardware<\/span>. Let\u2019s start by looking at the <span id=\"urn:enhancement-7cf4ddd6\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/computer_hardware\">hardware<\/span>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Processing power<\/h3>\n\n\n\n<p>As we saw in the last article, edge ML implies the need for significant processing power. Modern <span id=\"urn:enhancement-11c481c\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/server_computing\">servers<\/span> and <span id=\"urn:enhancement-3cb23ca2\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/desktop_computer\">desktop<\/span> machines have sufficient power to run most models, but they are not optimised for edge operations. What is really needed is a processor designed for <span id=\"urn:enhancement-b62ea4fd\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/embedded_system\">embedded<\/span> applications but with similar power to a <span id=\"urn:enhancement-b850dda5\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/desktop_computer\">desktop<\/span>. This rules out low-power microcontrollers and <span id=\"urn:enhancement-c3b1106\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/system_on_a_chip\">SoCs<\/span>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Power draw\/efficiency<\/h3>\n\n\n\n<p>Many edge ML applications are embedded. That means you have to be aware of the power needs and overall efficiency of the system. This rules out multicore CPUs since even the most efficient Intel processors usually consume\u00a010&#8217;s\u00a0of Watts. Instead, you have to look at options such as ARM processors or ATMega microcontrollers.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Architecture<\/h3>\n\n\n\n<p>Edge machine <span id=\"urn:enhancement-bb6093f8\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/learning\">learning<\/span> requires processors that are capable of running deep neural network models. These use large numbers of parallel operations, which is why cloud instances for machine <span id=\"urn:enhancement-204c739\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/learning\">learning<\/span> rely on <span id=\"urn:enhancement-9d1ee90\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/graphics_processing_unit_2\">GPUs<\/span> so heavily. Here, you are forced to make a compromise when you move to the edge. <span id=\"urn:enhancement-4cdfe8f1\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/graphics_processing_unit_2\">GPUs<\/span> are extremely power-hungry. You could try using <a href=\"https:\/\/www.codemotion.com\/magazine\/dev-hub\/machine-learning-dev\/fpgas-why-use-them\/\" target=\"_blank\" rel=\"noopener\">FPGAs<\/a>, but they also have issues. In practice, most <span id=\"urn:enhancement-70de3f8e\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/people\">people<\/span> end up using a processor optimised for <span id=\"urn:enhancement-c94325e3\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/mobile_computing\">mobile<\/span> use.&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Suitable MCUs<\/h3>\n\n\n\n<p>Taking all the above into account, your edge ML project will probably end up using an <span id=\"urn:enhancement-70144430\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/microcontroller\">MCU<\/span> based on an <span id=\"urn:enhancement-1fd33bf8\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/arm_architecture\">ARM<\/span> Cortex M series processor. There are a number of these on the market currently, with varying <span id=\"urn:enhancement-dfb7f186\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/computer_performance\">processing power<\/span> and capabilities. Here is a selection of development boards you can look at:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>Board<\/strong><\/td><td><strong>Processor<\/strong><\/td><td><strong>Core<\/strong><\/td><td><strong>Speed<\/strong><\/td><\/tr><tr><td><a href=\"https:\/\/eu.mouser.com\/new\/nxp-semiconductors\/nxp-mimxrt1050-evk\/\" target=\"_blank\" aria-label=\"undefined (opens in a new tab)\" rel=\"noreferrer noopener\">NXP i.MX RT1050 EVK<\/a>&nbsp;<\/td><td>MIMXRT1052DVL6A<\/td><td>Cortex-M7<\/td><td>Up to 600MHz<\/td><\/tr><tr><td><a href=\"https:\/\/eu.mouser.com\/new\/microchip\/microchip-sam-e54-xplained-pro\/\" target=\"_blank\" aria-label=\"undefined (opens in a new tab)\" rel=\"noreferrer noopener\">Microchip SAM E54 Xplained Pro<\/a><\/td><td>ATSAME54P20A<\/td><td>Cortex-M4<\/td><td>Up to 120MHz<\/td><\/tr><tr><td><a href=\"https:\/\/eu.mouser.com\/new\/infineon\/infineon-xmc4700-eval-kits\/\" target=\"_blank\" aria-label=\"undefined (opens in a new tab)\" rel=\"noreferrer noopener\">Infineon XMC4700 Relax Kit&nbsp;<\/a><\/td><td>XMC4700-F144<\/td><td>Cortex-M4<\/td><td>144MHz<\/td><\/tr><tr><td><a href=\"https:\/\/eu.mouser.com\/new\/silicon-labs\/silicon-labs-slstk3701a-kit\/\" target=\"_blank\" aria-label=\"undefined (opens in a new tab)\" rel=\"noreferrer noopener\">SiLabs SLSTK3701A starter kit<\/a><\/td><td>EFM32 Giant Gecko 11<\/td><td>Cortex-M4<\/td><td>72MHz<\/td><\/tr><tr><td><a href=\"https:\/\/eu.mouser.com\/new\/arduino\/arduino-nano-33-ble-sense\/\" target=\"_blank\" aria-label=\"undefined (opens in a new tab)\" rel=\"noreferrer noopener\">Arduino Nano 33 BLE Sense<\/a><\/td><td>nRF52840<\/td><td>Cortex-M4<\/td><td>64MHz<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">TensorFlow Lite: enabling ML at the edge<\/h2>\n\n\n\n<p>Now you have chosen your <span id=\"urn:enhancement-8e779702\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/computer_hardware\">hardware<\/span>, the next step is porting your ML <span id=\"urn:enhancement-7babaff0\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/conceptual_model\">model<\/span> to the edge. Fortunately, TensorFlow Lite makes this relatively easy. <span id=\"urn:enhancement-579cf8a3\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/tensorflow\">TensorFlow<\/span> was originally developed by <span id=\"urn:enhancement-6a656d8c\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/google\">Google<\/span>. They describe it as \u201can <span id=\"urn:enhancement-9282ba06\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/end-to-end_principle\">end-to-end<\/span> <span id=\"urn:enhancement-b34050ee\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/open_source\">open-source<\/span> platform for <span id=\"urn:enhancement-8fcf332d\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/machine_learning\">machine learning<\/span>.\u201d TensorFlow Lite is a version optimised for <span id=\"urn:enhancement-3745b26b\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/low-power_electronics\">low-power<\/span> <span id=\"urn:enhancement-52f9f0\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/information_appliance\">devices<\/span>, such as <span id=\"urn:enhancement-97f91885\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/mobile_computing\">mobile<\/span> phones and <span id=\"urn:enhancement-7c044c3c\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/embedded_system\">embedded<\/span> MCUs.&nbsp;<\/p>\n\n\n\n<p>TensorFlow Lite allows you to <span id=\"urn:enhancement-44f09773\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/performance\">perform<\/span> <span id=\"urn:enhancement-cbae197c\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/inference\">inference<\/span> in your end-<span id=\"urn:enhancement-4b5a7ef\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/computer_hardware\">device<\/span> using embedded <span id=\"urn:enhancement-7b948bdf\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/machine_learning\">machine learning<\/span> <span id=\"urn:enhancement-13b33cfb\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/conceptual_model\">models<\/span>. Importantly, it is optimised for <span id=\"urn:enhancement-de520630\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/information_appliance\">devices<\/span> with limited <span id=\"urn:enhancement-89ad3a61\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/resource\">resources<\/span>. It generates small <span id=\"urn:enhancement-f0b45e14\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/binary_file\">binaries<\/span>, making it ideal for <span id=\"urn:enhancement-b24ce59\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/embedded_software\">embedded applications<\/span>. However, it also supports <span id=\"urn:enhancement-fb48e4d5\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/hardware_acceleration\">hardware acceleration<\/span>, allowing it to offer real-time <span id=\"urn:enhancement-f0a2bde2\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/performance\">performance<\/span>. This makes it the ideal framework for ML at the edge.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">The limitations of TensorFlow Lite&nbsp;<\/h3>\n\n\n\n<p>TensorFlow Lite only supports the most common TensorFlow operations used in <span id=\"urn:enhancement-a6353504\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/inference\">inference<\/span> <span id=\"urn:enhancement-6f744dc\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/conceptual_model\">models<\/span>. This allows it to reduce the <span id=\"urn:enhancement-cf625168\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/memory_footprint\">footprint<\/span> of both the <span id=\"urn:enhancement-b13574fe\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/binary_file\">binary<\/span> and its core framework. It achieves this by simplifying TensorFlow <span id=\"urn:enhancement-7d4bb788\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/conceptual_model\">models<\/span>, eliding and fusing some operations and mapping the result to TensorFlow Lite operations. Some operations map directly. Others have strict usage requirements before they will map. However, not every TensorFlow operation has a counterpart in TensorFlow Lite. In some cases, it is possible to include the TensorFlow operator at the <span id=\"urn:enhancement-6a1658db\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/cost\">cost<\/span> of increasing the binary size. But there is no support at all for some operators, such as <code>tf.depth_to_space<\/code>.&nbsp;<\/p>\n\n\n\n<p>Another important observation is that not all TensorFlow Lite operations work on all <span id=\"urn:enhancement-2109cbbb\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/data\">data<\/span> types. Normal <code>tf.float32<\/code>, <code>tf.int8<\/code> and <code>tf.uint8<\/code> are always supported, but some operations don\u2019t support <code>tf.float16<\/code> and <code>tf.string<\/code>. So, if your <span id=\"urn:enhancement-e4499a25\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/conceptual_model\">model<\/span> has previously been optimised in <span id=\"urn:enhancement-3266d7fe\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/tensorflow\">TensorFlow<\/span>, you may need to refactor it before converting it to TensorFlow Lite.<\/p>\n\n\n\n<p>If you are hoping to create your own TensorFlow Lite <span id=\"urn:enhancement-8a78831a\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/conceptual_model\">models<\/span>, you should fully understand the <span id=\"urn:enhancement-99cc2b4a\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/social_influence\">impact<\/span> of these limitations. A great starting point is <a aria-label=\"undefined (opens in a new tab)\" href=\"https:\/\/www.tensorflow.org\/lite\/guide\/ops_compatibility\" target=\"_blank\" rel=\"noreferrer noopener\">the relevant page on the TensorFlow Lite site<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to deploy a TensorFlow Lite model<\/h2>\n\n\n\n<p>There are five steps to deploy a TensorFlow Lite <span id=\"urn:enhancement-f95d3ecd\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/conceptual_model\">model<\/span>.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Build a TensorFlow Model<\/li><li>Convert your model to a TensorFlow Lite FlatBuffer<\/li><li>Convert this FlatBuffer to a C byte array<\/li><li>Integrate the <span id=\"urn:local-annotation-762377\" class=\"textannotation disambiguated\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/c__\">C++<\/span> Library<\/li><li>Deploy to your device<\/li><li>Let\u2019s look at each step in a little more detail.<\/li><\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Build a TensorFlow model<\/h3>\n\n\n\n<p>As we saw above, creating a machine learning <span id=\"urn:enhancement-9859d1c4\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/conceptual_model\">model<\/span> from scratch is a 7 step <span id=\"urn:enhancement-8b71f18c\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/process_computing\">process<\/span>, including deployment. However, there are numerous pre-compiled TensorFlow <span id=\"urn:enhancement-d5a6634\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/conceptual_model\">models<\/span> available. One of the best sources is the <a href=\"https:\/\/modelzoo.co\/framework\/tensorflow\" target=\"_blank\" aria-label=\"undefined (opens in a new tab)\" rel=\"noreferrer noopener\">Model Zoo<\/a>. Here, you can <span id=\"urn:enhancement-f12f5a6d\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/download\">download<\/span> over a hundred suitable ML <span id=\"urn:enhancement-3b16bd9f\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/conceptual_model\">models<\/span>. These include <span id=\"urn:enhancement-60977325\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/chatterbot\">chatbots<\/span>, <span id=\"urn:enhancement-34f35891\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/object_detection\">object detection<\/span> and <span id=\"urn:enhancement-71a019b0\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/speech_recognition\">speech recognition<\/span> <span id=\"urn:enhancement-35a65524\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/conceptual_model\">models<\/span>. You can use pre-trained versions of these <span id=\"urn:enhancement-ff9ba831\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/scientific_modelling\">models<\/span>, or you might choose to retrain them with your own <span id=\"urn:enhancement-9c9da8c6\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/data\">data<\/span>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Convert to a FlatBuffer<\/h3>\n\n\n\n<p><a href=\"https:\/\/google.github.io\/flatbuffers\/\" target=\"_blank\" aria-label=\"undefined (opens in a new tab)\" rel=\"noreferrer noopener\">FlatBuffers<\/a> are an efficient serialised flat <span id=\"urn:enhancement-559ba883\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/data\">data<\/span> structure. Unusually, they allow you to pack structured hierarchical <span id=\"urn:enhancement-af22aa67\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/data\">data<\/span>, while still maintaining direct access to all that <span id=\"urn:enhancement-7a2114ad\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/data\">data<\/span>. You need to use the TensorFlow Lite Converter to convert your TensorFlow <span id=\"urn:enhancement-f1290731\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/conceptual_model\">model<\/span> into a FlatBuffer. The Converter also handles remapping TensorFlow operations to TensorFlow Lite equivalents.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Convert to a C byte array<\/h3>\n\n\n\n<p>Generally, microcontrollers do not offer native <span id=\"urn:enhancement-cfec1091\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/file_system\">filesystem<\/span> support. This means you need to compile your <span id=\"urn:enhancement-6792c955\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/conceptual_model\">model<\/span> directly into your <span id=\"urn:enhancement-2aa8d60d\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/binary_file\">binary<\/span>. To do this, you need to use <span id=\"urn:enhancement-c8baa8d9\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/standardization\">standard<\/span> <span id=\"urn:enhancement-19182916\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/tool\">tools<\/span> to convert the TensorFlow Lite FlatBuffer into a C <span id=\"urn:enhancement-3f9caf59\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/byte\">byte<\/span> array. For instance, you can do this using the <span id=\"urn:local-annotation-17566\" class=\"textannotation disambiguated\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/linux\">Linux<\/span> xxd <span id=\"urn:enhancement-3dea5884\" class=\"textannotation disambiguated wl-thing\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/command_computing\">command<\/span>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Integrate the C++ library<\/h3>\n\n\n\n<p>You are now ready to build your binary. This will need to import data (e.g. from sensors), perform inference with the compiled ML model and utilise the results. One of the core requirements is to import and integrate the <a aria-label=\"undefined (opens in a new tab)\" href=\"https:\/\/www.tensorflow.org\/lite\/microcontrollers\/library\" target=\"_blank\" rel=\"noreferrer noopener\">TensorFlow Lite C++ library<\/a>. This provides all the functionality to interpret and run your ML model. Many MCUs offer this library via their <span id=\"urn:local-annotation-803199\" class=\"textannotation disambiguated\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/software_development_kit\">SDKs<\/span> or as pre-compiled middleware.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Deploy the binary<\/h3>\n\n\n\n<p>The final step is to deploy the model onto your chosen microcontroller. Clearly, this step depends on your choice of platform. Once deployed, you can test the performance of the model. If needed, you can use the <a href=\"https:\/\/www.tensorflow.org\/lite\/performance\/model_optimization\" target=\"_blank\" aria-label=\"undefined (opens in a new tab)\" rel=\"noreferrer noopener\">Model Optimization Toolkit<\/a> to improve the performance or reduce the size of the binary.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusions<\/h2>\n\n\n\n<p>By now I hope you are convinced that edge machine learning is both desirable and feasible. This is a rapidly evolving area of ML, and edge machine learning models are getting ever more capable. You still need to train your original model and need to be aware of the limitations of TensorFlow Lite. However, nowadays it is pretty easy to convert machine learning inference models and run them in embedded devices. Next time I will show you a practical example of creating an edge machine learning model. I will also look in more detail at some of the hardware available from suppliers like <a aria-label=\"undefined (opens in a new tab)\" style=\"user-select: auto;\" href=\"https:\/\/eu.mouser.com\/applications\/tensorflow-lite-mcus-ai-edge\/\" target=\"_blank\" rel=\"noreferrer noopener\"><span style=\"user-select: auto;\" id=\"urn:local-annotation-671446\" class=\"textannotation disambiguated\" itemid=\"http:\/\/data.wordlift.io\/wl01770\/entity\/mouser_electronics__inc\">Mouser<\/span><\/a>.<\/p>\n\n\n\n<div class=\"uagb-cta__outer-wrap uagb-block-a5e59c92\"><div class=\"uagb-cta__content-wrap uagb-cta__block uagb-cta__icon-position-right uagb-cta__content-right uagb-cta__content-stacked-tablet uagb-cta__button-valign-middle uagb-cta__button-type-none \"><div class=\"uagb-cta__left-right-wrap\"><div class=\"uagb-cta__content\"><div class=\"uagb-cta__title-wrap\"><h4 class=\"uagb-cta__title\">RELATED CONTENT<\/h4><\/div><div class=\"uagb-cta-text-wrap\"><p class=\"uagb-cta__desc\"><a href=\"https:\/\/www.codemotion.com\/magazine\/dev-hub\/machine-learning-dev\/the-cutting-edge-of-real-time-ai\/\" target=\"_blank\" aria-label=\"undefined (opens in a new tab)\" rel=\"noreferrer noopener\">The cutting edge of real-time AI<\/a><\/p><\/div><\/div><div class=\"uagb-cta__link-wrapper uagb-cta__block-link-style\"><\/div><\/div><\/div><\/div>\n\n\n","protected":false},"excerpt":{"rendered":"<p>In this six-article series from Mouser Electronics, we explore why AI is moving to the network edge and the technology that\u2019s making it possible. The first article examined why AI needs to move to the edge. Here, we dive in to the hardware and tools that are making edge machine learning a reality.&nbsp; Introduction Artificial&#8230; <a class=\"more-link\" href=\"https:\/\/www.codemotion.com\/magazine\/ai-ml\/machine-learning\/edge-machine-learning\/\">Read more<\/a><\/p>\n","protected":false},"author":83,"featured_media":8168,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_editorskit_title_hidden":false,"_editorskit_reading_time":8,"_editorskit_is_block_options_detached":false,"_editorskit_block_options_position":"{}","_uag_custom_page_level_css":"","_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[35],"tags":[7105],"collections":[],"class_list":{"0":"post-7038","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-machine-learning","8":"tag-mouser","9":"entry"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.9 (Yoast SEO v26.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Getting started with edge machine learning - Codemotion Magazine<\/title>\n<meta name=\"description\" content=\"In this article we explore why artificial intelligence and machine learning are moving to the network edge, and the technology that is making it possible.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.codemotion.com\/magazine\/ai-ml\/machine-learning\/edge-machine-learning\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Getting started with edge machine learning\" \/>\n<meta property=\"og:description\" content=\"In this article we explore why artificial intelligence and machine learning are moving to the network edge, and the technology that is making it possible.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.codemotion.com\/magazine\/ai-ml\/machine-learning\/edge-machine-learning\/\" \/>\n<meta property=\"og:site_name\" content=\"Codemotion Magazine\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Codemotion.Italy\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-08-03T08:10:58+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-01-05T19:05:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/08\/August_article_image_final.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"896\" \/>\n\t<meta property=\"og:image:height\" content=\"504\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Mark Patrick, Mouser Electronics\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@CodemotionIT\" \/>\n<meta name=\"twitter:site\" content=\"@CodemotionIT\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mark Patrick, Mouser Electronics\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/ai-ml\/machine-learning\/edge-machine-learning\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/ai-ml\/machine-learning\/edge-machine-learning\/\"},\"author\":{\"name\":\"Mark Patrick, Mouser Electronics\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/664e4da6990fc1344a2299435a542654\"},\"headline\":\"Getting started with edge machine learning\",\"datePublished\":\"2020-08-03T08:10:58+00:00\",\"dateModified\":\"2022-01-05T19:05:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/ai-ml\/machine-learning\/edge-machine-learning\/\"},\"wordCount\":2115,\"publisher\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/ai-ml\/machine-learning\/edge-machine-learning\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/08\/August_article_image_final.jpg\",\"keywords\":[\"Mouser\"],\"articleSection\":[\"Machine Learning\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/ai-ml\/machine-learning\/edge-machine-learning\/\",\"url\":\"https:\/\/www.codemotion.com\/magazine\/ai-ml\/machine-learning\/edge-machine-learning\/\",\"name\":\"Getting started with edge machine learning - Codemotion Magazine\",\"isPartOf\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/ai-ml\/machine-learning\/edge-machine-learning\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/ai-ml\/machine-learning\/edge-machine-learning\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/08\/August_article_image_final.jpg\",\"datePublished\":\"2020-08-03T08:10:58+00:00\",\"dateModified\":\"2022-01-05T19:05:27+00:00\",\"description\":\"In this article we explore why artificial intelligence and machine learning are moving to the network edge, and the technology that is making it possible.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/ai-ml\/machine-learning\/edge-machine-learning\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.codemotion.com\/magazine\/ai-ml\/machine-learning\/edge-machine-learning\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/ai-ml\/machine-learning\/edge-machine-learning\/#primaryimage\",\"url\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/08\/August_article_image_final.jpg\",\"contentUrl\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/08\/August_article_image_final.jpg\",\"width\":896,\"height\":504,\"caption\":\"edge machine learning\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/ai-ml\/machine-learning\/edge-machine-learning\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.codemotion.com\/magazine\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"AI\/ML\",\"item\":\"https:\/\/www.codemotion.com\/magazine\/ai-ml\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Machine Learning\",\"item\":\"https:\/\/www.codemotion.com\/magazine\/ai-ml\/machine-learning\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Getting started with edge machine learning\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#website\",\"url\":\"https:\/\/www.codemotion.com\/magazine\/\",\"name\":\"Codemotion Magazine\",\"description\":\"We code the future. Together\",\"publisher\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.codemotion.com\/magazine\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#organization\",\"name\":\"Codemotion\",\"url\":\"https:\/\/www.codemotion.com\/magazine\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/11\/codemotionlogo.png\",\"contentUrl\":\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/11\/codemotionlogo.png\",\"width\":225,\"height\":225,\"caption\":\"Codemotion\"},\"image\":{\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/Codemotion.Italy\/\",\"https:\/\/x.com\/CodemotionIT\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/664e4da6990fc1344a2299435a542654\",\"name\":\"Mark Patrick, Mouser Electronics\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0d35fad9fee01e991637b67f54ae7cb8b001b5d2c1e4f7c1942b2105dad5a9bf?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/0d35fad9fee01e991637b67f54ae7cb8b001b5d2c1e4f7c1942b2105dad5a9bf?s=96&d=mm&r=g\",\"caption\":\"Mark Patrick, Mouser Electronics\"},\"url\":\"https:\/\/www.codemotion.com\/magazine\/author\/mark-patrick\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Getting started with edge machine learning - Codemotion Magazine","description":"In this article we explore why artificial intelligence and machine learning are moving to the network edge, and the technology that is making it possible.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.codemotion.com\/magazine\/ai-ml\/machine-learning\/edge-machine-learning\/","og_locale":"en_US","og_type":"article","og_title":"Getting started with edge machine learning","og_description":"In this article we explore why artificial intelligence and machine learning are moving to the network edge, and the technology that is making it possible.","og_url":"https:\/\/www.codemotion.com\/magazine\/ai-ml\/machine-learning\/edge-machine-learning\/","og_site_name":"Codemotion Magazine","article_publisher":"https:\/\/www.facebook.com\/Codemotion.Italy\/","article_published_time":"2020-08-03T08:10:58+00:00","article_modified_time":"2022-01-05T19:05:27+00:00","og_image":[{"width":896,"height":504,"url":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/08\/August_article_image_final.jpg","type":"image\/jpeg"}],"author":"Mark Patrick, Mouser Electronics","twitter_card":"summary_large_image","twitter_creator":"@CodemotionIT","twitter_site":"@CodemotionIT","twitter_misc":{"Written by":"Mark Patrick, Mouser Electronics","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.codemotion.com\/magazine\/ai-ml\/machine-learning\/edge-machine-learning\/#article","isPartOf":{"@id":"https:\/\/www.codemotion.com\/magazine\/ai-ml\/machine-learning\/edge-machine-learning\/"},"author":{"name":"Mark Patrick, Mouser Electronics","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/664e4da6990fc1344a2299435a542654"},"headline":"Getting started with edge machine learning","datePublished":"2020-08-03T08:10:58+00:00","dateModified":"2022-01-05T19:05:27+00:00","mainEntityOfPage":{"@id":"https:\/\/www.codemotion.com\/magazine\/ai-ml\/machine-learning\/edge-machine-learning\/"},"wordCount":2115,"publisher":{"@id":"https:\/\/www.codemotion.com\/magazine\/#organization"},"image":{"@id":"https:\/\/www.codemotion.com\/magazine\/ai-ml\/machine-learning\/edge-machine-learning\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/08\/August_article_image_final.jpg","keywords":["Mouser"],"articleSection":["Machine Learning"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.codemotion.com\/magazine\/ai-ml\/machine-learning\/edge-machine-learning\/","url":"https:\/\/www.codemotion.com\/magazine\/ai-ml\/machine-learning\/edge-machine-learning\/","name":"Getting started with edge machine learning - Codemotion Magazine","isPartOf":{"@id":"https:\/\/www.codemotion.com\/magazine\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.codemotion.com\/magazine\/ai-ml\/machine-learning\/edge-machine-learning\/#primaryimage"},"image":{"@id":"https:\/\/www.codemotion.com\/magazine\/ai-ml\/machine-learning\/edge-machine-learning\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/08\/August_article_image_final.jpg","datePublished":"2020-08-03T08:10:58+00:00","dateModified":"2022-01-05T19:05:27+00:00","description":"In this article we explore why artificial intelligence and machine learning are moving to the network edge, and the technology that is making it possible.","breadcrumb":{"@id":"https:\/\/www.codemotion.com\/magazine\/ai-ml\/machine-learning\/edge-machine-learning\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.codemotion.com\/magazine\/ai-ml\/machine-learning\/edge-machine-learning\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codemotion.com\/magazine\/ai-ml\/machine-learning\/edge-machine-learning\/#primaryimage","url":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/08\/August_article_image_final.jpg","contentUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/08\/August_article_image_final.jpg","width":896,"height":504,"caption":"edge machine learning"},{"@type":"BreadcrumbList","@id":"https:\/\/www.codemotion.com\/magazine\/ai-ml\/machine-learning\/edge-machine-learning\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.codemotion.com\/magazine\/"},{"@type":"ListItem","position":2,"name":"AI\/ML","item":"https:\/\/www.codemotion.com\/magazine\/ai-ml\/"},{"@type":"ListItem","position":3,"name":"Machine Learning","item":"https:\/\/www.codemotion.com\/magazine\/ai-ml\/machine-learning\/"},{"@type":"ListItem","position":4,"name":"Getting started with edge machine learning"}]},{"@type":"WebSite","@id":"https:\/\/www.codemotion.com\/magazine\/#website","url":"https:\/\/www.codemotion.com\/magazine\/","name":"Codemotion Magazine","description":"We code the future. Together","publisher":{"@id":"https:\/\/www.codemotion.com\/magazine\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.codemotion.com\/magazine\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.codemotion.com\/magazine\/#organization","name":"Codemotion","url":"https:\/\/www.codemotion.com\/magazine\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/logo\/image\/","url":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/11\/codemotionlogo.png","contentUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/11\/codemotionlogo.png","width":225,"height":225,"caption":"Codemotion"},"image":{"@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Codemotion.Italy\/","https:\/\/x.com\/CodemotionIT"]},{"@type":"Person","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/664e4da6990fc1344a2299435a542654","name":"Mark Patrick, Mouser Electronics","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/0d35fad9fee01e991637b67f54ae7cb8b001b5d2c1e4f7c1942b2105dad5a9bf?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0d35fad9fee01e991637b67f54ae7cb8b001b5d2c1e4f7c1942b2105dad5a9bf?s=96&d=mm&r=g","caption":"Mark Patrick, Mouser Electronics"},"url":"https:\/\/www.codemotion.com\/magazine\/author\/mark-patrick\/"}]}},"featured_image_src":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/08\/August_article_image_final-600x400.jpg","featured_image_src_square":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/08\/August_article_image_final-600x504.jpg","author_info":{"display_name":"Mark Patrick, Mouser Electronics","author_link":"https:\/\/www.codemotion.com\/magazine\/author\/mark-patrick\/"},"uagb_featured_image_src":{"full":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/08\/August_article_image_final.jpg",896,504,false],"thumbnail":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/08\/August_article_image_final-150x150.jpg",150,150,true],"medium":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/08\/August_article_image_final-300x169.jpg",300,169,true],"medium_large":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/08\/August_article_image_final-768x432.jpg",768,432,true],"large":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/08\/August_article_image_final.jpg",896,504,false],"1536x1536":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/08\/August_article_image_final.jpg",896,504,false],"2048x2048":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/08\/August_article_image_final.jpg",896,504,false],"small-home-featured":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/08\/August_article_image_final.jpg",100,56,false],"sidebar-featured":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/08\/August_article_image_final-180x128.jpg",180,128,true],"genesis-singular-images":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/08\/August_article_image_final-896x504.jpg",896,504,true],"archive-featured":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/08\/August_article_image_final-400x225.jpg",400,225,true],"gb-block-post-grid-landscape":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/08\/August_article_image_final-600x400.jpg",600,400,true],"gb-block-post-grid-square":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2020\/08\/August_article_image_final-600x504.jpg",600,504,true]},"uagb_author_info":{"display_name":"Mark Patrick, Mouser Electronics","author_link":"https:\/\/www.codemotion.com\/magazine\/author\/mark-patrick\/"},"uagb_comment_info":0,"uagb_excerpt":"In this six-article series from Mouser Electronics, we explore why AI is moving to the network edge and the technology that\u2019s making it possible. The first article examined why AI needs to move to the edge. Here, we dive in to the hardware and tools that are making edge machine learning a reality.&nbsp; Introduction Artificial&#8230;&hellip;","lang":"en","_links":{"self":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts\/7038","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/users\/83"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/comments?post=7038"}],"version-history":[{"count":8,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts\/7038\/revisions"}],"predecessor-version":[{"id":14335,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts\/7038\/revisions\/14335"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/media\/8168"}],"wp:attachment":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/media?parent=7038"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/categories?post=7038"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/tags?post=7038"},{"taxonomy":"collections","embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/collections?post=7038"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}