Anomaly detection method of multi-sensor signals, electronic device, medium

By combining the KAN network and the Transformer encoder-decoder layer, along with the methods of confidence intervals and dynamic threshold intervals, the problems of model complexity and scenario uniformity in anomaly detection of multi-sensor signals are solved, achieving efficient anomaly detection and accurate judgment.

CN119202994BActive Publication Date: 2025-10-17ZHEJIANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411349609.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2025-10-17
Estimated Expiration
2044-09-26

AI Technical Summary

Technical Problem

Existing technologies for data anomaly detection suffer from problems such as complex model building, limited scenarios, and heavy reliance on empirical formulas, making it difficult to effectively handle complex high-dimensional data from multiple sensors and anomalies in time series.

Method used

A method combining KAN network and Transformer encoder-decoder layer is used to preprocess and extract features from multi-sensor signals. Anomaly detection is performed by calculating confidence intervals and dynamic threshold intervals, and anomaly judgment is made by using historical data from sensors around the target sensor.

Benefits of technology

It improves the accuracy of anomaly detection and reduces false alarms and missed alarms, quantifies the uncertainty of model prediction results, and can identify anomalies of all sensors within the same time period.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119202994B_ABST
    Figure CN119202994B_ABST
Patent Text Reader

Abstract

The application discloses a kind of multi-sensor signal anomaly detection method, electronic equipment, medium, comprising: based on the first confidence interval, second confidence interval obtained by target sensor historical measurement data acquisition;First confidence interval, the sum of second confidence interval is as overall dynamic threshold interval;When the 2 norm of the first output data corresponding to the to-be-detected data of the sensor and the difference between the second output data and the first tensor 2 norm sum does not belong to overall dynamic threshold interval, then output first exception label;And / or, obtain the historical measurement data of T sensors around target sensor;The sample mean corresponding to the measurement data of T sensors is calculated, the sample standard deviation is calculated, the standard error is calculated, to obtain confidence interval;When the real-time measurement data of the i th sensor around target sensor does not belong to confidence interval, then determine that the i th sensor is abnormal at this moment, output second exception label.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of data anomaly detection, and in particular to a multi-sensor signal anomaly detection method, electronic device and medium. BACKGROUND

[0002] The main methods in the field of data anomaly detection at present mainly include statistical methods, machine learning-based methods and deep learning-based methods. Statistical methods such as Z-Score, IQR and Grubbs'test can detect outliers through mathematical formulas, but they need to establish a model in advance and cannot cope with different scenarios and conditions; machine learning-based methods including Isolation Forest, Support Vector Machine (SVM) and K-Means clustering can identify abnormal patterns by training data models, but they need a large amount of data to build models and have a single scene; deep learning-based methods such as Autoencoder and Long Short-Term Memory Network (LSTM) can handle complex high-dimensional data and capture anomalies in time series, but the judgment of outliers is usually based on empirical formulas. SUMMARY

[0003] The present application provides a multi-sensor signal anomaly detection method, electronic device and medium to overcome the deficiencies of the prior art.

[0004] In a first aspect, the present application provides a multi-sensor signal anomaly detection method, characterized in that the method comprises:

[0005] Obtaining historical measurement data of a target sensor and preprocessing the data to obtain time series data;

[0006] Position encoding the time series data, adding the position encoded data to the time series data as first input data, setting a batch size, and randomly extracting from the first input data according to the batch size to obtain a first tensor;

[0007] The first input data is processed by a first KAN network, a Transformer encoding layer, a first Transformer decoding layer and a second KAN network to obtain first output data;

[0008] The difference between the first tensor and the first output data is taken as second input data;

[0009] The second input data is processed by a second Transformer decoding layer, a linear layer and an activation function to obtain second output data;

[0010] The 2-norm of the first output data and the 2-norm of the difference between the second output data and the first tensor are calculated and sampled to obtain first sample data and second sample data, respectively.

[0011] The sample mean, sample variance and standard error corresponding to the first sample data and the second sample data are calculated, so as to obtain the first confidence interval and the second confidence interval; and the sum of the first confidence interval and the second confidence interval is taken as the overall dynamic threshold interval.

[0012] When the sum of the 2-norm of the first output data corresponding to the to-be-detected data of the sensor and the 2-norm of the difference between the second output data and the first tensor does not belong to the overall dynamic threshold interval, the first abnormal label is output.

[0013] And / or,

[0014] The historical measurement data of T sensors around the target sensor are obtained.

[0015] The sample mean corresponding to the historical measurement data of the T sensors is calculated, the sample standard deviation is calculated, and the standard error is calculated, so as to obtain the confidence interval.

