TinyML: Continual Learning with LwM2M

2023-04-23
关注

Illustration: © IoT For All

While MCUs are becoming more powerful, machine learning models can be designed to utilize fewer resources. This enables the implementation of TinyML; deep learning models which can run on resource-constrained IoT devices. TinyML can be used to analyze raw sensor data locally which reduces or removes the need to send data to the cloud, lowers battery consumption, and preserves data privacy.

Nevertheless, implementing intelligent IoT solutions does not solely rely on the ML model itself. It involves challenges such as implementing continual learning, enabling low-power wireless communication, managing devices remotely, ensuring secure communication, updating the firmware (over the air), and enabling device interoperability.

“TinyML can be used to analyze raw sensor data locally which reduces or removes the need to send data to the cloud, lowers battery consumption, and preserves data privacy.”

-AVSystem

TinyML & LwM2M Complement Each Other

LwM2M is an application-layer communication standard that simplifies messaging and device management for IoT devices. The protocol dictates a data format and defines device management mechanisms and standardized processes for firmware-over-the-air updates (FOTA). The protocol is well-suited for LPWAN standards such as NB-IoT and LTE-M.

While TinyML provides the device intelligence (using tools such as Edge Impulse or Cartesiam.ai), the LwM2M protocol provides connectivity, standardized communication, and device management. When combined, they create a holistic solution for smart IoT devices.

TinyML is only one part of a smart solution

Retrofitting Existing Devices with Smart Sensors

Cloud-based analysis of a device’s raw sensor data is inefficient due to the volume of data the device needs to transmit. A more efficient way is to process data from sensors directly on the device using TinyML. For example, analyzing the X, Y, and Z values of the accelerometer can detect complex movements or vibrations which could give valuable insights, enabling use cases such as predictive maintenance, monitoring the utilization of valuable goods, or classifying movements of people or animals.

These days, more and more smart sensors are being developed. In addition to their sensing capabilities, smart sensors come with an embedded MCU which runs the TinyML model and communicates only the detected patterns to the main MCU of the device. These TinyML integrated sensors are referred to as the Sensor 2.0 Paradigm by Prof. Vijay Janapa Reddi (Harvard University) during his recent lecture at the TinyML Summit. Smart sensors simplify the implementation of TinyML as it allows for retrofitting existing devices with TinyML capabilities without having to redesign the embedded firmware. In addition, it can solve privacy issues due to the true isolation of raw sensor data. Smart sensors can analyze voices or camera images while ensuring people’s privacy as data does not leak out to the main MCU of the device.

Continual Learning

One of today’s key challenges is to keep the TinyML model reliable post-deployment. Oftentimes, datasets used for training purposes differ from real-world data, leading to inaccurate models. In addition, the environmental context may change over time (e.g. due to the decalibration of industrial machines, or changing climate conditions) leading to the deterioration of the model quality.

Continual learning refers to the ability of TinyML models to adapt over time. This can be accomplished by learning from new data sets without the need to retrain the model from scratch. Although the techniques to realize continual learning are well-known, practical implementations are often missing when running the models on resource-constrained devices. Often, this has to do with a missing device-management layer that takes care of ML model lifecycle management. LwM2M may be the missing link to realize continual learning as it comes with native support for remote configurations and firmware updates. Using proven methods, ML models can be updated continuously without having to physically access each device to update its firmware.

TinyML Catalyst

TinyML solutions for resource-constrained IoT devices are a catalyst for the development of intelligent solutions. To move beyond the current POC phase and start deploying actual TinyML applications, it is necessary to provide mechanisms for efficient communication, device, and firmware management, and secure connectivity. The use of the LwM2M protocol to manage TinyML models and provide connectivity is a path towards standardizing TinyML and enriching the ecosystem of intelligent IoT solutions.

Case Study: TinyML Pattern Detector

A TinyML solution has been designed using the LwM2M standard. The Thingy:91 is a development device that uses the nRF9160 SiP from Nordic Semiconductor. It runs the Zephyr OS operating system and was trained to detect three different motion patterns, as shown in the visual below.

Motion patterns recognized by the IoT device

