Health monitoring data anomaly detection method fusing improved attention mechanism and residual network structure

By converting structural health monitoring data into TFM images and combining them with a residual neural network that incorporates an attention mechanism, the class imbalance problem in anomaly detection is solved, thereby improving the accuracy and robustness of detection.

CN121170523BActive Publication Date: 2026-07-07ZHEJIANG SCI RES INST OF TRANSPORT

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHEJIANG SCI RES INST OF TRANSPORT
Filing Date
2025-09-19
Publication Date
2026-07-07

AI Technical Summary

Technical Problem

In structural health monitoring systems, the anomaly detection suffers from class imbalance, which causes deep learning to perform poorly on anomaly categories with small sample sizes. Furthermore, existing methods for converting time series data into images affect detection accuracy.

Method used

The original one-dimensional time series signal is sampled using a non-overlapping window segment and converted into time channel, frequency channel and Markov transfer field channel to generate TFM image. The class weights are dynamically adjusted to alleviate the data imbalance problem by using a residual neural network model with fused attention mechanism, combined with SoftMax classifier and focus loss function.

Benefits of technology

This improved the model's sensitivity to minority anomalies, enhanced its ability to distinguish anomaly data features, and improved the accuracy and robustness of anomaly detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121170523B_ABST
    Figure CN121170523B_ABST
Patent Text Reader

Abstract

The specific steps of the health monitoring data anomaly detection method fusing the improved attention mechanism and the residual network structure are as follows: S1, the original signals collected are used to construct samples in a non-overlapping manner, one-dimensional time sequence signals are converted into time domain images, frequency domain images and Markov transition field images, and the time domain images, the frequency domain images and the Markov transition field images are fused to generate TFM images; S2, the health monitoring data of known health states obtained are subjected to step S1 to obtain model training samples and perform abnormal data classification; S3, a model fusing the improved attention mechanism and the residual network is constructed as an anomaly detection model, and the model training samples are used for training; the anomaly detection model comprises a region-aware multi-modal channel attention mechanism and a residual neural network fusing the attention mechanism; S4, the health monitoring data to be monitored are input into the anomaly detection model trained in step S3 after step S1 is performed, and the type of abnormal data is output.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of bridge monitoring technology, and in particular to a method for detecting anomalies in residual network structure health monitoring data that integrates an improved attention mechanism and residual network structure. Background Technology

[0002] With the rapid development of transportation infrastructure, numerous bridges, tunnels, and other engineering structures have been built and put into use. To ensure the operational safety of these critical infrastructures, structural health monitoring systems have been widely applied. Structural health monitoring data contains crucial structural status information, and its quality is a vital foundation for ensuring the system's intended functionality. However, in complex operating environments, factors such as sensor aging and failure, damaged transmission lines, and electromagnetic interference can easily lead to anomalies in monitoring data. These anomalies severely affect the accuracy of structural health status analysis, thereby interfering with the reliability of structural safety early warning and condition assessment. Therefore, conducting research on anomaly identification in structural health monitoring is of significant engineering practical value for improving the assessment capabilities, early warning accuracy, and decision-making efficiency of structural health monitoring systems.

[0003] Anomaly detection (or anomaly diagnosis) refers to identifying data that deviates from the normal range or expected patterns in large-scale datasets. It is an important research problem in fields such as statistics, signal processing, and machine learning. Anomalies in structural health monitoring can be mainly categorized into outliers, trends, deviations, decreased accuracy, drift, periodic anomalies, constant anomalies, and missing data. Since structural health monitoring systems are data-intensive, relying on manual methods to identify anomalies from massive amounts of monitoring data would consume a significant amount of time and effort.

[0004] Deep learning-based methods for identifying structural health monitoring anomalies can quickly and accurately detect and identify them. However, the method of converting time series data into images presents a key problem. Different image conversion methods yield different features in the time series, directly impacting detection accuracy. In practical engineering, structural health monitoring anomalies often suffer from class imbalance, meaning there are significant differences in the number of samples for different anomaly categories. This leads to deep learning performing poorly on anomaly categories with fewer samples. Summary of the Invention

