Ship electrical fault diagnosis method and system based on machine learning algorithm

Through a machine learning algorithm-based method, the Teager capability operator and wavelet packet feature extraction technology are used, combined with convolutional neural network, and the accuracy and efficiency of ship electrical fault diagnosis are solved, achieving high accuracy and rapid fault recognition.

CN120217119AInactive Publication Date: 2025-06-27NANJING DAQO ELECTRICAL INST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510694389.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-28
Publication Date
2025-06-27
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the prior art, the accuracy of ship electrical fault diagnosis is low, the accuracy of fault classification is insufficient, the learning efficiency of neural networks is not high, and the overall diagnosis time is long.

Method used

Using a machine learning algorithm method, the vibration signals of ship electrical equipment are collected and enhanced processing is performed using the Teager capability operator. Then wavelet packet feature extraction is performed to obtain feature vectors, and the convolutional neural network is trained based on these feature vectors to obtain a fault prediction model.

Benefits of technology

It improves the accuracy of fault identification, improves the degree of automation of processing processes, is highly complex in adapting to environment, and is suitable for real-time intelligent health monitoring and maintenance warning of key equipment such as ships.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120217119A_ABST
    Figure CN120217119A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of ships, discloses a ship electrical fault diagnosis method and system based on a machine learning algorithm, and aims to effectively enhance nonlinear instantaneous features in a signal by introducing a Teager capability operator to preprocess the original vibration signal, so that the subsequent feature extraction stage is more sensitive and accurate. And meanwhile, multi-level and multi-scale frequency domain division is realized by utilizing wavelet packet decomposition, and key characteristic frequency bands are screened in a targeted manner, so that redundant data interference is reduced, and the identification degree and stability of the characteristics are also improved. Besides, the convolutional neural network is introduced to train and classify the extracted feature vectors, and automatic optimization of network weight is realized in combination with a back propagation algorithm, so that the generalization ability and diagnosis precision of the model for complex electrical faults are effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of ships, and particularly relates to a ship electrical fault diagnosis method and system based on a machine learning algorithm. Background Art

[0002] Electrical equipment is a key component in ship operation, covering multiple aspects such as ship navigation, control, communication, and basic living guarantee for crew members. Whether it is related to the overall navigation ability of the ship or the convenience of crew daily operations, electrical equipment plays an indispensable role. Therefore, timely and accurate classification and diagnosis of ship electrical equipment faults are of great significance for ensuring the safe operation of ships and reducing economic losses caused by faults.

[0003] Regarding the fault diagnosis of ship equipment, there have been many research works. Some scholars have proposed a ship diesel engine fault diagnosis method for unbalanced data based on graph convolutional network (GCN). Aiming at the problem of uneven distribution of diesel engine state information, this method introduces Kullback-Leibler (K-L) divergence to measure the similarity between samples, and uses the graph learning mechanism to extract and aggregate sample features in a multi-layer graph convolutional network to achieve fault discrimination. Another study proposed a ship main engine fault diagnosis method based on rough set and optimized directed acyclic graph support vector machine (DAG-SVM). The sample data is dimensionally reduced through a discrimination matrix, and the performance of the classifier is improved by combining rough set theory. With the goal of optimizing the multi-classification accuracy and the position of leaf nodes, the problem of error accumulation in traditional methods is improved. In addition, some scholars, aiming at the defects of the traditional BP neural network (Back Propagation Neural Network), have proposed a ship power system fault diagnosis method that optimizes the BP neural network and combines the idea of "small network clusters" to improve the accuracy and efficiency of ship electrical fault identification and diagnosis.

[0004] Although the existing methods have improved the ability of ship equipment fault diagnosis to a certain extent, there are still many problems, such as: the accuracy of fault diagnosis is low, the precision of fault classification is insufficient, the learning efficiency of the neural network is not high, and the overall diagnosis time is long. These problems are likely to lead to untimely fault handling in practical applications, thus increasing the operation risk of ships and bringing serious consequences. Therefore, it is urgent to research and develop a more efficient, accurate, and rapid ship electrical equipment fault classification and diagnosis method to better meet the actual needs of ship safe operation. Summary of the Invention

