A method for predicting the risk of liquid leakage at the filling port of a pharmaceutical filling machine

Through data monitoring and deep learning models, combined with attribute coefficient analysis method and module construction, the problem of liquid leakage risk prediction of pharmaceutical filling machines has been solved, more accurate leakage risk prediction and equipment management have been achieved, and the technology and management of the pharmaceutical industry have been improved. level.

CN118468226BActive Publication Date: 2024-09-06山东黄海智能装备有限公司
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410916920.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-10
Publication Date
2024-09-06
Estimated Expiration
2044-07-10

AI Technical Summary

Technical Problem

Pharmaceutical liquid leakage may occur during the filling process of the pharmaceutical filling machine, resulting in drug waste, increased production costs, and affecting drug quality and patient safety. It is difficult to effectively predict and prevent leakage risks with existing technology.

Method used

Use data monitoring and analysis technology to collect environmental and equipment data of the filling machine through sensors, use attribute coefficient analysis method to determine the weight of key attributes, build a state optimization module, a sequence integration module, a cross-object aggregation module and a time series fusion module, combined with deep learning The model is used to predict the risk of liquid leakage.

Benefits of technology

It improves the accuracy of liquid leakage risk prediction and equipment operation safety, reduces calculation costs, enhances equipment maintenance efficiency, and promotes the intelligent and digital development of the pharmaceutical industry.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118468226B
    Figure CN118468226B
Patent Text Reader

Abstract

The present invention belongs to the technical field of risk prediction, and specifically relates to a method for predicting the risk of liquid leakage at the filling port of a medicine filling machine. The present invention proposes a risk prediction process for liquid leakage at the filling port of a medicine filling machine, and determines the weights of each key attribute through the attribute coefficient analysis method ACAM. This method can eliminate attributes with lower weights, and at the same time introduces a state optimization module for dynamically adjusting features, a sequence integration module for generating embeddings of local details of data time series, a cross-object aggregation module for aggregating local embeddings of other filling machines, and a time series fusion module for querying the embedding of the last time step from all time embeddings, thereby generating a comprehensive embedding; the method provided by the present invention performs well in processing complex time series data and relationships between devices, and can more accurately predict the risk of liquid leakage, and improve the operating safety and maintenance efficiency of the equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of risk prediction, and in particular relates to a method for predicting the risk of liquid medicine leakage at a filling port of a medicine filling machine. Background Art

[0002] The drug filling machine is one of the key equipment in the pharmaceutical industry. Its main function is to accurately and safely fill liquid drugs into medicine bottles, ampoules, syringes or other containers. The accuracy and stability of the filling process are crucial to ensuring drug quality and production efficiency. However, there may be a risk of drug leakage during the drug filling process, which will not only cause drug waste and increase production costs, but may also cause harm to operators and the production environment, and even affect the quality of drugs and patient safety.

[0003] In order to effectively predict and prevent liquid medicine leakage, modern filling machines are usually equipped with a variety of sensors and monitoring systems, such as pressure sensors, flow sensors, liquid level sensors, and temperature sensors. These sensors and monitoring systems can monitor various parameters in the filling process in real time, detect abnormal situations in time, and predict possible leakage risks through data analysis and machine learning algorithms, and take preventive measures in advance.

[0004] In summary, the problem of liquid leakage at the filling port of the pharmaceutical filling machine not only affects production efficiency and drug quality, but also is related to production safety and environmental protection. Therefore, in-depth research and effective management of this problem are of great significance to improving the overall level of the pharmaceutical industry. Summary of the invention

[0005] The main purpose of the present invention is to provide a method for predicting the risk of liquid leakage at the filling port of a medicine filling machine, which aims to use data monitoring and analysis technology to predict the risk of leakage, help establish a scientific equipment management and maintenance system, improve the management level and technical capabilities of the enterprise, and promote the intelligent and digital development of the pharmaceutical industry.

[0006] To achieve the above object, the technical solution of the present invention is: a method for predicting the risk of liquid leakage at the filling port of a medicine filling machine, the method comprising:

[0007] S1. Use sensors to collect data sets related to liquid leakage at the filling port of a medicine filling machine, including the environment data of the filling machine and the filling machine equipment data itself;

[0008] S2. Process the data related to the leakage of liquid medicine at the filling port, including filling and normalizing the missing values ​​of the data set, and determining the data quality and consistency;

