Ship equipment fault prediction method and system based on LSTM and BP-RF
Patent Information
- Application Number
- CN202511730034.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-24
- Publication Date
- 2026-10-30
AI Technical Summary
基于模型驱动的方法通过建立能够反映装备性能退化规律的数学模型来预测其故障,其优点是对故障数据的需求量小、预测精度高,但这类方法的前提要求是对预测对象的故障机理研究较为透彻,并且对数学模型建立的完整性和准确性要求较高,否则预测精度低,难以适用于某些故障机理复杂的舰船装备;基于知识驱动的方法通过获取设计及维修领域专家的经验知识来对装备故障类型进行预测,其优点是不需要获取对象的精确数学模型,但这类方法由于其本质上使用定性推理技术,不太适合于定量计算,因而在计算精确性方面受所获知识质量的制约;基于数据驱动的方法通过从历史数据中不断学习装备的正常或故障状态,将原始监测数据转化为相关故障信息,近年来在舰船装备领域受到广泛关注,其优点是能够很好解决对模型和经验知识的依赖,适用范围广且预测精度高,常见的基于数据驱动的故障预测和诊断方法包括人工神经网络、随机森林、支持向量机、灰色模型等,然而这些方法难以兼顾时序数据的长期依赖捕捉和多参数与故障之间的非线性关联挖掘,因此研究重点集中于故障诊断,预测的有效性和可靠性有待提高,同时,单一算法易受数据规模和质量的影响,其稳定性和泛化能力不足
1、本发明基于LSTM网络模型有效地对舰船装备多个反映故障状态的参数进行特征分析,捕捉特征参数的时序规律,预测舰船装备特征参数的变化趋势,进而推测故障可能发生的时间节点,基于对未来时刻的特征参数预测结果,利用BP-RF诊断模型充分挖掘特征参数与故障模式之间的复杂映射关系,对故障类型进行预测。本发明的BP-RF诊断模型能够将BP神经网络的非线性关系处理能力和RF的集成学习能力相结合,提升了特征学习和抗干扰能力,其准确率和分数分别为96.67%和96.70%,同时交叉验证的标准差也较小,能够准确且稳定地诊断舰船装备的故障类型。
Smart Images

