CN115879569B - Online learning method and system for IoT observation data - Google Patents
Online learning method and system for IoT observation data Download PDFInfo
- Publication number
- CN115879569B CN115879569B CN202310214205.9A CN202310214205A CN115879569B CN 115879569 B CN115879569 B CN 115879569B CN 202310214205 A CN202310214205 A CN 202310214205A CN 115879569 B CN115879569 B CN 115879569B
- Authority
- CN
- China
- Prior art keywords
- normal distribution
- distribution
- data
- value
- quasi
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 65
- 238000009826 distribution Methods 0.000 claims abstract description 120
- 238000013136 deep learning model Methods 0.000 claims abstract description 44
- 230000008569 process Effects 0.000 claims abstract description 25
- 238000012545 processing Methods 0.000 claims abstract description 13
- 230000004927 fusion Effects 0.000 claims description 22
- 230000006870 function Effects 0.000 claims description 19
- 238000005070 sampling Methods 0.000 claims description 18
- 238000013461 design Methods 0.000 claims description 6
- 230000007246 mechanism Effects 0.000 claims description 6
- 238000004422 calculation algorithm Methods 0.000 claims description 5
- 238000013528 artificial neural network Methods 0.000 claims description 4
- 238000011478 gradient descent method Methods 0.000 claims description 3
- 239000004744 fabric Substances 0.000 claims 1
- 230000008685 targeting Effects 0.000 claims 1
- 238000012549 training Methods 0.000 description 8
- 239000013598 vector Substances 0.000 description 8
- 238000010586 diagram Methods 0.000 description 6
- 230000008859 change Effects 0.000 description 5
- 238000013135 deep learning Methods 0.000 description 5
- 238000012544 monitoring process Methods 0.000 description 4
- 230000015556 catabolic process Effects 0.000 description 3
- 238000006731 degradation reaction Methods 0.000 description 3
- 238000013473 artificial intelligence Methods 0.000 description 2
- 230000007547 defect Effects 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 230000006872 improvement Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000002411 adverse Effects 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000015572 biosynthetic process Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000007405 data analysis Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
- 230000007774 longterm Effects 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- YHXISWVBGDMDLQ-UHFFFAOYSA-N moclobemide Chemical compound C1=CC(Cl)=CC=C1C(=O)NCCN1CCOCC1 YHXISWVBGDMDLQ-UHFFFAOYSA-N 0.000 description 1
- 238000003062 neural network model Methods 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
- 238000010223 real-time analysis Methods 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 230000000717 retained effect Effects 0.000 description 1
- 238000007493 shaping process Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000013179 statistical model Methods 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Images
Landscapes
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention provides an online learning method and an online learning system for internet traffic (IoT) observation data, which relate to the technical field of data processing and initialize an online deep learning model according to acquired initial time sequence observation data; acquiring time sequence observation data generated by a sensor in real time, and forming an input data stream according to the time sequence observation data; processing an input data stream by an online deep learning model to generate a final prediction result; in the process of processing the input data stream, the input data stream is subjected to instant learning, and an online deep learning model is dynamically updated in real time; the instant learning is to learn data distribution based on the mean value and variance of data flow, construct quasi-normal distribution, reconstruct new sample, realize the variable-distribution attention network, and dynamically adjust the model based on distribution difference, reconstruction difference and reasoning difference; the invention learns the hidden information between different hidden layers, improves the accuracy of model reasoning, and dynamically adjusts the parameters between different hidden layers through online learning.
Description
Technical Field
The invention belongs to the technical field of data processing, and particularly relates to an online learning method and system of internet traffic (IoT) observation data.
Background
The statements in this section merely provide background information related to the present disclosure and may not necessarily constitute prior art.
In recent years, with the high-speed development of the internet of things (Internet of Things, ioT for short), various types of internet of things sensors are becoming more and more popular; in response, the time series observation data generated by the sensors of the internet of things grow exponentially, and the real-time intelligent analysis of the data is urgent and necessary in the application fields of intelligent environment monitoring, industrial monitoring, data center monitoring and the like.
With the rapid development of artificial intelligence, knowledge needs to be precisely mined from data in the application fields; deep Learning (DL) has strong nonlinear modeling capability and capability of extracting abstract features layer by layer, and has achieved great success in modeling various data forms, such as images, natural language, voice, biological signals, and the like; therefore, a large number of deep learning models are continuously proposed and validated in the modeling of the data of the internet of things.
It should be noted that the deep learning model is mainly a static and basic parameter set, and the parameters of the deep learning model are not changed after the deep learning model is trained offline; however, the traditional offline batch training and online reasoning solution is mainly aimed at internet of things data with small distribution variation, such as license plate recognition tasks; the scheme cannot meet the real-time analysis requirements of the data stream of the Internet of things with high sampling rate and unknown change; most of the observed data of the Internet of things are non-stationary data, the probability distribution of the observed data changes along with the passage of time, so that the problem of concept drift is caused, the concept drift refers to the change of the data distribution along with the passage of time, and the trend or attribute of new data cannot be accurately predicted by an original predictor or model. In the field of data stream prediction, concept drift is an important challenge because it can have an impact on the accuracy and effectiveness of the model.
In the case of concept drift, it is important how to obtain relatively stable reasoning performance, for which some studies related to the problem of concept drift are continuously discussed and explored; while various artificial intelligence-based time series prediction models have been widely studied and applied, these models are unreliable for prediction of internet of things data streams with conceptual drift and can result in degradation of overall performance; how to learn and infer effectively from non-stationary data streams remains a great challenge, and in particular how to adapt models to concept drift is a problem that many researchers focus on and try to solve, and in recent years, solutions to the above problem have achieved good results in combination with deep learning methods, but these studies have certain limitations, and in particular they tend to make only limited assumptions about solving certain types of concept drift patterns; thus, there is currently a lack of suitable methods and theory to effectively address the problem of concept drift without affecting the accuracy and reliability of the final result.
As described above, offline trained deep learning models do not adapt well to data streams with evolving distributions, and even if the model is updated periodically, new knowledge is "injected" into the model, the data between two adjacent updates still has to face the problem of performance degradation; the higher the sampling rate of the data of the Internet of things is, the more serious the problem of performance degradation is caused when the model updating strategy is adopted; furthermore, the expressive power of these models is also limited by their predefined fixed structure; thus, the model will not learn the extremely complex patterns that future data may have; the above-mentioned problems in the current method will lead to accumulated bias decisions, since the flow data analysis follows the scheme of "one-pass processing", each data point is processed only once without further inspection, so that such errors may be continuously amplified and cannot be repaired, which will lead to chain reactions, have potentially significant adverse effects on the internet of things monitoring systems such as smart oceans, smart cities, smart data centers, etc., and even endanger the overall system operation.
For time series prediction, the main methods are roughly divided into two categories, namely, a statistical-based model and a deep learning-based model. The statistical model is interpretable and predicts smooth data very well, provided that the time series data trend is consistent and unchanged; such as ARIMA models and statistical machine learning methods GBDT, GBRT, etc., which require extensive data preprocessing and labor intensive feature engineering and therefore cannot capture complex patterns in time series.
The salient features of deep learning based models in the field of time series data prediction are becoming more and more interesting, e.g. RNN based models, seq2seq and LSNET have proven to be effective in capturing short-term or long-term patterns; compared with the above model, the recently proposed transducer-based model shows more excellent performance in long sequences, however, the transducer-based model still needs to rely on abundant data to optimize its specific parameters, and cannot meet the accurate inference prediction of stream data with conceptual drift; the method can not effectively solve the problem of concept drift and also can not solve the problem of cold start of the model.
Disclosure of Invention
In order to overcome the defects of the prior art, the invention provides the online learning method and the online learning system for the IoT observation data, which are used for learning the hidden information among different hidden layers, improving the accuracy of model reasoning, and dynamically adjusting parameters among different hidden layers through online learning to solve the problem of concept drift and the problem of cold start, so that the model can learn and update the data continuously and accurately along with the time, thereby being better suitable for the continuously changed data characteristics and modes, and ensuring that the performance and accuracy of the model are always kept in an optimal state.
To achieve the above object, one or more embodiments of the present invention provide the following technical solutions:
the first aspect of the invention provides an online learning method of IoT observed data;
an online learning method of IoT observations, comprising:
initializing an online deep learning model according to the acquired initial time sequence observation data;
acquiring time sequence observation data generated by a sensor in real time, and forming an input data stream according to the time sequence observation data;
the online deep learning model processes an input data stream to generate and output a final prediction result;
in the process of processing the input data stream, the input data stream is subjected to instant learning, and an online deep learning model is dynamically updated in real time;
the instant learning is to learn data distribution based on the mean value and variance of data flow, construct quasi-normal distribution, reconstruct new sample, realize variable attention network, and dynamically adjust model based on distribution difference, reconstruction difference and reasoning difference.
Further, the online deep learning model comprises an encoder, a decoder and a result fusion module, takes a data stream as input, and outputs a prediction of a data value at the next moment.
Further, the encoder performs two-part operations:
(1) Extracting hidden information between hidden layers, inputting the hidden information into a result fusion module, and calculating a final predicted value;
(2) With standard normal distribution as a target, coding hidden information, and outputting a mean value meeting the standard normal distribution through re-parameterization settingAnd standard deviation->。
Further, the decoder randomly selects samples from the quasi-normal distribution generated by the encoder and outputs data consistent with the original characteristic structure of the data stream.
Further, the result fusion module performs weighted fusion on a plurality of features extracted by the encoder to obtain a current predicted value;
the weight is used for dynamically adjusting the contribution degree of each hidden layer, and the weight of each hidden layer is calculated in real time after each input sample is processed through the variable attention network.
Further, the variable attention network calculates the weight of each hidden layer according to the relation between each hidden layer in the encoder and the necessary degree of each substructure.
Further, the loss function of the online deep learning model includes:
reconstruction loss, which is the difference between the true value and the reconstructed value;
KL loss, the difference between the quasi-normal distribution and the standard normal distribution is measured;
predicting loss, and measuring the difference between a true value and a current predicted value;
the difference between the final predicted value and the true value is measured by a weighted fusion of the three losses.
A second aspect of the present invention provides an online learning system for IoT observations.
An online learning system for IoT observations includes an initialization module, an acquisition module, a prediction module, and a learning module:
an initialization module configured to: initializing an online deep learning model according to the acquired initial time sequence observation data;
an acquisition module configured to: acquiring time sequence observation data generated by a sensor in real time, and forming an input data stream according to the time sequence observation data;
a prediction module configured to: the online deep learning model processes an input data stream to generate and output a final prediction result;
a learning module configured to: in the process of processing the input data stream, the input data stream is subjected to instant learning, and an online deep learning model is dynamically updated in real time;
the instant learning is to learn data distribution based on the mean value and variance of data flow, construct quasi-normal distribution, reconstruct new sample, realize variable attention network, and dynamically adjust model based on distribution difference, reconstruction difference and reasoning difference.
A third aspect of the present invention provides a computer-readable storage medium having stored thereon a program which, when executed by a processor, implements steps in an online learning method of IoT observations in accordance with the first aspect of the present invention.
A fourth aspect of the invention provides an electronic device comprising a memory, a processor and a program stored on the memory and executable on the processor, the processor implementing the steps in an online learning method of IoT observations according to the first aspect of the invention when the program is executed.
The one or more of the above technical solutions have the following beneficial effects:
the invention designs a self-adaptive online deep learning model which is used for learning time series data streams of an Internet of things sensor in real time; the model can start from a shallow network, has higher convergence rate, has higher generalization capability on the observed data of the Internet of things with concept drift, can automatically evolve along with the change of the observed time sequence data, can flexibly adjust the complexity and the representation capability of the model, effectively solves the problem of the concept drift in the observed data stream of the Internet of things, and can be directly applied to process the data stream in a cold start mode; the result shows that the online deep learning model can obviously improve the real-time accuracy of the reasoning result compared with the traditional method.
Additional aspects of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the invention.
Fig. 1 is a flow chart of a method of a first embodiment.
Fig. 2 is a structural diagram of an online deep learning model of the first embodiment.
Fig. 3 is a schematic diagram of an online learning operation mechanism of the first embodiment.
Fig. 4 is a schematic diagram of the evolution of the weights of the various layers of the inference network of the first embodiment.
Fig. 5 is a system configuration diagram of the second embodiment.
Detailed Description
The invention will be further described with reference to the drawings and examples.
In order to solve the problem of concept drift without affecting the accuracy and reliability of a final result, a method of fast and real-time learning is needed for a data stream, the method is commonly called as online learning or lifelong learning, online learning is a learning mode of time sequence data stream, the existing scheme has defects in training speed and reasoning speed, real-time performance cannot be truly realized, and the effect of online learning is affected. For the deep learning model, its parameters can be updated simply periodically, however, this approach has the following drawbacks:
1. only the adjustment of different parameters between online multitasking is focused, but the importance of different hidden layer parameters is ignored, i.e. the model cannot be flexibly adjusted.
2. The complexity of the model cannot be adjusted, i.e. the model selection cannot be performed, and in the online learning environment, a model is required to learn the data flow from shallow to deep, so that the over-fitting problem when the data volume is small (cold start stage) and the under-fitting problem when the data volume is large are overcome.
Therefore, the invention designs an online learning method, called 'instant learning', which can learn hidden information among different hidden layers, meet the final reasoning accuracy of a model, and simultaneously can meet the dynamic adjustment of parameters among different hidden layers, realize the real-time dynamic adjustment of the model, and compared with the existing online learning method, the online learning method improves the training speed and the reasoning speed and can really realize real-time performance.
The design concept of the invention follows the following existing online learning paradigm:
for the time series observation data,is generated by the sensor in real time, wherein T represents the number of data,x t data representing the time instant t is provided,Xrepresenting streaming data with unbounded T. In an online learning environment, this time series is not all available at once, but is processed one after the other in the form of a stream, with only historical data for each instant tIs available via the sensor but can be obtained via the history data +.>To predict the value at time t as +.>Thereby observing and revealing the true valuex t 。
Further, calculating the instantaneous loss of the real value generated at the current time t through the residual error of the real value and the predicted value; of course, for a specific application scenario, time seriesThe value at the current instant t can also be predicted in the form of a window; according to predictive value +.>Calculating the current instantaneous loss with the corresponding true value: />
The algorithm uses the loss and gradient iteration update generated by each input training sample, and can meet and realize the online training of mass data by training each input data.
The existing online learning architecture can only realize data improvement, but the architecture provided by the invention can also realize data generation and learn the distribution of potential variables; by constructing quasi-normal distribution, the mean and variance of the quasi-normal distribution are learned, a new sample is generated, and the next reasoning prediction is performed based on a fusion module.
Example 1
In one or more embodiments, an online learning method of IoT observations is disclosed, fig. 1 is a method flowchart thereof, as shown in fig. 1, comprising the steps of:
step S1: and initializing an online deep learning model according to the acquired initial time sequence observation data.
Step S2: and acquiring time sequence observation data generated by the sensor in real time, and forming an input data stream according to the time sequence observation data.
Step S3: the online deep learning model processes an input data stream to generate and output a final prediction result.
Step S4: in the process of processing an input data stream, the input data stream is subjected to instant learning, an online deep learning model is dynamically updated in real time, the instant learning is based on the mean value and the variance of the data stream, the data distribution is learned, quasi-normal distribution is constructed, a new sample is reconstructed, a variable-distribution attention network is realized, and the model is dynamically adjusted based on the distribution difference, the reconstruction difference and the reasoning difference.
The implementation procedure of an online learning method for IoT observed data in this embodiment is described in detail below.
Fig. 2 is a block diagram of an online deep learning model, and as shown in fig. 2, the online deep learning model includes an encoder, a decoder, and a result fusion module, and takes a data stream as an input, and outputs a prediction of a data value at a next time.
The encoder is connected with the result fusion module and used for dynamically updating the online deep learning model by introducing the predicted data value into the decoder and matching with the encoder and the result fusion module.
Encoder with a plurality of sensors
Based on deep neural network construction, the system is composed of a plurality of hidden layers, and the maximum network capacity can be k+1 hidden layers in consideration of available computing powerThe multi-scale learning is carried out on a sample-by-sample basis in the form of data flow, and the learned hidden layer has two functions:
(1) Calculating predictive vectors and attention weights for hidden layers
In order to fully utilize information in different hidden layers of the encoder, extracting hidden information in each hidden layer to obtain k+1 predictive vectorsp i Inputting the result into a result fusion module, and obtaining a final prediction result through weighted fusion, wherein the prediction vectorp i The calculation formula of (2) is as follows:
wherein ,pred()is a feed forward network that converts the hidden layer representation into local predictions,h i representing the i-th hidden layer.
In order to dynamically adjust the contribution weight of each hidden layer in the final prediction, a variable attention network capable of meeting the above requirements is designed to learn the attention weight of the hidden layer, namely:
wherein ,attention()is a feed forward network with Softmax function that is primarily responsible for calculating the weights of each hidden layer, all normalized to the weights of all hidden layersThe objective is to determine the relationship between each hidden layer in the overall model and how much each sub-structure is necessary in the final prediction.
In order to realize the iterative updating of the model, an important technology of the weight re-weighting operation is realized based on the above, namely, the real-time dynamic adjustment of the weight is realized, and the weights of all hidden layers are recalculated and normalized after each input sample processing through the weight re-weighting operation, which is completed after each iteration.
(2) Constructing quasi-normal distributions
The encoder attempts to transcode the distribution of all the characteristic information carried by the samples into a quasi-normal distribution, which, although coded with the aim of a standard normal distribution, cannot generally be coded into a standard normal distribution (target distribution), referred to herein as a potential distribution; in this process, the encoder directly outputs a mean value satisfying the quasi-normal distributionAnd standard deviation->As a result of the encoding, i.e. the mean value generated in the encoding process +.>And standard deviation->Rather than being calculated by means of a mean or standard deviation definition, it is directly output from the encoder.
To ensure the average value of the encoder outputAnd standard deviation->The standard normal distribution is satisfied, a penalty term is set in the loss function, and once the standard normal distribution (actual distribution) fed back based on the mean and the standard deviation is different from the standard normal distribution (target distribution), the embodiment model is further adjusted under the influence of a penalty mechanism.
Therefore, in the actual algorithm operation flow, the encoder is responsible for outputting the mean and standard deviation, the loss function ensures that the mean and standard deviation conform to a certain quasi-normal distribution, which is equivalent to encoding the original data in the direction of the quasi-normal distribution, outputting the mean and standard deviation of the quasi-normal distribution, and randomly sampling to generate the dataSubsequent decoder operations are performed.
At the same time, to ensure sampling dataThe probability distribution of (a) corresponds to the input samples, first of all it needs to be assumed that there is a +.>Regarding the posterior probability P (z|x) of X, and further assume that this probability distribution is a normal distribution: />Then sample data +.>The probability distribution P (Z) of (a) is:
thus, the P (Z) a priori distribution sumThe posterior distribution meets the standard normal distribution.
Furthermore, from a normal distributionIs selected randomly for sample->And inputs the samples to a decoder. Because there are random samplings in this process, so that the gradient information flow in the architecture is broken and the back propagation cannot be done by the traditional chain law, the design uses unique re-parameterization techniques to accomplish the back propagation of the embodiment model to meet the characteristics of a typical neural network. In the re-parameterization, this embodiment uses a random sampling method to generate a set of variables satisfying the normal distribution, from +.>Middle sample z, equivalent to from +.>Sampling epsilon and then let ∈ ->Thus, a gradient descent method may be applied; finally, the decoder decodes z and outputs the reconstructed data of sample x.
Thus, in the encoding stage of the encoder, each input sample is calculatedMean>And variance->For constructing a quasi-normal distribution.
Decoder
From the quasi-normal distribution generated by the encoder, the samples are randomly selected, data is output that is consistent with the original characteristic structure of the data stream, i.e. the original input structure is restored by the decoder to generate new data samplesData sampled from the latent variable space is desired +.>The probability distribution of the original data X is followed such that +.>New data generatedThe probability distribution of the raw data is also followed, and relatively speaking, the larger the potential variable space of the present embodiment, the more information about the probability distribution can be retained.
Result fusion module
Final pre-shaping of a modelThe measurement is based on the prediction vector of each hidden layerAnd carrying out weighted fusion to obtain a final prediction result, namely a prediction value at the next moment, wherein the weighted fusion based on a variation attention mechanism comprises the following specific steps:
wherein ,is predicted from the representation of the ith hidden layer,/i>Is the weight of the i-th hidden layer,is->Is a parameter of (a).
The above is the formation of the online deep learning model, and after the online deep learning model is built, the online deep learning model is divided into two flows: real-time prediction and online learning.
FIG. 3 is a schematic diagram of online learning, as shown in FIG. 3, in the process of inputting samples of a data stream one by one into a deep learning model for processing, the online learning continuously learns characteristics of the samples, and updates parameters of the model through changes of parameters, so as to realize dynamic real-time adjustment of the model, as shown in FIG. 4, by setting three hidden layers as verification discovery through the embodiment, weights of the hidden layer-1, the hidden layer-2 and the hidden layer-3 continuously change along with the increase of the number of the samples of the data stream, and weights among layers also change at different stages, which further illustrates that the embodiment can dynamically and accurately capture the changes when dealing with concept drift problems; in the learning process, the loss and gradient generated by each input sample are iteratively updated, and the on-line training of mass data is satisfied and realized by training each input sample, wherein the loss is quantized by adopting a loss function, and the embodiment calculates the final total loss by using three losses: reconstruction loss, KL loss, and prediction loss.
(1) Predicting loss
Unlike conventional neural network models, the prediction of the model is not from the final representation of the last layer, and the final prediction vector is obtained by weighting the prediction vector obtained for each hidden layer to ensure absolute high accuracy.
Thus, for observation of streaming IoT data, the predicted loss Lt for the current predicted phase time t is:
where y is the true value of y,is a predictive value->Representing the predicted instantaneous loss function at time t.
The predictive loss function here may be any convex function, and the present embodiment uses a mean square loss function (MSE) in which the error derivatives are back-propagated from the last output layer, unlike the original back-propagation, which is back-propagated from each predictor pj, such as:
wherein ,the parameters of the j-th layer network at the time t and the time t+1 are respectively +.>Representing update rate->Representing gradient->Representing the predicted value of each layer, +.>Indicating the loss at the current time.
Calculating the gradient of the parameters of each layer according to the equation, updating the parameters of the j layer of the embodiment model in the time t, and calculating the final prediction according to the gradient of the parameters of each layer; it is worth to say that, when the data sample is small, the model can realize rapid convergence through a shallow network for rapidly learning hidden information; as data increases, the use of a variable distraction mechanism may allow dynamic adjustment of different depth networksThereby conforming to the scalability of model capacity.
(2) KL loss
KL Loss (Kullback-Leibler Loss) for measuring the difference between the quasi-normal and standard normal distributions, i.e. the meanAnd variance->Differences between them.
Given a known mean valueAnd variance->The KL penalty is defined as the hidden variable space of dimension k:
(3) Reconstruction loss
The reconstruction loss here uses the standard L2 loss, i.e. MSE, assuming that when there are n samples, there are the original value x and the reconstruction valueReconstruction loss is defined as:
finally, in order to enhance the expressive power and predictive accuracy of the model, the total loss of this embodiment consists of the above three loss functions, the coefficients areThe method specifically comprises the following steps:
thus, at the end of each round, the algorithm will self-adjust to the instantaneous loss of the next several rounds, which also solves the problem of model flexibility in the concept drift scenario.
The real-time prediction is that the data stream is input into an online deep learning model, the prediction vector corresponding to each hidden layer is obtained through the encoding of the hidden layer of the encoder, and then the prediction vectors are weighted and fused to obtain the final prediction result, namely the prediction value of the next moment.
Example two
The embodiment discloses an online learning system of IoT observation data;
as shown in fig. 5, an online learning system for IoT observations includes an initialization module, an acquisition module, a prediction module, and a learning module:
an initialization module configured to: initializing an online deep learning model according to the acquired initial time sequence observation data;
an acquisition module configured to: acquiring time sequence observation data generated by a sensor in real time, and forming an input data stream according to the time sequence observation data;
a prediction module configured to: the online deep learning model processes an input data stream to generate and output a final prediction result;
a learning module configured to: in the process of processing the input data stream, the input data stream is subjected to instant learning, and an online deep learning model is dynamically updated in real time;
the instant learning is to learn data distribution based on the mean value and variance of data flow, construct quasi-normal distribution, reconstruct new sample, realize variable attention network, and dynamically adjust model based on distribution difference, reconstruction difference and reasoning difference.
Example III
An object of the present embodiment is to provide a computer-readable storage medium.
A computer readable storage medium having stored thereon a computer program which when executed by a processor implements steps in an online learning method of IoT observations in accordance with an embodiment one of the present disclosure.
Example IV
An object of the present embodiment is to provide an electronic apparatus.
An electronic device comprising a memory, a processor, and a program stored on the memory and executable on the processor, which when executed, implements steps in an online learning method for IoT observations in accordance with an embodiment one of the present disclosure.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, but various modifications and variations can be made to the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (7)
1. An online learning method of IoT observed data, comprising:
initializing an online deep learning model according to the acquired initial time sequence observation data;
acquiring time sequence observation data generated by a sensor in real time, and forming an input data stream according to the time sequence observation data;
the online deep learning model processes an input data stream to generate and output a final prediction result;
in the process of processing the input data stream, the input data stream is subjected to instant learning, and an online deep learning model is dynamically updated in real time;
the instant learning is to learn data distribution based on the mean value and variance of data flow, construct quasi-normal distribution, reconstruct new samples, realize a variable-distribution attention network and dynamically adjust a model based on distribution difference, reconstruction difference and reasoning difference;
the online deep learning model comprises an encoder, a decoder and a result fusion module, takes a data stream as input, and outputs a prediction of a data value at the next moment;
the encoder performs two-part operations:
(1) Extracting hidden information between hidden layers, inputting the hidden information into a result fusion module, and calculating a final predicted value;
(2) With standard normal distribution as a target, coding hidden information, and outputting a mean value meeting the standard normal distribution through re-parameterization settingAnd standard deviation->;
The structure is quasi-normal, and is specifically:
the encoder attempts to transcode the distribution of all the characteristic information carried by the samples into a quasi-normal distribution, although the quasi-normal distribution is divided in a standard normal wayCloth is targeted for encoding, but it cannot generally be encoded into a standard normal distribution, referred to herein as a potential distribution; in this process, the encoder directly outputs a mean value satisfying the quasi-normal distributionAnd standard deviation->As a result of the encoding, i.e. the mean value generated in the encoding process +.>And standard deviation->Not calculated by means of a mean or standard deviation definition, but directly output from the encoder;
to ensure the average value of the encoder outputAnd standard deviation->The method includes the steps that standard normal distribution is met, penalty items are set in a loss function, and once the standard normal distribution fed back based on the mean value and the standard deviation is different from the standard normal distribution, the model is affected by a penalty mechanism to make further adjustment;
therefore, in the actual algorithm operation flow, the encoder is responsible for outputting the mean and standard deviation, the loss function ensures that the mean and standard deviation conform to a certain quasi-normal distribution, which is equivalent to encoding the original data in the direction of the quasi-normal distribution, outputting the mean and standard deviation of the quasi-normal distribution, and randomly sampling to generate the dataPerforming subsequent decoder operations;
at the same time, to ensure sampling dataThe probability distribution of (a) corresponds to the input samples, first of all it needs to be assumed that there is a +.>Regarding the posterior probability P (z|x) of X, and further assume that this probability distribution is a normal distribution: />Then sample data +.>The probability distribution P (Z) of (a) is:
thus, the P (Z) a priori distribution sumPosterior distribution accords with standard normal distribution;
furthermore, from a normal distributionIs selected randomly for sample->And inputting the samples to a decoder; because random sampling exists in the process, gradient information flow in the architecture is broken, and back propagation cannot be performed through a traditional chain rule, the design uses a unique re-parameterization skill to complete the back propagation of the model so as to meet the characteristics of a typical neural network; in the re-parameterization, a set of variables satisfying normal distribution is generated by adopting a random sampling method, and the variables are selected from +.>Sampling z, equivalent to/>Sampling epsilon and then let ∈ ->Thus, a gradient descent method is applied; finally, the decoder decodes z and outputs the reconstructed data of the sample x;
in the encoding stage of the encoder, each input sample is calculatedMean>And variance->For constructing a quasi-normal distribution;
the loss function of the online deep learning model is used for measuring the difference between the final predicted value and the true value through weighted fusion of three losses:
(1) Reconstruction lossThe difference between the true value and the reconstructed value is measured, and the specific formula is as follows:
where n represents the number of samples, x represents the original value,representing the reconstructed value;
(2) KL loss, the difference between the quasi-normal distribution and the standard normal distribution is measured, and the specific formula is as follows:
wherein ,representing the mean and variance generated for each dimension, k is the mean +.>And variance->Dimension number of (a);
(3) Predicting lossThe difference between the true value and the current predicted value is measured, and the specific formula is as follows:
2. The online learning method of IoT observed data in accordance with claim 1, wherein the decoder randomly selects samples from a quasi-normal distribution generated by an encoder to output data consistent with an original feature structure of a data stream.
3. The online learning method of IoT observed data in accordance with claim 1, wherein the result fusion module performs weighted fusion on a plurality of features extracted by an encoder to obtain a current predicted value;
the weight is used for dynamically adjusting the contribution degree of each hidden layer, and the weight of each hidden layer is calculated in real time after each input sample is processed through the variable attention network.
4. The online learning method of IoT observations in accordance with claim 3, wherein the variational awareness network calculates the weight of each hidden layer based on the relationship between each hidden layer in the encoder and the degree of necessity of each substructure.
5. An online learning system for IoT observations, comprising an initialization module, an acquisition module, a prediction module, and a learning module:
an initialization module configured to: initializing an online deep learning model according to the acquired initial time sequence observation data;
an acquisition module configured to: acquiring time sequence observation data generated by a sensor in real time, and forming an input data stream according to the time sequence observation data;
a prediction module configured to: the online deep learning model processes an input data stream to generate and output a final prediction result;
a learning module configured to: in the process of processing the input data stream, the input data stream is subjected to instant learning, and an online deep learning model is dynamically updated in real time;
the instant learning is to learn data distribution based on the mean value and variance of data flow, construct quasi-normal distribution, reconstruct new samples, realize a variable-distribution attention network and dynamically adjust a model based on distribution difference, reconstruction difference and reasoning difference;
the online deep learning model comprises an encoder, a decoder and a result fusion module, takes a data stream as input, and outputs a prediction of a data value at the next moment;
the encoder performs two-part operations:
(1) Extracting hidden information between hidden layers, inputting the hidden information into a result fusion module, and calculating a final predicted value;
(2) With standard normal distribution as a target, coding hidden information, and outputting a mean value meeting the standard normal distribution through re-parameterization settingAnd standard deviation->;
The structure is quasi-normal, and is specifically:
the encoder attempts to transcode the distribution of all the characteristic information carried by the samples into a quasi-normal distribution, which, although targeting a standard normal distribution, is typically not encoded into a standard normal distribution, referred to herein as a potential distribution; in this process, the encoder directly outputs a mean value satisfying the quasi-normal distributionAnd standard deviation->As a result of the encoding, i.e. the mean value generated in the encoding process +.>And standard deviation->Not calculated by means of a mean or standard deviation definition, but directly output from the encoder;
to ensure the average value of the encoder outputAnd standard deviation->Meets standard normal distribution, sets penalty term in the loss function, and feeds back the quasi-normal component based on the mean value and standard deviation onceThe cloth is different from the standard normal distribution, and the model is further adjusted under the influence of a punishment mechanism;
therefore, in the actual algorithm operation flow, the encoder is responsible for outputting the mean and standard deviation, the loss function ensures that the mean and standard deviation conform to a certain quasi-normal distribution, which is equivalent to encoding the original data in the direction of the quasi-normal distribution, outputting the mean and standard deviation of the quasi-normal distribution, and randomly sampling to generate the dataPerforming subsequent decoder operations;
at the same time, to ensure sampling dataThe probability distribution of (a) corresponds to the input samples, first of all it needs to be assumed that there is a +.>Regarding the posterior probability P (z|x) of X, and further assume that this probability distribution is a normal distribution: />Then sample data +.>The probability distribution P (Z) of (a) is:
thus, the P (Z) a priori distribution sumPosterior distribution accords with standard normal distribution;
furthermore, from a normal distributionIs selected randomly for sample->And inputting the samples to a decoder; because random sampling exists in the process, gradient information flow in the architecture is broken, and back propagation cannot be performed through a traditional chain rule, the design uses a unique re-parameterization skill to complete the back propagation of the model so as to meet the characteristics of a typical neural network; in the re-parameterization, a set of variables satisfying normal distribution is generated by adopting a random sampling method, and the variables are selected from +.>Middle sample z, equivalent to from +.>Sampling epsilon and then let ∈ ->Thus, a gradient descent method is applied; finally, the decoder decodes z and outputs the reconstructed data of the sample x;
in the encoding stage of the encoder, each input sample is calculatedMean>And variance->For constructing a quasi-normal distribution; />
The loss function of the online deep learning model is used for measuring the difference between the final predicted value and the true value through weighted fusion of three losses:
(1) Reconstruction lossMeasuring the difference between the true value and the reconstructed value, the specific formulaThe method comprises the following steps:
where n represents the number of samples, x represents the original value,representing the reconstructed value;
(2) KL loss, the difference between the quasi-normal distribution and the standard normal distribution is measured, and the specific formula is as follows:
wherein ,representing the mean and variance generated for each dimension, k is the mean +.>And variance->Dimension number of (a);
(3) Predicting lossThe difference between the true value and the current predicted value is measured, and the specific formula is as follows:
6. An electronic device, comprising:
a memory for non-transitory storage of computer readable instructions; and
a processor for executing the computer-readable instructions,
wherein the computer readable instructions, when executed by the processor, perform the method of any of the preceding claims 1-4.
7. A storage medium, characterized by non-transitory storing computer-readable instructions, wherein the instructions of the method of any one of claims 1-4 are performed when the non-transitory computer-readable instructions are executed by a computer.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310214205.9A CN115879569B (en) | 2023-03-08 | 2023-03-08 | Online learning method and system for IoT observation data |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310214205.9A CN115879569B (en) | 2023-03-08 | 2023-03-08 | Online learning method and system for IoT observation data |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115879569A CN115879569A (en) | 2023-03-31 |
CN115879569B true CN115879569B (en) | 2023-05-23 |
Family
ID=85762015
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310214205.9A Active CN115879569B (en) | 2023-03-08 | 2023-03-08 | Online learning method and system for IoT observation data |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115879569B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109102126A (en) * | 2018-08-30 | 2018-12-28 | 燕山大学 | One kind being based on depth migration learning theory line loss per unit prediction model |
CN112836808A (en) * | 2021-03-22 | 2021-05-25 | 哈尔滨理工大学 | Time-space coupling learning method for deep learning-based distributed parameter system modeling |
Family Cites Families (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20200160207A1 (en) * | 2018-11-15 | 2020-05-21 | General Electric Company | Automated model update based on model deterioration |
CA3097655A1 (en) * | 2019-10-30 | 2021-04-30 | Royal Bank Of Canada | System and method for machine learning architecture with differential privacy |
US11443335B2 (en) * | 2019-12-19 | 2022-09-13 | Beijing Didi Infinity Technology And Development Co., Ltd. | Model-based deep reinforcement learning for dynamic pricing in an online ride-hailing platform |
US11531903B2 (en) * | 2020-08-02 | 2022-12-20 | Actimize Ltd | Real drift detector on partial labeled data in data streams |
CN114186668A (en) * | 2021-12-09 | 2022-03-15 | 山东省计算中心(国家超级计算济南中心) | Online deep learning method, system and equipment for Internet of things data flow prediction |
CN114676622A (en) * | 2022-02-17 | 2022-06-28 | 国网冀北电力有限公司承德供电公司 | Short-term photovoltaic power prediction method based on self-encoder deep learning model |
CN114970674A (en) * | 2022-04-15 | 2022-08-30 | 北京大学 | Time sequence data concept drift adaptation method based on relevance alignment |
CN114881331A (en) * | 2022-05-09 | 2022-08-09 | 西安交通大学 | Learner abnormal learning state prediction method facing online education |
CN114911831A (en) * | 2022-05-12 | 2022-08-16 | 大连大学 | Agricultural real-time early warning method and system based on Flink streaming calculation and deep learning |
CN115293662A (en) * | 2022-10-10 | 2022-11-04 | 山东省计算中心(国家超级计算济南中心) | Parallel and distributed ocean observation data fusion intelligent calculation method and system |
CN115731396A (en) * | 2022-11-28 | 2023-03-03 | 辽宁工程技术大学 | Continuous learning method based on Bayesian variation inference |
-
2023
- 2023-03-08 CN CN202310214205.9A patent/CN115879569B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109102126A (en) * | 2018-08-30 | 2018-12-28 | 燕山大学 | One kind being based on depth migration learning theory line loss per unit prediction model |
CN112836808A (en) * | 2021-03-22 | 2021-05-25 | 哈尔滨理工大学 | Time-space coupling learning method for deep learning-based distributed parameter system modeling |
Also Published As
Publication number | Publication date |
---|---|
CN115879569A (en) | 2023-03-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109165664B (en) | Attribute-missing data set completion and prediction method based on generation of countermeasure network | |
CN108900346B (en) | Wireless network flow prediction method based on LSTM network | |
Labach et al. | Survey of dropout methods for deep neural networks | |
CN108448610B (en) | Short-term wind power prediction method based on deep learning | |
CN112364975B (en) | Terminal running state prediction method and system based on graph neural network | |
CN108764568B (en) | Data prediction model tuning method and device based on LSTM network | |
CN113177633B (en) | Depth decoupling time sequence prediction method | |
CN108197736A (en) | A kind of Air Quality Forecast method based on variation self-encoding encoder and extreme learning machine | |
CN113095550B (en) | Air quality prediction method based on variational recursive network and self-attention mechanism | |
CN110737952A (en) | prediction method for residual life of key parts of mechanical equipment by combining AE and bi-LSTM | |
CN115271186B (en) | Reservoir water level prediction and early warning method based on delay factor and PSO RNN Attention model | |
CN115935834A (en) | History fitting method based on deep autoregressive network and continuous learning strategy | |
CN114548591A (en) | Time sequence data prediction method and system based on hybrid deep learning model and Stacking | |
CN116432697A (en) | Time sequence prediction method integrating long-term memory network and attention mechanism | |
CN115879569B (en) | Online learning method and system for IoT observation data | |
CN115860232A (en) | Steam load prediction method, system, electronic device and medium | |
CN115659201A (en) | Gas concentration detection method and monitoring system for Internet of things | |
CN113300884B (en) | GWO-SVR-based step-by-step network flow prediction method | |
CN115616163A (en) | Gas accurate preparation and concentration measurement system | |
CN115522945A (en) | Dynamic prediction method for shield tunneling attitude | |
CN116861962A (en) | Data processing method and device | |
CN114186668A (en) | Online deep learning method, system and equipment for Internet of things data flow prediction | |
CN114239934A (en) | Power grid load sequence prediction method and system based on generative countermeasure network | |
CN114912653A (en) | Short-term load combined prediction method based on self-adaptive chirp modal decomposition and SSA-BilSTM | |
CN114139677A (en) | Unequal interval time sequence data prediction method based on improved GRU neural network |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |