Abnormality detection method and system based on Bi-LSTM and ST-GCN
Through the joint optimization training of Bi-LSTM and ST-GCN, the problem of bridge damage identification was solved, accurate monitoring and early warning of bridge structures were achieved, and the accuracy and reliability of detection were improved.
Patent Information
- Application Number
- CN202510682283.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-26
- Publication Date
- 2025-09-26
AI Technical Summary
Existing technologies make it difficult to accurately identify bridge damage from standardized sensors. Traditional methods make it difficult to identify structural damage, and damage to existing bridges is particularly difficult to identify.
An anomaly detection method based on Bi-LSTM and ST-GCN is adopted. By standardizing the arrangement of sensors on the bridge, time series data is obtained and preprocessed. The joint optimization training of Bi-LSTM and ST-GCN is used to extract sensor time series features, identify the connection relationship between nodes, and perform damage detection and early warning.
It achieves precise monitoring and early warning of bridge structure damage, improves the accuracy and reliability of detection, and avoids the shortcomings of traditional methods.
Smart Images

Figure CN120705756A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of civil engineering structure health monitoring, and specifically relates to an anomaly detection method and system based on Bi-LSTM and ST-GCN. Background Art
[0002] As a vital transportation hub, the structural safety of bridges is directly linked to the safety of people's lives and property. However, over the long term, bridge structures can gradually degrade and even become damaged due to various factors, including traffic loads, the natural environment, and material aging. While damage to existing bridges can be difficult to identify, this can be achieved by deploying numerous sensors throughout the bridges to identify structural differences.
[0003] Traditional bridge deflection monitoring methods often rely on placing sensors at key interfaces. By monitoring these interfaces, the structural safety is guaranteed by ensuring that the sensor values at key locations are within a safe range. However, this method inevitably fails to identify structural damage. Cable tension sensors in tied-arch bridges are arranged in a standardized pattern throughout the bridge, allowing them to detect changes in the overall structure. However, accurately identifying bridge damage from these standardized sensor patterns remains an urgent challenge. Summary of the Invention
[0004] The technical problem to be solved by the present invention is to provide an anomaly detection method and system based on Bi-LSTM and ST-GCN for monitoring whether there is damage to the bridge structure.
[0005] The technical solution adopted by the present invention to solve the above technical problems is: an anomaly detection method based on Bi-LSTM and ST-GCN, comprising the following steps: S1: Arrange sensors in a standardized manner on the bridge, acquire time series data and perform preprocessing; S2: After training Bi-LSTM and ST-GCN separately, perform joint optimization training; S3: Input the preprocessed time series data into the trained Bi-LSTM, obtain the hidden state at the intermediate moment through the forward LSTM and backward LSTM, and perform feature mapping and dimensionality reduction on the hidden state to obtain the sensor time series features; S4: Input sensor private features as node features into ST-GCN, and use dynamic adjacency matrix and temporal attention mechanism to identify the connection relationship between nodes; S5: Analyze connection relationships and perform damage detection and early warning.
[0006] According to the above scheme, in step S1, the specific steps are: S11: Install cable force sensors at each suspender anchor point of the tied arch bridge, number them according to the spatial topology, record the three-dimensional coordinates of each sensor, and construct a static adjacency matrix to indicate whether two sensors are physically adjacent; S12: Divide the time series data at different locations in the same time period into one sample, which is used to distinguish the differences in sensor spatial features later; S13: Preprocess the data.
[0007] Furthermore, in step S13, the specific steps are: S131: Z-score normalization is performed on the time series data of each sensor separately; S132: Performing two enhancements on the sensor's time series data to generate positive samples including first-enhanced data and second-enhanced data. The first-enhanced data is obtained by cropping the time series data and interpolating it to its original length, and is used to increase local signal fluctuations. The second-enhanced data is obtained by increasing the standard deviation of Gaussian noise, and is used to increase sensor measurement noise. S133: constructing positive and negative sample pairs for the time series data of different sensors, where the positive samples are enhanced samples of samples at the same moment in the same sensor, and the negative samples are samples at the same moment in sensors of different categories.
[0008] Furthermore, in step S2, the specific steps are: S21: Freeze the parameters of ST-GCN, build and train the Bi-LSTM, and set the loss function of the Bi-LSTM. S22: Freeze the parameters of BI-LSTM, build and train ST-GCN, and set the loss function of ST-GCN; S23: Unfreeze all parameters and perform joint optimization training on Bi-LSTM and ST-GCN; set the loss function to the weighted sum of the Bi-LSTM loss function and the ST-GCN loss function.
[0009] Furthermore, in step S21, the specific steps are: S211: Build the Bi-LSTM network architecture, including the input layer, Bi-LSTM layer, and mapping layer; The input layer data is the positive and negative sample pairs constructed by preprocessing; The Bi-LSTM layer consists of three layers of bidirectional LSTM, with the number of hidden units being 256, 128, and 64 respectively, and the output after concatenation is a 128-dimensional feature; The mapping layer is a fully connected layer, which is used to compress the 128-dimensional features into 64 dimensions, of which 32 dimensions are private features related to the sensor identity and the other 32 dimensions are shared features related to the environmental load; S212: The Bi-LSTM loss function uses a decoupled contrast loss that includes a private feature comparison term and a shared feature comparison term. The private feature comparison term is used to enhance the similarity of features of similar sensors and to enhance the differences of features of different sensors. The shared feature comparison term is used to enhance the consistency of temporal patterns across sensors. The loss weight hyperparameter is set to prioritize sensor identity differentiation. The temperature coefficient gradually decays with training. S213: Use AdamW as the optimizer for the Bi-LSTM neural network. Set the training configuration including learning rate, batch size, maximum training rounds, and loss weight. The input data is multi-sensor time series data.
[0010] Furthermore, in step S22, the specific steps are: S221: Build the network architecture of ST-GCN, input the sensor private features extracted by pre-trained Bi-LSTM, use spatiotemporal graph convolution and temporal attention mechanism, and output the connection probability between nodes through MLP decoder; S222: The loss function of ST-GCN adopts a topology-preserving loss that includes a static topology constraint term and a dynamic smoothness constraint term. The static topology constraint term is used to maintain physical adjacency; the dynamic smoothness constraint term is used to suppress abnormal mutations; and the loss weight hyperparameter is set to strengthen the physical topology constraint. S223: Use RAdam as the optimizer for ST-GCN and set the training configuration including learning rate, training batch size, number of training rounds, and loss weight.
[0011] According to the above scheme, in step S3, the specific steps are: The preprocessed positive and negative sample pairs are processed separately by forward LSTM and backward LSTM, and the hidden states at different moments are calculated independently. For each time step, the hidden state at a certain moment in the forward direction and the hidden state at a certain moment in the reverse direction are concatenated to obtain the hidden state at a certain moment. The hidden state at the intermediate moment is input into the fully connected layer for feature mapping and dimensionality reduction to generate a high-level temporal feature representation.
[0012] According to the above scheme, in step S4, the specific steps are: S41: Compute spatiotemporal graph convolution of nodes and first-order neighbors; S42: Fusion of spatial features at different time steps to obtain spatiotemporal aggregation features to capture long-term temporal dependencies; S43: Identify the edges between nodes based on spatiotemporal aggregation features and predict the connection probability of node pairs.
[0013] According to the above scheme, in step S5, the specific steps are: S51: setting different thresholds for damage determination of the identified dynamic adjacency matrix, thereby determining the strength of the connection relationship between nodes; S52: Calculate the Mahalanobis distance between the private feature generated by the Bi-LSTM and the historical mean, and determine whether a sensor fault occurs based on the comparison result of the Mahalanobis distance and the threshold; S53: The overall features generated by Bi-LSTM are input into ST-GCN to predict the dynamic adjacency probability and output the dynamic adjacency matrix; the connected domain analysis is performed on the abnormal edges, and the presence of structural damage is determined based on the number of sensors contained in the area.
[0014] An anomaly detection system based on Bi-LSTM and ST-GCN, The data acquisition submodule is used to arrange sensors in a standardized manner on the bridge, acquire time series data and perform preprocessing; The model training submodule is used to train Bi-LSTM and ST-GCN separately and then perform joint optimization training; The feature acquisition submodule is used to input the preprocessed time series data into the trained Bi-LSTM, obtain the hidden state of the intermediate moment through the forward LSTM and backward LSTM, and perform feature mapping and dimensionality reduction on the hidden state to obtain the sensor time series features; The prediction and recognition submodule is used to input sensor-specific features as node features into ST-GCN and use the dynamic adjacency matrix and temporal attention mechanism to identify the connection relationship between nodes; The damage detection submodule is used to analyze connection relationships and perform damage detection and early warning.
[0015] The beneficial effects of the present invention are: 1. The present invention proposes an anomaly detection method and system based on Bi-LSTM and ST-GCN. For tied-arch bridges, Bi-LSTM is used to extract sensor time series features. The sensor-specific features are used as node features in the ST-GCN neural network, and the spatial positions of different sensors are identified through ST-GCN. Finally, the identified spatial positions are analyzed and adaptive warnings are issued, thus enabling the monitoring of whether the bridge structure is damaged.
[0016] 2. Based on the "point-line-surface" three-level detection mechanism, this paper constructs a spatiotemporal joint modeling framework for bridge health monitoring by phased fusion of bidirectional LSTM (Bi-LSTM) and spatiotemporal graph convolutional network (ST-GCN). The framework uses Bi-LSTM to identify single sensor hardware failures, separates shared features from sensor-specific features from multi-sensor time series data, and enhances sensor identity discrimination through decoupling contrast loss, suppressing interference factors such as temperature. ST-GCN employs a temporal attention mechanism to capture spatial topological associations and long-term temporal dependencies between sensors, analyzes connection probability anomalies under static adjacency relationships, and locates multi-node collaborative anomaly areas through a connected domain algorithm, thereby accurately positioning local damage (such as hanger fractures) and global anomalies (such as bridge deck settlement).
[0017] 3. Compared with traditional machine learning databases, this invention selects more experimental parameters and a larger experimental data set; it avoids the defect of low prediction accuracy of traditional machine learning and has very high accuracy and reliability.
[0018] Of course, any product implementing the present invention does not necessarily need to achieve all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0020] Figure 1 This is a Bi-LSTM flow chart of an embodiment of the present invention.
[0021] Figure 2 This is an overall flow chart of Bi-LSTM and ST-GCN in an embodiment of the present invention.
[0022] Figure 3 This is a diagram of the bridge sensor measurement point arrangement according to an embodiment of the present invention.
[0023] Figure 4 is a flow chart of an embodiment of the present invention. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0025] Example 1 The specific steps of an anomaly detection method based on Bi-LSTM and ST-GCN are as follows: S1: Arrange sensors in a standardized manner on the bridge, acquire time series data and perform preprocessing; S2: After training Bi-LSTM and ST-GCN separately, perform joint optimization training; S3: Input the preprocessed time series data into the trained Bi-LSTM, obtain the hidden state at the intermediate moment through the forward LSTM and backward LSTM, and perform feature mapping and dimensionality reduction on the hidden state to obtain the sensor time series features; S4: Input sensor time series features as node features into ST-GCN, and use dynamic adjacency matrix and temporal attention mechanism to identify the connection relationship between nodes; S5: Analyze connection relationships and perform damage detection and early warning.
[0026] Furthermore, in step S1, the specific steps are: S11: Install cable force sensors at each suspender anchor point of the tied arch bridge, number them according to the spatial topology, record the three-dimensional coordinates of each sensor, and construct a static adjacency matrix to indicate whether two sensors are physically adjacent; S12: Divide the time series data at different locations in the same time period into a sample, which is used to distinguish the differences in sensor time series characteristics later; S13: Preprocess the data.
[0027] Furthermore, in step S13, the specific steps are: S131: Z-score normalization is performed on the time series data of each sensor separately; S132: Performing two enhancements on the sensor's time series data to generate positive samples including first-enhanced data and second-enhanced data. The first-enhanced data is obtained by cropping the time series data and interpolating it to its original length, and is used to increase local signal fluctuations. The second-enhanced data is obtained by increasing the standard deviation of Gaussian noise, and is used to increase sensor measurement noise. S133: constructing positive and negative sample pairs for the time series data of different sensors, where the positive samples are enhanced samples of samples at the same moment in the same sensor, and the negative samples are samples at the same moment in sensors of different categories.
[0028] In step S2, the specific steps are: S21: Freeze the parameters of ST-GCN, build and train the Bi-LSTM, and set the loss function of the Bi-LSTM. S22: Freeze the parameters of BI-LSTM, build and train ST-GCN, and set the loss function of ST-GCN; S23: Unfreeze all parameters and perform joint optimization training on Bi-LSTM and ST-GCN; set the loss function to the weighted sum of the Bi-LSTM loss function and the ST-GCN loss function.
[0029] Furthermore, in step S21, the specific steps are: S211: Build the Bi-LSTM network architecture, including the input layer, Bi-LSTM layer, and mapping layer; The input layer data is the positive and negative sample pairs constructed by preprocessing; The Bi-LSTM layer consists of three layers of bidirectional LSTM, with the number of hidden units being 256, 128, and 64 respectively, and the output after concatenation is a 128-dimensional feature; The mapping layer is a fully connected layer, which is used to compress the 128-dimensional features into 64 dimensions, of which 32 dimensions are private features related to the sensor identity and the other 32 dimensions are shared features related to the environmental load; S212: The Bi-LSTM loss function uses a decoupled contrast loss that includes a private feature comparison term and a shared feature comparison term. The private feature comparison term is used to enhance the similarity of features between sensors of the same type; the shared feature comparison term is used to enhance the consistency of temporal patterns across sensors. The loss weight hyperparameter is set to prioritize sensor identity differentiation. The temperature coefficient gradually decays with training. S213: Use AdamW as the optimizer for the Bi-LSTM neural network. Set the training configuration including learning rate, batch size, maximum training rounds, and loss weight. The input data is single sensor time series data.
[0030] Furthermore, in step S22, the specific steps are: S221: Build the network architecture of ST-GCN, input the sensor private features extracted by pre-trained Bi-LSTM, use spatiotemporal graph convolution and temporal attention mechanism, and output the connection probability between nodes through MLP decoder; S222: The loss function of ST-GCN adopts a topology-preserving loss that includes a static topology constraint term and a dynamic smoothness constraint term. The static topology constraint term is used to maintain physical adjacency; the dynamic smoothness constraint term is used to suppress abnormal mutations; and the loss weight hyperparameter is set to strengthen the physical topology constraint. S223: Use RAdam as the optimizer for ST-GCN and set the training configuration including learning rate, training batch size, number of training rounds, and loss weight.
[0031] In step S3, the specific steps are: The forward LSTM and reverse LSTM are used to process the forward original sequence and reverse original sequence of the preprocessed time series data respectively, and the hidden states at different moments are calculated independently; for each time step, the hidden state at a certain moment in the forward direction and the hidden state at a certain moment in the reverse direction are concatenated to obtain the hidden state at a certain moment; the hidden state at the intermediate moment is input into the fully connected layer for feature mapping and dimensionality reduction to generate a high-level time series feature representation.
[0032] In step S4, the specific steps are: S41: Compute spatiotemporal graph convolution of nodes and first-order neighbors; S42: Fusion of spatial features at different time steps to obtain spatiotemporal aggregation features to capture long-term temporal dependencies; S43: Identify the edges between nodes based on spatiotemporal aggregation features and predict the connection probability of node pairs.
[0033] In step S5, the specific steps are: S51: setting different thresholds for damage determination of the identified dynamic adjacency matrix, thereby determining the strength of the connection relationship between nodes; S52: Calculate the Mahalanobis distance between the private feature generated by the Bi-LSTM and the historical mean, and determine whether a sensor fault occurs based on the comparison result of the Mahalanobis distance and the threshold; S53: Input the sensor private features generated by Bi-LSTM into ST-GCN to predict the dynamic adjacency probability and output the dynamic adjacency matrix; perform connected domain analysis on abnormal edges and determine whether structural damage occurs based on the number of sensors contained in the area.
[0034] This example, targeting a tied-arch bridge, uses Bi-LSTM to extract the temporal features of the cable tension gauge. The sensor-specific features are used as node features in the ST-GCN neural network, and the spatial positions of different sensors are identified through ST-GCN. Finally, the identified spatial positions are analyzed and adaptive warnings are issued, enabling the monitoring of whether the bridge structure is damaged.
[0035] Example 2 The steps of this embodiment are the same as those of embodiment 1, except that the steps are applied to a specific example, a tied arch bridge, where each suspender has a cable force sensor. Figure 2 and Figure 4 , specifically including the following steps: S1: Standardize the arrangement of sensors on the tied arch bridge, acquire time series data and perform preprocessing; S11: Deploy sensors; see Figure 3, install cable force sensors at each suspender anchor point of the tied arch bridge, number them according to the spatial topological relationship (1 to 22), record the three-dimensional coordinates of each sensor, and construct a static adjacency matrix If the sensor and Physically adjacent, , otherwise 0; S12: Extract sensor data; divide the sensor signals, taking all sensor signals of a day as a sample, and explicitly distinguish the differences in sensor physical characteristics; Collect sensor data; sensor data at different spatial locations on the tied arch bridge show different signal characteristics. The monitoring value of the cable force at a certain measuring point is expressed as:
[0036] Where, For the The monitoring value of each sensor; For the sensor The detection value at the moment; is the number of all monitoring values extracted by a sensor; The detection values are divided by day, and the detection value of each day is used as a sample for subsequent input into the Bi-LSTM neural network to extract the features of the sensor detection value; With a sampling frequency of 10 Hz, data is collected from 07:00 to 22:00 daily for a total of 15 hours. The amount of data from a single sensor per day is Data format: timestamp-value pair, samples are divided by natural day, and daily data form a matrix The rows represent sensors and the columns represent time points. Samples are divided into natural days, and the daily data constitutes a sample matrix ,in is the sensor data, is the number of sampling points per day; S13: preprocessing the data; S131: Time series data normalization: Z-score normalization is performed on the time series data of each sensor separately; S132: Data enhancement; for the original signal Perform two enhancements to generate positive sample pairs ,in The original data was trimmed, i.e. 90% to 95% of the original sequence was randomly retained and interpolated to the original length to increase the local signal fluctuation; Increase the standard deviation of Gaussian noise , increase sensor measurement noise; S133: constructing positive and negative sample pairs for the time series data of different sensors, where the positive samples are enhanced samples of samples at the same moment in the same sensor, and the negative samples are samples at the same moment in sensors of different categories.
[0037] S2: Train Bi-LSTM and ST-GCN; S21: Freeze the parameters of ST-GCN, build Bi-LSTM and train it, see Figure 1 ; S211: The network architecture of Bi-LSTM includes input layer, Bi-LSTM layer and mapping layer; The input layer data is the positive and negative sample pairs constructed by preprocessing (3600 points per window).
[0038] The Bi-LSTM layer consists of three layers of bidirectional LSTM, with the number of hidden units being 256, 128, and 64 respectively, and the output is a 128-dimensional feature after concatenation.
[0039] The mapping layer is a fully connected layer, which is used to compress the 128-dimensional features to 64 dimensions, of which 32 dimensions are private features. , related to the sensor identity; 32 dimensions are shared features , which is related to environmental loads.
[0040] S212: The loss function of Bi-LSTM uses decoupled contrast loss, and the mathematical formula is as follows:
[0041] In the formula is a private feature comparison item. To enhance the similarity of features of similar sensors, it is expressed as follows:
[0042] is the temperature coefficient, which is taken as 0.2 here.
[0043] In the formula To share the feature comparison term and enhance the consistency of the temporal pattern across sensors, the expression is as follows:
[0044] In the formula Indicates sensor shared features, such as global patterns such as environment and load, It is represented as the shared features of other sensors in the same period.
[0045] Here the hyperparameter settings , which prioritizes sensor identity discrimination; the temperature coefficient gradually decays with training, and the expression is as follows:
[0046] S213: The training configuration of the Bi-LSTM neural network is as follows: the optimizer uses AdamW, the learning rate is set to 0.001, the batch size is set to 44, the maximum number of training rounds is 50, and the input data is single sensor time series data. Loss weight , .
[0047] S22: Freeze the parameters of BI-LSTM, build and train ST-GCN; S221: The network architecture is: the input data is the sensor private features extracted by the pre-trained Bi-LSTM , through spatiotemporal graph convolution and temporal attention mechanism, and finally output the connection probability between nodes through the MLP decoder.
[0048] S222: The loss function uses topology preservation loss, the formula is as follows:
[0049] In the formula Represents a static topology constraint item, which is used to maintain physical adjacency. Its expression is as follows:
[0050] In the formula Represented as a static adjacency matrix, The dynamic adjacency probability model predicted by ST-GCN, Multiply the elements.
[0051] In the formula is a dynamic smoothing constraint term, which is used to suppress abnormal mutations. Its expression is as follows:
[0052]
[0053] In the formula is the characteristic matrix of all sensors, is the graph Laplacian matrix, is the degree matrix, is the matrix trace used to measure feature smoothness, where the hyperparameters are set to , the purpose is to strengthen the physical topology constraints, S223: The optimizer uses RAdam, the learning rate is recommended to be 0.001, the training batch size is 16, the number of training rounds is 20, and the loss weight is , .
[0054] S23: Unfreeze all parameters and perform joint optimization training on Bi-LSTM and ST-GCN; Its loss function is the weighted sum of two terms:
[0055] The optimizer is Lookahead (Adam (lr=1e-4)), the number of training rounds is 50, the batch size is 22, and the loss weight is , , ,
[0056] S3: Input the preprocessed positive sample pairs into the trained Bi-LSTM to obtain the sensor time series features. Due to the different sensor positions, the extracted time series signals are different. The Bi-LSTM learns different signal features from different sensors. LSTM neural network involves 3 different gates and two states: input gate, forget gate and output gate, as well as cell state and hidden state; Forget Gate As shown below:
[0057] Where, Indicates the The weight matrix of the forget gate at the current moment; Indicates the The bias vector of the forget gate at the current moment; Represents the weight matrix of the hidden state at the previous moment in the forget gate, The bias vector representing the previous hidden state in the forget gate. The forget gate determines which information should be deleted from the cell state. By adjusting the weights of the forget gate, the LSTM can selectively retain or discard past memories.
[0058] Input Gate As shown below:
[0059] Where, Indicates the The weight matrix of the input gate at the current moment; Indicates the The bias vector of the input gate at the current moment; represents the weight matrix of the hidden state in the input gate at the previous moment, The bias vector representing the previous hidden state in the input gate. The input gate determines what new information should be added to the cell state.
[0060] Output Gate As shown below:
[0061] Where, Indicates the The weight matrix of the output gate at the current moment; Indicates the The bias vector of the output gate at the current moment; Represents the weight matrix of the hidden state in the output gate at the previous moment, Represents the bias vector of the previous hidden state in the output gate. The output gate determines which information should be extracted from the cell state and passed to the hidden state.
[0062] Cell state As shown below:
[0063] Where, Represents the candidate value of the cell state at time t. The specific expression is as follows
[0064] Where, Indicates the The weight matrix of the output gate at the current moment; Indicates the The bias vector of the output gate at the current moment; Represents the weight matrix of the hidden state in the output gate at the previous moment, Represents the bias vector of the previous hidden state in the output gate. Cell state is used internally by LSTM to help the model capture and maintain long-term dependencies.
[0065] Hidden State As shown below:
[0066] Contains information about the current time step and all previous time steps, and is mainly used to pass it to the next time step or the final task layer.
[0067] The LSTM iterative process starts from the start time in the time series, calculates the input gate, forget gate, candidate cell state, updates the current cell state by combining the input gate, forget gate, and candidate cell state, and then obtains the current hidden state through the output gate and the current cell state.
[0068] Based on the LSTM iterative process, Bi-LSTM independently processes the forward original sequence and the reverse original sequence through forward LSTM and reverse LSTM, and independently calculates the hidden state at different times; for each time step t, the hidden state at the forward time t and the hidden state at the reverse time t are concatenated to obtain the hidden state at time t; the hidden state is input into the fully connected layer for feature mapping and dimensionality reduction to generate a high-level temporal feature representation .
[0069] S4: Input the sensor private features as node features into ST-GCN to identify the connection relationship between nodes; The ST-GCN neural network predicts the node connection probability; the time series signal processed by the Bi-LSTM neural network is input into the ST-GCN for node feature embedding, and the dynamic adjacency matrix and temporal attention mechanism are used to identify the edges between nodes; The edge prediction algorithm based on ST-GCN. The algorithm mainly involves 3 parts. The following details the required content and steps. S41: Spatiotemporal graph convolution; its mathematical expression is as follows
[0070] In the formula Representation node Dynamic embedding, Representation node Dynamic embedding of the first-order neighbors of express The number of first-order neighbors of a node, Represents the weight matrix of spatiotemporal graph convolution.
[0071] S42: Fusion of spatial features at different time steps , capturing long-term timing dependencies:
[0072]
[0073] In the formula is the temporal attention weight, which is a learnable parameter Output the ST-GCN at each time step Mapped to scalar weights; The final spatiotemporal aggregation feature S43: Based on spatiotemporal aggregation features , predict node pairs The connection probability; here we use the MLP decoder, and its mathematical expression is as follows:
[0074] Indicates that the node and Spatiotemporal aggregation characteristics of and Splice together and then pass The concatenated vector is mapped to a scalar and then converted into a probability value through the Sigmoid function.
[0075] S5: Analyze connection relationships and perform damage detection and early warning; S51: Setting different thresholds, and determining the strength of the connection relationship between nodes based on the different threshold settings; and performing damage determination on the identified dynamic adjacency matrix:
[0076] S52: Sensor Anomaly: Calculating Private Features Generated by Bi-LSTM and historical average The Mahalanobis distance:
[0077] like (The cycle length is 1 day, and the threshold is triggered for 3 consecutive days), then it is determined to be a sensor failure , is the standard deviation of the historical Mahalanobis distance, and the calculation formula is as follows:
[0078] S53: Structural Damage: Generate private features of the cable tension gauge using Bi-LSTM, input into ST-GCN to predict dynamic adjacency probability and output dynamic adjacency matrix , abnormal edges are connected domain analysis, the area contains If there are 2 sensors, it is judged as structural damage.
[0079] Based on the "point-line-surface" three-level detection mechanism, this embodiment constructs a spatiotemporal joint modeling framework for bridge health monitoring by fusing bidirectional LSTM (Bi-LSTM) and spatiotemporal graph convolutional network (ST-GCN) in stages. Bi-LSTM is used to identify single sensor hardware faults, separate shared features from sensor-private features from multi-sensor time series data, and enhance sensor identity differentiation through decoupling contrast loss, suppressing interference factors such as temperature. ST-GCN uses a temporal attention mechanism to capture spatial topological associations and long-term temporal dependencies between sensors, analyze connection probability anomalies under static adjacency relationships, and locate multi-node collaborative anomaly areas through a connected domain algorithm, thereby accurately positioning local damage (such as hanger fractures) and global anomalies (such as bridge deck settlement).
[0080] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0081] Example 3 This embodiment is used to implement the principles of the above method embodiment to build an anomaly detection system based on Bi-LSTM and ST-GCN, including a data acquisition submodule, a model training submodule, a feature acquisition submodule, a prediction and recognition submodule, and a damage detection submodule; The data acquisition submodule is used to arrange sensors in a standardized manner on the bridge, acquire time series data and perform preprocessing; The model training submodule is used to train Bi-LSTM and ST-GCN separately and then perform joint optimization training; The feature acquisition submodule is used to input the preprocessed positive and negative sample pairs into the trained Bi-LSTM, obtain the hidden state at the intermediate moment through the forward LSTM and reverse LSTM, and perform feature mapping and dimensionality reduction on the hidden state to obtain the sensor time series features; The prediction and recognition submodule is used to input sensor-specific features as node features into ST-GCN and use the dynamic adjacency matrix and temporal attention mechanism to identify the connection relationship between nodes; The damage detection submodule is used to analyze connection relationships and perform damage detection and early warning.
[0082] Each sub-module is mainly used to implement each step of the method embodiment, which will not be described in detail here.
[0083] It should be pointed out that, according to the needs of implementation, the various steps / components described in this application can be split into more steps / components, or two or more steps / components or partial operations of steps / components can be combined into new steps / components to achieve the purpose of the present invention.
[0084] This embodiment also includes a processor, a communication interface, a memory, and a communication bus; wherein the processor, the communication interface, and the memory communicate with each other via the communication bus; the memory stores a computer program, and when the program is executed by the processor, the processor performs the steps of an anomaly detection method based on Bi-LSTM and ST-GCN.
[0085] This embodiment also provides a computer-readable storage medium having executable instructions stored thereon. When the instructions are executed by a processor, the processor implements an anomaly detection method based on Bi-LSTM and ST-GCN.
[0086] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware.
[0087] Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0088] This application is described with reference to the flowcharts of the method and computer program product according to Example 1 of the application and the block diagram of the device (system) according to Example 3. It should be understood that each process or block in the flowchart or block diagram, as well as combinations of processes or blocks in the flowchart or block diagram, can be implemented by computer program instructions.
[0089] These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce the instructions for implementing the process Figure 1 a process or multiple processes or boxes Figure 1 An anomaly detection system based on Bi-LSTM and ST-GCN for functions specified in boxes or multiple boxes.
[0090] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes or boxes Figure 1 The function specified in one or more boxes.
[0091] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes or boxes Figure 1 The steps of a Bi-LSTM and ST-GCN based anomaly detection method are specified in one or more boxes.
[0092] The above embodiments are intended only to illustrate the design concepts and features of the present invention. Their purpose is to enable those skilled in the art to understand the contents of the present invention and implement them accordingly. The scope of protection of the present invention is not limited to the above embodiments. Therefore, any equivalent changes or modifications made based on the principles and design concepts disclosed in the present invention are within the scope of protection of the present invention.
Claims
1. An anomaly detection method based on Bi-LSTM and ST-GCN, characterized by: The following steps are involved: S1: Arrange sensors in a standardized manner on the bridge, acquire time series data and perform preprocessing; S2: After training Bi-LSTM and ST-GCN separately, perform joint optimization training; S3: Input the preprocessed time series data into the trained Bi-LSTM, obtain the hidden state at the intermediate moment through the forward LSTM and backward LSTM, and perform feature mapping and dimensionality reduction on the hidden state to obtain the sensor time series features; S4: Input sensor time series features as node features into ST-GCN, and use dynamic adjacency matrix and temporal attention mechanism to identify the connection relationship between nodes; S5: Analyze connection relationships and perform damage detection and early warning.
2. The anomaly detection method based on Bi-LSTM and ST-GCN according to claim 1, characterized in that: In the step S1, the specific steps are: S11: Install cable force sensors at each suspender anchor point of the tied arch bridge, number them according to the spatial topology, record the three-dimensional coordinates of each sensor, and construct a static adjacency matrix to indicate whether two sensors are physically adjacent; S12: Divide the time series data at different locations in the same time period into one sample, which is used to distinguish the differences in sensor spatial features later; S13: Preprocess the data.
3. The anomaly detection method based on Bi-LSTM and ST-GCN according to claim 2, characterized in that: In the step S13, the specific steps are: S131: Z-score normalization is performed on the time series data of each sensor separately; S132: Performing two enhancements on the sensor's time series data to generate positive samples including the first enhancement data and the second enhancement data; The first enhanced data is obtained by cropping the time series data and interpolating it to the original length, which is used to increase the local signal fluctuation. The second enhanced data is obtained by increasing the standard deviation of Gaussian noise, which is used to increase the sensor measurement noise. S133: constructing positive and negative sample pairs for the time series data of different sensors, where the positive samples are enhanced samples of samples at the same moment in the same sensor, and the negative samples are samples at the same moment in sensors of different categories.
4. The anomaly detection method based on Bi-LSTM and ST-GCN according to claim 3, characterized in that: In the step S2, the specific steps are: S21: Freeze the parameters of ST-GCN, build and train the Bi-LSTM, and set the loss function of the Bi-LSTM. S22: Freeze the parameters of BI-LSTM, build and train ST-GCN, and set the loss function of ST-GCN; S23: Unfreeze all parameters and perform joint optimization training on Bi-LSTM and ST-GCN; set the loss function to the weighted sum of the Bi-LSTM loss function and the ST-GCN loss function.
5. The anomaly detection method based on Bi-LSTM and ST-GCN according to claim 4, characterized in that: In the step S21, the specific steps are: S211: Build the Bi-LSTM network architecture, including the input layer, Bi-LSTM layer, and mapping layer; The input layer data is the positive and negative sample pairs constructed by preprocessing; The Bi-LSTM layer consists of three layers of bidirectional LSTM, with the number of hidden units being 256, 128, and 64 respectively, and the output after concatenation is a 128-dimensional feature; The mapping layer is a fully connected layer, which is used to compress the 128-dimensional features into 64 dimensions, of which 32 dimensions are private features related to the sensor identity and the other 32 dimensions are shared features related to the environmental load; S212: The loss function of Bi-LSTM uses a decoupled contrast loss that includes private feature contrast terms and shared feature contrast terms; The private feature comparison item is used to enhance the similarity of features of sensors of the same type and to enhance the difference of features of sensors of different types; The shared feature comparison term is used to enhance the consistency of temporal patterns across sensors; the loss weight hyperparameter is set to prioritize sensor identity differentiation; the temperature coefficient gradually decays during training; S213: Use AdamW as the optimizer for the Bi-LSTM neural network. Set the training configuration including learning rate, batch size, maximum training rounds, and loss weight. The input data is multi-sensor time series data.
6. The anomaly detection method based on Bi-LSTM and ST-GCN according to claim 5, characterized in that: In the step S22, the specific steps are: S221: Build the network architecture of ST-GCN, input the sensor private features extracted by pre-trained Bi-LSTM, use spatiotemporal graph convolution and temporal attention mechanism, and output the connection probability between nodes through MLP decoder; S222: The loss function of ST-GCN adopts a topology-preserving loss that includes a static topology constraint term and a dynamic smoothness constraint term. The static topology constraint term is used to maintain physical adjacency; the dynamic smoothness constraint term is used to suppress abnormal mutations; and the loss weight hyperparameter is set to strengthen the physical topology constraint. S223: Use RAdam as the optimizer for ST-GCN and set the training configuration including learning rate, training batch size, number of training rounds, and loss weight.
7. The anomaly detection method based on Bi-LSTM and ST-GCN according to claim 1, characterized in that: In the step S3, the specific steps are: The positive and negative sample pairs of the preprocessed time series data are processed separately by forward LSTM and backward LSTM, and the hidden states at different moments are calculated independently; for each time step, the hidden state at a certain moment in the forward direction and the hidden state at a certain moment in the reverse direction are concatenated to obtain the hidden state at a certain moment; the hidden state at the intermediate moment is input into the fully connected layer for feature mapping and dimensionality reduction to generate a high-level time series feature representation.
8. The anomaly detection method based on Bi-LSTM and ST-GCN according to claim 1, characterized in that: In the step S4, the specific steps are: S41: Compute spatiotemporal graph convolution of nodes and first-order neighbors; S42: Fusion of spatial features at different time steps to obtain spatiotemporal aggregation features to capture long-term temporal dependencies; S43: Identify the edges between nodes based on spatiotemporal aggregation features and predict the connection probability of node pairs.
9. The anomaly detection method based on Bi-LSTM and ST-GCN according to claim 1, characterized in that: In the step S5, the specific steps are: S51: setting different thresholds for damage determination of the identified dynamic adjacency matrix, thereby determining the strength of the connection relationship between nodes; S52: Calculate the Mahalanobis distance between the private feature generated by the Bi-LSTM and the historical mean, and determine whether a sensor fault occurs based on the comparison result of the Mahalanobis distance and the threshold; S53: Input the sensor private features generated by Bi-LSTM into ST-GCN to predict the dynamic adjacency probability and output the dynamic adjacency matrix; perform connected domain analysis on abnormal edges and determine whether structural damage occurs based on the number of sensors contained in the area.
10. An anomaly detection system based on Bi-LSTM and ST-GCN, characterized by: The data acquisition submodule is used to arrange sensors in a standardized manner on the bridge, acquire time series data and perform preprocessing; The model training submodule is used to train Bi-LSTM and ST-GCN separately and then perform joint optimization training; The feature acquisition submodule is used to input the preprocessed time series data into the trained Bi-LSTM, obtain the hidden state of the intermediate moment through the forward LSTM and backward LSTM, and perform feature mapping and dimensionality reduction on the hidden state to obtain the sensor time series features; The prediction and recognition submodule is used to input sensor time series features as node features into ST-GCN and use the dynamic adjacency matrix and temporal attention mechanism to identify the connection relationship between nodes; The damage detection submodule is used to analyze connection relationships and perform damage detection and early warning.
Citation Information
Cited By
Building safety monitoring data abnormity diagnosis method and system
CN121479188A
Bridge digital twin disease mapping prediction method and system
CN121982226A
Bridge digital twin disease mapping prediction method and system
CN121982226B
Project data full-period tracing method and system based on multi-source data fusion
CN122134138A