Structural health monitoring acceleration data restoration method based on differential Transform
The lost data in structural health monitoring is reconstructed through the differential Transformer model, which solves the problem of repairing large segments of continuous data loss for multiple sensors, realizes rapid reconstruction and self-evaluation of data, and improves the reliability and accuracy of the repair effect.
Patent Information
- Application Number
- CN202510620586.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-14
- Publication Date
- 2025-08-08
AI Technical Summary
The existing structural health monitoring technology is difficult to repair when processing random large segments of continuous data loss of multiple sensors, and lacks a self-evaluation mechanism when the real value is unknown, resulting in limited reference value for the evaluation of repair effect in actual applications.
Using a structural health monitoring acceleration data repair method based on differential Transformer, data reconstruction and accuracy prediction are achieved through building block embedding modules, encoders and decoders, combining random masking strategies and loss functions.
It can quickly reconstruct lost data in structural health monitoring and realize self-evaluation of reconstruction accuracy of each sub-segment without real data. It is suitable for scenes of random large segments of continuous data loss for multiple sensors, improving the reliability and accuracy of repair effects.
Smart Images

Figure CN120449700A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of structural health monitoring and data processing, and in particular relates to a structural health monitoring acceleration data repair method based on differential Transformer. Background Art
[0002] In recent years, structural health monitoring technology has developed rapidly in the civil engineering community, making significant contributions to ensuring structural safety and reliability and extending structural service life. Many structures typically deploy long-term structural health monitoring systems to achieve real-time monitoring of structural status and abnormal warnings. In structural health monitoring systems, the continuous healthy operation and data transmission of sensors are key to achieving real-time assessment of structural status. However, due to equipment aging, communication interruptions, or environmental interference, problems such as data loss and measurement errors often occur, which directly affects the reliability and accuracy of health monitoring systems. Once a sensor fails or the signal is lost, it may be impossible to accurately assess the structural health status and perform abnormality detection. Therefore, in order to ensure the integrity and availability of structural monitoring data, the reconstruction of monitoring data has become an important issue in the field.
[0003] During the research process, various acceleration data reconstruction methods have been developed, mainly divided into two categories: finite element modeling and data-driven methods. Although the finite element modeling method can theoretically accurately describe structural behavior, it is subject to many constraints in practical applications, such as complex loading conditions and uncertain material properties. Data-driven methods, on the other hand, have become an important tool for solving the data loss problem due to their flexible use of monitoring data. Data-driven recovery algorithms can be roughly divided into three categories: statistical interpolation methods, machine learning methods, and deep learning methods. Zhang et al. modeled the correlation between sensors and regarded data recovery as a regression task, proposing a Bayesian dynamic regression (BDR) method to reconstruct missing SHM data. Huang et al. proposed a novel data recovery method based on correlation analysis and machine learning (ML). They used correlation analysis to select appropriate inputs for the ML model, and then used the ML model with the selected inputs to recover the missing wind pressure. Jiang et al. designed a new missingness perception function. The network can effectively integrate missing data patterns and is trained end-to-end in a self-supervised manner.
[0004] The aforementioned research has made significant progress in the field of health monitoring data restoration. However, as data size and complexity increase, limitations in processing accuracy and efficiency are becoming increasingly apparent. First, there are limitations related to data loss patterns. Existing research primarily focuses on discrete point data loss and complete data loss from a single sensor in multi-sensor scenarios. However, limited attention has been paid to the restoration of random, long-range continuous data loss from multiple sensors. Studies have shown that compared to discrete point data loss, the loss of long-range continuous data places higher demands on model restoration capabilities, significantly increasing the difficulty of restoration. The adaptability and robustness of existing methods in such scenarios still need to be further improved. Second, there are limitations in restoring performance evaluation. Most current studies rely on artificially simulated data loss and evaluate restoration accuracy by comparing it with complete data. While this approach can be used to quantify overall performance, complete, real-world data is often unavailable in real-world engineering applications. Restoration performance varies significantly across sensors, loss rates, and loss locations. Even achieving a uniform overall assessment accuracy often fails to reflect the model's true restoration capabilities in various specific scenarios, limiting the usefulness of this metric in practical applications. Consequently, a self-assessment mechanism that can effectively determine the credibility of restoration results when the true value is unknown remains lacking. Summary of the Invention
[0005] The present invention aims to address the deficiencies of the prior art and proposes a structural health monitoring acceleration data repair method based on differential Transformer, comprising the following steps:
[0006] S1. Acquire complete acceleration data from structural health monitoring to obtain an acceleration dataset of a time series monitoring signal type; and randomly and continuously discard a preset proportion of signals from the acceleration dataset to simulate a data loss process, thereby obtaining an acceleration repair dataset.
[0007] S2. Constructing a differential Transformer model for repairing acceleration data; inputting the acceleration repair data set into the differential Transformer model to obtain training repair data; and optimizing the differential Transformer model based on data repair accuracy and prediction accuracy;
[0008] S3. Collect real-time acceleration data from structural health monitoring and divide the signal of each sensor into several data segments along the length. If a data point is lost in the data segment, the entire data segment is considered completely lost. All sensor data are traversed to obtain a mask matrix of the corresponding data. The data segment is input into the optimized differential Transformer model to obtain repair data.
[0009] Further preferably, the differential Transformer model includes: a block embedding module, an encoder, a decoder and a loss function;
[0010] The method for obtaining the repair data by the differential Transformer model includes:
[0011] Inputting data of the time series monitoring signal type into the model, the block embedding module combines the random masking strategy to map the input data into a tensor representation;
[0012] Inputting the tensor into the encoder, the encoder is used to extract features from the input, and then the decoder reconstructs data based on the extracted features to obtain the training repair data and predict the reconstruction accuracy;
[0013] The loss function is used to evaluate the accuracy of the training data restoration, thereby updating the parameters of the differential Transformer model.
[0014] Further preferably, the method of mapping the input data into a tensor representation by the block embedding module in combination with a random mask strategy includes:
[0015] The block embedding module combines a random masking strategy to perform a random masking operation on the input data and maps the data of the visible patch to a higher-dimensional embedding space as the input of the encoder;
[0016] The method of the random mask strategy includes:
[0017] Randomly generate a 0-1 mask matrix of size [n,K×k] with a loss rate between 0.1 and 0.6, where 0 represents data loss at the corresponding position;
[0018] The random masking process includes: performing a masking operation on the [n, K×k, C0] feature using a randomly generated mask matrix, returning the masked feature [n, (K×kg), C0]; recording the mask matrix M of the masked position and the index used by the decoder to restore the feature order;
[0019] Methods for performing mapping include:
[0020] For input data of size [n,K,k×s], the input data is reshaped to [n,K×k×s,1]; the reshaped features are passed through a 1D convolution layer with a convolution kernel size and a step size of s to obtain features of size [n,K×k,C0]. Sin-cosine position encoding is used to generate an invariant position information tensor, which is then appended to the features of size [n,K×k,C0] by direct addition.
[0021] Further preferably, the encoder includes m1 differential Transformer modules, and the input is a feature of size [n, (K×kg), C0]; after being processed by the differential Transformer module, a final feature of size [n, (K×kg), C0] is obtained.
[0022] Further preferably, the final features output by the encoder are first mapped to features of size [n, (K×kg), C1] through a fully connected layer, and the features of size [n, (K×kg), C1] are restored to complete features of size [n, K×k, C1] in the original order using the restoration index generated by the mask matrix M, wherein the features corresponding to the data with a mask matrix of 0 are replaced by a learnable vector, and then input into the decoder;
[0023] The decoder includes: a data reconstruction branch and a reconstruction accuracy evaluation branch; the data reconstruction branch and the reconstruction accuracy evaluation branch are used to reconstruct data and predict reconstruction accuracy respectively, and are both composed of m2 differential Transformer modules stacked together;
[0024] In the data reconstruction branch, the features of size [n, K×k, C1] output by the differential Transformer module are sequentially subjected to layer normalization and a fully connected layer, and the repaired data of size [n, K×k×s, 1] is output;
[0025] In the reconstruction accuracy evaluation branch, the output features of the differential Transformer module pass through a three-layer fully connected neural network in sequence, mapping the high-dimensional features into a two-dimensional prediction result [n, K×k, 2]. The two-dimensional prediction result is the "1-relative coefficient" and relative error between the repaired data and the original data in each segment of data with a length of s.
[0026] Further preferably, the loss function includes:
[0027]
[0028] Where, L total Represents the total loss function; L1 represents the relative error loss; L2 represents the relative coefficient loss; Represents the relative error prediction bias loss; represents the relative coefficient prediction deviation loss;
[0029] in,
[0030]
[0031] Where n represents the batch size; M b,irepresents the mask value of the i-th fragment of the b-th sample; K represents the number of sensors; k represents the number of fragments into which each sensor input model data is split; s represents the length of the data in each fragment; x b,i represents the true value of the i-th fragment of the b-th sample; represents the reconstructed data of the i-th fragment of the b-th sample; x b,i,j represents the jth original data point in the i-th segment of the b-th sample; represents the reconstructed data of the jth original data point in the i-th segment of the b-th sample; and They represent the mean of the reconstructed data and the original data of the i-th fragment of the b-th sample; e b,i Indicates the actual relative error value of the i-th segment of the b-th sample; represents the model relative error prediction value of the i-th segment of the b-th sample; r b,i represents the actual "1-correlation coefficient" value of the i-th segment of the b-th sample; It represents the predicted value of the model "1-correlation coefficient" for the i-th segment of the b-th sample.
[0032] Further preferably, in S3, when the batch size of K sensors is n, the data size input to the optimized differential Transformer model is [n, K, k×s], and the mask value 0-1 is discriminated with s as the length. The mask matrix is initially of size [n, K, k], and becomes of size [n, K×k] after the reshaping operation, and then input into the optimized differential Transformer model.
[0033] Compared with the prior art, the present invention has the following beneficial effects:
[0034] The present invention can be widely used in the task of repairing and reconstructing missing acceleration data in structural health monitoring without manual intervention, and can also predict the accuracy of data reconstruction:
[0035] 1. It can realize the rapid reconstruction of lost data in structural health monitoring. Compared with traditional methods, the method proposed in this invention is more suitable for the reconstruction of data with random large-scale continuous data loss of multiple sensors in the structural health monitoring system.
[0036] 2. The present invention can simultaneously achieve reconstruction of lost data in each sub-segment and self-evaluation of the reconstruction accuracy of the corresponding sub-segment, while the traditional method can only give the overall average result of the reconstruction accuracy when the real data is known. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solution of the present invention, the following briefly introduces the drawings required for use in the embodiments. 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 any creative work.
[0038] Figure 1 It is the overall technical roadmap of the present invention;
[0039] Figure 2 This is the structure diagram of the differential Transformer module of the present invention;
[0040] Figure 3 This is a schematic diagram of an acceleration sensor for monitoring health of a pedestrian bridge according to an embodiment of the present invention;
[0041] Figure 4 is a training convergence curve in an embodiment of the present invention;
[0042] Figure 5 2 is a schematic diagram of the validation loss curves of each sub-item during the training process in an embodiment of the present invention;
[0043] Figure 6 This is a diagram showing the effect of data repair at a 50% loss rate in the present invention;
[0044] Figure 7 This is a comparison chart of the relative error loss of the two repair methods in the present invention under different data loss rates;
[0045] Figure 8 This is a comparison chart of the correlation coefficient loss of the two repair methods in the present invention under different data loss rates;
[0046] Figure 9 It is the box plot of relative error prediction deviation at different loss rates in the present invention;
[0047] Figure 10 It is a box plot of the correlation coefficient prediction deviation at different loss rates in the present invention.
[0048] Description of reference numerals:
[0049] 1, 2, 3, 4, 5, 6, 7, and 8 are acceleration sensors. DETAILED DESCRIPTION
[0050] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0051] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0052] Example 1:
[0053] like Figure 1 As shown, this embodiment discloses a structural health monitoring acceleration data repair method based on differential Transformer, comprising the following steps:
[0054] During the training phase:
[0055] S1. Acquire complete acceleration data from structural health monitoring to obtain an acceleration dataset of the time series monitoring signal type; and randomly and continuously discard a preset proportion of signals in the acceleration dataset to simulate the data loss process and obtain an acceleration repair dataset.
[0056] A moving window scanning method was used to extract data from the original complete acceleration data. Training and validation sets were constructed for training and validation of the differential Transformer model. The mean and variance of each sensor signal in the initial training set were calculated. The data in the initial training and validation sets were preprocessed using the Z-score normalization method. Since the original monitoring signals do not contain abnormal data, these data points serve as the ground truth for the training and validation sets, representing the target output of the network.
[0057] S2. Construct a differential Transformer model for repairing acceleration data; input the acceleration repair dataset into the differential Transformer model to obtain training repair data; and optimize the differential Transformer model based on data repair accuracy and prediction accuracy.
[0058] In this embodiment, Figure 2 As shown, the differential Transformer model includes: block embedding module, encoder, decoder and loss function;
[0059] The methods for obtaining repaired data using the differential Transformer model include:
[0060] The data of the time series monitoring signal type is input into the model. First, the block embedding module combines the random masking strategy to map the input data into a tensor representation; then, the tensor is input into the encoder, which is used to extract features from the input, and the decoder is used to reconstruct the data based on the extracted features to obtain training repair data and predict the reconstruction accuracy; finally, the loss function is used to evaluate the data repair accuracy, thereby updating the parameters of the differential Transformer model.
[0061] Further implementation is that the block embedding module combines the random mask strategy to map the input data into a tensor representation, including:
[0062] The block embedding module combines a random masking strategy to perform random masking operations on the input data and maps the data of visible patches to a higher-dimensional embedding space as the input of the encoder.
[0063] Methods for random masking strategies include:
[0064] Randomly generate a 0-1 mask matrix of size [n,K×k] with a loss rate between 0.1 and 0.6, where 0 represents data loss at the corresponding position.
[0065] The random masking process includes: performing a masking operation on the [n, K×k, C0] feature through a randomly generated mask matrix, returning the masked feature [n, (K×kg), C0]; recording the mask matrix M of the masked position and the index used by the decoder to restore the feature order.
[0066] Methods for performing mapping include:
[0067] For input data of size [n,K,k×s], the input data is reshaped to [n,K×k×s,1]; the reshaped features are passed through a 1D convolution layer with a convolution kernel size and a step size of s to obtain features of size [n,K×k,C0]. Sin-cosine position encoding is used to generate an invariant position information tensor, which is then appended to the features of size [n,K×k,C0] by direct addition.
[0068] In a further implementation, the encoder includes m1 differential Transformer modules, which take as input features of size [n, (K×kg), C0]. The differential Transformer module uses a regularization layer for layer normalization, which does not track the global mean variance but only normalizes each batch. After the input [n, (K×kg), C0] features are layer-normalized, the normalized features of the same size are output to the differential attention mechanism. In the differential attention mechanism, based on the number of heads (set to 8 in this embodiment), the normalized features of size [n, (K×kg), C0] are passed through a fully connected layer and a reshape operation to generate 8 sets of query (Q1, Q2), key (K1, K2), and value (V) features, all of size [n, (K×kg), C0 / 8]. The generated 8 groups of features are input into the differential attention module respectively to obtain eight groups of differential features of size [n, (K×kg), C0 / 8]. In the differential Transformer module, the residual structure is nested in each sublayer, including the attention mechanism layer and the multi-layer perceptron layer. In the multi-layer perceptron, the hyperparameter mlp_ratio is set to 4. The 8 groups of differential features of size [n, (K×kg), C0 / 8] are integrated using the concatenation layer to obtain an integrated feature of size [n, (K×kg), C0]. The integrated feature is input into the fully connected layer and the final feature of size [n, (K×kg), C0] is output.
[0069] A further implementation is that the final features output by the encoder are first mapped to features of size [n, (K×kg), C1] through a fully connected layer, and the restoration index (ids_restore) generated by the mask matrix M is used to restore the features of size [n, (K×kg), C1] to complete features of size [n, K×k, C1] in the original order, where the features corresponding to the data with a mask matrix of 0 are replaced by a learnable vector and then input into the decoder.
[0070] Furthermore, the decoder includes a data reconstruction branch and a reconstruction accuracy assessment branch, which are used for data reconstruction and reconstruction accuracy estimation, respectively. Both the data reconstruction branch and the reconstruction accuracy assessment branch are composed of m2 differential Transformer modules stacked together, with the same number of heads and mlp_ratio settings as the encoder.
[0071] In the data reconstruction branch, the features of size [n, K×k, C1] output by its differential Transformer module are sequentially normalized and subjected to a fully connected layer to output reconstructed data of size [n, K×k×s, 1]; the reconstructed data can then be restored to the same shape as the original input through a reshaping operation.
[0072] In the reconstruction accuracy evaluation branch, the output features of the differential transformer are sequentially passed through a three-layer fully connected neural network, mapping the high-dimensional features into a two-dimensional prediction result [n,K×k,2]. The two-dimensional prediction result is the "1-relative coefficient" and relative error between the repaired data and the original data for each data segment of length s.
[0073] A further implementation is that in the calculation process of the loss function, only the error evaluation is performed on the masked part of the data, that is, only the loss term corresponding to the position of the missing data is calculated to more accurately measure the effectiveness of the model in the data repair task. The total loss function is:
[0074]
[0075] Where, L total Represents the total loss function; L1 represents the relative error loss; L2 represents the relative coefficient loss; Represents the relative error prediction bias loss; Represents the relative coefficient prediction bias loss.
[0076] in,
[0077]
[0078] Where n represents the batch size; M b,i represents the mask value of the i-th fragment of the b-th sample; K represents the number of sensors; k represents the number of fragments into which each sensor input model data is split; s represents the length of the data in each fragment; x b,i represents the true value of the i-th fragment of the b-th sample; represents the reconstructed data of the i-th fragment of the b-th sample; x b,i,j represents the jth original data point in the i-th segment of the b-th sample; represents the reconstructed data of the jth original data point in the i-th segment of the b-th sample; and They represent the mean of the reconstructed data and the original data of the i-th fragment of the b-th sample; e b,i Indicates the actual relative error value of the i-th segment of the b-th sample; represents the model relative error prediction value of the i-th segment of the b-th sample; r b,i represents the actual "1-correlation coefficient" value of the i-th segment of the b-th sample; It represents the predicted value of the model "1-correlation coefficient" for the i-th segment of the b-th sample.
[0079] S3 collects real-time acceleration data from structural health monitoring and divides the signal from each sensor into several data segments along its length. If a data point is missing in a data segment, the segment is considered completely lost. All sensor data is traversed to obtain a mask matrix corresponding to the data. The data segments are input into the optimized differential Transformer model to obtain repaired data.
[0080] The method of obtaining the mask matrix includes:
[0081] Assuming that there are K sensors with a batch size of n, the data size input to the optimized differential Transformer model is [n, K, k×s]. The mask value 0-1 is discriminated with a length of s. The mask matrix is initially of size [n, K, k] and becomes [n, K×k] after the reshaping operation. It is then input into the optimized differential Transformer model and processed by the differential Transformer model to obtain the repaired data.
[0082] Example 2:
[0083] This embodiment combines Figure 3 The bridge structure shown contains 8 accelerometers and collects 17 weeks of monitoring data. The input model data size is set to [n, K, k×s], where n represents the batch size and K is the corresponding number of sensors, which is 8 in this example. k×s is 1024, where s is set to 128 and k is 8. This is equivalent to dividing each 1024-length sensor data into 8 segments. Set C0 to 512, C1 to 256, m1 to 12, and m2 to 8. The last 5 weeks of data are used to construct the test set, with 200,000 data segments in the training set, 50,000 data segments in the validation set, and 50,000 data segments in the test set.
[0084] (1) Training phase:
[0085] The first seven weeks of data were used to construct the initial training set, and the subsequent five weeks of data were used to construct the initial validation set. A moving window scanning method was used to extract the dataset from the raw data. The time series length and moving step size for each sensor data point were set to k × s, or 1024. The training and validation sets were constructed, and the mean and variance of each sensor signal in the initial training set were calculated. The data in the initial training and validation sets were preprocessed and normalized using the Z-score normalization method. Random sampling was performed from the initial training and validation sets, resulting in data segments of size [8, 1024], which served as the training and validation sets for the input model. The training set contained 20,000 data segments, and the validation set contained 5,000 data segments.
[0086] The input data of size [32, 8, 1024] to the differential Transformer model is first reshaped into features of size [32, 8192]. The reshaped features are then passed through a 1D convolutional layer with a kernel size and stride of 128, resulting in features of size [32, 64, 512]. Sin-cosine positional encoding is used to generate an invariant position information tensor, which is then directly added to the features. A random 0-1 mask matrix of size [32, 64] is then generated based on a dropout rate between 0.1 and 0.6, where 0 represents data loss at the corresponding position. The features of size [32, 64, 512] are masked using the mask matrix. Assuming a batch dropout rate of 0.125, the corresponding g = 8 × 8 × 0.125, rounded to 8. The masked features of size [32, 64 - g, 512] are returned, recording the mask vector M of the occluded positions and the indices used to restore the feature order in the decoder. Each element in M corresponds to a 128-length segment of the input data. The features of size [32, 64-g, 512] are then fed into an encoder consisting of 12 differential Transformer modules, which output features of size [32, 64-g, 512]. The encoder output of size [32, 64-g, 512] is first mapped to features of size [32, 64-g, 256] via a fully connected layer. Using the restored indices (ids_restore) generated by the mask matrix M, these features are restored to their original order, returning them to the full features of size [64, 64, 256]. Features with a mask matrix of 0 are replaced with a learnable vector before being fed into the decoder. The features are then fed into the decoder branch, which consists of two functional branches: one for data reconstruction and the other for evaluating and predicting reconstruction accuracy. The main structure of both branches consists of a stack of eight differential Transformer modules. In the data reconstruction branch, the output features of the differential Transformer module are sized [32, 64, 256] and then pass through layer normalization and a fully connected layer to output reconstructed data of size [32, 8192, 1]. The reconstructed data of size [32, 8, 1024] can be subsequently restored through a reshaping operation. 32 represents the batch size, 8 represents 8 sensors, and 1024 represents the length of each data segment input to the network for each sensor. In the reconstruction accuracy evaluation branch, the output features of the differential Transformer pass through a three-layer fully connected neural network to map the high-dimensional features to an input of size [32, 64, 2]. This can be split into two matrices of size [32, 64], where 32 is the batch size. The 64 in each matrix corresponds to the predicted repair accuracy of each element of the mask matrix M corresponding to a 128-length data segment. Only the predicted values corresponding to the elements of the mask matrix M that are 0 (i.e., missing data) are valid.Based on the proposed loss function, the Adam algorithm is used to update the network parameters and train the data repair proposed in this invention. The model training process is as follows. Figure 4 As shown in the figure, training converged without overfitting. Both training loss and validation loss showed a clear downward trend in the initial training phase. After 100 epochs, network performance improvement gradually slowed, with optimal results achieved at epoch 199. Figure 5 The figure shows the various loss function curves of the model saved during training on the validation set. L1 represents the relative error loss of each 128-length segment repair data, and L2 represents the correlation coefficient loss of each segment repair data (i.e. "1-correlation coefficient"). and They represent the deviation of the model's prediction relative error loss and prediction correlation coefficient loss for each fragment of repaired data. The L1 and L2 curves show a significant downward trend overall, indicating that the performance of the data repair branch is continuously improving. and The two curves show completely different trends, stabilizing after the 25th epoch, with the loss remaining roughly around 0.05. This indicates that the repair accuracy prediction branch is easier to train than the data repair branch, and can accurately predict the current model's repair accuracy even in the early stages when the model has not yet converged and the repair effect is poor.
[0087] (2) Testing phase:
[0088] The optimal model, i.e., the one with the lowest validation loss, can be obtained based on the training curve. For the data to be repaired, Z-score normalization is first performed using the same parameters as the training set. During the data repair phase, the eight sensor data are divided into segments of size [8, 1024] with a length of 1024 and reshaped to [1, 8192]. Each sensor data segment is further divided into eight subsegments according to the model parameter s (set to 128 during training). If a data point is missing in a data segment, the segment is considered completely lost. This process is repeated through all sensor data to obtain the mask matrix for the test phase. The data and mask matrix are fed into the trained model, which outputs the repaired data for each subsegment and its corresponding prediction accuracy.
[0089] Figure 6 This is the data repair effect of a certain segment of data in the present invention under a 50% loss rate, and only the repair result of the lost data part is shown. Figure 6The zeros in the graph indicate no missing data. The numbers above each sensor subgraph indicate the actual restoration accuracy for the corresponding data segment, while the numbers below indicate the model's predicted restoration accuracy. This shows that the restored data and the real data are highly consistent in both overall trends and detailed changes, demonstrating that the model can accurately restore the missing data for each sensor even when entire segments are randomly missing.
[0090] Figure 7 This is a comparison of the relative error losses of the two repair methods in the present invention under different data loss rates. By comparing the repair performance of the differential Transformer model and the classic Transformer model under different data loss rates, it can be seen that at each loss rate level, the model using the differential Transformer is significantly better than the classic Transformer model in relative error loss.
[0091] Figure 8 This is a comparison of the correlation coefficient loss of the two repair methods in the present invention under different data loss rates. By comparing the repair performance of the differential Transformer model and the classic Transformer model under different data loss rates, it can be seen that at each loss rate level, the model using the differential Transformer is significantly better than the classic Transformer model in terms of correlation coefficient loss.
[0092] Figure 9 It is the box plot of relative error prediction deviation at different loss rates in the present invention; Figure 10 It is the correlation coefficient prediction deviation box plot under different loss rates in the present invention; Figure 9 and Figure 10 It can be seen that under most loss rate conditions, the median of the prediction deviation remains within 0.06, and the interquartile range (IQR) is also mostly within 0.05, indicating that the model has a high consistency in repair accuracy prediction.
[0093] The embodiments described above are merely descriptions of preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Without departing from the spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by persons skilled in the art should fall within the scope of protection defined by the claims of the present invention.
Claims
1. A structural health monitoring acceleration data repair method based on differential Transformer, characterized in that: The following steps are involved: S1. Obtain complete acceleration data in structural health monitoring and obtain an acceleration data set of time series monitoring signal type; and randomly and continuously discarding a preset proportion of signals in the acceleration data set to simulate a data loss process and obtain an acceleration repair data set; S2. Constructing a differential Transformer model for repairing acceleration data; inputting the acceleration repair data set into the differential Transformer model to obtain training repair data; and optimizing the differential Transformer model based on data repair accuracy and prediction accuracy; S3. Collect real-time acceleration data from structural health monitoring and divide the signal of each sensor into several data segments along the length. If a data point is lost in the data segment, the entire data segment is considered completely lost. All sensor data are traversed to obtain a mask matrix of the corresponding data. The data segment is input into the optimized differential Transformer model to obtain repair data.
2. The structural health monitoring acceleration data repair method based on differential Transformer according to claim 1 is characterized in that: The differential Transformer model includes: a block embedding module, an encoder, a decoder, and a loss function; The method for obtaining the repair data by the differential Transformer model includes: Inputting data of the time series monitoring signal type into the model, the block embedding module combines the random masking strategy to map the input data into a tensor representation; Inputting the tensor into the encoder, the encoder is used to extract features from the input, and then the decoder reconstructs data based on the extracted features to obtain the training repair data and predict the reconstruction accuracy; The loss function is used to evaluate the accuracy of the training data restoration, thereby updating the parameters of the differential Transformer model.
3. The structural health monitoring acceleration data repair method based on differential Transformer according to claim 2 is characterized in that: The block embedding module combines a random mask strategy to map input data into a tensor representation, including: The block embedding module combines a random masking strategy to perform a random masking operation on the input data and maps the data of the visible patch to a higher-dimensional embedding space as the input of the encoder; The random masking strategy method includes: Randomly generate a 0-1 mask matrix of size [n,K×k] with a loss rate between 0.1 and 0.6, where 0 represents data loss at the corresponding position; The random masking process includes: performing a masking operation on the [n, K×k, C0] feature using a randomly generated mask matrix, returning the masked feature [n, (K×kg), C0]; recording the mask matrix M of the masked position and the index used by the decoder to restore the feature order; Methods for performing mapping include: For input data of size [n,K,k×s], the input data is reshaped to [n,K×k×s,1]; the reshaped features are passed through a 1D convolution layer with a convolution kernel size and a step size of s to obtain features of size [n,K×k,C0]. Sin-cosine position encoding is used to generate an invariant position information tensor, which is then appended to the features of size [n,K×k,C0] by direct addition.
4. The structural health monitoring acceleration data repair method based on differential Transformer according to claim 2 is characterized in that: The encoder consists of m1 differential Transformer modules, with input features of size [n, (K×kg), C0]; After being processed by the differential Transformer module, the final feature of size [n, (K×kg), C0] is obtained.
5. The structural health monitoring acceleration data repair method based on differential Transformer according to claim 4 is characterized in that: The final features output by the encoder are first mapped to features of size [n, (K×kg), C1] through a fully connected layer. The features of size [n, (K×kg), C1] are restored to complete features of size [n, K×k, C1] in the original order using the restoration index generated by the mask matrix M. The features corresponding to the data with a mask matrix of 0 are replaced by a learnable vector and then input into the decoder. The decoder includes: a data reconstruction branch and a reconstruction accuracy evaluation branch; the data reconstruction branch and the reconstruction accuracy evaluation branch are used to reconstruct data and predict reconstruction accuracy respectively, and are both composed of m2 differential Transformer modules stacked together; In the data reconstruction branch, the features of size [n, K×k, C1] output by the differential Transformer module are sequentially subjected to layer normalization and a fully connected layer, and the repaired data of size [n, K×k×s, 1] is output; In the reconstruction accuracy evaluation branch, the output features of the differential Transformer module are sequentially passed through a three-layer fully connected neural network to map the high-dimensional features into a two-dimensional prediction result [n, K × k, 2]. The two-dimensional prediction result is the "1-relative coefficient" and relative error between the repaired data and the original data in each data segment of length s.
6. The structural health monitoring acceleration data repair method based on differential Transformer according to claim 2 is characterized in that: The loss function includes: Where, L total Represents the total loss function; L1 represents the relative error loss; L2 represents the relative coefficient loss; Represents the relative error prediction bias loss; represents the relative coefficient prediction deviation loss; in, Where n represents the batch size; M b,i represents the mask value of the i-th fragment of the b-th sample; K represents the number of sensors; k represents the number of fragments into which each sensor input model data is split; s represents the length of the data in each fragment; x b,i represents the true value of the i-th fragment of the b-th sample; represents the reconstructed data of the i-th fragment of the b-th sample; x b,i,j represents the jth original data point in the i-th segment of the b-th sample; represents the reconstructed data of the jth original data point in the i-th segment of the b-th sample; and They represent the mean of the reconstructed data and the original data of the i-th fragment of the b-th sample; e b,i Indicates the actual relative error value of the i-th segment of the b-th sample; represents the model relative error prediction value of the i-th segment of the b-th sample; r b,i Indicates the actual "1-correlation coefficient" value of the i-th segment of the b-th sample; Represents the model "1-correlation coefficient" predicted value of the i-th segment of the b-th sample.
7. The structural health monitoring acceleration data repair method based on differential Transformer according to claim 1 is characterized in that: In S3, when the batch size is n, the K sensors input into the optimized differential Transformer model have a data size of [n, K, k×s], and the mask value 0-1 is discriminated with a length of s. The mask matrix is initially of size [n, K, k] and becomes [n, K×k] after the reshaping operation, and then input into the optimized differential Transformer model.
Citation Information
Patent Citations
Rotary mechanical equipment fault detection method based on monitoring data projection distribution learning
CN117992881A
Training method of ultrasonic video basic model based on edge mask and time sequence difference
CN118864383A
Apparatus and method for estimation of strain distribution of steel girder subjected to uncertain loads
KR1020140105345A