A bolt connection state cross-domain small sample ultrasonic guided wave monitoring method
By converting ultrasonic guided wave signals into two-dimensional grayscale images using a cross-domain small sample prototype network model, the problems of strong dependence on labeled data and poor cross-domain generalization ability of deep learning models are solved, and high-precision monitoring and positioning of bolt connection status in complex structures are realized.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NORTHWESTERN POLYTECHNICAL UNIV
- Filing Date
- 2026-03-12
- Publication Date
- 2026-07-03
AI Technical Summary
Existing deep learning models rely heavily on labeled data for bolt connection condition monitoring, requiring large datasets and exhibiting poor cross-domain generalization ability, especially performing poorly in complex structures.
By constructing a cross-domain few-sample prototype network model, ultrasonic guided wave signals are converted into two-dimensional grayscale images. An embedding function module, a set function module, an attention weight generation module, and a metric classification module are designed and trained using the source domain dataset to achieve high-precision monitoring of the bolt connection status in the target domain.
High-precision bolt connection status monitoring can be achieved with only a very small number of labeled samples of the target structure, reducing the dependence on massive amounts of labeled data, improving the feasibility and economy of structural health monitoring, effectively overcoming the data distribution differences between the source domain and the target domain, and realizing high-precision damage monitoring and location.
Smart Images

Figure CN122330299A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of structural health monitoring technology, specifically relating to a cross-domain small-sample ultrasonic guided wave detection method for bolted connection states. Background Technology
[0002] In recent years, with the rapid development of aerospace technology, efficient and rapid operation and maintenance of aircraft structures are crucial for ensuring the high performance and high reliability of aircraft equipment. Bolted connections are widely used due to their ease of assembly and disassembly and high load-bearing capacity; for example, they are used in solid rocket motors, liquid rocket motors, and reusable spacecraft. However, due to improper installation and harsh service environments, bolted connections are prone to losing their preload, thereby reducing the usability, safety, and reliability of the structure. Therefore, online monitoring of bolt loosening in aerospace structures is of great significance to ensure the safe operation of bolted connections.
[0003] Structural Health Monitoring (SHM) technology generally refers to the process of applying damage diagnosis in infrastructure such as aerospace, civil, and mechanical engineering. For bolted structures, commonly used health monitoring techniques mainly fall into three categories: vibration-based, mechanical impedance-based, and ultrasonic guided wave-based methods. Vibration-based SHM technology uses the overall dynamic characteristics of the structure, such as natural frequencies, modes, and frequency response functions, to monitor structural damage, but this method is not sensitive to changes in local damage. Mechanical impedance-based methods determine bolt preload by monitoring changes in mechanical impedance at bolted connections and identify structural damage by measuring changes in mechanical impedance, but this method has a poor global monitoring range. When guided waves propagate in a structure, they scatter when they encounter damage, and the damage status of the structure can be monitored by analyzing the received signals. Ultrasonic guided waves have a large monitoring range and are sensitive to small damage, and have been widely studied in the field of structural health monitoring. However, the propagation mechanism of guided waves at bolt holes is complex, and traditionally, it relies on manual extraction of guided wave features of damage. However, manually extracted guided wave data features have problems such as low sensitivity. Therefore, feature extraction technology has become a key issue in guided wave structural health monitoring.
[0004] In recent years, machine learning (ML) has demonstrated powerful feature extraction and pattern recognition capabilities. Traditional machine learning models use features from the input data to predict results, and traditional machine learning methods often require manual feature extraction. Deep learning technology can achieve automatic feature extraction, and it has already begun to be successfully applied in the field of bolt preload monitoring. Using deep learning, multi-layer feature self-learning can be performed on guided wave signals of bolted connections to extract features that reflect the bolt preload state and are beneficial for classification tasks, thereby improving the efficiency and accuracy of bolt preload monitoring tasks.
[0005] However, the performance of deep learning models depends on the size of the training dataset, but in practice, obtaining a sufficient number of labeled data categories usually requires significant manual and economic costs. Therefore, developing a technique that can achieve deep learning tasks with only a small number of samples is particularly important. Against this backdrop, the Few Shot Learning (FSL) method was proposed. Existing FSL methods are mainly divided into three categories: model fine-tuning-based, meta-learning-based, and metric learning-based. Among them, metric learning-based methods (such as prototype networks) have attracted attention due to their simplicity and efficiency. However, standard prototype networks and other models were originally designed for image recognition, and when directly applied to one-dimensional guided wave signal processing, they failed to fully exploit the metric relationships between signal features. More importantly, when the training data (source domain, such as a simple flat plate structure) and the test data (target domain, such as a complex bolted connection structure) come from different structures and there are significant differences in data distribution (i.e., the cross-domain problem), the performance of standard prototype networks drops sharply, exhibiting poor generalization ability. Summary of the Invention
[0006] To address the problems of existing deep learning-based structural health monitoring technologies, such as strong dependence on labeled data, large dataset requirements, and poor cross-domain generalization ability, this invention provides a cross-domain small-sample ultrasonic guided wave monitoring method for bolt connection states. This invention converts the acquired dataset into two-dimensional grayscale images and designs and constructs a cross-domain small-sample prototype network model. By utilizing a large amount of readily available data from the source domain and a very small number of labeled samples from the target domain for training and optimization, it achieves high-precision and robust monitoring and localization of bolt loosening states on new structures.
[0007] To achieve the above objectives, the technical solution provided by this invention is:
[0008] A method for cross-domain small-sample ultrasonic guided wave monitoring in bolted connection states includes the following steps:
[0009] Step 1: Construct a source domain auxiliary dataset for ultrasonic guided wave signals;
[0010] Labeled ultrasonic guided wave signals under various simulated damage states are acquired in the source domain structure to construct a source domain auxiliary set A. Each sample in the source domain auxiliary set A contains the original one-dimensional ultrasonic guided wave time domain signal and its corresponding simulated damage state category label.
[0011] Step 2: Data preprocessing;
[0012] Data processing is performed on the ultrasonic guided wave signals in the source domain auxiliary set A obtained in step 1. The original one-dimensional ultrasonic guided wave time domain signals are preprocessed to convert the original one-dimensional ultrasonic guided wave time domain signals of all samples into two-dimensional grayscale images.
[0013] Step 3: Construct a cross-domain few-shot prototype network model;
[0014] During model training and optimization, the cross-domain few-shot prototype network model takes two-dimensional grayscale images of the auxiliary support set and auxiliary query set sampled from the source domain auxiliary set A as input, and outputs the probability that the query sample belongs to each bolt connection condition category; the bolt connection condition categories include fully loose state, semi-loose state and tightened state.
[0015] The cross-domain few-shot prototype network model includes an embedding function module, an ensemble function module, an attention weight generation module, a prototype computation module, and a metric classification module; among which:
[0016] The embedding function module is used to extract high-dimensional embedding feature vectors from the input two-dimensional grayscale image;
[0017] The set function module is used to receive high-dimensional embedded feature vectors from the support set samples of the embedding function module, and to model the set relationships of sample features within the same category to enhance the feature representation of each sample;
[0018] The attention weight generation module is used to receive the features of each sample in the support set samples after they have been enhanced by the set function module, and to calculate the attention weight of each support set sample.
[0019] The prototype calculation module is used to use the attention weights output by the attention weight generation module to perform a weighted average of the sample features of each category in the support set, and obtain the prototype vectors of each category.
[0020] The metric classification module expands the attention weights output by the attention weight generation module into feature dimension weights, and uses the expanded feature dimension weights to perform a weighted calculation on the distance between the prototype vector and the embedded feature vector of the query sample in the query set, outputting the probability that the query sample belongs to each category.
[0021] Step 4: Train and optimize the constructed cross-domain few-shot prototype network model;
[0022] An interstitial training mechanism is adopted, and training interstitials are constructed by randomly sampling from the source domain auxiliary set A after step 2. Each training interstitial contains an auxiliary support set and an auxiliary query set. The cross-domain few-shot prototype network model constructed in step 3 is trained and optimized using the auxiliary support set and the auxiliary query set to obtain the optimal model parameters.
[0023] Step 5: Monitoring and locating loose bolts in a small sample within the target domain;
[0024] Step 5.1, construct the target domain dataset;
[0025] Labeled ultrasonic guided wave signals under various real bolt loosening conditions are acquired on the bolted connection structure of the target domain to be monitored. Several samples from each condition are randomly selected to construct the target domain support set S, and the remaining samples are constructed as the target domain query set Q. Each sample in the target domain support set S contains the original one-dimensional ultrasonic time-domain signal and its corresponding real bolt loosening condition category label. Each sample in the target domain query set Q contains the original one-dimensional time-domain signal, and its category label is unknown.
[0026] Step 5.2, target domain data preprocessing;
[0027] Perform the same data processing as in step 2 on the original one-dimensional ultrasonic guided wave time domain signals in the target domain support set S and target domain query set Q obtained in step 5.1, and convert the one-dimensional time domain signals of all samples into two-dimensional grayscale images.
[0028] Step 5.3, Monitoring Applications;
[0029] Using the target domain support set S after data preprocessing in step 5.2 as the support set and the target domain query set Q as the query set, input the cross-domain small sample prototype network model trained in step 4, identify the probability that each query sample in the target domain query set Q belongs to each bolt connection condition category, take the category with the highest probability as the predicted category of the query sample, and combine it with the sensor position information to realize the location of loose bolts.
[0030] Furthermore, the steps in steps 2 and 5.2 to convert the original one-dimensional ultrasound time-domain signal into a two-dimensional grayscale image include:
[0031] The acquired original one-dimensional ultrasonic guided wave time-domain signal was sequentially filtered and normalized.
[0032] According to the preset truncation length, a one-dimensional ultrasonic guided wave time domain signal segment after filtering and normalization is truncated, the one-dimensional ultrasonic guided wave time domain signal segment is converted into a two-dimensional Hankel matrix, and the two-dimensional Hankel matrix is converted into a two-dimensional grayscale image.
[0033] Furthermore, in step 3, the embedding function module is a convolutional neural network, which includes multiple convolutional layers. After each convolutional layer, a feature transformation layer is embedded and arranged between the batch normalization layer and the ReLU activation function layer to perform affine transformation on the features output by the convolutional layer in order to simulate the feature distribution of different data domains.
[0034] Furthermore, the feature transformation layer uses the Fourier Transform (FT) layer to process the batch-normalized feature maps. Perform an element-wise affine transformation to generate the transformed feature map. The transformation formula is:
[0035]
[0036] In the formula, ; ; Subscript These represent the channels, height, and width of the feature map, respectively. The dimension of the feature map; and These are learnable affine transformation parameters with the same dimension as the input feature map, where:
[0037]
[0038]
[0039] In the formula, For activation function, ; and It is a learnable hyperparameter matrix, whose dimension is... and same; and It is random noise sampled from a Gaussian distribution with a mean of 0 and a standard deviation of 1.
[0040] Furthermore, in step 3, the set function module employs a DeepSets network structure with permutation invariance. It enhances the feature representation of each sample by converting the high-dimensional embedding feature vectors of samples in the target domain support set of a single event into a task-specific representation. The specific conversion method is as follows:
[0041]
[0042] In the formula, Indicates support for the centralized first Class 1 Embedded vectors, Represents the transformed th Class 1 There are several embedded vectors, where ⊕ represents a vector concatenation operation; Indicates the first Except for the first class Besides the embedded vectors, the rest Element-wise maximum aggregation operation of embedded vectors; function sum function Both are two-layer fully connected networks with ReLU activation functions.
[0043] Furthermore, the attention weight generation module adopts a structure combining dual-channel pooling and one-dimensional convolution. It is configured to: perform average pooling and max pooling operations on the sample features of the same category in the support set, and concatenate the average pooling results and max pooling results before inputting them into the one-dimensional convolutional layer to generate a preliminary attention response map; and apply the Softmax function to normalize the preliminary attention response map in the sample feature dimension of the support set to obtain the final attention weight of each sample in the output support set.
[0044] Furthermore, the metric classification module uses weighted Euclidean distance to calculate the distance between the prototype vector and the embedded feature vector of the query sample in the query set. The formula for calculating the weighted Euclidean distance is:
[0045]
[0046] In the formula, Indicates support for the centralized first Prototype vectors of each category; prototype vector The feature dimension weight vector is obtained by expanding the attention weights output by the attention weight generation module. Its dimension and prototype vector The dimensions are the same; Indicates the first in the query set Embedded feature vectors of each query sample; This represents the total number of dimensions of the embedded feature vector, i.e., the length of the feature vector; It is the dimension index, with values ranging from 1 to... ; It supports the centralized first The prototype vector at the th... The weights in each dimension are derived from the attention weights. It is the first in the query set The embedded feature vector of the query sample at the th query sample is in the th... Values in each dimension; It supports the centralized first The prototype vectors of the n categories in the nth case The values in each dimension.
[0047] Furthermore, in step 4, the episode training mechanism is as follows:
[0048] Divide the source domain auxiliary set A into a training subset and a validation subset. Both the training subset and the validation subset include an auxiliary support set and an auxiliary query set. Randomly select multiple categories in the training subset to construct several training episodes simulating few-sample tasks. The training episodes include an auxiliary support set and an auxiliary query set. Perform a preset number of episode training sessions in each training cycle. After each training cycle, evaluate the model performance using an independent validation subset. When the prediction accuracy using the validation subset no longer improves in a consecutive number of training cycles, terminate the model training and use the current model parameters as the optimal model parameters.
[0049] During the training of interludes, a fusion cross-entropy loss function is used. The composite loss function, consisting of the Davies-Bouldin index, is used to train and optimize the cross-domain few-shot prototype network model. for:
[0050]
[0051] In the formula, The Davies-Bouldin index. This refers to the scaling hyperparameters of DBI.
[0052] Furthermore, in step 4, the Adam optimization algorithm is used to train and optimize the cross-domain few-sample prototype network model, and a hierarchical learning rate strategy is adopted. The first learning rate is used for the parameters of the embedding function module and the set function module, and the second learning rate is used for the parameters of the feature transformation layer. The first learning rate is less than the second learning rate.
[0053] Furthermore, in step 5.3, the process of classifying and identifying the bolt connection status of the target domain small samples using the trained cross-domain few-sample prototype network model is as follows:
[0054] The target domain support set S, after data preprocessing, is used as the support set and input into the cross-domain few-sample prototype network model trained in step 4 to calculate the prototype vectors for various loosening conditions.
[0055] The target domain query set Q, after data preprocessing, is used as the query set and input into the cross-domain small sample prototype network model trained in step 4. By calculating the weighted distance between the model and the prototype vectors of various loosening conditions, the probability of each query sample in the target domain query set Q belonging to each bolt loosening condition category is obtained. The category with the highest probability is taken as the predicted category of the query sample.
[0056] The advantages of this invention are:
[0057] 1. This invention introduces a source domain auxiliary dataset and designs a specialized cross-domain small sample prototype network model. It requires only a very small number of labeled samples (about 5 training samples per type of damage) of each working condition on the target structure to quickly adapt to new structures and accurately monitor the bolt connection status. This greatly reduces the dependence on massive labeled data of the target structure and significantly improves the feasibility and economy of ultrasonic guided wave-based structural health monitoring technology in engineering practice.
[0058] 2. This invention achieves effective migration and high-precision damage monitoring from a readily available source domain to a target domain of complex engineering structures by designing a feature transformation layer to simulate domain shift, an ensemble function module to enhance sample representation, and DBI loss to optimize the feature space. This effectively overcomes the problem of data distribution differences between the source domain (simple structures) and the target domain (complex engineering structures). Experiments demonstrate that even when the source and target domains have significant structural differences, this method maintains monitoring accuracy and exhibits strong model generalization ability.
[0059] 3. This invention uses an attention mechanism to select representative samples and weighted distance for fine measurement, enabling the acquisition of high-quality category prototypes and classification boundaries even with very few samples. This allows for high-precision identification of bolt loosening states (e.g., fully loose, partially loose, and tightened). Combining the model classification results with bolt position information obtained from sparsely arranged sensors on the target structure, the location of loose bolts can be accurately pinpointed, providing direct and precise information support for maintenance decisions. Attached Figure Description
[0060] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:
[0061] Figure 1 This is a flowchart of the cross-structure small sample bolt loosening monitoring process in an embodiment of the present invention;
[0062] Figure 2 This is a schematic diagram of a flat panel structure used for collecting source domain dataset data in an embodiment of the present invention; in the figure, PZT1 is the excitation piezoelectric element, PZT2 is the receiving piezoelectric element, and the numbers are the numbers of the 16 square grids.
[0063] Figure 3 This is an example image of a two-dimensional grayscale image obtained by converting a one-dimensional ultrasonic guided wave signal in an embodiment of the present invention;
[0064] Figure 4 This is a structural block diagram of the cross-domain few-shot prototype network model constructed in this invention;
[0065] Figure 5 This is a schematic diagram of the attention weight generation module in this invention;
[0066] Figure 6 This is a schematic diagram of the structure and operation of the feature transformation layer in this invention;
[0067] Figure 7 This is a schematic diagram of a bolted connection structure used to collect target domain dataset data in an embodiment of the present invention; where (a) is the front view and (b) is the top view; in (b), the red numbers #1 to #10 are the bolt numbers for loosening monitoring, and the bolts with the other tail marks are always kept in a tightened state;
[0068] Figure 8 This is the result of t-SNE dimensionality reduction visualization of the source domain dataset features using the standard ProtoNet model; t-SNE, or t-distributed random neighborhood embedding algorithm, is a visualization method used to reduce high-dimensional data to two or three-dimensional space in order to observe its distribution characteristics.
[0069] Figure 9 This is a visualization of the result of using the cross-domain few-sample prototype network model of this invention to perform t-SNE dimensionality reduction on the features of the source domain dataset;
[0070] Figure 10 This is a visualization of the result of t-SNE dimensionality reduction of the target domain dataset features using the standard ProtoNet model;
[0071] Figure 11 This is a visualization of the t-SNE dimensionality reduction of the target domain dataset features using the cross-domain few-sample prototype network model of this invention. Detailed Implementation
[0072] The embodiments of the present invention are described in detail below. These embodiments are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.
[0073] Considering the current limitations of deep learning models in bolt preload classification tasks, such as strong dependence on labeled data, large required amounts of labeled data, and weak cross-domain capabilities, it is necessary to construct a suitable model that can achieve bolt preload classification with only a small amount of labeled data in order to improve the accuracy and precision of bolt preload classification and enhance its practical application. Based on this, this invention provides a cross-domain small-sample learning ultrasonic guided wave bolt loosening monitoring method suitable for bolted connection structures (refer to...). Figure 1 ), including the following steps:
[0074] Step 1: Construct a source domain auxiliary dataset for ultrasonic guided wave signals.
[0075] Ultrasonic guided wave signals under multiple damage states are acquired on the source domain structure to construct a source domain auxiliary set A. In this embodiment of the invention, a flat plate test specimen is used as the source domain structure, such as... Figure 2 As shown. This structure is simpler than bolted connections and makes it easier to obtain a sufficient number of tagged data. The plate material is aluminum 2024, and the plate dimensions (length, width, height) are 500mm × 500mm × 2mm. A 200mm × 200mm square area is taken in the center of the plate, and this area is divided into 16 square grids, each grid measuring 50mm × 50mm. A piezoelectric element is attached to each side of the area, one side being the excitation voltage element PZT1 and the other side being the receiving voltage element PZT2. The voltage elements are model P5-1, with a diameter of 8mm and a thickness of 0.5mm; voltage element PZT1 is used to excite the guided wave signal, and voltage element PZT2 is used to receive the signal. A 3.5-cycle sinusoidal signal modulated by a Hanning window is selected as the excitation signal, with a center frequency of 150kHz and a sampling frequency of 20MHz. In the experiment, a localized concentrated mass was applied to selected locations to simulate different types of damage to the plate. Specifically, circular magnets were placed sequentially in 16 squares within the orange area of the plate to simulate 16 different damage locations. Each magnet was 20mm × 1mm in size, and five magnets were placed simultaneously. The plate was considered undamaged when no magnets were placed, resulting in a total of 17 simulated damage states. Multiple excitation-receiver pairs were sparsely arranged on the source domain structure. Excitation and guided wave signals were received under each damage state. The guided wave signals measured under different damage states by the excitation-receiver pairs were used as source domain data.
[0076] During the experiment, a water-based coupling agent was used to couple the magnet and the aluminum plate at their contact points. Each simulated damage state was measured 40 times, yielding 40 guided wave signals. Every 20 repeated measurements, the magnet in the grid was slightly moved, which increased the intra-class variation of the guided wave signals in a single simulated damage state, beneficial for subsequent model training. A total of 680 samples labeled with bolted connection states were obtained, forming a labeled source domain auxiliary set A. Each sample in source domain auxiliary set A contains the original one-dimensional ultrasonic time-domain guided wave signal and its corresponding simulated damage state category label. During model training and optimization, the constructed cross-domain small-sample prototype network model took the two-dimensional grayscale images of the auxiliary support set and auxiliary query set sampled from source domain auxiliary set A as input, and output the probability that the query sample in the auxiliary query set belongs to each bolted connection condition category. Bolted connection condition categories include fully loose, partially loose, and tightened states. When obtaining the source domain auxiliary set, the source domain structure used only needs to be similar in scale to the target structure (the monitored test piece), and bolted connections are not required.
[0077] To monitor model performance and implement early stopping strategies during subsequent training, the source domain auxiliary set A is randomly divided into a training subset and a validation subset in a 6:3 ratio. The training subset is used for intermittent training of the model, while the validation subset is used to evaluate model performance at the end of each training cycle in order to preserve the optimal model parameters.
[0078] Step 2, source domain data preprocessing.
[0079] Step 2.1: The original one-dimensional ultrasonic guided wave signal (original source domain and target domain experimental signal) is sequentially filtered and normalized. In this embodiment of the invention, an FIR bandpass filter with a passband of 60~550kHz is used to filter the original guided wave signal, and then maximum and minimum value normalization is used to map the signal amplitude to the [0,1] interval.
[0080] Step 2.2: Extract the filtered and normalized guided wave signal of the set length from the previous step, and convert it into a two-dimensional image using the Hankel matrix.
[0081] In this embodiment of the invention, a 400-microsecond segment of the guided wave one-dimensional time-domain signal is extracted from the filtered and normalized signal. This segment mainly contains the direct wave of the ultrasonic guided wave propagating in the structure and the wave packet formed by early reflections from the bolt connection interface, concentrating key information related to the bolt loosening state while effectively eliminating noise interference caused by later complex boundary reflections. The extracted one-dimensional time-domain signal is then converted into a two-dimensional image matrix (e.g., a two-dimensional HanKel matrix) and further converted into a grayscale image, such as... Figure 3 As shown. For a one-dimensional time-domain signal sequence of original length 2n-2... The n×n dimensional Hankel matrix formed for:
[0082] (1)
[0083] In the formula, for The HanKel matrix; The first one in a one-dimensional guided wave data sequence One element, .
[0084] The obtained Hankel matrix is normalized and mapped to grayscale values, resulting in a two-dimensional grayscale image. To adapt to the input format of the pre-trained network, the single-channel grayscale image is copied as a three-channel RGB image. At this point, all samples in the source domain auxiliary set A have been converted into two-dimensional grayscale images.
[0085] Step 3: Construct a cross-domain few-shot prototype network model.
[0086] During model training and optimization, the input to the constructed cross-domain few-sample model is a two-dimensional grayscale image of the auxiliary support set and auxiliary query set sampled from the source domain auxiliary dataset A after step 2 processing. For ease of model training, the two-dimensional grayscale image is a converted three-channel RGB image. The output is the probability that the query sample in the source domain auxiliary dataset A belongs to each bolt connection condition category, thus obtaining the classification and identification result of the bolt preload corresponding to the two-dimensional grayscale image of the query sample. The bolt connection condition categories include fully loose, partially loose, and tightened states. In actual target domain bolt connection status monitoring, the model input is a small amount of labeled target domain dataset (including the target domain support set S and the target domain query set Q) after data preprocessing, to classify and identify the bolt preload of samples in the target domain query set Q, i.e., accurately identifying which bolt the grayscale image of an unknown condition (target domain query set Q) belongs to and identifying the magnitude of the bolt preload. Prototypical Networks (ProtoNet) are a typical metric learning method. During computation, this network assumes that each class has a prototype in the embedding space, and uses the mean of the embedding vectors of each support class sample as its corresponding prototype representation. Then, a metric classification module compares the distance between the query (test) sample and the prototype of each class to perform nearest neighbor classification. (See reference...) Figure 4 The cross-domain few-shot prototype network model proposed in this invention is an improvement on the prototype network, including an embedding function module, an ensemble function module, an attention weight generation module, a prototype calculation module, and a metric classification module. Wherein:
[0087] (1) Embedded function modules
[0088] The embedding function module employs a convolutional neural network to extract high-dimensional embedding feature vectors from the input two-dimensional image data. A feature transformation layer is embedded after multiple convolutional layers of the embedding function to enhance the diversity of the model's feature distribution and simulate features from different domains. In this embodiment, the embedding function module uses a four-layer convolutional network (Conv4) architecture, specifically composed of four sequentially connected convolutional layers. Each convolutional layer contains 64 3×3 convolutional kernels, a batch normalization layer, a ReLU activation function, and a 2×2 max-pooling layer for downsampling. Specifically, the first convolutional layer receives the input three-channel RGB image and extracts features using 64 3×3 convolutional kernels with a stride of 1 and padding of 1 to maintain the spatial size of the feature map. The second, third, and fourth convolutional layers all maintain 64 output channels, with the same 3×3 kernel size. After each convolutional operation, a batch normalization layer standardizes the feature distribution, and then a ReLU activation function introduces non-linear transformation capability. After each convolutional layer, the model employs a max-pooling layer with a kernel size of 2×2 and a stride of 2. This layer progressively reduces the spatial dimension of the feature map through downsampling while simultaneously expanding the receptive field to capture a wider range of contextual information. After four such convolution-pooling combinations, the max-pooling layer further reduces the spatial size of the feature map, ultimately yielding a fixed-dimensional feature vector through global average pooling.
[0089] After each convolutional layer of the embedding function module, a feature transformation layer (such as...) is inserted. Figure 6 As shown in the diagram, the feature map is positioned between the batch normalization layer and the ReLU activation function layer to perform an affine transformation on the features output by the convolutional layer, simulating the feature distribution of different data domains. In actual model implementation, multiple feature transformation layers can be inserted into the embedding function depending on the number of convolutional layers. In this embodiment, the Fourier Transform (FT) layer is used as the affine transformation layer, which is inserted between the batch normalization layer and the activation function of each convolutional layer to diversify the feature distribution and enhance cross-domain generalization ability. Specifically, for the first convolutional layer, the feature map output by its batch normalization layer is... The FT layer utilizes affine transformation parameters and Perform an element-wise affine transformation on the feature map to generate the transformed feature map. The conversion formula is shown in equation (2):
[0090] (2)
[0091] In the formula, , ; Subscript These represent the channel, height, and width positions of the feature map, respectively. It has the same dimension as the input feature map. Learnable affine transformation parameters, As a scaling factor, it is responsible for adjusting the scale (amplitude) of the feature. As a translation factor, it is responsible for adjusting the mean (bias) of the features. By introducing different, learnable scaling and translation at each spatial location and each channel, the feature transformation layer can simulate the diverse distribution of signal amplitude and baseline in different data domains, thereby enhancing the robustness of the model to domain changes.
[0092] To prevent affine transformation parameters and In the early stages of model training, drastic changes can lead to training instability. This invention employs a reparameterization strategy, namely... and It is not directly used as a trainable variable, but rather derived from two other basic trainable variables. and Generated through the following mapping:
[0093] (3)
[0094] (4)
[0095] In the formula, For activation function, ; and It is a learnable hyperparameter matrix, whose dimension is... and same; and It is random noise sampled from a Gaussian distribution, specifically random noise sampled from a standard normal distribution N(0,1) with a mean of 0 and a standard deviation of 1. During model training... As a hyperparameter, through optimization and The model can indirectly learn the optimal... and In this embodiment of the invention, and The initial values are set to a matrix with all parameters equal to 1 and a matrix with all parameters equal to 0, respectively. This is determined based on experimental experience, which allows the model to have appropriate domain perturbation in the early stage of training, which is conducive to rapid adaptation in the later stage.
[0096] (3) Set function module
[0097] The ensemble function module receives embedded feature tensors from the support set samples of the feature extraction module. It models the set relationships of sample features within the same category using a deep ensemble function, enhancing the feature representation of each sample. The ensemble function module has dimensions of [number of categories (N), number of samples per category (K), feature dimension (D)]. Internally, the ensemble function module constructs a symmetric ensemble function, whose processing flow includes three key steps: The first step is context information aggregation: To eliminate the influence of the sample itself, a K×K mask matrix is created, with all elements being 1 except for the elements on its main diagonal, which are 0. This mask is applied to the rearranged feature tensor, and then the features of all other samples corresponding to each sample (i.e., its context samples) are aggregated through a maximization operation, thereby accurately generating a preliminary context feature representation. The second step is dual-path feature transformation and fusion: The context features first undergo a transformation path consisting of a fully connected layer (expanding from D-dimensional to 4D-dimensional), a ReLU activation function, and another fully connected layer (compressing from 4D-dimensional back to D-dimensional). Simultaneously, the original features and the transformed context features are concatenated along the feature dimension (resulting in 2D features), and then deeply fused through another set of structurally similar fully connected layers (2D→4D→D). The third step is the residual connection output: the deeply fused features are added element-wise to the original input features to form the final enhanced ensemble features.
[0098] Since the embedding vectors output by the embedding function module are unordered, in this embodiment of the invention, the set function module uses the DeepSets module, which has permutation invariance, for feature adaptation to convert the support set embedding vectors of a single event into a task-specific representation. For the support set embedding vectors... (in Indicates the first Categories Indicates the first in the event (a number of embedding vectors), for this embedding variable The DeepSets module enhances the features of each sample by aggregating other samples within the same class:
[0099] (5)
[0100] in, Indicates the first in the support set of the input Class 1 Embedded vectors, Represents the transformed th Class 1 Embedded vectors; the symbol ⊕ indicates vector concatenation; Indicates the first Except for the first class Besides the embedding vectors, the rest The function performs element-wise maximum aggregation on each embedded vector. For encoding the context information network, the function Both are feature fusion networks, and are two-layer fully connected networks with ReLU activation functions. Specifically:
[0101] Context information coding network (function The specific form of ) is:
[0102] (6)
[0103] Context information coding network Receive the aggregated context information (i.e.) (with dimension D) as input. and It is the weight matrix and bias of the first fully connected layer, which expands the input dimension from D to 4D. and It is the weight matrix and bias of the second fully connected layer, which compresses the dimension from 4D back to D.
[0104] Feature Fusion Network (function The specific form of ) is
[0105] (7)
[0106] Feature Fusion Network Accepts support set embedding vectors The concatenated vector (2D dimension) output by the encoded context information encoding network is used as input. and These are the parameters of the first fully connected layer. and These are the parameters of the second fully connected layer. All the network parameters (weights) mentioned above. , , , and bias , , , All of these are learnable parameters. They are not preset, but are learned by the optimizer from the source domain dataset during the model training process.
[0107] (4) Attention weight generation module
[0108] The attention weight generation module adopts a lightweight design structure based on a channel attention mechanism. It receives the support set sample features (i.e., the embedding features of the samples) after enhancement by the set function module and calculates the attention weight for each support set sample. In this embodiment of the invention, the attention weight generation module uses a structure combining dual-channel pooling and one-dimensional convolution to assign differentiated weights to the input support set samples, such as... Figure 5 As shown. Its workflow begins with two different statistically significant global aggregations of the input support set features (dimensions [1, N×K, D], after view transformation): firstly, for the... The K feature vectors of a class are average-pooled (average value calculated) along the feature dimension (D dimension), i.e., the feature vectors are average-pooled; secondly, the K feature vectors of the class are average-pooled. The K feature vectors of a class are max-pooled (the maximum value is calculated) along the same dimension to obtain max-pooled feature vectors. Average pooling and max-pooling feature vectors are used to describe the overall features of the class. These two pooling methods capture the overall average response and the strongest response of the features, respectively, providing complementary information. Subsequently, these two feature vectors of length D are concatenated along the channel dimension to form a 2×D concatenated feature. This concatenated feature is then fed into a one-dimensional convolutional layer (Conv1d) for processing. The configuration of this one-dimensional convolutional layer is: 2 input channels, 1 output channel, a kernel size of 7, and symmetrical padding (padding=3) to maintain the sequence length. The function of this convolutional layer is to learn and fuse the average and maximum statistical information to generate a preliminary attention response map. Finally, the Softmax function is applied to normalize this attention response map along the sample dimension (i.e., N×K dimensions) to obtain the final attention weights for each sample in the support set. , representing the The first in the class The relative importance of each sample in constructing the prototype of this class, and the sum of the final attention weights of all samples. Let the final attention weights of all samples be denoted as... The calculation formula is:
[0109] (8)
[0110] In the formula, ,express The weights of each sample; To make the first Classes support centralized The embedding feature matrix, composed of concatenated embedding vectors, has the shape ( , ).
[0111] (5) Prototype Calculation Module
[0112] The prototype calculation module is used to perform a weighted average of the sample features of each category in the support set based on the weights output by the attention weight generation module, to obtain the prototype vectors of each category. In this embodiment of the invention, the prototype calculation module uses a simple averaging strategy to calculate the initial prototype, and the attention weight is subsequently used to measure the feature dimension weighting in the classification module.
[0113] (6) Measurement and classification module
[0114] The distance metric classification module expands the weights output by the attention module into feature dimension weights, and uses these weights to perform a weighted calculation of the Euclidean distance between the prototype vector and the embedded feature vector of the query sample. Finally, it outputs the probability that a query sample belongs to each category through a Softmax function layer. Specifically, the distance metric classification module uses a weighted Euclidean distance function to calculate the distance between the query sample and each type of prototype vector in the query set. The distance between two samples is used to determine their similarity. When performing a weighted distance metric, the attention weights of the sample dimension (i.e., the sample attention weights obtained in the previous step) need to be factored in. The transformation is as follows: First, the weights of the support set are converted into feature dimensions. In the class The embedding vectors are concatenated to obtain a matrix; then, the concatenated matrix is subjected to average pooling and max pooling operations row by row; next, the pooling results are combined and input into a one-dimensional (1D) convolutional layer, where the softmax function is used to calculate the weights of that feature dimension and output them. The calculation formula is:
[0115] (9)
[0116] In the formula, , where represents the weights of the D feature dimensions.
[0117] At this point, the formula for calculating the weighted Euclidean distance function is:
[0118] (10)
[0119] in, Indicates support for the centralized first Prototype vectors of each category; prototype vector The feature dimension weight vector is obtained by expanding the attention weights output by the attention weight generation module. Its dimension and prototype vector The dimensions are the same; Indicates the first in the query set Embedded feature vectors of each query sample; This represents the total number of dimensions of the embedded feature vector, i.e., the length of the feature vector; It is the dimension index, with values ranging from 1 to... ; It supports the centralized first The prototype vector at the th... The weights in each dimension are derived from the attention weights. It is the first in the query set The embedded feature vector of the query sample at the th query sample is in the th... Values in each dimension; It supports the centralized first The prototype vectors of the n categories in the nth case The values in each dimension.
[0120] (7) Construct the loss function
[0121] The loss function used is a composite loss function consisting of the cross-entropy loss function and the Davies-Bouldin exponent (DBI). Among them, cross-entropy loss is used to drive the model to correctly classify query samples, and DBI is used to promote the formation of compact intra-class distribution and separate inter-class distribution in the feature space.
[0122] The formula for the composite loss function is:
[0123] (11)
[0124] In the formula, The standard cross-entropy loss function, is the scaling hyperparameter of DBI, used to balance the weight between classification accuracy and feature space structure; in this embodiment of the invention, it is set to 0.8. With this value, the model can effectively optimize the distribution of the feature space and improve cross-domain generalization ability while ensuring high classification accuracy. This is a composite loss function.
[0125] The exponent formula is:
[0126] (12)
[0127] In the formula, T is the number of categories in the current training episode (i.e., N in N-way). prototype vector and The standard Euclidean distance between them. Used to measure the The intra-class dispersion of a sample is calculated based on samples from the auxiliary query set in the current episode during the training process of this invention.
[0128] (13)
[0129] In the formula, This represents the number of samples in the auxiliary query set that belong to the i-th class. It belongs to the auxiliary query set. Embedded feature vectors of class samples. Calculated on a mini-batch of auxiliary query sets. The model can instantly evaluate the degree of intra-class aggregation in the current feature space, and together with the inter-class distance, it constitutes the DBI loss, guiding the model to optimize in the direction of more compact intra-class aggregation and more separated inter-class aggregation.
[0130] The cross-domain small sample prototype network established in this invention has the following characteristics: (1) It adopts a feature transformation layer, and adjusts the batch-normalized features at the channel level and spatial level through affine transformation parameters γ and β, thereby enhancing the diversity of feature distribution, simulating the data characteristics of different structural domains, and improving cross-domain generalization ability. (2) It introduces a set function module based on DeepSets theory, and adopts residual connection and fully connected network structure to model the set relationship of the embedded features of the support set samples. This module captures the structural relationship between samples within the category through permutation invariance operation, enhances the feature representation of each sample, and is particularly suitable for small sample scenarios with a limited number of samples. (3) It designs an attention weight generation module, and adopts a structure that combines dual pooling (average pooling and max pooling) with one-dimensional convolution to assign differentiated weights to the support set samples. This module adaptively evaluates the representativeness of the samples through learnable convolutional layers, and gives higher weights to more discriminative samples when calculating the prototype, thereby improving the prototype quality. (4) The constructed composite loss function combines cross-entropy classification loss with Davies-Bouldin index (DBI). Cross-entropy loss optimizes classification accuracy, while DBI promotes a compact intra-class distribution and a separate inter-class distribution in the feature space, improving the model's generalization ability in cross-domain scenarios and preventing overfitting to specific features of the source domain.
[0131] Step 4: Train and optimize the constructed cross-domain few-shot prototype network.
[0132] This invention employs a hierarchical optimization strategy and an episode training mechanism to train and optimize the model. The episode training mechanism uses an episode-based meta-learning paradigm, where each training episode simulates a complete N-way K-shot few-shot task. For example, in this embodiment, random and repeated sampling is performed from the training subset of the source domain auxiliary set A to construct a large number of training tasks. Each task is a 5-way 5-shot task, meaning 5 categories are randomly selected, with 5 samples randomly selected from each category as the auxiliary support set and 15 samples as the auxiliary query set. Fifteen such training episodes are constructed in each training cycle, forming an independent training unit. Constructing 15 such episodes in each training cycle ensures that the model fully learns the ability to quickly adapt to new tasks from the few-shot support set.
[0133] A hierarchical optimization strategy is adopted, dividing the model parameters into a feature extraction / ensemble function parameter group and a feature transformation layer parameter group, each with different learning rates for independent optimization. The feature transformation parameters use a larger learning rate to quickly adapt to domain shifts, while the feature extraction parameters use a smaller learning rate to maintain basic representational capabilities, thus balancing the model's basic representational capabilities and domain adaptability. The hierarchical optimization strategy introduces a learnable feature transformation layer into the feature extractor to simulate domain shifts during meta-training, thereby improving cross-domain adaptability. A schematic diagram of the feature transformation layer is shown below. Figure 6 As shown, the model includes two learnable parameters, γ and β, which scale and translate the features. During training, the model parameters are divided into two groups. The first group consists of basic model parameters, including all standard network parameters such as those for the feature extraction convolutional layer, DeepSets fully connected layer, and attention convolutional layer. The second group consists of feature transformation parameters, specifically the parameters of the learnable feature affine transformation layer inserted into the feature extraction network, i.e., the scaling factor γ and bias factor β for each channel. Independent optimizers are configured for each group of parameters, with different learning rates. The basic model parameters use a smaller learning rate. Fine-tuning is performed to maintain its general feature representation capability. A large learning rate is used for the feature transformation parameters. ( Greater than This allows it to rapidly adjust on the support set of new tasks using a small number of gradient steps (i.e., inner loop or fast adaptation), simulating the domain adaptation process during testing. The training process consists of two phases: an inner loop calculates the loss and updates the feature transformation parameters on the support set, simulating the fast adaptation process; the outer loop calculates the loss and updates all parameters on the query set, achieving meta-optimization.
[0134] Specifically, in this embodiment of the invention, the Adam optimizer is selected, and the learning rates of the hierarchical learning rate embedding function module and the ensemble function module are set to [value missing]. The learning rate of the feature transformation layer is set to ,and Less than The loss function constructed in step 3 is used; preferably, in this embodiment of the invention, the training process is set with... , The optimizer parameters are set to: the exponential decay rate of the first moment estimate. It is used to calculate the moving average (i.e., momentum term) of the gradient mean, controlling the decay rate of historical gradients; the exponential decay rate is estimated by the second moment. It is used to calculate the moving average of the squared gradient (i.e., the uncentered variance), controlling the decay rate of historical values of the squared gradient; numerical stability term. To prevent the denominator from being zero during update calculations and ensure numerical stability; initial values of the affine transformation hyperparameters in the FT layer. and In this embodiment of the invention, the batch size is 16, and each episode contains 5 categories × (5 support samples + 15 query samples) = 100 samples, forming a complete few-shot learning unit. Training is performed for 30 epochs, with 15 episodes trained in each epoch. An early stopping strategy is employed during training. After each training epoch, model performance is evaluated on an independent validation subset: validation episodes with the same configuration (5-way 5-shot) as the training task are randomly sampled from the validation subset of the source domain auxiliary set A, and the classification accuracy of the model on the validation episode query set is calculated. Training is terminated when the prediction accuracy using the validation subset does not improve for 10 consecutive training epochs. The model parameters that perform best on the validation subset are saved as the optimal model parameters.
[0135] Step 5: Utilize the trained cross-domain few-sample prototype network model to perform target domain few-sample bolt loosening monitoring and localization. This includes the following steps:
[0136] Step 5.1: Construct the target domain dataset. Acquire ultrasonic guided wave signals under various bolt loosening conditions on the bolted connection structure in the target domain to construct the target domain dataset. The target domain dataset includes a target domain support set S and a target domain query set Q. The target domain dataset consists of ultrasonic guided wave data for monitoring bolt loosening on the monitored test specimen.
[0137] To meet the requirements of the cross-structure small-sample bolt loosening identification task, source domain data and target domain data need to be obtained from two significantly different test structures. Therefore, this experiment uses bolted-connected workpieces as the target domain structure. In this embodiment of the invention, a lapped aluminum plate structure connected by 14 M6 bolts is used as the target domain structure, such as... Figure 7As shown, multiple excitation-receiver sensor pairs are sparsely arranged on the target domain structure to acquire guided wave signals. The overlapping aluminum plates are all 680mm × 600mm × 3mm in size, made of aluminum 2024, and bolts are standard M6 bolts with a strength grade of 8.8. The length of the overlapping area is 80mm. Piezoelectric plates are attached to both ends of the bolts at the overlapping points to excite and receive signals. Excitation piezoelectric plate PZT 1 is used for excitation, and receiving piezoelectric plate PZT 2 is used for receiving. The piezoelectric plates are model P5-1, with a diameter of 8mm and a thickness of 0.5mm. Experimental studies were conducted at room temperature.
[0138] Target domain operating conditions considerations Figure 2 Ten bolts, numbered in red, were used in the experiment. Each bolt was configured with three states: fully loose (torque 2 N·m), partially loose (torque 5 N·m), and tightened (torque 8 N·m). All bolts were considered healthy when tightened. Four unmarked bolts remained tightened throughout the experiment. The excitation signal was a 3.5-cycle sinusoidal signal modulated with a Hanning window; the signal center frequency was 150 kHz, and the peak value was 11 Vpp. The total signal length was 800 μs, and the sampling frequency was 20 MHz. A total of 21 operating conditions were tested, and each loosening condition was measured 40 times, resulting in 840 sets of experimental data. K samples were randomly selected from each operating condition, where K is a positive integer less than or equal to 5 (e.g., for a 5-way 5-shot task, 5 classes with 5 samples each) to construct the target domain support set S. The remaining samples were used to construct the target domain query set Q. Each sample in the target domain support set S contains the original one-dimensional time domain signal and its corresponding real bolt loosening condition category label, and each category contains only K samples; each sample in the target domain query set Q contains the original one-dimensional time domain signal, and its category label is unknown during the monitoring phase.
[0139] Step 5.2: Preprocessing of target domain data.
[0140] The original one-dimensional ultrasonic guided wave time-domain signals in the target domain support set S and target domain query set Q are processed in exactly the same way as in step 2: filtering, normalization, truncation, Hankel matrix transformation, grayscale image generation, and three-channel replication are performed in sequence to convert the one-dimensional ultrasonic guided wave time-domain signals of all samples into two-dimensional grayscale images.
[0141] Step 5.3, Bolt Connection Status Monitoring Application. First, using the target domain support set S after data preprocessing in Step 5.2 as the support set, input the cross-domain few-sample prototype network model trained in Step 4 to obtain prototype vectors for various loosening conditions. Then, using the target domain query set Q after data preprocessing in Step 5.2 as the query set, input each selected sample into the cross-domain few-sample prototype network model trained in Step 4, calculate its weighted Euclidean distance with each prototype vector, identify the probability that each query sample in the target domain query set Q belongs to each bolt loosening condition category, and take the category with the highest probability as the predicted category of the query sample; based on the classification and identification results of the query samples, combined with sensor location information, the loosening status monitoring and location of specific bolts on the target domain structure can be realized.
[0142] In this embodiment of the invention, five categories are selected from the target domain support set S. Five samples are randomly selected from each category and input into the trained model. Through processing by the embedding function model module, the set function module, and the attention weight generation module, prototype vectors for each category are calculated. Then, each sample in the target domain query set Q is input into the model, and its weighted Euclidean distance with each prototype vector is calculated. Softmax classification is used, and the category with the highest probability is taken as the bolt loosening state of the sample (e.g., bolt #3 - completely loose). Combined with the location information obtained by pre-deployed sensors, the identification and location of specific bolt loosening states can be achieved.
[0143] To verify the effectiveness of the present invention, comparative experiments were conducted. The model of the present invention (Cross-Domain ProtoNet) was compared with baseline models such as standard ProtoNet and improved ProtoNet on 5-way 5-shot and 5-way 1-shot tasks. By integrating the FT layer and DeepSets module into the baseline models, the cross-domain effectiveness of the components designed in the model structure of the present invention was verified.
[0144] (1) Comparison of results of inter-domain prototype networks
[0145] The Cross-Domain ProtoNet model of this invention was evaluated against the standard ProtoNet and the Improved ProtoNet models on 5-way 5-shot and 5-way 1-shot tasks. Each model underwent 200 tests on the target domain dataset. The mean and standard deviation of the test accuracy are summarized in Table 1, where the sign... This indicates that the FT layer or DeepSets module was used.
[0146] Table 1. Comparison of test accuracy of cross-domain prototype networks
[0147]
[0148] As shown in Table 1, the proposed cross-domain prototype network achieves the highest accuracy in both the 5-class, 5-sample and 5-class, 1-sample tasks. Compared to the standard prototype network, the cross-domain prototype network improves test accuracy by 4.98% and 3.41%, respectively. Compared to the improved prototype network, the improvements are 3.99% and 1.90%, respectively. Notably, even when integrating the FT layer and DeepSets module into a variant of the standard prototype network, improvements of 4.34% and 2.75% are still achieved, respectively. These results confirm the effectiveness of the proposed cross-domain prototype network and its FT layer and DeepSets module in cross-domain damage identification.
[0149] (2) The effect of the FT layer alone
[0150] The effectiveness of the FT layer was evaluated on both 5-way 5-shot and 5-way 1-shot classification tasks. Specifically, the FT layer was integrated separately into the standard prototype network (ProtoNet) and the improved prototype network (Improved ProtoNet). Each configuration was tested 200 times on the target domain dataset. The mean and standard deviation of the classification accuracy are summarized in Table 2. This indicates that the FT layer was used.
[0151] Table 2. Test accuracy using the feature transformation layer
[0152]
[0153] After introducing the FT layer, both the standard prototype network (ProtoNet) and the improved prototype network (ImprovedProtoNet) significantly outperformed their respective baseline models before the introduction of the FT layer in terms of test accuracy on the 5-way 5-shot and 5-way 1-shot tasks. Specifically, the improved prototype network improved accuracy by 2.62% and 0.84%, respectively, while the standard prototype network improved accuracy by 2.02% and 1.68%, respectively. Although the accuracy in Table 2 is lower than that of the cross-domain prototype network of this invention, these results fully demonstrate the effectiveness of the FT layer in improving cross-domain generalization ability.
[0154] (3) The impact of the DeepSets module acting alone
[0155] The effectiveness of the DeepSets module was also evaluated on 5-way 5-shot and 5-way 1-shot classification tasks. Specifically, the DeepSets module was integrated separately into ProtoNet and Improved ProtoNet. Each configuration was tested 200 times on the target domain dataset. The mean and standard deviation of the classification accuracy are summarized in Table 3. This indicates that the DeepSets module was used.
[0156] Table 3. Test accuracy using DeepSets collection functions
[0157]
[0158] After introducing the DeepSets module, both the standard prototype network (ProtoNet) and the improved prototype network (ImprovedProtoNet) significantly outperformed the corresponding baseline models in test accuracy on 5-way 5-sample and 5-way 1-sample tasks. Specifically, the improved prototype network improved accuracy by 2.12% and 0.84%, respectively, while the standard prototype network improved accuracy by 2.55% and 1.67%, respectively. Although the accuracy in Table 3 is lower than that of the cross-domain prototype network, these results fully demonstrate the effectiveness of the DeepSets module in improving cross-domain generalization ability.
[0159] Furthermore, the results in Table 3 are similar to those in Table 2. The gain of the DeepSets module is comparable to that of the FT layer. When the two modules are integrated into the network, the accuracy improvement is roughly equal to the sum of their individual contributions. In all configurations, the improved ProtoNet consistently outperforms the standard ProtoNet, demonstrating the effectiveness of weighted Euclidean distance and DBI in improving model performance.
[0160] This invention also uses t-SNE (t-distributed random neighborhood embedding) to visualize the high-dimensional embedding vectors mapped by the embedding functions of the standard ProtoNet prototype network and the cross-domain few-shot prototype network. t-SNE is a commonly used high-dimensional data visualization algorithm that can map high-dimensional feature vectors to a two-dimensional plane, thereby intuitively displaying the clustering effect and separation degree of different categories of sample features. Wherein:
[0161] For the 5-way 5-shot task, the visualization results of the embedding vectors of the source domain dataset using the standard prototype network ProtoNet model are as follows: Figure 8 As shown, the visualization results of the embedding vectors of the source domain dataset using the cross-domain few-shot prototype network model are as follows: Figure 9 As shown. By Figure 8 , 9As can be seen from the range of the vertical axis, the embedding vectors of the source domain dataset mapped by the cross-domain few-shot prototype network model have a larger inter-class distance, which is beneficial to improving the verification accuracy during training, and the corresponding saved model has better classification performance.
[0162] For the 5-way 5-shot task, the visualization results of the embedding vectors of the target domain dataset using the standard prototype network ProtoNet model are as follows: Figure 10 As shown, the visualization results of the embedding vectors of the target domain dataset using the cross-domain few-shot prototype network model are as follows: Figure 11 As shown. Among them, for those mapped by the standard prototype network ProtoNet... Figure 10 For these 21 categories, it can be seen that there are two instances in the graph where data points from different categories are mixed and intermingled: category 9 with category 5, and category 8 with category 9. This is detrimental to classification, as the model has difficulty distinguishing these categories, leading to a decrease in classification accuracy. This is especially true for data mapped from a cross-domain few-sample prototype network model. Figure 11 As can be seen, although there is still some mixing of categories 9 and 5, compared with the original ProtoNet, the embedding vectors of different categories can be clearly distinguished, and the classification accuracy of the corresponding cross-domain few-shot prototype network model is naturally improved.
[0163] Figure 8-11 The t-SNE dimensionality reduction visualization results further demonstrate that the cross-domain prototype network model of this invention ( Figure 9 , Figure 11 Compared to the standard prototype network ProtoNet ( Figure 8 , Figure 10 Whether in the source domain or the target domain, the learned features have clearer inter-class boundaries and a more compact intra-class distribution, which intuitively explains the reason for the performance improvement of the model in this invention.
[0164] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the scope of the technology disclosed in the present invention, and such modifications or substitutions should all be covered within the scope of protection of the present invention.
Claims
1. A bolted joint condition cross-domain small sample ultrasonic guided wave monitoring method, characterized in that, Includes the following steps: Step 1: Construct a source domain auxiliary dataset for ultrasonic guided wave signals; Labeled ultrasonic guided wave signals under various simulated damage states are acquired in the source domain structure to construct a source domain auxiliary set A; each sample in the source domain auxiliary set A contains the original one-dimensional ultrasonic guided wave time domain signal and its corresponding simulated damage state category label. Step 2: Data preprocessing; Data processing is performed on the ultrasonic guided wave signals in the source domain auxiliary set A obtained in step 1. The original one-dimensional ultrasonic guided wave time domain signals are preprocessed to convert the original one-dimensional ultrasonic guided wave time domain signals of all samples into two-dimensional grayscale images. Step 3: Construct a cross-domain few-shot prototype network model; During model training and optimization, the cross-domain few-sample prototype network model takes two-dimensional grayscale images of the auxiliary support set and auxiliary query set sampled from the source domain auxiliary set A as input, and outputs the probability that the query sample belongs to each bolt connection condition category; the bolt connection condition categories include fully loose state, semi-loose state and tightened state. The cross-domain few-shot prototype network model includes an embedding function module, an ensemble function module, an attention weight generation module, a prototype computation module, and a metric classification module; wherein: The embedding function module is used to extract high-dimensional embedding feature vectors from the input two-dimensional grayscale image; The set function module is used to receive high-dimensional embedded feature vectors from the support set samples of the embedding function module, and to model the set relationship of sample features within the same category to enhance the feature representation of each sample. The attention weight generation module is used to receive the features of each sample in the support set samples after being enhanced by the set function module, and to calculate the attention weight of each support set sample. The prototype calculation module is used to use the attention weights output by the attention weight generation module to perform a weighted average of the sample features of each category in the support set to obtain the prototype vectors of each category. The metric classification module is used to expand the attention weights output by the attention weight generation module into feature dimension weights, and use the expanded feature dimension weights to perform weighted calculations on the distance between the prototype vector and the embedded feature vectors of the query samples in the query set, and output the probability that the query sample belongs to each category. Step 4: Train and optimize the constructed cross-domain few-shot prototype network model; An interlude training mechanism is adopted, and training interludes are constructed by randomly sampling from the source domain auxiliary set A after step 2. Each training interlude contains an auxiliary support set and an auxiliary query set. The cross-domain few-shot prototype network model constructed in step 3 is trained and optimized using the auxiliary support set and the auxiliary query set to obtain the optimal model parameters. Step 5: Monitoring and locating loose bolts in a small sample within the target domain; Step 5.1, construct the target domain dataset; Labeled ultrasonic guided wave signals under various real bolt loosening conditions are acquired on the bolted connection structure of the target domain to be monitored. Several samples from each condition are randomly selected to construct a target domain support set S, and the remaining samples are used to construct a target domain query set Q. Each sample in the target domain support set S contains an original one-dimensional ultrasonic time-domain signal and its corresponding real bolt loosening condition category label. Each sample in the target domain query set Q contains an original one-dimensional time-domain signal, and its category label is unknown. Step 5.2, target domain data preprocessing; Perform the same data processing as in step 2 on the original one-dimensional ultrasonic guided wave time domain signals in the target domain support set S and target domain query set Q obtained in step 5.1, and convert the one-dimensional time domain signals of all samples into two-dimensional grayscale images. Step 5.3, Monitoring Applications; Using the target domain support set S after data preprocessing in step 5.2 as the support set and the target domain query set Q as the query set, the cross-domain small sample prototype network model trained in step 4 is input to identify the probability of each query sample in the target domain query set Q belonging to each bolt connection condition category. The category with the highest probability is taken as the predicted category of the query sample, and the loose bolts are located by combining the sensor position information.
2. The bolted connection condition cross-domain small sample ultrasonic guided wave monitoring method according to claim 1, characterized in that, The steps in steps 2 and 5.2 of converting the original one-dimensional ultrasound time-domain signal into a two-dimensional grayscale image include: The acquired original one-dimensional ultrasonic guided wave time-domain signal was sequentially filtered and normalized. According to the preset truncation length, a one-dimensional ultrasonic guided wave time domain signal segment after filtering and normalization is truncated, the one-dimensional ultrasonic guided wave time domain signal segment is converted into a two-dimensional Hankel matrix, and the two-dimensional Hankel matrix is converted into a two-dimensional grayscale image.
3. The method for cross-domain small-sample ultrasonic guided wave monitoring of bolted connection states according to claim 1, characterized in that, In step 3, the embedded function module is a convolutional neural network, which includes multiple convolutional layers. After each convolutional layer, a feature transformation layer is embedded and arranged between the batch normalization layer and the ReLU activation function layer to perform affine transformation on the features output by the convolutional layers to simulate the feature distribution of different data domains.
4. The method for cross-domain small-sample ultrasonic guided wave monitoring of bolted connections according to claim 3, characterized in that, The feature transformation layer uses the Fourier Transform (FT) layer to transform the batch-normalized feature map. Perform an element-wise affine transformation to generate the transformed feature map. The transformation formula is: In the formula, ; ; Subscript These represent the channels, height, and width of the feature map, respectively. The dimension of the feature map; and These are learnable affine transformation parameters with the same dimension as the input feature map, where: In the formula, For activation function, ; and It is a learnable hyperparameter matrix, whose dimension is... and same; and It is random noise sampled from a Gaussian distribution with a mean of 0 and a standard deviation of 1.
5. The method for cross-domain small-sample ultrasonic guided wave monitoring of bolted connection states according to claim 1, characterized in that, In step 3, the set function module adopts a DeepSets network structure with permutation invariance. It enhances the feature representation of each sample by converting the high-dimensional embedding feature vectors of samples in the target domain support set of a single event into a task-specific representation. The specific conversion method is as follows: In the formula, Indicates support for the centralized first Class 1 Embedded vectors, Represents the transformed th Class 1 There are several embedded vectors, where ⊕ represents a vector concatenation operation; Indicates the first Except for the first class Besides the embedding vectors, the rest Element-wise maximum aggregation operation of embedded vectors; function sum function Both are two-layer fully connected networks with ReLU activation functions.
6. The method for cross-domain small-sample ultrasonic guided wave monitoring of bolted connection states according to claim 1, characterized in that, The attention weight generation module adopts a structure combining dual-channel pooling and one-dimensional convolution. It is configured to: perform average pooling and max pooling operations on sample features within the same category in the support set, and concatenate the average pooling results and max pooling results before inputting them into a one-dimensional convolutional layer to generate a preliminary attention response map. The initial attention response map is normalized using the Softmax function along the sample feature dimension of the support set to obtain the final attention weight for each sample in the output support set.
7. The method for cross-domain small-sample ultrasonic guided wave monitoring of bolted connection states according to claim 1, characterized in that, The metric classification module uses weighted Euclidean distance to calculate the distance between the prototype vector and the embedded feature vector of the query sample in the query set. The formula for calculating the weighted Euclidean distance is as follows: In the formula, Indicates support for the centralized first Prototype vectors of each category; prototype vector The feature dimension weight vector is obtained by expanding the attention weights output by the attention weight generation module. Its dimension and prototype vector The dimensions are the same; Indicates the first in the query set Embedded feature vectors of each query sample; This represents the total number of dimensions of the embedded feature vector, i.e., the length of the feature vector; It is the dimension index, with values ranging from 1 to... ; It supports the centralized first The prototype vector at the th... The weights in each dimension are derived from the attention weights. It is the first in the query set The embedded feature vector of the query sample at the th query sample is in the th... Values in each dimension; It supports the centralized first The prototype vectors of the n categories in the nth case The values in each dimension.
8. The method for cross-domain small-sample ultrasonic guided wave monitoring of bolted connection states according to claim 1, characterized in that, In step 4, the episode training mechanism is as follows: Divide the source domain auxiliary set A into a training subset and a validation subset. Both the training subset and the validation subset include an auxiliary support set and an auxiliary query set. Randomly select multiple categories from the training subset to construct several training episodes simulating small sample tasks. The training episodes include an auxiliary support set and an auxiliary query set. Perform a preset number of episode training sessions in each training cycle. After each training cycle, the model performance is evaluated using an independent validation subset. When the accuracy of prediction using the validation subset no longer improves over a consecutive number of training cycles, the model training is terminated, and the current model parameters are taken as the optimal model parameters. During the training of interludes, a fusion cross-entropy loss function is used. The composite loss function, consisting of the Davies-Bouldin index, is used to train and optimize the cross-domain few-shot prototype network model. for: In the formula, The Davies-Bouldin index. This refers to the scaling hyperparameters of DBI.
9. The method for cross-domain small-sample ultrasonic guided wave monitoring of bolted connection states according to claim 3, characterized in that, In step 4, the Adam optimization algorithm is used to train and optimize the cross-domain few-shot prototype network model. A hierarchical learning rate strategy is adopted, with a first learning rate for the parameters of the embedding function module and the set function module, and a second learning rate for the parameters of the feature transformation layer. The first learning rate is less than the second learning rate.
10. The method for cross-domain small-sample ultrasonic guided wave monitoring of bolted connection states according to claim 9, characterized in that, In step 5.3, the process of classifying and identifying the bolt connection status of the target domain small samples using the trained cross-domain few-sample prototype network model is as follows: The target domain support set S, after data preprocessing, is used as the support set and input into the cross-domain few-sample prototype network model trained in step 4 to calculate the prototype vectors for various loosening conditions. The target domain query set Q, after data preprocessing, is used as the query set and input into the cross-domain small sample prototype network model trained in step 4. By calculating the weighted distance between the model and the prototype vectors of various loosening conditions, the probability of each query sample in the target domain query set Q belonging to each bolt loosening condition category is obtained. The category with the highest probability is taken as the predicted category of the query sample.