[0016] When the to-be-detected data of the i th sensor around the target sensor does not belong to the confidence interval, it is determined that the i th sensor is abnormal at this moment, and the second abnormal label is output.

[0017] In a second aspect, an electronic device is provided, including a memory and a processor, the memory being coupled to the processor; wherein the memory is configured to store program data, and the processor is configured to execute the program data to implement the above-mentioned multi-sensor signal anomaly detection method.

[0018] In a third aspect, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program, and the program is executed by a processor to implement the above-mentioned multi-sensor signal anomaly detection method.

[0019] In a fourth aspect, a computer program product is provided, including computer programs / instructions, and the computer programs / instructions are executed by a processor to implement the above-mentioned multi-sensor signal anomaly detection method.

[0020] Compared with the prior art, the present application has the following beneficial effects:

[0021] (1) The present application combines KAN network and Transformer coding, which can better capture complex patterns and features in data, reduce false positives and false negatives, and improve the accuracy of anomaly detection.

[0022] (2) The present application sets the overall dynamic threshold interval by combining the confidence interval, which can quantify the uncertainty of the model prediction result and improve the accuracy of anomaly judgment.

[0023] (3) The application calculates the sample mean corresponding to the historical measurement data of the T sensors around the target sensor, calculates the sample standard deviation, and calculates the standard error, so as to obtain the confidence interval; the abnormal sensor among all the sensors can be determined under the same time period. BRIEF DESCRIPTION OF DRAWINGS

[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0025] Figure 1 The schematic diagram of the first embodiment of the multi-sensor signal abnormality detection method provided by the embodiments of the present application is shown in the figure.

[0026] Figure 2 The schematic diagram of the second embodiment of the multi-sensor signal abnormality detection method provided by the embodiments of the present application is shown in the figure.

[0027] Figure 3 The schematic diagram of the abnormality detection network provided by the embodiments of the present application is shown in the figure.

[0028] Figure 4 The schematic diagram of the KAN network provided by the embodiments of the present application is shown in the figure.

[0029] Figure 5 The schematic diagram of the application of the multi-sensor signal abnormality detection method provided by the embodiments of the present application to tobacco sheet mildew detection is shown in the figure.

[0030] Figure 6 The schematic diagram of the electronic device provided by the embodiments of the present application is shown in the figure. DETAILED DESCRIPTION

[0031] The technical solutions in the embodiments of the present application will be described clearly and completely in the following with reference to the drawings of the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.

[0032] It should be noted that the features in the following embodiments and implementation manners can be combined with each other without conflict.

[0033] As shown in Figure 1 and Figure 2 , the embodiments of the present application provide a multi-sensor signal abnormality detection method, which specifically comprises the following steps:

[0034] Step S101, obtain the historical measurement data of the target sensor and preprocess it to obtain time series data.

[0035] Further, the historical measurement data of the target sensor is obtained, and the data is cleaned. When missing data is encountered, the mean of the recorded data before and after is taken to fill in, obtaining X={x(1), x(2),.., x(L)}, each point x(i)∈R m is a m-dimensional vector, and in this example, m=2.

[0036] Min-Max is used to standardize the data X, obtaining y={y(1), y(2),.., y(L)}.

[0037] Sliding window is used to divide the time series data y, the window size is set to w=100, and the step size s=1, and the time series data Y={Y(1), Y(2),.., Y=(K)} is obtained, where K=L-99, and Y(i) is a 100*2 matrix.

[0038] Step S102, position encoding is performed on the time series data Y, and the position encoded data PE is added to the time series data Y as the first input data T; the batch size is set, and the first tensor is obtained by randomly sampling from the first input data according to the batch size.

[0039] Further, the sine function is used for encoding, and for the pth position in the sequence and the ith dimension in the feature dimension, the position encoding formula is as follows:

[0040]

[0041] Further, BatchSize is 64, and a random batch is taken from Y to obtain the first tensor B={B(1), B(2),.., B(J)}, where where B(i) is a 64*100*2 tensor.

[0042] Further, the position encoded data PE is added to the time series data Y as the first input data T; T=PE+Y, T={T(1), T(2),.., T(K)}.

[0043] Step S103, as shown in Figure 3 , the first input data is processed by the first KAN network, the Transformer encoding layer, the first Transformer decoding layer, and the second KAN network to obtain the first output data P.

[0044] wherein the structure of the first KAN network is as shown in Figure 4As shown: wherein the input is Feats, the first layer and the second layer input are 2*Feats-1, and the output of the third layer is Feats, wherein the activation function of each layer is a Spline activation function, and the formula is:

[0045]

[0046] wherein c i is a parameter to be optimized during training, B i (x) is a B-spline basis function defined on the grid.

[0047] Step S104, taking the difference between the first tensor P and the first output data B as the second input data P1, that is, P1=B-P; after the second input data is processed by the second Transformer decoding layer, the linear layer and the Sigmoid activation function, the second output data P2 is obtained.

[0048] Further, the method further comprises:

[0049] setting a loss function, and optimizing the first KAN network, the Transformer encoding layer, the first Transformer decoding layer, the second KAN network, the second Transformer decoding layer and the linear layer based on the loss function;

[0050] The expression of the loss function is as follows:

[0051] LOSS=MinMax(||P1||2)(||P2-B||2)

[0052] In the formula, P1 represents the first output data, P2 represents the second output data, and B represents the first tensor.

[0053] Step S105, calculating the 2-norm ||P1||2 of the first output data and the 2-norm ||P2-B||2 of the difference between the second output data and the first tensor, and sampling them to obtain the first sample data and the second sample data respectively.

[0054] Further, the 2-norm ||P1||2 of the first output data and the 2-norm ||P2-B||2 of the difference between the second output data and the first tensor are randomly sampled for a group of α points, a total of β groups (in this example, a group of 30 points is randomly sampled, a total of 100 groups), and the mean value of each group of data is taken to obtain the first sample data G(1)={g1, g2,.., g β}, and the second sample data G(2)={g1, g2,.., g β}.

[0055] Step S106, calculating the sample mean, sample variance, and standard error corresponding to the first sample data and the second sample data, so as to obtain the first confidence interval and the second confidence interval; taking the sum of the first confidence interval and the second confidence interval as the overall dynamic threshold interval.

[0056] Further, the first sample mean corresponding to the first sample data is calculated The first sample variance s 2 (1), the first standard error SE(1);

[0057] Wherein,

[0058]

[0059] In the formula, n is the sample quantity, i=1, 2;

[0060] The second sample mean corresponding to the second sample data is calculated The second sample variance s 2 (2), the second standard error SE(2);

[0061] The first confidence interval is calculated, and the expression is as follows:

[0062]

[0063] The second confidence interval is calculated, and the expression is as follows:

[0064]

[0065] In the formula, Z is the confidence level; the value obtained by looking up the table is 1.96 for a confidence level of 95%;

[0066] The sum of the first confidence interval and the second confidence interval is taken as the overall dynamic threshold interval CIA, that is, CIA=CI(1)+CI(2).

[0067] Step S107, processing the to-be-detected data of the sensor, when the sum of the 2-norm of the first output data corresponding to the to-be-detected data of the sensor and the second output data and the 2-norm of the difference between the first tensor does not belong to the overall dynamic threshold interval, that is The first abnormal label is output.

[0068] And / or,

[0069] Step S100, obtaining the historical measurement data X T ={x 1 ,x 2 ,...,x T} of T sensors around the target sensor.

[0070] Step S200, the sample mean corresponding to the historical measurement data of the T sensors is calculated, the sample standard deviation is calculated, the standard error is calculated, and thus the confidence interval is obtained.

[0071] Further, the sample mean corresponding to the historical measurement data of the T sensors is calculated The sample standard deviation s is calculated, and the standard error SE is calculated.

[0072]

[0073] The expression of the confidence interval CI is as follows:

[0074]

[0075] In the formula, t represents the t value looked up from the t distribution table for a confidence level of 95%. For a confidence level of 95%, t≈2.262.

[0076] Step S300, when the to-be-detected data of the i-th sensor around the target sensor does not belong to the confidence interval, it is determined that the i-th sensor is abnormal at this moment, and a second abnormality label is output.

[0077] Further, when the to-be-detected data of the i-th sensor around the target sensor does not belong to the confidence interval, that is, Then it is determined that the i-th sensor is abnormal at this moment, the abnormal value is set to 1, and γ i =1.

[0078] The total sum Y of abnormal values in a unit time is continuously recorded i =∑γ i When the total sum of abnormal values is greater than a threshold value, it is determined that the i-th sensor is abnormal in the unit time interval.

[0079] Embodiment 1

[0080] As Figure 5 shown, the embodiment of the present application provides an abnormality detection method for multi-sensor signals, which is used for detecting data abnormality caused by moldy change in the process of tobacco sheet aging, so as to reduce the moldy change risk in the process of tobacco sheet maintenance. The method specifically comprises the following steps:

[0081] Step S101, obtaining historical measurement data of a target sensor and preprocessing the same to obtain time series data;

[0082] Step S102, position encoding is performed on the time series data, and the position encoded data is added to the time series data as first input data; a batch size is set, and the first tensor is obtained by randomly extracting from the first input data according to the batch size.

[0083] Step S103, the first input data is processed by the first KAN network, the Transformer encoding layer, the first Transformer decoding layer, and the second KAN network to obtain first output data;

[0084] Step S104, the difference between the first tensor and the first output data is taken as second input data; the second input data is processed by the second Transformer decoding layer, the linear layer, and the activation function to obtain second output data;

[0085] Step S105, the 2-norm of the first output data and the 2-norm of the difference between the second output data and the first tensor are calculated and sampled to obtain first sample data and second sample data, respectively;

[0086] Step S106, the sample mean, sample variance, and standard error corresponding to the first sample data and the second sample data are calculated to obtain a first confidence interval and a second confidence interval; the sum of the first confidence interval and the second confidence interval is taken as a total dynamic threshold interval;

[0087] Step S107, when the sum of the 2-norm of the first output data corresponding to the to-be-detected data of the sensor and the 2-norm of the difference between the second output data and the first tensor does not belong to the total dynamic threshold interval, a first abnormal label is outputted;

[0088] and / or,

[0089] Step S100, historical measurement data of T sensors around a target sensor are obtained; the distance between the sensors is no more than 10 m.

[0090] Step S200, the sample mean corresponding to the historical measurement data of the T sensors is calculated, the sample standard deviation is calculated, and the standard error is calculated to obtain a confidence interval;

[0091] Step S300, when the to-be-detected data of the i-th sensor around the target sensor does not belong to the confidence interval, it is determined that the i-th sensor is abnormal at this moment, and a second abnormal label is outputted.

[0092] It should be noted that the first abnormal label indicates that a large number of sensors are involved in the tobacco aging process, and these data produce a series of abnormal data at the data level due to network transmission failure, internal failure, or external interference. These data are manifested as noise points, collective abnormalities, and context abnormalities in time series, which are not conducive to reflecting the real data of each dimension of the tobacco package and need to be processed in a timely manner.

[0093] At the same time, due to the slow mildew of the internal tobacco leaves, the mildew part sensor data will be different from other sensors, and such data anomaly is difficult to identify by manual naked eye. It is necessary to determine the sensors with differences in all sensors in the same time period. The second anomaly label represents the anomaly of the data caused by the chemical change of the internal tobacco leaves of the tobacco bale in the tobacco aging process.

[0094] Correspondingly, the present application also provides an electronic device, comprising: one or more processors; a memory for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the anomaly detection method as described above. As Figure 6 As shown in the figure, a hardware structure diagram of any data processing capable device where the anomaly detection method provided by the embodiment of the present application is located, in addition to the Figure 6 In addition to the processor, the memory and the network interface shown in the figure, any data processing capable device where the device in the embodiment is located can also include other hardware according to the actual function of the data processing capable device, which will not be described here.

[0095] Correspondingly, the present application also provides a computer readable storage medium having computer instructions stored thereon, which are executed by a processor to implement the anomaly detection method as described above. The computer readable storage medium can be an internal storage unit of any data processing capable device, such as a hard disk or a memory. The computer readable storage medium can also be an external storage device, such as a plug-in hard disk, a smart media card (SMC), an SD card, a flash card, etc. Further, the computer readable storage medium can include both the internal storage unit of any data processing capable device and the external storage device. The computer readable storage medium is used to store the computer program and other programs and data required by the data processing capable device, and can also be used to temporarily store data that has been output or will be output.

[0096] The above embodiments are only used to illustrate the design ideas and characteristics of the present application, and the purpose is to enable those skilled in the art to understand the content of the present application and implement it, and the protection scope of the present application is not limited to the above embodiments. Therefore, any equivalent changes or modifications made according to the principles and design ideas disclosed by the present application are within the protection scope of the present application.

Claims

