Analysis of Machine Learning Approach for the mode model in SWC Mapping in Automotive Systems

Automotive technologies are ever-increasingly becoming digital. Highly autonomous driving together with digital E/E control mechanisms include thousands of software applications which are called as software components. Together with the industry requirements, and rigorous software development processes, mapping of components as a software pool becomes very difficult. This article analyses and discusses the integration possibilities of machine learning approaches to our previously introduced concept of mapping of software components through a common software pool. Keywords— Automotive, Machine Learning, Software


I. INTRODUCTION
The last two decades, have shown an exponential growth in digitalization of the automotive industry. Recent trends are evolving for high performance computing in cars, further on leading to autonomous driving. [11] A complete system methodology that also includes all the requirements and generates a SW-HW resource allocation map is however still missing for ease of development. The ECUs developed in such cases are then static and execute the components on it. Researches [8] [4] already exist that show more efficient usage of hardware resources by improvising mapping methods.
Standard and requirements 1  The above mentioned requirements are some of the most widely used. However, they only address problems related to development and deployment. With growth of high performance computing in cars, the problem for defining a dynamic functional system still persists. Adherence to the standards that are already existing is just another hurdle.

Machine Learning
Machine learning is a part of the artificial intelligence, which focus is on study of algorithms that can improve through experience [10]. The idea behind machine learning is to create a mathematical model based on a set of input data also known as "training data", in order to be able to make prediction or decision on future data without being explicitly programmed. Machine learning can be applied in different area of computer science such as data analysis, email filtering, computer vision etc.

II. RESEARCH FOCUS
A methodology for achieving a complete system wide mapping scheme has been proposed in [11]. As already mentioned in requirements section, there are several aspects that need to be considered when developing software for automotive ECUs. The proposed method works on the basis four main models: safety, resource, mode and scheduling. One of the most important is the "Mode Model". This article focuses on the analysis of machine learning approaches for the mode model in SWC mapping in automotive systems.

Mapping Problem
In a modern fully equipped car, there are more than 10,000 software components that perform functionalities in different domain of an automotive system such as comfort, driving, multimedia etc [11]. The main problem is the mapping of this big amount of software components into a finite limited number of computational resources, which in turn makes it a NP-hard problem. Furthermore taking into consideration the heterogeneous nature of the vehicular system and the functional requirements of the SWCs themselves adds more complexity to calculate the possible number of solutions.  Figure 1 shows the overall concept that is planned to achieve a solution for the mentioned mapping problem. One of the main aspects used for it is the mode model. This model is a set of functionalities that is mapped to different vehicular states. It is then analyzed for functionalities that can share the hardware while executing in real-time. Mode model is the first set of inputs that is applied in the given concept to generate mapping schema. Therefore, an impact that leads to a change in mode model will lead to change in the overall mapping scheme.