[0005] To overcome the shortcomings of existing technologies, this invention proposes a method for anomaly detection in health monitoring data that integrates an improved attention mechanism and a residual network structure. The original one-dimensional time-series signal is sampled using non-overlapping windows and converted into time, frequency, and Markov Transmitted Field (MTF) channels, respectively. These channels are then fused to generate a TFM (Time-Frequency-Markov) image. Subsequently, the TFM image is input into a residual neural network model with an integrated attention mechanism. A multimodal attention mechanism focuses on key images in different regions, while a channel attention mechanism adaptively focuses on key features, enhancing the model's ability to distinguish anomalies. Finally, a SoftMax classifier is used to establish a feature-class mapping relationship, and focal loss is used as the loss function. By dynamically adjusting class weights, the data imbalance problem is mitigated, thereby improving the model's sensitivity to minority class anomalies.

[0006] The technical solution adopted in this invention is:

[0007] The specific steps of integrating an improved attention mechanism with an anomaly detection method for residual network structure health monitoring data are as follows:

[0008] Step S1: Construct samples from the acquired raw signals using a non-overlapping method, convert the one-dimensional time series signal into a time-domain image, a frequency-domain image, and a Markov migration field image, and fuse the time-domain image, frequency-domain image, and Markov migration field image to generate a TFM (Time-Frequency-Markov) image.

[0009] Step S2: Perform step S1 on the health monitoring data of the known health status to obtain model training samples and classify abnormal data;

[0010] Step S3: Construct an anomaly detection model that integrates the improved attention mechanism and the residual network model, and train it using the model training samples;

[0011] The anomaly detection model includes a region-aware multimodal channel attention mechanism and a residual neural network that fuses attention mechanisms;

[0012] Step S4: Input the health monitoring data to be monitored, which was processed in step S1, into the anomaly detection model trained in step S3, and output the type of abnormal data.

[0013] Furthermore, the temporal image in step S1 is obtained as follows:

[0014] The raw time series data was divided into hourly segments (per sensor), then plotted and saved as image files. Each image was 32-bit with a resolution of 224×224.

[0015] Furthermore, the frequency domain image in step S1 is obtained as follows:

[0016] The Discrete Fourier Transform represents any signal as a superposition of a series of sinusoidal signals, thus decomposing a time-domain signal into countless discrete sine waves in the frequency domain.

[0017] ;

[0018] ;

[0019] In the formula, These are the Fourier coefficients, which are complex numbers, and their absolute values ​​are... This is called the amplitude spectrum; Let X be the nth data point in a time series X of length N. This is in the frequency domain.

[0020] Furthermore, the Markov transfer field image obtained in step S1 is as follows:

[0021] Markov transition fields are based on Markov processes and are used to describe the state transition probability between every two points in time series data, thereby enabling further analysis of the dynamic characteristics and spatial structure of the data. They divide the time series data into multiple windows, and then calculate the state transition rate in each window to obtain a transition matrix. This matrix is ​​then treated as an RGB image, i.e., an MTF image is obtained.

[0022] The steps to encode a time series data into an MTF are as follows:

[0023] S111, for time series , After normalization, the curve usually exhibits a Gaussian distribution. The dividing points under the Gaussian curve are easily identified. The area under the Gaussian curve, which follows a normal distribution, is divided into Q small regions of equal size according to the following formula, and the dividing points are considered as an ordered set of numbers. ,

[0024] ;

[0025] In the formula, Quantile window The probability, Quantile window The probability of;

[0026] S112, After determining the quantile window, the points of the time series... The elements are assigned to their corresponding windows q, and the window transitions with time step are statistically analyzed using a first-order Markov chain, thus obtaining a Q×Q weighted adjacency matrix W. Then, through... After normalization, W will be transformed into the Markov matrix shown below:

[0027] ;

[0028] S113, to improve the insensitivity of W to data distribution and time dependence, the MTF of the Markov matrix is ​​extended by aligning each probability along the time order, and is defined as follows:

[0029] ;

[0030] In MTF, Represents the transition probability between two points with a time interval of k; main diagonal It represents the maximum transition probability at a time interval of 0, indicating that the self-transition probability or state remains unchanged; for points in a time series... and points If the amplitude changes more drastically, then in the MTF... A smaller value will be assigned to these two points, indicating a lower probability of transition; conversely, if their magnitudes are similar, then in the MTF... A larger value will be assigned, indicating that the transition probability of these two points is relatively high; when the length of the original time series is N, the MTF size is N×N.

[0031] Furthermore, the region-aware multimodal channel attention mechanism in step S3 divides the output feature map of global average pooling into multiple regions, then uses one-dimensional convolution to calculate the attention weight of each region in the channel dimension, and finally uses multiplication to apply the attention weight of each region to the input feature map; the specific steps are as follows:

[0032] S311, Let the TFM image be... Where W and H represent the width and height respectively, X is divided into four regions, and the segmented image can be represented as:

[0033] ;

[0034] Among them, X 11 X 12 X 11 X 22 These represent the images of the four segmented regions.

[0035] S312, global features are obtained by compressing the images of the four regions using channel GAP. The global features can be represented as:

[0036] ;

[0037] ;

[0038] ;

[0039] ;

[0040] ;

[0041] Wherein, g(X) 11 ), g(X) 12 ), g(X) 21 ), g(X) 22 ) represent the global features within the four regions respectively; X ij This represents the value in the i-th row and j-th column of the X-image;

[0042] S313 uses four one-dimensional convolutions to construct correlation features of four different regions in the channel dimension, and then uses the sigmoid function to generate channel attention weights. The above operation can be represented as:

[0043] ;

[0044] ;

[0045] in, Represents the Sigmoid function; This represents four one-dimensional convolutions with kernel size k; C represents the number of channels. This indicates that the range of values ​​is integers;

[0046] S314, channel weight The image is obtained by upsampling using a linear interpolation method and multiplying it by X. The calculation formula is:

[0047] ;

[0048] in, Indicates multiplication by channel; This indicates upsampling.

[0049] Furthermore, the residual neural network with fusion attention mechanism in step S3 consists of eight modules, which are derived from the input image. The system starts with W=224 and H=224. The first input is a 7×7 convolutional layer (Conv) with a stride of 2 and padding of 3, resulting in 64 output channels. ReLU is used as the activation function, and the output is a 64×112×112 feature tensor. The second layer is a 3×3 max pooling layer with a stride of 2 and padding of 1, resulting in a 64×56×56 feature tensor. The third layer is a residual module consisting of two first residual attention modules. The fourth, fifth, and sixth layers are residual modules consisting of first and second residual attention modules. After the sixth layer, the output tensor size is 512×7×7. The seventh layer is a 5×5 global average pooling layer, outputting a 512-dimensional feature tensor. The eighth layer is a fully connected layer that performs a fully connected transformation, outputting 7 class classifications and using the Softmax function to output the probability of each class.

[0050] Furthermore, in step S3, an ECA module is introduced into the residual module of the residual neural network that incorporates the attention mechanism.

[0051] Furthermore, in step S3, the first residual attention module consists of two 3×3 convolutional layers with a stride of 1 and padding of 1, one ECA attention mechanism, and one cross-layer connection; the second residual attention module consists of one 3×3 convolutional layer Conv1 with a stride of 2 and padding of 1, one 3×3 convolutional layer Conv2 with a stride of 1 and padding of 1, one 1×1 downsampling layer with a stride of 2, one ECA attention mechanism, and one cross-layer connection.

[0052] Furthermore, the ECA module calculates channel attention using one-dimensional convolution after channel feature compression. Let the feature map in the ECA module... Where W, H, and C represent the width, height, and channel dimensions, respectively. The specific steps are as follows:

[0053] S321, global features are obtained by feature compression through channel GAP. GAP can then be represented as:

[0054] ;

[0055] in, Representation of feature map The value in the i-th row and j-th column;

[0056] S322, using a core size of One-dimensional convolution is used to achieve local cross-channel interaction, and then the sigmoid function is used to generate channel attention in the ECA module. The above operation can be represented as:

[0057] ;

[0058] ;

[0059] in, Represents the Sigmoid function; This represents a one-dimensional convolution with a kernel size of ; C represents the number of channels; This represents the nearest odd number to t. ;

[0060] S323, in channel weight With input feature map Multiply to obtain the calibrated feature map. The calculation formula is:

[0061] ;

[0062] in, This indicates multiplication by channel.

[0063] Furthermore, in step S3, the loss function of the anomaly detection model adopts the focus loss function, as shown in the following formula:

[0064] ;

[0065] In the formula, t represents the category of abnormal data samples in bridge structural health monitoring; It is the probability value predicted by the model for sample t; These are the weight coefficients corresponding to category sample t; It is an adjustable factor, ranging from [0, 5], and is usually taken as 2;

[0066] The smaller the value, the less accurate the identification, and the more the focus loss function tends to regard this type of abnormal data type as a small number of abnormal data types;

[0067] The larger the value, the greater the contribution of a small number of abnormal data types to the loss.

[0068] The beneficial effects of this invention are:

[0069] 1. The region-aware multimodal channel attention mechanism improves the ability of subsequent convolutional neural networks to capture abnormal data model features by dynamically adjusting the temporal, frequency, and Markov migration field importance of different regions in the TFM image, thereby enhancing the performance of abnormal data detection.

[0070] 2. ResNet (Residual Neural Network) is a deep residual network that introduces residual connections to address the vanishing and exploding gradient problems that can occur during the training of deep neural networks, allowing for the construction of deeper network structures. The original ResNet residual modules cannot effectively filter out unimportant parts during training, thus reducing the impact of noise and enabling the model to focus on meaningful features. Integrating an attention mechanism into a CNN enhances its ability to extract image features, allowing the model to focus more on important features during image processing. By allocating attention based on the importance of features at different locations, the model can focus more on task-relevant regions, thereby enhancing the representation and learning of key features. Introducing an ECA module into the ResNet residual modules dynamically adjusts the weights of feature channels, enhancing the network's ability to capture key information and improving the effectiveness of feature representation. Attached Figure Description

[0071] Figure 1 This is a schematic diagram of the framework structure of the present invention.

[0072] Figure 2 This is a schematic diagram of the time-domain spectra under various data characteristics of the present invention.

[0073] Figure 3 This is a schematic diagram of the frequency domain spectrum under various data characteristics of the present invention.

[0074] Figure 4 This is a schematic diagram of Markov transfer field spectra under various data characteristics of the present invention.

[0075] Figure 5 This is a schematic diagram of the residual neural network structure based on the fusion attention mechanism of the present invention. Detailed Implementation

[0076] The present invention will be further described below with reference to specific embodiments, but the invention is not limited to these specific embodiments. Those skilled in the art should recognize that the present invention covers all alternatives, improvements, and equivalents that may be included within the scope of the claims.

[0077] Reference Figures 1-5 This embodiment provides a method for detecting anomalies in residual network structure health monitoring data by integrating an improved attention mechanism and the method itself. The specific steps are as follows:

[0078] S1. The acquired raw signal is used to construct samples in a non-overlapping manner, and the one-dimensional time series signal is converted into a time domain image, a frequency domain image, and a Markov migration field image. The time domain image, frequency domain image, and Markov migration field image are then fused to generate a TFM (Time-Frequency-Markov) image.

[0079] The structural health monitoring data in this embodiment comes from a long-span cable-stayed bridge in my country. The monitoring system uses 38 accelerometers for continuous data acquisition, with the data acquisition period from January 1, 2012 to April 15, 2012. The raw data is divided into non-overlapping segments with a time window of 1 hour, resulting in 96,672 independent samples. Each sample is converted into a time-frequency Markov (TFM) image using data visualization methods and uniformly adjusted to 224×224 pixel RGB format. Based on the temporal morphological characteristics of the acceleration data, all samples are divided into the following 7 categories: normal, missing, second smallest, outlier, overrange oscillation, trend, and drift.

[0080] The acquisition of multimodal temporal feature maps includes:

[0081] (1) The time-domain image is obtained as follows:

[0082] The original time series data was divided into hourly segments, plotted, and saved as image files. Each image was 32-bit with a resolution of 224×224. The segmented data can be considered as window data with no overlap between two adjacent windows.

[0083] (2) The frequency domain image is obtained as follows:

[0084] The Discrete Fourier Transform (DFT) represents any signal (i.e., a one-dimensional digital signal) as a superposition of a series of sinusoidal signals, thus decomposing a time-domain signal into countless discrete sine waves in the frequency domain.

[0085] The Fourier transform decomposes a signal into sine curves of different frequencies; it is a mathematical method that converts time signals into frequency signals.

[0086] ;

[0087] ;

[0088] In the formula, These are the Fourier coefficients, which are complex numbers, and their absolute values ​​are... This is called the amplitude spectrum; Let X be the nth data point in a time series X of length N. This is in the frequency domain.

[0089] (3) The Markov transfer field image is obtained as follows:

[0090] Markov transition fields are based on Markov processes and are used to describe the state transition probability between every two points in time series data, thereby enabling further analysis of the dynamic characteristics and spatial structure of the data. They divide the time series data into multiple windows, and then calculate the state transition rate in each window to obtain a transition matrix. This matrix is ​​then treated as an RGB image, i.e., an MTF image is obtained.

[0091] The steps to encode a time series data into an MTF are as follows:

[0092] S111, for time series , After normalization, the curve usually exhibits a Gaussian distribution. The dividing points under the Gaussian curve are easily identified. The area under the Gaussian curve, which follows a normal distribution, is divided into Q small regions of equal size according to the following formula, and the dividing points are considered as an ordered set of numbers. ,

