A fault diagnosis method and system for unbalanced samples of unmanned surface boats

Through the improved SMOTE algorithm and improved FPN structure, combined with the rotating attention mechanism, the problem of sample imbalance and feature fusion in surface unmanned vehicle fault diagnosis is solved, and the accuracy and generalization ability of fault diagnosis are significantly improved.

CN118885913BActive Publication Date: 2025-01-21SHANDONG UNIV OF SCI & TECH
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411354531.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-27
Publication Date
2025-01-21
Estimated Expiration
2044-09-27

AI Technical Summary

Technical Problem

The prior art has sample imbalance in the diagnosis of surface unmanned boat faults, resulting in limited generalization ability and accuracy of the diagnostic model, and the fusion of high-level features and low-level features has information loss, and the feature interaction is not deep enough.

Method used

The improved SMOTE algorithm is used to identify and isolate boundary samples and unstable samples through multiple k-means clustering, and generate new samples to balance the data set. At the same time, an improved FPN structure is used for multi-scale feature extraction, and a rotational attention mechanism is introduced to enhance the expression ability and interaction of features.

Benefits of technology

It significantly improves the model's ability to identify fault states, enhances the model's generalization ability and ability to capture multi-level fault characteristics, and improves the accuracy and robustness of diagnostic results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118885913B_ABST
    Figure CN118885913B_ABST
Patent Text Reader

Abstract

The present invention belongs to the technical field of unmanned boat fault diagnosis, and discloses a method and system for fault diagnosis of unbalanced samples of surface unmanned boats. The method effectively identifies and isolates boundary samples through an improved SMOTE algorithm, effectively integrates feature maps of different resolutions through an improved FPN bottom-up and top-down network structure, introduces an improved rotational attention mechanism, realizes feature rotation and interaction in channel and spatial dimensions, and adaptively adjusts weights to enhance the model's processing capabilities for these complex features. The present invention optimizes the recognition accuracy and robustness of the model for fault features through feature extraction and weighted fusion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of unmanned boat fault diagnosis, and in particular relates to a method and system for diagnosing a fault of an unbalanced sample of a surface unmanned boat. Background Art

[0002] With their outstanding autonomy and flexibility, surface unmanned boats play a vital role in the fields of ocean monitoring, resource development, environmental research, etc., and have gradually become a powerful assistant in carrying out maritime missions. With the continuous breakthrough of technology, the autonomy of unmanned boats in carrying out complex and dangerous tasks is constantly improving, and their importance in ocean exploration and the protection of marine rights and interests is becoming increasingly prominent.

[0003] However, when operating for a long time in a harsh marine environment, the complex systems of unmanned boats are bound to have various faults. If these faults are not identified and repaired in time, they may seriously interfere with the execution of the mission and may even cause safety accidents. Therefore, the development of efficient and reliable fault diagnosis methods is extremely critical to ensure the normal operation of unmanned boats and the smooth completion of missions.

[0004] Existing fault diagnosis methods often encounter sample imbalance problems when processing data from surface unmanned boats, which limits the generalization ability and accuracy of the diagnostic model. Although the traditional SMOTE algorithm solves the sample imbalance problem to a certain extent, its randomness may cause the generated samples to be too close to boundary points or noise points, affecting the model performance; existing improved algorithms mostly optimize boundary samples to improve the robustness and accuracy of the model, but ignore the unstable samples and sample diversity within the sample.

[0005] In the fault diagnosis of surface unmanned boats, the fusion of high-level features and low-level features is one of the key steps. The existing FPN (Feature Pyramid Network) structure may cause information loss during the fusion process, especially for the extraction of small objects or subtle fault features is not accurate enough.

[0006] In unmanned boat fault diagnosis, fault features may show complexity in different dimensions. Although the attention mechanism in existing technologies, such as SE module and CBAM module, can improve the expressiveness of features, it still lacks in-depth mining of the interaction between features in different dimensions. Fixed weighting methods may not be suitable for all situations, which limits the further improvement of model performance. Summary of the invention

[0007] In order to overcome the problems existing in the related art, the disclosed embodiment of the present invention provides a fault diagnosis method and system for an unbalanced sample of an unmanned surface vehicle.

[0008] The technical solution is as follows: A fault diagnosis method for an unbalanced sample of a surface unmanned boat comprises:

[0009] S1, obtaining one-dimensional vibration time series data of propeller blockage by water weeds, plastic bags, nylon ropes, cloth strips and normal states through sensors of the surface unmanned boat, wherein the sensors of the surface unmanned boat include acceleration sensors installed at the bow, hull and propeller;

[0010] S2, preprocess the collected data to remove outliers and noise, apply the improved SMOTE algorithm, identify and isolate boundary samples and unstable samples through multiple k-means clustering, and generate new samples to balance the data set;

[0011] S3, using continuous wavelet transform to convert the preprocessed one-dimensional vibration data into two-dimensional time-frequency graph data, and divide it into a training set and a test set;

[0012] S4, establish a surface unmanned boat fault diagnosis network model, including a residual module, a feature extraction module, an attention module, a pooling layer, a fully connected layer, and an output layer;

[0013] S5, uses the improved FPN structure to extract multi-scale features from the two-dimensional time-frequency map, integrating feature maps of different levels through bottom-up and top-down paths;

[0014] S6, introduces the rotation attention mechanism, which enhances the expressiveness of features by rotating and pooling the feature map, and applies the Softmax function to generate adaptive weights to achieve weighted fusion of features;

[0015] S7, training the surface unmanned boat fault diagnosis network model, inputting the fused features into the network model, and using the loss function and optimization algorithm for training;

[0016] S8, applying the trained fault diagnosis network model to an independent test set, evaluating the diagnostic accuracy and generalization ability of the fault diagnosis network model, optimizing and adjusting the fault diagnosis network model, and continuously iterating;

[0017] S9, based on the diagnostic results output by the fault diagnosis network model, analyze the fault type and severity to provide a basis for eliminating the fault and repairing the equipment.

[0018] In step S2, the improved SMOTE algorithm includes:

[0019] S201, Boundary Sample Identification: For the minority class sample set Any two samples in and ,in, , the distance between them Using Euclidean distance calculation, the formula is as follows:

[0020] ;

[0021] In the formula, are the first and samples, is the feature dimension of the sample, that is, the number of features in each sample; They are minority class samples and In the The value of the dimension;

[0022] For samples in the minority class sample set and majority class sample set Samples in , the distance between them Using Euclidean distance calculation, the formula is as follows:

[0023] ;

[0024] In the formula, Represents the majority class sample set. samples, Represents the majority class sample In the The value of the dimension;

[0025] If exists , then the sample is a boundary sample, and the boundary sample is isolated and protected; among them, is the minimum distance between the sample point and the minority class sample, is the minimum distance between the sample point and the majority class sample;

[0026] S202, k-means clustering: Set the number of repetitions for the remaining minority class samples to , the expected number of clusters is K-means clustering and initialize an array ,element Indicates The number of times a sample point changes its cluster;

[0027] S203, Allocation Matrix Construction: Define an allocation matrix ,element Indicates The clusters to which the minority class samples belong in a certain clustering, where:

[0028] ;

[0029] For samples and two consecutive clustering and , , calculate the change in cluster assignment ,if , indicating the sample Different clusters were assigned to the two clusterings, namely , update the counter , The larger the value, the more sample points The more affected by noise and outliers, the more unstable the sample is.

[0030] S204, unstable sample identification: by comparing the changes in cluster allocation of samples in multiple clustering, that is, When , it is identified as an unstable sample;

[0031] S205, setting weight parameters: obtaining the propeller speed of the surface unmanned boat and hull length , define the weight coefficient:

[0032] ;

[0033] In the formula, Indicates the propeller speed of the surface unmanned boat. Indicates the length of the hull, Indicates the number of times a sample changes its cluster in multiple clusterings. represents the number of clustering repetitions, represents the weight coefficient;

[0034] S206, generating new sample points: according to the number of cluster changes recorded in the allocation matrix, the formula of the original SMOTE algorithm is adjusted, and the newly generated sample points are ,in, is a random variable, exist The value in the interval is used to adjust the newly generated sample points relative to the original sample points and its neighbor samples location;

[0035] S207, sample balance is achieved: the above steps are repeated until the minority sample points and the majority sample points achieve a quantitative balance.

[0036] In step S2, the collected data is preprocessed to remove outliers and noise, including:

[0037] S211, analyzing the characteristics of the noisy signal, selecting dbn wavelet, symn wavelet or coifn wavelet as the basis function, and the number of decomposition layers is 3 to 5;

[0038] S212, threshold processing is applied to the signal coefficients after wavelet decomposition. By selecting a threshold function and a threshold parameter, the wavelet coefficients are quantized to suppress the noise component. The formula of the soft threshold function is as follows:

[0039] ;

[0040] In the formula, The waveform after decomposition Level coefficients, for The absolute value of for The symbol function of is a positive threshold parameter;

[0041] Heursure Threshold The formula is as follows:

[0042] ;

[0043] In the formula, is the length of the entire signal, is the signal standard deviation, SNR is the signal-to-noise ratio;

[0044] ;

[0045] In the formula, is the wavelet transform coefficient, is the median;

[0046] S213, reconstructing the wavelet coefficients.

[0047] In step S3, the pre-processed one-dimensional vibration data is converted into two-dimensional time-frequency graph data by using continuous wavelet transform, including: Perform wavelet transform and decompose into a series of scales and pan The related wavelet coefficients are projected into a two-dimensional time-frequency distribution image as the input of the surface unmanned boat fault diagnosis model. The continuous wavelet transform formula is as follows:

[0048] ;

[0049] ;

[0050] In the formula, are the coefficients of wavelet transform, represents the scaled and translated wavelet function, are the scale and translation parameters, is the signal or function to be analyzed, is the center position of the wavelet function Through the scale The transformed position of is the set of real numbers;

[0051] The Morlet wavelet basis function formula is as follows:

[0052] ;

[0053] In the formula, is the width of the Gaussian window, is the center frequency, is the normalization factor ensuring that the wavelet function is normalized, is the time variable, is the base of natural logarithms, is the exponential part of the normal distribution, Is an imaginary unit.

[0054] In step S5, the improved FPN structure is used to extract multi-scale features from the two-dimensional time-frequency graph, including:

[0055] S501, bottom-up network: the input data is processed through a series of residual units, producing a series of gradually decreasing feature maps ,These feature maps have different resolutions and feature information;

[0056] S502, lateral connection: At each level, lateral connection is performed through 1×1 convolution kernels to adjust the number of channels of the feature map to match the required dimension so that features at different levels can be transferred and integrated more effectively;

[0057] S505, top-down network: integrating top-down pathways into underlying features;

[0058] S506, finally the fused features are output through a convolution layer with a 3×3 convolution kernel.

[0059] In step S505, the top-down path is integrated into the underlying features, including:

[0060] S5051, C5 becomes P4 through 1×1 convolution;

[0061] S5052, C5 is convolved by 1×1 and upsampled by ×2, and then combined with the output of C4 through 1×1 convolution to become P3;

[0062] At S5053, C5 is convolved by 1×1 and upsampled by ×4, C4 is convolved by 1×1 and upsampled by ×2, and then combined with the output of C3 through 1×1 convolution to become P2;

[0063] S5054, C5 is convolved by 1×1 and upsampled by ×8, C4 is convolved by 1×1 and upsampled by ×4, C3 is convolved by 1×1 and upsampled by ×2, and then combined with the output of C2 through 1×1 convolution, and finally becomes P1;

[0064] in,

[0065] ;

[0066] ;

[0067] ;

[0068] ;

[0069] In the formula, They all represent the features reconstructed from the original features. For the upsampling operation, is the upsampling multiple, It is used to adjust the number of channels for convolution operation.

[0070] In step S6, the rotation attention mechanism is introduced to enhance the expressiveness of features by rotating and pooling the feature map, including:

[0071] S601, Input feature rotation: Rotate the input feature Along the spatial dimension and Rotate 90 degrees clockwise to get and , to enhance the channel and spatial dimensions The interaction between is the original feature, is the set of real numbers, Along the spatial dimension The new feature obtained after rotating 90 degrees clockwise, It is the new feature obtained by rotating 90 degrees clockwise along the spatial dimension W;

[0072] S602, Concatpool operation: respectively Perform Concatpool operation, Apply max pooling on the dimension and average pooling , concatenate the results:

[0073] ;

[0074] ;

[0075] ;

[0076] In the formula, To perform Concatpool operation on the original features, To perform average pooling on the original features, To perform the maximum pooling operation on the original features, To perform Concatpool operation on H-dimensional features, To perform average pooling on H-dimensional features, To perform the maximum pooling operation on the H-dimensional features, To perform Concatpool operation on W-dimensional features, To perform average pooling operation on W-dimensional features, To perform the maximum pooling operation on the W-dimensional features;

[0077] S603, convolution layer and fully connected layer: The output of Concatpool is feature mapped and adaptively weighted through the convolution layer and the subsequent fully connected layers FC1 and FC2. The expression is:

[0078] ;

[0079] In the formula, is the activation function used to introduce nonlinearity, To connect the output of Concatpool to the fully connected layer;

[0080] S604, for each branch The output weight matrix First, through the Softmax function Generate normalized adaptive weights , the expression is:

[0081] ;

[0082] ;

[0083] In the formula, There are three different branches. are the indices of the output weights, The Softmax function acts on the input features On The value obtained after the elements are transformed. is the input vector Middle Elements The index of is the input vector Middle Elements Index of

[0084] S605, feature weighted fusion: Apply adaptive weights to the original rotation features to achieve weighted fusion of features:

[0085] ;

[0086] ;

[0087] ;

[0088] In the formula, is element-wise multiplication, is the weighted C-dimensional feature, is the adaptive weight of dimension C, is the weighted H-dimensional feature, is the new feature obtained by rotating 90 degrees clockwise along the spatial dimension H. is the adaptive weight of dimension H, is the weighted W-dimensional feature, is the new feature obtained by rotating 90 degrees clockwise along the spatial dimension W, is the adaptive weight of dimension W;

[0089] S606, reverse rotation operation: After completing the weighted fusion of features, the features of each branch are Perform the opposite rotation to the previous one to restore the original spatial dimensions; if the original rotation was a 90-degree clockwise rotation along the H or W axis, the inverse rotation is a 90-degree counterclockwise rotation along the same axis:

[0090] ;

[0091] In the formula, To restore the features to their original dimensions, For reverse rotation;

[0092] S607, final feature fusion: Integrate the weighted features to obtain the final feature representation:

[0093] ;

[0094] In the formula, is the feature output by the rotation attention module, is element-wise addition, is the weighted feature after dimension H is restored, is the weighted feature after dimension W is restored, is the weighted feature after dimension C is restored.

[0095] In step S7, the features after feature extraction and attention network are connected to the fully connected network of the network model, and the relevant parameters are continuously updated in reverse through the loss function, so that the predicted type of the input signal data after passing through the model continuously approaches the actual fault type, thereby realizing fault diagnosis and fault classification of the signal data.

[0096] Furthermore, the fault diagnosis network model uses cross entropy as the loss function for training, and the basic information entropy of cross entropy is:

[0097] ;

[0098] In the formula, is a random variable The basic information entropy of is a random variable, is the range of values ​​of the random variable, is the probability distribution, for The probability of a variable distribution;

[0099] In the case of multi-classification, the data sample is time, among which As a sample, is the label of the sample. At this time, the prediction result is not only Between two values, but A set of classification labels; the loss function is:

[0100] ;

[0101] In the formula, For label distribution and the predicted distribution Calculate the log-likelihood loss, is the set of true labels, is the probability distribution predicted by the model, is the total number of samples, is the sample index, from 0 to , is the total number of categories, For sample Belongs to category , if it belongs to ,otherwise , Predict samples for the model Belongs to category probability.

[0102] Another object of the present invention is to provide a fault diagnosis system for an unbalanced sample of an unmanned surface vehicle, the system performs diagnosis by the fault diagnosis method for an unbalanced sample of an unmanned surface vehicle, and the system comprises:

[0103] A one-dimensional vibration time series data acquisition module is used to acquire one-dimensional vibration time series data of propeller water weed blockage, plastic bag blockage, nylon rope blockage, cloth strip blockage, and normal state through sensors of the surface unmanned boat, wherein the sensors of the surface unmanned boat include acceleration sensors installed at the bow, hull, and propeller;

[0104] The data generation module is used to preprocess the collected data, remove outliers and noise, apply the improved SMOTE algorithm, identify and isolate boundary samples and unstable samples through multiple k-means clustering, and generate new samples to balance the data set;

[0105] A training set and test set division module is used to convert the pre-processed one-dimensional vibration data into two-dimensional time-frequency graph data by using continuous wavelet transform, and divide it into a training set and a test set;

[0106] The surface unmanned boat fault diagnosis network model building module is used to build the surface unmanned boat fault diagnosis network model, including residual module, feature extraction module, attention module, pooling layer, full connection layer, and output layer;

[0107] The multi-scale feature extraction module is used to extract multi-scale features from the two-dimensional time-frequency graph using the improved FPN structure, integrating feature graphs at different levels through bottom-up and top-down paths;

[0108] The rotation attention mechanism module is introduced to introduce the rotation attention mechanism. By rotating and pooling the feature map, the expressiveness of the feature is enhanced, and the Softmax function is applied to generate adaptive weights to achieve weighted fusion of features.

[0109] The fault diagnosis network training module is used to train the surface unmanned boat fault diagnosis network model, input the fused features into the network model, and use the loss function and optimization algorithm for training;

[0110] The testing module is used to apply the trained fault diagnosis network model to an independent test set, evaluate the diagnostic accuracy and generalization ability of the fault diagnosis network model, optimize and adjust the fault diagnosis network model, and continuously iterate;

[0111] The analysis module is used to analyze the fault type and severity according to the diagnosis results output by the fault diagnosis network model, so as to provide a basis for eliminating the fault and repairing the equipment.

[0112] In combination with all the above technical solutions, the beneficial effects of the present invention are as follows: the present invention effectively identifies and isolates boundary samples through the improved SMOTE algorithm, reduces the noise and outliers introduced by randomness, and thus significantly improves the model's ability to identify fault states. At the same time, the unstable samples identified by clustering and allocation matrices ensure the balance of the quantity and quality of the generated new sample points, increase the stability and diversity of the samples, and thus enhance the generalization ability of the surface unmanned boat fault diagnosis model.

[0113] Fault features may exist at different scales and levels. The improved FPN effectively integrates feature maps of different resolutions through bottom-up and top-down network structures, enhancing the model's ability to capture these multi-level fault features. This fusion of multi-scale features enables the model to better adapt to the fault diagnosis needs of different equipment and working conditions, improving the generalization and accuracy of the model.

[0114] The fault features of surface unmanned boats may show complexity in different dimensions. The improved rotation attention mechanism introduced in this invention enhances the model's ability to handle these complex features by rotating and interacting features in channel and spatial dimensions. The implementation of adaptive weight adjustment further optimizes the recognition accuracy and robustness of the model for fault features through weighted fusion of features.

[0115] The improved SMOTE algorithm and the improved FPN feature extraction technology can improve the accuracy and generalization ability of surface unmanned boat fault diagnosis, directly reduce the maintenance cost and fault downtime of the unmanned boat, and improve operational efficiency. The technical solution of the present invention effectively solves the common problems of sample imbalance and inaccurate feature extraction in the existing surface unmanned boat fault diagnosis technology through improved data processing and model design. Through the improved SMOTE algorithm and the improved FPN feature extraction technology, the present invention not only improves the accuracy of diagnosis, but also enhances the generalization ability of the model, and solves the long-standing challenges of sample imbalance and feature extraction limitations in the field of surface unmanned boat fault diagnosis. The present invention is no longer limited to a single sample processing method or feature extraction strategy. By adopting adaptive sample generation and multi-dimensional feature fusion technology, it realizes the optimization of surface unmanned boat fault diagnosis and improves the reliability and accuracy of the diagnosis results. BRIEF DESCRIPTION OF THE DRAWINGS

[0116] The accompanying drawings herein are incorporated in and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description, serve to explain the principles of the present disclosure;

[0117] Figure 1 It is a flow chart of a method for diagnosing a fault of an unmanned surface vehicle imbalance sample provided by an embodiment of the present invention;

[0118] Figure 2 is a schematic diagram of an improved FPN feature extraction output provided by an embodiment of the present invention;

[0119] Figure 3 is a schematic diagram of an improved rotational attention principle provided by an embodiment of the present invention;

[0120] Figure 4 It is a schematic diagram of a fault diagnosis system for an unbalanced sample of a surface unmanned boat provided by an embodiment of the present invention;

[0121] Figure 5 It is the training and test accuracy curve;

[0122] Figure 6 Loss curves for training and testing;

[0123] Figure 7 This is the confusion matrix diagram of the training results;

[0124] Figure 8 This is a comparison chart of the accuracy of different models;

[0125] Fig. 9 Comparison chart of loss of different models. DETAILED DESCRIPTION

[0126] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present invention, so the present invention is not limited by the specific implementation disclosed below.

[0127] The present invention proposes a recognition and processing mechanism for boundary samples, which effectively avoids unnecessary degradation of model performance; an unstable sample recognition method based on clustering and allocation matrices improves the quality and pertinence of sample generation; a new sample point generation strategy takes into account sample stability and diversity, and enhances the robustness of the fault diagnosis model. The present invention proposes an FPN fusion mechanism for multi-scale features, especially a top-down path design. The present invention proposes the introduction of the rotational attention fully connected layers FC1 and FC2 for adaptively adjusting the attention weights; a feature weighted fusion method improves the model's ability to handle complex features.

[0128] Embodiment 1, as Figure 1 As shown, the fault diagnosis method of the unbalanced sample of the surface unmanned boat provided by the embodiment of the present invention includes:

[0129] S1, obtaining one-dimensional vibration time series data of propeller blockage by water weeds, plastic bags, nylon ropes, cloth strips and normal states through sensors of the surface unmanned boat, wherein the sensors of the surface unmanned boat include acceleration sensors installed at the bow, hull and propeller;

[0130] S2, preprocess the collected data to remove outliers and noise, apply the improved SMOTE algorithm, identify and isolate boundary samples and unstable samples through multiple k-means clustering, and generate new samples to balance the data set;

[0131] S3, using continuous wavelet transform to convert the preprocessed one-dimensional vibration data into two-dimensional time-frequency graph data, and divide it into a training set and a test set;

[0132] Divide into training set and test set to facilitate the training and verification of the surface unmanned boat fault diagnosis network model;

[0133] S4, establish a surface unmanned boat fault diagnosis network model, including a residual module, a feature extraction module, an attention module, a pooling layer, a fully connected layer, and an output layer;

[0134] The feature extraction module uses an improved FPN structure to extract multi-scale features and enhance the ability to capture fault features of different sizes. The attention module weights features in the channel and spatial dimensions to improve the expression and recognition accuracy of fault features. The pooling layer is used to reduce the spatial dimension of the feature map and reduce the amount of calculation of subsequent layers. The fully connected layer provides a basis for classification by learning the complex mapping relationship between features and fault types. The output layer is responsible for converting the information of the fully connected layer into the final diagnosis result.

[0135] S5, uses the improved FPN structure to extract multi-scale features from the two-dimensional time-frequency map, integrating feature maps of different levels through bottom-up and top-down paths;

[0136] S6, introduces the rotation attention mechanism, which enhances the expressiveness of features by rotating and pooling the feature map, and applies the Softmax function to generate adaptive weights to achieve weighted fusion of features;

[0137] S7, training the surface unmanned boat fault diagnosis network model, inputting the fused features into the network model, and using the loss function and optimization algorithm for training;

[0138] S8, applying the trained fault diagnosis network model to an independent test set, evaluating the diagnostic accuracy and generalization ability of the fault diagnosis network model, optimizing and adjusting the fault diagnosis network model, and continuously iterating;

[0139] S9, based on the diagnostic results output by the fault diagnosis network model, analyze the fault type and severity to provide a basis for eliminating the fault and repairing the equipment.

[0140] Exemplarily, in step S2, the improved SMOTE algorithm is an improved synthetic minority class oversampling technique, which increases the number of minority class samples by generating new synthetic samples while reducing the impact of potential noise and outliers caused by randomness, and is applicable to the problem of unbalanced data sets in surface unmanned boat fault diagnosis. Specifically, it includes:

[0141] S201, boundary sample identification: Use Euclidean distance to calculate the distance between minority class samples, and at the same time calculate the distance between any minority class sample and the majority class sample. Identify boundary samples based on the size of these distances and isolate and save them to prevent them from affecting model performance.

[0142] For the minority class sample set Any two samples in and ,in, , the distance between them You can use the Euclidean distance calculation, the formula is as follows:

[0143] ;

[0144] In the formula, are the first and samples, is the feature dimension of the sample, that is, the number of features in each sample; They are minority class samples and In the The value of the dimension;

[0145] For samples in the minority class sample set and majority class sample set Samples in , the distance between them You can also use the Euclidean distance calculation, the formula is as follows:

[0146] ;

[0147] In the formula, Represents the majority class sample set. samples, Represents the majority class sample In the The value of the dimension;

[0148] If exists , then the sample is a boundary sample, and the boundary sample is isolated and protected; among them, is the minimum distance between the sample point and the minority class sample, is the minimum distance between the sample point and the majority class sample;

[0149] S202, k-means clustering: Set the number of repetitions for the remaining minority class samples to , the expected number of clusters is K-means clustering and initialize an array ,element Indicates The number of times a sample point changes its cluster;

[0150] S203, Allocation Matrix Construction: Define an allocation matrix , whose elements Indicates The clusters to which the minority class samples belong in a certain clustering, where:

[0151] ;

[0152] For samples and two consecutive clustering and , , calculate the change in cluster assignment ,if , indicating the sample Different clusters were assigned to the two clusterings, namely , update the counter , The larger the value, the more sample points The more affected by noise and outliers, the more unstable the sample is.

[0153] S204, unstable sample identification: by comparing the changes in cluster allocation of samples in multiple clustering, that is, When , they are identified as unstable samples; these samples are more susceptible to noise and outliers;

[0154] S205, setting weight parameters: obtaining the propeller speed of the surface unmanned boat and hull length , define the weight coefficient:

[0155] ;

[0156] In the formula, Indicates the propeller speed of the surface unmanned boat. Indicates the length of the hull, Indicates the number of times a sample changes its cluster in multiple clusterings. represents the number of clustering repetitions, represents the weight coefficient;

[0157] S206, generating new sample points: according to the number of cluster changes recorded in the allocation matrix, the formula of the original SMOTE algorithm is adjusted, and the newly generated sample points are ,in, is a random variable, exist The value in the interval is used to adjust the newly generated sample points relative to the original sample points and its neighbor samples to enhance the diversity and representativeness of the sample;

[0158] S207, sample balance is achieved: the above steps are repeated until the minority sample points and the majority sample points achieve a quantitative balance.

[0159] Exemplarily, in step S2, the collected data is preprocessed to remove outliers and noise using a wavelet threshold algorithm, including:

[0160] S211, analyze the characteristics of the noisy signal, select a suitable wavelet basis function and decomposition level, the wavelet basis function has a certain similarity with the signal waveform to achieve effective decomposition of the signal. Preferably, dbn wavelet, symn wavelet or coifn wavelet is used as the basis function, and the determination of the decomposition level should be based on the complexity of the signal, and 3 to 5 levels are generally recommended to achieve effective decomposition of the signal.

[0161] S212, threshold processing is applied to the signal coefficients after wavelet decomposition. By selecting appropriate threshold functions and threshold parameters, the wavelet coefficients are quantized to suppress the noise component. The soft threshold function formula is as follows:

[0162] ;

[0163] In the formula, The waveform after decomposition Level coefficients, for The absolute value of for The symbol function of is a positive threshold parameter;

[0164] Commonly used thresholds include rigsure threshold, sqtwologs threshold, heursure threshold and maxmin threshold. The formula is as follows:

[0165] ;

[0166] In the formula, is the length of the entire signal, is the signal standard deviation, SNR is the signal-to-noise ratio;

[0167] ;

[0168] In the formula, is the wavelet transform coefficient, is the median;

[0169] S213, reconstructing the wavelet coefficients. The wavelet coefficients processed by the threshold value are reconstructed by inverse discrete wavelet transform to obtain a denoised signal, while ensuring that important features of the signal are retained.

[0170] Exemplarily, in step S3, by By performing wavelet transform, it can be decomposed into a series of and pan The related wavelet coefficients are projected into a two-dimensional time-frequency distribution image as the input of the surface unmanned boat fault diagnosis model. The continuous wavelet transform formula is as follows:

[0171] ;

[0172] ;

[0173] In the formula, are the coefficients of wavelet transform, represents the wavelet function after scaling and translation, are the scale and translation parameters, is the signal or function to be analyzed, is the center position of the wavelet function Through the scale The transformed position of is the set of real numbers;

[0174] The Morlet wavelet basis function formula is as follows:

[0175] ;

[0176] In the formula, is the width of the Gaussian window, is the center frequency, is the normalization factor ensuring that the wavelet function is normalized, is the time variable, is the base of natural logarithms, is the exponential part of the normal distribution, Is an imaginary unit.

[0177] Exemplarily, in step S5, an improved feature pyramid network (FPN) structure, such as Figure 2 As shown in the figure, by optimizing the feature fusion strategy, the model's ability to capture and express fault features of different scales is enhanced, and multi-scale feature extraction in surface unmanned boat fault diagnosis is realized. Specifically, it includes:

[0178] S501, bottom-up network: the input data is processed through a series of residual units, producing a series of gradually decreasing feature maps These feature maps have different resolutions and feature information.

[0179] S502, lateral connection: At each level, lateral connection is performed through 1×1 convolution kernels, which can adjust the number of channels of the feature map to match the required dimension so that features at different levels can be transmitted and integrated more effectively.

[0180] S505, top-down network: Different from the conventional FPN, the improved structure integrates the top-down path into the underlying features. The specific steps are as follows:

[0181] S5051, C5 becomes P4 through 1×1 convolution.

[0182] S5052, C5 is convolved by 1×1 and upsampled by ×2, and then combined with the output of C4 through 1×1 convolution to become P3.

[0183] In S5053, C5 is convolved by 1×1 and upsampled by ×4, C4 is convolved by 1×1 and upsampled by ×2, and then combined with the output of C3 through 1×1 convolution to become P2.

[0184] S5054, C5 passes through 1×1 convolution and upsamples to ×8, C4 passes through 1×1 convolution and upsamples to ×4, C3 passes through 1×1 convolution and upsamples to ×2, and then combines with the output of C2 through 1×1 convolution, and finally becomes P1.

[0185] Among them, the detailed formula of feature fusion is as follows:

[0186] ;

[0187] ;

[0188] ;

[0189] ;

[0190] In the formula, They all represent the features reconstructed from the original features. is the upsampling operation, is the upsampling multiple, The convolution operation is used to adjust the number of channels. For example, P3 represents the feature reconstructed by the original features C4 and C5.

[0191] S506, finally the fused features are output through a convolution layer with a 3×3 convolution kernel.

[0192] Exemplarily, in step S6, a rotation attention module is introduced, such as Figure 3 As shown in the figure, by rotating and weighting the features in different dimensions, the feature extraction and expression capabilities of the surface unmanned boat fault diagnosis model are enhanced, and the recognition accuracy and robustness of the model for fault features are improved. Specifically, it includes:

[0193] S601, Input feature rotation: Rotate the input feature Along the spatial dimension and Rotate 90 degrees clockwise to get and , to enhance the channel and spatial dimensions The interaction between is the original feature, is the set of real numbers, Along the spatial dimension The new feature obtained after rotating 90 degrees clockwise, It is the new feature obtained by rotating 90 degrees clockwise along the spatial dimension W;

[0194] S602, Concatpool operation: respectively Perform Concatpool operation, Apply max pooling on the dimension and average pooling , concatenate the results:

[0195] ;

[0196] ;

[0197] ;

[0198] In the formula, To perform Concatpool operation on the original features, To perform average pooling on the original features, To perform the maximum pooling operation on the original features, To perform Concatpool operation on H-dimensional features, To perform average pooling on H-dimensional features, To perform the maximum pooling operation on the H-dimensional features, To perform Concatpool operation on W-dimensional features, To perform average pooling operation on W-dimensional features, To perform the maximum pooling operation on the W-dimensional features;

[0199] S603, convolution layer and fully connected layer: The output of Concatpool is feature mapped and adaptively weighted through the convolution layer and the subsequent fully connected layers FC1 and FC2. The expression is:

[0200] ;

[0201] In the formula, is the activation function used to introduce nonlinearity, To connect the output of Concatpool to the fully connected layer;

[0202] S604, for each branch The output weight matrix First, through the Softmax function Generate normalized adaptive weights , the expression is:

[0203] ;

[0204] ;

[0205] In the formula, There are three different branches. are the indices of the output weights, The Softmax function acts on the input features On The value obtained after the elements are transformed. is the input vector Middle Elements The index of is the input vector Middle Elements Index of

[0206] S605, feature weighted fusion: Apply adaptive weights to the original rotation features to achieve weighted fusion of features:

[0207] ;

[0208] ;

[0209] ;

[0210] In the formula, is element-wise multiplication, is the weighted C-dimensional feature, is the adaptive weight of dimension C, is the weighted H-dimensional feature, is the new feature obtained by rotating 90 degrees clockwise along the spatial dimension H. is the adaptive weight of dimension H, is the weighted W-dimensional feature, is the new feature obtained by rotating 90 degrees clockwise along the spatial dimension W, is the adaptive weight of dimension W;

[0211] S606, reverse rotation operation: After completing the weighted fusion of features, the features of each branch are Perform the opposite rotation to the previous one to restore the original spatial dimensions; if the original rotation was a 90-degree clockwise rotation along the H or W axis, the inverse rotation is a 90-degree counterclockwise rotation along the same axis:

[0212] ;

[0213] In the formula, To restore the features to their original dimensions, For reverse rotation;

[0214] S607, final feature fusion: Integrate the weighted features to obtain the final feature representation:

[0215] ;

[0216] In the formula, is the feature output by the rotation attention module, is element-wise addition, is the weighted feature after dimension H is restored, is the weighted feature after dimension W is restored, is the weighted feature after dimension C is restored.

[0217] Exemplarily, in step S7, the features after passing through the FPN feature extraction network and the rotational attention are input into the fault diagnosis network model, and the network parameters are reversely updated through the loss function and the optimizer to optimize the surface unmanned boat fault diagnosis model.

[0218] Specifically, the features after feature extraction and attention network are connected to the fully connected network of the network model, and the relevant parameters are continuously updated in reverse through the loss function, so that the predicted type of the input signal data after passing through the model continuously approaches the actual fault type, thereby realizing fault diagnosis and fault classification of the signal data.

[0219] The fault diagnosis network model uses cross entropy as the loss function for training. The basic information entropy of cross entropy is:

[0220] ;

[0221] In the formula, is a random variable The basic information entropy of is a random variable, is the range of values ​​of the random variable, is the probability distribution, for The probability of a variable distribution;

[0222] In the case of multi-classification, the data sample is time, among which As a sample, is the label of the sample. At this time, the prediction result is not only Between two values, but A set of classification labels; the loss function is:

[0223] ;

[0224] In the formula, For label distribution and the predicted distribution Calculate the log-likelihood loss, is the set of true labels, is the probability distribution predicted by the model, is the total number of samples, is the sample index, from 0 to , is the total number of categories, For sample Belongs to category , if it belongs to ,otherwise , Predict samples for the model Belongs to category probability.

[0225] Embodiment 2, the embodiment of the present invention provides a fault diagnosis system for an unbalanced sample of a surface unmanned boat, such as Figure 4 As shown, including:

[0226] A one-dimensional vibration time series data acquisition module is used to acquire one-dimensional vibration time series data of propeller water weed blockage, plastic bag blockage, nylon rope blockage, cloth strip blockage, and normal state through sensors of the surface unmanned boat, wherein the sensors of the surface unmanned boat include acceleration sensors installed at the bow, hull, and propeller;

[0227] The data generation module is used to preprocess the collected data, remove outliers and noise, apply the improved SMOTE algorithm, identify and isolate boundary samples and unstable samples through multiple k-means clustering, and generate new samples to balance the data set;

[0228] A training set and test set division module is used to convert the pre-processed one-dimensional vibration data into two-dimensional time-frequency graph data by using continuous wavelet transform, and divide it into a training set and a test set;

[0229] The surface unmanned boat fault diagnosis network model building module is used to build the surface unmanned boat fault diagnosis network model, including residual module, feature extraction module, attention module, pooling layer, full connection layer, and output layer;

[0230] The multi-scale feature extraction module is used to extract multi-scale features from the two-dimensional time-frequency graph using the improved FPN structure, integrating feature graphs at different levels through bottom-up and top-down paths;

[0231] The rotation attention mechanism module is introduced to introduce the rotation attention mechanism. By rotating and pooling the feature map, the expressiveness of the feature is enhanced, and the Softmax function is applied to generate adaptive weights to achieve weighted fusion of features.

[0232] The fault diagnosis network training module is used to train the surface unmanned boat fault diagnosis network model, input the fused features into the network model, and use the loss function and optimization algorithm for training;

[0233] The testing module is used to apply the trained fault diagnosis network model to an independent test set, evaluate the diagnostic accuracy and generalization ability of the fault diagnosis network model, optimize and adjust the fault diagnosis network model, and continuously iterate;

[0234] The analysis module is used to analyze the fault type and severity according to the diagnosis results output by the fault diagnosis network model, so as to provide a basis for eliminating the fault and repairing the equipment.

[0235] Experimental example.

[0236] Step 1. Collect vibration data of the bow, hull and propeller of the surface unmanned boat in five fault states: propeller blocked by water plants, plastic bags, nylon ropes, cloth strips and normal. The sampling frequency of the acceleration sensor is 10000 Hz.

[0237] Step 2. Perform wavelet threshold denoising on the data collected in step 1, and select the db3 wavelet basis function to decompose the data into 3 layers. The db3 wavelet basis function is as follows:

[0238] ;

[0239] The Heursure threshold is a combination of the RigSure threshold and the Sqtwolog threshold, which is more suitable for high noise conditions. Therefore, the Heursure threshold is selected as the threshold for wavelet denoising in this paper. The formula for the Heursure threshold is as follows:

[0240]

[0241] In the formula, is the length of the entire signal, is the signal standard deviation, SNR is the signal-to-noise ratio;

[0242] ;

[0243] For unbalanced data, the improved SMOTE method is used for expansion, where the number of clusters in k-means clustering is 2 and the total clustering is 100 times. The threshold is selected as 50, that is, if the number of cluster changes is greater than 50, it is considered to be unstable data, and the number of cluster changes is obtained. After that, use The balanced data are obtained and expanded with normal data as the quantity standard. The data of blockage caused by aquatic plants, plastic bags, nylon ropes and cloth strips are expanded to be equal to the normal data.

[0244] Step 3. Use continuous wavelet transform to convert the one-dimensional vibration data preprocessed in step 2 into two-dimensional time-frequency graph data, and generate a CWT graph for every 1024 data points.

[0245] The continuous wavelet transform formula is as follows:

[0246] ;

[0247] ;

[0248] In the formula, are the coefficients of wavelet transform, represents the scaled and translated wavelet function, are the scale and translation parameters, is the signal or function to be analyzed, is the center position of the wavelet function Through the scale The transformed position of is the set of real numbers;

[0249] The Morlet complex wavelet is selected as the wavelet basis function, and its bandwidth parameter is set to 3 and the center frequency is set to 3. The formula of the Morlet wavelet basis function is as follows:

[0250] ;

[0251] In the formula, is the width of the Gaussian window, is the center frequency, is the normalization factor ensuring that the wavelet function is normalized, is the time variable, is the base of natural logarithms, is the exponential part of the normal distribution, Is an imaginary unit.

[0252] After converting the one-dimensional vibration data into two-dimensional time-frequency graph data, it is divided into training set and test set in a ratio of 7:3. The data is input into the surface unmanned boat fault diagnosis network model to train and optimize the model.

[0253] Step 4. Establish a surface unmanned boat fault diagnosis network model, including residual module, feature extraction module, attention module, pooling layer, fully connected layer, and output layer.

[0254] The residual module is based on the ResNet-50 architecture.

[0255] The feature extraction module adopts an improved feature pyramid network (FPN) structure to integrate feature maps of different resolutions through bottom-up and top-down multi-scale feature fusion.

[0256] The attention module introduces a rotational attention mechanism, which enhances the model's ability to express fault features by rotating and weighting features in channel and spatial dimensions, and uses the Softmax function to generate adaptive weights to achieve weighted fusion of features.

[0257] After feature extraction, pooling operation is used to reduce the number of parameters and the complexity of the model, and then input

[0258] The fully connected layers map the extracted high-level features to the final fault categories.

[0259] Step 5. Design and train a deep learning model, input the fused features into the network, and use appropriate loss functions and optimization algorithms for training to achieve accurate identification of fault types.

[0260] The data was input into the surface unmanned boat fault diagnosis network model for training. The batch size during training was set to 32 and the number of iterations was 50. The Adam optimizer was used to automatically optimize the learning rate. The model parameters were optimized using the cross entropy loss function. The training and test accuracy curves are shown in Figure 2. Figure 5 As shown, the training and test loss curves are as follows Figure 6 As shown in the figure, the training results show that the accuracy curve of the training set has completely converged after about 10 iterations, and the accuracy has reached 99.2%. The loss curve decreases rapidly with the iterations and completely converges after 13 iterations, and the loss is close to 0.02. The accuracy curve of the test set has completely converged after 10 iterations, reaching 99.6%. The loss curve decreases rapidly with the iterations and completely converges after 17 iterations, and is infinitely close to 0.02. Figure 7 Confusion matrix diagram of training results.

[0261] Step 6. Set up an ablation test to prove the effectiveness of the present invention. The ablation test is designed as follows:

[0262] Model A: ResNet model, unbalanced data. Use the standard ResNet-50 architecture without any improved FPN or rotational attention mechanism, and train with the original unbalanced dataset.

[0263] Model B: ResNet model with balanced data. Same as Model A, but the dataset is processed using the improved SMOTE algorithm to balance the category distribution.

[0264] Model C: ResNet model, balanced data + improved FPN feature extraction. Based on model B, an improved FPN structure is added for feature extraction to enhance the ability to capture multi-level fault features.

[0265] Model D: ResNet model, balanced data + FPN feature extraction + rotational attention. Complete model configuration, including all improvements: balanced dataset, improved FPN feature extraction and rotational attention mechanism

[0266] The training and optimization of the model are consistent with step 5. The batch size during training is set to 32 and the number of iterations is 50. The Adam optimizer is used to automatically optimize the learning rate and the cross entropy loss function is used to optimize the model parameters.

[0267] in, Figure 8 This is a comparison chart of the accuracy of different models. Fig. 9 Comparison chart of loss of different models.

[0268] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principles of the present invention should be covered within the protection scope of the present invention.

Claims