Mode model and Machine Learning
Mode model is pre-given set of inputs that determine the set of SWCs that are active in any given vehicular state. Certainly, being a manual input, there are chances of mistakes and since it is given for the whole system, it needs to be verified before actual deployment and during prototyping. Applying AI techniques by consideration of parameters like, application use cases, sensor data, deadlines, context switching time, latencies etc., can help in predicting the next state, so that the application is able to fully execute in real-time. Mode model as shown in the Figure 2, one can see a set of diagram of Finite State Machines (FSMs) that is generated upon a set of inputs. The picture below shows a more concrete example of its implementation in the original concept. [11] Each individual rectangle is a state of the vehicle where it holds applications' functional requirements' information. Not all applications are needed in every state in theory and therefore it can be determined which applications can be turned off in a nonpertinent state. In the figure [11] the FSM with speed is the main FSM where the FSMs of other functionalities are used based on the scenario in which they are needed. In practice, switching contexts and restarting applications is not feasible, as since every application might need different requirements and resources. All the different parameters for mapping are analyzed and predetermined based on individual functionality (SWC) and provided as a given to the overall mapping system. The improvisation of the parameters that are required, for instance a sleep-wake time, is where artificial intelligence can be considered for our concept and implementation. An improvisation, in this context, will also affect the mode model based on already given inputs because applications are mapped dynamically. Therefore, it is not predetermined, the exact resource and SWCs running on it. To improvise the state diagram for such a dynamic mapping, machine learning can be beneficial. Machine learning algorithms are divided into three main groups based on the learning approach and feedback [1]: 1. Supervised learning in which the computer is given a set of input data and the desired output. In this approach the goal is to create an algorithm based on a mathematical model to map the given input data to the desired output. 2. Unsupervised learning in which there is no need to provide a label or a correlation between input data and the desired output, leaving it to the machine to find the correlation and create an algorithm based on it. 3. Reinforcement learning in which the machine interacts with a dynamic system and it needs to make decision to reach a certain goal, based on every decision that the model makes it is provided with a feedback and a reward if the decision was correct. The mode model describes a set of mode in which the machine runs and the application or functionalities that are enabled based on that specific mode. Supervised learning cannot be applied in this context because of the nature of the model, in which we do not have fixed inputs that leads to a specific output. For example, a subset of application that are enabled in a specific mode can also be enabled in another mode, this will lead to ~ 19 ~ the same set of input defining two different output and the machine will not be able to create a mathematical model to create the correlation between the set of input application and the desired output mode. In addition, further application that will be added to the system will not be assigned to execute only to a specific mode in which the system is running, so this makes it impossible to create an algorithm to predict the mapping of the new added application to a specific mode. Reinforcement learning learns how to control data [3] and this makes it suitable for this case because of it nature that needs to reach a certain goal and maximize the rewards that it receives when it makes a correct prediction, which is not the case in mode model where it needs to decide whether an application is available or not in that specific case. Unsupervised learning is the only possible method in which it can be argued whether mode model can be implemented or no. The only problem when considering this approach is that it tries to create itself an algorithm to relate the input data and make decision or predict an output, but in this case, it can be that there is no relation between different input data and the output data, so even though the machine created a model it can lead to wrong prediction.

IV. REALISATION
The first step in realisation is dividing the set of input data into input training data and test data. The next step is decision of which machine learning approach is going to be used to create the mathematical model to make the future predictions. To make the realisation process easier python can be used by importing libraries such as "sklearn", which provide dozens of built-in machine learning algorithm and models [2]. In the presented mode model, the set of input variable will be composed of different scenario values, sensor data received from different ECU`s, safety requirements, deadlines, context switching etc. The permutation of all the variables will create an enormous set of test cases that are needed to verify and improve an already given set of modes. Another problem that needs to be taken into consideration is that the prediction accuracy can never be 100 percent, which in safety critical system such as automotive system may lead to hazardous situation even loss of human life. The output in the mode model will be the prediction of the modes in which applications can be executed based on the set of input data. Reinforcement learning can be used in this case to predict the immediate next states and applications used in it without a human input and gain a reward in the case of a successful change of state. As also shown in picture 3 the agent is the machine which is making a prediction or a decision that will be affected by the environment variables and then it would get feedback, if the machine made the right decision it will get a reward and move forward perform the same loop again. Regression tree is another machine learning models, which can be applied in this case due to its tree based structure which will fit the mode model system approach. The drawback in using machine learning to predict the next state in mode model is the statistical nature, which makes it not feasible in a safety critical system such as automotive in which the execution behavior of the component shall be fixed to avoid hazardous situation that may lead to the loss of human life. The use of machine learning in this case is for feedback purposes.

V. CONCLUSION AND OUTLOOK
The mode model is a concept that can create a functional map of the intended system based on the vehicular states. It shows the active SWCs at any instance of time. For Practical realisation of the mode model along with all the automotive requirements, the future state corresponding to any needs to be known in order to provide a smooth transitioning of applications when maximising system efficiency.
With machine learning approach, only overall system feedback is feasible. This can only be achieved by a vehicle simulation or HIL(Hardware-In-Loop)/VIL(Vehicle-In-Loop) eventually making the whole process much more expensive and exhaustive. A huge set of scenarios is required where the learning method becomes appropriate for rewards method to function will require manual human inputs and can take very long.
The approach can however be still beneficial once the whole system mapping is completed and parameters like scheduling deadlines can be optimised based on a real-time feedback. The analysis of which, we propose as future work. For the mode model and its prediction, another AI algorithm like the RETE [7] net can be feasible, where no training set is required