Real-time sensor anomaly detection method and system based on LSTM-AE-Bayes

By combining the LSTM-AE-Bayes model in sensor anomaly detection, features are extracted using the autoencoder and prediction model, and corrected by Bayesian anomaly probability formula, the problems of complex timing data processing and dynamic anomaly pattern recognition in the prior art are solved, and efficient and accurate anomaly detection is achieved.

CN119513789BActive Publication Date: 2025-04-25ZHEJIANG UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510077961.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-17
Publication Date
2025-04-25
Estimated Expiration
2045-01-17

AI Technical Summary

Technical Problem

Existing sensor anomaly detection methods are difficult to effectively deal with complex timing data and dynamically changing abnormal patterns, resulting in low detection accuracy, many false alarms and missed reports, and lack the advantages of multi-model fusion.

Method used

The sensor real-time abnormality detection method based on LSTM-AE-Bayes is used to extract the characteristics of time sequence data through the autoencoder and prediction model, and combine the Bayesian anomaly probability formula, and use the reconstruction error value and prediction error value to generate correction factors, calculate the abnormality probability of the sensor, and set an abnormality threshold for judgment.

Benefits of technology

It realizes more efficient and accurate abnormality detection, improves the system's adaptability and accuracy to sensor status, reduces false alarms and missed alarms, and enhances the sensitivity and robustness of abnormality detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119513789B_ABST
    Figure CN119513789B_ABST
Patent Text Reader

Abstract

The present invention provides a sensor real-time anomaly detection method and system based on LSTM-AE-Bayes, which relates to the technical field of machine learning and deep learning. The present invention obtains the previous normal time series data of the sensor to train an autoencoder and a prediction model, obtains the current monitoring time series data, inputs it into the autoencoder for reconstruction, and predicts the current data, calculates the reconstruction error value between the current data and the reconstructed data, and the prediction error value between the current data and the predicted data, and combines the Bayesian abnormal probability formula to generate a correction factor, correct the formula, calculate the abnormal probability at the current moment, and finally set an abnormal threshold. When the abnormal probability exceeds the threshold, it is determined that the sensor is in an abnormal state. The present invention detects the abnormal state of the sensor in real time and efficiently by combining the LSTM prediction model, the autoencoder reconstruction error value and the correction of the Bayesian abnormal probability formula, thereby improving the accuracy and reliability of abnormal detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of machine learning and deep learning, and specifically to a real-time anomaly detection method and system for sensors based on LSTM-AE-Bayes. Background Art

[0002] At present, with the improvement of computing power and the advancement of big data technology, the anomaly detection method combined with LSTM-AE-Bayes is gradually becoming one of the mainstream technologies for solving complex sensor data anomaly problems, especially in multi-source heterogeneous data processing and online real-time monitoring. It shows great application potential. At the same time, integrated methods such as Bayesian networks and integrated learning have also been introduced to improve detection accuracy and robustness. The real-time requirement has prompted the continuous optimization of algorithms, and the combination of edge computing and cloud computing technologies has further improved the efficiency and response speed of sensor data processing. Overall, real-time anomaly detection technology is developing towards higher automation, intelligence and real-time performance, providing effective solutions for equipment monitoring, fault warning, etc. in various industries.

[0003] In the prior art, although the real-time anomaly detection method of sensors has made significant progress and applications, there are still some shortcomings, which need to be solved in practical applications to improve the reliability and accuracy of detection.

[0004] First, existing sensor anomaly detection methods usually rely on simple statistical or rule-based models and cannot effectively handle complex time series data and dynamically changing anomaly patterns. These methods often cannot adapt to the time series characteristics and nonlinear relationships of sensor data, resulting in low detection accuracy when complex anomalies occur. In addition, traditional methods usually ignore the potential correlation in the data and the need for feature extraction, resulting in inaccurate anomaly detection results or a large number of false positives and negatives.

