tinyml如何使用TensorFlow Lite构建智能物联网设备

If you are new to machine learning, it is a technique of using algorithms to analyze massive amounts of data to draw conclusions. Deep learning is a branch of machine learning that uses an algorithm called neural networks.

如果您不熟悉机器学习,它是一种使用算法来分析大量数据以得出结论的技术。 深度学习是机器学习的一个分支,它使用一种称为神经网络的算法。

When you combine large data sets with high computing power, these neural networks can understand patterns between data.

当您将大型数据集与高计算能力结合在一起时,这些神经网络可以理解数据之间的模式。

Deep learning has given rise to self-driving cars, personal assistants like Siri, and many others. Engineers are adopting deep learning models into their applications to solve complex problems for their customers.

深度学习催生了无人驾驶汽车,Siri等私人助理以及许多其他应用。 工程师正在将深度学习模型应用于其应用程序,以为其客户解决复杂的问题。

Tensorflow is a leading Deep learning library developed by Google. It supports a variety of neural network models like Convolutional and Recurrent Neural Networks.

Tensorflow是Google开发的领先的深度学习库。 它支持各种神经网络模型,例如卷积和递归神经网络。

I recently wrote an article on Machine learning called “Machine Learning For Managers — What You Need To Know”. It should give you all the basics you need.

我最近写了一篇有关机器学习的文章,名为“ 管理者的机器学习-您需要知道的知识 ”。 它应该为您提供所需的所有基础知识。

嵌入式系统 (Embedded Systems)

If hardware scares you, don't worry. I'll make this simple.

如果硬件吓到您,请不要担心。 我将简单说明。

A microprocessor is a small computer similar to your CPU. The difference is that it is really tiny and can only perform low-level operations.

微处理器是类似于您的CPU的小型计算机。 不同之处在于它确实很小,并且只能执行低级操作。

These tiny microprocessors are present in devices like your air-conditioner and your refrigerator. But microprocessors alone cannot do much. They need input through sensors and send outputs to perform an action.

这些微型微处理器存在于诸如空调和冰箱之类的设备中。 但是光靠微处理器是无能为力的。 他们需要通过传感器输入并发送输出以执行操作。

When you press a button on your remote and change a channel on your TV, the device takes in an input, understands the command, and performs an operation. The combination of these sensors and the microprocessor is called Embedded Systems. (coz they are embedded together on a circuit board)

当您按遥控器上的按钮并更改电视上的频道时,设备将接受输入,理解命令并执行操作。 这些传感器和微处理器的组合称为嵌入式系统 。 (因为它们被嵌入在一起在电路板上)

Embedded systems are present in devices like your smartphone, electric guitar, and many others we use on a daily basis.

嵌入式系统存在于您的智能手机,电吉他以及我们每天使用的许多其他设备中。

物联网(IoT) (Internet of Things (IoT))

IoT is any device connected to the internet. If your air conditioner is connected to the internet, you can turn it on/off from your office through a mobile app. That makes it an IoT device.

物联网是连接到互联网的任何设备。 如果您的空调已连接到互联网,则可以通过移动应用程序在办公室中打开/关闭空调。 这使其成为物联网设备。

IoT devices are usually grouped together to perform various actions. A few examples would be:

IoT设备通常组合在一起以执行各种操作。 一些例子是:

  • Devices on a farm to check weeds and pests using cameras.

    农场中使用照相机检查杂草和害虫的设备。
  • Traffic cameras for real-time monitoring

    用于实时监控的交通摄像机
  • A network of drones to monitor a construction site.

    无人机网络监视施工现场。

There are pre-built embedded systems like Raspberry Pi and Arduino that come packaged with a microcontroller, sensors, support for wifi, and even a USB port. You can connect to them using a keyword and a monitor, just like you would do with a CPU.

有诸如Raspberry Pi和Arduino之类的预构建嵌入式系统,它们与微控制器,传感器,对wifi的支持,甚至USB端口一起打包在一起。 您可以使用关键字和监视器连接到它们,就像使用CPU一样。

什么是TinyML (What is TinyML)

Most IoT devices perform a specific task. They take input through a sensor, perform computation, and send the data out or perform an action.

大多数物联网设备执行特定任务。 它们通过传感器获取输入,执行计算,然后发送数据或执行操作。

The usual approach to IoT is to collect data and send it to a centralized logging server. From here, you can use machine learning to draw conclusions.

物联网的常用方法是收集数据并将其发送到集中式日志服务器。 从这里,您可以使用机器学习得出结论。

But why don't we make these devices intelligent at the embedded system level? We can build solutions like smart traffic signals based on traffic density, send you an alert when your refrigerator goes out of stock, or even predict rainfall based on weather data.