The steps to implement the presented concept are as follows:

  1. Data collection and labeling.
  2. Design and train the classifier.
  3. Deploy and test the classifier on the device.
  4. Provide network connectivity and device management by implementing an LwM2M client.
  5. Manage devices and data using an LwM2M server.

The example uses the Edge Impulse platform to collect the data from the Thingy:91 accelerometer, train the ML classifier, and generate standalone libraries for C++. The library containing the TinyML model can run on the device and control the LED signaling pattern detection. The Anjay LwM2M client provides a connectivity layer for the solution, handling low-level technology issues related to communication and secure data transmission.

Training the TinyML model by classifying the movements using Edge Impulse

Finally, the device is registered in the LwM2M server where the data is stored and visualized. Using the Coiote IoT Device Management portal, the device can be instructed to notify the server every time a specific pattern is detected or to reduce the frequency to once every several seconds, minutes, or hours and send a counter indicating the number of times a pattern has been detected.

Visualization of the movement patterns in Coiote. Object ID /33650 represents the Pattern Detector

Tweet

Share

Share

Email

  • Automation
  • Connectivity
  • Internet of Things
  • Machine Learning
  • NB-IoT

  • Automation
  • Connectivity
  • Internet of Things
  • Machine Learning
  • NB-IoT

  • sensors
您觉得本篇内容如何
评分

相关产品

Alliance Sensors Group PGxR 线性电位计

Applications Where Radiation is Present in Power Generating Steam Turbine Control Systems ","The Alliance SensorsGroup PGxR Series linear sensors are the first LVDT-based valve position sensors designed and engineeredMaterials selected for the Alliance Sensors Group PGxR Sensors allow the sensor to survive a dose of,"Features","Also Ideal For Other Heavy Duty Linear Position Sensing Applications","Alliance Sensors,"There has never been anything like the Alliance Sensors Group PG Series LVDT Linear Sensors for power

All Sensors ELVR Series Analog and Digital Low Pressure Sensors 压力传感器

Send Me Product Information数据表下载,ELVR系列是First Sensors’ HCLA产品线的直接替代品。

Gems Sensors & Controls 捷迈 Alloy DIPTAPE 料位计

The 6700 series pressure sensors features customer accessible 5:1 turndown via a switch and potentiometer

Sensata 森萨塔 Boost Temperature Sensors 温度探头

Medium Temperature Sensors (-40 to 500°C) monitor compressor in & outlet and EGR cooler temperatures

SICK 西克 Liquid Level Sensors 液位开关

Based on the installation situation, medium properties, and ambient conditions, SICK provides sensors

Magnetic Sensors Corporation(MSC) SK10504 速度传感器

•Available as active or passive magnetic sensors","• Prototype quantities through full-scale OEM production

BEI Sensors / Sensata 9960135 旋转位置传感器

BEI Sensors’ new Model 9960 Hall effect rotary position sensor is available in numerous standard configurations

Conax 康纳斯 Conax Miniature Bearing Sensors (MBS) RTD温度探头

Conax Miniature Bearing Sensors provide a simple and cost-effective method to monitor bearing temperaturesRTDs – 100 ohm platinum, 0.00385 ohm\/ohm\/¡C * Thermocouples types J, K, T & E * Single and duplex sensors

HACH 哈希 LCP pH Sensors pH电极

LCP(液晶聚合物),可转换安装方式,4.5米模拟电缆,5线内置前置放大器,通用玻璃pH电极特殊性能,差分电极测量技术,低维护需要,可更换的盐桥内置前置放大器或二线发射器多功能安装方式1年保修,30个月按比例更换

Malema Sensors 2000 Series 气体流量开关

Malema的2000系列可变面积吹扫流量计使用锥形硼硅玻璃管和细螺纹调节阀,用于精确流量调节。各种流量管长度,如100毫米,150毫米和300毫米可供选择。它的结构紧凑,尺寸更小,便于安装和安装在控制面板上,特点

评论

您需要登录才可以回复|注册

提交评论

iotforall

这家伙很懒,什么描述也没留下

关注

点击进入下一篇

工业物联网的挑战及如何解决

提取码
复制提取码
点击跳转至百度网盘