Enabling Un-/Semi-Supervised Machine Learning for MDSE of the Real-World CPS/IoT Applications

Armin Moin, Atta Badii, Stephan GünnemannarXiv 2021 · DOI

Abstract

Software engineering of network-centric Artificial Intelligence (AI) and Internet of Things (IoT) enabled Cyber-Physical Systems (CPS) and services, involves complex design and validation challenges. In this paper, we propose a novel approach, based on the model-driven software engineering paradigm, in particular the domain-specific modeling methodology. We focus on a sub-discipline of AI, namely Machine Learning (ML) and propose the delegation of data analytics and ML to the IoT edge. This way, we may increase the service quality of ML, for example, its availability and performance, regardless of the network conditions, as well as maintaining the privacy, security and sustainability. We let practitioners assign ML tasks to heterogeneous edge devices, including highly resource-constrained embedded microcontrollers with main memories in the order of Kilobytes, and energy consumption in the order of milliwatts. This is known as TinyML. Furthermore, we show how software models with different levels of abstraction, namely platform-independent and platform-specific models can be used in the software development process. Finally, we validate the proposed approach using a case study addressing the predictive maintenance of a hydraulics system with various networked sensors and actuators.

1. Introduction

The development of network-centric Artificial Intelligence (AI) and Internet of Things (IoT) enabled Cyber-Physical Systems (CPS) presents significant design and validation challenges. A primary hurdle is the "technology spectrum" problem, where a single project requires expertise across diverse operating systems (Linux, TinyOS, ROS), multiple programming languages (C, Java, Python), and various communication protocols. While cloud-based AI is common, moving intelligence to the "edge"—specifically to resource-constrained microcontrollers (TinyML)—offers benefits in privacy, latency, and energy efficiency. However, the low-level complexity of these devices often exceeds the expertise of typical software engineers.

2. Methodology: Model-Driven TinyML

This paper proposes a Domain-Specific Modeling (DSM) approach to bridge this gap. By utilizing Model-Driven Software Engineering (MDSE), developers can define high-level logic that is automatically transformed into executable code for heterogeneous targets.

The process involves two primary levels of abstraction:

  • Platform-Independent Models (PIM): These describe the business logic and ML tasks (e.g., anomaly detection) without hardware-specific details.
  • Platform-Specific Models (PSM): These extend the PIM with "annotations" for target hardware, such as Arduino Nano 33 BLE Sense or Raspberry Pi 3 B+, and handle data type mappings.

The toolchain, an extension of the ML-Quadrat project, automates code generation (C++ for Arduino, Python for Raspberry Pi) and converts trained Keras/TensorFlow models into the hexadecimal arrays required for embedded systems. The approach was validated using a hydraulics system dataset from ZeMA gGmbH, aiming to predict internal leakage in a main pump using vibration, power, and efficiency sensors.

3. Results and Discussion

The research demonstrated that 100% of the required source code for TinyML applications could be generated from high-level models.

Key findings from the case study include:

  • Model Optimization: Quantization (converting 32-bit floats to 8-bit integers) was essential for Arduino deployment. A compact model (316 KB) achieved 80% accuracy, while a larger model (1.2 MB) achieved 97% accuracy but exceeded the Arduino's memory limits.
  • Performance Gains: On Raspberry Pi, quantization reduced model size by 75% and improved inference speed by 60%.
  • Privacy and Resilience: Local processing at the edge inherently supports GDPR by keeping sensitive data on-device and ensures system functionality even during network outages.

4. Conclusion

MDSE effectively abstracts the complexities of heterogeneous IoT hardware, enabling AI engineering at the edge. By automating the "plumbing" of AI on microcontrollers, the proposed approach allows software engineers to focus on logic rather than hardware constraints. Future work will address real-world data noise and explore Federated Learning to allow collaborative model training across edge devices without compromising raw data privacy.

Summary updated

Abstract

Software engineering of network-centric Artificial Intelligence (AI) and Internet of Things (IoT) enabled Cyber-Physical Systems (CPS) and services, involves complex design and validation challenges. In this paper, we propose a novel approach, based on the model-driven software engineering paradigm, in particular the domain-specific modeling methodology. We focus on a sub-discipline of AI, namely Machine Learning (ML) and propose the delegation of data analytics and ML to the IoT edge. This way, we may increase the service quality of ML, for example, its availability and performance, regardless of the network conditions, as well as maintaining the privacy, security and sustainability. We let practitioners assign ML tasks to heterogeneous edge devices, including highly resource-constrained embedded microcontrollers with main memories in the order of Kilobytes, and energy consumption in the order of milliwatts. This is known as TinyML. Furthermore, we show how software models with different levels of abstraction, namely platform-independent and platform-specific models can be used in the software development process. Finally, we validate the proposed approach using a case study addressing the predictive maintenance of a hydraulics system with various networked sensors and actuators.
BibTeX
@misc{moin2021enabling,
  author = {Armin Moin and Atta Badii and Stephan Günnemann},
  title = {{Enabling Un-/Semi-Supervised Machine Learning for MDSE of the Real-World CPS/IoT Applications}},
  year = {2021},
  eprint = {2107.02690},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2107.02690},
}
Figure