[0093] ;

[0094] In the formula, Quantile window The probability, Quantile window The probability of;

[0095] S112, After determining the quantile window, the points of the time series... The elements are assigned to their corresponding windows q, and the window transitions with time step are statistically analyzed using a first-order Markov chain, thus obtaining a Q×Q weighted adjacency matrix W. Then, through... After normalization, W will be transformed into the Markov matrix shown below:

[0096] ;

[0097] S113, to improve the insensitivity of W to data distribution and time dependence, the MTF of the Markov matrix is ​​extended by aligning each probability along the time order, and is defined as follows:

[0098] ;

[0099] In MTF, Represents the transition probability between two points with a time interval of k; main diagonal It represents the maximum transition probability at a time interval of 0, indicating that the self-transition probability or state remains unchanged; for points in a time series... and points If the amplitude changes more drastically, then in the MTF... A smaller value will be assigned to these two points, indicating a lower probability of transition; conversely, if their magnitudes are similar, then in the MTF... A larger value will be assigned, indicating that the transition probability of these two points is relatively high; when the length of the original time series is N, the MTF size is N×N.

[0100] S2, execute step S1 on the health monitoring data of known health status to obtain model training samples and classify abnormal data;

[0101] S3, construct an anomaly detection model that integrates an improved attention mechanism and a residual network model, and train it using the model training samples;

[0102] The anomaly detection model includes a region-aware multimodal channel attention mechanism and a residual neural network that fuses attention mechanisms;

[0103] The region-aware multimodal channel attention mechanism enhances the ability of subsequent convolutional neural networks to capture features of anomaly data models by dynamically adjusting the temporal, frequency, and Markov transfer field importance of different regions in a TFM image, thereby improving anomaly detection performance. The mechanism divides the output feature map of global average pooling into multiple regions, then uses one-dimensional convolution to calculate the attention weight for each region along the channel dimension. Finally, multiplication is used to apply the attention weight of each region to the input feature map to highlight the importance of different regions in each channel. The specific steps are as follows:

[0104] S311, Let the TFM image be... Where W and H represent the width and height respectively, X is divided into four regions, and the segmented image can be represented as:

[0105] ;

[0106] Among them, X 11 X 12 X 11 X 22 These represent the images of the four segmented regions.

[0107] S312, global features are obtained by compressing the images of the four regions using channel GAP. The global features can be represented as:

[0108] ;

[0109] ;

[0110] ;

[0111] ;

[0112] ;

[0113] Wherein, g(X) 11 ), g(X) 12 ), g(X) 21 ), g(X) 22 ) represent the global features within the four regions respectively; X ij This represents the value in the i-th row and j-th column of the X-image;

[0114] S313 uses four one-dimensional convolutions to construct correlation features of four different regions in the channel dimension, and then uses the sigmoid function to generate channel attention weights. The above operation can be represented as:

[0115] ;

[0116] ;

[0117] in, Represents the Sigmoid function; This represents four one-dimensional convolutions with kernel size k; C represents the number of channels. This indicates that the range of values ​​is integers;

[0118] S314, channel weight The image is obtained by upsampling using a linear interpolation method and multiplying it by X. The calculation formula is:

[0119] ;

[0120] in, Indicates multiplication by channel; This indicates upsampling.

[0121] ResNet (Residual Neural Network) is a deep residual network that introduces residual connections to address the vanishing and exploding gradient problems that can occur during the training of deep neural networks, allowing for the construction of deeper network structures. The original ResNet residual modules cannot effectively filter out unimportant parts during training, thus reducing the impact of noise and enabling the model to focus on meaningful features. Integrating an attention mechanism into a CNN enhances the ability to extract image features, allowing the model to focus more on important features during image processing. By allocating attention based on the importance of features at different locations, the model can focus more on task-relevant regions, thereby enhancing the representation and learning of key features. Introducing an ECA module into the ResNet residual modules dynamically adjusts the weights of feature channels, enhancing the network's ability to capture key information and improving the effectiveness of feature representation. The residual neural network with an attention mechanism incorporates an ECA module into the residual modules of the ResNet 18 model.

