Model optimisation
The method of switching between static and online machine learning models addresses the issue of accuracy drops due to sensor drift by ensuring continuous accuracy in dynamic environments, reducing retraining needs and enhancing model resilience.
Patent Information
- Application Number
- PCT/GB2024/050702
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-04-24
- Filing Date
- 2024-03-15
- Publication Date
- 2024-09-26
AI Technical Summary
Machine learning models, especially those used in sensor data analysis, face accuracy drops due to static inference models failing to adapt to changing conditions such as sensor drift, requiring lengthy updates to regain accuracy.
A method that switches between a pre-determined static inference model and a dynamically updating online model based on performance comparisons, ensuring continued accuracy by switching when the static model's output deviates significantly from the online model's output, thereby addressing issues like sensor calibration drift.
This approach maintains prediction accuracy by seamlessly switching between models, reducing the need for frequent retraining and adapting to changing conditions, thus enhancing the resilience of machine learning models in dynamic environments.
Smart Images

Figure GB2024050702_26092024_PF_FP
Abstract
Description
[0001]MODEL OPTIMISATION FIELD OF INVENTION This application relates to model optimisation, in particular to a method of model optimisation which may be computer implemented. BACKGROUND Machine learning models are trained with data that implicitly assumes certain parameters governing the data received for inputs remains constant. For example, whether operating conditions of sensors are performing within expected tolerance ranges, as determined by a calibration procedure conducted before measurement data acquired by the sensor are used as input data for a machine learning model. A further example is an inference model trained for performing a diagnosis based on data comprising one or more physiological parameters of a patient. The inference model may be accurate for a particular demographic or lifestyle that may drift over time. If a static machine learning inference model is used while conditions change (e.g. sensors drift out of calibration), the accuracy of inference will start to drop. Online machine learning techniques are known, whereby a machine learning model can be configured to update as it performs inference. These approaches tend to need a long period to obtain a high level of accuracy. SUMMARY According to a first aspect of the invention, there is provided a method of optimising a machine learning model for determining at least one prediction from input data, comprising: determining, from a first inference model receiving the input data, a first output; determining, from a second inference model receiving the data, a second output; performing a comparison of the first output and the second output; and switching, from using the first inference model to determine at least one prediction from the input data to using the second inference model to determine the at least one prediction from the input data, when the comparison satisfies a switching criterion. The method may be computer implemented, or hardware implemented (e.g. by an ASIC or other electronic circuit). According to a second aspect, there is provided a method of calibrating one or more sensor, comprising: receiving sensor data from the one or more sensor; for each of a series of time steps: i) determining a first calibration estimate from a first inference model receiving the sensor data and ii) determining a second calibration estimate from a second inference model receiving the sensor data; iii) performing a comparison of the first calibration estimate and the second calibration estimate; over a first period of time, using the first calibration estimate to determine a measurand from the sensor data; when the comparison in step iii) satisfies a switching criterion, switching from the first inference model to the second inference model; and then over a second period of time, using the second calibration estimate from the second inference model receiving the sensor data to determine the measurand from the sensor data. The following features are applicable to both the first aspect and the second aspect. In some embodiments a change in accuracy of the output of the first inference model can be obtained, such that when the change in accuracy is significant enough to be providing an output less accurate than the second inference model, a switch in inference model can be made so that the output remains as accurate as possible. The switch in inference model may overcome issues with conditional changes to parameters used for input data into the first inference model, such as, those associated with sensor drifts of calibration data. The switching criterion may be when the first output is greater than the second output. The first inference model may be a pre-determined machine learning inference model algorithm that is not updated in use. The first inference model may be a pre-trained static (offline) machine learning inference model. The second inference model may be a dynamically adjusting machine learning model algorithm that is updated in use. The second inference model may be an online machine learning model. The first and / or second inference models may be artificial neural networks (ANNs). The first and / or second inference models may be hardware ANNs. The first and / or second inference models may emulate a hardware ANN. Determining the first output may comprise determining a difference between a current prediction from the first inference model and a previous prediction from the first inference model. Determining the second output may comprising determining a difference between a current prediction from the second inference model and a previous prediction from the second inference model. Determining the difference in prediction for the first inference model may comprise determining a sum of the square of differences between the current prediction and the preceding prediction for the first inference model. Determining the difference in prediction for the second inference model may comprise determining a sum of the square of differences between the current prediction and the preceding prediction for the second inference model. Determining the difference in prediction for each of the first inference model and the second inference model may comprise determining a mean squared error. The prediction may comprise a calibration estimate for use in calibration of each of one or more sensors. The sensors may be environmental sensors. The environmental sensors may be configured to measure at least one of: temperature, humidity, vibration, and light. At least some of the input data may be received from the one or more sensors. The sensors may be wirelessly connected to a network and the input data may be received via the network. The one or more sensors may be Internet of Things (IoT) devices. The first inference model may be trained using a cloud service, and the second inference model may be implemented in an edge node of a network. The method may comprise updating the second inference model at the edge node over time. The first inference model and the second inference model may each be implemented as one or more containers. According to a third aspect of the invention, there is provided a non-transitory machine- readable medium for configuring one or more processors to perform the method according to the first aspect or the second aspect, including any optional features thereof. According to a fourth aspect of the invention, there is provided a system for optimising a machine learning model for determining at least one prediction from input data. The system comprises: one or more sensors; a computer configured to receive input data from the one or more sensors via the network and configured to perform the method according to the first aspect, including any optional features thereof. The features of each aspect may be combined with those of any other aspect, including optional features. Embodiments of the invention will now be described, by way of example only, with reference to the accompanying drawings, in which: BRIEF DESCRIPTION OF THE DRAWINGS Figure 1 shows a simplified flow diagram of a model optimisation method according to an example embodiment; Figure 2 is a graph empirically illustrating regression performance for online and offline inference models; Figure 3 is a graph empirically illustrating how the difference in performance changes over time for online and offline inference models; Figure 4 is a graph comparing outputs from a first and second inference model with the true parameter data; Figure 5 shows an example system according to an embodiment; Figure 6 illustrates example processes in more detail; Figure 7 shows an exemplary neural network architecture; Figures 8a and 8b show message delivery success in the context of example embodiments; Figures 9a to 9d show switching times from an offline to an online inference model for different wireless sensor networking arrangements; Figures 10a to 10c show traffic flows in the context of an example embodiment; Figures 11a to 11c show quality of experience (QoE) scoring in the context of an example embodiment; and Figures 12a to 12c show model performance according to an embodiment compared with examples that do not employ model switching. DETAILED DESCRIPTION In general, a machine learning algorithm will comprise one or more weights, which are model parameters that are adjusted during training to cause the model to improve the accuracy with which it predicts a desired output from the input data. The term “offline” may be used to describe an algorithm in which one or more weights are fixed and not adjustable while the model is online. The term “online” may be used to describe an algorithm in which the one or more weights are subject to adjustment while the model is online (e.g. in order to improve the performance of the model). Figure 1 shows a method 100 according to an embodiment. At step 101 input data is obtained and provided to each of a first inference model and a second inference model. The input data may comprise measurements from sensors, or any other information. The first inference model and the second inference model may each be computer implemented, and may comprise any suitable machine learning algorithm. The first inference model and the second inference model may each be implemented on hardware. An example of a suitable machine learning algorithm is an artificial neural network, ANN. The first and / or second model may emulate a hardware ANN. In some embodiments, the first inference model comprises an offline machine learning model and the second machine learning model comprises an online machine learning model. At step 102, inference is performed using the first inference model and a first output is determined from that inference. The first inference model receives the input data, makes a prediction. The prediction may comprise an estimate for one or more parameters, and / or one or more classifications. The prediction is used to determine the first output. The first output may be determined based on a comparison between a current prediction and a previous prediction from the first inference model. The comparison may comprise subtracting the previous prediction from the current prediction. At step 103 (which is depicted as parallel with step 102, but may be serial in some embodiments), inference is performed using the second inference model and a second output is determined from that inference. The second inference model receives the input data, makes a prediction (of the same sort as that produced by the first inference model), and the prediction is used to determine the second output. The second output may be determined based on a comparison between a current prediction and a previous prediction from the second inference model. The comparison may comprise subtracting the previous prediction from the current prediction. At step 104 a comparison is made between the first output and the second output. The comparison may comprise determining which is greater: the first output or the second output. At step 105, a determination is made as to whether a switching criteria is met by the comparison between the first output and the second output. In an example embodiment, the switching criteria is that the first output is greater than (or equal to) the second output. If the switching criteria is met, a switch may be made, from using the first inference model to perform inference to using the second inference model to perform inference. An example solution approach for determining an optimal switching time that is useful for understanding the invention is discussed below, with reference to a simplified polynomial regression problem. Let ^^1and ^^2be two polynomial regression prediction models of second degree, such that: Formula (1) defines an offline polynomial regression prediction model, which may be trained in the cloud. Constant ^^ and weight ^^ remain constant until the model is retrained. In contrast, formula (2) describes polynomial regression according to an online polynomial regression prediction model. Instead of the invariant or static weight factors in (1), parameters ^^( ^^) and ^^( ^^) in (2) vary over time (e.g. in response to input data), and thus are able to capture dynamics and adapt to dataset shifts. Both models may be deployed in the field (e.g. implemented in one or more processors that receive sensor data, which may be in an edge computing node). The option may consequently exist to use either model for inference. Optimal switching between such models requires some system or method that can predict and / or monitor the models’ performance as they are running. Being able to identify an optimal (or at least good) time to switch between a first and second inference model may also reduce the need for retraining of model weights (which typically requires significant computing resources). Furthermore, online training may enable out-of-core machine learning, which is well suited to implementation at edge nodes. A performance comparison between the two models (online and offline) may be based on how accurately they predict real data points. The real data points are independent and identically distributed based on a continuous distribution, namely ^^( ^^). This distribution yields values that vary over time; hence the models’ performance varies as well. The accuracy of the models decreases or increases with the volatility of ^^( ^^). The deviation and convergence between the models, as well as the real prediction points, define the performances of the models, respectively termed ^^1and ^^2: ^^1 = ^^1 − ^^(^^) (3)^^2= ^^2− ^^( ^^) (4) Both formulas (3) and (4) predict model performances ^^1and ^^2. Based on empirical observation, the performance between offline and online models typically follows the overall trend that is illustrated in Figure 2. The offline model performance ^^1starts off high. In contrast, the online model might be expected to perform similarly to the offline model, but due to online training of model weights (e.g. ^^ and ^^) the online model performance ^^2may initially be low, as depicted in Figure 2. Over time, the performance of the offline ^^1is expected to decrease, and the performance of the online model ^^2is expected to increase. A time ^^0can be identified in Figure 2 at which the performance ^^1= ^^2: where the two lines cross on the graph. The difference between the performance of the first model and second model ^^ may be defined as: ^^(^^)= ^^1(^^)− ^^2(^^) (5)Figure 3 plots an example performance difference curve in order to provide a visual guide to the concept of finding a good time to switch between the first model and second model. In this representation, ^^0is the point at which the ^^ curve intersects the ^^ = 0 axis. Based on these empirical observations, we can define the following conditions: ^^( ^^0) = 0 (6) Without loss of generality, we can proceed by simplifying both (6) and (7). Figure 4 is used to develop an analysis and a solution approach for identifying (or approximating) ^^0and thus enabling a seamless switch between first and second inference models. As shown in the graph of Figure 4, the output ^^2from the online (second) machine learning model increases according to a reference line ^^( ^^): ^^(^^)= ^^ ⋅ ^^ + ^^(8)In order for this to occur, ^^( ^^) in (2) changes with time. For the sake of simplicity and without loss of generality, we consider ^^ to be constant in this analysis. In accordance with Figure 4 and based on the empirical distribution ^^( ^^), what follows are slight variations over time (represented in Figure 4 as successive falls and rises in ^^1and ^^2), but convergence between ^^1and ^^2eventually occurs. With an approximation, we can conclude that ^^( ^^) = ^^( ^^) or ^^( ^^) = ^^ ⋅ ^^ + ^^ and ^^2= ^^ ⋅ ^^ + ^^ + ^^ ⋅ ^^2Due to (5), the above results in: Based on the extremum condition of (7) we have that: ^^ ^^( ^^) = 2 ⋅ ( ^^ − ^^) ⋅ ^^ − ^^ ^^ ^^ and because (7) equals zero, we can show that: ^^0 = ^^2( ^^ − ^^)(10)In accordance with (6), ^^( ^^0) = 0, thus By substitution of ^^0 with (10), we have0 or ^^2^^ − ^^ =4( ^^ − ^^)from which we can derive that: Replacing ^^ from (12) in (10) implies that: Hence: We can now proceed with an approximation solution to (13) that allows the definition of a time that a switch from a first (e.g. offline) model to a second (e.g. online) model will maximise performance (and preferably be seamless). Coefficients ^^, ^^, ^^ and ^^ are defined. The values of the output of the first model and second model are stored at time ^^ = 0 (i.e. ^^1(0)and ^^2(0)are stored). Because ^^1= ^^ + ^^ ⋅ ^^2and at ^^ = 0 we have ^^1= ^^ and ^^2= ^^(0). Additionally, from ^^(^^)defined in (8) we have ^^ = ^^ ⋅ ^^ + ^^, thus we can derive that ^^ = ^^ for ^^ = 0, with the result that ^^2(0) = ^^(0) = ^^. Therefore, in (13) we observe the difference ^^ − ^^ = ^^1(0)− ^^2(0), so let: ^^ − ^^ = ^^0(14) Next the difference ^^ − ^^ can be determined by storing the data from first model and second model during the period ^^1= 1 minute, which yields ^^1( ^^1) = ^^ + ^^ ^^12and 1 minute ^^1= ^^ + ^^. By replacing ^^ with (12) we conclude − ^^1− ^^ or We already have ^^ − ^^ = ^^0from (14) and by setting ^^ = ^^ = ^^, the equation above can be which can be written as Based on the above, (13) can be revisited as: where ^^ is as defined in equation (16). Note that ^^0= ^^^^(0)− ^^2(0) and ^^ = ^^1( ^^1)− ^^2( ^^1) for ^^ = 1 minute. With (17), two estimates for ^^0can be determined, from which the larger value will always be selected. The solution defined above can be generalised. An algorithm may be defined for determining a good / optimal switching time between the first model and the second model. In the specific case of second degree regression which is discussed above, the first algorithm listed below may be used: Algorithm 1 RTMEQ for second degree regression Input: ^^ ^^ ^^ ^^, ^^ ^^ ^^ ^^1, ^^ ^^ ^^ ^^2, ^^ ^^, ^^1, ^^2Output: ^^0while ^^ ^^ ^^ ^^ do if if ^^ = ^^ ^^ ^^ ^^1then ^^1[0] ← ^^ ^^. ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^( ^^) ^^2[0]← ^^ ^^. ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^( ^^) ^^0← ^^1[0]− ^^2[0] then ^^ ^^ ^^ ^^ ^^ ^^ ^^(^^)^^ ^^ ^^ ^^ ^^ ^^ ^^( ^^) [1] The above algorithm provides input data ^^ ^^. ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^( ^^) to each of the first model and second model ( ^^1and ^^2respectively) at times corresponding with ^^ ^^ ^^ ^^1and ^^ ^^ ^^ ^^2. At a first time (corresponding with ^^ ^^ ^^ ^^1) an output from the first model and the second model are compared ( ^^0is defined as the difference between the output from the first model and the output from the second model). At a second time (corresponding with ^^ ^^ ^^ ^^2) an output from the first model and the second model are again compared ( ^^ is defined as the difference between the output from the first model and the output from the second model). The optimal switching time ^^0is determined in reliance on the comparisons between the outputs of the first and second models (as defined in the final step). This algorithm has a worst case complexity of ^^( ^^2). In the more general case of ^^ degree regression, the following algorithm may be used: Algorithm 2 RTMEQ for ^^ degree regression Input: ^^ ^^ ^^ ^^, ^^ ^^ ^^ ^^1, ^^ ^^ ^^ ^^2, ^^ ^^, ^^1, ^^2Output: ^^0 do )2)2 ^^ ^^ ^^ ^^ ← ^^ ^^. ^^ ^^ ^^ ^^() while ^^ ^^ ^^1 > ^^ ^^ ^^2 ^^0← ^^ ^^ ^^ ^^ In this algorithm, it is assumed that each of the first and second model are predicting a number of parameters, the number defined by the parameter ^^ ^^ ^^ ^^. Each iteration of the do-while loop corresponds to a different time step. At each iteration of the loop, the current prediction ^^1for each of the ^^ ^^ ^^ ^^ parameters from the first model is compared with the previous prediction ^^ ^^. ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ for each of the ^^ ^^ ^^ ^^ parameters from the first model: the difference between the current prediction and the previous prediction is determined, squared and then averaged over ^^ = 1 to ^^ ^^ ^^ ^^ to determine ^^ ^^ ^^1. Similarly, at each iteration of the loop, the current prediction ^^2for each of the ^^ ^^ ^^ ^^ parameters from the second model is compared with the previous prediction ^^ ^^. ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ for each of the ^^ ^^ ^^ ^^ parameters from the second model: the difference between the current prediction and the previous prediction is determined, squared and then averaged over ^^ = 1 to ^^ ^^ ^^ ^^ to determine ^^ ^^ ^^2. The time ^^ ^^. ^^ ^^ ^^ ^^ associated with the current step of the loop is stored as ^^ ^^ ^^ ^^. The optimal switching time is identified as when the time at which ^^ ^^ ^^2 ≥ ^^ ^^ ^^1, because that criteria will not satisfy the while condition of the loop. This algorithm has a worst case complexity of ^^( ^^ + ^^2). Figure 5 shows an example system 200 according to an embodiment. The system 200 comprises one or more wireless sensor 201, edge network 202, multi-access edge computing platform 203 and cloud services 250. The wireless sensor network 201 comprises one or more devices that obtain data (e.g. based on measurements), and which are connected to the edge network 202 (e.g. wirelessly). In some embodiments, the one or more devices comprise internet of things (IoT) devices that include environmental sensors (e.g. temperature, humidity, vibration, light etc). For example, an output ^^ from one or more sensor may be related to a measurand ^^ via a calibration ^^( ^^) so that ^^(^^)= ^^. The function ^^( ^^) may be linear, for example comprising a constant of proportionality and an offset. In other embodiments the function may be more complex. In some embodiments, the one or more devices may comprise network monitoring devices that monitor traffic and / or quality of service in a network. The edge network 202 connects the wireless sensor network to the internet. The multi access edge computing (MEC) platform 203 comprises one or more computing nodes in which a number of software components are implemented. The software components implemented in the MEC platform 203 comprise: services orchestrator 220, edge IoT platform 204, edge machine learning (ML) platform 207 and real time model evaluation technique (RTMEQ) 211. The services orchestrator 220 is an orchestration component that initialises and coordinates the other software components implemented in the MEC platform 203, including: edge IoT platform 204, edge machine learning platform 207, and RTMEQ 211. Each of these software components (which may also be termed services) may be initialised as pods comprising one or more virtualised containers suitable for running in any suitable computing environment. The services orchestrator 220 may also provision connectivity configurations that enable information to be exchanged between the various services (and between these components and the cloud services 250). The edge IoT platform 204 is configured to collect data from the wireless sensor network 202 and any other sources of information that may be required for inference by the models implemented in the edge machine learning platform 207 and the RTME 211. The edge IoT platform 204 has two components: a communication agent 206 that enables data protocols (e.g. MQTT, COAP, AMQP, HTTP) and a data broker 206 that create services per wireless sensor node. The edge IoT platform 204 may be configured to serve inference models with data automatically so that the models can perform prediction. The edge ML platform 207 is configured to receive one or more machine learning inference models from the cloud services 250, and prepare an inference model (e.g. the first inference model of Figure 1) for performing inference (i.e. to determine predicted parameters from the input data received from the edge network 202). The edge ML platform 207 may comprise a converter 208, interpreter 209 and serving model 210. The serving model 210 implements an inference model (e.g. the first inference model). The converter 208 may be configured to receive an inference model from the cloud services 250, and convert this model into a version that can be run on an edge node, which may have computational and / or memory constraints. The interpreter 209 may provide a compatibility layer that enables the serving model 210 to efficiently run machine learning models on a wide range of different computer architectures. The RTMEQ 211 may be configured to clone the offline inference model that is implemented in the edge ML platform 207 into an online inference model that has incremental learning abilities (i.e. the second inference model in the method of Figure 1). The online inference model weights can be updated within the RTME 211 service without recourse to cloud services 250. The second inference model, implemented in the RTME service 211, may comprise one or more docker containers (e.g. in the case that it is implemented using Kubernetes). This enables orchestration of the inference model (and other functions) as a virtual network function or a micro-service which may be a key enabler for deploying and managing services in a MEC platform 203. The RTMEQ 211 comprises a real time model evaluator RTME 216 that is configured to evaluate the output of the inference model running on the edge ML platform 207 and to evaluate the output of the online inference model that is running in the RTMEQ 211. The evaluation of the model may be in accordance with algorithm 2, described above, and may occur in real time (without interruption of the models performing inference). When the performance of the offline model implemented in the edge ML platform 207 starts to degrade, the RTMEQ 211 switches the serving model (providing parameter estimates to a user) to the online inference model that is running in the RTMEQ 211. The cloud services 250 include: cloud orchestrator 251, IoT platform 254, big data 253, and AI platform 252. The cloud orchestrator 251 is configured to provide service control, scheduling and deployment of containers. The cloud orchestrator 251 is also responsible for connectivity provisioning between MEC platform 203 and the cloud services 250. The IoT platform 254 is responsible for collecting, storing and analysing data received from field wireless sensors and wireless sensor networks. The data may be used in training process for the inference models used in embodiments. The big data service 253 is configured to store data for any services that require this, and may hold historical data. Each IoT service collecting data may have the option of storing or streaming their data in the big data service 253. The AI platform 252 may control the training of machine learning models and the deployment of machine learning models to the MEC platform 203. Figure 6 shows example processes in more detail. In step 303 an offline model 301 (model x, corresponding with the first inference model in Figure 1) is trained in the cloud. In step 304 the model is saved, for example as a docker container or a set of docker containers, thereby enabling deployment and orchestration of the models as virtual network functions or micro-services. The orchestration step 305 provides for communication and automation of the offline model 301 deployment to the MEC platform on which it will run. Figure 6 depicts steps from p1 to p6, showing what is occurring in each of: cloud Kubernetes 308, MEC platform 309 generally and RTMEQ 310 (implemented within the MEC platform 309). In step p1, the offline model x (i.e. the first inference model) is deployed as one or more containers to the MEC platform 309 from the cloud. In step p2, a communication channel is opened for the offline model x (e.g. HTTP is enabled), thereby enabling API responses from the offline model x. In step p3 the RTMEQ replicates model x as online model r (model r being the second inference model). A communication channel is opened to the online model r so that it can be provided with input data (e.g. from wireless sensor network) to enable model evaluation. At p4 the model evaluation starts, and p5 shows that online model r receives the same input data as offline model x. The user is provided with inference results from model x until it is determined that a switching criteria is met, which indicates that it is a good time to switch from model x to model r. The user may be sent the inference results from the cloud to a local machine. The cloud therefore sends a message to a local machine. At step p6 the RTMEQ identifies that the switching criteria is met, and requests that the “in service” model is switched from model x to model r. The user may be sent a message by the RTMEQ to a local machine that a request to switch from model x to model r has been made. The MEC 309 subsequently uses model r as the model used for production 311 of inference results to the user. Figure 7 provides an illustrative example of an inference model 400 according to an embodiment. The inference model 400 is an artificial neural network (ANN), comprising an input layer 401 (receiving the input data), hidden layers 402 and an output layer 403. The inference model 400 may be a hardware ANN or an emulated hardware ANN. In this example the input data comprises environmental sensor data from an IoT sensor node, and the output layer comprises a calibration estimate (which may be a percentage calibration required for sensors). The ANN may be a hardware ANN or an emulated hardware ANN. An experimental evaluation was conducted at the University of Bristol. The testbed comprised a 5G test network and wireless technologies include 5G radio, SDN enabled WiFi, Bluetooth Low Energy (BLE) and wireless conversion from ipv6 to ipv4. The testbed network is integrated with virtualised MEC services. The test hosted 52 sensor devices that are divided into twenty cellular sensors, twenty WiFi sensors, six 802.15.4 constrained sensor nodes and 4 BLE wearable devices. A polynomial regression model was trained to predict the percentage of calibration required for the sensors. The model was trained for different sensor types (5G, 802.15.4, WiFi and BLE). A dataset was constructed by accumulating time-series data from all the sensors. The dataset comprised 4 million messages including sensory and networking data. An inference model was implemented as an artificial neural network implemented in TensorFlow with six densely connected hidden layers and an output layer that predicts the calibration percentage required (e.g. as shown in Figure 7). For training, 80% of the dataset was used, with 20% of the dataset used for validation. During the training process the input data was defined as vectors ^^ comprising different parameters (such as temperature, humidity, light, vibration, angular velocity, air pressure, packet loss and packet latency). The input data is provided to the input layer of the ANN. The ANN was trained, based on known calibration values, to determine parameters and hyperparameters that include: the number of hidden neurons, biases for the neurons, and weights of interconnections between neurons. The training process was minimises the mean squared error between the ANN output and the training data (but other loss functions can be used). After training, the ANN is used to predict the calibration values at a given node by using the trained ANN. Figure 8a and 8b present the performance of orchestrating ML models as microservices over time from a cloud orchestrator to MEC nodes and from an edge orchestrator to MEC nodes, respectively. Experiments are divided into different samples (S) of 1000, 2000, and 4000, and the average success ratio is given with a confidence interval of 95%. Furthermore, the message delivery ratio of the WSNs is also modified to realistically test the orchestration behaviour over 25, 50, and 100 messages per hour per sensor. The success ratio is calculated by measuring the faults generated and not by terminated deployments. In the cloud orchestration scenario, the success ratio is always around 91% to 93%, and the network throughput is irrelevant in all cases. Similarly, in the edge orchestration, the network throughput is not affecting the success ratio; however, the minimal latency increases the reliability of deployment to almost 100%. Experiments to investigate switching between online and offline models were conducted for all wireless sensor types and the results are shown in Figure 9 for a) WiFi, b) cellular, c) 802.15.4, and d) BLE. The following conclusions can be drawn from the results 1) The performance of RTMEQ for 100 experiments and WiFi WSN improves when the WSN data transition rate is increased. As seen in Figure 9a, the average switching time for a traffic of 10 messages per minute is around 4 minutes, and it slightly decreases to less than 4 minutes for doubling WSN data. Interestingly, a further decline of the switch time occurs for x4 and x8 traffic of almost 40%. 2) There is no observation of any different behaviour of RTMEQ for cellular WSN setup. Figure 9b shows a similar RTMEQ performance as in the case of WiFi setup with some deviation in the average switching time. 3) In Figure 9c the results for a 802.15.4 sensor network are depicted; here, there is a translation from IPv6 to IPv4. No differences are seen in the RTMEQ performance in this setup as well. 4) Finally, in Figure 9d, results for a BLE sensor network is shown, which indicates some variability in the RTMEQ performance numbers. However, the general trend remains the same. The traffic of the MEC node was observed throughout a one hour experiment where dataset shift is imposed. Figure 10a shows the traffic that is generated overall in the MEC node and specifically the traffic generated by RTMEQ. The RTMEQ pod ingress and egress traffic is constantly between ~5% and ~9% of maximum traffic levels for the MEC node. The traffic of each container of RTMEQ can be monitored when the dataset shift occurs. As illustrated in Figure 10b, the traffic generated from RTMEQ is increased 2 mins after the dataset shift is introduced. This reaction of RTMEQ to dataset shift is expected since the communication with the edge platform is initiated once RTMEQ needs to redirect the sensor traffic (input data) from the offline model to the online model. When the later action is completed, RTMEQ drops down to the previous traffic percentage and maintains only the monitoring procedure. Finally, in Figure 10c the traffic per RTMEQ container is presented for the same juncture of time when dataset shift is introduced. The general conclusion is that there is no strong correlation between the performance and the wireless technology that the sensor network utilizes. Moreover, these experiments indicate an auspicious performance feature: the more traffic, the better the performance. This outcome is due to the algorithms presented in earlier sections, where the more frequent the data rate is, the more information is available to detect the proper time to switch from the poorly performing offline inference model to the online inference model. In Figure 11 a Mean Opinion Score (MOS) is used as a QoE (Quality of Experience) indicator to assess improvement from model switching for time-critical IoT applications. We measure the time the ML model services are "down" and not responding to requests adequately as they require further training. Figure 11 presents the data from experimentation using models hosted and served from the cloud and edge respectively. Different severities of dataset shift are used: mild, moderate and severe. In Figure 11a, the dataset shift is mild, and we observe a MOS of approximately 2 for the cloud hosting experiments. In the same scenario for edge hosting, the MOS for RTMEQ is significantly better as it improves more than 40% for the x4 network traffic scenario. Figure 11b includes the data from the moderate dataset shift. In this case, both cloud and edge experiments report a reduced MOS; however, the behaviour of RTMEQ is still similar. Figure 11c shows the data from a severe dataset shift. Figure 12 presents the results of experimentation during 10 hours for different scenarios of IoT deployments and observing the performance of an offline model (Static-ML) 502, online model 501, and RTMEQ 503 (which switches between offline and online model). The three models are deployed in production and are provided similar input data. The output data is compared to actual values required for sensor calibration. At the end of the second hour severe dataset shift is introduced. Figure 12a depicts the data for a small IoT scenario deployment. After introducing dataset shift the cloud model declines significantly and does not recover. The online model is affected momentarily and then increases in performance as it adapts to the dataset shift. RTMEQ success rate improves performance over using an online learning only by 30% at the critical time of the dataset shift and then performance converges. Similar behaviour is observed for medium and massive IoT deployments (Figure 12b, 12c), with some differences in success rate for the cloud model where the initial performance is increased due to the more data points available for training. RTMEQ and online learning models suffer a drop in performance right after the dataset shift. However they are maintaining the incremental success rate over time with RTMEQ maintaining an approximate 30% improvement of success rate compared to the online learning. These results provide more confidence that offline and online cooperative models provide improved resilience in production / mission critical IoT applications. The examples disclosed herein shown that online inference models perform well in the context of edge computing nodes. Incremental learning in the example embodiments used CRÈME1, but other suitable toolsets may also be used. Various modifications will be apparent to the skilled person without departing form the scope of the claims. The embodiments described above should be understood as exemplary only. Any feature of any of the aspects or embodiments of the disclosure may be employed separately or in combination with any other feature of the same or different aspect or embodiment of the disclosure and the disclosure includes any feature or combination of features disclosed herein.1M. Halford, G. Bolmier, R. Sourty, R. Vaysse, and A. Zouitine, “creme, a Python library for online machine learning,” 2019. [Online]. Available: https: / / github.com / MaxHalford / creme
Claims
CLAIMS 1. A method of calibrating one or more sensor, comprising: receiving sensor data from the one or more sensor; for each of a series of time steps: i) determining a first calibration estimate from a first inference model receiving the sensor data and ii) determining a second calibration estimate from a second inference model receiving the sensor data; iii) performing a comparison of the first calibration estimate and the second calibration estimate; over a first period of time, using the first calibration estimate to determine a measurand from the sensor data; when the comparison in step iii) satisfies a switching criterion, switching from the first inference model to the second inference model; and then over a second period of time, using the second calibration estimate from the second inference model receiving the sensor data to determine the measurand from the sensor data.
2. The method according to claim 1, wherein the switching criterion is when the first output is greater than the second output.
3. The method according to claim 1 or claim 2, wherein the first inference model is a pre-determined machine learning inference model algorithm that is not updated in use.
4. The method according to any preceding claim, wherein the second inference model is a dynamically adjusting machine learning model algorithm that is updated in use.
5. The method according to claim any preceding claim, wherein determining the first output comprises determining a difference between a current prediction from the first inference model and a previous prediction from the first inference model.
6. The method according to any preceding claim, wherein determining the second output comprises determining a difference between a current prediction from the second inference model and a previous prediction from the second inference model.
7. The method according to claim 6, including the subject matter of claim 5, wherein determining the difference in prediction for the first inference model comprises determining a sum of the square of differences between the current prediction and the preceding prediction for the first inference model, and determining a difference in prediction for the second inference model comprises determining a sum of the square of differences between the current prediction and the preceding prediction for the second inference model.
8. The method of claim 7, wherein determining the difference in prediction for each of the first inference model and the second inference model comprises determining a mean squared error.
9. The method of claim 9 or 10, wherein the one or more sensor is: wirelessly connected to a network and the input data is received via the network; and / or Internet of Things devices.
10. The method of any preceding claim, wherein the first inference model is trained using a cloud service, and the second inference model is implemented in an edge node of a network, and the method comprises updating the second inference model at the edge node over time.
11. The method of any preceding claim, wherein the first inference model and the second inference model are each implemented as one or more containers.
12. A non-transitory machine-readable medium for configuring one or more processors to perform the method according to any preceding claim.
13. A system for optimising a machine learning model for determining at least one prediction from input data, the system comprising: one or more sensors;a network a computer configured to receive input data from the one or more sensors via the network and configured to perform the method of any of claims 1 to 11.
14. A computer implemented method of optimising a machine learning model for determining at least one prediction from input data, comprising: determining, from a first inference model receiving the input data, a first output; determining, from a second inference model receiving the input data, a second output; performing a comparison of the first output and the second output; and switching, from using the first inference model to determine at least one prediction from the input data to using the second inference model to determine the at least one prediction from the input data, when the comparison satisfies a switching criterion.
Citation Information
Patent Citations
Intelligent Edge Computing Platform with Machine Learning Capability
US20200327371A1
Anomaly and outlier explanation generation for data ingested to a data intake and query system
US20220358124A1