[0005] Existing technologies usually rely on a single model for anomaly detection and lack the advantages of multi-model fusion. For example, some methods only use autoencoders for data reconstruction or rely only on prediction models for data prediction, and fail to combine the information of both to detect anomalies more comprehensively. Therefore, existing technologies often perform poorly when processing high-dimensional and complex time series data, and are unable to capture useful information in reconstruction error values ​​and prediction error values ​​at the same time, thereby reducing the accuracy and reliability of anomaly detection.

[0006] Therefore, it is necessary to provide a real-time anomaly detection method and system for sensors based on LSTM-AE-Bayes to solve the above problem.

[0007] The above information disclosed in this Background section is only for enhancement of understanding of the background of the present disclosure and therefore it may contain information that does not constitute the prior art that is already known to one of ordinary skill in the art. Summary of the invention

[0008] The purpose of the present invention is to provide a real-time anomaly detection method and system for sensors based on LSTM-AE-Bayes to solve the problems raised in the above background technology.

[0009] To achieve the above object, the present invention provides the following technical solutions:

[0010] A sensor real-time anomaly detection method based on LSTM-AE-Bayes, the specific steps include:

[0011] Step 1: Obtain normal time series data collected by the sensor in the past, and train the autoencoder and prediction model based on the normal time series data. The autoencoder is used to extract features from multiple consecutive data in the time series data to obtain a feature vector. The prediction model is used to output the next predicted data after the multiple consecutive data according to the feature vector.

[0012] Step 2: Acquire monitoring time series data collected by the sensor, and the monitoring time series data is the current data collected at the current moment and multiple continuous data before it, input multiple continuous data including the current data into the autoencoder to obtain reconstructed data of the current data, and input multiple continuous data excluding the current data into the autoencoder to obtain a feature vector for predicting the current data, and input the feature vector into the prediction model to obtain predicted data of the current data;

[0013] Step 3: Based on the current data and the reconstructed data, a reconstruction error value is obtained, and based on the current data and the predicted data, a prediction error value is obtained;

[0014] Step 4: Based on the Bayesian abnormal probability formula, the reconstruction error value and the prediction error value are combined to generate a correction factor, and the Bayesian abnormal probability formula is corrected to calculate the abnormal probability of the sensor at the current moment;

[0015] Step 5: Set an abnormal threshold. If the abnormal probability exceeds this threshold, the sensor is judged to be in an abnormal state at the current moment.

[0016] Furthermore, the autoencoder and prediction model are trained based on normal time series data according to the following method:

[0017] The autoencoder is divided into an encoder and a decoder. Normal time series data is input into the encoder, which processes the input data through a series of neural network layers to extract the main features of the data and represent it as a feature vector. The decoder is responsible for converting the feature vector generated by the encoder into reconstructed data. The autoencoder is trained with the goal of minimizing the reconstruction error value until the predetermined round is reached.

[0018] The feature vectors extracted from normal time series data include the maximum value, minimum value and average value in the time series data. The prediction model adopts a convolutional neural network layer structure, including an input layer, a hidden layer and an output layer. The input layer is used to receive the generated feature vectors, the hidden layer is used to process the feature vectors, and the output layer is used to output the next predicted data after the multiple consecutive data.

[0019] Furthermore, the reconstruction error value and the prediction error value are obtained according to the following method:

[0020] The continuous multiple data of the current data are input into the autoencoder and then input into the trained autoencoder to obtain the reconstructed data of the current monitoring time series data. According to the current data and the reconstructed data, the formula for calculating the reconstruction error value is as follows:

[0021] ;

[0022] in, represents the reconstruction error value, For the current data collected, To reconstruct data;

[0023] The generated feature vector is input into the trained prediction model to obtain the predicted data of the current data. Based on the current data and the predicted data, the formula for calculating the prediction error value is as follows:

[0024] ;

[0025] in, represents the prediction error value, For the current data collected, The prediction data output by the prediction model.

[0026] Furthermore, the Bayesian anomaly probability formula is modified based on the following method:

[0027] The correction factor is generated by combining the reconstruction error value and the prediction error value of the autoencoder, and the correction factor is used to correct the Bayesian anomaly probability formula. The formula is:

[0028] ;

[0029] ;

[0030] in, represents the generated correction factor, represents the reconstruction error value, represents the predicted difference calculated by the model, , They represent the Bayesian anomaly probability formula before and after correction respectively.

[0031] Furthermore, the abnormal probability of the sensor at the current moment is calculated based on the following method:

[0032] Using the current reconstruction error value and the predicted difference, the current moment is calculated based on the modified Bayesian anomaly probability formula

[0033] The abnormal probability is based on the formula:

[0034] ;

[0035] in, represents the abnormal probability of the sensor at the current moment, represents the probability of the observed reconstruction error value and prediction error value under abnormal sensor conditions; Represents the prior probability, which indicates the basic probability that sensor data is judged as abnormal under normal circumstances, and is set based on historical data; is the marginal probability, which represents the overall probability of the observed reconstruction error value and prediction error value.

[0036] Furthermore, an abnormal threshold is set. If the abnormal probability exceeds this threshold, the current sensor is determined to be in an abnormal state. The method is as follows:

[0037] Set the abnormal threshold as , to determine whether the current sensor is in an abnormal state, the logic formula is:

[0038] ;

[0039] in, Indicates the logical value to judge whether the sensor is in abnormal state. When , the abnormal probability does not exceed the abnormal threshold, indicating that the sensor is in a normal state; when When , the abnormal probability exceeds the abnormal threshold, indicating that the sensor is in an abnormal state.

[0040] The present invention also provides a real-time anomaly detection system for sensors based on LSTM-AE-Bayes, wherein the anomaly detection system is used to execute the above-mentioned real-time anomaly detection method for sensors based on LSTM-AE-Bayes, comprising:

[0041] A data preparation and training module, wherein the data preparation and training module is used to obtain normal time series data previously collected by the sensor, and train an autoencoder and a prediction model based on the normal time series data, wherein the autoencoder is used to extract features of a plurality of consecutive data in the time series data to obtain a feature vector, and the prediction model is used to output the next predicted data after the plurality of consecutive data according to the feature vector;

[0042] A real-time data processing module, wherein the real-time data processing module is used to obtain monitoring time series data collected by the sensor, and the monitoring time series data is the current data collected at the current moment and a plurality of continuous data before it, inputting a plurality of continuous data including the current data into the autoencoder to obtain reconstructed data of the current data, and inputting a plurality of continuous data excluding the current data into the autoencoder to obtain a feature vector for predicting the current data, and inputting the feature vector into the prediction model to obtain predicted data of the current data;

[0043] An error calculation module, the error calculation module is used to obtain a reconstruction error value based on current data and reconstruction data, and to obtain a prediction error value based on current data and prediction data;

[0044] An abnormality probability correction module, which is used to generate a correction factor based on the Bayesian abnormality probability formula, combining the reconstruction error value and the prediction error value, and correct the Bayesian abnormality probability formula to calculate the abnormality probability of the sensor at the current moment;

[0045] The abnormality determination module is used to set an abnormality threshold. If the abnormality probability exceeds the threshold, it is determined that the sensor is in an abnormal state at the current moment.

[0046] Compared with the prior art, the present invention has the following beneficial effects:

[0047] First, by combining the autoencoder and the prediction model, the features of the time series data can be effectively extracted and accurately predicted, thereby determining whether the sensor is in an abnormal state. By comprehensively utilizing the reconstructed error value and the predicted error value, the present invention can achieve more efficient and accurate anomaly detection. The autoencoder's ability to extract features and the accuracy of the prediction model are optimized in this solution, making the system more adaptable and accurate in detecting abnormal sensor states, reducing the false positives and false negatives in traditional methods;