Figure CN123012382A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of ship failure prediction technology, and in particular to a ship equipment failure prediction method and system based on LSTM and BP-RF. Background Technology
[0002] As large and complex equipment systems characterized by multiple missions and systems, the safe and stable operation of naval vessels is directly related to combat effectiveness and mission success. However, long-term high-load operation at sea and the harsh marine environment exacerbate equipment aging and wear, leading to frequent failures and the accumulation of a large amount of fault data. Currently, fault type judgment still relies heavily on human experience, fault data utilization is low, and there is a lack of in-depth mining and analysis of the mapping relationship between characteristic parameters and faults. This results in insufficient accuracy in equipment fault prediction, making it difficult to meet the needs of naval equipment combat use and support decision-making. Fault prediction, as an extension of fault diagnosis, predicts impending faults by analyzing historical and real-time monitoring data. It can not only predict fault types but also transform periodic preventive maintenance and post-event diagnostic maintenance into predictive maintenance, effectively reducing the risk of major and serious accidents.
[0003] Currently, fault prediction methods can be categorized into model-driven, knowledge-driven, and data-driven approaches. Model-driven methods predict faults by establishing mathematical models that reflect the performance degradation patterns of equipment. Their advantages include low demand for fault data and high prediction accuracy. However, these methods require a thorough understanding of the fault mechanism of the object being predicted and a high degree of completeness and accuracy in establishing the mathematical model; otherwise, the prediction accuracy will be low, making them unsuitable for certain shipboard equipment with complex fault mechanisms. Knowledge-driven methods predict equipment fault types by acquiring the experiential knowledge of experts in the design and maintenance fields. Their advantage is that they do not require a precise mathematical model of the object. However, because these methods essentially use qualitative reasoning techniques, they are not well-suited for quantitative calculations, and therefore their computational accuracy is constrained by the quality of the acquired knowledge. Data-driven methods, which continuously learn the normal or faulty states of equipment from historical data and transform raw monitoring data into relevant fault information, have received widespread attention in the field of naval equipment in recent years. Their advantages include the ability to effectively address the dependence on models and empirical knowledge, wide applicability, and high prediction accuracy. Common data-driven fault prediction and diagnosis methods include artificial neural networks, random forests, support vector machines, and grey models. However, these methods struggle to simultaneously capture the long-term dependencies of time-series data and mine the nonlinear correlations between multiple parameters and faults. Therefore, research focuses on fault diagnosis, and the effectiveness and reliability of predictions need to be improved. Furthermore, single algorithms are susceptible to the influence of data scale and quality, and their stability and generalization ability are insufficient.
[0004] In view of this, based on the temporal characteristics of ship equipment characteristic parameters and their nonlinear correlation with failure modes, we study a ship equipment failure prediction method with more accurate and stable advantages. This is conducive to improving the safety and reliability of equipment operation and providing reliable support for ship equipment combat use and support decisions. Summary of the Invention
[0005] To address the shortcomings of the existing technologies, the present invention aims to provide a method and system for predicting ship equipment failures based on LSTM and BP-RF, which can effectively predict the timing and type of failures, providing reliable support for ship equipment operational use and support decisions.
[0006] The main technical approach of this invention is as follows: based on the temporal characteristics of ship equipment feature parameters and their nonlinear correlation with failure modes, the temporal patterns of feature parameters are extracted using an LSTM (long short-term memory network) model to achieve accurate prediction of complex time-series data. At the same time, the back propagation (BP) neural network and random forest (RF) algorithms are integrated to compensate for the shortcomings of single algorithm feature learning and anti-interference capabilities, thereby fully exploring the complex mapping relationship between feature parameters and failure modes and improving the accuracy and stability of failure mode prediction.
[0007] To achieve the above-mentioned technical objectives, the present invention adopts the following technical solution: The first aspect of the technical solution disclosed in this invention is: a ship equipment fault prediction method based on LSTM and BP-RF, comprising the following steps: The first sample dataset is constructed using the time series of real-time characteristic parameters of ship equipment collected, and the second sample dataset is constructed using historical data containing multiple failure modes and corresponding characteristic parameters. The first sample dataset is input into the LSTM network model, and the LSTM network model is used to predict the evolution trend of the feature parameters to obtain the predicted values of the feature parameters in the future. A BP-RF diagnostic model was constructed, and the BP-RF model was trained and tested based on the second sample dataset to obtain an optimized BP-RF diagnostic model. The predicted values of the feature parameters are input into the BP-RF diagnostic optimization model to analyze the mapping relationship between the feature parameters and the fault modes, and the predicted results of the fault types are output.
[0008] As a further preferred embodiment of the above technical solution, the steps for predicting the evolution trend of feature parameters using an LSTM network model include: The first sample dataset is pre-standardized using the MinMaxScaler() function. The preprocessed first sample dataset is divided into a first training set and a first test set. The first training set is input into the LSTM network model for training. During the training process, the LSTM network model continuously adjusts its parameters through the backpropagation algorithm to minimize the error between the output predicted value and the true value. The trained LSTM network model is validated using the first test set, and the predicted values of the feature parameters for a future period are output.
[0009] A further optimized approach is that the LSTM network model includes a forget gate, an input gate, and an output gate. The specific process of inputting the first training set into the LSTM network model for training is as follows: The forget gate receives the feature parameters input to the LSTM network model from the previous time step, and determines the lost or saved information in the memory unit based on the value of the calculation result of the forget gate at the current time step. The input gate updates the currently stored state information in the memory cell by combining the new candidate information. The output gate uses the input at the current time step and the hidden layer information from the previous time step to obtain the state calculation result at the current time step, and combines it with the currently stored state information to update the hidden layer information of the network at the current time step.
[0010] As a further preferred option, the steps to obtain the BP-RF diagnostic optimization model include: The StandardScaler() function is used to perform standardization preprocessing on the second sample dataset. The preprocessed second sample dataset is divided into a second training set and a second test set. The second training set and the second test set were respectively input into the BP-RF diagnostic model for training and testing, resulting in the BP-RF diagnostic optimization model.
[0011] A further optimized approach is as follows: the process of training the BP-RF diagnostic model with the second training set is as follows: The second training set is input into the BP-RF diagnostic model, and the BP neural network is used to construct the first diagnostic set by mapping the fault modes and feature parameters in a portion of the second training set. Diagnostic set two is constructed by using the RF algorithm to map the fault modes and feature parameters in another part of the second training set; A weighted soft voting method is used to assign higher nonlinear feature fitting weights to the BP neural network and higher robustness weights to the RF algorithm. The output probabilities of diagnostic set one and diagnostic set two are quantized and fused by combining the weights of the BP neural network and the weights of the RF algorithm. The diagnostic probability after quantization and fusion is calculated using the argmax activation function, and the maximum diagnostic probability is taken as the fault mode diagnosis result.
[0012] The second aspect of the technical solution disclosed in this invention is: a ship equipment fault prediction system based on LSTM and BP-RF, wherein the prediction system is used to implement the prediction method described above, and the prediction system includes: The data acquisition module is used to collect real-time characteristic parameter time series of ship equipment, as well as historical data containing multiple fault modes and corresponding characteristic parameters, and to form a first sample dataset and a second sample dataset respectively. The first-level prediction module is used to input the first sample dataset into the LSTM network model, predict the evolution trend of the feature parameters, and obtain the predicted values of the feature parameters over a future period of time. The model building module is used to build a BP-RF diagnostic model and train and test the BP-RF model using the second sample dataset to obtain an optimized BP-RF diagnostic model. The secondary prediction module uses the predicted values of the feature parameters as input values for the BP-RF diagnostic optimization model, analyzes the mapping relationship between the feature parameters and the fault modes, and predicts the fault type.
[0013] In addition, the present invention also discloses an electronic device, comprising: at least one processor; and a memory communicatively connected to said at least one processor; wherein: The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the steps of the ship equipment fault prediction method based on LSTM and BP-RF as described in any one of claims 1-5.
[0014] The present invention also discloses a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-described method for predicting ship equipment faults based on LSTM and BP-RF.
[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. This invention effectively performs feature analysis on multiple parameters reflecting the fault state of ship equipment based on an LSTM network model, captures the temporal patterns of these parameters, predicts their changing trends, and thus infers the possible time points of fault occurrence. Based on the prediction results of these future feature parameters, a BP-RF diagnostic model is used to fully explore the complex mapping relationship between feature parameters and fault modes, predicting the fault type. The BP-RF diagnostic model of this invention combines the nonlinear relationship processing capability of BP neural networks with the ensemble learning capability of RF, improving feature learning and anti-interference capabilities, and achieving high accuracy and... The scores were 96.67% and 96.70% respectively, and the standard deviation of the cross-validation was also small, which can accurately and stably diagnose the fault types of ship equipment.
[0016] 2. Compared with other existing diagnostic models, the BP-RF diagnostic model proposed in this invention has significant advantages in terms of accuracy and stability in fault mode diagnosis. Combined with time series prediction results, it further proves its superiority in predicting ship equipment fault types and can provide reliable support for the operational use and maintenance support decisions of ship equipment.
[0017] 3. The integrated framework of the LSTM network model and the BP-RF diagnostic model proposed in this invention, with its data-driven feature analysis and processing logic, can provide a reference for other ship equipment with time-series monitoring data and offer insights for fault prediction in other similar fields. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.
[0019] Figure 1 The flowchart shows the ship equipment fault prediction method based on LSTM and BP-RF of the present invention. Figure 2 This is a schematic diagram of the LSTM network model of the present invention. Figure 3 This is a schematic diagram of the BP neural network of the present invention; Figure 4 This is a schematic diagram of the random forest algorithm of the present invention; Figure 5 This is a schematic diagram of the diagnostic principle of the BP-RF diagnostic model of the present invention; Figure 6 This is a box plot showing the parameter distribution of transformer normal and grounding fault modes in an embodiment of the present invention; Figure 7 This is a graph showing the changes in training loss and validation loss of the LSTM network model in this embodiment of the invention. Figure 8 This is a comparison of the predicted values and the actual values of the test set during the LSTM network model validation process in this embodiment of the invention. Figure 9 The prediction results of the LSTM network model for the four feature parameters in this embodiment of the invention; Figure 10 The training process of the BP-RF diagnostic model in this embodiment of the invention is shown in (a) where the accuracy of the training set changes and (b) where the loss value of the training set changes. Figure 11 The experimental diagnostic results of the BP-RF diagnostic model in this embodiment of the invention are as follows: (a) The horizontal and vertical coordinates of the confusion matrix 0~5 represent the fault modes in transformer 6, and the diagonal of the matrix represents the number of samples accurately identified for each fault mode. (b) The F1 score of the BP-RF diagnostic model in diagnosing the 6 fault modes is shown. Figure 12 This is a comparison of the cross-validation results of the BP-RF diagnostic model of the present invention with other existing models. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.
[0021] Reference Figures 1-12 This invention proposes a shipboard equipment fault prediction method based on LSTM and BP-RF, comprising the following steps: The first sample dataset is constructed using the time series of real-time characteristic parameters of ship equipment collected, and the second sample dataset is constructed using historical data containing multiple failure modes and corresponding characteristic parameters. The first sample dataset is input into the LSTM network model, and the LSTM network model is used to predict the evolution trend of the feature parameters to obtain the predicted values of the feature parameters in the future. A BP-RF diagnostic model was constructed, and the BP-RF model was trained and tested based on the second sample dataset to obtain an optimized BP-RF diagnostic model. The predicted values of the feature parameters are input into the BP-RF diagnostic optimization model to analyze the mapping relationship between the feature parameters and the fault modes, and the predicted results of the fault types are output.
[0022] Specifically, compared to the traditional macro-classification of fault types, this invention focuses more on the specific manifestations of fault modes, which are directly related to sensor data characteristics and are more suitable for data-driven prediction. Although the fault modes of ship equipment may vary depending on the system type, the temporal variation patterns of the characteristic parameters (such as vibration, temperature, and pressure) reflecting the fault modes of ship equipment have commonalities. Based on this, this invention constructs a data-driven core framework for temporal variations and multiple fault modes. It uses an LSTM network to extract the temporal variation patterns of characteristic parameters to achieve accurate prediction of complex time-series data. At the same time, it integrates BP neural networks and random forest algorithms to make up for the shortcomings of single algorithm feature learning and anti-interference capabilities, fully explores the complex mapping relationship between characteristic parameters and fault modes, and improves the accuracy and stability of fault mode prediction.
[0023] In this invention, the fault data of ship equipment exhibits strong temporal characteristics. LSTM (Long Short-Term Memory), as the latest algorithm with the best processing effect for temporal data, can effectively capture both long and short-range temporal information and is suitable for the fault data characteristics of various types of equipment. LSTM is a Long Short-Term Memory network, a type of Temporal Recurrent Neural Network (RNN), which adds a "forgetting mechanism" to the RNN. Each time, the influence of historical data on the current state is determined by the weights, thus solving the problems of gradient vanishing and exploding when RNNs process long-term sequence data, improving the model's prediction accuracy. LSTM is a gated network composed of gate structures and activation functions, including forget gates, input gates, and output gates, to control the flow of information. The specific structural framework is as follows... Figure 2 As shown.
[0024] The forget gate's function is to retain or forget historical state information, allowing the LSTM network model to focus more on the current fault characteristics of the ship's equipment. Its output is: (1) The function of the input gate is to allow the network to dynamically adjust the contents of the memory cells based on changes in real-time feature parameters. (2) (3) (4) The output gate is used to control the state value of the output memory unit. In practical applications, the adjustment function of the output gate is to better capture the characteristics of parameter changes over time, and its output is: (5) (6) In the formula: , , , , , , , This is the weight matrix. , , These are the current state calculation results for the forget gate, input gate, and output gate, respectively. and These represent the network's input and output at the current moment, respectively. This represents the current cell state input. This represents the final state of the gating unit after its update at the current moment. , , , For bias terms, The hyperbolic tangent activation function is used. It is the Sigmoid activation function. This represents the dot product of vectors.
[0025] Based on this, when using the LSTM network model to predict the evolution trend of feature parameters, the specific process is as follows: The MinMaxScaler() function is used to standardize and preprocess the first sample dataset, dividing it into a first training set and a first test set. The first training set is then input into the LSTM network model for training. During training, the LSTM network model continuously adjusts its parameters through the backpropagation algorithm to minimize the error between the output predicted value and the true value. The first test set is used to validate the trained LSTM network model and output the predicted value of the feature parameters for a future period of time.
[0026] Specifically: When the feature parameters of the previous time step contain After the signal is input into the LSTM network model, the forget gate first receives the data, and then... The input gate determines which information is lost or saved from the memory cell. The input gate then combines this information with new candidate information to update the currently stored state information of the memory cell. The output gate is determined by the input at the current time. And the hidden layer information from the previous time step Get the output at the current time. and combined Update the hidden layer information of the network at the current moment. Through this mechanism, the LSTM network model can effectively capture long-term dependencies in time series data.
[0027] During actual training, the LSTM network model continuously adjusts its parameters through the backpropagation algorithm, making the output predicted values increasingly closer to the true values, thereby minimizing the error. After multiple iterations of training, the LSTM network model can learn the changing patterns of the ship's equipment feature parameters. In the prediction phase, the time series of feature parameters over a past period is input into the trained LSTM network model, and through forward propagation calculation, the predicted feature parameters for the future period can be obtained.
[0028] Based on the prediction of feature parameters for a future period, a BP-RF diagnostic model is constructed by integrating BP neural network and random forest algorithm to deeply explore the nonlinear mapping relationship between feature parameters and failure modes. This enables precise conversion from multidimensional monitoring data to failure mode probability distribution, providing a quantitative basis for predictive maintenance decisions for ship equipment.
[0029] Backpropagation (BP) neural networks are one of the artificial neural networks currently used in the field of fault diagnosis. They have advantages such as high adaptability and strong generalization ability, and can handle nonlinear problems that general algorithms cannot handle. This is essentially consistent with the nonlinearity of the ship equipment fault mode diagnosis problem in this invention.
[0030] A backpropagation (BP) neural network consists of three layers: an input layer, hidden layers, and an output layer. Each layer of neurons has weights. Its basic principle is to forward-propagate each input feature parameter sample to obtain the output result. Then, based on the difference between the actual output result and the expected output result, the error is calculated backward and progressively propagated back to each neuron. Finally, the connection weights between neurons are adjusted according to the magnitude of the error, making the diagnostic results more accurate. When processing nonlinear data, the number of hidden layers in a BP neural network is usually adjusted appropriately depending on the complexity of the problem and the accuracy requirements, generally choosing 1-3 layers. A typical BP neural network model structure with one hidden layer is shown below. Figure 3 As shown.
[0031] exist Figure 3 In the middle, the input is a collection of A vector of dimensional feature parameters The dimension of the feature parameters corresponds to the number of neurons in the input layer. Each input layer neuron and each hidden layer neuron has a connection weight. And the activation function used by this connection is The corresponding hidden layer contains The _ neurons, of which the _ ... Each neuron has a threshold. Similarly, there are connection weights between hidden layer neurons and output layer neurons. And the activation function of the output layer is The output layer contains 1 neuron, corresponding to There are several failure modes, among which the first one is the first. Each neuron has a threshold. And the expected output is The actual output is In this case, the dimension of the BP neural network is... .
[0032] The learning mechanism of a backpropagation (BP) neural network is supervised learning. This means that a target expectation value is given before training with data samples. Then, through backpropagation, the network's weights and thresholds are continuously adjusted so that the actual output value infinitely approaches the target expectation value, achieving the goal of training and optimizing the network's classification performance. The essence of its network training is to use gradient descent to adjust the corresponding weights and thresholds along the negative gradient of the error function, ultimately solving the problem of minimizing the error function. Figure 3 The network parameters and the learning and training process of the BP neural network are as follows: ① Forward transmission of signals: First, the hidden layer The input for each node is: (7) Will Substitute into the activation function of the hidden layer The hidden layer can be obtained. The output of each node is: (8) Will Substitute into the activation function of the output layer The output layer can be obtained. The output of each node is: (9) ② Backpropagation of error: First, starting from the output layer, the output error of each neuron in each layer is calculated backwards. Then, the error gradient descent method is used to adjust the thresholds and weights of each layer. For multi-class classification problems, commonly used loss functions in BP neural networks include cross-entropy loss and mean squared error loss. Given that the cross-entropy loss function has a significant advantage in avoiding the problem of the mean squared error loss function potentially leading to local optima, this invention chooses the cross-entropy loss function to calculate the error, thereby performing gradient updates. The cross-entropy loss function for the actual output and expected output of a single sample is: (10) The weight correction amount of the output layer can be obtained sequentially using the error gradient descent method. Threshold correction amount of output layer Hidden layer weight adjustment and the threshold correction amount of the hidden layer for: (11) (12) (13) (14) In the formula: and These are the first derivatives of the activation functions of the output layer and the hidden layer, respectively; This represents the network learning rate.
[0033] At the same time, targeting By training on samples, the global error of the network can be obtained as: (15) Before the training of the sample data is completed, run the above formulas (7)-(15) repeatedly until the maximum number of training times is reached or the error accuracy requirement is met.
[0034] The Random Forest (RF) algorithm, based on the idea of ensemble learning, combines multiple decision trees into a set, making it suitable for solving classification and regression problems. Based on the Bagging algorithm, the RF algorithm can effectively reduce the risk of overfitting, while also possessing advantages such as high classification accuracy, good robustness, and strong interpretability. It can complement the advantages of backpropagation (BP) neural networks to obtain more accurate and stable diagnostic results.
[0035] like Figure 4 As shown, the Random Forest algorithm is an ensemble algorithm that combines the Bagging algorithm and the CART (Classification and Regression Tree) decision tree algorithm. Bagging is an ensemble algorithm whose basic idea is to construct a training sample set using the Bootstrap resampling method, then train multiple different models using different sample sets based on a certain algorithm, and finally vote to determine the class. In the field of machine learning, Bagging is often used to solve classification problems. CART decision trees use each sample set as the entire training data for a single decision tree, assuming each sample set has... If there are 10 sample features, then at each node of the tree, it starts from... Randomly selected from the features Each feature serves as the basis for node splitting, and the feature with the best classification effect is selected according to the principle of minimizing node impurity. This feature is then used as the splitting attribute of the binary tree node to branch and grow the decision tree. Unlike a general decision tree, this process does not require pruning, but continues to select features and split nodes until all feature attributes have been used.
[0036] Based on this, the RF algorithm improves the accuracy and robustness of the model by constructing multiple decision trees and integrating their classification results, thereby achieving fault type identification. Specifically, firstly, the training set is resampled using Bootstrap to generate multiple different training subsets. Each training subset is used to train an independent CART decision tree, thus constructing an ensemble classifier composed of multiple decision trees. When a sample is input, each decision tree outputs a classification result. Finally, the final classification result of the ensemble classifier is determined through a majority voting mechanism.
[0037] Furthermore, the Random Forest algorithm incorporates two stochastic processes during its construction: 1) generating the training sample set using random sampling with replacement; and 2) randomly selecting features from the entire feature set as the feature set used when splitting tree nodes. These two stochastic processes increase model diversity, making the results of each decision tree in the Random Forest more random and accurate, thus improving generalization ability.
[0038] The learning and training process of the Random Forest algorithm for fault classification is as follows: ① First, obtain the original training sample set. ,in The number of samples in the sample set. This represents the number of attributes in the sample set, i.e., the dimension of the fault features; For the first indivual The training sample vector is represented as follows: ,and for The corresponding fault category label; ②From the sample set The Bootstrap resampling method is used to randomly sample with replacement. These samples form a new subset of training samples. A total of This subset of training samples is used to form a new training sample set. ; ③ The CART decision tree algorithm is used to train each subset of training samples and obtain the results. A number of different decision tree classifiers, namely ; ④ After training The decision tree classifiers are merged into a random forest classifier, which is... Input the test sample set to be classified, and finally obtain the classification result through majority voting. The calculation formula is as follows: (16) In the formula: For input variables, For the first The classification results of the decision trees, Indicates the expected fault category label; It is an indicator function; its value is 1 when the expression inside the parentheses is true, and 0 otherwise.
[0039] Because BP neural networks and Random Forest (RF) algorithms are independent in their algorithmic principles and error sources, their error patterns are not directly causally related. Specifically, as a nonlinear mapping model, the diagnostic bias of BP neural networks mainly stems from the possibility of getting trapped in local optima during gradient updates; while RF algorithms, as ensemble learning models, derive their errors more from the correlation between decision trees or feature selection bias caused by sample resampling. This independence makes their diagnostic errors complementary; for example, a misjudgment of strongly coupled nonlinear features by a BP neural network may be corrected by the ensemble mechanism of the Random Forest algorithm, and vice versa.
[0040] Combination Figure 5 As shown, this invention constructs a BP-RF diagnostic model using a separate training and later ensemble approach. First, the StandardScaler() function is used to standardize and preprocess the second sample dataset. Then, the preprocessed second sample dataset is divided into a second training set and a second test set. The second training set is input into the BP-RF diagnostic model. A BP neural network is used to construct diagnostic set one by mapping the fault modes and feature parameters in a portion of the second training set. The RF algorithm is used to construct diagnostic set two by mapping the fault modes and feature parameters in another portion of the second training set. This avoids the amplification effect of the inherent defects of either the BP neural network or the RF algorithm. Furthermore, this invention abandons the "black and white" decision-making of hard voting methods that rely solely on category label voting. Instead, a weighted soft voting method is used to assign higher nonlinear feature fitting weights to the BP neural network and higher robustness weights to the RF algorithm. The output probabilities of diagnostic set one and diagnostic set two are quantized and fused by combining the BP neural network weights and the RF algorithm weights to obtain the BP-RF diagnostic optimization model. Finally, the argmax activation function is used to calculate the quantized and fused diagnostic probabilities, and the maximum diagnostic probability is used as the fault mode diagnosis result to determine the most likely future fault time and fault type.
[0041] The BP-RF diagnostic optimization model of this invention can use BP neural network to capture the nonlinear mapping relationship between feature parameters and fault modes, and map the original features to a high-dimensional space to improve the representation ability of hidden fault modes. The RF algorithm, through the integration of parallel decision trees, handles the risk of overfitting and data noise, ensuring that the diagnostic results can fully reflect the nonlinear mapping relationship between feature parameters and fault modes and have strong stability.
[0042] The ship equipment failure prediction method proposed in this invention is based on LSTM and BP-RF. It is data-driven and does not rely on the physical model or failure mechanism of specific equipment. It can be trained and predicted using only the failure modes and corresponding characteristic parameter data of ship equipment in the past. It has the potential to be adapted to equipment of different types and complexities.
[0043] Example: Given that power system transformers are core equipment of ships, undertaking the key functions of power conversion and distribution, their operating status is directly related to the safety and stability of the ship's power system. However, in complex marine environments, they are prone to overload, overheating, and local short circuits due to factors such as aging and wear, threatening the overall operational safety of the ship. The failure modes of transformers are characterized by multi-parameter coupling and significant time-series evolution, and the monitoring data covers common monitoring indicators of ship equipment such as voltage, temperature, and vibration. This embodiment selects a certain type of ship power system transformer as a typical object to verify the effectiveness of the method of the present invention, providing theoretical basis and technical support for ship equipment failure prediction and health management.
[0044] 1. Data acquisition and analysis; 1.1 Data Sources and Composition: This embodiment uses real monitoring data from a certain type of ship's power system transformer during actual operation. Current transformers, voltage transformers, temperature sensors, and vibration sensors are used as data sensors to construct a multi-category transformer fault detection dataset. This dataset includes six different categories: normal, overload fault, overheating fault, partial short-circuit fault, low load fault, and grounding fault. The six fault modes are represented by 0 to 5, where 0 represents normal and 1 to 5 correspond to the five fault modes respectively. Based on the actual operating data collected by the sensors, current, voltage, temperature, and vibration velocity are selected as characteristic parameters that are significantly correlated with faults in this type of transformer. The six fault modes and their corresponding characteristic parameter ranges are shown in Table 1.
[0045] Table 1. Range of characteristic parameters corresponding to the 6 failure modes 1.2 Analysis of the relationship between failure modes and characteristic parameters: Statistical analysis of historical fault data of transformer equipment reveals that the fault modes and characteristic parameter changes follow certain patterns. Specifically, during normal operation, the energy conversion efficiency is high, mechanical movement is stable, and all parameters fluctuate within the design thresholds. Overload faults cause the equipment to exceed its rated operating range, with parameters exhibiting a "current-dominated" anomaly, and temperature and vibration increasing with the duration of the load. Overheating faults are primarily characterized by abnormal temperature, with unstable fluctuations in current and voltage, and increased mechanical vibration. Partial short-circuit faults exhibit a time sequence of "sudden current increase - sudden vibration increase - gradual temperature increase," with strong coupling between parameters. Under low load conditions, the equipment is in an "under-excited" state, with parameters exhibiting a "current-dominated decay," and vibration and temperature decreasing proportionally with the load reduction. Grounding faults are "asymmetrical faults," with the most common grounding method being direct neutral grounding. Current, voltage, and vibration velocity show an upward trend and an increased fluctuation range, and temperature also rises. For example, the box plots of various characteristic parameters of this type of transformer under normal and grounding fault conditions are shown below. Figure 6 As shown, Figure 6 The figures in the middle, from left to right and from top to bottom, represent a comparison of the distribution of current, voltage, temperature, and vibration velocity.
[0046] Depend on Figure 6 It can be seen that when a transformer experiences a ground fault, the median and quartile of current, voltage, temperature, and vibration velocity are all higher than in the normal state. In addition, the length of the tank for current, voltage, and vibration velocity is also significantly greater than in the normal state, which is consistent with the characteristics of the parameter changes. This directly verifies the variation law of each characteristic parameter under the ground fault mode and the normal state.
[0047] 2. Feature parameter prediction based on LSTM network model; To improve the accuracy and continuity of the evaluation results, real-time characteristic parameter time series data of 500 sets of continuous monitoring sampling points of the ship's transformer were collected at 1-minute intervals using real-time monitoring equipment. These data were then used as training and testing data for the LSTM network model in an 8:2 ratio to predict changes in transformer characteristic parameters.
[0048] 2.1 Determination of hyperparameters for the LSTM network model: After continuous pre-training, the optimal hyperparameter combination for the LSTM network model was determined: 80 hidden layer neurons, a dropout probability of 0.2, 32 samples for weight updates, a learning rate of 0.003, a time step of 3, and the Adam optimizer. Early stopping and learning rate decay were also used in the LSTM network model. These techniques prevent overfitting, improve generalization ability, and allow for dynamic adjustment of the learning rate, enabling finer parameter tuning, avoiding oscillations, and ultimately improving performance.
[0049] 2.2 Analysis of Predictive Experimental Results: The LSTM network model is implemented in a Python programming environment. First, the feature parameters are standardized using the MinMaxScaler() function, scaling them to the range of 0 to 1. Then, the training and test sets are input into the LSTM network model for training and testing, respectively. In this embodiment, the LSTM network model achieves good convergence after 50 iterations. The convergence process of the training and validation loss values is as follows: Figure 7 As shown, by Figure 7 It can be seen that after about 40 iterations of training, both the training loss and validation loss values are close to 0, indicating that the LSTM network model performs well on both the training and test sets and does not exhibit overfitting.
[0050] Meanwhile, during the verification process using 100 sets of test data, comparison results were obtained between the predicted and actual values of four feature parameters, such as... Figure 8 As shown, Figure 8 The data, arranged from left to right and top to bottom, represent the comparison between the actual and predicted values of current, voltage, temperature, and vibration velocity. Figure 8 It can be seen that the fluctuations of the true and predicted values of the four feature parameters are basically consistent, the curve fitting is good, and the prediction error is small, confirming that the LSTM network model can accurately predict the trend of feature parameters changing over time.
[0051] To more thoroughly analyze and evaluate the predictive performance of the LSTM network model on feature parameters and enhance the persuasiveness of the experimental results, the mean absolute error (MAE), root mean square error (RMSE), and coefficient of determination (R²) were defined. 2 Three evaluation indicators are used to verify the effectiveness of the LSTM network model. The specific calculation methods are shown in equations (17) to (19).
[0052] (17) (18) (19) In the formula: For the sample size, For the first Predicted values for each sample, For the first The true value of each sample for and covariance, They are respectively and The variance.
[0053] After 50 iterations of training, the performance evaluation metrics of the LSTM network model are shown in Table 2. Furthermore, taking the starting point of a 1-minute sampling period as a sampling moment, the changes in feature parameters over the next 50 moments were predicted starting from the last set of test samples. The results are as follows: Figure 9 As shown, Figure 9 The predicted results for current, voltage, temperature, and vibration velocity are presented sequentially from left to right and from top to bottom.
[0054] Table 2. Evaluation results of the prediction performance of the LSTM network model.
[0055] As shown in Table 2, the LSTM network model exhibits very high prediction accuracy for all four feature parameters. The average values of MAE and RMSE are 0.0390 and 0.0503, respectively, with both errors approaching zero. The average R... 2 The value is 0.9781, which is close to 1, further demonstrating that the LSTM network model can accurately fit the changing trends of the predicted and actual values and has high reliability. Figure 9 In this study, the introduction of moving average trend lines effectively smooths out short-term fluctuations in data and highlights the long-term trends of each parameter, thereby helping to accurately predict the operating status of equipment and the timing of potential failures. Moving average trend lines calculate the average value of each parameter over five consecutive time points, and use a simple mean line as a substitute when data points are insufficient. This allows the moving average trend lines to more accurately reflect predicted fluctuations and visually present the changes in each parameter. Specifically, current exhibits a pattern of initial sharp fluctuations followed by a sustained decrease; voltage initially fluctuates upwards before stabilizing; and temperature and vibration velocity initially fluctuate downwards before remaining stable. These moving average trend lines help identify deviations of parameters from standard values and accurately predict potential failure times.
[0056] 3. Fault mode diagnosis based on BP-RF diagnostic model; By statistically analyzing historical fault data, the fault mode data were divided into two sets. The average value of each characteristic parameter within the interval from the fault alarm to 1 minute before maintenance was taken as the parameter data for a sample. This yielded historical data on fault modes and corresponding characteristic parameters for 300 monitoring sampling points of this type of ship transformer. The sample data was randomly divided into training and test sets at an 8:2 ratio, serving as the training and test sets for the BP-RF diagnostic model to predict possible fault modes of this type of transformer in the future.
[0057] 3.1 Determination of hyperparameters of the BP-RF diagnostic model: For the BP neural network, the specific hyperparameter settings are as follows: 4 neurons in the input layer (corresponding to 4 feature parameters), 32 neurons in the hidden layer, ReLU activation function, 6 neurons in the output layer (corresponding to 6 fault modes), softmax activation function; the model training learning rate is set to 0.003, the number of training iterations is 50, and the optimizer is Adam.
[0058] For the Random Forest algorithm, the key hyperparameters involved are the number of decision trees and the maximum depth of each tree. Therefore, the grid search method is adopted, with accuracy as the objective function, and finally the optimal combination of hyperparameters for the RF algorithm is found, that is, the number of decision trees is 100 and the maximum depth of each tree is 10.
[0059] 3.2 Analysis of Diagnostic Test Results: After determining the hyperparameters of the BP neural network and FR algorithm, the feature parameter data is first standardized using the StandardScaler() function to convert it into data with a mean of 0 and a standard deviation of 1. Then, the training set is input into the BP-RF diagnostic model for training, as follows: Figure 10 As shown, by Figure 10 (a) Figure 10 The results in (b) show that after the BP-RF diagnostic model has been trained for about 40 times, the accuracy and loss value of the training set gradually stabilize. The accuracy eventually reaches about 96% and the loss value is close to 0. This indicates that because the BP-RF diagnostic model has undergone standardized preprocessing and uses the Adam optimizer, the parameters of the BP-RF diagnostic model have obtained the optimal value through iteration, that is, the optimized BP-RF diagnostic model has been obtained.
[0060] When the test set was input into the BP-RF diagnostic optimization model, the diagnostic results for fault modes were found to be very stable, such as... Figure 11 As shown, Figure 11 In the confusion matrix (a), the horizontal and vertical axes 0-5 represent the six fault modes of the transformer. The diagonal of the matrix represents the number of samples accurately identified for each fault mode. It can be seen that the number of test samples for the six fault modes are 10, 12, 7, 9, 14, and 8, respectively. Only one sample for fault mode 1 was misclassified. Specifically, two samples of fault mode 1 (overload fault) were incorrectly classified into category 5 (grounding fault). Therefore, the diagnostic accuracy of the BP-RF diagnostic optimization model is 96.67%.
[0061] While accuracy reflects the consistency between diagnostic results and actual outcomes, it cannot fully reflect the needs of decision-making in real-world scenarios. Therefore, precision, recall, and... The score allows for a more comprehensive analysis of the diagnostic results. In practice, precision and recall are conflicting; an increase in one often leads to a decrease in the other. Therefore, a harmonic mean of the two is introduced. The score serves as the final evaluation metric for the model, encompassing accuracy and... The higher the score, the more accurate and reliable the model. The specific calculation method is shown in equations (20) to (23).
[0062] (20) (twenty one) (twenty two) (twenty three) In the formula, These represent the number of true positive, false positive, true negative, and false negative samples, respectively. Accuracy is expressed as the ratio of the number of correctly diagnosed failure mode samples to the total number of samples. Precision rate represents the proportion of samples diagnosed as a certain failure mode that actually belong to that failure mode. Recall rate represents the proportion of samples that actually belong to a certain failure mode and are correctly diagnosed as that failure mode.
[0063] Figure 11 (b) shows the model's ability to diagnose six fault modes. Fractions, from Figure 11 As can be seen in (b), for the four fault modes (0, 2, 3, and 4), the model can not only diagnose correctly but also avoid misdiagnosis, achieving a 100% recognition rate; for the other two fault modes... The scores reached 90.91% and 88.89% respectively, verifying that the BP-RF diagnostic optimization model can achieve accurate diagnosis of ship equipment faults.
[0064] Furthermore, this embodiment employs a 5-fold cross-validation method to further verify the diagnostic stability and generalization ability of the BP-RF diagnostic model. Specifically, the 300 samples were randomly re-divided into 5 subsets, with each subset serving as the test set in turn, and the remaining subsets serving as the training set. After 50 iterations of training, the performance evaluation results of the BP-RF diagnostic model at different fold numbers are shown in Table 3.
[0065] Table 3 Performance evaluation index results for different fold numbers
[0066] Table 3 shows that the average accuracy of the BP-RF diagnostic model's 5-fold cross-validation and The scores were 96.00% and 95.92%, respectively, with corresponding standard deviations of 1.70% and 1.75%, indicating that the BP-RF diagnostic model not only demonstrated excellent diagnostic performance but also exhibited good stability and strong generalization ability, providing reliable diagnostic results in different datasets and contexts.
[0067] 3.3 Comparative analysis of the BP-RF diagnostic model with other existing models: To verify the superiority of the BP-RF diagnostic model, it was compared with other existing diagnostic models, including BP neural network models, RF models, SVM models, CNN models, and BP-SVM models. The hyperparameter settings of the individual BP neural network and RF models were consistent with the combined model presented in this paper. The hyperparameters of the other models were set according to the actual application scenario in this embodiment and using a grid search method to achieve optimal performance. The performance evaluation metrics and 5-fold cross-validation results of each model are shown in Tables 4 and 5, respectively. Figure 12 As shown.
[0068] Table 4 Performance evaluation metrics of the BP-RF diagnostic model compared to other diagnostic models
[0069] Table 4 shows that the accuracy of the CNN model and The scores were all lower than those of BP neural network, RF, and SVM, indicating that CNN models struggle to learn effective feature representations when processing small fault samples and low-dimensional feature data, making them prone to overfitting and resulting in inferior fault diagnosis performance compared to BP neural network, RF, and SVM. The fault mode diagnosis accuracy of the BP-RF diagnostic model was also lower than that of BP neural network, RF, and SVM. The highest score, among which The score was 96.70%, which was 6.33% and 5.27% higher than the single BP neural network model and RF model, respectively. This indicates that the BP-RF diagnostic model can combine the nonlinear relationship processing capability of the BP neural network model with the ensemble learning capability of the RF model, thereby improving the accuracy of ship equipment fault diagnosis. Meanwhile, the diagnostic accuracy of the BP-RF diagnostic model and... The scores were improved by 10.12%, 11.94%, and 4.75% compared to the other three models, respectively, further demonstrating that the BP-RF diagnostic model has a greater advantage in diagnostic accuracy than other fault diagnosis methods. Figure 12 It can be seen that the cross-validation accuracy, precision, and accuracy of the BP-RF diagnostic model are... The standard deviation of the scores is lower than that of the other five models, indicating that the BP-RF diagnostic model can effectively eliminate noise interference and has stronger stability and generalization ability.
[0070] In practical applications, crew members can combine the equipment characteristic parameter data collected by real-time monitoring equipment with the fault prediction method proposed in this invention to predict the time and type of the next equipment failure, so as to intervene in advance before the failure occurs, avoid the failure, achieve the purpose of predictive maintenance, and provide reliable support for the operational use and support decisions of ship equipment.
[0071] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for predicting shipboard equipment faults based on LSTM and BP-RF, characterized in that, Includes the following steps: The first sample dataset is constructed using the time series of real-time characteristic parameters of ship equipment collected, and the second sample dataset is constructed using historical data containing multiple failure modes and corresponding characteristic parameters. The first sample dataset is input into the LSTM network model, and the LSTM network model is used to predict the evolution trend of the feature parameters to obtain the predicted values of the feature parameters in the future. A BP-RF diagnostic model was constructed, and the BP-RF model was trained and tested based on the second sample dataset to obtain an optimized BP-RF diagnostic model. The predicted values of the feature parameters are input into the BP-RF diagnostic optimization model to analyze the mapping relationship between the feature parameters and the fault modes, and the predicted results of the fault types are output.
2. The ship equipment fault prediction method based on LSTM and BP-RF according to claim 1, characterized in that, The steps for predicting the evolution trend of feature parameters using an LSTM network model include: The first sample dataset is pre-standardized using the MinMaxScaler() function. The preprocessed first sample dataset is divided into a first training set and a first test set. The first training set is input into the LSTM network model for training. During the training process, the LSTM network model continuously adjusts its parameters through the backpropagation algorithm to minimize the error between the output predicted value and the true value. The trained LSTM network model is validated using the first test set, and the predicted values of feature parameters for a future period are output.
3. The ship equipment fault prediction method based on LSTM and BP-RF according to claim 2, characterized in that, The LSTM network model includes a forget gate, an input gate, and an output gate. The process of inputting the first training set into the LSTM network model for training is as follows: The forget gate receives the feature parameters input to the LSTM network model from the previous time step, and determines the lost or saved information in the memory unit based on the value of the calculation result of the forget gate at the current time step. The input gate updates the currently stored state information in the memory cell by combining the new candidate information. The output gate uses the input at the current time step and the hidden layer information from the previous time step to calculate the state at the current time step, and then combines the stored state information to update the hidden layer information of the network at the current time step.
4. The ship equipment fault prediction method based on LSTM and BP-RF according to claim 1, characterized in that, The steps to obtain the BP-RF diagnostic optimization model include: The StandardScaler() function is used to perform standardization preprocessing on the second sample dataset. The preprocessed second sample dataset is divided into a second training set and a second test set. The second training set and the second test set were respectively input into the BP-RF diagnostic model for training and testing, resulting in the BP-RF diagnostic optimization model.
5. The ship equipment fault prediction method based on LSTM and BP-RF according to claim 4, characterized in that, The process of training the BP-RF diagnostic model with the second training set is as follows: The second training set is input into the BP-RF diagnostic model, and the BP neural network is used to construct the first diagnostic set by mapping the fault modes and feature parameters in a portion of the second training set. Diagnostic set two is constructed by using the RF algorithm to map the fault modes and feature parameters in another part of the second training set; A weighted soft voting method is used to assign higher nonlinear feature fitting weights to the BP neural network and higher robustness weights to the RF algorithm. The output probabilities of diagnostic set one and diagnostic set two are quantized and fused by combining the weights of the BP neural network and the weights of the RF algorithm. The diagnostic probability after quantization and fusion is calculated using the argmax activation function, and the maximum diagnostic probability is taken as the fault mode diagnosis result.
6. A ship equipment fault prediction system based on LSTM and BP-RF, characterized in that, The prediction system is used to implement the prediction method according to any one of claims 1-5, and the prediction system includes: The data acquisition module is used to collect real-time characteristic parameter time series of ship equipment, as well as historical data containing multiple fault modes and corresponding characteristic parameters, and to form a first sample dataset and a second sample dataset respectively. The first-level prediction module is used to input the first sample dataset into the LSTM network model, predict the evolution trend of the feature parameters, and obtain the predicted values of the feature parameters over a future period of time. The model building module is used to build a BP-RF diagnostic model and train and test the BP-RF model using the second sample dataset to obtain an optimized BP-RF diagnostic model. The secondary prediction module uses the predicted values of the feature parameters as input values for the BP-RF diagnostic optimization model, analyzes the mapping relationship between the feature parameters and the fault modes, and predicts the fault type.
7. An electronic device, characterized in that, include: At least one processor; and a memory communicatively connected to the at least one processor; wherein: The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the steps of the ship equipment fault prediction method based on LSTM and BP-RF as described in any one of claims 1-5.
8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the ship equipment fault prediction method based on LSTM and BP-RF as described in any one of claims 1-5.
