Deep clustering method for bridge time sequence anomaly classification
By using the autoencoding module of the convolutional neural network and the long short-term memory neural network and the KL divergence loss function in the bridge time series data, the problem of insufficient accuracy and adaptability of the bridge time series data classification in the existing technology is solved, and the classification of the bridge time series data is realized. Efficient clustering and anomaly detection of bridge time series data.
Patent Information
- Application Number
- CN202410786242.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-18
- Publication Date
- 2024-09-17
AI Technical Summary
Existing anomaly detection methods are difficult to effectively apply to the time series data collected by bridge sensors, especially the data that is stopped after triggered collection. The classification accuracy and adaptability are poor, and they mainly target point anomalies and contextual anomalies. Overall timing anomaly detection less.
The autoencoding module based on convolutional neural network and long short-term memory neural network is used for two-stage autoencoding training, and the clusterer is trained with the KL divergence loss function to form a deep clustering model to classify the bridge time series data.
It improves the classification accuracy and adaptability of bridge time series data, enables more efficient clustering of the entire time series data collected by trigger sensors, and reduces reliance on domain knowledge.
Smart Images

Figure CN118656752A
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of data processing technology, and in particular to a deep clustering method for bridge time series anomaly classification. Background Art
[0002] In recent years, deep learning methods have been widely used in the fields of image classification, speech recognition and time series prediction. Existing methods for anomaly detection include traditional statistical learning methods, machine learning-based methods such as KNN and isolation forests. At present, the algorithms for abnormal time series detection mainly include two types: prediction-based models and reconstruction-based methods.
[0003] The prediction-based method builds a prediction method for the training set, and uses the trained prediction method for the test set. The prediction error is used as its anomaly score. The judgment principle is that the higher the score, the more likely it is an anomaly. The reconstruction-based method learns the normal pattern in the process of reconstructing the input, uses the reconstruction-based anomaly score, and detects the data with a score higher than the set threshold as anomaly.
[0004] The deep learning-based method has achieved excellent results in time series anomaly detection, but it also has some shortcomings and is difficult to be used in bridge anomaly detection.
[0005] The existing anomaly detection methods, whether single-variable or multi-variable, are all aimed at anomaly detection of data continuously collected by the same sensor. However, it is difficult to apply anomaly detection of data collected by bridge sensors in a triggered manner and stopping collection after a fixed time period.
[0006] The existing anomaly detection types include point anomalies, contextual anomalies, and global anomalies. Currently, most successful anomaly detections are performed on point anomalies and contextual anomalies, while there are fewer works on the detection of overall time series anomalies.
[0007] It can be seen that there is an urgent need for a deep clustering method with higher classification accuracy and adaptability for bridge time series anomaly classification. Summary of the invention
[0008] In view of this, an embodiment of the present invention provides a deep clustering method for bridge time series anomaly classification, which at least partially solves the problems of poor classification accuracy and adaptability in the prior art.
[0009] The embodiment of the present invention provides a deep clustering method for bridge time series anomaly classification, comprising:
[0010] Step 1, obtaining sample time series data of the bridge collected by multiple sensors and performing preprocessing;
[0011] Step 2, constructing an autoencoder module based on a convolutional neural network and a long short-term memory neural network, wherein the autoencoder module includes an encoder and two decoders;
[0012] Step 3, input the preprocessed sample time series data into the encoder for two-stage autoencoder training;
[0013] Step 4, use the trained encoder to extract feature information and kl divergence loss function to train the clusterer;
[0014] Step 5: Combine the loss function of the two-stage autoencoder training and the KL divergence loss function to obtain the fusion loss function, and train the encoder again based on it, and form a classification model with the trained encoder and the trained clusterer;
[0015] Step 6: Collect target time series data corresponding to multiple sensors on the target bridge and input them into the classification model to obtain classification results.
[0016] According to a specific implementation of the embodiment of the present invention, step 1 specifically includes:
[0017] Step 1.1, directly discard the subsequences whose data missing length exceeds half of the preset sequence length;
[0018] Step 1.2, for subsequences whose data length does not exceed half of the preset sequence length, forward value padding is used;
[0019] Step 1.3: For each subsequence with missing timestamp data, fill it with random data.
[0020] According to a specific implementation of an embodiment of the present invention, the encoder includes a one-dimensional convolutional layer, two single long short-term memory neural networks and a linear fully connected layer, the convolution kernel of the convolutional layer is 3, and after the convolution operation, it passes through a relu activation layer and then passes through a maximum pooling layer with a scale of 2. The input size of the first single long short-term memory neural network is the number of output channels of the one-dimensional convolutional layer, and the output is half of the input. The input of the second single long short-term memory neural network is the output of the first single long short-term memory neural network, and the output is a set hidden size. The input of the linear fully connected layer is the size after the convolution of the convolution encoder, and the output is the set hidden size. Finally, a relu activation layer is connected;
[0021] The decoder includes a linear layer and a one-dimensional deconvolution layer. The input size of the linear layer is the output size of the linear fully connected layer of the encoder, and the output is the size of the encoder's one-dimensional convolutional layer after convolution multiplied by a preset hidden layer size. The input size of the one-dimensional deconvolution layer is the output size of the linear layer of the decoder, and the output size is the output size of the encoder. The convolution kernel is 3, the step size is 1, the padding is 1, and the anti-padding is 1.
[0022] According to a specific implementation of the embodiment of the present invention, step 3 specifically includes:
[0023] Step 3.1, inputting the preprocessed sample time series data into the encoder, obtaining an output recorded as an embedded code, inputting the embedded code into a first decoder to obtain a first decoding result, and inputting the embedded code into a second decoder to obtain a second decoding result;
[0024] Step 3.2, inputting the first decoding result into the encoder, and inputting the embedded encoding of the first decoding by the encoder into the second decoder to obtain a third decoding result;
[0025] Step 3.3, calculating the loss function of the two stages according to the first decoding result, the second decoding result and the third decoding result;
[0026] Step 3.4: Repeat steps 3.1 to 3.3 until the second-stage loss function becomes stable and a trained encoder is obtained.
[0027] According to a specific implementation of an embodiment of the present invention, the expression of the two-stage loss function is:
[0028]
[0029] in, Indicates two stages through the first decoder, It indicates that the two stages pass through the second decoder, n indicates the current training round, decoed1 indicates the first decoding result, decoed2 indicates the second decoding result, decoed2_2 indicates the third decoding result, and X indicates the preprocessed sample time series data.
[0030] According to a specific implementation of the embodiment of the present invention, step 4 specifically includes:
[0031] Step 4.1: Use K-means clustering method to initialize the cluster center of feature information and determine K cluster centers, denoted as {c1, c2, ..., c k}, where the number of clusters K is the number of categories contained in the sample time series data;
[0032] Step 4.2, using the T distribution in statistics, the probability of belonging to each category is calculated based on the distance between the encoder's feature vector and the cluster center. The specific calculation formula is:
[0033]
[0034] Among them, z i represents the hidden feature information obtained by the encoder of the i-th time series sample, c jrepresents the cluster center of the jth cluster, q ij Indicates z i The probability of belonging to the jth cluster;
[0035] Step 4.3: For a sample of time series data, the feature information obtained by the encoder is determined by determining its corresponding probability q ij Then, for the probability q ij , calculate the probability p that the feature information in each cluster should be attracted by the cluster ij , the specific calculation formula is:
[0036]
[0037] Among them, p ij It indicates the probability that the feature information obtained by the encoder of the i-th time series sample is attracted by the j-th cluster;
[0038] Step 4.4, the probability q ij and probability p ij The kl divergence between is used as the kl divergence loss function of the clusterer, and the expression of the kl divergence loss function is:
[0039]
[0040] Among them, P represents a probability distribution, where p ij , represents the probability that the i-th time series sample belongs to the j-th cluster, Q represents another probability distribution, where q ij , represents the probability that the feature information obtained by the encoder of the i-th time series sample is attracted by the j-th cluster;
[0041] Step 4.5, update the cluster center by backpropagation according to the KL divergence loss function.
[0042] According to a specific implementation of the embodiment of the present invention, the expression of the fusion loss function is:
[0043] L=L AE +L c .
[0044] According to a specific implementation of the embodiment of the present invention, step 6 specifically includes:
[0045] Step 6.1, input the target time series data into the encoder to obtain feature information;
[0046] Step 6.2, use K-means clustering method to initialize the cluster center of feature information and obtain the number of cluster centers;
[0047] Step 6.3, using the T distribution in statistics, calculate the probability that the feature information corresponding to the target time series data belongs to each cluster center according to the distance between the feature information of the encoder and the cluster center;
[0048] Step 6.4: Use a clusterer to convert the probability that the feature information corresponding to the target time series data belongs to each cluster center into an integer label, and use the label as the classification result.
[0049] The deep clustering scheme for bridge time series anomaly classification in the embodiment of the present invention includes: step 1, obtaining sample time series data of the bridge collected by multiple sensors and preprocessing; step 2, constructing an autoencoder module based on a convolutional neural network and a long short-term memory neural network, wherein the autoencoder module includes an encoder and two decoders; step 3, inputting the preprocessed sample time series data into the encoder for two-stage autoencoder training; step 4, using the trained encoder to extract feature information and the kl divergence loss function to train the clusterer; step 5, combining the loss function of the two-stage autoencoder training and the kl divergence loss function to obtain a fusion loss function, and training the encoder again based on it, and forming a classification model with the trained encoder and the trained clusterer; step 6, collecting the target time series data corresponding to multiple sensors on the target bridge and inputting it into the classification model to obtain a classification result.
[0050] The beneficial effects of the embodiments of the present invention are as follows: through the scheme of the present invention, two bidirectional LSTM algorithms are used as encoders, and then two bidirectional LSTMs are used as decoders to reconstruct the data sequence, and k-means is used as a clustering tool to cluster the output Z obtained by the encoder, and the reconstruction loss of the encoder and decoder and the KL divergence loss for measuring the clustering effect are used to jointly optimize the encoder parameter weights, so that the entire time series data collected by the trigger sensor can be clustered more efficiently, and only less domain knowledge is needed for the clustering results to judge the abnormal time series segments in the cluster, thereby improving the classification accuracy and adaptability. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0052] Figure 1 A schematic flow chart of a deep clustering method for bridge time series anomaly classification provided by an embodiment of the present invention;
[0053] Figure 2A schematic diagram of a model training process of a deep clustering method for bridge time series anomaly classification provided by an embodiment of the present invention;
[0054] Figure 3 A framework diagram of a model training process of a deep clustering method for bridge time series anomaly classification provided by an embodiment of the present invention;
[0055] Figure 4 A real-time classification process framework diagram provided by an embodiment of the present invention;
[0056] Figure 5 A schematic diagram of a flow chart of a real-time classification process provided by an embodiment of the present invention;
[0057] Figure 6 A single sensor clustering visualization result diagram provided by an embodiment of the present invention;
[0058] Figure 7 Another single sensor clustering visualization result diagram provided by an embodiment of the present invention;
[0059] Figure 8 A multidimensional data clustering visualization result diagram provided by an embodiment of the present invention;
[0060] Fig. 9 Another multidimensional data clustering visualization result diagram provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0061] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0062] The following describes the embodiments of the present invention through specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work belong to the scope of protection of the present invention.
[0063] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein can be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present invention, it should be understood by those skilled in the art that an aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects described herein can be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein can be used to implement this device and / or practice this method.
[0064] It should also be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention. The drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0065] Additionally, in the following description, specific details are provided to facilitate a thorough understanding of the examples. However, it will be understood by those skilled in the art that the aspects described may be practiced without these specific details.
[0066] An embodiment of the present invention provides a deep clustering method for bridge time series anomaly classification, which can be applied in the bridge monitoring process.
[0067] See also Figure 1 , is a flow chart of a deep clustering method for bridge time series anomaly classification provided by an embodiment of the present invention. Figure 1 As shown, the method mainly comprises the following steps:
[0068] Step 1, obtaining sample time series data of the bridge collected by multiple sensors and performing preprocessing;
[0069] Furthermore, the step 1 specifically includes:
[0070] Step 1.1, directly discard the subsequences whose data missing length exceeds half of the preset sequence length;
[0071] Step 1.2, for subsequences whose data length does not exceed half of the preset sequence length, forward value padding is used;
[0072] Step 1.3: For each subsequence with missing timestamp data, fill it with random data.
[0073] The data format requirements of the present invention are as follows: the data format to be processed is time series data with a fixed length collected by trigger sensing. Given a sensor SR ( S enso R ), set the trigger threshold to thd (threshold), the acquisition length seq (sequences), trigger acquisition when the sensor value val is greater than or less than thd, and collect data X, X = (x1, x2, x3..., x t ,…,x seq ).
[0074] One acquisition is a sample. The data collected by a sensor is a group of samples or a variable. The data shape is expressed as xshape = (n_samples, seq), where n_samples represents the number of samples collected by a sensor, and seq represents the length of a sample collection. Taking a sensor with a collection frequency of 50Hz as an example, assuming that the collection time is set to 60 seconds, the length of the collected sequence is the frequency multiplied by the time, that is, seq = 300.
[0075] The data shape of multiple sensors is expressed as inputx=(SRs, n_samples, seq), where SRs represents the number of sensors.
[0076] In the specific implementation, the data collected from the sensor may have inconsistent lengths due to network or sensor factors. Therefore, it is necessary to fill or discard the subsequences that do not meet the preset length. The specific process can be as follows:
[0077] Subsequences with missing data length exceeding 1 / 2 are directly discarded; for example, if the subsequence length is set to 100 and the actual collected length is less than 50, it is directly discarded.
[0078] For subsequences whose data length does not exceed 1 / 2, forward value padding is used.
[0079] Since the first step may have a missing length of more than 1 / 2, there may also be misalignment of time series samples in multiple sensors. Time series samples are time-aligned, and each subsequence of data collection has a timestamp. For the exact timestamp, random data is used to fill it.
[0080] Step 2, constructing an autoencoder module based on a convolutional neural network and a long short-term memory neural network, wherein the autoencoder module includes an encoder and two decoders;
[0081] Furthermore, the encoder includes a one-dimensional convolutional layer, two single long short-term memory neural networks and a linear fully connected layer, the convolution kernel of the convolutional layer is 3, after the convolution operation, it passes through a relu activation layer, and then passes through a maximum pooling layer with a scale of 2, the input size of the first single long short-term memory neural network is the number of output channels of the one-dimensional convolutional layer, and the output is half of the input, the input of the second single long short-term memory neural network is the output of the first single long short-term memory neural network, and the output is a set hidden size, the input of the linear fully connected layer is the size after the convolution of the convolution encoder, and the output is a set hidden size, and finally a relu activation layer is connected;
[0082] The decoder includes a linear layer and a one-dimensional deconvolution layer. The input size of the linear layer is the output size of the linear fully connected layer of the encoder, and the output is the size of the encoder's one-dimensional convolutional layer after convolution multiplied by a preset hidden layer size. The input size of the one-dimensional deconvolution layer is the output size of the linear layer of the decoder, and the output size is the output size of the encoder. The convolution kernel is 3, the step size is 1, the padding is 1, and the anti-padding is 1.
[0083] When implementing it, Figure 2 As shown, an autoencoder module can be constructed based on a convolutional neural network and a long short-term memory neural network for training. The structure of the autoencoder module is as follows Figure 3 As shown in the figure, the encoder consists of a one-dimensional convolutional layer, two single LSTMs, and a linear fully connected layer. The convolution kernel of the convolution layer is 3. After the convolution operation, it passes through a relu activation layer and then a maximum pooling layer with a scale of 2; the input size of the first LSTM layer is the number of output channels of the encoder convolution layer, and the output is 1 / 2 of the input; the input of the first LSTM is the input of the first LSTM, and the output is the set hidden size; the input of the fully connected layer is the size after the convolution of the convolution encoder, and the calculation formula is "(input size-convolution kernel size+2*padding) / step size+1", and the output is the set hidden size, and finally passes through a relu activation layer.
[0084] The decoder consists of two independent decoders, each of which consists of a linear layer and a one-dimensional deconvolution. The input size of the linear layer is the output size of the encoder's linear layer, and the output is the size of the encoder's convolutional layer multiplied by the preset hidden layer size. The input size of the one-dimensional deconvolution layer is the output size of the decoder's linear layer, and the output size is the output size of the encoder. The convolution kernel is 3, the stride is 1, the padding is 1, and the anti-padding is 1.
[0085] Step 3, input the preprocessed sample time series data into the encoder for two-stage autoencoder training;
[0086] Based on the above embodiment, step 3 specifically includes:
[0087] Step 3.1, inputting the preprocessed sample time series data into the encoder, obtaining an output recorded as an embedded code, inputting the embedded code into a first decoder to obtain a first decoding result, and inputting the embedded code into a second decoder to obtain a second decoding result;
[0088] Step 3.2, inputting the first decoding result into the encoder, and inputting the embedded encoding of the first decoding by the encoder into the second decoder to obtain a third decoding result;
[0089] Step 3.3, calculating the loss function of the two stages according to the first decoding result, the second decoding result and the third decoding result;
[0090] Step 3.4: Repeat steps 3.1 to 3.3 until the second-stage loss function becomes stable and a trained encoder is obtained.
[0091] Furthermore, the expression of the two-stage loss function is
[0092]
[0093] in, Indicates two stages through the first decoder, It indicates that the two stages pass through the second decoder, n indicates the current training round, decoed1 indicates the first decoding result, decoed2 indicates the second decoding result, decoed2_2 indicates the third decoding result, and X indicates the preprocessed sample time series data.
[0094] In the specific implementation, the training data is input. The pre-processed data obtained in step 1 of the present invention is sent to the encoder of the self-encoder constructed in step 2. The rest of the process is described as the self-encoder training process in step 3.
[0095] Autoencoder training. The training of autoencoder consists of two stages. In the first stage, the original single-dimensional or multi-dimensional sample X is input into the constructed model encoder to obtain the output recorded as embed, and the embedded is sent to the following Figure 2 The outputs of decoder 1 and decoder 2 are recorded as decoed1 and decoded2 respectively; in the second stage, the output decoed1 of decoder 1 is sent to the encoder again to obtain the output recorded as embed2; embed2 is sent to decoder 2 to obtain the output decoded2_2. The loss of the two stages is expressed as:
[0096]
[0097]
[0098] in, Indicates two stages through decoder 1, Indicates that the two stages pass through the decoder 2, and n represents the current training round. In the pre-training process, this method sums the losses of the two parts in the autoencoder part until the loss tends to be stable or reaches the maximum number of iterations, then stops the training of the autoencoder.
[0099] Step 4, use the trained encoder to extract feature information and kl divergence loss function to train the clusterer;
[0100] Based on the above embodiment, step 4 specifically includes:
[0101] Step 4.1: Use K-means clustering method to initialize the cluster center of feature information and determine K cluster centers, denoted as {c1, c2, ..., c k}, where the number of clusters K is the number of categories contained in the sample time series data;
[0102] Step 4.2, using the T distribution in statistics, the probability of belonging to each category is calculated based on the distance between the encoder's feature vector and the cluster center. The specific calculation formula is:
[0103]
[0104] Among them, z i represents the hidden feature information obtained by the encoder of the i-th time series sample, c j represents the cluster center of the jth cluster, q ij Indicates z i The probability of belonging to the jth cluster;
[0105] Step 4.3: For a sample of time series data, the feature information obtained by the encoder is determined by determining its corresponding probability q ij Then, for the probability q ij , calculate the probability p that the feature information in each cluster should be attracted by the cluster ij , the specific calculation formula is:
[0106]
[0107] Among them, p ij It indicates the probability that the feature information obtained by the encoder of the i-th time series sample is attracted by the j-th cluster;
[0108] Step 4.4, the probability q ij and probability p ij The kl divergence between is used as the kl divergence loss function of the clusterer, and the expression of the kl divergence loss function is:
[0109]
[0110] Among them, P represents a probability distribution, where p ij , represents the probability that the i-th time series sample belongs to the j-th cluster, Q represents another probability distribution, where q ij , represents the probability that the feature information obtained by the encoder of the i-th time series sample is attracted by the j-th cluster;
[0111] Step 4.5, update the cluster center by backpropagation according to the KL divergence loss function.
[0112] In specific implementation, the process of building a clusterer and training can be as follows:
[0113] 1) Use K-means clustering method to initialize the cluster center of feature information. Determine K cluster centers, denoted as {c1, c2, …, c k}, where the number of clusters K is the number of categories contained in the time series data set.
[0114] 2) After the cluster center is determined, the T distribution in statistics is used to calculate the probability of belonging to each class according to the distance between the encoder's feature vector and the cluster center, and normalization is performed to calculate the P distribution and q distribution of the characteristic information, that is, the probability q of the input sample cluster being divided into K clusters after the characteristic information corresponding to the encoder is calculated. The specific calculation formula is
[0115]
[0116] Among them, z i represents the hidden feature information obtained by the encoder of the i-th time series sample, c j represents the cluster center of the jth cluster, q ij Indicates z i The probability of belonging to the jth cluster.
[0117] 3) For the feature information obtained by the encoder for a time series sample, after determining its corresponding probability q, the probability p that the feature information in each cluster should be attracted by the cluster is calculated based on the probability q. The specific calculation formula is:
[0118]
[0119] Among them, p ij It represents the probability that the feature information obtained by the encoder of the i-th time series sample is attracted by the j-th cluster. In essence, p i and q i are all probability distributions of the feature information of image i based on the clustering results, and q ij It is right ijAn expected probability of the proportion of probability in each cluster.
[0120] 4) The KL divergence between probability q and probability p is used as the loss of the clusterer. The KL loss calculation formula is expressed as:
[0121]
[0122] 5) Update the cluster centers based on the KL divergence loss back-propagation.
[0123] Step 5: Combine the loss function of the two-stage autoencoder training and the KL divergence loss function to obtain the fusion loss function, and train the encoder again based on it, and form a classification model with the trained encoder and the trained clusterer;
[0124] Furthermore, the expression of the fusion loss function is:
[0125] L=L AE +L c .
[0126] In the specific implementation, fusion training. After the autoencoder training in step 3, the encoder can extract some main features of the time series data for clustering, but the clustering accuracy is still low. The fusion clusterer optimization training method is adopted to update the autoencoder to further improve the clustering accuracy of the clusterer.
[0127] Fusion loss. If only the autoencoder loss is optimized, the clustering information will be ignored. The KL loss of clustering is added to optimize the autoencoder to extract features so that the autoencoder can consider clustering features. The joint loss is expressed as:
[0128] L=L AE +L c
[0129] Optimization goal. The goal of optimization is to minimize the value of the loss function. During the joint training process, the loss value approaches a minimum value, but it seems that it cannot reach the minimum value. In the present invention, when the change of the loss value is set to be less than 0.00001 within 20 training cycles, the optimization of the model of the present invention is stopped. The setting of less than 0.00001 within 20 training cycles assumes that the model can no longer learn the characteristics of the data. After the encoder and clusterer are trained, they are formed into a classification model.
[0130] Step 6: Collect target time series data corresponding to multiple sensors on the target bridge and input them into the classification model to obtain classification results.
[0131] Based on the above embodiment, step 6 specifically includes:
[0132] Step 6.1, input the target time series data into the encoder to obtain feature information;
[0133] Step 6.2, use K-means clustering method to initialize the cluster center of feature information and obtain the number of cluster centers;
[0134] Step 6.3, using the T distribution in statistics, calculate the probability that the feature information corresponding to the target time series data belongs to each cluster center according to the distance between the feature information of the encoder and the cluster center;
[0135] Step 6.4: Use a clusterer to convert the probability that the feature information corresponding to the target time series data belongs to each cluster center into an integer label, and use the label as the classification result.
[0136] When implementing it, Figure 4 As shown in the figure, when the time series data of the target bridge needs to be classified, the target time series data corresponding to multiple sensors on the target bridge can be collected and input into the classification model. The encoder extracts the feature information of the target time series and inputs it into the clusterer. The probability that the feature information corresponding to the target time series data belongs to each cluster center is calculated based on the distance between the feature vector of the encoder and the cluster center, and then the clusterer converts it into an integer 0, 1 label as output. The 0, 1 label is the final clustering result.
[0137] The deep clustering method for bridge time series anomaly classification provided in this embodiment uses two bidirectional LSTM algorithms as encoders and two bidirectional LSTMs as decoders to reconstruct the data sequence, uses k-means as a clustering tool to cluster the output Z obtained by the encoder, uses the reconstruction loss of the encoder and decoder and the KL divergence loss that measures the clustering effect, and jointly optimizes the encoder parameter weights. It can more efficiently cluster the entire time series data collected by the trigger sensor, and only requires less domain knowledge for the clustering results to judge the abnormal time series segments in the cluster, thereby improving the classification accuracy and adaptability.
[0138] The present solution will be further described below in conjunction with a specific embodiment. The test data is collected from the monitoring data of a high-speed railway bridge in area A, and mainly includes data from two simply supported bridges and monitoring data from the transition section of the bridge. Among them, the simply supported bridge data mainly include track plate displacement, beam amplitude, track plate vibration acceleration, beam mid-span dynamic deflection, beam mid-span dynamic strain, support displacement, beam end displacement, etc. The transition section data mainly includes measurement indicators such as track plate displacement, track plate vibration acceleration, and longitudinal displacement of the bottom of the beam. One measurement indicator may correspond to multiple sensors. The test accuracy is to construct a small number of test samples with the help of knowledge provided by experts in the field to test the efficiency of this method.
[0139] The process of this experiment is as follows Figure 5The output of the model is the collected multi-dimensional sensor data (one-dimensional is a special case of multi-dimensional). First, it goes through the data preprocessing part, which mainly filters or fills in missing and incomplete data; then it goes through the encoder module to extract the feature information of the data; then it goes through the clusterer to calculate the probability that the extracted feature information belongs to a certain category; finally, it goes through the output clustering label module to obtain the data label.
[0140] 1) Single sensor classification implementation: This method performs two types of clustering on a single sensor, and the classification accuracy on the track plate displacement and track plate vibration acceleration sensors can reach 98.12%.
[0141] Track plate displacement is a single sensor clustering result as follows Figure 6 As shown, (a) is a normal visualization diagram of track plate displacement, with output label 0, and (b) is an abnormal visualization diagram of track plate displacement, with output label 1.
[0142] The vibration acceleration of the track plate is a single sensor clustering result as follows Figure 7 As shown, (a) is a normal visualization of orbital acceleration, with output label 0, and (b) is an abnormal visualization of orbital acceleration, with output label 1.
[0143] 2) Multi-sensor classification implementation. Two types of clustering are performed on multiple sensors. The results are as follows: Figure 8 and Fig. 9 As shown, the clustering accuracy can reach 88.23%.
[0144] It should be understood that various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof.
[0145] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A deep clustering method for bridge time series anomaly classification, characterized in that: include: Step 1, obtaining sample time series data of the bridge collected by multiple sensors and performing preprocessing; Step 2, constructing an autoencoder module based on a convolutional neural network and a long short-term memory neural network, wherein the autoencoder module includes an encoder and two decoders; Step 3, input the preprocessed sample time series data into the encoder for two-stage autoencoder training; Step 4, use the trained encoder to extract feature information and kl divergence loss function to train the clusterer; Step 5: Combine the loss function of the two-stage autoencoder training and the KL divergence loss function to obtain the fusion loss function, and train the encoder again based on it, and form a classification model with the trained encoder and the trained clusterer; Step 6: Collect target time series data corresponding to multiple sensors on the target bridge and input them into the classification model to obtain classification results.
2. The method according to claim 1, characterized in that , the step 1 specifically includes: Step 1.1, directly discard the subsequences whose data missing length exceeds half of the preset sequence length; Step 1.2, for subsequences whose data length does not exceed half of the preset sequence length, forward value padding is used; Step 1.3: For each subsequence with missing timestamp data, fill it with random data.
3. The method according to claim 2, characterized in that The encoder includes a one-dimensional convolutional layer, two single long short-term memory neural networks and a linear fully connected layer. The convolution kernel of the convolutional layer is 3. After the convolution operation, it passes through a relu activation layer and then a maximum pooling layer with a scale of 2. The input size of the first single long short-term memory neural network is the number of output channels of the one-dimensional convolutional layer, and the output is half of the input. The input of the second single long short-term memory neural network is the output of the first single long short-term memory neural network, and the output is the set hidden size. The input of the linear fully connected layer is the size after the convolution of the convolution encoder, and the output is the set hidden size. Finally, a relu activation layer is connected; The decoder includes a linear layer and a one-dimensional deconvolution layer. The input size of the linear layer is the output size of the linear fully connected layer of the encoder, and the output is the size of the encoder's one-dimensional convolutional layer after convolution multiplied by a preset hidden layer size. The input size of the one-dimensional deconvolution layer is the output size of the linear layer of the decoder, and the output size is the output size of the encoder. The convolution kernel is 3, the step size is 1, the padding is 1, and the anti-padding is 1.
4. The method according to claim 3, characterized in that , the step 3 specifically includes: Step 3.1, inputting the preprocessed sample time series data into the encoder, obtaining an output recorded as an embedded code, inputting the embedded code into a first decoder to obtain a first decoding result, and inputting the embedded code into a second decoder to obtain a second decoding result; Step 3.2, inputting the first decoding result into the encoder, and inputting the embedded encoding of the first decoding by the encoder into the second decoder to obtain a third decoding result; Step 3.3, calculating the loss function of the two stages according to the first decoding result, the second decoding result and the third decoding result; Step 3.4: Repeat steps 3.1 to 3.3 until the second-stage loss function becomes stable and a trained encoder is obtained.
5. The method according to claim 4, characterized in that , the expression of the two-stage loss function is in, Indicates two stages through the first decoder, It indicates that the two stages pass through the second decoder, n indicates the current training round, decoed1 indicates the first decoding result, decoed2 indicates the second decoding result, decoed2_2 indicates the third decoding result, and X indicates the preprocessed sample time series data.
6. The method according to claim 5, characterized in that , the step 4 specifically includes: Step 4.1: Use K-means clustering method to initialize the cluster center of feature information and determine K cluster centers, denoted as {c1, c2, ..., c k }, where the number of clusters K is the number of categories contained in the sample time series data; Step 4.2, using the T distribution in statistics, the probability of belonging to each category is calculated based on the distance between the encoder's feature vector and the cluster center. The specific calculation formula is: Among them, z i represents the hidden feature information obtained by the encoder of the i-th time series sample, c j represents the cluster center of the jth cluster, q ij Indicates z i The probability of belonging to the jth cluster; Step 4.3: For a sample of time series data, the feature information obtained by the encoder is determined by determining its corresponding probability q ij Then, for the probability q ij , calculate the probability p that the feature information in each cluster should be attracted by the cluster ij , the specific calculation formula is: Among them, p ij It indicates the probability that the feature information obtained by the encoder of the i-th time series sample is attracted by the j-th cluster; Step 4.4, the probability q ij and probability p ij The kl divergence between is used as the kl divergence loss function of the clusterer, and the expression of the kl divergence loss function is: Among them, P represents a probability distribution, where p ij , represents the probability that the i-th time series sample belongs to the j-th cluster, Q represents another probability distribution, where q ij , represents the probability that the feature information obtained by the encoder of the i-th time series sample is attracted by the j-th cluster; Step 4.5, update the cluster center by backpropagation according to the KL divergence loss function.
7. The method according to claim 6, characterized in that , the expression of the fusion loss function is L=L AE +L c .
8. The method according to claim 7, characterized in that , the step 6 specifically includes: Step 6.1, input the target time series data into the encoder to obtain feature information; Step 6.2, use K-means clustering method to initialize the cluster center of feature information and obtain the number of cluster centers; Step 6.3, using the T distribution in statistics, calculate the probability that the feature information corresponding to the target time series data belongs to each cluster center according to the distance between the feature information of the encoder and the cluster center; Step 6.4: Use a clusterer to convert the probability that the feature information corresponding to the target time series data belongs to each cluster center into an integer label, and use the label as the classification result.
Citation Information
Cited By
Periodic time series data analysis and treatment method and product
CN119248760A
Multi-view cancer subtype data clustering method based on convolutional auto-encoder and knowledge distillation
CN119252497A
Bridge wind field change mode prediction method based on LSTM depth embedded clustering model
CN119989932A
Nerve patient rehabilitation training method based on task training and brain-computer interaction
CN121034540A