[0048] Secondly, the present invention effectively enhances the sensitivity and robustness of anomaly detection by introducing the Bayesian anomaly probability formula for correction. By calculating the correction factor, the abnormal signal of the sensor can be captured more accurately in a dynamically changing environment, improving the adaptability of the system in complex and dynamic environments. In addition, the establishment of an abnormal threshold judgment mechanism ensures that the judgment of sensor anomalies is based on actual data changes and preset thresholds, so that the abnormal moment can be accurately identified, providing important support for equipment maintenance and prevention, reducing the occurrence of equipment failures, and improving the reliability of the system.

[0049] The present invention combines the LSTM prediction model, the autoencoder reconstruction error value and the correction of the Bayesian abnormal probability formula to detect the abnormal state of the sensor in real time and efficiently, thereby improving the accuracy and reliability of abnormality detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 It is a schematic diagram of the overall method flow of the present invention.

[0051] Figure 2 It is a schematic diagram of the system module flow of the present invention. DETAILED DESCRIPTION

[0052] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with specific embodiments.

[0053] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the present invention should be understood by people with ordinary skills in the field to which the present invention belongs. The words "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0054] Example:

[0055] See also Figure 1 , a real-time anomaly detection method for sensors based on LSTM-AE-Bayes, the specific steps include:

[0056] Step 1: Obtain normal time series data collected by the sensor in the past, and train the autoencoder and prediction model based on the normal time series data. The autoencoder is used to extract features from multiple consecutive data in the time series data to obtain a feature vector. The prediction model is used to output the next predicted data after the multiple consecutive data according to the feature vector.

[0057] Step 2: Acquire monitoring time series data collected by the sensor, and the monitoring time series data is the current data collected at the current moment and multiple continuous data before it, input multiple continuous data including the current data into the autoencoder to obtain reconstructed data of the current data, and input multiple continuous data excluding the current data into the autoencoder to obtain a feature vector for predicting the current data, and input the feature vector into the prediction model to obtain predicted data of the current data;

[0058] Step 3: Based on the current data and the reconstructed data, a reconstruction error value is obtained, and based on the current data and the predicted data, a prediction error value is obtained;

[0059] Step 4: Based on the Bayesian abnormal probability formula, the reconstruction error value and the prediction error value are combined to generate a correction factor, and the Bayesian abnormal probability formula is corrected to calculate the abnormal probability of the sensor at the current moment;

[0060] Step 5: Set an abnormal threshold. If the abnormal probability exceeds this threshold, the sensor is judged to be in an abnormal state at the current moment.

[0061] It should be noted that training autoencoders and prediction models based on normal time series data is of great significance, mainly reflected in the fact that the main features of the data can be extracted through the autoencoder, which can effectively capture the laws and changing trends of time series data. The convolutional neural network can further process these features in depth to achieve accurate prediction of future data. Combining the advantages of autoencoders and convolutional neural networks, it is not only possible to accurately reconstruct and understand normal data, but also to monitor and predict abnormal patterns through learned features. This method has broad application prospects in the fields of anomaly detection, predictive analysis, etc.

[0062] Therefore, it is necessary to train the autoencoder and prediction model based on normal time series data, based on the following method:

[0063] The autoencoder is divided into an encoder and a decoder. Normal time series data is input into the encoder, which processes the input data through a series of neural network layers to extract the main features of the data and represent it as a feature vector. The decoder is responsible for converting the feature vector generated by the encoder into reconstructed data. The autoencoder is trained with the goal of minimizing the reconstruction error value until the predetermined round is reached.

[0064] The feature vectors extracted from normal time series data include the maximum value, minimum value and average value in the time series data. The prediction model adopts a convolutional neural network layer structure, including an input layer, a hidden layer and an output layer. The input layer is used to receive the generated feature vectors, the hidden layer is used to process the feature vectors, and the output layer is used to output the next predicted data after the multiple consecutive data.