[0005] In an embodiment of the present invention, a ship electrical fault diagnosis method and system based on a machine learning algorithm are provided to solve the problems of low accuracy of ship electrical fault diagnosis, insufficient fault classification accuracy, low learning efficiency of a neural network, and long overall diagnosis time in the prior art.

[0006] To solve the above technical problems, the embodiments of the present invention disclose the following technical solutions: One aspect of the present invention provides a ship electrical fault diagnosis method based on a machine learning algorithm, including: Collect vibration signals of various electrical devices on the ship and perform enhancement processing using the Teager energy operator. The vibration signals include vibration signals when the electrical devices are operating normally and vibration signals when various faults occur. Extract wavelet packet features from the enhanced vibration signals to obtain feature vectors of all vibration signals. Train a convolutional neural network based on the feature vectors to obtain a fault prediction model. After enhancing the target vibration signal using the Teager energy operator, input it into the fault prediction model to generate a fault diagnosis result.

[0007] Optionally, the step of collecting vibration signals of various electrical devices on the ship and performing enhancement processing using the Teager energy operator includes: For each electrical device, collect multiple vibration signals when it is operating normally and multiple vibration signals when various faults occur. For any one vibration signal, use the Teager energy operator to express the vibration signal as :

[0008]

[0009] where , and are the frequency, amplitude, and phase of the vibration signal respectively; t is the time variable of the vibration signal.

[0010] Optionally, before performing the step of extracting wavelet packet features from the enhanced vibration signals to obtain feature vectors of all vibration signals, the method further includes: Perform normalization processing on all enhanced vibration signals.

[0011] Optionally, the step of extracting wavelet packet features from the enhanced vibration signals to obtain feature vectors of all vibration signals includes: For each vibration signal, the following method is used to obtain the feature vector: Using a set of conjugate low-pass filters h(k) and high-pass filters Decompose the enhanced vibration signal into layers, where the L-th layer contains frequency bands; Pre-screen m characteristic frequency bands in the L-th layer; Retain the wavelet packet coefficients corresponding to the characteristic frequency bands, and set the wavelet packet coefficients corresponding to other frequency bands to zero to form a new wavelet packet coefficient sequence for the L-th layer ; Based on the sequence Perform wavelet packet reconstruction to obtain a complete characteristic signal; Calculate the average energy of each frequency band in each layer of the characteristic signal and perform normalization processing to obtain the feature vector of the characteristic signal.

[0012] Optionally, the retaining the wavelet packet coefficients corresponding to the characteristic frequency bands and setting the wavelet packet coefficients corresponding to other frequency bands to zero to form a new wavelet packet coefficient sequence for the L-th layer , includes: Construct a new wavelet packet coefficient sequence according to the following formula :

[0013]

[0014] where is the set of serial numbers of the m characteristic frequency bands selected; n is the serial number of the frequency band; is the wavelet packet coefficient sequence of the frequency band n in the L-th layer, obtained by the following formula:

[0015] where 2d = n; is the wavelet packet coefficient sequence of the frequency band d in the (L-1)-th layer, k is the serial number of the sampling point in the sequence; i is the serial number of the sampling point in the wavelet packet coefficient sequence of the L-th layer.

[0016] Optionally, the performing wavelet packet reconstruction based on the sequence to obtain a complete characteristic signal, includes: Use the following formula to perform wavelet packet reconstruction on :

[0017] where is the serial number of the decomposition layer, is the serial number of the sampling point of the wavelet packet coefficient sequence of the current layer, is the serial number of the sampling point of the layer wavelet packet coefficient sequence.

[0018] Optionally, the method further includes: Constructing a data set based on the feature vectors, and dividing the data set into a training data set and a validation data set.