[0122] The residual neural network with an attention mechanism consists of eight modules, starting from the input image. The system starts with W=224 and H=224. The first input is a 7×7 convolutional layer (Conv) with a stride of 2 and padding of 3, resulting in 64 output channels. ReLU is used as the activation function, and the output is a 64×112×112 feature tensor. The second layer is a 3×3 max pooling layer with a stride of 2 and padding of 1, resulting in a 64×56×56 feature tensor. The third layer is a residual module consisting of two first residual attention modules. The fourth, fifth, and sixth layers are residual modules consisting of first and second residual attention modules. After the sixth layer, the output tensor size is 512×7×7. The seventh layer is a 5×5 global average pooling layer, outputting a 512-dimensional feature tensor. The eighth layer is a fully connected layer that performs a fully connected transformation, outputting 7 class classifications and using the Softmax function to output the probability of each class.

[0123] The basic idea of ​​the residual module is to add the input features to the output features of the convolutional layer, adding a skip connection to the traditional feedforward convolutional network to learn the residual mapping from input features to output features, rather than directly learning the mapping from features to output features. Compared to traditional residual modules, the first and second residual attention modules introduce an ECA attention mechanism. The first residual attention module consists of two 3×3 convolutional layers with a stride of 1 and padding of 1, one ECA attention mechanism, and one cross-layer connection. The second residual attention module consists of one 3×3 convolutional layer Conv1 with a stride of 2 and padding of 1, one 3×3 convolutional layer Conv2 with a stride of 1 and padding of 1, one 1×1 downsampling layer with a stride of 2, one ECA attention mechanism, and one cross-layer connection.

[0124] The ECA module calculates channel attention using one-dimensional convolution after channel feature compression. Let the feature map in the ECA module... Where W, H, and C represent the width, height, and channel dimensions, respectively. The specific steps are as follows:

[0125] S321, global features are obtained by feature compression through channel GAP. GAP can then be represented as:

[0126] ;

[0127] in, Representation of feature map The value in the i-th row and j-th column;

[0128] S322, using a core size of One-dimensional convolution is used to achieve local cross-channel interaction, and then the sigmoid function is used to generate channel attention in the ECA module. The above operation can be represented as:

[0129] ;

[0130] ;

[0131] in, Represents the Sigmoid function; This represents a one-dimensional convolution with a kernel size of ; C represents the number of channels; This represents the nearest odd number to t. ;

[0132] S323, in channel weight With input feature map Multiply to obtain the calibrated feature map. The calculation formula is:

[0133] ;

[0134] in, This indicates multiplication by channel.

[0135] The anomaly detection model employs a focus loss function, which is used to address class imbalance and difficulty imbalance issues. By adjusting the weight coefficients among imbalanced samples, the loss contribution from the larger number of samples is reduced, while the loss contribution from the smaller number of samples is increased. The formula is as follows:

[0136] ;

[0137] In the formula, t represents the category of abnormal data samples in bridge structural health monitoring; It is the probability value predicted by the model for sample t; These are the weight coefficients corresponding to category sample t; It is an adjustable factor, ranging from [0, 5], and is usually taken as 2;

[0138] The smaller the value, the less accurate the identification, and the more the focus loss function tends to regard this type of abnormal data type as a small number of abnormal data types;

[0139] The larger the value, the greater the contribution of a small number of abnormal data types to the loss.

[0140] S4: Input the health monitoring data to be monitored into the anomaly detection model trained in step S3 after performing step S1, and output the type of abnormal data.

[0141] To better demonstrate the effectiveness of the different components in the model mentioned in this invention, ResNet18 is used as an example.

[33] We added a region-aware multimodal channel attention mechanism module, an ECA module, and a focus loss function to the model base and conducted experiments on the MTF dataset for comparison. The experimental results were analyzed by accuracy, balanced accuracy, precision, recall, and F1 score, as shown in Table 1. The best results are shown in bold.

[0142] Table 1

[0143]

[0144] The table above shows that different combinations of attention mechanisms and loss functions have a significant impact on model performance. In the ResNet18 architecture, using the ECA module alone brings a small but comprehensive performance improvement compared to the baseline model (accuracy increases from 0.9329 to 0.9333), indicating that this lightweight global channel attention mechanism can effectively optimize feature representation without destroying the original structure. However, using the region-aware multimodal channel attention mechanism alone exhibits an interesting duality: although it leads to a significant decrease in overall accuracy (Acc=0.8774), its balanced accuracy (Ba-Acc=0.8815) is the highest among all configurations, while its precision (Precision=0.9163) is significantly higher than its accuracy (Acc=0.8774). This suggests that RMCA has a special sensitivity to minority class samples; although it sacrifices some majority class recognition ability, it demonstrates a unique advantage in handling class imbalance problems.