[0065] It should be noted that the calculation of the reconstruction error value and the prediction error value plays a vital role in the present invention, because they are the core indicators for detecting whether the sensor is abnormal. The reconstruction error value measures the difference between the data reconstructed by the autoencoder after learning the normal time series data and the current actual data. If the reconstruction error value is large, it means that the current data deviates from the normal mode under the understanding of the autoencoder, and there may be abnormal phenomena. The prediction error value is based on the difference between the prediction result generated by the feature vector and the actual collected data, which reflects the accuracy of the prediction model for future data. If the prediction error value is large, it means that the model has failed to effectively capture the regularity of the data, which may be due to the occurrence of abnormal conditions. The two errors work together to enable the system to keenly capture abnormal patterns and provide more reliable sensor state assessment. Through accurate error calculation, the system can flexibly respond to various complex data changes, thereby achieving efficient and accurate anomaly detection.

[0066] Therefore, it is necessary to obtain the reconstruction error value and the prediction error value, and the method based on this is:

[0067] The continuous multiple data of the current data are input into the autoencoder and then input into the trained autoencoder to obtain the reconstructed data of the current monitoring time series data. According to the current data and the reconstructed data, the formula for calculating the reconstruction error value is as follows:

[0068] ;

[0069] in, represents the reconstruction error value, For the current data collected, To reconstruct data;

[0070] The generated feature vector is input into the trained prediction model to obtain the predicted data of the current data. Based on the current data and the predicted data, the formula for calculating the prediction error value is as follows:

[0071] ;

[0072] in, represents the prediction error value, For the current data collected, The prediction data output by the prediction model.

[0073] It should be noted that the importance of modifying the Bayesian anomaly probability formula is that it can effectively improve the accuracy and sensitivity of anomaly detection. By combining the reconstruction error value and prediction error value of the autoencoder to generate a correction factor, this method can more finely adjust the Bayesian anomaly probability formula to better reflect the true situation of the data. The reconstruction error value and the prediction error value reflect the reconstruction accuracy and prediction accuracy of the data respectively. Through the combination of the two, a more accurate assessment of the degree of abnormality of the data can be made;

[0074] The introduction of the correction factor makes the Bayesian probability model not only rely on previous probability information, but also dynamically adjust according to the degree of abnormality of real-time data, thereby improving the sensitivity to potential abnormalities. This correction process can effectively reduce the false alarm rate and improve the ability to detect small changes, which is especially important when dealing with complex and frequently changing time series data. Ultimately, the corrected Bayesian anomaly probability formula can provide more accurate anomaly judgment, help to detect problems in a timely manner and take measures, and improve the reliability and stability of the system.

[0075] Therefore, it is necessary to modify the Bayesian anomaly probability formula based on the following method:

[0076] The correction factor is generated by combining the reconstruction error value and the prediction error value of the autoencoder, and the correction factor is used to correct the Bayesian anomaly probability formula. The formula is:

[0077] ;

[0078] ;

[0079] in, represents the resulting correction factor, represents the reconstruction error value, represents the prediction error value calculated by the model, , They represent the Bayesian anomaly probability formula before and after correction respectively; in the above formula, the reconstruction error value provided by the autoencoder and the prediction error value provided by the prediction model reflect the degree of deviation between the currently monitored time series data and the normal time series data, and the correction factor This combines the two errors and normalizes the correction effect by the value of the current data, ensuring that the sensitivity of the anomaly is appropriate to the size of the data itself. , When increasing, Increase means that the reconstruction error value and the prediction error value are large, indicating that the current data deviates greatly from the normal mode, so the probability of abnormality will be enhanced, which can help the system detect abnormal situations more sensitively; when , When decreasing, It also decreases, which means that the reconstruction error value and the prediction error value are small, the current data is consistent with the normal mode, and the system's judgment of abnormalities will be reduced.

[0080] It should be noted that by combining the modified Bayesian anomaly probability formula, using the reconstructed error value and the predicted difference at the current moment, it is possible to dynamically evaluate whether the sensor data deviates from the normal mode. Specifically, each element in the formula helps to quantitatively measure the probability of observing a specific error in the abnormal state of the sensor, and further adjusts the anomaly probability through the correction factor β to ensure the timely identification of potential anomalies. This method enhances the system's anomaly detection capability when processing complex time series data, thereby effectively improving prediction accuracy and response speed, and helping to prevent potential system failures or abnormal behaviors.