[0019] Optionally, the convolutional neural network includes a plurality of convolutional layers, pooling layers, fully connected layers, and calculates errors through a cross-entropy loss function.

[0020] Optionally, training the convolutional neural network based on the feature vectors to obtain a fault prediction model, including: Inputting all the feature vectors in the training data set into the convolutional neural network for training, and automatically updating the weight parameters of each layer of the network by using the backpropagation algorithm in a supervised learning manner; Performing multiple iterative trainings on the classifier, and optimizing the performance of the classifier and updating the classifier parameters after each training until the classification accuracy meets the preset conditions, and then completing the training to obtain a fault prediction model.

[0021] Another aspect of the present invention discloses a ship electrical fault diagnosis system based on a machine learning algorithm, which is applied to a ship electrical fault diagnosis method based on a machine learning algorithm disclosed in the foregoing aspect.

[0022] A ship electrical fault diagnosis method and system disclosed in an embodiment of the present invention preprocess the original vibration signal by introducing a Teager energy operator, effectively enhancing the non-linear instantaneous features in the signal, making the subsequent feature extraction stage more sensitive and accurate. At the same time, wavelet packet decomposition is used to achieve multi-level and multi-scale frequency domain division, and key feature frequency bands are screened out specifically, which not only reduces the interference of redundant data, but also improves the recognition and stability of features. In addition, a convolutional neural network is introduced to train and classify the extracted feature vectors, and the backpropagation algorithm is combined to automatically optimize the network weights, effectively improving the generalization ability and diagnosis accuracy of the model for complex electrical faults. The method and system disclosed in the present invention have the advantages of high fault recognition accuracy, high degree of automation in the processing flow, strong adaptability to environmental complexity, etc., and are suitable for real-time intelligent health monitoring and maintenance warning of key equipment such as ships. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 is a schematic flow chart of a ship electrical fault diagnosis method based on a machine learning algorithm provided by an embodiment of the present invention; Figure 2 is to provide an implementation for an embodiment of the present invention Figure 1Flow diagram of step S200; Figure 3 Schematic diagram of a basic structure of a convolutional neural network provided by an embodiment of the present invention; Figure 4 One kind of implementation provided by an embodiment of the present invention Figure 1 Flow diagram of step S300 in Figure 5 Original signal waveform diagram provided by an embodiment of the present invention; Figure 6 Amplified signal waveform diagram provided by an embodiment of the present invention; Figure 7 Fault diagnosis accuracy rate result diagram provided by an embodiment of the present invention. Detailed implementation manners

[0024] To enable those skilled in the art to better understand the technical solutions of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific implementation manners.

[0025] Figure 1 Flow diagram of a ship electrical fault diagnosis method based on a machine learning algorithm disclosed by an embodiment of the present invention. As Figure 1 shown, the method includes the following steps: Step S100: Collect vibration signals of various electrical devices on a ship and perform enhancement processing using the Teager energy operator.

[0026] The vibration signals include vibration signals when the electrical devices are operating normally and vibration signals when various faults occur. Since the operating states of electrical devices during ship operation are complex, the vibration characteristics are variable, and the signal noise interference is significant, in an embodiment disclosed in the present invention, step S100 can be implemented in the following manner: Deploy multiple high-sensitivity vibration sensors for various types of electrical devices operating on the ship (such as generators, motors, distribution cabinets, transformers, etc.), and continuously collect the vibration signals on their surfaces or key parts during device operation.

[0027] The acquisition process needs to cover the following two types of states: vibration signals of electrical devices in the normal operating state; vibration signals of electrical devices when different types of faults occur (such as motor winding short circuits, bearing faults, rotor imbalance, etc.). To ensure the data coverage and representativeness, multiple samples should be collected for each operating state of each type of device to form a complete training data set.