[0009] S3, sensors detect the environment of the medicine filling machine and the historical data of the filling machine equipment, and propose the attribute coefficient analysis method ACAM to determine the weight of each key attribute and eliminate the attributes with lower weight;

[0010] S4. Build a state optimization module SOM. In the scenario of a pharmaceutical filling machine, use the current equipment status and operating conditions to adjust the features, and dynamically adjust the weights of the features so that the model can focus more on key features.

[0011] S5, construct a sequence integration module SIM to aggregate information from other time steps and generate embeddings of local details of the data time series;

[0012] S6. Construct a cross-object aggregation module CEAM to calculate the instantaneous correlation between filling machines and aggregate the local embeddings of other filling machines;

[0013] S7, construct a time series fusion module TFM, for each medicine filling machine, the embedding of the last time step is queried from all historical time embeddings to generate a comprehensive embedding;

[0014] S8. Construct a filling port liquid leakage risk prediction model based on deep learning. The model consists of input, equipment state conversion module, sequence integration module, cross-object aggregation module, time series fusion module, and output.

[0015] S9. Use the filling port medicine liquid leakage data set to train the filling port medicine liquid leakage risk prediction model. During the training process, the prediction model gradually improves the ability of filling port medicine liquid leakage risk prediction.

[0016] Furthermore, the step S3 specifically includes: the historical data of liquid leakage at the filling port includes: pressure data, flow data, liquid level data, temperature data, humidity data, vibration data, filling speed, equipment use frequency and equipment maintenance status. In addition, the network delay and power conditions between different devices will also affect the leakage of liquid at the filling port; AHP decomposes complex problems into multiple levels and uses a combination of expert judgment and mathematical calculation to determine the importance weight of each attribute. The specific steps are as follows:

[0017] S31. Construct attribute association matrix: Based on the judgment of experts, compare each attribute in pairs and construct an attribute association matrix. The matrix elements represent the importance of one attribute relative to another attribute. For one , attribute association matrix as follows:

[0018] ;

[0019] In the formula, the element Indicates The attribute is relative to The importance of each attribute;

[0020] S32, calculate the weight vector: by calculating the eigenvector of the attribute association matrix, the eigenvector is normalized to obtain the weight vector of each attribute, the formula is as follows:

[0021] ;

[0022] ;

[0023] In the formula, For the matrix The characteristic vector of For the matrix The maximum eigenvalue of is the feature vector No. elements, is the number of elements of the eigenvector, is the feature vector Normalized value;

[0024] S33, weight feasibility test: check the feasibility of the attribute association matrix. If the weight feasibility test passes, the weight vector is valid, otherwise the attribute association matrix needs to be adjusted. The present invention uses the feasibility ratio To measure the matrix Is it feasible? The formula is as follows:

[0025] ;

[0026] ;

[0027] In the formula, For the matrix feasibility indicators, For the matrix The random feasibility index is generally It means that the matrix is ​​feasible.

[0028] Through the sub-steps in step S3, ACAM can be used to determine the weights of various key attributes. Important attributes are given greater weights, and attributes with lower weights are eliminated, thereby reducing computational costs and network training time.

[0029] Furthermore, in step S4, a state optimization module SOM is constructed, and the specific steps are as follows:

[0030] S41, first construct the state vector, the state vector is used Indicates, where P is the pressure data of the liquid medicine data set at the filling port of the medicine filling machine, T is the temperature data, S is the filling speed data, and H is the ambient humidity data;

[0031] S42. Then, the weight of the feature is calculated through linear transformation and Softmax activation function , the calculation formula is as follows:

[0032] ;

[0033] Where F is the feature dimension, is the trainable weight matrix, is the bias term;

[0034] S43. Finally, the feature vector With the scaling factor Multiply element by element and dynamically adjust the weight of the feature so that the model can pay more attention to the key features. The calculation process is as follows:

[0035] ;

[0036] Where ⊙ is the Hadamard product, and the input eigenvector is is the feature vector of device u at time step t.

[0037] Furthermore, in step S5, a sequence integration module SIM is constructed to aggregate information from other time steps at each time step to form a local embedding and retain local details of the time series; the specific steps are as follows:

[0038] S51. First, feature encoding is performed, and the scaled feature vector is mapped to a high-dimensional space using a linear transformation. The mapping formula used is as follows:

[0039] ;

[0040] In the formula, is the feature encoded vector, is the weight matrix of feature encoding, is the feature vector after the state optimization module in step S4, is the bias term;

[0041] S52. Subsequently, the bidirectional long short-term memory network BiLSTM considers both the forward and backward information of the time series, which can better capture the dependencies in the sequence. BiLSTM includes two LSTM layers, one for processing the forward sequence and the other for processing the reverse sequence; among them, the forward LSTM is from time step 1 to T, and the formula is as follows: ;

[0042] In the formula, is the hidden state of the forward LSTM at time step t, The feature-encoded vector is used as input; the reverse LSTM is from time step T to 1, and the formula is as follows:

[0043] ;

[0044] In the formula, is the hidden state of the reverse LSTM at time step t;

[0045] S53. Finally, the outputs of the forward LSTM and the reverse LSTM are concatenated to form the output of the bidirectional LSTM. The formula is as follows:

[0046] ;

[0047] In the formula, is the output of the bidirectional LSTM at time step t, which contains the concatenation of the forward and reverse hidden states; the final output form is , where is the local embedding matrix of device u at all time steps, each Contains the concatenation result of the forward and reverse hidden states, with a dimension of 2d, where d is the dimension of the LSTM hidden state; the forward LSTM and reverse LSTM process the sequence data separately, concatenate the output of each time step, and generate a local embedding containing contextual information, which helps to more accurately predict the risk of drug leakage and can be used in subsequent cross-object aggregation and time series fusion steps.

[0048] Furthermore, in step S6, a cross-object aggregation module CEAM is constructed to calculate the instantaneous correlation between filling machines and aggregate the local embeddings of other filling machines. The network delay and power conditions between different devices will also affect the leakage of the filling port liquid. Step S6 adopts an improved multi-head attention mechanism. The improvement method is to add an automatic weight adjustment mechanism on the basis of the multi-head attention mechanism and perform position encoding. The improved multi-head attention mechanism introduces an automatic weight adjustment mechanism so that each attention head can adjust different weights for different devices, thereby capturing more complex relationships. Position encoding adds position encoding information to each time step, so that the model can capture the relative position relationship between time steps. The specific operation steps are as follows:

[0049] S61. First, position code each device using the following formula:

[0050] ;

[0051] ;

[0052] In the formula, pos is the position, indicating the index of a time step in the sequence, i is the dimension index, and d is the feature dimension;

[0053] For each position pos, a position encoding vector containing feature dimension d is generated, and the final position encoding is ;

[0054] The positional encoding is added to the input to capture the time step information, which is calculated as follows:

[0055] ;

[0056] In the formula, is the local embedding matrix of the input, The position information corresponding to each time step;

[0057] S62. Subsequently, a multi-head attention mechanism with automatic weight adjustment is introduced to calculate the correlation between different device states and embed the local input Perform a linear transformation to obtain the query ,key Sum Matrix , the query, key and value matrix calculation formulas are as follows:

[0058] ;

[0059] ;

[0060] ;

[0061] In the formula, is the local embedding matrix with position encoding added, , , For local embedding The weight matrix after linear transformation is used for attention head calculation. The calculation formula is as follows:

[0062] ;

[0063] In the formula, is the output of the attention head of device u, is the dimension of the key matrix; the weights of the automatic weight adjustment mechanism are calculated as follows:

[0064] ;

[0065] Combining the automatic weight adjustment mechanism with the output of the attention head, the output of the attention mechanism is:

[0066] ;

[0067] Where u is the device number, and ;

[0068] The final output of the multi-head attention mechanism with automatic weight adjustment mechanism is:

[0069] ;

[0070] In the formula, Concat is to concatenate the attention mechanism outputs of each device. The training weight matrix of the multi-head attention mechanism for automatically adjusting the weight mechanism; in order to enhance the network's ability to fit the risk of pharmaceutical leakage at the filling port, the present invention alleviates the gradient vanishing and gradient exploding problems and improves the stability of training through residual connection and layer normalization. The residual connection and layer normalization formulas are as follows:

[0071] ;

[0072] In the formula, LayerNorm is the layer normalization operation, is the local embedding matrix with position encoding added, Output of the multi-head attention mechanism for automatic weight adjustment.