[0145] When the region-aware multimodal channel attention mechanism is combined with ECA, the model achieves the best overall performance (accuracy Acc = 0.9445, F1 score F1 = 0.9448). This phenomenon reveals the complementary nature of the two attention mechanisms: the region-aware multimodal channel attention mechanism focuses on extracting local region features, while ECA optimizes global channel relationships. Their synergistic effect preserves the sensitivity of RMCA to minority classes while maintaining the integrity of global features through ECA. Notably, using the focus loss function instead of the cross-entropy loss further improves the model's performance in imbalanced scenarios (balanced accuracy 0.8766). Although the overall accuracy decreases slightly, this result confirms the effectiveness of adjusting the loss function to address the data imbalance problem. The model mentioned in this invention simultaneously considers three key factors: local feature extraction, global feature optimization, and class imbalance, thus achieving optimal performance in anomaly detection.

Claims

1. A method for detecting anomalies in residual network structure health monitoring data, which integrates an improved attention mechanism, is proposed. The specific steps are as follows: S1, construct samples from the acquired raw signals using a non-overlapping method, convert the one-dimensional time series signal into time-domain image, frequency-domain image, and Markov migration field image, and fuse the time-domain image, frequency-domain image, and Markov migration field image to generate a TFM image; S2, execute step S1 on the health monitoring data of known health status to obtain model training samples and classify abnormal data; S3, construct an anomaly detection model that integrates an improved attention mechanism and a residual network model, and train it using the model training samples; The anomaly detection model includes a region-aware multimodal channel attention mechanism and a residual neural network that integrates attention mechanisms. The region-aware multimodal channel attention mechanism divides the output feature map of global average pooling into multiple regions, then uses one-dimensional convolution to calculate the attention weight of each region in the channel dimension, and finally uses multiplication to apply the attention weight of each region to the input feature map. The residual neural network that integrates attention mechanisms introduces an ECA module into the residual module. S4: Input the health monitoring data to be monitored into the anomaly detection model trained in step S3 after performing step S1, and output the type of abnormal data.

2. The method according to claim 1, wherein the method is characterized in that: The time-domain image obtained in step S1 is as follows: The original time series data is segmented into one-hour segments, then plotted into graphs, and saved as image files, each image is 32-bit, resolution is 224 224.

3. The method according to claim 2, wherein the method is characterized in that: The frequency domain image obtained in step S1 is as follows: The Discrete Fourier Transform represents any signal as a superposition of a series of sinusoidal signals, thus decomposing a time-domain signal into countless discrete sine waves in the frequency domain. ; ; In the formula, These are the Fourier coefficients, which are complex numbers, and their absolute values ​​are... This is called the amplitude spectrum; Let X be the nth data point in a time series X of length N. This is in the frequency domain.

4. The method for detecting anomalies in health monitoring data of residual network structures by fusing improved attention mechanisms and residual network structures according to claim 1, characterized in that: The Markov transfer field image obtained in step S1 is as follows: Markov transition fields are based on Markov processes and are used to describe the state transition probability between every two points in time series data, thereby enabling further analysis of the dynamic characteristics and spatial structure of the data. They divide the time series data into multiple windows, and then calculate the state transition rate in each window to obtain a transition matrix. This matrix is ​​then treated as an RGB image, i.e., an MTF image is obtained. The steps to encode a time series data into an MTF are as follows: S111, for time series , After normalization, the curve usually exhibits a Gaussian distribution. The dividing points under the Gaussian curve are easily identified. The area under the Gaussian curve, which follows a normal distribution, is divided into Q small regions of equal size according to the following formula, and the dividing points are considered as an ordered set of numbers. , ; In the formula, Quantile window The probability, Quantile window The probability of; S112, After determining the quantile window, the points of the time series... Assigned to its corresponding window In the middle, the window transition with time step is statistically analyzed using a first-order Markov chain, thus obtaining... Weighted adjacency matrix Then through After normalization, This will be transformed into a Markov matrix as shown below: ; S113, to improve Insensitivity to data distribution and time dependence is achieved by extending the MTF of the Markov matrix by aligning each probability along the time order, and it is defined as follows: ; In MTF, Represents the transition probability between two points with a time interval of k; main diagonal It represents the maximum transition probability at a time interval of 0, indicating that the self-transition probability or state remains unchanged; for points in a time series... and points If the amplitude changes more drastically, then in the MTF... They will be assigned smaller values, indicating that the transition probability between these two points is lower; Conversely, if the amplitudes of the two are similar, then in the MTF... A larger value will be assigned, indicating a higher probability of transition between these two points; when the original time series length is N, the MTF size is... .