[0028] Given that the high-noise background in the ship operation environment will mask some key vibration characteristics, directly using the original signal for feature extraction and classification will seriously affect the diagnostic accuracy. Therefore, in the disclosed embodiments of the present invention, the Teager energy operator is first used to enhance the vibration signal.

[0029] For any vibration signal, the vibration signal is expressed as :

[0030]

[0031] wherein, , and are the frequency, amplitude, and phase of the vibration signal, respectively, obtained by the set vibration sensor; t is the time variable of the vibration signal.

[0032] The Teager energy operator can complete the amplification of the vibration signal of the ship electrical equipment collected by the sensor by using the non-linear combination of the original vibration signal of the ship electrical equipment and the first and second derivatives of the original signal, reduce the influence of noise, and facilitate better completion of the vibration signal feature extraction.

[0033] In an embodiment disclosed in the present invention, before performing step S200, it is also necessary to perform a normalization process on all the enhanced vibration signals.

[0034] For example, the amplitude of the vibration signal is normalized to [–1, 1].

[0035] Step S200: Perform wavelet packet feature extraction on the enhanced vibration signal to obtain the feature vectors of all the vibration signals.

[0036] In an embodiment disclosed in the present invention, as Figure 2 shown, step S200 can be implemented by the following sub-steps: For each vibration signal, the feature vector is obtained in the following manner: Step S201: Use a set of conjugate low-pass filters h(k) and high-pass filters to decompose the enhanced vibration signal into layers.

[0037] wherein, , for a vibration signal of a ship electrical equipment with a length of 2N, the layering should follow the principle.

[0038] Select a set of conjugate low-pass filters h(k) and high-pass filters There is the following relationship between the two: This way of constructing the filter ensures that conditions such as orthogonality and energy conservation are satisfied during the wavelet packet decomposition and reconstruction processes, which is beneficial for subsequent extraction of frequency features with physical significance.

[0039] Using the constructed low-pass filter and high-pass filter to perform multi-layer wavelet packet decomposition on each vibration signal, setting the decomposition level as L, then the L-th layer will contain equi-width frequency bands, and each frequency band corresponds to a set of wavelet packet coefficient sequences. The decomposition process of each layer includes performing low-pass and high-pass filtering on each frequency band in the previous layer respectively, and downsampling to obtain the frequency bands of this layer.

[0040] is the wavelet packet coefficient sequence of the n-th frequency band in the L-th layer, which is obtained by the following formula:

[0041] where 2d = n; is the wavelet packet coefficient sequence of the d-th frequency band in the (L - 1)-th layer, k is the serial number of the sampling point in the sequence; i is the serial number of the sampling point in the wavelet packet coefficient sequence of the L-th layer.

[0042] , the starting frequency of each layer is , the sequence bandwidth is , is the sampling frequency, and n is the currently calculated layer number.

[0043] Step S202: Pre-screen m characteristic frequency bands in the L-th layer.

[0044] According to the actual application background and empirical knowledge of the vibration signal, combined with the signal spectrum characteristics, m characteristic frequency bands with strong discrimination ability are pre-determined in advance, and the selected characteristic frequency bands are denoted as .

[0045] Step S203: Retain the wavelet packet coefficients corresponding to the characteristic frequency bands, and set the wavelet packet coefficients corresponding to other frequency bands to zero to form a new wavelet packet coefficient sequence of the L-th layer .

[0046] In an embodiment disclosed by the present invention, a new wavelet packet coefficient sequence is constructed according to the following formula :

[0047]

[0048] where is the set of serial numbers of the m selected characteristic frequency bands; n is the serial number of the frequency band; is the wavelet packet coefficient sequence of the middle frequency band n in the L-th layer, and is obtained by the following formula:

[0049] where 2d = n; is the wavelet packet coefficient sequence of the middle frequency band d in the (L - 1)-th layer, k is the serial number of the sampling point in the sequence; i is the serial number of the sampling point in the wavelet packet coefficient sequence of the L-th layer.