[0073] By calculating the correlation between the device states at different time steps and under different operating conditions through each sub-step in step S6, and aggregating the local embedding of other devices, the dynamic correlation between devices can be captured, thereby improving the prediction accuracy of the risk of drug liquid leakage.

[0074] Furthermore, in step S7, a time series fusion module TFM is constructed. For each pharmaceutical filling machine, the embedding of the last time step is queried from all historical time embeddings to generate a comprehensive embedding. The multi-head attention mechanism with automatic weight adjustment mechanism is introduced to calculate each time step t, so the output It also contains feature representations for multiple time steps. Specifically, Contains the feature vector for each time step t ,Right now: ; Through the time series fusion module, the information of all time steps is aggregated on the time axis to generate a comprehensive time embedding , the calculation formula of the timing fusion module is as follows:

[0075] ;

[0076] In the formula, is the cross-object embedding at time step t, is the weight matrix of temporal attention, is the cross-object embedding for the last time step;

[0077] Finally, the comprehensive time embedding is generated by weighted summation, and the formula is: ; This can capture the temporal dependencies in the sequence data and improve the accuracy of the risk prediction of drug leakage.

[0078] Compared with the prior art, the present invention has the following technical effects:

[0079] The technical solution provided by the present invention aims to solve the risk prediction of liquid medicine leakage at the filling port of a medicine filling machine. The technical solution determines the weight of each key attribute through the attribute coefficient analysis method ACAM, and eliminates the attributes with lower weights through this method. At the same time, a state optimization module is introduced to dynamically adjust the features, a sequence integration module is introduced to generate embeddings of local details of the data time series, a cross-object aggregation module is introduced to aggregate the local embeddings of other filling machines, and a time series fusion module is introduced to query the embedding of the last time step from all time embeddings, thereby generating a comprehensive embedding. Compared with other models, the method provided by the present invention performs well in processing complex time series data and relationships between devices, and can more accurately predict the risk of liquid medicine leakage, thereby improving the operating safety and maintenance efficiency of the equipment. BRIEF DESCRIPTION OF THE DRAWINGS

[0080] Figure 1 The present invention is a flowchart of the steps of a method for predicting the risk of liquid leakage at the filling port of a medicine filling machine.

[0081] Figure 2 This is a state optimization module (SOM) step diagram for a method for predicting the risk of liquid leakage at the filling port of a pharmaceutical filling machine.

[0082] Figure 3 This is a structure diagram of a sequence integration module SIM for a method for predicting the risk of liquid leakage at the filling port of a medicine filling machine.

[0083] Figure 4 This is a cross-object aggregation module CEAM structure diagram for a method for predicting the risk of liquid leakage at the filling port of a pharmaceutical filling machine.

[0084] Figure 5 This is a fitting diagram of the predicted value and the true value of a method for predicting the risk of liquid leakage at the filling port of a pharmaceutical filling machine. DETAILED DESCRIPTION

[0085] 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.

[0086] See also Figure 1-Figure 5 The present invention provides a technical solution: a method for predicting the risk of liquid leakage at the filling port of a medicine filling machine, which uses the attribute coefficient analysis method ACAM to determine the weights of various key attributes, and uses this method to eliminate attributes with lower weights. At the same time, a state optimization module is introduced to dynamically adjust features, a sequence integration module is introduced to generate embeddings of local details of data time series, a cross-object aggregation module is introduced to aggregate local embeddings of other filling machines, and a time series fusion module is introduced to query the embedding of the last time step from all time embeddings, thereby generating a comprehensive embedding; the method can improve the expression ability and generalization ability of the model.

[0087] See also Figure 1 As shown, a method for predicting the risk of liquid leakage at a filling port of a medicine filling machine in an embodiment of the present application is as follows:

[0088] S1. Use sensors to collect data sets related to liquid leakage at the filling port of a medicine filling machine, including the environment data of the filling machine and the filling machine equipment data itself;

[0089] S2. Process the data related to the leakage of liquid medicine at the filling port, including filling and normalizing the missing values ​​of the data set, and determining the data quality and consistency;

[0090] S3, sensors detect the environment of the medicine filling machine and the historical data of the filling machine equipment, and propose the attribute coefficient analysis method ACAM to determine the weight of each key attribute and eliminate the attributes with lower weight;

[0091] S4. Build a state optimization module SOM. In the scenario of a pharmaceutical filling machine, use the current equipment status and operating conditions to adjust the features, and dynamically adjust the weights of the features so that the model can focus more on key features.