1. A fault diagnosis method for an unbalanced sample of a surface unmanned vehicle, characterized in that: The method includes: S1, obtaining one-dimensional vibration time series data of propeller blockage by water weeds, plastic bags, nylon ropes, cloth strips and normal states through sensors of the surface unmanned boat, wherein the sensors of the surface unmanned boat include acceleration sensors installed at the bow, hull and propeller; S2, preprocess the collected data to remove outliers and noise, apply the improved SMOTE algorithm, identify and isolate boundary samples and unstable samples through multiple k-means clustering, and generate new samples to balance the data set; S3, using continuous wavelet transform to convert the preprocessed one-dimensional vibration data into two-dimensional time-frequency graph data, and divide it into a training set and a test set; S4, establish a surface unmanned boat fault diagnosis network model, including a residual module, a feature extraction module, an attention module, a pooling layer, a fully connected layer, and an output layer; S5, uses the improved FPN structure to extract multi-scale features from the two-dimensional time-frequency map, integrating feature maps of different levels through bottom-up and top-down paths; S6, introduces the rotation attention mechanism, which enhances the expressiveness of features by rotating and pooling the feature map, and applies the Softmax function to generate adaptive weights to achieve weighted fusion of features; S7, training the surface unmanned boat fault diagnosis network model, inputting the fused features into the network model, and using the loss function and optimization algorithm for training; S8, applying the trained fault diagnosis network model to an independent test set, evaluating the diagnostic accuracy and generalization ability of the fault diagnosis network model, optimizing and adjusting the fault diagnosis network model, and continuously iterating; S9, analyzing the fault type and severity according to the diagnostic results output by the fault diagnosis network model, and providing a basis for eliminating the fault and repairing the equipment; In step S2, the improved SMOTE algorithm includes: S201, boundary sample identification: For the minority class sample set x = {x1, x2, ..., x n Any two samples x in i and x j The distance between xx (i, j) is calculated using the Euclidean distance; where i, j < n, the formula is as follows: In the formula, x i , x j are the i-th and j-th samples in the minority class sample set, respectively; d is the feature dimension of the sample, that is, the number of features in each sample; x ik , x jk They are respectively minority class samples x i and x j The value in the kth dimension; For the sample x in the minority class sample set i and the majority class sample set y = {y1, y2, ..., y m Sample y in} j , j<m, the distance between them is d xy (i, j) is calculated using the Euclidean distance, as follows: In the formula, y j represents the jth sample in the majority class sample set, y jk Represents the majority class sample y j The value in the kth dimension; If there is d xxmin (i, j)>d xymin (i, j), then the sample x i is the boundary sample, and the boundary sample is isolated and protected; where d xxmin (i, j) is the minimum distance between the sample point and the minority class sample, d xymin (i, j) is the minimum distance between the sample point and the majority class sample; S202, k-means clustering: Set the number of repetitions for the remaining minority class samples to The expected number of clusters is k-means clustering, and initialize an array f, element f p Indicates the number of times the pth sample point changes its cluster; S203, allocation matrix construction: define an allocation matrix A, element A pq Indicates the cluster to which the p-th minority class sample belongs in a certain clustering, where: For a sample p and two consecutive clusters r and r′, r′=r+1, calculate the change in cluster assignment ΔA p (r) = A pq -A pq′ , if ΔA p (r)≠0, indicating that sample p is assigned to different clusters in the two clusterings, i.e., q≠q′, and the counter f is updated. p =f p +1,f p The larger the value is, the more affected the sample point p is by noise and outliers, which means it is an unstable sample. S204, unstable sample identification: by comparing the changes in cluster allocation of samples in multiple clustering, i.e. ΔA p When (r)>τ, it is identified as an unstable sample; S205, setting weight parameters: obtaining the propeller speed w and the hull length L of the surface unmanned boat, and defining the weight coefficient as: In the formula, w represents the propeller speed of the unmanned surface vehicle, L represents the length of the hull, and f p represents the number of times the sample changes its cluster in multiple clusterings, M represents the number of clustering repetitions, and w usv represents the weight coefficient; S206, generating new sample points: according to the number of cluster changes recorded in the allocation matrix, the formula of the original SMOTE algorithm is adjusted, and the newly generated sample point is x new =x i +(1-δ·w usv )·(x j -x i ), where δ∈(0,1) is a random variable, δ takes values ​​in the interval (0,1) and is used to adjust the newly generated sample point relative to the original sample point x i and its neighbor samples x j location; S207, sample balance is achieved: the above steps are repeated until the minority sample points and the majority sample points achieve a quantitative balance.

2. The fault diagnosis method for unbalanced samples of unmanned surface vehicles according to claim 1 is characterized in that: In step S2, the collected data is preprocessed to remove outliers and noise, including: S211, analyzing the characteristics of the noisy signal, selecting dbn wavelet, symn wavelet or coifn wavelet as the basis function, and the number of decomposition layers is 3 to 5; S212, threshold processing is applied to the signal coefficients after wavelet decomposition. By selecting a threshold function and a threshold parameter, the wavelet coefficients are quantized to suppress the noise component. The formula of the soft threshold function is as follows: In the formula, ω j,k is the jth coefficient of the kth level after waveform decomposition, |ω j,k | is ω j,k The absolute value of sgn(ω j,k ) is ω j,k The sign function of , λ is a positive threshold parameter; The formula for the heursure threshold λ is as follows: Where N is the length of the entire signal, σ is the signal standard deviation, and SNR is the signal-to-noise ratio; In the formula, ω j,k is the wavelet transform coefficient, Median() is the median; S213, reconstructing the wavelet coefficients.

3. The fault diagnosis method for unbalanced samples of unmanned surface vehicles according to claim 1, characterized in that: In step S3, the preprocessed one-dimensional vibration data is converted into two-dimensional time-frequency graph data by continuous wavelet transform, including: performing wavelet transform on the one-dimensional signal x(t), decomposing it into wavelet coefficients related to scale s and translation t, and projecting it into a two-dimensional time-frequency distribution image as the input of the surface unmanned boat fault diagnosis model. The continuous wavelet transform formula is as follows: Where W(a, b) is the coefficient of wavelet transform, ψ a,b (t) represents the scaled and translated wavelet function, a and b are the scale and translation parameters respectively, f(t) is the signal or function to be analyzed, is the position of the center position b of the wavelet function after the transformation of scale a, and R is a real number set; The Morlet wavelet basis function formula is as follows: In the formula, is the width of the Gaussian window, ω0 is the center frequency, π 1 / 4 is the normalization factor to ensure that the wavelet function is normalized, t is the time variable, e is the base of the natural logarithm, is the exponential part of the normal distribution, and i is the imaginary unit.

4. The fault diagnosis method for unbalanced samples of unmanned surface vehicles according to claim 1, characterized in that: In step S5, the improved FPN structure is used to extract multi-scale features from the two-dimensional time-frequency graph, including: S501, bottom-up network: the input data is processed through a series of residual units to produce gradually reduced feature maps [C1, C2, C3, C4, C5], which have different resolutions and feature information; S502, lateral connection: At each level, lateral connection is performed through 1×1 convolution kernels to adjust the number of channels of the feature map to match the required dimension so that features at different levels can be effectively transferred and integrated; S505, top-down network: integrating top-down pathways into underlying features; S506, the fused features are output through a convolution layer with a 3×3 convolution kernel.

5. The fault diagnosis method for unbalanced samples of unmanned surface vehicles according to claim 4, characterized in that: In step S505, the top-down path is integrated into the underlying features, including: S5051, C5 becomes P4 through 1×1 convolution; At S5052, C5 is convolved by 1×1 and upsampled by ×2, and then combined with the output of C4 through 1×1 convolution to become P3; At S5053, C5 is convolved by 1×1 and upsampled by ×4, C4 is convolved by 1×1 and upsampled by ×2, and then combined with the output of C3 through 1×1 convolution to become P2; S5054, C5 is upsampled by ×8 through 1×1 convolution, C4 is upsampled by ×4 through 1×1 convolution, C3 is upsampled by ×2 through 1×1 convolution, and the output of C2 is combined with the output of 1×1 convolution, and finally becomes P1; in, P4=C 1×1 (C5) P3=U (2) (C 1×1 (C5))+C 1×1 (C4) P2=U (4) (C 1×1 (C5))+U (2) (C 1×1 (C4))+C 1×1 (C3) P1=U (8) (C 1×1 (C5))+U (4) (C 1×1 (C4))+U (2) (C 1×1 (C3))+C 1×1 (C2) In the formula, [P1, P2, P3, P4] all represent the features reconstructed from the original features, U( f ) is the upsampling operation, f is the upsampling multiple, C 1×1 It is used to adjust the number of channels for convolution operation.

6. The method for fault diagnosis of unbalanced samples of unmanned surface vehicles according to claim 1, characterized in that: In step S6, the rotation attention mechanism is introduced to enhance the expressiveness of features by rotating and pooling the feature map, including: S601, Input feature rotation: Rotate the input feature Rotate 90 degrees clockwise along the spatial dimensions H and W to get and To enhance the interaction between channel C and spatial dimensions H, W; where x is the original feature, is a set of real numbers, x rotatedH is the new feature obtained by rotating 90 degrees clockwise along the spatial dimension H, x rotatedW It is the new feature obtained by rotating 90 degrees clockwise along the spatial dimension W; S602, Concatpool operation: perform Concatpool operations on feature x respectively, apply maximum pooling Maxpool and average pooling Avgpool in C, H, and W dimensions, and concatenate the results: In the formula, Z(x) is the Concatpool operation on the original feature, AvgPool(x) is the average pooling operation on the original feature, MaxPool(x) is the maximum pooling operation on the original feature, and Z(x rotatedH ) is to perform Concatpool operation on H-dimensional features, AvgPool(x rotatedH ) is an average pooling operation for H-dimensional features, MaxPool(x rotatedH ) is the maximum pooling operation for the H-dimensional feature, Z(x rotatedW ) is to perform Concatpool operation on W-dimensional features, AvgPool(x rotatedW ) is an average pooling operation on the W-dimensional features, MaxPool(x rotatedW ) is to perform the maximum pooling operation on the W-dimensional features; S603, convolution layer and fully connected layer: The output of Concatpool is feature mapped and adaptively weighted through the convolution layer and the subsequent fully connected layers FC1 and FC2. The expression is: P = FC2(ReLU(FC1(Z))) In the formula, ReLU() is the activation function used to introduce nonlinearity, and FC1(Z) connects the output of Concatpool to the fully connected layer; S604, for each branch i output weight matrix p i First, the normalized adaptive weight ω is generated by the Softmax function σ i , the expression is: oh i =σ(p i ) Where i=CHW are three different branches, j and k are the indexes of output weights, and σ(z) j is the value obtained after the Softmax function acts on the j-th element of the input feature z. is the jth element z in the input vector z j The index of is the kth element z in the input vector z k Index of S605, feature weighted fusion: Apply adaptive weights to the original rotation features to achieve weighted fusion of features: x weightedC =x⊙ω C x weightedH =x rotatedH ⊙ω H x weightedW =x rotatedW ⊙ω W In the formula, ⊙ is the element-by-element multiplication, x weightedC is the weighted C-dimensional feature, ω C is the adaptive weight of dimension C, x weightedH is the weighted H-dimensional feature, x rotatedH is the new feature obtained by rotating 90 degrees clockwise along the spatial dimension H, ω H is the adaptive weight of dimension H, x weightedW is the weighted W-dimensional feature, x rotatedW is the new feature obtained by rotating 90 degrees clockwise along the spatial dimension W, ω W is the adaptive weight of dimension W; S606, reverse rotation operation: After completing the weighted fusion of features, the features of each branch are Perform the opposite rotation to the previous one to restore the original spatial dimensions; if the original rotation was a 90-degree clockwise rotation along the H or W axis, the inverse rotation is a 90-degree counterclockwise rotation along the same axis: x restordi =Rotate -1 (x weightedi ) In the formula, x restoredi To restore the features to their original dimensions, Rotate -1 () is reverse rotation; S607, final feature fusion: Integrate the weighted features to obtain the final feature representation: In the formula, x final is the feature output by the rotation attention module, is element-by-element addition, x restoredH is the weighted feature after dimension H recovery, x restoredW is the weighted feature after dimension W is restored, x restoredC is the weighted feature after dimension C is restored.

7. The fault diagnosis method for unbalanced samples of unmanned surface vehicles according to claim 1, characterized in that: In step S7, the features after feature extraction and attention network are connected to the fully connected network of the network model, and the relevant parameters are continuously updated in reverse through the loss function, so that the predicted type of the input signal data after passing through the model continuously approaches the actual fault type, thereby realizing fault diagnosis and fault classification of the signal data.

8. The method for fault diagnosis of unbalanced samples of unmanned surface vehicles according to claim 7, characterized in that: The fault diagnosis network model uses cross entropy as the loss function for training. The basic information entropy of cross entropy is: In the formula, H(X) is the basic information entropy of the random variable X, x is the random variable, n is the range of the random variable, p(x) is the probability distribution, p( xi ) is the distribution probability of i variables; In the case of multi-classification, when the data sample is (a, b), where a is the sample and b is the label of the sample, the prediction result is not just between the two values ​​{0, 1}, but a set of K classification labels; the loss function is: Where, L log(Y,P) is the log-likelihood loss calculated for the label distribution Y and the predicted distribution P, where Y is the set of true labels, P is the probability distribution predicted by the model, N is the total number of samples, i is the sample index from 0 to N-1, K is the total number of categories, and y i,k Is whether sample i belongs to category k, if it belongs to y i,k =1, otherwise y i,k =0,P i,k The model predicts the probability that sample i belongs to category k.

9. A fault diagnosis system for unbalanced samples of surface unmanned boats, characterized in that: The system is diagnosed by the fault diagnosis method of the unbalanced sample of the surface unmanned boat according to any one of claims 1 to 8, and the system comprises: A one-dimensional vibration time series data acquisition module is used to acquire one-dimensional vibration time series data of propeller water weed blockage, plastic bag blockage, nylon rope blockage, cloth strip blockage, and normal state through sensors of the surface unmanned boat, wherein the sensors of the surface unmanned boat include acceleration sensors installed at the bow, hull, and propeller; The data generation module is used to preprocess the collected data, remove outliers and noise, apply the improved SMOTE algorithm, identify and isolate boundary samples and unstable samples through multiple k-means clustering, and generate new samples to balance the data set; A training set and test set division module is used to convert the pre-processed one-dimensional vibration data into two-dimensional time-frequency graph data by using continuous wavelet transform, and divide it into a training set and a test set; The surface unmanned boat fault diagnosis network model building module is used to build the surface unmanned boat fault diagnosis network model, including residual module, feature extraction module, attention module, pooling layer, full connection layer, and output layer; The multi-scale feature extraction module is used to extract multi-scale features from the two-dimensional time-frequency graph using the improved FPN structure, integrating feature graphs at different levels through bottom-up and top-down paths; The rotation attention mechanism module is introduced to introduce the rotation attention mechanism. By rotating and pooling the feature map, the expressiveness of the feature is enhanced, and the Softmax function is applied to generate adaptive weights to achieve weighted fusion of features. The fault diagnosis network training module is used to train the surface unmanned boat fault diagnosis network model, input the fused features into the network model, and use the loss function and optimization algorithm for training; The testing module is used to apply the trained fault diagnosis network model to an independent test set, evaluate the diagnostic accuracy and generalization ability of the fault diagnosis network model, optimize and adjust the fault diagnosis network model, and continuously iterate; The analysis module is used to analyze the fault type and severity according to the diagnosis results output by the fault diagnosis network model, so as to provide a basis for eliminating the fault and repairing the equipment.

Citation Information

Patent Citations

  • Data driven incremental integration based screw type fault diagnosis model

    CN107784325A

  • Parcel position real-time detection method and device based on rotating target detection, equipment and medium

    CN114821408A

  • Power system fault diagnosis method based on MP-Convform parallel network

    CN118410415A

  • Unbalanced bearing data fault diagnosis method based on two-dimensional time-frequency image space domain and frequency domain auxiliary classification generative adversarial network

    CN118468019A