[0050] After construction only contains the effective information of the selected frequency band, thereby improving the sparsity and pertinence of feature expression, and effectively suppressing the interference of irrelevant frequency bands on model training.

[0051] Step S204: Based on the sequence perform wavelet packet reconstruction to obtain a complete feature signal; Based on the constructed new wavelet packet coefficient sequence perform wavelet packet reconstruction operations to restore the corresponding time-domain feature signal, and the reconstruction process proceeds layer by layer upward from the L-th layer to the 0-th layer.

[0052] In an embodiment disclosed by the present invention, the following formula is used to perform wavelet packet reconstruction:

[0053] where is the serial number of the decomposition layer, is the serial number of the sampling point of the wavelet packet coefficient sequence of the current layer, is the serial number of the sampling point of the wavelet packet coefficient sequence of the -th layer.

[0054] Step S205: Calculate the average energy of each frequency band in each layer of the feature signal respectively and perform normalization processing to obtain the feature vector of the feature signal.

[0055] Calculate the average energy feature of the reconstructed feature signal in each layer and each frequency band respectively, and normalize the obtained energy feature vector to eliminate the influence of the dimension and magnitude of each dimension feature, and improve the training stability and prediction performance of the subsequent machine learning model.

[0056] Wavelet packet decomposition The average energy of the -th frequency band in the -th layer can be calculated by the square of the wavelet coefficient

[0057] where M is the total number of frequency bands in the -th layer; N is the number of layers.

[0058] The The sum of the energies of each frequency band in the layer is .

[0059] Divide the of each frequency band by the total , and perform a normalization operation to form each dimension of the feature vector.

[0060] Step S300: Train a convolutional neural network based on the feature vector to obtain a fault prediction model.

[0061] In an embodiment disclosed by the present invention, a data set is constructed based on the feature vector, and the data set is divided into a training data set and a validation data set.

[0062] In an embodiment disclosed by the present invention, as Figure 3 shown, the convolutional neural network includes multiple convolutional layers, pooling layers, and fully connected layers, and calculates the error through a cross-entropy loss function.

[0063] In an embodiment disclosed by the present invention, as Figure 4 shown, the following sub-steps can be used to implement step S300: Step S301: Input all the feature vectors in the training data set into the convolutional neural network for training, and automatically update the weight parameters of each layer of the network by using the backpropagation algorithm in a supervised learning manner.

[0064] Input all the feature vectors in the training data set into the constructed convolutional neural network for training. First, perform a normalization process on the extracted feature vectors to make them meet the size requirements of the network input and maintain the consistency of the data distribution, so as to avoid unstable model training caused by inconsistent feature scales. Then, input the processed feature vectors into the input layer of the convolutional neural network. This neural network consists of multiple convolutional layers, pooling layers, and fully connected layers, where the convolutional layers are used to extract local spatial features, the pooling layers are used to reduce the feature dimension and enhance the translational invariance of the model, and the fully connected layers are used to synthesize features for final classification prediction.

[0065] The feature vectors pass through operations such as convolution, activation (such as ReLU), and pooling in sequence in the network, and finally output to the fully connected layer, and the probabilities belonging to each fault type are output through the Softmax function. During the training process, a supervised learning method is used, and the labeled training samples are used as inputs, and the cross-entropy loss function is used to measure the error between the model prediction result and the true label. Through the backpropagation algorithm, the error gradient of each layer is automatically calculated, and combined with optimization algorithms such as gradient descent or Adam, the weight parameters and bias terms of each layer in the network are iteratively updated, so as to gradually optimize the model performance.

[0066] Step S302: Perform multiple iterative trainings on the classifier, optimize the classifier performance and update the classifier parameters after each training until the classification accuracy meets the preset conditions, and then complete the training to obtain a fault prediction model.