[0081] Therefore, it is necessary to calculate the abnormal probability of the sensor at the current moment, based on the following method:

[0082] The current reconstruction error value and the prediction difference are used to calculate the abnormal probability at the current moment based on the modified Bayesian abnormal probability formula. The formula is:

[0083] ;

[0084] in, represents the abnormal probability of the sensor at the current moment, It represents the probability of observing the reconstruction error value and the prediction error value under the abnormal state of the sensor; represents the prior probability, which indicates the probability of sensor abnormality; is the marginal probability, which indicates the overall probability of observing the reconstruction error value and the prediction error value; in the above formula, Reconstruction error value representing abnormal probability of sensor;

[0085] It should be noted that when the reconstruction error value is greater than the reconstruction error value threshold, it is determined that a reconstruction error value has occurred, and when the prediction error value is greater than the prediction error value, it is determined that a prediction error value has occurred;

[0086] in, The method for obtaining is as follows: determine the monitoring time period of the sensor, and based on expert evaluation, determine the period when the sensor is in an abnormal state within the monitoring time period, and define the period as the abnormal period, and use the proportion of the duration of the abnormal period in the monitoring time period as ;

[0087] in, The method for obtaining is as follows: obtain the total number of times the sensor collects data during the above monitoring time period, and obtain the number of times the reconstruction error value and the prediction error value occur simultaneously during the monitoring time period, and use the ratio of this number to the total number corresponding to the monitoring time period as ;

[0088] in, The method for obtaining is: obtain the total number of times the sensor collects data during the above abnormal period, and obtain the number of times the reconstruction error value and the prediction error value occur simultaneously during the abnormal period, and use the ratio of this number to the total number corresponding to the abnormal period as ;

[0089] It should be noted that the monitoring time period is the time period before the current moment, and the length of the monitoring time period can be five hours, ten hours, fifteen hours, etc., without limitation;

[0090] It should be noted that by setting an appropriate threshold, when the abnormal probability at the current moment exceeds the threshold, the system can quickly determine that the sensor has entered an abnormal state, thereby starting the corresponding warning or maintenance mechanism. The setting of the threshold ensures the sensitivity and stability of the system and avoids problems caused by false alarms or missed alarms. The introduction of this mechanism effectively improves the reliability of the system, reduces the risk of potential failures, and ensures the accuracy of monitoring.

[0091] Therefore, it is necessary to set an abnormal threshold. If the abnormal probability exceeds this threshold, the current sensor is judged to be in an abnormal state. The method is based on:

[0092] Set the abnormal threshold as , to determine whether the current sensor is in an abnormal state, the logic formula is:

[0093] ;

[0094] in, Indicates the logical value to judge whether the sensor is in abnormal state. When , the abnormal probability does not exceed the abnormal threshold, indicating that the sensor is in a normal state; when When , the abnormal probability exceeds the abnormal threshold, indicating that the sensor is in an abnormal state.

[0095] See also Figure 2 The present invention also provides a sensor real-time anomaly detection system based on LSTM-AE-Bayes, wherein the anomaly detection system is used to execute the above-mentioned sensor real-time anomaly detection method based on LSTM-AE-Bayes, comprising:

[0096] A data preparation and training module, wherein the data preparation and training module is used to obtain normal time series data previously collected by the sensor, and train an autoencoder and a prediction model based on the normal time series data, wherein the autoencoder is used to extract features of a plurality of consecutive data in the time series data to obtain a feature vector, and the prediction model is used to output the next predicted data after the plurality of consecutive data according to the feature vector;

