Anomaly detection method and device based on improved data imaging

Through the deep learning network model and improved Markov switching field technology, chemical production data are collected and analyzed in real time, which solves the problems of delay and limitations of traditional monitoring methods, realizes real-time monitoring and anomaly detection of the chemical production process, and improves the efficiency of chemical production. Accuracy and efficiency of abnormal pattern recognition.

CN118470658BActive Publication Date: 2024-10-01NANJING ANALYTICAL INSTR FACTORY
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202410931672.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-12
Publication Date
2024-10-01
Estimated Expiration
2044-07-12

AI Technical Summary

Technical Problem

Traditional chemical production process monitoring methods rely on manual inspections, which have high delays and limitations, and cannot monitor abnormal conditions in real time, resulting in abnormal conditions being missed or discovered late.

Method used

An improved data imaging anomaly detection method is adopted to collect and analyze parameter data in real time through a deep learning network model. The improved Markov transformation field is used to encode the one-dimensional data into a two-dimensional feature image. The Transformer network model is combined for anomaly detection to achieve Real-time monitoring and timely warning of chemical production processes.

Benefits of technology

It realizes real-time monitoring and timely warning of the chemical production process, enhances the data feature representation and model perception capabilities of time correlation, can more accurately detect abnormal situations, and improves the effectiveness of abnormal pattern recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118470658B_ABST
    Figure CN118470658B_ABST
Patent Text Reader

Abstract

The present invention discloses an anomaly detection method and device based on improved data imaging, belonging to the field of deep learning technology. The method comprises obtaining a picture to be detected, inputting the picture to be detected into a trained deep learning network model, and obtaining an anomaly detection result; wherein the training method of the deep learning network model comprises: encoding pre-collected one-dimensional training data through an improved Markov transition field, and converting it into a two-dimensional feature image with time correlation; and training a pre-constructed deep learning network model using the two-dimensional feature image. The present invention can realize real-time monitoring and timely early warning of the production process by collecting various parameter data in real time and identifying abnormal situations through data analysis and algorithms.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to an anomaly detection method and device based on improved data imaging, belonging to the technical field of deep learning. Background Art

[0002] The chemical production process involves the monitoring and control of many parameters, such as gas concentration, temperature, pressure, etc., and abnormal changes in these parameters may lead to production accidents and product quality problems. Therefore, it is crucial for chemical companies to detect and deal with these abnormal situations as early as possible.

[0003] Traditional chemical production process monitoring methods mainly rely on manual inspections and regular sampling analysis, which has the problems of high latency and limitations. For large-scale chemical production systems, manual inspections are inefficient and cannot monitor abnormal conditions in real time, which can easily lead to missed detection or delayed discovery of abnormal conditions. Summary of the invention

[0004] The purpose of the present invention is to overcome the deficiencies in the prior art and to provide an anomaly detection method and device based on improved data imaging, which can realize real-time monitoring and timely warning of the production process by collecting various parameter data in real time and identifying abnormal situations through data analysis and algorithms.

[0005] To achieve the above object, the present invention is implemented by adopting the following technical solutions:

[0006] In a first aspect, the present invention provides an anomaly detection method based on improved data imaging, comprising:

[0007] Obtain the image to be detected, input the image to be detected into the trained deep learning network model, and obtain the anomaly detection result;

[0008] Among them, the training method of the deep learning network model includes:

[0009] The pre-collected one-dimensional training data is encoded through an improved Markov transformation field and converted into a two-dimensional feature image with time correlation;

[0010] The pre-built deep learning network model is trained using two-dimensional feature images.

[0011] Furthermore, the method also includes preprocessing the collected one-dimensional training data, removing a maximum value and a minimum value in the data sliding window, and then using mean filtering on other data in the data sliding window.

[0012] Furthermore, the one-dimensional training data collected in advance is encoded by the improved Markov transformation field to be converted into a two-dimensional feature image with time correlation, including:

[0013] The one-dimensional training data is divided into four categories using the standardized quantile division rule, namely, excess 10%, excess 50%, excess 100%, and others;

[0014] Perform quantile enhancement on each one-dimensional training data after division;

[0015] The number of occurrences of each one-dimensional training data in the quantile interval after quantile enhancement is counted, a state transfer matrix is ​​constructed, and the state transfer matrix is ​​used as a two-dimensional feature image with time correlation.

[0016] Furthermore, the calculation formula for performing quantile enhancement on each one-dimensional training data after division is as follows:

[0017] ;

