Astronomical light curve time series anomaly detection method and system
Patent Information
- Application Number
- CN202410142541.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-01
- Publication Date
- 2026-08-18
- Estimated Expiration
- 2044-02-01
AI Technical Summary
2)共现噪声
[0129] (1) By using univariate and multivariate time series modeling techniques in two different models, the characteristics of channel independence and co-occurrence noise can be addressed respectively.
Smart Images

Figure CN118035703B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing, specifically to a method and system for detecting time-series anomalies in astronomical light curves. Background Technology
[0002] In recent years, with the development of observational equipment, significant progress has been made in astronomical scientific discoveries. On the one hand, optical or radio telescopes with higher temporal and spatial resolution have facilitated the collection of large-scale astronomical data, including light curves, optical images, and radio signals, thus providing researchers with valuable resources for exploring and interpreting the natural world. On the other hand, automated analysis and interpretation of massive amounts of observational data can uncover more valuable scientific phenomena; for example, anomalous patterns in light curves (i.e., deviations from normal patterns) may indicate potentially valuable astronomical events or physical phenomena. However, given the sheer volume of observational data, it is difficult to sift through anomalous data. Therefore, designing an effective anomaly detection method to aid scientific discovery from massive astronomical datasets is crucial.
[0003] Light curve data from multiple celestial objects can be represented as a multivariate time series, but compared to general multivariate time series, light curves have two unique characteristics: 1) Channel independence. Since each channel in a multivariate time series represents a celestial object, they are physically distant from each other and have different physical properties. Therefore, each channel is inherently independent and does not affect each other under normal circumstances. This differs from general multivariate time series from industrial equipment or IT systems, which often exhibit normal channel dependence. 2) Co-occurrence noise. Light curves observed through telescopes are easily affected by environmental interference, such as cloud cover or extreme weather. These factors may simultaneously affect the observation of a variable number of celestial objects within the same time period; this effect is called co-occurrence noise.
[0004] The two characteristics described above can be summarized as follows: multiple light curves are uncorrelated in normal mode, but may be affected by correlated noise. However, this noise does not correspond to actual celestial events and therefore should not be identified as anomalies, otherwise it would cause a large number of false alarms.
[0005] This shows that existing time series anomaly detection methods are not suitable for the above two characteristics, such as... Figure 1As shown in (a), univariate time series anomaly detection methods misidentify co-occurrence noise as celestial events, thus rendering them unsuitable for anomaly detection in astronomical light curves. To address the characteristics of co-occurrence noise, multiple light curves need to be considered as a multivariate time series, thereby modeling the co-occurrence noise correlation among them. However, existing multivariate time series anomaly detection methods primarily target systems such as industrial equipment and urban infrastructure, relying on the assumption that all channels are generally interdependent. This assumption contradicts the inherent channel independence of celestial objects. Therefore, these methods perform poorly when applied to astronomical observations.
[0006] Recent research has proposed treating each channel of multiple light curves as a node and applying graph neural networks (GNNs) to explicitly model the dependencies between nodes. While these methods have shown superior performance in capturing dependencies between nodes compared to traditional multivariate time series modeling methods, they still face challenges in effectively modeling co-occurrence noise. Specifically, existing graph neural networks can explicitly learn the degree of dependency between nodes, including both global static graphs and dynamic time series graphs. However, the unpredictable environmental disturbances in astronomical observations result in co-occurrence noise exhibiting both spatial and temporal randomness. This indicates a lack of stable dependencies between celestial bodies and a lack of predictable, fixed temporal evolution patterns. This randomness not only undermines the fundamental premise of constructing static graphs but also violates the core principles of constructing dynamic graphs. Summary of the Invention
[0007] This invention provides a method and system for detecting time series anomalies in astronomical light curves with co-occurrence noise by combining univariate and multivariate time series modeling approaches.
[0008] To address the aforementioned technical problems, this invention first provides a method for constructing a time-series anomaly detection model for astronomical light curves, comprising the following steps:
[0009] S100. Obtain light curve data containing multiple celestial bodies, and treat each channel of the subsequence Y of the light curve data as an independent univariate time series, with one celestial body instance corresponding to one channel.
[0010] A time series reconstruction sub-model based on the transformer architecture is established to reconstruct the univariate time series of each channel, and the reconstruction results are concatenated into a time series reconstruction matrix. Calculate the reconstruction error between the temporal reconstruction matrix and the original matrix formed by the optical curve data;
[0011] In the first stage, the normal time patterns of each celestial body are modeled by a temporal reconstruction sub-model, which uses a Transformer-based encoder-decoder architecture. According to channel independence, multiple celestial bodies are regarded as independent univariate time series through a shared network.
[0012] S200. Take the reconstruction error as an embedding with timestamps as the sliding window, calculate the similarity between pairwise channels in the reconstruction error of each window, and derive the graph structure corresponding to the timestamp window;
[0013] Using the graph structure and the original matrix as inputs, perform secondary reconstruction through a co-occurrence noise reconstruction sub-model based on the graph convolutional neural network architecture, and output the co-occurrence noise matrix
[0014] In the second stage, considering channel dependence, perform reconstruction through the co-occurrence noise reconstruction sub-model to further filter out co-occurrence noise instances from the anomaly candidates. Given the spatial and temporal randomness of co-occurrence noise, the present invention uses a simple and effective window-level graph structure learning technique to generate a different adjacency matrix for each time window using the reconstruction error, without further calculating the temporal correlation between different adjacency matrices. This technique avoids the prerequisite assumptions of GNN in previous methods for learning static spatial correlations or predictable dynamic time patterns, enabling the model to better focus on capturing co-occurrence noise, thereby improving the effectiveness of anomaly detection in astronomical observations.
[0015] S300. Train the two established sub-models to obtain an anomaly detection model.
[0016] The present invention adopts a two-stage detection framework to address the limitations of existing two types of anomaly detection methods, including temporal reconstruction and co-occurrence noise reconstruction, which are designed respectively for two different characteristics of channel independence and co-occurrence noise in astronomical observations. The present invention can effectively reconstruct the normal time pattern and co-occurrence noise, thereby screening out real anomalies. Compared with existing methods, the two-stage framework customized for astronomical observation data in the present invention significantly reduces the number of false positives in practical applications.
[0017] In the present invention, the light curve data generates two types of sequences. One is the celestial body instance with a window length of W, and the generated sequence X is written as X ∈ R N×W , where N is the number of channels; the other is the subsequence Y generated from the second half of X, with a window length of ω, and ω < W, written as Y ∈ R N×ω . This method ensures that the reconstruction focuses more on the second half of the time series while using a longer context to better capture the time pattern. The principle behind this strategy is consistent with the inference stage of time series anomaly detection, where a sliding window is used to gradually determine the anomaly score of the last timestamp.
[0018] In step S100 of the present invention, each channel of the light curve data of multiple celestial bodies is regarded as an independent univariate time series. When reconstructing the univariate time series of each channel, the established time series reconstruction sub-model is based on the encoder-decoder architecture of the transformer.
[0019] Its input part denotes each channel of X and Y as L separately. (n) and S (n) Then for L (n) and S (n) It is formed by adding the linear projection to the temporal embedding.
[0020] The standard Transformer integrates sequential information into a sequence using positional encoding, assuming equal time intervals. However, this assumption does not apply to astronomical light curves because the observation intervals are not strictly equal. To account for irregular intervals, this invention proposes an improved time encoding technique. This time embedding not only includes the absolute positions in the original trigonometric functions but also encodes the time intervals as learnable phase shifts. Finally, the sum of the sin and cosine terms is used as the time embedding function, TE. t The j-th dimension on timestamp t is defined as:
[0021]
[0022] Where f j Predefined angular frequency, pos t Δ represents the absolute position of timestamp t. t It is the time interval between the current timestamp and the previous timestamp, α. j These are learnable parameters;
[0023] The final input embedding of the temporal reconstruction sub-model is:
[0024]
[0025]
[0026] Use I respectively E and I D to represent and In the above formula, W E W D These are learnable parameters.
[0027] The encoder of the temporal reconstruction sub-model described in this invention processes the time series I of a long window. EThe generated representation is based on the attention mechanism applied in the Transformer architecture, which performs the following operations:
[0028]
[0029] Where Q, K, and V are derived from the linear projection of the input embedding; in the above formula, softmax is the normalized exponential function, T represents the transpose, and m is the dimension of Q and K.
[0030] The input embedding is projected onto h sets of different queries, keys, and values. Given an input representation IE, the output representation of multi-head attention is as follows:
[0031] MHA(Q,K,V)=Concat(H1,…,H h )×W o ;
[0032] H x =Attention(Q) i ,K i V i );
[0033] Q i ,K i V i , i∈{1,…,h} is the value of I E Through projection matrix Obtained by linear projection;
[0034] Using the Transformer architecture for coding:
[0035] M E =LayerNorm(I E +MHA(I E ,I E ,I E ));
[0036] O E =LayerNorm(M E +FeedForward(M E ));
[0037] Where LayerNorm represents layer normalization, FeedForward represents the feedforward layer, and O E The final output of the encoder,
[0038] The decoder of the temporal reconstruction sub-model aims to reconstruct the time series of a short window. The decoder utilizes I... D and encoder output O E Reconstruct each channel:
[0039] M D =LayerNorm(I D +MHA(I D ,I D ,I D ));
[0040] o′ D =LayerNorm(M D +MHA(M D O E O E ,));
[0041] O D =Sigmoid(FeedForward(O′) D ));
[0042] The sigmoid function is used to generate a normalized reconstruction result for each channel.
[0043] The output layer of the temporal reconstruction sub-model described in this invention concatenates the reconstruction results of each channel output by the decoder to form a matrix.
[0044]
[0045] Calculate the reconstruction error:
[0046]
[0047] Through the above steps, the reconstruction error of normal celestial bodies is relatively small, while the reconstruction error of anomalous candidates is relatively large. Therefore, the temporal reconstruction sub-model can initially identify anomalous candidates. However, if the correlation between channels is not considered, co-occurring noise may be incorrectly classified as anomalous.
[0048] Co-occurrence noise reconstruction aims to improve this problem by filtering out co-occurrence noise from identified anomaly candidates. Since co-occurrence noise often exhibits large errors simultaneously across multiple channels, it can usually be distinguished by modeling channel correlations. Further refinement of the anomaly detection process is achieved through secondary reconstruction of the reconstruction error.
[0049] Co-occurrence noise exhibits spatial and temporal randomness, potentially appearing on any celestial body (channel) at any time. These characteristics render existing static or dynamic GNN methods unsuitable: static GNN methods rely on static graph structures to represent stable dependencies between channels, while dynamic GNN methods assume channel correlations are dynamically predictable. To overcome these limitations, this invention constructs a specific graph structure for each sliding window. Specifically, the reconstruction error calculated in step S100 is set to E, and the embedding of the sliding window at time stamp t is set to E. t The specific steps of step S200 are as follows:
[0050] S201, Calculate E t The similarity between channels m and n is expressed as:
[0051]
[0052] S202. Derive the graph structure corresponding to the timestamp t window, i.e., the adjacency matrix, which represents the pairwise similarity between channels:
[0053]
[0054] S203, the graph structure A and the original matrix Y corresponding to the timestamp t window. t As input to the co-occurrence noise reconstruction sub-model, the output is the co-occurrence noise matrix.
[0055]
[0056] in Let W be the degree matrix, σ be the activation function, and W be the degree matrix. θ and b θ These are learnable parameters. It's worth noting that self-loops have been removed from message passing to exclude information from the target node itself. This design prevents genuine anomalies from being well reconstructed based on their own information.
[0057] In deriving the graph structure for each sliding window, channels exhibiting similar error patterns are given significant weights. Since channels affected by co-occurring noise exhibit similar fluctuations, while true anomalies typically occur alone, this principle can be used to distinguish between co-occurring noise and true anomalies: if a channel is affected by co-occurring noise within a given window, its behavior can be effectively reconstructed using the error patterns of other similarly affected channels, whereas true anomalies cannot be well reconstructed using this principle and thus cannot be distinguished.
[0058] In this invention, step S300 involves training the two established sub-models, wherein...
[0059] 1) When training the temporal reconstruction sub-model, stop training the temporal reconstruction sub-model after the loss function of the temporal reconstruction sub-model no longer decreases. The loss function of the temporal reconstruction sub-model is as follows:
[0060]
[0061] 2) When training the co-occurrence noise reconstruction sub-model, fix the parameters of the temporal reconstruction sub-model. Stop training after the loss function of the co-occurrence noise reconstruction sub-model no longer decreases. The loss function of the co-occurrence noise reconstruction sub-model is as follows:
[0062]
[0063] The present invention also provides a construction system for a time series anomaly detection model for astronomical light curves, including:
[0064] A data acquisition sub-module for acquiring light curve data containing multiple celestial bodies;
[0065] A temporal reconstruction sub-module for establishing a temporal reconstruction sub-model based on the transformer architecture, reconstructing the univariate time series of each channel, and splicing the reconstruction results into a temporal reconstruction matrix Calculating the reconstruction error between the temporal reconstruction matrix and the original matrix formed by the light curve data;
[0066] A co-occurrence noise reconstruction sub-module for applying a window-level graph structure learning algorithm, constructing a specific graph structure for each sliding window with the reconstruction error calculated by the temporal reconstruction sub-module, and establishing a co-occurrence noise reconstruction sub-model based on the graph convolutional neural network architecture to perform secondary reconstruction on the obtained graph structure and the original matrix, and outputting a co-occurrence noise matrix;
[0067] A model training sub-module for training the two established sub-models to obtain an anomaly detection model.
[0068] According to the construction system for a time series anomaly detection model for astronomical light curves provided by the present invention, the data acquisition sub-module generates two types of sequences from the acquired light curve data. One is the sequence X generated by celestial body instances with a window length of W, written as X ∈ R N×W , where N is the number of channels; the other is the subsequence Y generated from the second half of X, with a window length of ω and ω < W, written as Y ∈ R B×ω .
[0069] According to the construction system for a time series anomaly detection model for astronomical light curves provided by the present invention, the input part of the temporal reconstruction sub-model established by the temporal reconstruction sub-module separately records each channel of X and Y as L (n) and S (n)Then for L (n) and S (n) It is formed by adding the linear projection to the temporal embedding.
[0070] According to the construction system of the time series anomaly detection model for astronomical light curves provided by the present invention, the time embedding includes the absolute position in the original trigonometric functions, encodes the time interval as a learnable phase shift, and finally sums the sin and cos terms as the time embedding function. The time embedding TE t The j-th dimension on timestamp t is defined as:
[0071]
[0072] Where f j Predefined angular frequency, pos t Δ represents the absolute position of timestamp t. t It is the time interval between the current timestamp and the previous timestamp, α. j These are learnable parameters;
[0073] The final input embedding of the temporal reconstruction sub-model is:
[0074]
[0075]
[0076] Use I respectively E and I D to represent and In the above formula, W E W D These are learnable parameters.
[0077] According to the construction system of the time series anomaly detection model for astronomical light curves provided by the present invention, the encoder of the time series reconstruction sub-model performs long-window time series I... E The generated representation is based on the attention mechanism applied in the Transformer architecture, which performs the following operations:
[0078]
[0079] Where Q, K, and V are derived from the linear projection of the input embedding; in the above formula, softmax is the normalized exponential function, T represents the transpose, and m is the dimension of Q and K.
[0080] The input embedding is projected onto h sets of different queries, keys, and values. Given an input representation IE, the output representation of multi-head attention is as follows:
[0081] MHA(Q,K,V)=Concat(H1,...,H h )×W O ;
[0082] H i =Attention(Q) i K i V i );
[0083] Q i K i V i , i∈{1,...,h} is the value of I E Through projection matrix Obtained by linear projection;
[0084] Using the Transformer architecture for coding:
[0085] M E =LayerNorm(I E +MHA(I E I E I E ));
[0086] O E =LayerNorm(M E +FeedForward(M E ));
[0087] Where LayerNorm represents layer normalization, FeedForward represents the feedforward layer, and O E The final output of the encoder,
[0088] The decoder of the temporal reconstruction sub-model aims to reconstruct the time series of a short window. The decoder utilizes I... D and encoder output O E Reconstruct each channel:
[0089] M D =LayerNorm(I D +MHA(I D I D I D ));
[0090] O′ D =LayerNorm(M D +MHA(M D O E O E ,));
[0091] O D =Sigmoid(FeedForward(O′) D ));
[0092] The sigmoid function is used to generate a normalized reconstruction result for each channel.
[0093] According to the construction system for a time-series anomaly detection model for astronomical light curves provided by the present invention, the output layer of the time-series reconstruction sub-model concatenates the reconstruction results of each channel output by the decoder to form a matrix.
[0094]
[0095] Calculate the reconstruction error:
[0096]
[0097] According to the construction system of the time series anomaly detection model for astronomical light curves provided by the present invention, the reconstruction error calculated by the time series reconstruction submodule is set to E, and the embedding of the sliding window of the timestamp t is set to E. t The co-occurrence noise reconstruction submodule is used to calculate E. t The similarity between channels m and n is expressed as:
[0098]
[0099] This leads to the graph structure corresponding to the timestamp t window, namely the adjacency matrix, which represents the pairwise similarity between channels:
[0100]
[0101] And the graph structure A corresponding to the timestamp t window and the original matrix Y t The co-occurrence noise matrix serves as the input to the co-occurrence noise reconstruction sub-model. As output:
[0102]
[0103] in Let W be the degree matrix, σ be the activation function, and W be the degree matrix. θ and b θ These are learnable parameters.
[0104] According to the system for constructing a time-series anomaly detection model for astronomical light curves provided by the present invention, the model training submodule trains the two established sub-models as follows:
[0105] 1) When training the temporal reconstruction sub-model, training should stop when the loss function of the temporal reconstruction sub-model no longer decreases. The loss function of the temporal reconstruction sub-model is:
[0106]
[0107] 2) When training the co-occurrence noise reconstruction sub-model, the parameters of the temporal reconstruction sub-model are fixed. Training is stopped when the loss function of the co-occurrence noise reconstruction sub-model no longer decreases. The loss function of the co-occurrence noise reconstruction sub-model is:
[0108]
[0109] This invention also provides a method for detecting time-series anomalies in astronomical light curves, comprising the following steps:
[0110] The sliding window is maintained with a stride of 1, and new observations are added to the previous window as they arrive.
[0111] Then, the astronomical light curve is reconstructed using the time-series anomaly detection model established by any of the above methods. The anomaly score is calculated based on the reconstruction result, which is defined as the combination of the reconstruction matrices of the two sub-modules. The calculation formula is as follows:
[0112]
[0113] in () represents retrieving the last timestamp of each window;
[0114] For each celestial body, anomaly score Indicates the corresponding input The difficulty of reconstruction is used to set a threshold for outlier scores, resulting in binary labels. The specific formula is as follows:
[0115]
[0116] The binary label is used to determine whether it is a celestial body instance affected by a real anomaly.
[0117] This invention also provides a time-series anomaly detection system for astronomical light curves, comprising:
[0118] The online data reading module is used to continuously acquire newly observed astronomical light curves online and maintain a sliding window with a step size of 1. When a new observation arrives, it is added to the previous window.
[0119] The anomaly detection module reconstructs the acquired astronomical light curves using a time-series anomaly detection model established through any of the above methods. An anomaly score is calculated based on the reconstruction result, defined as a combination of the reconstruction matrices from the two sub-modules. The calculation formula is as follows:
[0120]
[0121] in () represents retrieving the last timestamp of each window;
[0122] For each celestial body, anomaly score Indicates the corresponding input The difficulty of reconstruction is used to set a threshold for outlier scores, resulting in binary labels. The specific formula is as follows:
[0123]
[0124] The binary label is used to determine whether it is a celestial body instance affected by a real anomaly.
[0125] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the above-described time-series anomaly detection method for astronomical light curves.
[0126] The present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to perform the above-described time-series anomaly detection method for astronomical light curves.
[0127] The present invention also provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; the processor calls logical instructions in the memory to execute the above-mentioned time series anomaly detection method for astronomical light curves.
[0128] The present invention has the following advantages due to the adoption of the above technical solutions:
[0129] (1) By using univariate and multivariate time series modeling techniques in two different models, the characteristics of channel independence and co-occurrence noise can be addressed respectively.
[0130] (2) By using two models, the normal mode and the co-occurrence noise mode are fitted in turn, thereby filtering out the real abnormal events, better realizing the abnormal detection of the light curve, and reducing the false alarm rate.
[0131] (3) By inputting a long window into the encoder, information about a longer context can be encoded, and by inputting a short window into the decoder, the data can be reconstructed more accurately and adapted to the scenario of online use.
[0132] (4) By proposing a window-level graph structure learning component in the co-occurrence noise reconstruction submodule, the present invention can better adapt to co-occurrence noise with temporal and spatial randomness.
[0133] (5) By using the reconstruction error of the time series reconstruction submodule as the input of the graph structure learning component of the co-occurrence noise reconstruction submodule, the co-occurrence noise pattern can be better mined and the influence of the shape of the original time series data can be reduced. Attached Figure Description
[0134] Figure 1 This is a comparison diagram of the detection process in the prior art and the detection process of the present invention.
[0135] Figure 2 This is a basic framework diagram of the detection method of the present invention.
[0136] Figure 3 This is a structural block diagram of the timing reconstruction submodule of the present invention.
[0137] Figure 4 This is a structural block diagram of the co-occurrence noise reconstruction submodule of the present invention. Detailed Implementation
[0138] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, embodiments of this invention, and should not be construed as limiting the invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention. In the description of this invention, it should be understood that the terminology used is for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0139] Construction Method of Time Series Anomaly Detection Model for Astronomical Light Curves
[0140] This embodiment provides a method for constructing a time-series anomaly detection model for astronomical light curves, including the following steps:
[0141] S100. Obtain light curve data containing multiple celestial bodies, with one celestial body instance corresponding to one channel. The light curve data generates two types of sequences: one is a sequence X generated from celestial body instances with a window length of W, written as X∈R. N×WN is the number of channels; another type is the subsequence Y generated from the latter half of X, with a window length of ω, where ω < W, written as Y ∈ R. N ×ω .
[0142] A time series reconstruction sub-model based on the transformer architecture is established to reconstruct the univariate time series of each channel.
[0143] The temporal reconstruction sub-model includes an input part, an encoder and decoder, and an output part.
[0144] The input part denotes each channel of X and Y as L separately. (n) and S (n) Then for L (n) and S (n) The time embedding is formed by adding the linear projection to the temporal embedding. The temporal embedding includes the absolute positions of the original trigonometric functions and encodes the time intervals as learnable phase shifts. Finally, the sum of the sin and cos terms is used as the temporal embedding function, TE. t The j-th dimension on timestamp t is defined as:
[0145]
[0146] Where f j Predefined angular frequency, pos t Δ represents the absolute position of timestamp t. t It is the time interval between the current timestamp and the previous timestamp, α. j These are learnable parameters;
[0147] The final input embedding of the temporal reconstruction sub-model is:
[0148]
[0149]
[0150] Use I respectively E and I D to represent and In the above formula, W E W D These are learnable parameters.
[0151] Encoder for long window time series I E The generated representation is based on the attention mechanism applied in the Transformer architecture, which performs the following operations:
[0152]
[0153] Where Q, K, and V are derived from the linear projection of the input embedding; in the above formula, soffmax is the normalized exponential function, T represents the transpose, and m is the dimension of Q and K.
[0154] The input embedding is projected onto h sets of different queries, keys, and values. Given an input representation IE, the output representation of multi-head attention is as follows:
[0155] MHA(Q,K,V)=Concat(H1,...,H h )×W O ;
[0156] Hi = Attention(Q) i Ki, Vi);
[0157] Q i K i V i , i∈{1,...,h} is the value of I E Through projection matrix Obtained by linear projection;
[0158] Using the Transformer architecture for coding:
[0159] M E =LayerNorm(I E +MHA(I E I E I E ));
[0160] O E =LayerNorm(M E +FeedForward(M E ));
[0161] Where LayerNorm represents layer normalization, FeedForward represents the feedforward layer, and O E The final output of the encoder,
[0162] The goal of the decoder in the temporal reconstruction sub-model is to reconstruct the time series of a short window. The decoder utilizes I... D and encoder output O E Reconstruct each channel:
[0163] M D =LayerNorm(I D +MHA(I D I D I D ));
[0164] O′ D =LayerNorm(M D +MHA(M D O E O E ,));
[0165] O D =Sigmoid(FeedForward(O′) D ));
[0166] The sigmoid function is used to generate a normalized reconstruction result for each channel.
[0167] The output section concatenates the reconstruction results of each channel output by the decoder to form a matrix.
[0168]
[0169] Calculate the reconstruction error:
[0170]
[0171] Identify anomalous candidate celestial bodies that include both those affected by co-occurrence noise and those with genuine anomalies.
[0172] S200, The reconstruction error E is used as the embedding E with the timestamp t as the sliding window. t Calculate the similarity between pairs of channels in the reconstruction error of each window, and derive the graph structure corresponding to the timestamp t window;
[0173] A co-occurrence noise reconstruction sub-model based on a graph convolutional neural network architecture is constructed. The co-occurrence noise reconstruction sub-model takes the graph structure and the original matrix as input, performs secondary reconstruction through the graph convolutional neural network, and outputs the co-occurrence noise matrix.
[0174] The specific steps are as follows:
[0175] S201, Calculate E t The similarity between channels m and n is expressed as:
[0176]
[0177] S202. Derive the graph structure corresponding to the timestamp t window, i.e., the adjacency matrix, which represents the pairwise similarity between channels:
[0178]
[0179] S203, the graph structure A and the original matrix Y corresponding to the timestamp t window. tAs input to the co-occurrence noise reconstruction sub-model, the output is the co-occurrence noise matrix.
[0180]
[0181] in Let W be the degree matrix, σ be the activation function, and W be the degree matrix. θ and b θ These are learnable parameters.
[0182] S300. Train the two sub-models to obtain the anomaly detection model;
[0183] When training the temporal reconstruction sub-model, training is stopped when the loss function of the temporal reconstruction sub-model no longer decreases. The loss function of the temporal reconstruction sub-model is:
[0184]
[0185] When training the co-occurrence noise reconstruction sub-model, the parameters of the temporal reconstruction sub-model are fixed. Training stops when the loss function of the co-occurrence noise reconstruction sub-model no longer decreases. The loss function of the co-occurrence noise reconstruction sub-model is:
[0186]
[0187] Construction System for Time Series Anomaly Detection Model of Astronomical Light Curves
[0188] This embodiment presents a system for constructing a time-series anomaly detection model for astronomical light curves, including:
[0189] Data Acquisition Submodule
[0190] This is used to acquire light curve data containing multiple celestial bodies, and to generate two types of sequences from the acquired light curve data. One type is a sequence X generated from celestial body instances with a window length of W, written as X∈R. N×W N is the number of channels; another type is the subsequence Y generated from the latter half of X, with a window length of ω, where ω < W, written as Y ∈ R. N×ω .
[0191] Timing Reconfiguration Submodule
[0192] In this submodule, each channel of the light curve data of multiple celestial bodies is treated as an independent univariate time series. A time series reconstruction sub-model is applied to reconstruct the univariate time series of each channel, and the reconstruction results are concatenated into a time series reconstruction matrix. Calculate the time-series reconstruction matrix The reconstruction error of the original matrix Y formed by the light curve data initially identifies anomalous candidate celestial bodies that include both those affected by co-occurrence noise and those with genuine anomalies.
[0193] This submodule consists of five components: temporal embedding, input embedding, encoder, decoder, and output component.
[0194] (1) Temporal embedding
[0195] It incorporates the absolute positions from the original trigonometric functions, encodes the time intervals as learnable phase shifts, and finally sums the sin and cos terms as the time embedding function, TE. t The j-th dimension on timestamp t is defined as:
[0196]
[0197] Where f j Predefined angular frequency, pos t Δ represents the absolute position of timestamp t. t It is the time interval between the current timestamp and the previous timestamp, α. j These are learnable parameters.
[0198] (2) Input embedding
[0199] Each channel of X and Y is denoted as L. (n) and S (n) Then for L (n) and S (n) After linear projection, and with time embedding TE t The two inputs are added together to form the final input embedding, as follows:
[0200]
[0201]
[0202] To make the expression concise, I will be used thereafter. E and I D to represent respectively and
[0203] (3) Encoder
[0204] Encoder for long window time series I E The generated representation is based on the attention mechanism applied in the Transformer architecture, which performs the following operations:
[0205]
[0206] Q, K, and V are derived from the linear projection of the input embedding;
[0207] The input embedding is projected onto h sets of different queries, keys, and values. Given an input representation IE, the output representation of multi-head attention is as follows:
[0208] MHA(Q,K,V)=Concat(H1,...,H h )×W O ;
[0209] Hi = Attention(Q) i K i V i );
[0210] Q i K i V i , i∈{1,...,h} is the value of I E Through projection matrix Obtained by linear projection;
[0211] Using the Transformer architecture for coding:
[0212] M E =LayerNorm(I E +MHA(I E I E I E ));
[0213] O E =LayerNorm(M E +FeedForward(M E ));
[0214] Where LayerNorm represents layer normalization, FeedForward represents the feedforward layer, and O E The final output of the encoder,
[0215] (4) Decoder
[0216] The goal of the decoder is to reconstruct the time series of a short window. The decoder utilizes I D and encoder output O E Reconstruct each channel:
[0217] M D =LayerNorm(I D +MHA(I D I D I D ));
[0218] O′ D =LayerNorm(M D +MHA(M D O E O E ,));
[0219] O D =Sigmoid(FeedForward(O′) D ));
[0220] The sigmoid function is used to generate a normalized reconstruction result for each channel.
[0221] (5) Output
[0222] The output section concatenates the reconstruction results of each channel output by the decoder to form a matrix.
[0223]
[0224] Calculate the reconstruction error:
[0225]
[0226] Co-occurrence noise reconstruction submodule
[0227] Used to calculate E t The similarity between channels m and n is expressed as:
[0228]
[0229] Derive the graph structure corresponding to the timestamp t window, namely the adjacency matrix, which represents the pairwise similarity between channels:
[0230]
[0231] The graph structure A corresponding to the timestamp t window and the original matrix Y t As input to the co-occurrence noise reconstruction sub-model, the output is the co-occurrence noise matrix.
[0232]
[0233] in Let W be the degree matrix, σ be the activation function, and W be the degree matrix. θ and b θ These are learnable parameters.
[0234] Model training submodule
[0235] This is used to train the two sub-models to obtain the anomaly detection model;
[0236] When training the temporal reconstruction sub-model, training is stopped when the loss function of the temporal reconstruction sub-model no longer decreases. The loss function of the temporal reconstruction sub-model is:
[0237]
[0238] When training the co-occurrence noise reconstruction sub-model, the parameters of the temporal reconstruction sub-model are fixed. Training stops when the loss function of the co-occurrence noise reconstruction sub-model no longer decreases. The loss function of the co-occurrence noise reconstruction sub-model is:
[0239]
[0240] To examine the contributions of each submodule of the system, we conducted ablation experiments, selectively deleting or modifying different submodules to observe their impact on the performance of the constructed model. The effectiveness of these submodules was verified through seven variants of the original system. These variants fall into two categories: three modifying the timing reconstruction submodule and four modifying the co-occurring noise reconstruction submodule. Details of these variants are described below:
[0241] 1) Impact of the timing reconstruction module
[0242] • No timing refactoring submodule: It removes the timing refactoring module and retains only the co-occurrence noise refactoring submodule in the framework.
[0243] • No univariate input: The input to the time series reconstruction submodule has been changed from a direct univariate time series to a multivariate time series. This adjustment aims to demonstrate the effectiveness of independently modeling each channel in this module.
[0244] • No short window: Removes the input from a short window of length ω in the timing reconstruction submodule.
[0245] 2) Impact of the co-occurrence noise reconstruction submodule
[0246] • No co-occurrence noise reconstruction submodule: The co-occurrence noise reconstruction submodule has been removed, and only the timing reconstruction submodule has been retained.
[0247] • No co-occurrence noise sub-module reconstruction and univariate input: The co-occurrence noise reconstruction sub-module has been removed, and the multivariate time series has been changed to a univariate time series as the input to the time series reconstruction sub-module.
[0248] • Windowless graph structure (static): Applying a static complete graph to model channel correlations instead of window-level graph structure learning techniques.
[0249] • Windowless graph structure (dynamic): Learning techniques that use dynamic graph structures instead of window-level graph structures.
[0250] Experiments have shown that the performance of the above seven variants is inferior to that of the model constructed by the system of this invention.
[0251] Time-series anomaly detection method for astronomical light curves
[0252] This embodiment provides a method for detecting time-series anomalies in astronomical light curves, including the following steps:
[0253] The sliding window is maintained with a stride of 1, and new observations are added to the previous window as they arrive.
[0254] Then, the astronomical light curve is reconstructed using the time-series anomaly detection model for astronomical light curves established in the above embodiments. The anomaly score is calculated based on the reconstruction result, and the anomaly score is defined as the combination of the reconstruction matrices of the two sub-modules. The calculation formula is as follows:
[0255]
[0256] in () represents retrieving the last timestamp of each window;
[0257] For each celestial body, anomaly score Indicates the corresponding input The difficulty of reconstruction is used to set a threshold for outlier scores, resulting in binary labels. The specific formula is as follows:
[0258]
[0259] The binary label is used to determine whether it is a celestial body instance affected by a real anomaly.
[0260] Time-series anomaly detection system for astronomical light curves
[0261] This embodiment provides a time-series anomaly detection system for astronomical light curves, including:
[0262] The online data reading module is used to continuously acquire newly observed astronomical light curves online and maintain a sliding window with a step size of 1. When a new observation arrives, it is added to the previous window.
[0263] The anomaly detection module reconstructs the acquired astronomical light curves using the time-series anomaly detection model for astronomical light curves established in the above embodiments. An anomaly score is calculated based on the reconstruction result, defined as a combination of the reconstruction matrices from two sub-modules. The calculation formula is as follows:
[0264]
[0265] in () represents retrieving the last timestamp of each window;
[0266] For each celestial body, anomaly score Indicates the corresponding input The difficulty of reconstruction is used to set a threshold for outlier scores, resulting in binary labels. The specific formula is as follows:
[0267]
[0268] The binary label is used to determine whether it is a celestial body instance affected by a real anomaly.
[0269] Computer-readable storage media
[0270] This embodiment provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, is implemented to perform a time-series anomaly detection method for astronomical light curves.
[0271] This method for detecting time-series anomalies in astronomical light curves includes the following steps:
[0272] The sliding window is maintained with a stride of 1, and new observations are added to the previous window as they arrive.
[0273] Then, the astronomical light curve is reconstructed using the time-series anomaly detection model for astronomical light curves established in the above embodiments. The anomaly score is calculated based on the reconstruction result, and the anomaly score is defined as the combination of the reconstruction matrices of the two sub-modules. The calculation formula is as follows:
[0274]
[0275] in () represents retrieving the last timestamp of each window;
[0276] For each celestial body, anomaly score Indicates the corresponding input The difficulty of reconstruction is used to set a threshold for outlier scores, resulting in binary labels. The specific formula is as follows:
[0277]
[0278] The binary label is used to determine whether it is a celestial body instance affected by a real anomaly.
[0279] Computer program products
[0280] This embodiment provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute a time-series anomaly detection method for astronomical light curves.
[0281] This method for detecting time-series anomalies in astronomical light curves includes the following steps:
[0282] The sliding window is maintained with a stride of 1, and new observations are added to the previous window as they arrive.
[0283] Then, the astronomical light curve is reconstructed using the time-series anomaly detection model for astronomical light curves established in the above embodiments. The anomaly score is calculated based on the reconstruction result, and the anomaly score is defined as the combination of the reconstruction matrices of the two sub-modules. The calculation formula is as follows:
[0284]
[0285] in This represents retrieving the last timestamp of each window;
[0286] For each celestial body, anomaly score Indicates the corresponding input The difficulty of reconstruction is used to set a threshold for outlier scores, resulting in binary labels. The specific formula is as follows:
[0287]
[0288] The binary label is used to determine whether it is a celestial body instance affected by a real anomaly.
[0289] electronic devices
[0290] This embodiment provides an electronic device, including a processor, a communication interface, a memory, and a communication bus. The processor, communication interface, and memory communicate with each other through the communication bus. The processor calls logical instructions in the memory to execute a time-series anomaly detection method for astronomical light curves.
[0291] This method for detecting time-series anomalies in astronomical light curves includes the following steps:
[0292] The sliding window is maintained with a stride of 1, and new observations are added to the previous window as they arrive.
[0293] Then, the astronomical light curve is reconstructed using the time-series anomaly detection model for astronomical light curves established in the above embodiments. The anomaly score is calculated based on the reconstruction result, and the anomaly score is defined as the combination of the reconstruction matrices of the two sub-modules. The calculation formula is as follows:
[0294]
[0295] in () represents retrieving the last timestamp of each window;
[0296] For each celestial body, anomaly score Indicates the corresponding input The difficulty of reconstruction is used to set a threshold for outlier scores, resulting in binary labels. The specific formula is as follows:
[0297]
[0298] The binary label is used to determine whether it is a celestial body instance affected by a real anomaly.
[0299] Furthermore, the logical instructions in the aforementioned memory can be implemented as software functional units and sold or used as independent products, and can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0300] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0301] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0302] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for constructing a time-series anomaly detection model for astronomical light curves, characterized in that, Includes the following steps: S100. Obtain light curve data containing multiple celestial bodies, and treat each channel of the subsequence Y of the light curve data as an independent univariate time series, with one celestial body instance corresponding to one channel. A time series reconstruction sub-model based on the transformer architecture is established to reconstruct the univariate time series of each channel, and the reconstruction results are concatenated into a time series reconstruction matrix. Calculate the reconstruction error between the temporal reconstruction matrix and the original matrix formed by the optical curve data; S200. The reconstruction error is used as an embedding with timestamps as sliding windows. The similarity between pairs of channels in the reconstruction error of each window is calculated, and the graph structure corresponding to the timestamp window is derived. Using the graph structure and the original matrix as input, a secondary reconstruction is performed through a co-occurrence noise reconstruction sub-model based on a graph convolutional neural network architecture, outputting a co-occurrence noise matrix. S300. Train the two sub-models to obtain the anomaly detection model.
2. The construction method according to claim 1, characterized in that, The light curve data generates two types of sequences. One is the sequence X generated by celestial instances with a window length of W, written as X ∈ R N×W , where N is the number of channels; the other is the subsequence Y generated from the second half of X, with a window length of ω and ω < W, written as Y ∈ R N×ω .
3. The construction method according to claim 2, characterized in that, In step S100, the input to the timing reconstruction sub-model is to denote each channel of X and Y as L. (n) and S (n) Then for L (n) and S (n) It is formed by adding the linear projection to the temporal embedding.
4. The construction method according to claim 3, characterized in that, The temporal embedding includes the absolute positions in the original trigonometric functions and encodes the time intervals as learnable phase shifts. Finally, the sum of the sin and cos terms is used as the temporal embedding function, TE. t The j-th dimension on timestamp t is defined as: Where f j Predefined angular frequency, pos t Δ represents the absolute position of timestamp t. t It is the time interval between the current timestamp and the previous timestamp, α. j These are learnable parameters; The final input embedding of the temporal reconstruction sub-model is: I6 and I8 will be used to represent them respectively. and In the above formula, W : W ; These are learnable parameters.
5. The construction method according to claim 4, characterized in that, The encoder of the temporal reconstruction sub-model generates a representation of the long-window time series I6. This representation is generated based on the attention mechanism applied in the Transformer architecture. The attention mechanism performs the following operations: In the above formula, Q, K, and V come from the linear projection of the input embedding, softmax is the normalized exponential function, T represents the transpose, and m is the dimension of Q and K. The input embedding is projected onto h sets of different queries, keys, and values. Given an input representation IE, the output representation of multi-head attention is as follows: MHA(Q,K,V)=Concat(H1,...,H h )×W O ; H i =Attention(Q i ,K i ,V i ); Q i K i V i , i∈{1,...,h} is the set of I E Through projection matrix Obtained by linear projection; Using the Transformer architecture for coding: M E =LayerNorm(I E +MHA(I E ,I E ,I E )); O E =LayerNorm(M E +FeedForward(M E )); Where LayerNorm represents layer normalization, FeedForward represents the feedforward layer, and O E The final output of the encoder, The decoder of the temporal reconstruction sub-model aims to reconstruct the time series of a short window. The decoder utilizes I... D and encoder output O E Reconstruct each channel: M D =LayerNorm(I D +MHA(I D ,I D ,I D )); O′ D =LayerNorm(M D +MHA(M D ,O E ,O E ,)); O D =Sigmoid(FeedForward(O′ D )); Sigmoid is the activation function used to generate a normalized reconstruction result for each channel; The output layer of the temporal reconstruction sub-model concatenates the reconstruction results of each channel output by the decoder to form a matrix. Calculate the reconstruction error:
6. The construction method according to claim 2, characterized in that, Let the reconstruction error calculated in step S100 be E, and let the embedding of the sliding window of timestamp t be E. t The specific steps of step S200 are as follows: S201, Calculate E t The similarity between channels m and n is expressed as: S202. Derive the graph structure corresponding to the timestamp t window, i.e., the adjacency matrix, which represents the pairwise similarity between channels: S203, the graph structure A and the original matrix Y corresponding to the timestamp t window. t As input to the co-occurrence noise reconstruction sub-model, the output is the co-occurrence noise matrix. in Let W be the degree matrix, σ be the activation function, and W be the degree matrix. w and b w These are learnable parameters.
7. A method for detecting time-series anomalies in astronomical light curves, characterized in that, Includes the following steps: The sliding window is maintained with a stride of 1, and new observations are added to the previous window as they arrive. Then, the astronomical light curve is reconstructed using the time-series anomaly detection model for astronomical light curves established by any one of the construction methods in claims 1-6. The anomaly score is calculated based on the reconstruction result, and the anomaly score is defined as the combination of the reconstruction matrices of the two sub-modules. The calculation formula is as follows: Where S() represents retrieving the last timestamp of each window; For each celestial body, anomaly score Indicates the corresponding input The difficulty of reconstruction is used to set a threshold for outlier scores, resulting in binary labels. The specific formula is as follows: The binary label is used to determine whether it is a celestial body instance affected by a real anomaly.
8. A time-series anomaly detection system for astronomical light curves, characterized in that, include: The online data reading module is used to continuously acquire newly observed astronomical light curves online and maintain a sliding window with a step size of 1. When a new observation arrives, it is added to the previous window. The anomaly detection module reconstructs the acquired astronomical light curves using a time-series anomaly detection model established by any one of the construction methods in claims 1-6. An anomaly score is calculated based on the reconstruction result, and the anomaly score is defined as the combination of the reconstruction matrices of the two sub-modules. The calculation formula is as follows: in This represents retrieving the last timestamp of each window; For each celestial body, anomaly score Indicates the corresponding input The difficulty of reconstruction is used to set a threshold for outlier scores, resulting in binary labels. The specific formula is as follows: The binary label is used to determine whether it is a celestial body instance affected by a real anomaly.
9. An electronic device, characterized in that, Includes processor, communication interface, memory, and communication bus; The processor, communication interface, and memory communicate with each other through a communication bus. The processor is used to invoke logical instructions in memory to execute the time series anomaly detection method for astronomical light curves as described in claim 7.
10. A non-transitory computer-readable storage medium having stored thereon computer instructions that cause a computer to execute the time-series anomaly detection method for astronomical light curves as described in claim 7.
Citation Information
Patent Citations
Multi-element time sequence anomaly detection method for intelligent Internet of Things system
CN116663613A
Transform-based multivariable time sequence anomaly detection method
CN116796272A