[0097] A real-time data processing module, wherein the real-time data processing module is used to obtain monitoring time series data collected by the sensor, and the monitoring time series data is the current data collected at the current moment and a plurality of continuous data before it, inputting a plurality of continuous data including the current data into the autoencoder to obtain reconstructed data of the current data, and inputting a plurality of continuous data excluding the current data into the autoencoder to obtain a feature vector for predicting the current data, and inputting the feature vector into the prediction model to obtain predicted data of the current data;

[0098] An error calculation module, the error calculation module is used to obtain a reconstruction error value based on current data and reconstruction data, and to obtain a prediction error value based on current data and prediction data;

[0099] An abnormality probability correction module, which is used to generate a correction factor based on the Bayesian abnormality probability formula, combining the reconstruction error value and the prediction error value, and correct the Bayesian abnormality probability formula to calculate the abnormality probability of the sensor at the current moment;

[0100] The abnormality determination module is used to set an abnormality threshold. If the abnormality probability exceeds the threshold, it is determined that the sensor is in an abnormal state at the current moment.

[0101] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters in the formula are set by technicians in this field according to actual conditions.

[0102] The above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination thereof. When implemented by software, the above embodiments may be implemented in whole or in part in the form of a computer program product. Those skilled in the art may appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein may be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed by hardware or software methods depends on the specific application and design constraints of the technical solution.

[0103] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, and may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0104] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.

Claims

1. A real-time anomaly detection method for sensors based on LSTM-AE-Bayes, characterized in that: The specific steps include: Step 1: Obtain normal time series data collected by the sensor in the past, and train the autoencoder and prediction model based on the normal time series data. The autoencoder is used to extract features from multiple consecutive data in the time series data to obtain a feature vector. The prediction model is used to output the next predicted data after the multiple consecutive data according to the feature vector. Step 2: Acquire monitoring time series data collected by the sensor, and the monitoring time series data is the current data collected at the current moment and multiple continuous data before it, input multiple continuous data including the current data into the autoencoder to obtain reconstructed data of the current data, and input multiple continuous data excluding the current data into the autoencoder to obtain a feature vector for predicting the current data, and input the feature vector into the prediction model to obtain predicted data of the current data; Step 3: Based on the current data and the reconstructed data, a reconstruction error value is obtained, and based on the current data and the predicted data, a prediction error value is obtained; Step 4: Based on the Bayesian abnormal probability formula, the reconstruction error value and the prediction error value are combined to generate a correction factor, and the Bayesian abnormal probability formula is corrected to calculate the abnormal probability of the sensor at the current moment; Step 5: Set an abnormal threshold. If the abnormal probability exceeds this threshold, the sensor is judged to be in an abnormal state at the current moment. The method for training the autoencoder and prediction model based on normal time series data is as follows: The autoencoder is divided into an encoder and a decoder. Normal time series data is input into the encoder, which processes the input data through a series of neural network layers to extract the main features of the data and represent it as a feature vector. The decoder is responsible for converting the feature vector generated by the encoder into reconstructed data. The autoencoder is trained with the goal of minimizing the reconstruction error value until the predetermined round is reached. The feature vectors extracted from normal time series data include the average rate of change, maximum value, minimum value and average value in the time series data. The prediction model adopts a convolutional neural network layer structure, including an input layer, a hidden layer and an output layer. The input layer is used to receive the generated feature vectors, the hidden layer is used to perform data processing on the feature vectors, and the output layer is used to output the next predicted data after the multiple consecutive data.

2. According to claim 1, a sensor real-time anomaly detection method based on LSTM-AE-Bayes is characterized in that: The reconstruction error value and the prediction error value are obtained based on the following method: The continuous multiple data of the current data are input into the autoencoder and then input into the trained autoencoder to obtain the reconstructed data of the current monitoring time series data. According to the current data and the reconstructed data, the formula for calculating the reconstruction error value is as follows: in, Represents the reconstruction error value, x now is the current data collected, x cg is the reconstructed data corresponding to the current data; The generated feature vector is input into the trained prediction model to obtain the predicted data of the current data. Based on the current data and the predicted data, the formula for calculating the prediction error value is as follows: in, Represents the prediction error value, x now is the current data collected, x yc is the predicted data corresponding to the current data.