[0092] S5, construct a sequence integration module SIM to aggregate information from other time steps and generate embeddings of local details of the data time series;

[0093] S6. Construct a cross-object aggregation module CEAM to calculate the instantaneous correlation between filling machines and aggregate the local embeddings of other filling machines;

[0094] S7, construct a time series fusion module TFM, for each medicine filling machine, the embedding of the last time step is queried from all historical time embeddings to generate a comprehensive embedding;

[0095] S8. Construct a filling port liquid leakage risk prediction model based on deep learning. The model consists of input, equipment state conversion module, sequence integration module, cross-object aggregation module, time series fusion module, and output.

[0096] S9. Use the filling port medicine liquid leakage data set to train the filling port medicine liquid leakage risk prediction model. During the training process, the prediction model gradually improves the ability of filling port medicine liquid leakage risk prediction.

[0097] Further, in step S3, referring to Figure 2 As shown, the specific steps include:

[0098] S31. Constructing an attribute association matrix: The attribute association matrix of the present invention is a 4×4 matrix, the attribute association matrix as follows:

[0099] ;

[0100] In the formula, the element Indicates The attribute is relative to The importance of each attribute, where 1≤i≤4, 1≤j≤4;

[0101] S32, calculate the weight vector: by calculating the eigenvector of the attribute association matrix, the eigenvector is normalized to obtain the weight vector of each attribute, the formula is as follows:

[0102] ;

[0103] ;

[0104] In the formula, For the matrix The characteristic vector of For the matrix The maximum eigenvalue of is the feature vector No. elements, is the number of elements of the eigenvector, which is 4. is the feature vector Normalized value;

[0105] S33, weight feasibility test: check the feasibility of the attribute association matrix. If the weight feasibility test passes, the weight vector is valid, otherwise the attribute association matrix needs to be adjusted. The present invention uses the feasibility ratio To measure the matrix Is it feasible? The formula is as follows:

[0106] ;

[0107] ;

[0108] In the formula, For the matrix feasibility indicators, For the matrix The random feasibility index is generally It means that the matrix is ​​feasible.

[0109] Furthermore, the specific steps of step S4 are as follows:

[0110] S41, first construct the state vector, the state vector is used Indicated as follows, where P is the pressure data of the liquid medicine data set at the filling port of the medicine filling machine, T is the temperature data, S is the filling speed data, and H is the ambient humidity data. It is specifically expressed as ;

[0111] S42. Then, the weight of the feature is calculated through linear transformation and Softmax activation function , the calculation formula is as follows:

[0112] ;

[0113] Where F is the feature dimension, which is 4, and serves as the scaling factor of the feature weight. is the trainable weight matrix, is the bias term, the softmax function maps the input value to between 0 and 1;

[0114] S43. Finally, the feature vector is multiplied element by element by the scaling factor to dynamically adjust the feature weights so that the model can pay more attention to key features. The calculation process is as follows:

[0115] ;

[0116] Where ⊙ is the Hadamard product, and the input eigenvector is is the characteristic of equipment u at time step t, and the maximum value of u depends on the number of filling machines.

[0117] Further, in step S5, referring to Figure 3 As shown, the specific steps are as follows:

[0118] S51. First, feature encoding is performed, and the scaled feature vector is mapped to a high-dimensional space using a linear transformation. The mapping formula used is as follows:

[0119] ;

[0120] In the formula, is the feature encoded vector, is the weight matrix of feature encoding, is the feature vector after the state optimization module in step S4, is the bias term;

[0121] S52. Subsequently, the bidirectional long short-term memory network BiLSTM considers both the forward and backward information of the time series, which can better capture the dependencies in the sequence. BiLSTM includes two LSTM layers, one for processing the forward sequence and the other for processing the reverse sequence. The BiLSTM input is a feature vector sequence. , the number of neurons in the hidden layer is 64; among them, the forward LSTM from time step 1 to T, the formula is as follows: ;

[0122] In the formula, is the hidden state of the forward LSTM at time step t, The feature-encoded vector is used as input; the reverse LSTM is from time step T to 1, and the formula is as follows:

[0123] ;

[0124] In the formula, is the hidden state of the reverse LSTM at time step t;