[0018] in, is the first Percentile, No. Percentile data points, is the mean of the quantile data points, is the quantile reinforcement coefficient of the quantile data point.

[0019] Furthermore, the method also includes: labeling the one-dimensional training data, and the labels are divided into the following four categories: data without abnormality, data trend change, data large fluctuation, and data out of range.

[0020] Furthermore, the deep learning network model adopts an improved Transformer network model, which includes a dual convolutional layer, a downsampling layer, a lightweight Transformer and a pooling layer, and a 1x1 convolutional layer. The lightweight Transformer includes multiple convolutional layers, a GroupNorm layer, and an axial compression attention layer. The axial compression attention layer includes a convolutional layer, a horizontal pooling compression module, a vertical pooling compression module, and a multi-head attention calculation module.

[0021] Furthermore, the step of inputting the image to be detected into a trained deep learning network model to obtain anomaly detection results includes:

[0022] The image to be detected is input into the improved Transformer network model. After the image to be detected is processed by three sets of double convolution layers, downsampling layers and lightweight Transformer, the number of output channels is adjusted through the pooling layer and 1x1 convolution layer to obtain the anomaly detection result.

[0023] Among them, in the lightweight Transformer, the feature layer obtained by double convolution and downsampling of the detection image is used as input. The feature layer is processed by two convolution blocks to obtain K and V respectively. The feature layer itself is used as Q to obtain three vectors Q, K, and V for calculating attention.

[0024] Q, K, and V are compressed horizontally and vertically respectively to obtain the compressed Q. 1 , K 1 、V 1 and Q 2 , K 2 、V 2 ;

[0025] The compressed Q 1 , K 1 、V 1 and Q 2 , K 2 、V 2 Multi-head attention calculations are performed separately, the results are added bit by bit, and finally a 1x1 convolution is performed to adjust the number of channels to obtain the output feature layer.

[0026] Furthermore, the method further includes: using a multi-classification cross entropy loss function to train a deep learning network model, and the calculation formula is as follows:

[0027] ;

[0028] in, is the loss function; K is the number of species; is a label, if the category is c ,but =1, otherwise equal to 0; is the category output by the network model c probability.

[0029] In a second aspect, the present invention provides an anomaly detection device based on improved data imaging, comprising:

[0030] The anomaly detection module is used to obtain the image to be detected, input the image to be detected into the trained deep learning network model, and obtain the anomaly detection result;

[0031] Among them, the training method of the deep learning network model includes:

[0032] The pre-collected one-dimensional training data is encoded through an improved Markov transformation field and converted into a two-dimensional feature image with time correlation;

[0033] The pre-built deep learning network model is trained using two-dimensional feature images.

[0034] In a third aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the aforementioned methods.

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

[0036] The present invention provides an anomaly detection method and device based on improved data imaging, which can realize real-time monitoring and timely early warning of the production process by collecting various parameter data in real time and identifying abnormal situations through data analysis and algorithms; the data is converted from one dimension to two dimensions through an improved Markov transition field, which not only enriches the feature representation of the data, but also enhances the model's perception of time correlation; the deep learning model can automatically extract and learn complex features in the data, so as to more accurately detect anomalies; the present invention combines the advantages of data conversion and deep learning, and can more effectively identify and detect abnormal patterns in data. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 The present invention provides a flowchart of an anomaly detection method based on improved data imaging.

[0038] Figure 2 It is a schematic diagram of improved Markov transformation field data imaging provided by an embodiment of the present invention.

[0039] Figure 3 This is a diagram of the improved standardized quantile data imaging effect provided by an embodiment of the present invention.

[0040] Figure 4 This is a data imaging effect diagram of standardization and quantile enhancement provided by an embodiment of the present invention.

[0041] Figure 5 It is a structural diagram of the deep learning classification model provided by an embodiment of the present invention.

[0042] Figure 6 It is a structural diagram of a lightweight Transformer provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0043] The present invention will be further described below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the protection scope of the present invention.

[0044] Embodiment 1: This embodiment introduces an anomaly detection method based on improved data imaging, including:

[0045] Obtain the image to be detected, input the image to be detected into the trained deep learning network model, and obtain the anomaly detection result;

[0046] Among them, the training method of the deep learning network model includes:

[0047] The pre-collected one-dimensional training data is encoded through an improved Markov transformation field and converted into a two-dimensional feature image with time correlation;

[0048] The pre-built deep learning network model is trained using two-dimensional feature images.

[0049] See also Figure 1 The anomaly detection method based on improved data imaging provided in this embodiment specifically involves the following steps in its application process:

[0050] Step 1: Collect operating data and pre-process the collected operating data, including data filtering and conversion;

[0051] First, the collected operating data is preprocessed by removing a maximum value and a minimum value in the data sliding window, and then the other data in the data sliding window are filtered using mean value.

[0052] Step 2: Encode the one-dimensional time series running data through the improved Markov Transition Field (MTF) and convert it into a two-dimensional feature image with time correlation, and strengthen the association between current data and historical data in the MTF encoding rule of the standard quantile threshold;

[0053] Step 3: Classify and evaluate the two-dimensional feature images through the deep learning network model to determine the cause of data anomalies; first, prepare the data set through the method of step 2 for training the deep learning network model. The deep learning network model can use ResNet, VGG, EfficientNetV2, Transformer, etc. The improved Transformer network is used here as the model for judging and evaluating images.

[0054] Step 4: Save the trained deep learning network model and use the trained deep learning network model to detect data anomalies.

[0055] See also Figure 2In order to make the data before and after the moment contrast, the data is divided into four categories using the standardized quantile division rule, namely standard interval (excess 10%), excess 50%, excess 100%, and others. The standardized quantile interval enables the current data and historical data to establish a unified measurement standard, and the data before and after the moment are contrasted; the standardized quantile interval enables the current data and historical data to establish a unified measurement standard. Relatively stable data will be concentrated in the same quantile interval, and there will be no transfer phenomenon, so the image formed is simple. Unstable data will be scattered to other quantile intervals, resulting in transfers between quantiles, and the corresponding transfer probability will also change slightly, thus highlighting abnormal values ​​in the formed image.

[0056] The specific calculation process is as follows: For a given time series , divide it into 4 quantile intervals according to the standard interval, and use the quantile corresponding to each data To quantify the original data, by identifying the quantiles, each time series element Mapped to the corresponding quantile For any , which must belong to a certain quantile , and the next data point , belongs to the quantile , then at time i to i+1, there is a transition from the j quantile to the m quantile. All the transition phenomena are counted and the transition probabilities between the quantiles are calculated. According to the above rules, the quantiles representing the original time series are converted into a Markov transfer matrix W along the time axis through the first-order Markov chain method, which is essentially a Q×Q neighbor weighted matrix. As shown in the following formula:

[0057] ;

[0058] In the formula, Indicates from the percentile Transfer to quantile probability.

[0059] The Markov transition field is then used to further describe the relative time correlation. The elements in the transfer matrix are rearranged according to the corresponding order of the time series X. This is shown in the following formula:

[0060] ;

[0061] In the formula, Represents the data from time t Percentile Transfer to Time data Percentile The dimension of the Markov transition field M is n×n, where n is the length of the original time series X.

[0062] See also Figure 3 , is a data image of the standardized quantile. Figure 3 (a) to Figure 3 (d) The data imaging in the figure changes from no abnormality to various abnormalities. Figure 3 (a) and Figure 3 The similarity of the generated images in (d) is very high, which is not conducive to subsequent recognition. Figure 3 (b) and Figure 3 There are many "gray areas" in (c), which means that the coding rules are too sensitive to anomalies and the boundary between anomalies and normality is not obvious. Therefore, a method of quantile enhancement is proposed.

[0063] See also Figure 4 , perform quantile enhancement on each data; then, by counting the number of occurrences of each data in the quantile interval, a state transition matrix is ​​constructed, which describes the transition probability between different data; finally, MTF visualizes the state transition matrix and presents the transition probability in the form of an image. The quantile enhancement formula is as follows:

[0064] ;

[0065] in, is the first Percentile, No. Percentile data points, is the mean of the quantile data points, is the quantile enhancement coefficient of the quantile data point, which makes the abnormal data in the data window evenly distributed between 0 and 2 times the average value. Figure 4 It is the image formed after quantile enhancement.

[0066] Input the obtained data image into the improved Transformer network model;

[0067] There is a problem with using traditional visual Transformer. Its computational complexity is huge compared to CNN. In order to solve the problem of high computational complexity of transformer, we improved the multi-head attention mechanism in transformer and used an axial compression attention mechanism to reduce the computational complexity.

[0068] The improved Transformer network model combines CNN with Transformer to extract global and local information of the image. The basic structure of the model is double convolution plus downsampling and then inserting a lightweight Transformer. After three steps, it is pooled and finally adjusted through a 1x1 convolution to obtain the final classification result. Figure 5 Shown is the structural diagram of the deep learning network model.