但是,为什么我们不使这些设备在嵌入式系统级别上变得智能呢? 我们可以构建基于交通密度的智能交通信号等解决方案,在冰箱缺货时向您发送警报,甚至根据天气数据预测降雨量。

The challenge with embedded systems in that they are tiny. And most of them run on battery power. Since machine learning models consume a lot of processing power, machine learning tools like Tensorflow are not well suited to build models on IoT devices.

嵌入式系统的挑战在于它们很小。 而且大多数都依靠电池供电。 由于机器学习模型会消耗大量处理能力,因此Tensorflow等机器学习工具不太适合在IoT设备上构建模型。

This is where TinyML comes in.

这就是TinyML的用武之地。

TinyML can perform on-device analysis of sensor inputs with extremely low power. With hardware improvements and the advancements in TinyML tools like Tensorflow Lite, it is now possible to install intelligence in these tiny devices.

TinyML可以以极低的功耗对传感器输入进行设备上分析。 随着硬件的改进以及Tensorflow Lite等TinyML工具的发展,现在可以在这些小型设备中安装智能功能。

Tensorflow Lite (Tensorflow Lite)

So how do you achieve TinyML? There are a few tools that help us run machine learning models on IoT devices.

那么如何实现TinyML? 有一些工具可以帮助我们在IoT设备上运行机器学习模型。

The most famous one is Tensorflow Lite. With Tensorflow Lite, you can wrap your Tensorflow models to run on embedded systems. Tensorflow Lite will give you small sized binaries capable of running on low powered embedded systems.

最著名的是Tensorflow Lite 。 借助Tensorflow Lite,您可以包装Tensorflow模型以在嵌入式系统上运行。 Tensorflow Lite将为您提供能够在低功耗嵌入式系统上运行的小型二进制文件。

Tensorflow Lite also supports major platforms including Android, iOS, Arduino, and so on.

Tensorflow Lite还支持主要平台,包括Android,iOS,Arduino等。

Python is usually the preferred language to build machine learning models. But with TensorFlow Lite, you can use C, C++ or Java to build machine learning models.

通常,Python是构建机器学习模型的首选语言。 但是使用TensorFlow Lite,您可以使用C,C ++或Java来构建机器学习模型。

Connecting to the network is a power-consuming operation. With Tensorflow Lite, you can deploy machine learning models without the need to connect to the internet. This also solves security concerns since embedded systems are relatively easier to exploit.

连接到网络是一项耗电的操作。 使用Tensorflow Lite,您可以部署机器学习模型而无需连接到互联网。 由于嵌入式系统相对易于利用,因此这也解决了安全问题。

Tensorflow Lite offers pre-trained machine learning models for common use cases. These include:

Tensorflow Lite为常见用例提供了经过预训练的机器学习模型。 这些包括:

  • Object Detection — Recognizes multiple objects within an image. Supports up to 80 different classes of objects.

    对象检测 -识别图像中的多个对象。 支持多达80种不同类别的对象。

  • Smart RepliesGenerates smart replies, similar to interacting with a chatbot.

    智能回复 -生成智能回复,类似于与聊天机器人进行交互。

  • RecommendationsPersonalized recommendation systems based on user behavior.

    推荐 -基于用户行为的个性化推荐系统。

备择方案 (Alternatives)

There are a few alternatives to Tensorflow Lite. Two strong contenders are:

Tensorflow Lite有一些替代方案。 两个有力的竞争者是:

  • CoreML — Apple’s library for building machine learning models on iOS devices.

    CoreML — Apple的库,用于在iOS设备上构建机器学习模型。

  • PyTorch Mobile — Mobile version of Facebook’s deep learning library PyTorch.

    PyTorch Mobile — Facebook的深度学习库PyTorch的移动版本。

摘要 (Summary)

TinyML is still in its early stages. There are improvements being made in Tensorflow Lite and other TinyML frameworks to support complex machine learning models.

TinyML仍处于早期阶段。 Tensorflow Lite和其他TinyML框架进行了改进,以支持复杂的机器学习模型。

It might take a couple of years before we begin to see the mainstream adoption of TinyML. But no mistake, intelligent devices are coming.

我们可能要花几年时间才能开始看到TinyML的主流采用。 但是,毫无疑问,智能设备即将问世。

Loved this article? Join my Newsletter and get a summary of my articles and videos every Monday.

喜欢这篇文章吗? 加入我的时事通讯 并在每个星期一获得我的文章和视频的摘要。

翻译自: https://medium.com/manishmshiva/tinyml-how-to-build-intelligent-iot-devices-with-tensorflow-lite-8cbcd91592db

你可能感兴趣的:(物联网,python,人工智能,大数据)