[0125] S53. Finally, the outputs of the forward LSTM and the reverse LSTM are concatenated to form the output of the bidirectional LSTM. The formula is as follows:

[0126] ;

[0127] In the formula, is the output of the bidirectional LSTM at time step t, which contains the concatenation of the forward and reverse hidden states; the final output form is , where is the local embedding matrix of device u at all time steps, each Contains the concatenation result of the forward and reverse hidden states, with a dimension of 2d, where d is the dimension of the LSTM hidden state; the forward LSTM and reverse LSTM process the sequence data separately, concatenate the output of each time step, and generate a local embedding containing contextual information, which helps to more accurately predict the risk of drug leakage and can be used in subsequent cross-object aggregation and time series fusion steps.

[0128] Further, in step S6, referring to Figure 4 The specific steps are as follows:

[0129] S61. First, position code each device using the following formula:

[0130] ;

[0131] ;

[0132] In the formula, pos is the position, indicating the index of a time step in the sequence, i is the dimension index, and d is the feature dimension;

[0133] For each position pos, a position encoding vector containing feature dimension d is generated, and the final position encoding is ;

[0134] The positional encoding is added to the input to capture the time step information, which is calculated as follows:

[0135] ;

[0136] In the formula, is the local embedding matrix of the input, The position information corresponding to each time step;

[0137] S62. Subsequently, a multi-head attention mechanism with automatic weight adjustment is introduced to calculate the correlation between different device states and embed the local input Perform a linear transformation to obtain the query ,key Sum Matrix , the query, key and value matrix calculation formulas are as follows:

[0138] ;

[0139] ;

[0140] ;

[0141] In the formula, is the local embedding matrix with position encoding added, , , For local embedding The weight matrix for linear transformation has a dimension of 128. The matrix after linear transformation is used for attention head calculation, and the calculation formula is as follows:

[0142] ;

[0143] In the formula, is the output of the attention head of device u, is the dimension of the key matrix; the weights of the automatic weight adjustment mechanism are calculated as follows:

[0144] ;

[0145] Combining the automatic weight adjustment mechanism with the output of the attention head, the output of the attention mechanism is:

[0146] ;

[0147] Where u is the device number, and , h is the number of filling machines, is the output of the attention mechanism of the u-th device;

[0148] The final output of the multi-head attention mechanism with automatic weight adjustment mechanism is:

[0149] ;

[0150] In the formula, Concat is to concatenate the attention mechanism outputs of each device. The training weight matrix of the multi-head attention mechanism for the automatic weight adjustment mechanism, and finally, The output of the multi-head attention mechanism that automatically adjusts the weight mechanism for device u. Because the network delay and power conditions between different devices will also affect the leakage of the filling port liquid, for the filling machine device u, each device participates in the prediction of the u device; in order to enhance the network's ability to fit the risk of filling port liquid leakage, the present invention uses residual connection and layer normalization to alleviate the gradient disappearance and gradient explosion problems and improve the stability of training. The residual connection and layer normalization formulas are as follows:

[0151] ;

[0152] In the formula, LayerNorm is the layer normalization operation, is the local embedding matrix with position encoding added.

[0153] Furthermore, in step S7, the multi-head attention mechanism with automatic weight adjustment mechanism is introduced to calculate each time step t, and the information of all time steps is aggregated on the time axis through the time series fusion module to generate a comprehensive time embedding , the calculation formula of the timing fusion module is as follows:

[0154] ;

[0155] In the formula, is the cross-object embedding at time step t, is the weight matrix of temporal attention, is the cross-object embedding for the last time step;

[0156] Finally, the comprehensive time embedding is generated by weighted summation, and the formula is: ; This can capture the temporal dependencies in the sequence data and improve the accuracy of the risk prediction of drug leakage.

[0157] like Figure 5As shown in the figure, the predicted value of the filling port liquid leakage risk prediction model and the true value fit. The output of the prediction model is between 0 and 1, with 0.5 as the dividing line. A predicted value greater than 0.5 indicates a leakage risk, and a predicted value less than 0.5 indicates no leakage risk. Figure 5 It can be seen that the prediction accuracy of the filling port liquid leakage risk prediction model is high, which can meet the actual filling port liquid leakage prediction risk requirements of the pharmaceutical filling machine.

[0158] The above are only preferred embodiments of the present invention. It should be pointed out that a person skilled in the art can make several modifications and improvements without departing from the inventive concept of the present invention, and these all fall within the protection scope of the present invention.