[0069] The most important one is the lightweight Transformer in the middle. The lightweight Transformer structure is shown below: Figure 6 As shown. The feature layer obtained by double convolution and downsampling of the detection image is used as input. The feature layer first passes through the convolution and GroupNorm layers and enters the axial compression attention layer. In the axial compression attention layer, the feature layer first passes through two convolution blocks to obtain K and V respectively, and the feature layer itself is used as Q. In this way, three vectors Q, K, and V for calculating attention are obtained. Then Q, K, and V are compressed by horizontal pooling and vertical pooling respectively to obtain the compressed Q 1 , K 1 、V 1 and Q 2 , K 2 、V 2 ; The compressed Q 1 , K 1 、V 1 and Q 2 , K 2 、V 2 The multi-head attention calculation is performed separately, and the results are added bit by bit. Finally, a 1x1 convolution is performed to adjust the number of channels to obtain the output result. After the axial compression attention layer, a series of convolutions in the structure diagram are performed, normalized and activated to the final output feature layer. And the residual structure is interspersed in the lightweight Transformer structure to help the network understand the deep feature information.

[0070] When training this model, the cross entropy loss function is used, and its calculation formula is as follows:

[0071] ;

[0072] in, is the loss function; K is the number of species; is a label, if the category is c ,but =1, otherwise equal to 0; is the category output by the network model c probability.

[0073] When preparing the data set for model training, the improved Markov transition field is used to convert the data into images and the images are labeled. The images can be divided into four categories: (1) no abnormal data, (2) data trend changes, (3) large data fluctuations, and (4) data out of range. Except for category (1) indicating that the data is normal, the other categories are detected as abnormal data. Category (2) indicates that the ambient gas concentration is changing, category (3) indicates that the ambient gas concentration changes dramatically, and category (4) indicates that the ambient gas concentration is not within the normal range.

[0074] Embodiment 2: This embodiment provides an abnormality detection device based on improved data imaging, comprising:

[0075] The anomaly detection module is used to obtain the image to be detected, input the image to be detected into the trained deep learning network model, and obtain the anomaly detection result;

[0076] Among them, the training method of the deep learning network model includes:

[0077] The pre-collected one-dimensional training data is encoded through an improved Markov transformation field and converted into a two-dimensional feature image with time correlation;

[0078] The pre-built deep learning network model is trained using two-dimensional feature images.

[0079] Embodiment 3, this embodiment provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the steps of any one of the methods described in Embodiment 1 are implemented.

[0080] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

[0081] It should be understood by those skilled in the art that the embodiments of the present disclosure may be provided as methods, systems or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware aspects. Moreover, the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0082] The present disclosure is described with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present disclosure. It should be understood that each process and / or block in the flowchart and / or block diagram and the combination of processes and / or blocks in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0083] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0084] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0085] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present disclosure rather than to limit its protection scope. Although the present disclosure has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that after reading the present disclosure, those skilled in the art can still make various changes, modifications or equivalent substitutions to the specific implementation methods of the invention, but these changes, modifications or equivalent substitutions are all within the protection scope of the disclosed claims to be approved.

Claims

1. An anomaly detection method based on improved data imaging, characterized in that: include: Obtain a picture to be detected, input the picture to be detected into a trained deep learning network model, and obtain anomaly detection results; the deep learning network model adopts an improved Transformer network model, the improved Transformer network model includes a double convolution layer, a downsampling layer, a lightweight Transformer and a pooling layer, a 1x1 convolution layer, the lightweight Transformer includes multiple convolution layers, a GroupNorm layer and an axial compression attention layer, the axial compression attention layer includes a convolution layer, a horizontal pooling compression module, a vertical pooling compression module and a multi-head attention calculation module; The step of inputting the image to be detected into the trained deep learning network model to obtain anomaly detection results includes: The image to be detected is input into the improved Transformer network model. After the image to be detected is processed by three sets of double convolution layers, downsampling layers and lightweight Transformer, the number of output channels is adjusted through the pooling layer and 1x1 convolution layer to obtain the anomaly detection result. Among them, in the lightweight Transformer, the feature layer obtained by double convolution and downsampling of the detection image is used as input. The feature layer is processed by two convolution blocks to obtain K and V respectively. The feature layer itself is used as Q to obtain three vectors Q, K, and V for calculating attention. Perform horizontal pooling compression and vertical pooling compression on Q, K, and V respectively to obtain compressed Q1, K1, V1 and Q2, K2, V2; The compressed Q1, K1, V1 and Q2, K2, V2 are respectively subjected to multi-head attention calculation, the results are added bit by bit, and finally a 1x1 convolution is performed to adjust the number of channels to obtain the output feature layer; Among them, the training method of the deep learning network model includes: The pre-collected one-dimensional training data is encoded through an improved Markov transformation field and converted into a two-dimensional feature image with time correlation; The pre-built deep learning network model is trained using two-dimensional feature images.

