WO2023155296A1 - 时间序列数据检测方法、装置、设备及计算机存储介质 - Google Patents
时间序列数据检测方法、装置、设备及计算机存储介质 Download PDFInfo
- Publication number
- WO2023155296A1 WO2023155296A1 PCT/CN2022/089438 CN2022089438W WO2023155296A1 WO 2023155296 A1 WO2023155296 A1 WO 2023155296A1 CN 2022089438 W CN2022089438 W CN 2022089438W WO 2023155296 A1 WO2023155296 A1 WO 2023155296A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- image
- dimensional
- time series
- series data
- loss value
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T9/00—Image coding
- G06T9/001—Model-based coding, e.g. wire frame
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20081—Training; Learning
Definitions
- the present application relates to the field of artificial intelligence, and in particular to a time series data detection method, device, equipment and computer storage medium.
- the demand for anomaly detection of time series data is also increasing in the fields of network monitoring, equipment maintenance, information security, finance, aerospace and other fields.
- the inventors found that the current anomaly detection of time series data is usually an unsupervised anomaly detection method. For example, by segmenting time series data and then finding outliers through clustering of neighboring samples or densities, but such methods are often very sensitive to parameters, and the anomaly detection of time series data is more complicated. It can be seen that the anomaly detection of existing time series data The method cannot be applied to large-scale time series data, and there is a problem of small scope of application.
- the purpose of this application is to provide a time series data detection method, device, equipment and computer storage medium, so as to solve the problem that the existing time series data anomaly detection method cannot be applied to large-scale time series data, and has a small scope of application technical problems.
- a time series data detection method comprising:
- the trained IntroVAE model calculates the loss value between the two-dimensional image and the reconstructed image to obtain a target loss value; wherein, the target loss value is used to represent whether the one-dimensional time series data There is an exception.
- a time series data detection device comprising:
- a conversion module is used to convert the one-dimensional time series data to be detected to obtain a two-dimensional image
- a reconstruction module configured to perform image reconstruction based on the two-dimensional image, obtain a reconstructed image associated with the one-dimensional time series data, and a training image sample set including the reconstructed image;
- the training module is used to utilize the training image sample set to train the IntroVAE model of the introspection variational autoencoder to obtain the trained IntroVAE model;
- a detection module configured to use the trained IntroVAE model to calculate a loss value between the two-dimensional image and the reconstructed image to obtain a target loss value; wherein the target loss value is used to represent the one Whether there is an anomaly in the dimensional time series data.
- a computer device comprising a memory, a processor, and a readable storage medium stored in the memory and operable on the processor, wherein the processor implements the following steps when executing the readable storage medium:
- the trained IntroVAE model calculates the loss value between the two-dimensional image and the reconstructed image to obtain a target loss value; wherein, the target loss value is used to represent whether the one-dimensional time series data There is an exception.
- One or more readable storage media storing computer-readable instructions, the computer-readable storage medium storing computer-readable instructions, wherein the computer-readable instructions, when executed by one or more processors, cause all The one or more processors perform the following steps:
- the trained IntroVAE model calculates the loss value between the two-dimensional image and the reconstructed image to obtain a target loss value; wherein, the target loss value is used to represent whether the one-dimensional time series data There is an exception.
- the above-mentioned time series data detection method, device, equipment and computer storage medium convert the one-dimensional time series data to be detected into a two-dimensional image, and use the two-dimensional image as the input of the model, and solve the problem of abnormal detection of time series Converting to the problem of anomaly detection of images, the anomaly detection of time series data is relatively simple and has a wide range of applications. And through introspection variational autoencoder IntroVAE model to reconstruct the two-dimensional image, so that the reconstructed image is as close as possible to the input two-dimensional image.
- Fig. 1 is the realization flowchart of a kind of time series data detection method provided by the embodiment of the present application
- Fig. 2 is the structural representation of the IntroVAE model that the embodiment of the present application provides;
- FIG. 3 is a structural block diagram of a time-series data detection device provided in an embodiment of the present application.
- Fig. 4 is a structural block diagram of a device provided by an embodiment of the present application.
- AI artificial intelligence
- the embodiments of the present application may acquire and process relevant data based on artificial intelligence technology.
- artificial intelligence is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. .
- Artificial intelligence basic technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation/interaction systems, and mechatronics.
- Artificial intelligence software technology mainly includes computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning/deep learning.
- the embodiment of the present application provides a time series data detection method, which is applied to computer equipment.
- a time-series data detection method is configured on a computer device in the form of a target script, and the computer device executes the target script, and then executes various steps of the time-series data detection method provided in this embodiment.
- FIG. 1 shows a time series data detection method provided by an embodiment of the present application, including:
- S11 Perform a conversion operation on the one-dimensional time series data to be detected to obtain a two-dimensional image.
- step S11 the anomaly detection of the one-dimensional time series to be detected is to determine whether there is an obvious statistical anomaly at a time series point according to a certain statistical or machine learning strategy for the time series data.
- time series data is a data column recorded in chronological order, and each data in the same data column must be of the same caliber, requiring comparability.
- the scale and complexity of time series data have increased significantly, and the demand for time series anomaly detection with intelligent and automatic characteristics has surged, and has played a role in many fields to improve the robustness and quality of output or services in these fields and benefits, such as network monitoring, equipment maintenance, information security, finance, aerospace and other fields.
- time series anomaly detection is to mine and learn the rules of existing time series data. Due to noisy data from the real world and complex anomalous patterns need to be captured.
- the abnormal points detected in one-dimensional time series data are converted to detect abnormal points in two-dimensional images, and the detection of two-dimensional images is more intuitive and convenient than direct detection of one-dimensional time series data.
- the methods that can be used to convert one-dimensional time series data into two-dimensional images are Gramey angle field GAFs, including GASF (corresponding to the angle sum), and GADF (corresponding to the angle difference), Markov transition field MTF, recursive graph Recurrence Plot and short-time Fourier transform STFT.
- a two-dimensional image can be constructed by passing the one-dimensional time series data through the GAF algorithm and generating a recursive graph as the input of the IntroVAE model of the introspective variational autoencoder.
- the time series data is converted into a two-dimensional image, and the generated image can restore the original time series of Cartesian coordinates through the main diagonal, that is, each graph corresponds to a sequence without loss of information.
- the recurrence graph reveals the internal structure of the time series and provides more effective information for anomaly detection.
- step S11 may include:
- the two-dimensional image is generated based on the GAF image and the REC image.
- the GAF algorithm transforms the scaled time series data from a Cartesian coordinate system to a polar coordinate system, and then identifies the time correlation at different time points by considering the sum of angles between different points.
- the GAF image generated from the one-dimensional time series data X k is k is an integer greater than 0.
- the one-dimensional time series data is encoded based on the recurrence graph to obtain the REC image.
- the recurrence graph is an image representing the distance between trajectories extracted from the original time series.
- the recurrence graph is especially suitable for short time series data, and can test the stationarity and intrinsic similarity of the time series.
- the two images are concatenated in the dimension of the channel, that is, the image as input is generated. Then, the judgment of abnormal points in the time series can be transformed into the research of images. that is, through The formula generates a two-dimensional image.
- the above steps convert the one-dimensional time series data based on the GAF algorithm to obtain a GAF image, including:
- the scaled one-dimensional time series data is represented by polar coordinates to obtain a GAF image.
- the one-dimensional time series data is scaled to put the one-dimensional time series on [-1,1].
- the scaled one-dimensional time series is encoded into the form of polar coordinates through the coordinate transformation formula.
- the GAF algorithm first normalizes the values in the sequence to -1 to 1 according to formula 1 to get That is, put the sequence on [-1,1] by scaling.
- Formula 1 is: Where k and N are integers greater than 0.
- the coordinate transformation formula is: Finally, calculate the cosine of the dejudgment sum between the two time steps to get And generate a GAF image from this data.
- the final formula of the GAF algorithm is: A GAF image is generated by this formula.
- S12 Perform image reconstruction based on the two-dimensional image to obtain a reconstructed image associated with the one-dimensional time series data, and a training image sample set including the reconstructed image.
- step S12 training the IntroVAE model requires training samples, and by inputting a two-dimensional image into the IntroVAE model, the IntroVAE model reconstructs the two-dimensional image, that is, uses a deep multi-level variational self-encoding structure to improve the time series
- the data is reconstructed to obtain a reconstructed image.
- the training image sample set includes reconstructed images and sampled images.
- Image reconstruction based on a two-dimensional image is to input the two-dimensional image into the encoder of the IntroVAE model, the encoder converts the two-dimensional image into a latent variable, and the decoder of the IntroVAE model reconstructs the latent variable into an image, that is Get the reconstructed image.
- the latent variable obeys a distribution. We hope that this distribution obeys a distribution such as the standard normal distribution, then adjust the encoder, and hope that the variable obtained by the encoder to encode the image obeys this distribution.
- the latent variable is the two-dimensional image encoded by the encoder, while the sampling variable is directly sampled from the standard normal distribution without any image information. Therefore, the sampling image obtained by inputting the sampling variable to the decoder is not the same as the two-dimensional image and the reconstructed image.
- step S12 may include:
- a sample set is constructed based on the reconstructed image and the sampled image to obtain a training image sample set.
- FIG. 2 is a schematic structural diagram of the IntroVAE model provided in the embodiment of the present application.
- the introspective variational autoencoder IntroVAE model is a multi-level multi-scale encoder-decoder structure model for the prior distribution of latent variables and the posterior distribution of latent variables.
- 1, 2, 3, 4, and 5 in the figure are feature combinations, and the features extracted from the Input input are combined through feature combination 1, feature combination 2, feature combination 3, feature combination 4, and feature combination 5.
- the Residual Block is a residual block, which contains several layers of networks connected by a shortcut.
- the network in the residual block can be a fully connected layer or a convolutional layer.
- the residual block is between the input and output and is used to optimize the Trainable parameter (training parameter).
- the residual block improves the receptive field of the network through multi-layer convolution.
- the introspective variational autoencoder IntroVAE model is a deep generative model that combines the variational autoencoder VAE and the confrontational generative network GAN.
- Variational autoencoders are generative versions of autoencoders that approximate the mapping of data to prior distributions by optimizing a variational lower bound.
- the training of VAE is stable, and it can perform hidden variable inference and log likelihood estimation, but the generated samples are relatively vague.
- the adversarial generative network learns the distribution of real data through the confrontation between the generator and the discriminator. GAN can generate realistic and clear images, but there is a problem of training instability, which is especially serious when synthesizing high-resolution images.
- the IntroVAE model not only overcomes the problem that the synthetic image inherent in the variational autoencoder tends to be blurred without introducing an additional confrontation discriminator, but also generates high-definition and stable images, and does not use the commonly used multi-stage multi-discriminator. Under the strategy, stable training for high-resolution image synthesis is achieved.
- the IntroVAE model is able to self-assess the quality of the samples it generates and improve itself accordingly. Introducing adversarial learning into VAE realizes a kind of introspective learning, that is, the model itself can judge the quality of its generated samples and make corresponding changes to improve performance.
- the training method of the IntroVAE model is to train the encoder so that the hidden variables of the real image are close to the prior distribution, and the hidden variables of the synthetic image deviate from the prior distribution; on the contrary, the training generator makes the hidden variables of the synthetic image close to the prior distribution.
- the encoder and generator must cooperate to ensure that the reconstruction error of the input image is as small as possible in addition to confrontation.
- the training goal of this method is exactly the same as that of traditional VAE, which greatly stabilizes the model training; for synthetic data, the introduction of confrontation improves the quality of samples.
- the encoder and the decoder in the IntroVAE model correspond to the discriminator and the generator respectively.
- Adversarial training is reflected in:
- the role of the discriminator is to judge whether the latent variable has real data generated by the encoder, or is generated by the constructed data through the encoder.
- the role of the generator is to make the latent variables encoded by the generated data and the real data encoded as identical as possible.
- reconstruction loss and KL divergence to iteratively update the parameters of the model based on the Adamax optimization algorithm to achieve the purpose of training the IntroVAE model.
- step S13 may include:
- the IntroVAE model is trained to obtain a trained IntroVAE model.
- both the reconstruction loss and the KL divergence are loss functions, which are used to calculate the reconstructed loss.
- KL divergence is relative entropy, a measure of the asymmetry of the difference between two probability distributions.
- Relative entropy can measure the distance between two random distributions. When two random distributions are the same, their relative entropy is zero. When the difference between two random distributions increases, their relative entropy will also increase. So relative entropy can be used to compare the similarity of text.
- KL divergence and reconstruction loss are used to calculate the loss value between the two-dimensional image and the reconstructed image.
- X is a two-dimensional image
- X' is a reconstructed image
- B is the batch number of training data
- N is the length of each subsequence in time series data
- C is the number of image channels
- b and c are B and C is a variable
- b and c are integers greater than
- i and j are pixel values of the two-dimensional image and the reconstructed image
- i and j are integers greater than 0.
- KL divergence is used here as a regular term to make the posterior distribution of latent variables as close as possible to the prior distribution.
- the calculation formula of the overall KL divergence is as follows: Among them, Z is a latent variable, I g is the ith variable of Zg, G is the group number of latent variables, and I g is the length of Zg.
- the VAE training process based on reconstruction loss and KL divergence as a loss function can fit time series data, but it may also fit abnormal data.
- adversarial training is introduced to fit the data distribution so that the distribution of the reconstructed data is as close as possible to the input data.
- the parameters of the encoder and decoder are randomly initialized.
- a two-dimensional image is input to the encoder, the encoder obtains a latent variable Z, and the latent variable Z is used as the input of the decoder to obtain a reconstructed image.
- the parameters of the encoder and decoder are updated based on the Adamax algorithm according to the reconstruction loss and KL divergence.
- the sampling variable is sampled according to the prior distribution of the latent variable, and the sampling variable is input into the decoder to obtain the sampled image.
- the parameters of the encoder are updated using the Adamax algorithm based on a pre-configured loss function.
- the pre-configured loss functions are reconstruction loss function and KL divergence.
- the preconfigured loss function is Among them, Zr is the variable obtained by re-inputting the reconstructed image into the encoder, Zpp is the variable obtained by re-inputting the sampled image into the encoder, ⁇ and ⁇ are used as parameters, and the optimal value needs to be found through repeated training.
- the IntroVAE model is trained by training the sample set and reconstruction loss and KL divergence based on the reconstruction loss value and sampling loss value obtained by the Adamax optimization algorithm, and the trained IntroVAE model is obtained.
- S14 Using the trained IntroVAE model, calculate a loss value between the two-dimensional image and the reconstructed image to obtain a target loss value; wherein the target loss value is used to characterize the one-dimensional time series Whether the data is abnormal.
- the trained IntroVAE model itself can judge the quality of its generated samples and make corresponding changes to improve performance.
- the target loss value is the difference value between the 2D image converted from 1D time series data and the reconstructed image obtained by reconstructing the 2D image using the trained IntroVAE model. Because the two-dimensional image is real data, it is converted from the one-dimensional time series to be detected. The reconstructed image is the ideal data reconstructed by the IntroVAE model, so the difference between them can detect the abnormality of the one-dimensional time series data.
- the point is judged as abnormal point. Converting the problem of outlier detection in time series to the problem of outlier detection in images, the detection results are more intuitive and simple.
- this embodiment also includes:
- Alerts are data that detect anomalies in the time series data to be detected.
- the target loss value is obtained by calculating the reconstruction loss between the two-dimensional image converted from the time series data to be detected and the reconstructed image obtained by reconstructing the two-dimensional image.
- the target loss value is used to characterize whether the time series data is abnormal, and a certain threshold is preset to detect the time series data.
- the embodiment of the present application also provides a time series data detection device, as shown in Figure 3, the device 30 may include the following modules:
- a conversion module 31 configured to perform a conversion operation on the one-dimensional time series data to be detected to obtain a two-dimensional image
- a reconstruction module 32 configured to perform image reconstruction based on the two-dimensional image, obtain a reconstructed image associated with the one-dimensional time series data, and a training image sample set including the reconstructed image;
- the training module 33 is used to utilize the training image sample set to train the IntroVAE model of the introspection variational autoencoder to obtain the trained IntroVAE model;
- a detection module 34 configured to use the trained IntroVAE model to calculate a loss value between the two-dimensional image and the reconstructed image to obtain a target loss value; wherein the target loss value is used to represent the Anomalies in 1D time series data.
- each module is used to execute each step in the embodiment corresponding to FIG. 1 , and each step in the embodiment corresponding to FIG. 1 has been described in Detailed explanations are given in the foregoing embodiments, and for details, please refer to FIG. 1 and related descriptions in the embodiments corresponding to FIG. 1 , and details are not repeated here.
- Fig. 4 is a structural block diagram of a device provided by an embodiment of the present application.
- the device 40 of this embodiment includes: a processor 41, a memory 42, and a computer program 43 stored in the memory 42 and operable on the processor 41, such as a time series data detection method. program.
- the processor 41 executes the computer program 43, it realizes the steps in each embodiment of the time series data detection method described above, such as S11 to S14 shown in FIG. 1 .
- the processor 41 executes the computer program 43, it realizes the functions of each module in the above-mentioned embodiment corresponding to FIG. 3 , for example, the functions of the modules 31 to 34 shown in FIG. 3 .
- the relevant descriptions in the examples are not repeated here.
- the computer program 43 can be divided into one or more modules, and the one or more modules are stored in the memory 42 and executed by the processor 41 to complete the present application.
- the one or more modules may be a series of computer program instruction segments capable of accomplishing specific functions, and the instruction segments are used to describe the execution process of the computer program 43 in the device 40 .
- the computer program 43 can be divided into a transformation module, a reconstruction module, a training module and a detection module, and the specific functions of each module are as described above.
- the turntable device may include, but not limited to, a processor 41 and a memory 42 .
- FIG. 4 is only an example of the device 40, and does not constitute a limitation to the device 40. It may include more or less components than shown in the figure, or combine certain components, or different components, such as
- the turntable device may also include an input and output device, a network access device, a bus, and the like.
- the so-called processor 41 can be a central processing unit (Central Processing Unit, CPU), and can also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), Ready-made programmable gate array (Field-12 Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
- a general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like.
- the storage 42 may be an internal storage unit of the device 40 , such as a hard disk or memory of the device 40 .
- the memory 42 can also be an external storage device of the device 40, such as a plug-in hard disk equipped on the device 40, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, Flash card (Flash Card), etc. Further, the memory 42 may also include both an internal storage unit of the device 40 and an external storage device.
- the memory 2 is used to store the computer program and other programs and data required by the turntable device.
- the memory 42 can also be used to temporarily store data that has been output or will be output.
- one or more readable storage media storing computer readable instructions, the computer readable instructions being processed by one or more When executed by one or more processors, the one or more processors are executed to implement the time series data detection method in the above embodiment.
- the readable storage medium in this embodiment includes non-volatile readable storage medium and volatile readable storage medium.
- Nonvolatile memory can include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
- Volatile memory can include random access memory (RAM) or external cache memory.
- RAM random access memory
- RAM is available in many forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Chain Synchlink DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Multimedia (AREA)
- Quality & Reliability (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Image Analysis (AREA)
Abstract
本申请适用于人工智能技术领域,提供了一种时间序列数据检测方法、装置、设备及计算机存储介质,其中,一种时间序列数据检测方法包括以下步骤:对待检测的一维时间序列数据进行转换操作,得到二维图像;基于二维图像进行图像重构,得到包含重构图像的训练图像样本集合;利用训练图像样本集合,对自省变分自编码器IntroVAE模型进行训练,得到训练后的IntroVAE模型;利用训练后的IntroVAE模型,计算二维图像与重构图像之间的损失值,得到目标损失值;其中,目标损失值用于表征一维时间序列数据是否存在异常。应用本申请实施例所提供的技术方案,在保证时间序列数据的异常检测的效率的情况下,对大规模的时间序列数据进行异常检测时,提高时间序列数据检测的适用范围。
Description
本申请以2022年2月21日提交的申请号为202210158956.9,名称为“时间序列数据检测方法、装置、设备及计算机存储介质”的中国发明申请为基础,并要求其优先权。
本申请涉及人工智能领域,特别涉及一种时间序列数据检测方法、装置、设备及计算机存储介质。
随着人工智能技术的发展,在网络监控、设备维护、信息安全、金融、航空航天等领域对时间序列数据的异常检测的需求也日益增加。发明人发现目前时间序列数据的异常检测通常为无监督的异常检测方式。例如通过分割时间序列数据然后通过近邻样本或密度的聚类去寻找异常点,但是此类方法往往对参数十分敏感,对于时间序列数据的异常检测较为复杂,可见现有的时间序列数据的异常检测的方法无法适用在大规模的时间序列数据上,存在适用范围小的问题。
发明内容
本申请的目的在于提供一种时间序列数据检测方法、装置、设备及计算机存储介质,以解决现有的时间序列数据的异常检测的方法无法适用在大规模的时间序列数据上,存在适用范围小的技术问题。
一种时间序列数据检测方法,包括:
对待检测的一维时间序列数据进行转换操作,得到二维图像;
基于所述二维图像进行图像重构,得到与所述一维时间序列数据关联的重构图像,以及包含所述重构图像的训练图像样本集合;
利用所述训练图像样本集合,对自省变分自编码器IntroVAE模型进行训练,得到训练后的IntroVAE模型;
利用所述训练后的IntroVAE模型,计算所述二维图像与所述重构图像之间的损失值,得到目标损失值;其中,所述目标损失值用于表征所述一维时间序列数据是否存在异常。
一种时间序列数据检测装置,包括:
转换模块,用于对待检测的一维时间序列数据进行转换操作,得到二维图 像;
重构模块,用于基于所述二维图像进行图像重构,得到与所述一维时间序列数据关联的重构图像,以及包含所述重构图像的训练图像样本集合;
训练模块,用于利用所述训练图像样本集合,对自省变分自编码器IntroVAE模型进行训练,得到训练后的IntroVAE模型;
检测模块,用于利用所述训练后的IntroVAE模型,计算所述二维图像与所述重构图像之间的损失值,得到目标损失值;其中,所述目标损失值用于表征所述一维时间序列数据是否存在异常。
一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的可读存储介质,其中,所述处理器执行所述可读存储介质时实现如下步骤:
对待检测的一维时间序列数据进行转换操作,得到二维图像;
基于所述二维图像进行图像重构,得到与所述一维时间序列数据关联的重构图像,以及包含所述重构图像的训练图像样本集合;
利用所述训练图像样本集合,对自省变分自编码器IntroVAE模型进行训练,得到训练后的IntroVAE模型;
利用所述训练后的IntroVAE模型,计算所述二维图像与所述重构图像之间的损失值,得到目标损失值;其中,所述目标损失值用于表征所述一维时间序列数据是否存在异常。
一个或多个存储有计算机可读指令的可读存储介质,所述计算机可读存储介质存储有计算机可读指令,其中,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:
对待检测的一维时间序列数据进行转换操作,得到二维图像;
基于所述二维图像进行图像重构,得到与所述一维时间序列数据关联的重构图像,以及包含所述重构图像的训练图像样本集合;
利用所述训练图像样本集合,对自省变分自编码器IntroVAE模型进行训练,得到训练后的IntroVAE模型;
利用所述训练后的IntroVAE模型,计算所述二维图像与所述重构图像之间的损失值,得到目标损失值;其中,所述目标损失值用于表征所述一维时间序列数据是否存在异常。
上述时间序列数据检测方法、装置、设备及计算机存储介质,通过将待检测的一维时间序列数据转换为二维图像,并将二维图像作为模型的输入,把对于时间序列的异常检测的问题转换到图像的异常检测的问题,对时间序列数据的异常检测较为简单且适用范围较大。并通过自省变分自编码器IntroVAE模型对二维图像进行图像重构,使得重构图像尽可能接近输入的二维图像。并利用重构图像构成的图像样本集合对IntroVAE模型进行训练,使得利用训练后的IntroVAE模型能够通过计算重构图像与输入的二维图像的之间重构损失来检测一维时间序列数据是否存在异常。在保证时间序列数据的异常检测的效率的情况下,在对大规模的时间序列数据进行异常检测时,提高时间序列数据检测 的适用范围。
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例提供的一种时间序列数据检测方法的实现流程图;
图2为本申请实施例提供的IntroVAE模型的结构示意图;
图3是本申请实施例提供的一种时间序列数据检测装置的结构框图;
图4是本申请实施例提供的一种设备的结构框图。
为了使本申请所要解决的技术问题、技术方案及有益效果更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请实施例可以基于人工智能技术对相关的数据进行获取和处理。其中,人工智能(Artificial Intelligence,AI)是利用数字计算机或者数字计算机控制的机器模拟、延伸和扩展人的智能,感知环境、获取知识并使用知识获得最佳结果的理论、方法、技术及应用系统。
人工智能基础技术一般包括如传感器、专用人工智能芯片、云计算、分布式存储、大数据处理技术、操作/交互系统、机电一体化等技术。人工智能软件技术主要包括计算机视觉技术、机器人技术、生物识别技术、语音处理技术、自然语言处理技术以及机器学习/深度学习等几大方向。
本申请实施例所提供一种时间序列数据检测方法,应用于计算机设备上。在实现时,一种时间序列数据检测方法以目标脚本的形式被配置于计算机设备上,该计算机设备通过执行该目标脚本,进而执行本实施例提供的时间序列数据检测方法的各个步骤。
参照图1所示,图1示出了本申请实施例提供的一种时间序列数据检测方法,包括:
S11:对待检测的一维时间序列数据进行转换操作,得到二维图像。
在步骤S11中,待检测的一维时间序列的异常检测是对时间序列数据,按照一定的统计或机器学习策略判断某个时序点是否存在明显地统计异常性。其中,时间序列数据是按时间顺序记录的数据列,在同一数据列中的各个数据必须是同口径的,要求具有可比性。大数据时代,时序数据的规模和复杂性已大幅增加,具有智能、自动特点的时序异常检测的需求激增,并已在许多领域中发挥作用,提升这些领域中产出或服务的稳健性、质量和效益,如网络监控、设备维护、信息安全、金融、航空航天等领域。由于有大量的时间序列数据记 录潜在的异常,因此必须建立自动监测系统来发现这些异常。一旦成功建立了高性能的监控模型,在大批量数据中进行高效的搜索和异常检测,将极大地帮助运维人员发现和修复问题。时序异常检测的关键在于,需挖掘和学习已有的时序数据的规律。由于来自真实世界的噪声数据和复杂的异常模式需要捕获。
在将时间序列数据输入模型中进行训练前,需通过编码将一维时间序列数据转换为二维的图像数据。将检测的一维时间序列数据的异常点转换为检测二维图像中出现的异常点,检测二维图像比直接检测一维时间序列数据更直观简便。将一维时间序列数据转换为二维图像可以采用的方法有格拉米角场GAFs,包括GASF(对应做角度和),和GADF(对应做角度差),马尔可夫变迁场MTF,递归图Recurrence Plot和短时傅里叶变换STFT。
在本实施例中,可以通过将一维的时间序列数据分别通过GAF算法以及生成递归图来构造二维图像作为自省变分自编码器IntroVAE模型的输入。基于GAF算法和递归图算法将时序数据转换为二维图像,生成的图像可以通过主对角线回复直角坐标的原始时间序列,即每一个图对应一段序列且信息没有损失。而递归图揭示了时间序列的内部结构,给异常检测提供了更多有效信息。
作为本申请一个实施例,步骤S11可以包括:
基于GAF算法对所述一维时间序列数据进行转换得到GAF图像;
基于递归图对所述一维时间序列数据进行编码得到REC图像;
基于所述GAF图像和所述REC图像生成所述二维图像。
在本实施例中,GAF算法将缩放后的时间序列数据从直角坐标系统转换到极坐标系统,然后通过考虑不同点之间的角度和以识别不同时间点的时间相关性。即将一维时间序列数据X
k生成GAF图像为
k为大于0的整数。然后,基于递归图对一维时间序列数据进行编码得到REC图像。递归图是表示从原始时间序列提取的轨迹之间的距离的图像,递归图特别适合短时间序列数据,可以检验时间序列的平稳性、内在相似性。具体地,我们可以从原始图像中提取出各个轨迹,而REC图像则是展示了从原始时间序列中提取的轨迹之间距离的图像。首先根据以下公式提取轨迹并获得
其中m是轨迹的维度,τ表示时间滞后,可以将这两个参数均设置为1,通过
公式将滞后的数据编码成另一种格式,并可以根据此数据生成REC图像。
作为本申请一实施例中的实现方法,上述步骤基于GAF算法对所述一维时间序列数据进行转换得到GAF图像,包括:
将一维时间序列数据进行缩放,得到缩放后的一维时间序列数据;
将所述缩放后的一维时间序列数据用极坐标表示,得到GAF图像。
具体地,将一维时间序列数据通过缩放将一维时间序列放到[-1,1]上。并 通过坐标变换公式将缩放后的一维时间序列编码成极坐标的形式。具体地,将待检测的一维时间序列数据中的某一个时间点的值,首先按指定宽度w,提取其往前以及往后w时间步的子序列X
K={s
k-w+1,…,s
k,…,s
k+w}。GAF算法首先根据公式1将序列中的值标准化到-1到1之间得到
即通过缩放将序列放到[-1,1]上。公式1为:
其中k,N为大于0的整数。然后将
通过如下坐标变换公式编码成极坐标的形式。坐标变换公式为:
最后计算两个时间步之间的去判断和的余弦得到
并根据该数据生成GAF图像。GAF算法最终的公式为:
由该公式生成GAF图像。
S12:基于所述二维图像进行图像重构,得到与所述一维时间序列数据关联的重构图像,以及包含所述重构图像的训练图像样本集合。
在步骤S12中,训练IntroVAE模型需要有训练样本,而通过将二维图像输入到IntroVAE模型中,IntroVAE模型对二维图像进行图像重构,即使用深度多层次变分自编码结构去改进时间序列数据的重构,得到重构图像。训练图像样本集合包括重构图像和采样图像。基于二维图像进行图像重构,是通过将二维图像输入到IntroVAE模型的编码器中,编码器将二维图像转换为潜在变量,IntroVAE模型的解码器再将潜在变量重构为图像,即得到重构图像。这里的重构图像和二维图像尽可能相同。潜在变量服从一个分布,我们希望这个分布服从一个分布比如标准正态分布,那就调整编码器,希望编码器编码图像得到的变量服从这个分布。潜在变量就是二维图像经过编码器编码出来的,而采样变量是直接从标准正态分布抽样出来的,没有任何图像的信息。因此由采样变量输入到解码器获得的采样图像和二维图像、重构图像并不相同。
作为本申请一实施例,步骤S12可以包括:
对所述二维图像进行多层次提取,获得所述二维图像对应的潜在变量;
对所述潜在变量进行编码,得到重构图像;
基于对所述潜在变量的先验分布进行采样得到的采样变量,获得采样图像;
基于所述重构图像与所述采样图像进行样本集合构建,得到训练图像样本集合。
在本实施例中,图2为本申请实施例提供的IntroVAE模型的结构示意图。如图2所示,自省变分自编码器IntroVAE模型是对潜在变量先验分布和潜在变量后验分布进行的多层次多尺度编码器-解码器结构模型。图中的1、2、3、4和5都是特征组合,由Input输入提取到的特征经过特征组合1、特征组合2、特征组合3、特征组合4和特征组合5进行组合。在编码器部分,首先基于一个自底向上的网络从Input输入的二维图像中提取,经过层层的编码,再经过采样后获得最顶层的潜在变量Z
1,然后再从上到下,逐步通过计算得到底层的多个潜在变量Z={Z
1,Z
2,...,Zg,...Z
G},g∈{2,...,G-1}。然后解码器也是经 过一个自上而下的方式,逐步利用编码器获得的潜在变量,通过多次的采样以及经过多个残差块,Output输出重构图像。然后编码器再根据潜在变量的先验分布采样得到采样变量,并将直接从标准正态分布抽样出来的采样变量输入到解码器中获得采样图像。Residual Block为残差块,包含一个捷径连接的几层网络,残差块中的网络可以是全连接层,也可以是卷积层。残差块在输入和输出之间,用来优化Trainable parameter(训练参数)。残差块通过多层的卷积去提高网络的感受野。
S13:利用所述训练图像样本集合,对自省变分自编码器IntroVAE模型进行训练,得到训练后的IntroVAE模型。
在步骤S13中,自省变分自编码器IntroVAE模型是一种由变分自编码器VAE和对抗生成网络GAN结合而来的深度生成模型。变分自编码器是自动编码器的生成版本,通过优化一个变分下界来实现数据到先验分布的近似映射。VAE的训练稳定,能够进行隐变量推断和对数似然估计,但是生成的样本比较模糊。对抗生成网络通过生成器和判别器之间的对抗,来学习真实数据的分布。GAN可以生成逼真的清晰图像,但是存在训练不稳定的问题,这个问题在合成高分辨率图像上尤其严重。因此IntroVAE模型不仅在不引入额外的对抗判别器的情况下,克服了变分自编码器固有的合成图像趋于模糊的问题,生成高清稳定的图像,而且在不使用常用的多阶段多判别器策略下,实现了高分辨率图像合成的稳定训练。IntroVAE模型能够自我评估其生成的样品的质量并相应地改进自身。将对抗学习引入VAE内部,实现了一种自省的学习,即模型自身能够判断其生成样本的质量并作出相应改变以提高性能。IntroVAE模型的训练方式是训练编码器使得真实图像的隐变量接近先验分布,合成图像的隐变量偏离先验分布;与之相反的是,训练生成器使得合成图像的隐变量接近先验分布。同时,与GAN不同的是,编码器和生成器除了对抗外还要协同保证对输入图像的重建误差尽量小。对于真实数据来说,该方法的训练目标跟传统VAE完全一致,这极大地稳定了模型训练;对于合成数据来说,对抗的引入提高了样本的质量。
在本实施例中,在IntroVAE模型训练过程中,IntroVAE模型中的编码器和解码器分别对应判别器和生成器。对抗性训练体现在:一方面,判别器的作用是为了判断潜在变量是有真实的数据经过编码器生成的,或者是由构造的数据通过编码器生成。另一方面,生成器的作用是为了使得通过生成数据编码出来的和真实数据编码出来的潜在变量尽可能相同。利用训练图像样本集合,重构损失以及KL散度基于Adamax优化算法迭代更新模型的参数达到训练IntroVAE模型的目的。
作为本申请一实施例,步骤S13可以包括:
基于重构损失和KL散度,计算所述二维图像和所述重构图像之间的损失值,得到重构损失值;
基于预先配置的损失函数,计算所述重构图像和所述采样图像之间的损失值,得到采样损失值;
基于所述重构损失值和所述采样损失值,对所述IntroVAE模型进行训练, 得到训练后的IntroVAE模型。
在本实施例中,重构损失和KL散度都是损失函数,用来计算重构后的损失。KL散度是相对熵,是两个概率分布间差异的非对称性度量。相对熵可以衡量两个随机分布之间的距离,当两个随机分布相同时,它们的相对熵为零,当两个随机分布的差别增大时,它们的相对熵也会增大。所以相对熵可以用于比较文本的相似度。在本实施例中,KL散度和重构损失就是用来计算二维图像和重构图像之间的损失值。基于KL散度和重构损失的无监督训练,计算二维图像和重构图像之间的损失值。其中重构损失的定义为
其中,X为二维图像,X’为重构图像,B为训练数据的批数量,N为时间序列数据中每一子序列的长度,C则为图像通道的数量,b和c为B和C的变数,且b和c为大于0的整数,i和j为所述二维图像和所述重构图像的像素值,且i和j为大于0的整数。潜在变量Z被分割成不相交的组z={z
1,z
2,…,z
G},其中G为组的数量,z
g是其中一组潜在变量。对于每一个组,有以下关系
其中假定Z的分布p(z)是一系列的正态分布的阶乘。对于z
g中的第i个变量,有以下关系:
然后利用先验分布参数Δμ
i和Δσ
i的相对值来确定后验分布:
对于第g组的第i个变量的K-L散度计算公式如下:
基于重构损失以及KL散度作为损失函数的VAE训练过程可以对时间序列数据进行拟合,但同时也可能对异常数据进行拟合。为了提高IntroVAE模型的性能,引入了对抗性训练来拟合数据分布,使重构数据的分布尽可能接近输入数据。
具体地,对IntroVAE模型中的编码器与解码器,随机初始化编码器与解码器的参数。对编码器输入二维图像,编码器获得潜在变量Z,将潜在变量Z作为解码器的输入,获得重构图像。根据重构损失和KL散度基于Adamax算法更新编码器和解码器的参数。然后,根据潜在变量的先验分布采样出采样变量,将采样变量输入解码器获得采样图像。基于预先配置的损失函数应用Adamax算法更新编码器的参数。预先配置的损失函数为重构损失函数和KL散度。预先 配置的损失函数为
其中,Zr为重构图像再次输入编码器得到的变量,Zpp为采样图像再次输入编码器得到的变量,α和β是作为参数,需要通过重复的训练寻找到最优的数值。通过训练样本集合和重构损失以及KL散度基于Adamax优化算法得到的重构损失值和采样损失值,去训练IntroVAE模型,得到训练后的IntroVAE模型。
S14:利用所述训练后的IntroVAE模型,计算所述二维图像与所述重构图像之间的损失值,得到目标损失值;其中,所述目标损失值用于表征所述一维时间序列数据是否存在异常。
在步骤S14中,训练后的IntroVAE模型自身能够判断其生成样本的质量,并作出相应改变以提高性能。目标损失值是由一维时间序列数据转换得到的二维图像与利用训练后的IntroVAE模型对二维图像进行重构得到的重构图像之间的差异值。因为二维图像是真实数据,是由待检测的一维时间序列转换得到的。而重构图像是经过IntroVAE模型重构得到的理想数据,所以它们之间的差异能检测一维时间序列数据的异常。
通过将待检测时间数据输入到IntroVAE模型,经过二维图像编码,再计算重构后的重构图像与输入的二维图像的重构损失,当损失超过一定阈值的时候将该点判定为异常点。将时间序列的异常点检测的问题转换到图像的异常点检测的问题,检测结果更为直观简单。
作为本实施例一种实现的方式,还包括:
当所述目标损失值超过预先设定阈值时,发出警报。
警报是检测到待检测的时间序列数据中存在异常的数据。通过计算待检测的时间序列数据转换得到的二维图像和由二维图像重构得到的重构图像之间的重构损失,得到的目标损失值。用目标损失值来表征时间序列数据是否存在异常,并预先设定一定的阈值来检测时间序列数据。
相应于上面的方法实施例,本申请实施例还提供了一种时间序列数据检测装置,如图3所示,该装置30可以包括以下模块:
转换模块31,用于对待检测的一维时间序列数据进行转换操作,得到二维图像;
重构模块32,用于基于所述二维图像进行图像重构,得到与所述一维时间序列数据关联的重构图像,以及包含所述重构图像的训练图像样本集合;
训练模块33,用于利用所述训练图像样本集合,对自省变分自编码器IntroVAE模型进行训练,得到训练后的IntroVAE模型;
检测模块34,用于利用所述训练后的IntroVAE模型,计算所述二维图像与所述重构图像之间的损失值,得到目标损失值;其中,所述目标损失值用于表征所述一维时间序列数据是否存在异常。
应当理解的是,图3示出的时间序列数据检测装置的结构框图中,各模块用于执行图1对应的实施例中的各步骤,而对于图1对应的实施例中的各步骤已在上述实施例中进行详细解释,具体请参阅图1以及图1所对应的实施例中 的相关描述,此处不再赘述。
图4是本申请一实施例提供的一种设备的结构框图。如图4所示,该实施例的设备40包括:处理器41、存储器42以及存储在所述存储器42中并可在所述处理器41上运行的计算机程序43,例如时间序列数据检测方法的程序。处理器41执行所述计算机程序43时实现上述各个时间序列数据检测方法各实施例中的步骤,例如图1所示的S11至S14。或者,所述处理器41执行所述计算机程序43时实现上述图3对应的实施例中各模块的功能,例如,图3所示的模块31至34的功能,具体请参阅图3对应的实施例中的相关描述,此处不赘述。
示例性的,所述计算机程序43可以被分割成一个或多个模块,所述一个或者多个模块被存储在所述存储器42中,并由所述处理器41执行,以完成本申请。所述一个或多个模块可以是能够完成特定功能的一系列计算机程序指令段,该指令段用于描述所述计算机程序43在所述设备40中的执行过程。例如,所述计算机程序43可以被分割成转换模块、重构模块、训练模块和检测模块,各模块具体功能如上所述。
所述转台设备可包括,但不仅限于,处理器41、存储器42。本领域技术人员可以理解,图4仅仅是设备40的示例,并不构成对设备40的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述转台设备还可以包括输入输出设备、网络接入设备、总线等。
所称处理器41可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-12Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
所述存储器42可以是所述设备40的内部存储单元,例如设备40的硬盘或内存。所述存储器42也可以是所述设备40的外部存储设备,例如所述设备40上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器42还可以既包括所述设备40的内部存储单元也包括外部存储设备。所述存储器2用于存储所述计算机程序以及所述转台设备所需的其他程序和数据。所述存储器42还可以用于暂时地存储已经输出或者将要输出的数据。
在一个实施例中,提供了一个或多个存储有计算机可读指令的可读存储介质,所述计算机可读存储介质存储有计算机可读指令,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行时实现上述实施例中时间序列数据检测方法。本实施例中的可读存储介质包括非易失性可读存储介质和易失性可读存储介质。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于 一计算机存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。
Claims (20)
- 一种时间序列数据检测方法,其中,包括:对待检测的一维时间序列数据进行转换操作,得到二维图像;基于所述二维图像进行图像重构,得到与所述一维时间序列数据关联的重构图像,以及包含所述重构图像的训练图像样本集合;利用所述训练图像样本集合,对自省变分自编码器IntroVAE模型进行训练,得到训练后的IntroVAE模型;利用所述训练后的IntroVAE模型,计算所述二维图像与所述重构图像之间的损失值,得到目标损失值;其中,所述目标损失值用于表征所述一维时间序列数据是否存在异常。
- 根据权利要求1所述的方法,其中,所述对待检测的一维时间序列数据进行转换操作,得到二维图像,包括:基于GAF算法对所述一维时间序列数据进行转换得到GAF图像;基于递归图对所述一维时间序列数据进行编码得到REC图像;基于所述GAF图像和所述REC图像生成所述二维图像。
- 根据权利要求2所述的方法,其中,所述基于GAF算法对所述一维时间序列数据进行转换得到GAF图像,包括:将一维时间序列数据进行缩放,得到缩放后的一维时间序列数据;将所述缩放后的一维时间序列数据用极坐标表示,得到GAF图像。
- 根据权利要求1所述的方法,其中,所述基于所述二维图像进行图像重构,得到与所述一维时间序列数据关联的重构图像,以及包含所述重构图像的训练图像样本集合,包括:对所述二维图像进行多层次提取,获得所述二维图像对应的潜在变量;对所述潜在变量进行编码,得到重构图像;基于对所述潜在变量的先验分布进行采样得到的采样变量,获得采样图像;基于所述重构图像与所述采样图像进行样本集合构建,得到训练图像样本集合。
- 根据权利要求1所述的方法,其中,所述利用所述训练图像样本集合,对自省变分自编码器IntroVAE模型进行训练,得到训练后的IntroVAE模型,包括:基于重构损失和KL散度,计算所述二维图像和所述重构图像之间的损失值,得到重构损失值;基于预先配置的损失函数,计算所述重构图像和所述训练图像样本集合中采样图像之间的损失值,得到采样损失值;基于所述重构损失值和所述采样损失值,对所述IntroVAE模型进行训练,得到训练后的IntroVAE模型。
- 根据权利要求5所述的方法,其中,所述基于重构损失和KL散度,计算所述二维图像和所述重构图像之间的损失值,得到重构损失值,包括:通过以下公式,计算所述二维图像和所述重构图像之间的损失值:其中,L(X,X')为所述重构损失函数,X为所述二维图像,X′为所述重构图像,B是所述二维图像的数量,N为所述一维时间序列数据中每一子序列的长度,C为图像通道的数量,b和c为B和C的变数,且b和c为大于0的整数,i和j为所述二维图像和所述重构图像的像素值,且i和j为大于0的整数, 为所述二维图像和所述重构图像之间差值的平方求和;通过以下公式,计算所述二维图像和所述二维图像的潜在变量之间的损失值,得到重构损失值:
- 根据权利要求1所述的方法,其中,所述方法还包括:当所述目标损失值超过预先设定阈值时,发出警报。
- 一种时间序列数据检测装置,其中,包括:转换模块,用于对待检测的一维时间序列数据进行转换操作,得到二维图像;重构模块,用于基于所述二维图像进行图像重构,得到与所述一维时间序列数据关联的重构图像,以及包含所述重构图像的训练图像样本集合;训练模块,用于利用所述训练图像样本集合,对自省变分自编码器IntroVAE模型进行训练,得到训练后的IntroVAE模型;检测模块,用于利用所述训练后的IntroVAE模型,计算所述二维图像与所述重构图像之间的损失值,得到目标损失值;其中,所述目标损失值用于表征所述一维时间序列数据是否存在异常。
- 一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的可读存储介质,其中,所述处理器执行所述可读存储介质时实现如下步骤:对待检测的一维时间序列数据进行转换操作,得到二维图像;基于所述二维图像进行图像重构,得到与所述一维时间序列数据关联的重构图像,以及包含所述重构图像的训练图像样本集合;利用所述训练图像样本集合,对自省变分自编码器IntroVAE模型进行训练,得到训练后的IntroVAE模型;利用所述训练后的IntroVAE模型,计算所述二维图像与所述重构图像之间的损失值,得到目标损失值;其中,所述目标损失值用于表征所述一维时间序列数据是否存在异常。
- 如权利要求9所述的计算机设备,其中,所述对待检测的一维时间序列数据进行转换操作,得到二维图像,包括:基于GAF算法对所述一维时间序列数据进行转换得到GAF图像;基于递归图对所述一维时间序列数据进行编码得到REC图像;基于所述GAF图像和所述REC图像生成所述二维图像。
- 如权利要求10所述的计算机设备,其中,所述基于GAF算法对所述一维时间序列数据进行转换得到GAF图像,包括:将一维时间序列数据进行缩放,得到缩放后的一维时间序列数据;将所述缩放后的一维时间序列数据用极坐标表示,得到GAF图像。
- 如权利要求9所述的计算机设备,其中,所述基于所述二维图像进行图像重构,得到与所述一维时间序列数据关联的重构图像,以及包含所述重构图像的训练图像样本集合,包括:对所述二维图像进行多层次提取,获得所述二维图像对应的潜在变量;对所述潜在变量进行编码,得到重构图像;基于对所述潜在变量的先验分布进行采样得到的采样变量,获得采样图像;基于所述重构图像与所述采样图像进行样本集合构建,得到训练图像样本集合。
- 如权利要求9所述的计算机设备,其中,所述利用所述训练图像样本集合,对自省变分自编码器IntroVAE模型进行训练,得到训练后的IntroVAE模型,包括:基于重构损失和KL散度,计算所述二维图像和所述重构图像之间的损失值,得到重构损失值;基于预先配置的损失函数,计算所述重构图像和所述训练图像样本集合中采样图像之间的损失值,得到采样损失值;基于所述重构损失值和所述采样损失值,对所述IntroVAE模型进行训练,得到训练后的IntroVAE模型。
- 如权利要求13所述的计算机设备,其中,所述基于重构损失和KL散度,计算所述二维图像和所述重构图像之间的损失值,得到重构损失值,包括:通过以下公式,计算所述二维图像和所述重构图像之间的损失值:其中,L(X,X')为所述重构损失函数,X为所述二维图像,X′为所述重构图像,B是所述二维图像的数量,N为所述一维时间序列数据中每一子序列的长度,C为图像通道的数量,b和c为B和C的变数,且b和c为大于0的整数, i和j为所述二维图像和所述重构图像的像素值,且i和j为大于0的整数, 为所述二维图像和所述重构图像之间差值的平方求和;通过以下公式,计算所述二维图像和所述二维图像的潜在变量之间的损失值,得到重构损失值:
- 一个或多个存储有计算机可读指令的可读存储介质,所述计算机可读存储介质存储有计算机可读指令,其中,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:对待检测的一维时间序列数据进行转换操作,得到二维图像;基于所述二维图像进行图像重构,得到与所述一维时间序列数据关联的重构图像,以及包含所述重构图像的训练图像样本集合;利用所述训练图像样本集合,对自省变分自编码器IntroVAE模型进行训练,得到训练后的IntroVAE模型;利用所述训练后的IntroVAE模型,计算所述二维图像与所述重构图像之间的损失值,得到目标损失值;其中,所述目标损失值用于表征所述一维时间序列数据是否存在异常。
- 如权利要求15所述的可读存储介质,其中,所述对待检测的一维时间序列数据进行转换操作,得到二维图像,包括:基于GAF算法对所述一维时间序列数据进行转换得到GAF图像;基于递归图对所述一维时间序列数据进行编码得到REC图像;基于所述GAF图像和所述REC图像生成所述二维图像。
- 如权利要求16所述的可读存储介质,其中,所述基于GAF算法对所述一维时间序列数据进行转换得到GAF图像,包括:将一维时间序列数据进行缩放,得到缩放后的一维时间序列数据;将所述缩放后的一维时间序列数据用极坐标表示,得到GAF图像。
- 如权利要求15所述的可读存储介质,其中,所述基于所述二维图像进行图像重构,得到与所述一维时间序列数据关联的重构图像,以及包含所述重构图像的训练图像样本集合,包括:对所述二维图像进行多层次提取,获得所述二维图像对应的潜在变量;对所述潜在变量进行编码,得到重构图像;基于对所述潜在变量的先验分布进行采样得到的采样变量,获得采样图像;基于所述重构图像与所述采样图像进行样本集合构建,得到训练图像样本集合。
- 如权利要求15所述的可读存储介质,其中,所述利用所述训练图像样本集合,对自省变分自编码器IntroVAE模型进行训练,得到训练后的IntroVAE模型,包括:基于重构损失和KL散度,计算所述二维图像和所述重构图像之间的损失值,得到重构损失值;基于预先配置的损失函数,计算所述重构图像和所述训练图像样本集合中采样图像之间的损失值,得到采样损失值;基于所述重构损失值和所述采样损失值,对所述IntroVAE模型进行训练,得到训练后的IntroVAE模型。
- 如权利要求19所述的可读存储介质,其中,所述基于重构损失和KL散度,计算所述二维图像和所述重构图像之间的损失值,得到重构损失值,包括:通过以下公式,计算所述二维图像和所述重构图像之间的损失值:其中,L(X,X')为所述重构损失函数,X为所述二维图像,X′为所述重构图像,B是所述二维图像的数量,N为所述一维时间序列数据中每一子序列的长度,C为图像通道的数量,b和c为B和C的变数,且b和c为大于0的整数,i和j为所述二维图像和所述重构图像的像素值,且i和j为大于0的整数, 为所述二维图像和所述重构图像之间差值的平方求和;通过以下公式,计算所述二维图像和所述二维图像的潜在变量之间的损失值,得到重构损失值:
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210158956.9 | 2022-02-21 | ||
| CN202210158956.9A CN114494242B (zh) | 2022-02-21 | 2022-02-21 | 时间序列数据检测方法、装置、设备及计算机存储介质 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2023155296A1 true WO2023155296A1 (zh) | 2023-08-24 |
Family
ID=81482517
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2022/089438 Ceased WO2023155296A1 (zh) | 2022-02-21 | 2022-04-27 | 时间序列数据检测方法、装置、设备及计算机存储介质 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN114494242B (zh) |
| WO (1) | WO2023155296A1 (zh) |
Cited By (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN117392316A (zh) * | 2023-10-13 | 2024-01-12 | 清华大学 | 基于系列欠焦图像的三维重构方法及装置 |
| CN118395135A (zh) * | 2024-02-02 | 2024-07-26 | 简帷(杭州)软件有限公司 | 一种用于供应链计划系统的数据预处理系统及其方法 |
| CN119441981A (zh) * | 2024-10-31 | 2025-02-14 | 华中科技大学 | 一种基于格拉姆角场与vae-gan的设备故障诊断方法及系统 |
| CN120654104A (zh) * | 2025-08-20 | 2025-09-16 | 浪潮通用软件有限公司 | 基于因果正则化的工业时序事件分析方法、设备及介质 |
| CN121144699A (zh) * | 2025-11-20 | 2025-12-16 | 蓝卓数字科技有限公司 | 基于多粒度整体周期重建的工业多维时序异常检测方法 |
Families Citing this family (11)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115048426B (zh) * | 2022-06-13 | 2025-12-23 | 深圳市大数据研究院 | 模型训练方法、数据鉴别方法、设备、介质及产品 |
| CN115631438A (zh) * | 2022-07-05 | 2023-01-20 | 港珠澳大桥管理局 | 道钉状态识别方法、装置、计算机设备和存储介质 |
| CN116823976A (zh) * | 2022-08-16 | 2023-09-29 | 中移(苏州)软件技术有限公司 | 数据处理方法、装置、电子设备及存储介质 |
| CN115267461A (zh) * | 2022-09-13 | 2022-11-01 | 重庆邮电大学 | 基于维度扩展的拉曼光谱及机器视觉的油纸绝缘老化诊断方法 |
| CN115496205A (zh) * | 2022-10-17 | 2022-12-20 | 中国农业银行股份有限公司 | 检测模型训练、数据检测方法、装置、设备及存储介质 |
| CN115617882B (zh) * | 2022-12-20 | 2023-05-23 | 粤港澳大湾区数字经济研究院(福田) | 基于gan的带有结构约束的时序图数据生成方法及系统 |
| CN116381424A (zh) * | 2023-03-06 | 2023-07-04 | 武汉理工大学 | 一种基于多源数据融合的岸电箱绝缘性能异常检测方法 |
| CN117668719B (zh) * | 2023-11-14 | 2024-08-16 | 深圳大学 | 一种自适应阈值的隧道监测数据异常检测方法 |
| CN118334468B (zh) * | 2024-04-17 | 2025-09-30 | 福建师范大学 | 一种用于工业产品质量质控的图像异常检测方法 |
| CN119625734B (zh) * | 2024-11-21 | 2025-08-08 | 北京小蝇科技有限责任公司 | 基于试剂反应的序列化数据异常定位方法和装置 |
| CN120015312B (zh) * | 2025-01-16 | 2025-10-10 | 北京科技大学 | 一种基于太赫兹时域光谱的脑胶质瘤egfr扩增状态预测方法 |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US10373055B1 (en) * | 2016-05-20 | 2019-08-06 | Deepmind Technologies Limited | Training variational autoencoders to generate disentangled latent factors |
| CN112200244A (zh) * | 2020-10-09 | 2021-01-08 | 西安交通大学 | 一种基于递阶对抗训练的航天发动机异常智能检测方法 |
| CN112732785A (zh) * | 2020-12-31 | 2021-04-30 | 平安科技(深圳)有限公司 | 时序数据异常检测方法、装置、设备及存储介质 |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109886388B (zh) * | 2019-01-09 | 2024-03-22 | 平安科技(深圳)有限公司 | 一种基于变分自编码器的训练样本数据扩充方法和装置 |
| CN111967507A (zh) * | 2020-07-31 | 2020-11-20 | 复旦大学 | 基于离散余弦变换和U-Net的时序异常检测方法 |
| CN112131272B (zh) * | 2020-09-22 | 2023-11-10 | 平安科技(深圳)有限公司 | 多元kpi时间序列的检测方法、装置、设备及存储介质 |
-
2022
- 2022-02-21 CN CN202210158956.9A patent/CN114494242B/zh active Active
- 2022-04-27 WO PCT/CN2022/089438 patent/WO2023155296A1/zh not_active Ceased
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US10373055B1 (en) * | 2016-05-20 | 2019-08-06 | Deepmind Technologies Limited | Training variational autoencoders to generate disentangled latent factors |
| CN112200244A (zh) * | 2020-10-09 | 2021-01-08 | 西安交通大学 | 一种基于递阶对抗训练的航天发动机异常智能检测方法 |
| CN112732785A (zh) * | 2020-12-31 | 2021-04-30 | 平安科技(深圳)有限公司 | 时序数据异常检测方法、装置、设备及存储介质 |
Non-Patent Citations (2)
| Title |
|---|
| HUAIBO HUANG; ZHIHANG LI; RAN HE; ZHENAN SUN; TIENIU TAN: "IntroVAE: Introspective Variational Autoencoders for Photographic Image Synthesis", ARXIV.ORG, CORNELL UNIVERSITY LIBRARY, 201 OLIN LIBRARY CORNELL UNIVERSITY ITHACA, NY 14853, 17 July 2018 (2018-07-17), 201 Olin Library Cornell University Ithaca, NY 14853 , XP081055778 * |
| KAZUMA KOBAYASHI; RYUICHIRO HATAYA; YUSUKE KUROSE; AMINA BOLATKAN; MOTOTAKA MIYAKE; HIROKAZU WATANABE; MASAMICHI TAKAHASHI; JUN IT: "Learning Global and Local Features of Normal Brain Anatomy for Unsupervised Abnormality Detection", ARXIV.ORG, CORNELL UNIVERSITY LIBRARY, 201 OLIN LIBRARY CORNELL UNIVERSITY ITHACA, NY 14853, 8 May 2021 (2021-05-08), 201 Olin Library Cornell University Ithaca, NY 14853 , XP081949769 * |
Cited By (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN117392316A (zh) * | 2023-10-13 | 2024-01-12 | 清华大学 | 基于系列欠焦图像的三维重构方法及装置 |
| CN118395135A (zh) * | 2024-02-02 | 2024-07-26 | 简帷(杭州)软件有限公司 | 一种用于供应链计划系统的数据预处理系统及其方法 |
| CN119441981A (zh) * | 2024-10-31 | 2025-02-14 | 华中科技大学 | 一种基于格拉姆角场与vae-gan的设备故障诊断方法及系统 |
| CN120654104A (zh) * | 2025-08-20 | 2025-09-16 | 浪潮通用软件有限公司 | 基于因果正则化的工业时序事件分析方法、设备及介质 |
| CN121144699A (zh) * | 2025-11-20 | 2025-12-16 | 蓝卓数字科技有限公司 | 基于多粒度整体周期重建的工业多维时序异常检测方法 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN114494242A (zh) | 2022-05-13 |
| CN114494242B (zh) | 2024-12-27 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2023155296A1 (zh) | 时间序列数据检测方法、装置、设备及计算机存储介质 | |
| CN117974693B (zh) | 图像分割方法、装置、计算机设备和存储介质 | |
| AU2025252571A1 (en) | Processing images using self-attention based neural networks | |
| CN111666931B (zh) | 基于混合卷积文字图像识别方法、装置、设备及存储介质 | |
| CN109815956B (zh) | 一种基于自适应位置分割的车牌字符识别方法 | |
| WO2020049385A1 (en) | Multi-view image clustering techniques using binary compression | |
| CN117668719B (zh) | 一种自适应阈值的隧道监测数据异常检测方法 | |
| CN111027576A (zh) | 基于协同显著性生成式对抗网络的协同显著性检测方法 | |
| CN106780639B (zh) | 基于显著性特征稀疏嵌入和极限学习机的哈希编码方法 | |
| CN116776931B (zh) | 特征表示模型的损失函数构建方法、装置、设备及介质 | |
| CN114332500A (zh) | 图像处理模型训练方法、装置、计算机设备和存储介质 | |
| CN118427763B (zh) | 基于脑电信号的虚拟现实认知状态实时编码方法及设备 | |
| CN109492610B (zh) | 一种行人重识别方法、装置及可读存储介质 | |
| CN119205638A (zh) | 基于迭代Mamba架构的遥感图像变化检测方法及装置 | |
| CN112818846A (zh) | 视频帧的特征提取方法、装置及电子设备 | |
| CN116612488A (zh) | 书籍封面的识别方法、装置、电子设备及存储介质 | |
| AU2017100972A4 (en) | Systems and Methods for Reducing Computer Resources Consumption to Reconstruct Shape of Multi-Object Image | |
| CN117315651B (zh) | 基于仿射一致Transformer的多类别细胞检测分类方法以及装置 | |
| CN116861353B (zh) | 基于鲁棒转移子空间学习的故障诊断方法及系统 | |
| Stypułkowski et al. | Representing point clouds with generative conditional invertible flow networks | |
| Ren et al. | A new parallel PQDs classification method based on an optimized NLM and an improved DRSN-TCN model | |
| CN118397695A (zh) | 步态识别模型训练方法、人体步态识别方法及相关装置 | |
| CN114120245B (zh) | 基于深度神经网络的人群图像分析方法、装置以及设备 | |
| Kim | Robust, scalable anomaly detection for large collections of images | |
| CN114743013B (zh) | 局部描述子生成方法、装置、电子设备和计算机程序产品 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 22926609 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 22926609 Country of ref document: EP Kind code of ref document: A1 |