Claims

1. A method for predicting the risk of liquid leakage at the filling port of a medicine filling machine, characterized in that: The following steps are involved: S1. Use sensors to collect data sets related to liquid leakage at the filling port of a medicine filling machine, including the environment data of the filling machine and the filling machine equipment data itself; S2. Process the data related to the leakage of liquid medicine at the filling port, including filling and normalizing the missing values ​​of the data set, and determining the data quality and consistency; S3, sensors detect the environment of the medicine filling machine and the historical data of the filling machine equipment, and propose the attribute coefficient analysis method ACAM to determine the weight of each key attribute and eliminate the attributes with lower weight; S4. Build a state optimization module SOM. In the scenario of a pharmaceutical filling machine, use the current equipment status and operating conditions to adjust the features, and dynamically adjust the weights of the features so that the model can focus more on key features. S5. Construct a sequence integration module SIM to aggregate information from other time steps and generate embeddings of local details of the data time series; the specific method includes: First, feature encoding is performed, and the scaled feature vector is mapped to a high-dimensional space using a linear transformation. The mapping formula used is: , where is the feature encoded vector, is the weight matrix of feature encoding, is the feature vector after the state optimization module in step S4, is the bias term; subsequently, the bidirectional long short-term memory network BiLSTM considers the forward and backward information of the time series at the same time, which can better capture the dependencies in the sequence. BiLSTM includes two LSTM layers, one for processing the forward sequence and the other for processing the reverse sequence. The forward LSTM is from time step 1 to T, and the formula is , where is the hidden state of the forward LSTM at time step t, Taking the feature encoded vector as input, the reverse LSTM is from time step T to 1, and the formula is , where is the hidden state of the reverse LSTM at time step t; finally, the outputs of the forward LSTM and the reverse LSTM are concatenated to form the output of the bidirectional LSTM. The concatenation formula is , where is the output of the bidirectional LSTM at time step t, which contains the concatenation of the forward and reverse hidden states; the final output form is , where is the local embedding matrix of device u at all time steps, each Contains the concatenation results of the forward and reverse hidden states, with a dimension of 2d, where d is the dimension of the LSTM hidden state; the forward LSTM and reverse LSTM process the sequence data separately, concatenate the output of each time step, and generate a local embedding containing contextual information, which helps to more accurately predict the risk of drug leakage and can be used in subsequent cross-object aggregation and time series fusion steps; S6. Construct a cross-object aggregation module CEAM to calculate the instantaneous correlation between filling machines and aggregate the local embeddings of other filling machines. The specific method includes: Different weights are adjusted for different devices to capture more complex relationships. Position encoding adds position encoding information to each time step, so that the model can capture the relative position relationship between time steps. First, position encoding is performed on each device. The formula is: , , where pos is the position, indicating the index of a time step in the sequence, i is the dimension index, and d is the feature dimension. For each position pos, a position encoding vector containing the feature dimension d is generated. The final position encoding is ; Add the position encoding to the input to capture the time step information, and the calculation formula is , where is the local embedding matrix of the input, The position information corresponding to each time step is obtained; then, a multi-head attention mechanism with automatic weight adjustment mechanism is introduced to calculate the correlation between different device states and embed the local input Perform a linear transformation to obtain the query ,key Sum Matrix , the query, key and value matrix calculation formula is , , , where is the local embedding matrix with position encoding added, , , For local embedding The weight matrix after linear transformation is used for attention head calculation. The calculation formula is: , where is the output of the attention head of device u, is the dimension of the key matrix; the weight calculation process of the automatic weight adjustment mechanism is , combined with the automatic weight adjustment mechanism and the output of the attention head, the output of the attention mechanism is , where u is the device number, and ; The final output of the multi-head attention mechanism with automatic weight adjustment mechanism , where Concat is to concatenate the attention mechanism outputs of each device. The training weight matrix of the multi-head attention mechanism is used to automatically adjust the weight mechanism; in order to enhance the network's ability to fit the risk of pharmaceutical leakage at the filling port, residual connections and layer normalization are used to alleviate the gradient vanishing and gradient explosion problems and improve the stability of training. The residual connection and layer normalization process is , where LayerNorm is the layer normalization operation, is the local embedding matrix with position encoding added, The output of the multi-head attention mechanism for the automatic weight adjustment mechanism; S7, construct a time series fusion module TFM, for each pharmaceutical filling machine, the embedding of the last time step is queried from all historical time embeddings to generate a comprehensive embedding; S8. Construct a filling port liquid leakage risk prediction model based on deep learning. The model consists of input, equipment state conversion module, sequence integration module, cross-object aggregation module, time series fusion module, and output. S9. Use the filling port medicine liquid leakage data set to train the filling port medicine liquid leakage risk prediction model. During the training process, the prediction model gradually improves the ability of filling port medicine liquid leakage risk prediction.

