An optimization method for predicting oxygen leakage risk of oxygen delivery port connector
By improving the Black-winged Kite optimization algorithm and the dual attention mechanism to optimize the LSTM model, the problem of time-consuming feature engineering and local optimal solutions in oxygen leakage risk prediction of oxygen port joints has been solved, and the prediction accuracy and adaptability have been improved.
Patent Information
- Application Number
- CN202410840576.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2044-06-27
AI Technical Summary
Existing models have problems in predicting oxygen leakage risk of oxygen supply hole joints, such as feature engineering is time-consuming and labor-intensive, time series data processing is ineffective, hyperparameter adjustment efficiency is low, and it is easy to fall into local optimal solutions.
The improved Black-winged Kite Optimization Algorithm (IBKA) combines the dual attention mechanism to optimize the hyperparameters and feature capture capabilities of the LSTM model, initialize the population through the reverse learning strategy, improve the search strategy by integrating the hunting success rate, and introduce single-peak and cross-peak attention modules. Enhanced feature representation.
It improves the prediction accuracy and interpretability, avoids local optimal solutions, and enhances the accuracy and adaptability of oxygen leakage risk prediction in complex environments.
Smart Images

Figure CN118378659B
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of optimization algorithms and machine learning, and in particular relates to an optimization method for predicting the risk of oxygen leakage of an oxygen delivery hole connector. Background Art
[0002] Existing models have shortcomings when optimizing the prediction of oxygen leakage risk of oxygen delivery port connectors. First, traditional machine learning methods usually rely on manual feature engineering and require expert knowledge to select and extract useful features, which is not only time-consuming and labor-intensive, but also has limited performance when faced with complex nonlinear relationships. Secondly, many existing models do not work well when processing time series data and cannot effectively capture the time dependency and long-term trends in the data. In addition, the performance of such models is highly dependent on the setting of their hyperparameters, and these parameters need to be adjusted through algorithms during the training process. Therefore, they have limited performance when faced with complex high-dimensional non-convex optimization problems and are prone to fall into local optimal solutions, resulting in the model being unable to achieve optimal performance. Therefore, ensuring that the model can cope with the above problems and improve the accuracy of prediction is a key issue to be solved by the present invention.
[0003] LSTM (Long Short Term Memory Network) is a special recursive neural network. Different hyperparameters in LSTM have a great influence on prediction accuracy. Generally, empirical methods or grid search methods are used to determine its parameters, which are inefficient and inaccurate. Although the LSTM model performs well in processing time series data, it still has some shortcomings in capturing complex data dependencies, resulting in the inability to achieve optimal prediction accuracy.
[0004] The standard Black Kite Optimization Algorithm (BKA) simulates the predation and migration behaviors of black kites, and divides these two behaviors into two different stages to balance the exploration and development of the algorithm. The predation stage represents the search stage of BKA, and the migration stage represents the development stage of BKA. The search stage of BKA includes two different predation behaviors, and the development stage is regulated by the leader bird in the black kite population. Compared with other optimization algorithms, the standard Black Kite Optimization Algorithm (BKA) has an advantage in the optimization convergence speed of local development strategies, but the optimization speed of the standard Black Kite Optimization Algorithm (BKA) in the search stage is poor, resulting in poor performance balance between the algorithm search stage and the development stage, and the development stage is prone to converge prematurely, causing the algorithm to fall into a local optimum. Summary of the invention
[0005] The purpose of the present invention is to improve the optimization accuracy and local optimization speed of the standard Black Kite optimization algorithm by improving the Black Kite optimization algorithm, referred to as IBKA, and propose a new dual attention mechanism, referred to as Dattention, and use the improved Black Kite optimization algorithm to optimize the number of hidden layer neurons n and the learning rate α parameter of the LSTM model, and enhance the LSTM model's ability to capture input data features through the dual attention mechanism, and propose an improved Black Kite optimization algorithm-dual attention mechanism-LSTM model to improve the prediction accuracy and interpretability of risk prediction.
[0006] The technical solution adopted by the present invention to achieve the above-mentioned purpose is: an oxygen leakage risk prediction optimization method for an oxygen delivery port connector, including an improved black kite optimization algorithm, a dual attention mechanism and an LSTM model, optimizing the LSTM model hyperparameters using the improved black kite optimization algorithm, and using a dual attention mechanism to enhance the LSTM's ability to capture input features, thereby improving the accuracy of oxygen leakage risk prediction for an oxygen delivery port connector, specifically comprising the following steps:
[0007] S1. Collect data related to oxygen leakage risk of oxygen delivery port connectors, including features and target variables, and perform preprocessing;
[0008] S2, use the Z-score method to standardize the data, and divide the standardized data into training set and test set;
[0009] S3, improve the black-winged kite optimization algorithm, the specific steps are:
[0010] S31, in the population initialization stage of the standard black-winged kite optimization algorithm, the reverse learning strategy is used to improve and update the position X of the black-winged kite population individuals i ;
[0011] S32, in the global search phase of the standard black kite optimization algorithm, by integrating the hunting success rate β, improving the predation strategy model of the black kite optimization algorithm;
[0012] S4. Propose a unimodal attention module. The specific steps are as follows:
[0013] S41. Represent the input of the unimodal attention module as a time series x k ;
[0014] S42, perform linear transformation on the input to obtain query Q, key K and value V;
[0015] S43. Calculate the attention score by calculating the dot product of the query, key, and value and normalizing them to obtain the attention score Attention(Q, K, V).
[0016] S44, after weighted summing the values using the attention scores in step S43, an output is generated as the input of the subsequent layer;
[0017] S5. Propose a cross-peak attention module. The specific steps are as follows:
[0018] S51. Calculate query Q for each peak fin , key K sent Sum value V sent , and calculate the dot product, normalize it, and get the cross-peak attention score Attention fin-sent (Q fin , K sent , V sent );
[0019] S52: Fuse the outputs of the two unimodal attention modules to obtain a fused representation F, which is input into the LSTM prediction model to obtain a preliminary prediction result.
[0020] S6. Using the improved black-winged kite optimization algorithm, the number of hidden layer neurons n and the learning rate α parameters of the LSTM prediction model are optimized to obtain an improved LSTM model.
[0021] S7. Input the real oxygen leakage risk related data of the oxygen delivery port connector into the trained model, and de-normalize the output result to obtain the final oxygen leakage risk prediction result of the oxygen delivery port connector.
[0022] Furthermore, in step S1, the oxygen leakage risk-related data of the oxygen delivery port connector include the oxygen concentration, pressure, flow rate and temperature of the oxygen delivery pipeline, as well as the ambient temperature, ambient humidity and air pollution index. The collected data are cleaned. Specifically, the mean method is used to fill in the missing data values, and the 3-σ principle is used to process the data outliers. The specific calculation formula is as follows:
[0023]
[0024] In the formula, is the imputed mean, n is the number of missing values, x i is a data point with non-missing values;
[0025] |X I -λ|>3σ;
[0026] Where, X I is an outlier, λ is the mean of feature X, and σ is the standard deviation of feature X.
[0027] Furthermore, in step S2, the data cleaned in step S1 is standardized by using the Z-score method, the data is converted into a standard normal distribution with a mean of 0 and a standard deviation of 1, and the training set and the test set are divided into a ratio of 8:2. The calculation formula of the Z-score method is as follows:
[0028]
[0029] In the formula, ψ is the mean of the data, ε is the standard deviation of the data, and x' is the individual data value.
[0030] Further, in step S3, in the population initialization stage of the standard black kite algorithm, a reverse learning strategy is adopted, the black kite population size is N, the search space is d-dimensional, and the individual position x of the black kite when the population is initialized is i =(BK i,1 , B.K. i,2 , …, BK i,d )(i=1,2,…,N), individual positions in the initialization phase of the improved black kite algorithm The formula is:
[0031]
[0032] In formula (1), and X i The lower and upper bounds of , and rand is a random number between (0, 1).
[0033] Furthermore, in step S3, S32 improves the search behavior of the black kite algorithm by integrating the hunting success rate β in the search stage of the standard black kite algorithm, ensuring that the algorithm can search the solution space extensively in the early stage to avoid falling into the local optimal solution, and can perform more detailed local search in the later stage to improve the final optimization effect. The hunting success rate formula is:
[0034]
[0035] In formula (2), f Mmax and f Mmin are the maximum and minimum values of the Mth objective function, respectively, M (i+1) and f M (i-1) are the values of the Mth objective function, T max is the maximum number of iterations, t is the number of iterations completed so far, μ and are related parameters;
[0036] By integrating the hunting success rate β, the improved black kite optimization algorithm predation strategy model is:
[0037]
[0038] In formula (3), and are the positions of the ith black kite in the dth dimension in the t and y+1 iterations, r is a random number between (0, 1), and p is a constant of 0.9.
[0039] Furthermore, in step S4, S41 represents the input of the unimodal attention module as a time series x k , its mathematical representation is as follows:
[0040] Where T is the time step and k is the number of time series with a single peak.
[0041] Furthermore, in step S4, S42 converts the feature x input in step S41 into k , converted into the corresponding query Q, key K and value V. The specific calculation formula is as follows:
[0042] Q=W q +I;
[0043] K=W k ×I;
[0044] V=W v ×I;
[0045] Where I is the input sequence x in the single peak k , W q , W k and W v The weight matrix for query, key and value conversion.
[0046] Furthermore, in step S4, S43 obtains an attention score by calculating the dot product of the query, key, and value obtained in step S42 and normalizing them. The calculation method is as follows:
[0047]
[0048] In formula (4), d k is the dimension of the key, Q, K and V are query, key and value, K T is the transpose of the key and Softmax is the activation function.
[0049] Furthermore, in step S4, S44 generates an output after weighted summation of the values using the attention scores in step S43. In subsequent model training, different input data are sent to this unimodal attention module for processing and used as input for subsequent layers.
[0050] Furthermore, in step S5, S51 takes the data processed by the unimodal attention module in step S4 as input and calculates the query Q fin , key K sent Sum value V sent , the specific calculation formula is as follows:
[0051]
[0052] In the formula, and are the data inputs processed by two different unimodal attention modules, T is the time step, and is the weight matrix;
[0053] The dot product of the cross-modal attention query, key, and value is calculated and normalized to obtain the attention score, which is calculated as follows:
[0054]
[0055] In formula (5), d k is the dimension of the bond, Q fin , K sent and V sent are the query, key and value of cross-peak attention, (K sent ) T is the key transposition of cross-peak attention and Softmax is the activation function.
[0056] Furthermore, in step S5, S52 fuses the outputs of the two different unimodal attention modules to obtain a fused representation F, and inputs it into the LSTM prediction model to obtain a prediction result The specific mathematical formula of the fusion representation F is as follows:
[0057]
[0058] In formula (6), h t is the hidden state of the current time step, s t is the memory state of the current time step, F t is the fusion representation of the current time step;
[0059] The preliminary prediction results The specific calculation formula is as follows:
[0060]
[0061] In formula (7), h t is the hidden state of the current time step, W o is the weight matrix, b o For bias.
[0062] Furthermore, in step S6, the LSTM prediction model structure diagram is constructed as shown in Figure 4 As shown, and input the training set, the LSTM network formula is as follows:
[0063] f t =σ(W f ·[h t-1 , x t ]+b f );
[0064] i t =σ(W i ·[h t-1 , x t ]+b i );
[0065] C t =tanh(W c ·[h t-1 , x t ]+b c );
[0066]
[0067] O t =σ(W o ·[h t-1 , x t ]+b o );
[0068]
[0069] In the formula, x t is the input at time step t, h t is the output at time step t, is the unit state at time step t, W and b are the weight matrix and bias vector, σ is the sigmoid activation function, tanh is the hyperbolic tangent activation function, and * is the element-by-element product.
[0070] Furthermore, in step S6, the number of hidden layer neurons n and the learning rate α parameters of the LSTM prediction model are optimized using the improved black kite optimization algorithm in step S3. The specific steps are as follows:
[0071] S61, encoding a set of hidden layer neuron numbers n and learning rate α parameters of the oxygen leakage risk LSTM prediction model of the oxygen delivery port connector into a space vector;
[0072] S62, using formula (1) to initialize the population individual positions of the black kite optimization algorithm, set the population size N, the problem dimension d, Upper bound and Lower bound and maximum number of iterations T max , each black-winged kite represents a set of hidden layer neuron numbers and learning rate parameter vectors;
[0073] S63, determine the position X of the black-winged kite with the minimum fitness value by formula (8) L ;
[0074] X L =X(find(min(f(X i )))) (8);
[0075] In formula (8), min(f(X i )) is the minimum fitness value of all black kites, find is the index of the individual with the minimum fitness value, and X is the position matrix of all black kites;
[0076] S64, simulating the predation strategy of the black-winged kite, and establishing a mathematical model of the predation strategy through formula (3). If p < r, the black-winged kite hovers in the air to observe the prey, and the algorithm performs a local search. If p ≥ r, the black-winged kite quickly dives to attack the prey, and the algorithm performs a global search. The optimal black-winged kite position is found through these two behaviors.
[0077] S65, simulating the migration strategy of black-winged kites, and defining the optimal black-winged kite position obtained in step S64 as As a leader, the mathematical model of migration strategy is established through formula (9) to lead and update the position of the black-winged kite population. i <F ri , the leader will give up leadership and join the migrating population, otherwise, it will continue to lead. The specific calculation formula is as follows:
[0078]
[0079] In formula (9), is the position of the ith black-winged kite in the dth dimension at the tth iteration, is the position of the optimal black kite in the dth dimension at the tth iteration, F i is the position of any black-winged kite in the dth dimension at the tth iteration, F ri is the fitness value of any black-winged kite at a random position in the dth dimension at the tth iteration, C is the Cauchy mutation function, and m is a parameter related to the random number;
[0080] S66: Determine the number of iterations t and the maximum number of iterations T completed so far max Relationship, if t<T max If true, execute S63, otherwise exit the loop and output the best black-winged kite position X LAnd decode the number of hidden layer neurons and learning rate assigned to the LSTM model.
[0081] In summary, due to the adoption of the technical solution, the beneficial effects of the present invention are as follows: the present invention proposes an improved black kite optimization algorithm, introduces a reverse learning strategy to initialize the algorithm population, and improves the population diversity and global search capability of the black kite optimization algorithm; proposes a hunting success rate β, and integrates the predation strategy of the black kite optimization algorithm to better balance the global search and local search, ensuring that the algorithm can widely search the solution space in the early stage to avoid falling into the local optimal solution, and can perform more detailed local search in the later stage to improve the final optimization effect; proposes a unimodal attention module and a cross-modal attention module, and uses multiple unimodal attention modules to pay higher attention to the important features of the input data, and further captures the time dependency, and then uses the cross-modal attention module to capture the correlation between the outputs of multiple unimodal attention modules, enhances the feature representation, and the constructed IBKA-Dattention-LSTM prediction model is enhanced in performance, and the prediction model is applied to the oxygen leakage risk prediction of the oxygen supply port connector, which improves the accuracy and adaptability of the oxygen leakage risk prediction of the oxygen supply port connector in a complex environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0082] Figure 1 This is a step diagram of an optimization method for predicting oxygen leakage risk of an oxygen delivery hole connector.
[0083] Figure 2 This is the structure diagram of the LSTM model.
[0084] Figure 3 The structural diagram of the unimodal attention module and the cross-modal attention module.
[0085] Figure 4 This is the structural diagram of the unimodal attention module.
[0086] Figure 5 Flowchart for optimizing the number of hidden layer nodes s and initial learning rate α parameters of the LSTM model using the improved Black Kite optimization algorithm.
[0087] Figure 6 Fitting diagram of the oxygen leakage risk prediction effect of the oxygen supply port connector implemented by the IBKA-Dattention-LSTM model. DETAILED DESCRIPTION
[0088] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments; based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0089] See also Figure 1-Figure 5 The present invention provides a technical solution: an optimization method for predicting oxygen leakage risk of an oxygen delivery port connector, which improves the local convergence speed and the ability to jump out of the local optimum of the BAK algorithm by improving the black kite optimization algorithm, thereby improving the performance of the LSTM prediction model, and at the same time proposes a dual attention mechanism to give higher attention to the important features of the data, enhance the feature representation, and finally obtain the IBAK-Dattenion-LSTM prediction model. The specific steps are as follows: Figure 1 shown.
[0090] S1. Collect data related to the risk of oxygen leakage at the oxygen delivery port connector, including the oxygen concentration, pressure, flow rate and temperature of the oxygen delivery pipeline, as well as the ambient temperature, ambient humidity and air pollution index. Clean the collected data. Specifically, use the mean method to fill in the missing data values, and use the 3-σ principle to handle data outliers. The specific calculation formula is as follows:
[0091]
[0092] In the formula, is the imputed mean, n is the number of missing values, x i is a data point with non-missing values;
[0093] |X I -λ|>3σ;
[0094] Where, X I is an outlier, λ is the mean of feature X, and σ is the standard deviation of feature X.
[0095] Furthermore, in step S2, the data cleaned in step S1 is standardized by using the Z-score method, the data is converted into a standard normal distribution with a mean of 0 and a standard deviation of 1, and the training set and the test set are divided into a ratio of 8:2. The calculation formula of the Z-score method is as follows:
[0096]
[0097] In the formula, ψ is the mean of the data, ε is the standard deviation of the data, and x' is the individual data value.
[0098] Further, in step S3, in the population initialization stage of the standard black kite algorithm, a reverse learning strategy is adopted, the black kite population size is N, the search space is d-dimensional, and the individual position x of the black kite when the population is initialized is i =(BK i,1 , B.K. i,2 , …, BK i,d)(i=1.2,…,N), individual positions in the initialization phase of the improved black kite algorithm The formula is:
[0099]
[0100] In formula (1), and X i The lower and upper bounds of , rand is a random number between (0, 1).
[0101] Furthermore, in step S3, S32 improves the search behavior of the black kite algorithm by integrating the hunting success rate β in the search stage of the standard black kite algorithm, ensuring that the algorithm can search the solution space extensively in the early stage to avoid falling into the local optimal solution, and can perform more detailed local search in the later stage to improve the final optimization effect. The hunting success rate formula is:
[0102] In formula (2), f Mmax and f Mmin are the maximum and minimum values of the Mth objective function, respectively, f M (i+1) and f M (i-1) are the values of the Mth objective function, T max is the maximum number of iterations, t is the number of iterations completed so far, μ and are related parameters;
[0103] By integrating the hunting success rate β, the improved black kite optimization algorithm predation strategy model is:
[0104]
[0105] In formula (3), and are the positions of the ith black kite in the dth dimension in the t and y+1 iterations, r is a random number between (0, 1), and p is a constant of 0.9.
[0106] Furthermore, in step S4, S41 represents the input of the unimodal attention module as a time series x k , the structure of the unimodal attention module is as follows Figure 2 As shown, its mathematical expression is as follows:
[0107] Where T is the time step and k is the number of time series with a single peak.
[0108] Furthermore, in step S4, S42 converts the feature x input in step S41 into k, converted into the corresponding query Q, key K and value V. The specific calculation formula is as follows:
[0109] Q=W q +I;
[0110] K=W k ×I;
[0111] V=W v ×I;
[0112] Where I is the input sequence x in the single peak k , W q , W k and W v The weight matrix for query, key and value conversion.
[0113] Furthermore, in step S4, S43 obtains an attention score by calculating the dot product of the query, key, and value obtained in step S42 and normalizing them. The calculation method is as follows:
[0114]
[0115] In formula (4), d k is the dimension of the key, Q, K and V are query, key and value, K T is the transpose of the key and Softmax is the activation function.
[0116] Furthermore, in step S4, S44 generates an output after weighted summation of the values using the attention scores in step S43. In subsequent model training, different input data are sent to this unimodal attention module for processing and used as input for subsequent layers.
[0117] Furthermore, in step S5, S51 takes the data processed by the unimodal attention module in step S4 as input and calculates the query Q fin , key K sent Sum value V sent , the specific calculation formula is as follows:
[0118]
[0119] In the formula, and are the data inputs processed by two different unimodal attention modules, T is the time step, and is the weight matrix;
[0120] The dot product of the cross-modal attention query, key, and value is calculated and normalized to obtain the attention score, which is calculated as follows:
[0121]
[0122] In formula (5), d k is the dimension of the bond, Q fin , K sent and V sent are the query, key and value of cross-peak attention, (K sent ) T is the key transposition of cross-peak attention and Softmax is the activation function.
[0123] Furthermore, in step S5, S52 fuses the outputs of the two different unimodal attention modules to obtain a fused representation F. The specific fusion process structure is as follows: Figure 3 As shown, the fusion representation is input into the LSTM prediction model to obtain the prediction result The mathematical formula for F is as follows:
[0124]
[0125] In formula (6), h t is the hidden state of the current time step, s t is the memory state of the current time step, F t is the fusion representation of the current time step;
[0126] The preliminary prediction results The specific calculation formula is as follows:
[0127]
[0128] In formula (7), h t is the hidden state of the current time step, W o is the weight matrix, b o For bias.
[0129] Furthermore, in step S6, an LSTM prediction model is constructed and a training set is input. The LSTM network formula is as follows:
[0130] f t =σ(W f ·[h t-1 , x t ]+b f );
[0131] i t =σ(W i ·[h t-1 , x t ]+b i );
[0132] C t =tanh(W c ·[ht-1 , x t ]+b c );
[0133]
[0134] O t =σ(W o ·[h t-1 , x t ]+b o );
[0135]
[0136] In the formula, x t is the input at time step t, h t is the output at time step t, is the unit state at time step t, W and b are the weight matrix and bias vector, σ is the sigmoid activation function, tanh is the hyperbolic tangent activation function, and * is the element-by-element product.
[0137] Furthermore, in step S6, Figure 5 As shown, the improved black-winged kite optimization algorithm in step S3 is used to optimize the number of hidden layer neurons n and the learning rate α parameter of the LSTM prediction model. The specific steps are as follows:
[0138] S61, encoding a set of hidden layer neuron numbers n and learning rate α parameters of the oxygen leakage risk LSTM prediction model of the oxygen delivery port connector into a space vector;
[0139] S62, using formula (1) to initialize the population individual positions of the black kite optimization algorithm, set the population size N, the problem dimension d, Upper bound and Lower bound and maximum number of iterations T max , each black-winged kite represents a set of hidden layer neuron numbers and learning rate parameter vectors;
[0140] S63, determine the position X of the black-winged kite with the minimum fitness value by formula (8) L ;
[0141] X L =X(find(min(f(X i )))) (8);
[0142] In formula (8), min(f(X i )) is the minimum fitness value of all black kites, find is the index of the individual with the minimum fitness value, and X is the position matrix of all black kites;
[0143] S64, simulating the predation strategy of the black-winged kite, and establishing a mathematical model of the predation strategy through formula (3). If p < r, the black-winged kite hovers in the air to observe the prey, and the algorithm performs a local search. If p ≥ r, the black-winged kite quickly dives to attack the prey, and the algorithm performs a global search. The optimal black-winged kite position is found through these two behaviors.
[0144] S65, simulating the migration strategy of black-winged kites, and defining the optimal black-winged kite position obtained in step S64 as As a leader, the mathematical model of migration strategy is established through formula (9) to lead and update the position of the black-winged kite population. i <F ri , the leader will give up leadership and join the migrating population, otherwise, it will continue to lead. The specific calculation formula is as follows:
[0145]
[0146] In formula (9), is the position of the ith black-winged kite in the dth dimension at the tth iteration, is the position of the optimal black kite in the dth dimension at the tth iteration, F i is the position of any black-winged kite in the dth dimension at the tth iteration, F ri is the fitness value of any black-winged kite at a random position in the dth dimension at the tth iteration, C is the Cauchy mutation function, and m is a parameter related to the random number;
[0147] S66: Determine the number of iterations t and the maximum number of iterations T completed so far max Relationship, if t<T max If true, execute S63, otherwise exit the loop and output the best black-winged kite position X L And decode the number of hidden layer neurons and learning rate assigned to the LSTM model.
[0148] S7. Input the real oxygen leakage risk related data of the oxygen delivery port connector into the trained model, and de-normalize the output result to obtain the final oxygen leakage risk prediction result of the oxygen delivery port connector.
[0149] Furthermore, the 2000 sets of pre-processed oxygen leakage risk-related data of the oxygen delivery port connectors were stored as CSV files, and the IBAK-Dattenion-LSTM prediction model was designed and written using Python, setting the maximum population size N q =40, maximum number of iterations T max =40, problem dimension D = 2, upper bound of black-winged kite position and the lower bound The parameters μ and The values of are 0.5 and 0.2; the mean square error is used as the fitness function, and the CSV file of oxygen leakage risk related data of the oxygen supply port connector is input into the model, and the output is as follows Figure 5 shown.
[0150] Furthermore, Figure 6 This is the fitting effect diagram of the IBAK-Dattenion-LSTM model prediction and the real data. The dotted line represents the curve of the real data, and the points are the predicted values of the data. It can be seen from the figure that the model's predicted value of the oxygen leakage risk of the oxygen supply port connector fluctuates little and basically fits the real data, so accurate prediction can be achieved.
Claims
1. A method for predicting and optimizing the risk of oxygen leakage in an oxygen delivery port connector, characterized in that: The following steps are involved: S1. Collect data related to the risk of oxygen leakage from the oxygen supply port connector. Include features and target variables, perform preprocessing; S2, use the Z-score method to standardize the data, and divide the standardized data into training set and test set; S3, improve the black-winged kite optimization algorithm, the specific steps are: S31, in the population initialization stage of the standard black-winged kite optimization algorithm, the reverse learning strategy is used to improve and update the position X of the black-winged kite population individuals i , Individual positions in the initialization phase of the improved black kite optimization algorithm The formula is: In formula (1), and X i The lower and upper bounds of , rand is a random number between (0, 1); S32. In the global search phase of the standard black-winged kite optimization algorithm, the predation strategy model of the black-winged kite optimization algorithm is improved by integrating the hunting success rate β. The mathematical model of the hunting success rate β is: In formula (2), f Mmax and f Mmin are the maximum and minimum values of the Mth objective function, respectively, M (i+1) and f M (i-1) are the values of the Mth objective function, T max is the maximum number of iterations, t is the number of iterations completed so far, μ and are related parameters; By integrating the hunting success rate β, the improved black kite optimization algorithm predation strategy model is: In formula (3), and are the positions of the ith black-winged kite in the dth dimension at iterations t and t+1, r is a random number between (0, 1), and p is a constant of 0.9; S4. Propose a unimodal attention module. The specific method is as follows: S41. Represent the input of the unimodal attention module as a time series x k ; S42, perform linear transformation on the input to obtain query Q, key K and value V; S43. Calculate the attention score by calculating the dot product of the query, key, and value and normalizing them to obtain the attention score Attenntion (Q, K, V). S44, after weighted summing the values using the attention scores in step S43, an output is generated as the input of the subsequent layer; S5. Propose a cross-peak attention module. The specific method is as follows: S51. Calculate query Q for each peak fin , key K sent Sum value V sent , and calculate the dot product, normalize it, and get the cross-peak attention score Attention fin-sent (Q fin , K sent , V sent ); S52: Fuse the outputs of the two unimodal attention modules to obtain a fused representation F, which is input into the LSTM prediction model to obtain a preliminary prediction result. S6. Using the improved black-winged kite optimization algorithm, the number of hidden layer neurons n and the learning rate α parameters of the LSTM prediction model are optimized to obtain an improved LSTM model. S7. Input the real oxygen leakage risk related data of the oxygen delivery port connector into the trained model, and de-normalize the output result to obtain the final oxygen leakage risk prediction result of the oxygen delivery port connector.
2. The method for predicting and optimizing the risk of oxygen leakage of an oxygen delivery port connector according to claim 1, characterized in that: In step S41, the input of the unimodal attention module is represented as a time series x k , its mathematical representation is as follows: Where T is the time step and k is the number of time series with a single peak.
3. The method for predicting and optimizing the risk of oxygen leakage of an oxygen delivery port connector according to claim 2, characterized in that: In step S42, the feature x input in step S41 is k , converted into the corresponding query Q, key K and value V. The specific calculation formula is as follows: Q=W q +I; K=W k ×I; V=W v ×I; Where I is the input sequence x in the single peak k , W q , W k and W v The weight matrix for query, key and value conversion.
4. The method for predicting and optimizing oxygen leakage risk of an oxygen delivery port connector according to claim 3, characterized in that: In step S43, the dot product of the query, key and value obtained in step S42 is calculated and normalized to obtain an attention score. The calculation method is as follows: In formula (4), d k is the dimension of the key, Q, K and V are query, key and value, K T is the transpose of the key and Softmax is the activation function.
5. The method for predicting and optimizing the risk of oxygen leakage of an oxygen delivery port connector according to claim 4, characterized in that: In step S44, the output is generated by weighted summing of the values using the attention scores in step S43. In subsequent model training, different input data are sent to this unimodal attention module for processing and used as input for subsequent layers.
6. The method for predicting and optimizing the risk of oxygen leakage of an oxygen delivery port connector according to claim 5, characterized in that: In step S51, the data processed by the unimodal attention module in step S4 is used as input, and the query Q is calculated. fin , key K sent Sum value V sent , the specific calculation formula is as follows: In the formula, and are the data inputs processed by two different unimodal attention modules, T is the time step, and is the weight matrix; Calculate the dot product of the query, key, and value of the cross-peak attention and normalize them to get the attention score. The calculation method is as follows: In formula (5), d k is the dimension of the bond, Q fin , K sent and V sent are the query, key and value of cross-peak attention, (K sent ) T is the key transposition of cross-peak attention and Softmax is the activation function.
7. The method for predicting and optimizing the risk of oxygen leakage of an oxygen delivery port connector according to claim 6, characterized in that: In step S52, the fusion representation F mathematical model is: In formula (6), h t is the hidden state of the current time step, s t is the memory state of the current time step, F t is the fusion representation of the current time step; The preliminary prediction results The specific calculation formula is as follows: In formula (7), h t is the hidden state of the current time step, W o is the weight matrix, b o For bias.
8. The method for predicting and optimizing oxygen leakage risk of an oxygen delivery port connector according to claim 7, characterized in that: In step S6, the improved black-winged kite optimization algorithm is used to optimize the number of hidden layer neurons n and the learning rate α parameter of the LSTM prediction model, and the specific steps are: S61, encoding a set of hidden layer neuron numbers n and learning rate α parameters of the oxygen leakage risk LSTM prediction model of the oxygen delivery port connector into a space vector; S62, using formula (1) to initialize the population individual positions of the black kite optimization algorithm, set the population size N, the problem dimension d, Upper bound and Lower bound and maximum number of iterations T max , each black-winged kite represents a set of hidden layer neuron numbers and learning rate parameter vectors; S63, determine the position X of the black-winged kite with the minimum fitness value by formula (8) L ; X L =X(find(min(f(X i )))) (8); In formula (8), min(f(X i )) is the minimum fitness value of all black kites, find is the index of the individual with the minimum fitness value, and X is the position matrix of all black kites; S64, simulating the predation strategy of the black-winged kite, and establishing a mathematical model of the predation strategy through formula (3). If p < r, the black-winged kite hovers in the air to observe the prey, and the algorithm performs a local search. If p ≥ r, the black-winged kite quickly dives to attack the prey, and the algorithm performs a global search. The optimal black-winged kite position is found through these two behaviors. S65, simulating the migration strategy of black-winged kites, and defining the optimal black-winged kite position obtained in step S64 as As a leader, the mathematical model of migration strategy is established through formula (9) to lead and update the position of the black-winged kite population. i <F ri , the leader will give up leadership and join the migrating population, otherwise, it will continue to lead. The specific calculation formula is as follows: In formula (9), is the position of the ith black-winged kite in the dth dimension at the tth iteration, is the position of the optimal black kite in the dth dimension at the tth iteration, F i is the position of any black-winged kite in the dth dimension at the tth iteration, F ri is the fitness value of any black-winged kite at a random position in the dth dimension at the tth iteration, C is the Cauchy mutation function, and m is a parameter related to the random number; S66: Determine the number of iterations t and the maximum number of iterations T completed so far max Relationship, if t<T max If true, execute S63, otherwise exit the loop and output the best black-winged kite position X L And decode the number of hidden layer neurons and learning rate assigned to the LSTM model.
Citation Information
Patent Citations
Computer-executed event extraction method and device by using neural network
CN110032641A
Optimized LSTM short-term load prediction method based on attention mechanism
CN117910823A
Short-term offshore wind power combined prediction method
CN118040678A
METHOD FOR MINING POWERFUL MINERAL DEPOSITES
DD230299A3
Reading comprehension neural networks
EP3101597A2