[0067] Perform multiple rounds of iterative training on the above classifier model to continuously improve its classification accuracy. At the beginning of each round of training, input the training data into the network batch by batch for forward propagation and backward propagation, and update the parameters. During the training process, use the validation set to evaluate the model performance at the end of each round, and calculate metrics such as classification accuracy, precision, recall, and F1 score to monitor the training effect. If the accuracy of the model on the validation set continues to improve after multiple rounds of training, continue the training; if the accuracy tends to be stable or reaches the preset accuracy threshold (e.g., 95%), terminate the training process and save the current network parameters.

[0068] To prevent overfitting, regularization means such as the Dropout layer can be introduced, and combined with the early stopping strategy, stop the training after several consecutive rounds without obvious improvement in the validation set accuracy. In addition, the learning rate can be dynamically adjusted according to the loss change during the training process, or a learning rate decay mechanism can be introduced to improve the training stability. Finally, when the classification accuracy reaches the preset requirements, the model training is completed, and a prediction model for automatic identification and classification of ship electrical equipment faults is obtained.

[0069] Step S400: After enhancing the target vibration signal using the Teager energy operator, input it into the fault prediction model to generate a fault diagnosis result.

[0070] To verify the amplification effect of the method of the present invention on the vibration signals collected from ship electrical equipment, collect the vibration signals of the motor, the most important electrical equipment on the ship, for amplification experiments. The waveform of the original vibration signal is as Figure 5 shown, and the waveform of the vibration signal amplified by the method in the embodiment of the present invention is as Figure 6 shown. It can be seen that the method of the embodiment of the present invention can accurately amplify the vibration signal. At the same time, there is no loss in the amplified vibration signal, which can effectively avoid the problem of difficult extraction of weak vibration signal features and create good conditions for subsequent feature extraction.

[0071] After feature extraction, input the features into the convolutional neural network for training and testing, and the statistical results of the fault diagnosis accuracy are as Figure 7 shown. Input the vibration characteristics of ship electrical equipment into the convolutional neural network. After about 50 iterations, the diagnosis accuracy of faults reaches 90%. Further network training after that further increases the diagnosis accuracy, and the diagnosis accuracy approaches 100% after 200 trainings.

[0072] After determining that the network can perform fault diagnosis, an electrical equipment diagnosis test of the ship is carried out, and fault classification and diagnosis tests are carried out on the electrical equipment in the ship. The results of the ship electrical fault detection are shown in the following table:

[0073] It can be seen that the method of the present invention can accurately diagnose whether there are faults in various electrical equipment in the ship, and classify what kind of faults exist in the electrical equipment, providing detailed information for the maintenance personnel in the ship, and enabling the maintenance personnel to perform maintenance and repair of electrical equipment more quickly.

[0074] It can be seen from the experiment that the method disclosed in the embodiment of the present invention has a tight connection in the signal acquisition, processing, classification and diagnosis process of the electrical equipment of the ship, the processing result is accurate, the best result is achieved in each step and good conditions are provided for the next step, laying a solid foundation for finally classifying and diagnosing the faults of the electrical equipment in the ship. The final inspection results show that using a convolutional neural network to detect the electrical equipment of the ship can quickly and accurately obtain the equipment status, and if there is a problem, it can also be concluded what kind of problem caused it.

[0075] The embodiment of the present invention also discloses a ship electrical fault diagnosis system based on a machine learning algorithm, and this system is applied to a ship electrical fault diagnosis method based on a machine learning algorithm disclosed in the foregoing embodiment.

[0076] It can be understood that the above embodiments are merely exemplary embodiments adopted to illustrate the principle of the present invention, and the present invention is not limited thereto. For those of ordinary skill in the art, various modifications and improvements can be made without departing from the spirit and essence of the present invention, and these modifications and improvements are also regarded as the protection scope of the present invention.

Claims