2. The method for predicting the risk of liquid medicine leakage at the filling port of a medicine filling machine according to claim 1, characterized in that: In step S3, the historical data of liquid leakage at the filling port include: pressure data, flow data, liquid level data, temperature data, humidity data, vibration data, filling speed, equipment usage frequency and equipment maintenance status. In addition, network delay and power conditions between different devices will also affect the leakage of liquid at the filling port. AHP decomposes complex problems into multiple levels and uses a combination of expert judgment and mathematical calculation to determine the importance weight of each attribute. First, an attribute association matrix is ​​constructed. According to the judgment of experts, each attribute is compared pairwise. The matrix elements represent the importance of one attribute relative to another attribute. The attribute association matrix For one , attribute association matrix for , where the element Indicates The attribute is relative to The importance of each attribute; then, the weight vector is calculated by calculating the eigenvector of the attribute association matrix. The eigenvector is normalized to obtain the weight vector of each attribute. The formula is: , , where For the matrix The characteristic vector of For the matrix The maximum eigenvalue of is the feature vector No. elements, is the number of elements of the eigenvector, is the feature vector The normalized value; Finally, a weight feasibility test is performed to check the feasibility of the attribute association matrix. If the weight feasibility test passes, the weight vector is valid. Otherwise, the attribute association matrix needs to be adjusted, using the feasibility ratio To measure the matrix Is it feasible? The formula is , , where For the matrix feasibility indicators, For the matrix The random feasibility index is generally The representation matrix is ​​feasible; ACAM is used to determine the weight of each key attribute, giving greater weight to important attributes and eliminating attributes with lower weights.

3. The method for predicting the risk of liquid medicine leakage at the filling port of a medicine filling machine according to claim 1, characterized in that: In step S4, a state optimization module SOM is constructed. First, a state vector is constructed. The state vector is Indicated as follows, where P is the pressure data of the liquid medicine dataset at the filling port of the medicine filling machine, T is the temperature data, S is the filling speed data, and H is the ambient humidity data; then, the weight of the feature is calculated through linear transformation and Softmax activation function , the calculation formula is , where F is the feature dimension, is the trainable weight matrix, is the bias term; finally, the eigenvector With the scaling factor Multiply element by element and dynamically adjust the weight of the feature so that the model can pay more attention to the key features. The calculation process is: , where ⊙ is the Hadamard product, and the input eigenvector is the feature vector of device u at time step t.

4. The method for predicting the risk of liquid medicine leakage at the filling port of a medicine filling machine according to claim 1, characterized in that: In step S7, the embedding of the last time step is queried from all historical time embeddings to generate a comprehensive embedding; the multi-head attention mechanism with automatic weight adjustment mechanism is calculated for each time step t, so the output It also contains feature representations for multiple time steps. Specifically, Contains the feature vector for each time step t ,Right now: , through the time series fusion module, the information of all time steps is aggregated on the time axis to generate a comprehensive time embedding , the calculation formula of the timing fusion module is: , where is the cross-object embedding at time step t, is the weight matrix of temporal attention, is the cross-object embedding of the last time step; finally, the comprehensive time embedding is generated by weighted summation, and the formula is , thereby capturing the temporal dependencies in sequence data.

Citation Information

Patent Citations

  • BiLSTM-BiDAF named entity recognition method based on machine reading understanding

    CN114492441A

  • Chemical process dynamic prediction method based on dynamic space-time diagram

    CN117151275A

  • Natural gas flowmeter performance evaluation method and system based on deep learning

    CN117408422A

  • Human body different structure motion data prediction method driven by graph attention network

    CN118230415A

  • Multi-scale hybrid attention mechanism modeling method for predicting remaining useful life of aero engine

    WO2024087128A1