3. According to the LSTM-AE-Bayes-based sensor real-time anomaly detection method according to claim 1, it is characterized in that: The Bayesian anomaly probability formula is modified based on the following method: The correction factor is generated by combining the reconstruction error value and the prediction error value of the autoencoder, and the correction factor is used to correct the Bayesian anomaly probability formula. The formula is: P(A|B) ′ NP(A|B)*β Among them, β represents the generated correction factor, represents the reconstruction error value, Represents the prediction error value calculated by the model, P(A|B), P(A|B) ′ They represent the Bayesian anomaly probability formula before and after correction respectively.

4. According to claim 3, a sensor real-time anomaly detection method based on LSTM-AE-Bayes is characterized in that: The method for calculating the abnormal probability of the sensor at the current moment is: The current reconstruction error value and the prediction difference are used to calculate the abnormal probability at the current moment based on the modified Bayesian abnormal probability formula. The formula is: Among them, YC represents the abnormal probability of the sensor at the current moment, P(B|A) represents the probability of the observed reconstruction error value and prediction error value when the sensor is in an abnormal state; P(A) represents the prior probability, which represents the basic probability that the sensor data is judged to be abnormal under normal circumstances, and is set based on historical data; P(B) is the marginal probability, which represents the overall probability of the observed reconstruction error value and prediction error value.

5. The method for real-time sensor anomaly detection based on LSTM-AE-Bayes according to claim 1, characterized in that: An abnormality threshold is set. If the abnormality probability exceeds this threshold, the current sensor is judged to be in an abnormal state. The method is based on: The abnormal threshold is set as U to determine whether the current sensor is in an abnormal state. The logic formula is: Wherein, Q represents a logical value for judging whether the sensor is in an abnormal state. When Q=0, the abnormal probability does not exceed the abnormal threshold, indicating that the sensor is in a normal state at this time; when Q=1, the abnormal probability exceeds the abnormal threshold, indicating that the sensor is in an abnormal state at this time.

6. A sensor real-time anomaly detection system based on LSTM-AE-Bayes, characterized in that: The anomaly detection system is used to execute the real-time anomaly detection method for sensors based on LSTM-AE-Bayes according to any one of claims 1 to 5, comprising: A data preparation and training module, wherein the data preparation and training module is used to obtain normal time series data previously collected by the sensor, and train an autoencoder and a prediction model based on the normal time series data, wherein the autoencoder is used to extract features of a plurality of consecutive data in the time series data to obtain a feature vector, and the prediction model is used to output the next predicted data after the plurality of consecutive data according to the feature vector; A real-time data processing module, wherein the real-time data processing module is used to obtain monitoring time series data collected by the sensor, and the monitoring time series data is the current data collected at the current moment and a plurality of continuous data before it, inputting a plurality of continuous data including the current data into the autoencoder to obtain reconstructed data of the current data, and inputting a plurality of continuous data excluding the current data into the autoencoder to obtain a feature vector for predicting the current data, and inputting the feature vector into the prediction model to obtain predicted data of the current data; An error calculation module, the error calculation module is used to obtain a reconstruction error value based on current data and reconstruction data, and to obtain a prediction error value based on current data and prediction data; An abnormality probability correction module, which is used to generate a correction factor based on the Bayesian abnormality probability formula, combining the reconstruction error value and the prediction error value, and correct the Bayesian abnormality probability formula to calculate the abnormality probability of the sensor at the current moment; The abnormality determination module is used to set an abnormality threshold. If the abnormality probability exceeds the threshold, it is determined that the sensor is in an abnormal state at the current moment.

Citation Information

Patent Citations

  • Satellite anomaly detection method based on Bayesian neural network

    CN110751199A

  • Method and apparatus for detecting and explaining anomalies

    US20240289209A1