Fault detection method based on improved DFAW-MOPSO, program, equipment and storage medium
By improving the network structure and optimization algorithm in ship fault diagnosis, a fault detection method based on improving DFAW-MOPSO was proposed, which solved the problems of low accuracy and high resource consumption in traditional methods, and achieved the fault diagnosis effect of high accuracy and low resource consumption.
Patent Information
- Application Number
- CN202510042771.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-10
- Publication Date
- 2025-05-02
AI Technical Summary
Traditional ship fault diagnosis methods have problems such as low accuracy, poor working conditions adaptability, and large resource consumption, making it difficult to accurately identify multiple fault types in complex ship operating environments.
By improving the network structure and optimization algorithm, a fault detection method based on improved DFAW-MOPSO is proposed, including introducing a global average pooling layer in the fully connected layer and introducing quantum behavior, Gaussian perturbation and congestion distance calculations in the MOPSO algorithm to optimize network parameters and structures.
It significantly improves the accuracy of fault diagnosis, enhances the model's adaptability to complex working conditions, reduces resource consumption, and can be reliable in a low signal-to-noise ratio environment. It is suitable for real-time ship monitoring systems.
Smart Images

Figure CN119917929A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to a ship fault detection method, and specifically relates to a ship hull fault diagnosis method, program, equipment and storage medium based on an improved network structure and an optimized algorithm. Background Art
[0002] In the process of vigorous development of modern shipbuilding industry, ships are constantly moving towards large-scale, high-speed and automated directions. This evolution trend has put forward more stringent requirements on the performance and reliability of various ship components. As the core supporting components of the ship's mechanical system, ship bearings are like the "joints" of the ship. Their normal operation plays a vital role in ensuring the safe navigation, efficient operation and long life of the equipment of the entire ship. Whether it is the main engine, auxiliary engine or thruster and other key equipment, their stable operation is inseparable from the support of excellent bearings.
[0003] Once a ship bearing fails, its impact is by no means limited to the bearing itself. Since the various mechanical systems of a ship are closely connected and interdependent, a bearing failure may trigger a series of chain reactions. For example, a main engine bearing failure may cause the main engine to operate abnormally, thereby affecting the power output of the ship and causing the ship to lose its normal navigation ability; a propeller bearing failure may lead to reduced propulsion efficiency or even cause the ship to lose control, leading to serious navigation safety accidents. In addition, a bearing failure may also cause damage to other related equipment, increase maintenance costs and downtime, and bring huge economic losses to ship operations.
[0004] Traditional fault diagnosis methods, such as sensory diagnosis, instrument detection, and model-based methods, all have limitations and rely on expert experience and equipment quality. With the development of deep learning technology in the era of big data, its application in the field of fault diagnosis is becoming more and more extensive. Many researchers have proposed a variety of fault diagnosis methods based on deep learning, such as Szegedy et al.'s research on convolutional neural networks, Li J's multi-scale local feature learning method based on BP neural networks, and Zhang Y's fault diagnosis method based on recurrent neural networks. However, these methods have their own problems. BP neural network training may converge slowly and easily fall into local optimal solutions. Recurrent neural networks may have gradient vanishing or explosion problems.
[0005] When deep learning models are used for fault diagnosis, the accuracy and generalization ability of the model depend on reasonable parameter configuration. Improper parameters may lead to overfitting or underfitting. Early hyperparameter optimization algorithms, such as grid search algorithms, random search algorithms, and optimization methods based on gradient information, have low search efficiency when the number of hyperparameters is large. Although the Bayesian optimization algorithm has been improved, the population-based algorithm has received more attention in the field of multi-objective optimization fault detection. Among them, the particle swarm optimization (PSO) algorithm is widely used, but modern complex systems often require multi-objective optimization. In multi-objective optimization, although MOPSO can balance the relationship between multiple objectives, there are problems such as the particle swarm's local aggregation leading to premature convergence. Summary of the invention
[0006] The purpose of the present invention is to create a better solution for ship fault diagnosis. In the complex operating environment of ships, faults may cause serious consequences and high costs. Traditional methods and general models have problems such as low accuracy, poor adaptability to working conditions, and high resource consumption. The present invention significantly improves the accuracy of fault diagnosis by improving the network structure and optimization algorithm, and can accurately identify a variety of fault types. At the same time, the adaptability of the model to complex working conditions is enhanced, and it can still reliably diagnose in different signal-to-noise ratio environments, especially low signal-to-noise ratios. The network parameters and structure are optimized from a macro level, and new elements are introduced to reduce the number of parameters, reduce the risk of overfitting, and improve computing efficiency. Combined with the optimization algorithm, it reduces resource consumption while ensuring accuracy, which is conducive to the deployment of real-time monitoring systems on ships. This invention fills the gap in the combined application of related technologies in the field of ship fault diagnosis, provides new ideas for the development of the industry, and is of great significance to ensuring the safe navigation of ships and reducing costs.
[0007] The present invention provides a fault detection method based on improved DFAW-MOPSO, comprising the following steps:
[0008] Step 1: Obtain the vibration signal of the equipment and the corresponding fault type to build a training set;
[0009] Step 2: Build an improved DFAW network and introduce a global average pooling layer into the fully connected layer of the original DFAW network;
[0010] For a given sample and channel, all pixels in the height and width directions of the feature map are traversed, the feature values of all traversed pixels are added, and the sum is divided by the total number of pixels in the feature map as the output result of the global average pooling layer for the given sample on the given channel;
[0011] Step 3: Optimize the key parameters of the improved DFAW network using the improved MOPSO algorithm; the improved MOPSO algorithm introduces update terms related to quantum probability and Gaussian perturbations in the particle motion update of the original MOPSO, and uses the crowding distance to calculate the global optimal position; and returns the corresponding accuracy and number of parameters, and continuously optimizes in the improved MOGQPSO algorithm until the best result is found;
[0012] Step 4: Assign the optimized parameters to the improved DFAW network, and use the training set to train the improved DFAW network;
[0013] Step 5: Input the vibration signal of the equipment to be detected into the trained improved DFAW network to obtain the fault detection result.
[0014] Furthermore, in step 2, the improved DFAW network also includes a fused wavelet convolution module, the collected vibration signal is input into the fused wavelet convolution module, the fused wavelet convolution module converts the wavelet transform into a convolution form, and extracts multi-scale features of the vibration signal by combining it with scientific parameters; the wavelet coefficients W at different scales are calculated using the improved single-parameter wavelet convolution. p :
[0015] W p =x*ψ p
[0016] Where p is ψ p Learnable scale parameter; W p is the wavelet coefficient calculated at scale p, and x is the vibration signal collected by the sensor;
[0017] By transforming the original wavelet basis ψ m Linear weighted fusion can generate a new wavelet basis ψ' k :
[0018]
[0019] p k,m =softmax(-t||ψ k -ψ|| 2 )
[0020] Among them, ψ k is the selected wavelet basis, ψ is the other wavelet basis, t is the temperature parameter, softmax makes each element in the vector in the interval (0,1), and the sum of all elements is 1, m is the index variable in the operation, N 0 is the number of initial wavelet bases;
[0021] The wavelet basis W after fusion of wavelet convolution k:
[0022] W k =x*ψ' k
[0023] Furthermore, in step 2, the output result S of the global average pooling layer for a given sample on a given channel is n,c :
[0024]
[0025] Among them, Ph and Pw are the height and width of the feature map; n and c are the given sample and the given channel respectively; i and k are the index variables in the summation operation respectively.
[0026] Furthermore, in step 3, the update term related to quantum probability introduced in the particle motion update of the original MOPSO is:
[0027]
[0028] Among them, x i is the current position of the particle; is the new position of the particle; γ is the contraction-expansion coefficient; M is the average of the optimal positions of all individual particles; u and k are random numbers uniformly distributed in the interval (0,1); p is the local attractor; p i,dbest is the optimal position of the individual; p g,dbest is the global optimal position; c 1 and c 2 is a learning factor, which is used to adjust the influence of individual optimal position and global optimal position on local attractor; Y is the number of particles; Maxgen is the maximum number of iterations; gen is the current number of iterations; w 1 and w 2 It is a parameter that controls the particle position update process in the algorithm.
[0029] Furthermore, after adding the disturbance vector of Gaussian disturbance, the position of particle i
[0030]
[0031] in, is the position of particle i before adding Gaussian perturbation; is randomly generated according to the Gaussian distribution probability density function, the probability density function is
[0032] The introduction of Gaussian perturbation introduces randomness into the particle update process, so that the particle has the opportunity to jump out of the local optimal area during the search process. The particle i position update formula in the improved MOPSO algorithm is as follows:
[0033]
[0034] G = abs(N(0,1))
[0035] g = abs(N(0,1))
[0036] Among them, x i is the current position of the particle; is the new position of the particle, that is, after adding the disturbance vector; G and g are two parameters used to adjust p i,dbest and p g,dbest Perform weighting or adjustment; abs() is the absolute value function.
[0037] Furthermore, the crowding distance is calculated as follows: for each particle i, the distance d between it and its adjacent particles in the target space is calculated: i,i+1 :
[0038]
[0039] Then calculate the crowding distance d of particle i i The sum of the distances between its adjacent particles d i :
[0040]
[0041] Among them, d i,l is the distance between particle i and particle j.
[0042] The present invention also provides a computer device / equipment / system, comprising a memory, a processor and a computer program stored in the memory, wherein when the processor executes the computer program, the steps of any one of the above-mentioned fault detection methods based on the improved DFAW-MOPSO are implemented.
[0043] The present invention also provides a computer-readable storage medium having a computer program / instruction stored thereon, which, when executed by a processor, implements the steps of any of the above-mentioned fault detection methods based on the improved DFAW-MOPSO.
[0044] The present invention also provides a computer program product, comprising a computer program / instruction, which, when executed by a processor, implements the steps of any of the above-mentioned fault detection methods based on the improved DFAW-MOPSO.
[0045] The beneficial effects of the present invention are:
[0046] (1) The present invention greatly reduces the number of network parameters by introducing global average pooling in the fully connected layer, effectively avoids gradient vanishing and overfitting, and reduces the dependence on a large amount of training data and computing resources.
[0047] (2) The improved MOGQPSO algorithm overcomes the local optimality, particle swarm diversity decay and premature convergence problems of the traditional MOPSO algorithm in multi-objective optimization, can more effectively search for the global optimal solution, and improves the accuracy of fault diagnosis.
[0048] (3) The global average pooling is combined with the MOGQPSO algorithm and applied to fault detection. In practical applications, compared with the existing intelligent diagnosis methods, this method has obvious advantages in accuracy and number of parameters, providing more reliable technical support for the health monitoring of equipment such as hulls. At the same time, it performs well in noise resistance and feature extraction capabilities, and can still maintain a high accuracy under low signal-to-noise ratio. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 Optimization flow chart for the improved MOPSO algorithm. DETAILED DESCRIPTION
[0050] The present invention is further described below in conjunction with the accompanying drawings.
[0051] The present invention discloses a fault detection method based on improved DFAW-MOPSO, comprising the following steps:
[0052] (1) Create a data set, such as installing vibration sensors at key locations such as main engine bearings and auxiliary engine bearings to collect signals. After classification, segmentation into fixed-length segments and labeling, they are divided into training sets and validation sets according to a certain ratio to provide a data basis for model training.
[0053] (2) To address the problem of the fully connected layer of the original DFAW network, a global average pooling layer is added and the fully connected layer structure is simplified to effectively reduce the number of parameters and reduce the risk of overfitting.
[0054] (3) Improve the traditional MOPSO algorithm, such as Figure 1 As shown, quantum behavior, Gaussian perturbation and crowding distance are introduced to form the MOGQPSO algorithm to overcome the problems of local optimality, particle diversity decay and premature convergence.
[0055] (4) The MOGQPSO algorithm is used to optimize the key parameters of the network, thereby improving the accuracy of fault diagnosis and reducing the number of network parameters.
[0056] (5) The optimized parameters were substituted into the network for training and tested under different signal-to-noise ratio environments to simulate the noise interference in the actual operation of the ship. The model was compared with the traditional network to verify the performance advantages of the model in ship bearing fault detection from multiple aspects.
[0057] The present invention is further described in detail below with reference to specific embodiments.
[0058] The present invention relates to a fault detection method based on improved DFAW-MOPSO, which specifically comprises the following steps:
[0059] (1) Dataset preparation:
[0060] In this embodiment, the data collected is the sensor vibration signal of the equipment. The sensor is fixed on various bearings of the ship through a magnetic base, and the vibration signal is collected using a signal collector. The vibration signal obtained by each sampling is stored in a csv file named in chronological order according to the sampling time. These data are divided into segments of fixed length and labeled according to their corresponding states. The data set is divided according to the ratio of 80% training set and 20% validation set. A random seed is set during the division, and a stratified sampling method is used to ensure that each category of data is reasonably distributed in the training set and validation set.
[0061] (2) DFAW network structure adjustment:
[0062] DFAW network (Denoising Fault-Aware Wavelet Network) is a neural network based on signal processing knowledge for fault diagnosis. It effectively combines the advantages of traditional signal processing (SP) methods and deep learning (DL) methods, and has interpretability, noise reduction, fault feature extraction and end-to-end parameter learning capabilities. Its main components and functions are as follows:
[0063] (a) Fused Wavelet Convolution (FWConv) module
[0064] The input bearing vibration signal first enters the fused wavelet convolution (FWConv) module of the DFAW network. This module converts the wavelet transform into a convolution form and realizes the multi-scale feature extraction of the signal by combining it with the learnable parameters. Specifically, the improved single-parameter wavelet convolution is used to calculate the wavelet coefficients at different scales. The calculation formula is:
[0065] W p =x*ψ p (1)
[0066] Where p is ψ p A learnable scale parameter; Wp is the wavelet coefficient calculated at scale p, and x represents the input signal.
[0067] By transforming the original wavelet basis ψ m Linear weighted fusion can generate a new wavelet basis ψ′ k :
[0068]
[0069] Among them, the weight p k,mAccording to the difference between the wavelet bases (calculated by KL-divergence importance index), it is determined to satisfy formula (3), thereby adaptively selecting important wavelet bases and improving feature extraction capabilities.
[0070] p k,m =Softmax(-t||ψ k -ψ|| 2 ) (3)
[0071] Among them, ψ k is the selected wavelet basis, ψ is the other wavelet basis, t is the temperature parameter, softmax makes each element in the vector in the interval (0,1), and the sum of all elements is 1, m is the index variable in the operation, N 0 is the number of initial wavelet bases; Softmax makes each element in the vector in the interval (0,1), and the sum of all elements is 1, and t is the temperature parameter;
[0072] The final wavelet basis fusion formula is:
[0073] W k =x*ψ′ k (4)
[0074] (b) Dynamic Hard Threshold (DHT) module
[0075] The wavelet coefficients processed by FWConv enter the dynamic hard threshold (DHT) module. This module is similar to the traditional threshold function. Determines whether the wavelet coefficients are retained (features) or removed (noise). The feature discriminator is calculated as:
[0076]
[0077] Among them, H is the operation of removal or retention, is the output of the feature discriminator. In order to calculate The feature discriminator takes into account the intra-layer and inter-layer dependencies of wavelet coefficients. For intra-layer dependencies, local information of adjacent coefficients is extracted by simple convolution, and the calculation method is:
[0078] [ι 0 ,]=conv(W) (6)
[0079] For inter-layer dependencies, the global average is used to represent the features of each scale, which is calculated through the fully connected layer. The calculation method is:
[0080]
[0081] Among them, ι 0 , γ0 is the output that determines the retention coefficient, ι 1 , γ 1 is the decision output of removing the coefficients, and conv is a simple convolution. Then the final decision is obtained through the Softmax function:
[0082] φ i =Softmax(ι i +γ i ) (8)
[0083] In the training phase, in order to convert the decision of the feature discriminator into an optimizable hard threshold operation H, the DHT module uses the Gumbel-Softmax reparameterization technique. The specific calculation process is:
[0084] h i =Softmax((log(φ i )+g i ) / ε) (9)
[0085] Among them, g i are samples independently drawn from the Gumbel (0,1) distribution, ε is a parameter that controls the smoothness of the distribution, and the final calculation method of H is:
[0086]
[0087] Among them, h 0 is the calculated value related to the wavelet coefficients. The final DHT is implemented as:
[0088]
[0089] Among them, W is the original signal and H is the mask.
[0090] (c) Index-based soft filtering (ISF) module
[0091] The signal output by the DHT module enters the index-based soft filtering (ISF) module. The ISF module is mainly responsible for optimizing and selecting the optimal filter in the DFAW network, aiming to solve the filter optimization and index design problems in the traditional index filtering method, so as to extract fault features more effectively.
[0092] First, the filter optimization loss is designed. Based on the unique properties of spectral kurtosis (SK), SK can effectively measure the degree of correlation between wavelet coefficients and faults at the entire scale. Based on this, the filter optimization loss is designed and calculated as follows:
[0093]
[0094] in, is the envelope of the wavelet coefficients, L represents the length of the signal, C is the number of channels, and P(e) is a coefficient that changes dynamically according to the current training round e, and its value gradually changes from 1 to 0. In the early stage of training, P(e) is close to 1, and the filter is quickly optimized mainly using prior knowledge; as the training progresses, P(e) gradually decreases, and in the later stage, the filter design is fine-tuned in combination with the task-related diagnostic loss, so that the filter can better adapt to the specific fault diagnosis task.
[0095] Secondly, soft filter selection is performed. The hard filter selection method in the traditional index filtering method has certain limitations in the DFAW network. The ISF module proposes a soft filter selection strategy, which aims to retain all features and implicitly select the optimal filter. Specifically, the local relative index is calculated based on the channel energy, and its calculation formula is:
[0096]
[0097] Among them, E represents channel energy, and the sigmoid function maps the output value to the (0,1) interval. This soft selection method allows each channel to participate in the subsequent calculation process, and the higher the value corresponding to the channel, the more fault features it contains. The final output features of the ISF module are:
[0098]
[0099] It is the wavelet coefficient after the previous fused wavelet convolution (FWConv) and dynamic hard threshold (DHT) processing. The additional identity mapping helps to stabilize the training of the previous FWConv and DHT parts, ensuring the stability and effectiveness of the entire network during the training process.
[0100] (d) Designing a global average pooling layer
[0101] When the fully connected layer processes data, since each neuron is connected to all neurons in the previous layer, the number of parameters grows exponentially. Too many parameters not only increase the computational complexity and make the training process time-consuming and laborious, but also easily lead to overfitting. Overfitting causes the network to over-learn the details and noise in the training data, while ignoring the overall characteristics and potential laws of the data, resulting in a significant decrease in the generalization ability of the network when facing new data (test set), and it is unable to accurately diagnose unknown fault conditions. The parameter calculation method is:
[0102] P conv =C in ×k×k×C out +B chid (15)
[0103] P fc =Nin ×N out +B fchid (16)
[0104] Where P conv is the number of convolutional layer parameters, P fc is the number of parameters of the fully connected layer, C in is the number of input channels, C out is the number of output channels, k×k is the convolution kernel size, B chid is the convolution layer bias, N in is the number of input neurons, N out is the number of output neurons, B fchid is the bias of the fully connected layer.
[0105] To solve the above problem, the global average pooling layer is introduced. For a given sample n and channel c, all pixels in the feature map in the direction of height Ph and width Pw are traversed, the feature values of all traversed pixels are added, and then the sum is divided by the total number of pixels in the feature map to obtain the output result of the global average pooling layer for the sample in channel c. The calculation method is:
[0106]
[0107] Through such a calculation process, the global average pooling layer can effectively integrate the spatial information of the feature map on each channel, reduce the data dimension, and retain certain global feature information, providing a more suitable data form for subsequent network processing, which helps to improve the performance and generalization ability of the network, especially in processing tasks such as ship fault diagnosis that require extracting key features from complex data.
[0108] (3) Improved MOPSO algorithm:
[0109] 1. Introducing quantum behavior
[0110] Quantum behavior was introduced in the improvement process. Some concepts in quantum mechanics, such as quantum superposition and quantum tunneling, were applied to the particle motion update mechanism. Specifically, the particle position update is no longer based solely on the deterministic speed and position relationship, but introduces an update term related to quantum probability. The update formula is:
[0111]
[0112] Where γ is the contraction-expansion coefficient, which is used to control the convergence speed; M is the average of the optimal positions of all individual particles; u and k are random numbers uniformly distributed in the interval (0,1); p is the local attractor; p i,dbest is the optimal position of the individual; p g,dbestis the global optimal position; Maxgen is the maximum number of iterations; gen is the current number of iterations, w 1 and w 2 is the parameter of the particle position update process in the control algorithm; c 1 and c 2 is a learning factor used to adjust the influence of individual optimal position and global optimal position on local attractor; Y is the number of particles.
[0113] This update term makes the movement of particles in the search space have a certain degree of randomness and uncertainty, similar to the behavior of quantum particles in the microscopic world. In this way, particles can jump out of the trap of local optimal solutions with a greater probability and explore possible optimal solutions in a wider search space, thereby enhancing the performance of the algorithm in multi-objective optimization.
[0114] 2. Introducing Gaussian perturbation
[0115] Gaussian perturbation is one of the important improvements of the MOGQPSO algorithm. When the particle updates its position, in addition to considering the calculation related to quantum behavior, Gaussian perturbation is also added. Specifically, let the position of particle i before adding Gaussian perturbation be The perturbation vector is randomly sampled from the Gaussian distribution N (n is the dimension of the problem, that is, the number of parameters that need to be optimized), and then the disturbance vector is added to the particle position to obtain the position after adding the Gaussian disturbance:
[0116]
[0117] in, The value of is randomly generated according to the probability density function of the Gaussian distribution, and the probability density function is:
[0118]
[0119] Gaussian perturbation introduces randomness to the particle update process, so that particles have the opportunity to jump out of the local optimal area during the search process and continue to explore in a wider search space, thereby increasing the possibility of finding the global optimal solution. The particle update formula in the MOGQPSO algorithm is as follows:
[0120]
[0121] G=g=abs(N(0,1)) (26)
[0122] This method calculates the parameter c in the formula for the local attractor p 1 and c 2 Make changes. 1 Replace with G, c 2Replace with g. The new local attractor calculation formula is formula (25). In this way, the calculation of the local attractor is affected by the Gaussian distribution random variable, which increases the randomness and diversity of particles in the search process and helps the algorithm find better solutions in a complex search space.
[0123] 3. Use crowding distance to calculate the global best position
[0124] MOGQPSO uses crowding distance to determine the global best position. The crowding distance d i The calculation method is: for each particle i, calculate its distance to the adjacent particles in the target space. Assume that the target space has m objective functions For particles i and i+1, the distance between them is.
[0125]
[0126] Then, the crowding distance d of particle i is calculated i is the sum of the distances to its adjacent particles (considering a certain neighborhood range, such as taking the adjacent particles before and after), that is:
[0127]
[0128] In this way, when selecting the global optimal particle, it is no longer based solely on the objective function value of the particle. Instead, the crowding distance of the particle is comprehensively considered. Particles with better objective function values and relatively sparse distribution of surrounding particles (i.e., larger crowding distance) are preferentially selected as the global optimal particles. This helps the algorithm to search more comprehensively in the entire search space and increase the possibility of finding the global optimal solution.
[0129] (4) Use the MOGQPSO algorithm to optimize key network parameters:
[0130] 1. Determine the optimization parameters and their ranges. Set a reasonable range of values for each of the seven parameters in the DFAW network based on experience or experiments, thereby defining the parameter space. The seven parameters are set as follows: a. Wavelet kernel size: This parameter determines the window size of the wavelet filter when processing data, which directly affects the ability to extract signal features; based on in-depth research and a large number of experimental verifications on the trade-off between the above feature extraction and computational cost, the value range is set to 2 to 251; b. Number of output channels in the first layer: After weighing and considering many aspects such as model complexity, expression ability, and overfitting risk, the value range is determined to be 64 to 256; c. Maximum pooling layer kernel size and step size: These two parameters affect feature map reduction. 1. Dimension and feature extraction: Based on the dual considerations of computational efficiency and feature retention, the maximum pooling layer kernel size and step size are set to a range of 1 to 3; 2. Convolution kernel size and step size: These two parameters directly affect the convolution layer's extraction of input data features and the computational complexity of the model. Taking many factors into consideration, the convolution kernel size is set to a range of 1 to 7; 3. Adaptive maximum pooling layer output size: This parameter is directly related to the spatial dimension of the output feature map of this layer, and has an important impact on the input feature distribution and computational burden of subsequent network layers. After in-depth analysis of task characteristics and network structure, its value range is set to 10 to 80.
[0131] 2. Randomly generate particle swarms in the parameter space, and determine algorithm parameters such as particle swarm size, maximum number of iterations, and scaling factor.
[0132] 3. For each particle, G and g are obtained by taking the absolute value of the random variable of the standard normal distribution, and the intermediate position variable p and the average position M that comprehensively consider the individual historical optimal position and the global optimal position of the particle are calculated.
[0133] 4. For each particle, generate a random number k uniformly distributed between [0,1], and then calculate the position of the particle before adding the Gaussian disturbance according to the particle update formula. Then, randomly sample the disturbance vector from the Gaussian distribution, and then add the disturbance vector to the position of the particle before adding the Gaussian disturbance to obtain the final updated position after adding the Gaussian disturbance.
[0134] 5. For each particle, calculate the objective function value of its updated position and compare the objective function value of the particle with the objective function value of the individual historical best position. If the objective function value of the particle is larger, update the objective function value of the individual historical best position.
[0135] 6. Calculate the crowding distance of all particles in the particle swarm according to the crowding distance calculation method. Select the particle with better objective function value and larger crowding distance as the new global optimal position.
[0136] 7. Check whether the maximum number of iterations has been reached, or whether the change in the objective function value after several consecutive iterations (e.g., consecutive iterations) is less than a certain set threshold (indicating that the algorithm has converged to a certain degree). If the termination condition is met, the iteration is stopped, and the global optimal position and its corresponding objective function value (or fitness value) are output. The parameter combination represented by the global optimal position is the optimized result; if the termination condition is not met, the step of calculating the relevant parameters of the intermediate position variables is returned to continue the next iteration.
[0137] (5) Substitute the optimized parameters into the network, train and evaluate:
[0138] The optimized parameters are assigned to the corresponding network structure components. According to the network structure and the optimized parameters, the network weights, biases and other parameters are initialized. Then the training set data is input into the network, and the prediction output is calculated according to the network's forward propagation algorithm. Then, according to different configuration conditions, the wavelet spectrum constraint loss function and the sparsity constraint loss function are used to calculate and constrain the overall model training loss.
[0139] After the network training is completed, the test set is used to conduct a comprehensive evaluation of the network. The test set data is input into the trained network to obtain the network's predicted output to calculate various evaluation indicators. The main evaluation indicators are accuracy and the number of learnable parameters.
[0140] 1. Accuracy: The ratio of the number of samples with correct predictions to the total number of test samples reflects the overall prediction accuracy of the network. In ship fault detection, high accuracy means that the network can accurately identify various fault conditions of ship equipment, reduce false positives and false negatives, and ensure the safe operation of the ship.
[0141] 2. Number of learnable parameters: Count the number of all trainable parameters in the network, including weights and biases. This indicator reflects the complexity of the network and can be used to compare with the network before optimization to analyze the impact of the optimization process on network complexity. In the ship fault detection system, reasonable control of network complexity helps to improve the operating efficiency and stability of the system, avoid overfitting, and enable the network to better adapt to the complex and changeable operating environment and diverse fault modes of the ship.
[0142] (6) The vibration signal of the equipment to be detected is input into the trained improved DFAW network to obtain the fault detection result.
[0143] In particular, in some preferred embodiments of the present invention, a computer device is also provided, including a memory and a processor and a computer program stored in the memory, and when the processor executes the computer program, the steps of the fault detection method based on the improved DFAW-MOPSO in any of the above embodiments are implemented.
[0144] In some other preferred embodiments of the present invention, a computer-readable storage medium is provided, on which a computer program / instruction is stored. When the computer program is executed by a processor, the steps of the fault detection method based on the improved DFAW-MOPSO described in any of the above embodiments are implemented.
[0145] A person skilled in the art may understand that all or part of the processes in the above-mentioned embodiment method may be implemented by instructing related hardware through a computer program. The computer program may be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it may include the processes of the above-mentioned fault detection method embodiment based on the improved DFAW-MOPSO, which will not be repeated here.
[0146] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A fault detection method based on improved DFAW-MOPSO, characterized by: The following steps are involved: Step 1: Obtain the vibration signal of the equipment and the corresponding fault type to build a training set; Step 2: Build an improved DFAW network and introduce a global average pooling layer into the fully connected layer of the original DFAW network; For a given sample and channel, all pixels in the height and width directions of the feature map are traversed, the feature values of all traversed pixels are added, and the sum is divided by the total number of pixels in the feature map as the output result of the global average pooling layer for the given sample on the given channel; Step 3: Optimize the key parameters of the improved DFAW network using an improved MOPSO algorithm; the improved MOPSO algorithm introduces an update term related to quantum probability and a Gaussian perturbation into the particle motion update of the original MOPSO, and uses the crowding distance to calculate the global optimal position; Step 4: Assign the optimized particle parameters to the improved DFAW network, and use the training set to train the improved DFAW network; Step 5: Input the vibration signal of the equipment to be detected into the trained improved DFAW network to obtain the fault detection result.
2. The fault detection method based on improved DFAW-MOPSO according to claim 1 is characterized in that: In step 2, the improved DFAW network also includes a fused wavelet convolution module, and the collected vibration signal is input into the fused wavelet convolution module. The fused wavelet convolution module converts the wavelet transform into a convolution form, and extracts the multi-scale features of the vibration signal by combining it with scientific parameters; the wavelet coefficients W at different scales are calculated using the improved single-parameter wavelet convolution. p : W p =x*ψ p Where p is ψ p Learnable scale parameter; W p is the wavelet coefficient calculated at scale p, and x is the vibration signal collected by the sensor; By transforming the original wavelet basis ψ m Linear weighted fusion can generate a new wavelet basis ψ' k : p k,m =softmax(-t||ψ k -ψ||2) Among them, ψ k is the selected wavelet basis, ψ is the other wavelet basis, t is the temperature parameter, softmax makes each element in the vector in the interval (0,1), and the sum of all elements is 1, m is the index variable in the operation, and N0 is the number of initial wavelet bases; The wavelet basis W after fusion of wavelet convolution k : W k =x*ψ' k 3. The fault detection method based on improved DFAW-MOPSO according to claim 1 is characterized in that: In step 2, the output result S of the global average pooling layer for a given sample on a given channel is n,c : Among them, Ph and Pw are the height and width of the feature map; n and c are the given sample and the given channel respectively; i and k are the index variables in the summation operation respectively.
4. The fault detection method based on improved DFAW-MOPSO according to claim 1 is characterized in that: In step 3, the update term related to quantum probability is introduced in the particle motion update of the original MOPSO: Among them, x i is the current position of the particle; is the new position of the particle; γ is the contraction-expansion coefficient; M is the average of the optimal positions of all individual particles; u and k are random numbers uniformly distributed in the interval (0,1); p is the local attractor; p i,dbest is the optimal position of the individual; p g,dbest is the global optimal position; c1 and c2 are learning factors, which are used to adjust the influence of individual optimal position and global optimal position on local attractor; Y is the number of particles; Maxgen is the maximum number of iterations; gen is the current number of iterations; w1 and w2 are parameters of particle position update process in the control algorithm.
5. The fault detection method based on improved DFAW-MOPSO according to claim 1 is characterized in that: After adding the disturbance vector of Gaussian perturbation, the position of particle i in, is the position of particle i before adding Gaussian perturbation; is randomly generated according to the Gaussian distribution probability density function, the probability density function is The introduction of Gaussian perturbation introduces randomness into the particle update process, so that the particle has the opportunity to jump out of the local optimal area during the search process. The particle i position update formula in the improved MOPSO algorithm is as follows: G = abs(N(0,1)) g = abs(N(0,1)) Among them, x i is the current position of the particle; is the new position of the particle, that is, after adding the disturbance vector; G and g are two parameters used to adjust p i,dbest and p g,dbest Perform weighting or adjustment; abs() is the absolute value function.
6. The fault detection method based on improved DFAW-MOPSO according to claim 1, characterized in that: The crowding distance is calculated as follows: for each particle i, the distance d between it and its adjacent particles in the target space is calculated: i,i+1 : Then calculate the crowding distance d of particle i i The sum of the distances between its adjacent particles d i : Among them, d i,l is the distance between particle i and particle j.
7. A computer device / equipment / system comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 6.
8. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer program product comprising a computer program / instructions, characterized in that: When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.