2. The anomaly detection method based on improved data imaging according to claim 1, characterized in that: The method also includes preprocessing the collected one-dimensional training data, removing a maximum value and a minimum value in the data sliding window, and then using mean filtering on other data in the data sliding window.

3. The anomaly detection method based on improved data imaging according to claim 1, characterized in that: The method of encoding the pre-collected one-dimensional training data through the improved Markov transformation field and converting it into a two-dimensional feature image with time correlation includes: The one-dimensional training data is divided into four categories using the standardized quantile division rule, namely, excess 10%, excess 50%, excess 100%, and others; Perform quantile enhancement on each one-dimensional training data after division; The number of occurrences of each one-dimensional training data in the quantile interval after quantile enhancement is counted, a state transfer matrix is ​​constructed, and the state transfer matrix is ​​used as a two-dimensional feature image with time correlation.

4. The anomaly detection method based on improved data imaging according to claim 3, characterized in that: The calculation formula for performing quantile enhancement on each one-dimensional training data after division is as follows: ; in, is the first Percentile, For the Percentile data points, is the mean of the quantile data points, is the quantile reinforcement coefficient of the quantile data point.

5. The anomaly detection method based on improved data imaging according to claim 3, characterized in that: The method also includes: labeling the one-dimensional training data, where the labels are divided into the following four categories: data without abnormality, data trend change, data large fluctuation, and data out of range.

6. The anomaly detection method based on improved data imaging according to claim 1, characterized in that: The method further includes: using a multi-classification cross entropy loss function to train a deep learning network model, the calculation formula of which is as follows: ; in, is the loss function; K is the number of species; is a label, if the category is c ,but =1, otherwise equal to 0; is the category output by the network model c probability.

7. An anomaly detection device based on improved data imaging, characterized in that: include: An anomaly detection module is used to obtain a picture to be detected, input the picture to be detected into a trained deep learning network model, and obtain an anomaly detection result; the deep learning network model adopts an improved Transformer network model, and the improved Transformer network model includes a double convolution layer, a downsampling layer, a lightweight Transformer and a pooling layer, and a 1x1 convolution layer. The lightweight Transformer includes multiple convolution layers, a GroupNorm layer, and an axial compression attention layer. The axial compression attention layer includes a convolution layer, a horizontal pooling compression module, a vertical pooling compression module, and a multi-head attention calculation module; The step of inputting the image to be detected into the trained deep learning network model to obtain anomaly detection results includes: The image to be detected is input into the improved Transformer network model. After the image to be detected is processed by three sets of double convolution layers, downsampling layers and lightweight Transformer, the number of output channels is adjusted through the pooling layer and 1x1 convolution layer to obtain the anomaly detection result. Among them, in the lightweight Transformer, the feature layer obtained by double convolution and downsampling of the detection image is used as input. The feature layer is processed by two convolution blocks to obtain K and V respectively. The feature layer itself is used as Q to obtain three vectors Q, K, and V for calculating attention. Perform horizontal pooling compression and vertical pooling compression on Q, K, and V respectively to obtain compressed Q1, K1, V1 and Q2, K2, V2; The compressed Q1, K1, V1 and Q2, K2, V2 are respectively subjected to multi-head attention calculation, the results are added bit by bit, and finally a 1x1 convolution is performed to adjust the number of channels to obtain the output feature layer; Among them, the training method of the deep learning network model includes: The pre-collected one-dimensional training data is encoded through an improved Markov transformation field and converted into a two-dimensional feature image with time correlation; The pre-built deep learning network model is trained using two-dimensional feature images.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method described in any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Abnormal image detection model training method and device and medium

    CN114387451A

  • Transform-based monocular depth estimation algorithm

    CN115131418A

  • Near-infrared quantitative modeling method combining Markov transfer field and transfer learning

    CN115861679A

  • Epilepsy detection method based on Markov transition field and improved two-dimensional multi-fractal analysis method

    CN117153372A

  • Network anomaly detection method and device based on GMD imaging and improved ResNeXt

    CN117197543A