1. A method for detecting anomalies of multi-sensor signals, characterized in that: The method comprises: Obtain historical measurement data of the target sensor and preprocess it to obtain time series data; Position-encode the time series data, add the position-encoded data to the time series data, and use it as the first input data; set the batch size, and randomly extract from the first input data according to the batch size to obtain the first tensor; The first input data is processed by the first KAN network, the Transformer encoding layer, the first Transformer decoding layer, and the second KAN network to obtain the first output data; The difference between the first tensor and the first output data is used as the second input data; The second input data is processed by the second Transformer decoding layer, linear layer, and activation function to obtain the second output data; Calculate the 2-norm of the first output data and the 2-norm of the difference between the second output data and the first tensor and sample them to obtain first sample data and second sample data respectively; Calculating the sample mean, sample variance, and standard error corresponding to the first sample data and the second sample data to obtain a first confidence interval and a second confidence interval; and using the sum of the first confidence interval and the second confidence interval as the overall dynamic threshold interval; When the sum of the 2-norm of the first output data corresponding to the to-be-detected data of the sensor and the 2-norm of the difference between the second output data and the first tensor does not fall within the overall dynamic threshold interval, a first abnormal label is output; and / or, Obtain historical measurement data of T sensors around the target sensor; Calculate the sample mean, sample standard deviation, and standard error corresponding to the historical measurement data of T sensors to obtain the confidence interval; When the data to be detected of the i-th sensor around the target sensor does not belong to the confidence interval, the i-th sensor at that moment is determined to be abnormal, and the second abnormal label is output.

2. The method for detecting anomalies of multi-sensor signals according to claim 1, wherein: Obtain historical measurement data from the target sensor and preprocess it to obtain time series data including: The historical measurement data of the target sensor is cleaned, normalized, and processed using a sliding window to obtain time series data.

3. The method for detecting anomalies of multi-sensor signals according to claim 1, wherein: The method further comprises: Set the loss function and optimize the first KAN network, Transformer encoding layer, first Transformer decoding layer, second KAN network, second Transformer decoding layer, and linear layer based on the loss function; The expression of the loss function is as follows: LOSS=MinMax(‖P1‖2)(‖P2-B‖2) Where P1 represents the first output data, P2 represents the second output data, and B represents the first tensor.

4. The method for detecting anomalies of multi-sensor signals according to claim 1, wherein: Sampling the 2-norm of the first output data and the 2-norm of the difference between the second output data and the first tensor to obtain first sample data and second sample data respectively includes: The 2-norm of the first output data ‖P1‖2, and the 2-norm of the difference between the second output data and the first tensor ‖P2-B‖2, perform random sampling of a group of α points respectively, collect β groups in total, take the mean of each group of data, and obtain the first sample data G(1)={g1,g2,..,g β }, the second sample data G(2) = {g1, g2, .., g β }.

5. The method for detecting anomalies of multi-sensor signals according to claim 1, wherein: Calculate the sample mean, sample variance, and standard error corresponding to the first sample data and the second sample data, thereby obtaining a first confidence interval and a second confidence interval; The sum of the first confidence interval and the second confidence interval is used as the overall dynamic threshold interval, including: Calculate the first sample mean corresponding to the first sample data The first sample variance s 2 (1), first standard error SE(1); Calculate the second sample mean corresponding to the second sample data The second sample variance s 2 (2), second standard error SE (2); Calculate the first confidence interval using the following expression: Calculate the second confidence interval using the following expression: Where Z is the confidence level; The sum of the first confidence interval and the second confidence interval is taken as the overall dynamic threshold interval CIA.

6. The method for detecting anomalies of multi-sensor signals according to claim 1, wherein: The process of calculating the sample mean, sample standard deviation, and standard error corresponding to the historical measurement data of T sensors to obtain the confidence interval includes: Calculate the sample mean corresponding to the historical measurement data of T sensors Calculate the sample standard deviation s and the standard error SE; The expression for calculating the confidence interval CI is as follows: Where t represents the t value found from the t distribution table for a 95% confidence level.

7. The method for detecting anomalies of multi-sensor signals according to claim 1, wherein: When the data to be detected by the i-th sensor around the target sensor does not fall within the confidence interval, the abnormality of the i-th sensor at that moment is determined to include: When the detected data of the i-th sensor around the target sensor does not belong to the confidence interval, the i-th sensor is considered abnormal at that moment and the abnormal value is set to 1; The total number of abnormal values ​​within a unit time is continuously recorded; when the total number of abnormal values ​​is greater than the threshold, the i-th sensor within the unit time interval is determined to be abnormal.

8. An electronic device comprising a memory and a processor, characterized in that: The memory is coupled to the processor; wherein the memory is used to store program data, and the processor is used to execute the program data to implement the multi-sensor signal anomaly detection method according to any one of claims 1 to 7.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method for detecting abnormalities in multi-sensor signals according to any one of claims 1 to 7 is implemented.

10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the method for detecting anomalies of multi-sensor signals according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Large model compression method and system based on KAN network

    CN118673969A

  • Abnormality detector of multisensor signal and abnormality detecting method of multisensor signal

    JP2006317194A