Abstract
In this paper, we present the current position of the research project ML-Quadrat, which aims to extend the methodology, modeling language and tool support of ThingML - an open source modeling tool for IoT/CPS - to address Machine Learning needs for the IoT applications. Currently, ThingML offers a modeling language and tool support for modeling the components of the system, their communication interfaces as well as their behaviors. The latter is done through state machines. However, we argue that in many cases IoT/CPS services involve system components and physical processes, whose behaviors are not well understood in order to be modeled using state machines. Hence, quite often a data-driven approach that enables inference based on the observed data, e.g., using Machine Learning is preferred. To this aim, ML-Quadrat integrates the necessary Machine Learning concepts into ThingML both on the modeling level (syntax and semantics of the modeling language) and on the code generators level. We plan to support two target platforms for code generation regarding Stream Processing and Complex Event Processing, namely Apache SAMOA and Apama.
Introduction
As the Internet of Things (IoT) and Cyber-Physical Systems (CPS) grow in complexity, they become increasingly difficult to design and maintain. Traditional Model-Driven Engineering (MDE) helps by providing abstraction—using models to represent system components and their behaviors. Currently, tools like ThingML use state machines to define how a "Thing" (like a smart sensor or actuator) behaves. However, manual modeling has its limits when dealing with complex, real-world physical processes.
The Challenge: Beyond Manual State Machines
The authors argue that many real-world physical processes are too complex or poorly understood to be captured by a manual state machine. For instance, perfectly modeling the thermal dynamics of a building to optimize an AC unit is a significant engineering hurdle. In these cases, a data-driven approach—where the system "learns" behavior from observations—is superior.
Existing MDE tools aren't built to handle the specific requirements of Machine Learning (ML) workflows, such as data preparation, model training, and inference. Figure 1 shows a typical, simplified state machine for an AC unit. While clear, it lacks the nuance of a system that could adapt to occupant behavior or subtle environmental changes through learning.
The ML-Quadrat Approach
The authors propose ML-Quadrat, an extension of the existing ThingML framework. ThingML is a domain-specific modeling language (DSML) that already handles components, asynchronous message passing, and code generation for heterogeneous platforms. The "Plus" in ThingML+ comes from three key methodological shifts:
- Syntax and Semantics Extension: Adding ML-specific concepts directly into the modeling language so that "inference" becomes a first-class citizen alongside "state machines."
- Complementary Behavioral Views: Developers can choose to define behavior via traditional state charts or by delegating it to an ML algorithm that learns from data.
- Enhanced Code Generation: The framework is being designed to automatically generate code for specialized stream processing and Complex Event Processing (CEP) platforms, specifically Apache SAMOA and Apama. This removes the "plumbing" burden from the software engineer.
Key Insights and Ideas
- SE Models vs. ML Models: The authors make a sharp distinction between Software Engineering (SE) models (which define structure and interaction) and ML models (which are artifacts for inference). The goal isn't to replace one with the other, but to allow them to coexist in a single engineering workflow.
- Democratizing Data Science: A major goal is to allow software engineers who are not data scientists to implement smart services. By abstracting the ML algorithms behind a modeling layer, the tool can provide "hints" and handle the underlying platform complexities (like Spark or Flink).
- The "Black Box" Challenge: The authors acknowledge that ML algorithms cannot simply be treated as black boxes. They are sensitive to initialization and architectural choices. They suggest that AutoML (Automated Machine Learning) will be a critical component in making this abstraction successful.
Conclusion and Future Work
As a position paper, the results are primarily conceptual and architectural, defining the requirements for an "ML-aware" MDE tool for IoT and identifying integration points within the Eclipse Modeling Framework (EMF).
One of the biggest hurdles remains the "abstraction gap"—creating a formal specification for ML practices that are currently experimental and iterative. Additionally, data cleansing remains difficult to automate within an MDE framework. Future work involves fully implementing the code generators for Apache SAMOA and Apama and exploring how AutoML can be integrated to help users choose and tune their ML models during the design phase.
Summary updated