5. The method for detecting anomalies in health monitoring data of residual network structures by fusing improved attention mechanisms and residual network structures according to claim 1, characterized in that: The specific steps of the region-aware multimodal channel attention mechanism in step S3 are as follows: S311, Let the TFM image be... Where W and H represent the width and height respectively, The image is divided into four regions, and the segmented image can be represented as follows: ; in, , , , These represent the images of the four segmented regions. S312, global features are obtained by compressing the images of the four regions using channel GAP. The global features can be represented as: ; ; ; ; ; in, , , , These represent the global features within the four regions respectively; express The value in the i-th row and j-th column of the image; S313 uses four one-dimensional convolutions to construct correlation features of four different regions in the channel dimension, and then uses the sigmoid function to generate channel attention weights. The above operation can be represented as: ; ; in, Represents the Sigmoid function; This represents a one-dimensional convolution with four kernels of size k; Indicates the number of channels; This indicates that the range of values ​​is integers; S314, channel weight Upsampling was performed using the linear interpolation method. Multiply to obtain the calibrated image. The calculation formula is: ; in, Indicates multiplication by channel; This indicates upsampling.

6. The method for detecting anomalies in health monitoring data of the fusion improved attention mechanism and residual network structure as described in claim 5, characterized in that: The residual neural network with fusion attention mechanism in step S3 consists of 8 modules, starting from the input image. Departure, where W=224, H=224; the first input is A convolutional layer Conv with a stride of 2, padding of 3, and 64 output channels uses ReLU as the activation function. The output result is... The characteristic tensor; The second layer is A max-pooling layer with a stride of 2 and a fill value of 1 is used to output the results. The feature tensor; the third layer is a residual module composed of two first residual attention modules; the fourth, fifth, and sixth layers are residual modules composed of first and second residual attention modules; after the sixth layer, the output tensor size is The seventh floor is The first layer is a global average pooling layer, which outputs a 512-dimensional tensor as its feature; the eighth layer is a fully connected layer that performs a fully connected transformation and outputs 7 categories, using the Softmax function to output the probability of each category.

7. The method for detecting anomalies in health monitoring data of residual network structures by fusing improved attention mechanisms and residual network structures according to claim 6, characterized in that: In step S3, the first residual attention module consists of 2 The first convolutional layer consists of a stride of 1, padding of 1, an ECA attention mechanism, and a cross-layer connection; the second residual attention module consists of 1 A convolutional layer Conv1 with a stride of 2 and padding of 1, 1 A Conv2 convolutional layer with a stride of 1 and padding of 1, 1 It consists of a downsampling layer with a step size of 2, an ECA attention mechanism, and a cross-layer connection.

8. The method for detecting anomalies in health monitoring data of residual network structures by fusing improved attention mechanisms and residual network structures according to claim 7, characterized in that: The ECA module calculates channel attention using one-dimensional convolution after channel feature compression. Let the feature map in the ECA module... Where W, H, and C represent the width, height, and channel dimensions, respectively. The specific steps are as follows: S321, global features are obtained by feature compression through channel GAP. GAP can then be represented as: ; in, Representation of feature map The value in the i-th row and j-th column; S322, using a core size of One-dimensional convolution is used to achieve local cross-channel interaction, and then the sigmoid function is used to generate channel attention in the ECA module. The above operation can be represented as: ; ; in, Represents the Sigmoid function; This indicates that the size of one core is... One-dimensional convolution; Indicates the number of channels; This represents the nearest odd number to t. , ; S323, in channel weight With input feature map Multiply to obtain the calibrated feature map. The calculation formula is: ; in, This indicates multiplication by channel.

9. The method for detecting anomalies in health monitoring data of residual network structures by fusing improved attention mechanisms and residual network structures according to claim 1, characterized in that: In step S3, the loss function of the anomaly detection model adopts the focus loss function, as shown in the following formula: ; In the formula, These are samples of abnormal data categories from bridge structural health monitoring. It is the probability value predicted by the model for sample t; These are the weight coefficients corresponding to category sample t; It is an adjustable factor, ranging from [0, 5], and is usually taken as 2; The smaller the value, the less accurate the identification, and the more the focus loss function tends to regard this type of abnormal data type as a small number of abnormal data types; The larger the value, the greater the contribution of a small number of abnormal data types to the loss.