1. A ship electrical fault diagnosis method based on machine learning algorithms, characterized in that Including: Collecting vibration signals of various electrical devices on a ship and enhancing them using the Teager energy operator, where the vibration signals include vibration signals during normal operation of the electrical devices and vibration signals during various faults; Performing wavelet packet feature extraction on the enhanced vibration signals to obtain feature vectors of all vibration signals; Training a convolutional neural network based on the feature vectors to obtain a fault prediction model; After enhancing the target vibration signal using the Teager energy operator, inputting it into the fault prediction model to generate a fault diagnosis result.

2. The method according to claim 1, wherein The step of collecting vibration signals of various electrical devices on a ship and enhancing them using the Teager energy operator includes: For each electrical device, collecting multiple vibration signals during normal operation and multiple vibration signals during various faults; For any vibration signal, the Teager energy operator is used to express the vibration signal as : wherein, , and are respectively the frequency, amplitude and phase of the vibration signal; t is the time variable of the vibration signal.

3. The method according to claim 1 or 2, characterized in that, Before performing the step of performing wavelet packet feature extraction on the enhanced vibration signals to obtain feature vectors of all vibration signals, the method further includes: Performing normalization processing on all enhanced vibration signals.

4. The method according to claim 1, wherein The step of performing wavelet packet feature extraction on the enhanced vibration signals to obtain feature vectors of all vibration signals includes: For each vibration signal, obtaining a feature vector in the following manner: Using a set of conjugate low-pass filters and high-pass filters decompose the enhanced vibration signal into L layers, where the L-th layer contains frequency bands; Pre-screening m characteristic frequency bands in the L-th layer; Retain the wavelet packet coefficients corresponding to the characteristic frequency band, and set the wavelet packet coefficients corresponding to other frequency bands to zero to form a new wavelet packet coefficient sequence at the L-th layer ; Based on the said sequence perform wavelet packet reconstruction to obtain a complete feature signal; Calculating the average energy of each frequency band in each layer of the characteristic signal and performing normalization processing to obtain the feature vector of the characteristic signal.

5. The method according to claim 4, characterized in that Retaining the wavelet packet coefficients corresponding to the characteristic frequency band and setting the wavelet packet coefficients corresponding to other frequency bands to zero to form a new wavelet packet coefficient sequence at the L-th layer , including: Construct a new wavelet packet coefficient sequence according to the following formula : Among them, is the set of serial numbers of m selected characteristic frequency bands; n is the serial number of the frequency band; is the wavelet packet coefficient sequence of the frequency band n in the L-th layer, which is obtained by the following formula: where 2d = n; is the wavelet packet coefficient sequence of the middle frequency band d in the (L - 1)-th layer, k is the serial number of the sampling point in the sequence; i is the serial number of the sampling point in the wavelet packet coefficient sequence of the L-th layer.

6. The method according to claim 5, characterized in that Based on the said sequence perform wavelet packet reconstruction to obtain a complete feature signal, including: Perform wavelet packet reconstruction on using the following formula: Among them, is the serial number of the decomposition layer, is the serial number of the sampling point of the current layer wavelet packet coefficient sequence, is the serial number of the sampling point of the wavelet packet coefficient sequence of the layer.

7. The method according to claim 1, wherein The method further includes: Constructing a data set based on the feature vectors and dividing the data set into a training data set and a validation data set.

8. The method according to claim 7, wherein The convolutional neural network includes multiple convolutional layers, pooling layers, and fully connected layers, and calculates errors through a cross-entropy loss function.

9. The method according to claim 8, wherein The step of training a convolutional neural network based on the feature vectors to obtain a fault prediction model includes: Inputting all feature vectors in the training data set into the convolutional neural network for training, and automatically updating the weight parameters of each layer of the network using the backpropagation algorithm in a supervised learning manner; Performing multiple iterative trainings on the classifier, and optimizing the performance of the classifier and updating the classifier parameters after each training until the classification accuracy meets the preset conditions, and then completing the training to obtain a fault prediction model.

10. A ship electrical fault diagnosis system based on machine learning algorithms, characterized in that, Applied to a ship electrical fault diagnosis method based on a machine learning algorithm according to any one of claims 1 to 9.