Medicine cold-chain logistics quality early warning method
By using the SG-SSA-BiLSTM model to preprocess and calculate weights for each link in the pharmaceutical cold chain logistics, the problems of discontinuous data and low reliability in pharmaceutical cold chain logistics are solved, and high-precision quality and safety early warning is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHAANXI UNIV OF SCI & TECH
- Filing Date
- 2026-01-21
- Publication Date
- 2026-05-08
AI Technical Summary
The existing pharmaceutical cold chain logistics suffers from discontinuous and inaccurate temperature and humidity data, easily tampered sensor data, and low reliability of traceability code data, making it difficult to effectively monitor and warn of drug quality and safety.
The SG-SSA-BiLSTM model is used to preprocess and calculate the weights of quality data in each link of the pharmaceutical cold chain logistics. The BiLSTM model is optimized by combining the SG filter and the SSA algorithm to realize the pharmaceutical quality early warning of the whole link.
It improves the accuracy and stability of quality early warning for pharmaceutical cold chain logistics, accurately reflects the quality and safety status of drugs, and helps managers predict and eliminate risks in advance.
Smart Images

Figure CN121998527A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of pharmaceutical cold chain logistics quality early warning technology, and specifically relates to a pharmaceutical cold chain logistics quality early warning method. Background Technology
[0002] The global demand for pharmaceutical cold chain logistics is surging, with broad development prospects. However, the industry is plagued by frequent quality and safety incidents, rooted in substandard raw materials, insufficient storage and transportation equipment, and poor personnel professionalism. These issues, coupled with uncontrolled temperature and humidity, easily lead to drug spoilage and the influx of counterfeit and substandard drugs. Therefore, safety traceability and dynamic monitoring are crucial. Current technological shortcomings are prominent: most companies rely on manual recording of temperature and humidity data, resulting in discontinuities and inaccuracies; while some large companies utilize technologies such as RFID and GPS, the complexity of the process and the massive amounts of sensor data present risks of fragmented storage, tampering, and leakage; the industry's anti-counterfeiting and traceability mechanisms are imperfect, making liability identification and recall difficult; existing traceability code data is largely monopolized by companies, and the lack of encryption leads to low credibility for consumers, making it difficult to distinguish genuine from counterfeit information. There is an urgent need to build a safe early warning and reliable traceability system through technological innovation and equipment upgrades to promote the high-quality development of the pharmaceutical cold chain.
[0003] Existing research on early warning systems for the quality and safety of pharmaceuticals in cold chain logistics mainly focuses on the control and early warning of temperature and humidity during storage or transportation, as well as risk assessment in pharmaceutical cold chain logistics. Research comprehensively considering the factors affecting pharmaceutical quality and safety at each stage of the cold chain logistics process is relatively limited. Furthermore, the models used for early warning of pharmaceutical quality and safety are mostly traditional machine learning and backpropagation (BP) neural networks. In the context of today's big data, the increased dimensionality and feature complexity of data have escalated the difficulty of early warning, necessitating the adoption of more advanced early warning models. Therefore, it is imperative to conduct research using currently available advanced technologies to address the quality and safety issues in pharmaceutical cold chain logistics. Summary of the Invention
[0004] The purpose of this invention is to provide a quality early warning method for pharmaceutical cold chain logistics, which solves the problems existing in the prior art and realizes comprehensive consideration and early warning of all aspects of pharmaceutical cold chain logistics.
[0005] To achieve the above objectives, the present invention adopts the following technical solution:
[0006] A method for quality early warning in pharmaceutical cold chain logistics includes the following steps:
[0007] 1) Construct a comprehensive early warning indicator system for pharmaceutical quality, and preprocess the specific indicator data using normalization;
[0008] 2) The combined weighting method is used to calculate the weights of each early warning indicator;
[0009] 3) Introduce SG filter and SSA algorithm to optimize BiLSTM model, obtain SG-SSA-BiLSTM model and train the model;
[0010] 4) Optimize the trained model to predict alarms for the overall cold chain logistics of pharmaceutical quality and each link in the cold chain logistics of pharmaceutical quality.
[0011] Furthermore, the pharmaceutical quality early warning indicator system in step 1) specifically includes 5 primary indicators and 22 secondary indicators;
[0012] The primary indicators include the production, inspection, storage, transportation, and usage stages.
[0013] The secondary indicators of the production process include the quality of pharmaceutical raw materials and excipients, the level of pharmaceutical production equipment, the level of personnel operation standardization, and the level of pharmaceutical production technology.
[0014] The secondary indicators in the testing process include pH value, bacterial endotoxin, high molecular weight protein, phenol or m-cresol content, zinc content, insoluble particulate content, and sterility test.
[0015] The secondary indicators of the storage process include storage temperature, storage humidity, storage equipment quality, frequency of pharmaceutical expiration date checks, and disposal of expired pharmaceuticals.
[0016] The secondary indicators of the transportation process include transportation temperature, transportation equipment level, transportation humidity, and transportation road conditions;
[0017] The secondary indicators for the usage process include the physician's professional level and the level of standardization in medication use.
[0018] Furthermore, the combined weighting method in step 2) is specifically the analytic hierarchy process (AHP)-entropy method, as shown in the following formula.
[0019]
[0020] In the formula: W Sj —The subjective weight of the j-th indicator; W Oj — The objective weight of the j-th indicator; k — coefficient, with a value range of (0,1).
[0021] Furthermore, in the SG-SSA-BiLSTM model of step 3), the BiLSTM basic model includes an input layer, a two-layer BiLSTM layer structure, a fully connected layer, and an output layer, and the activation function is ReLU.
[0022] Furthermore, the SG filter introduced in step 3) is used to denoise the medical quality assessment value sequence. n data points are continuously selected from the first data point to the last data point as a window width, and the least squares method is used as the fitting polynomial. The window is selected sequentially and cyclically to fit the data until the last window completes the data fitting.
[0023] Furthermore, the SSA algorithm optimization parameters in step 3) include the number of neurons in the BiLSTM layer, the number of neurons in the fully connected layer, the learning rate, the batch size, and the number of iterations;
[0024] The updated formula is:
[0025]
[0026] In the formula: — The j-th dimension position of the i-th sparrow in the t-th iteration; T — the maximum number of iterations for the population; α — a uniform random number; Q — a standard normally distributed random value; L — a 1×d matrix filled with 1s; R2 — the sparrow population warning value; ST — the sparrow population safety threshold.
[0027] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0028] This invention addresses the problems of noise in pharmaceutical quality data and the difficulty in optimizing model parameters by proposing a pharmaceutical cold chain logistics quality early warning method based on a combined early warning model of SG-SSA-BiLSTM. The model first uses a Savitzky-Golay filter to smooth and reduce noise in the data. Then, a sparrow search algorithm is introduced to automatically optimize the key parameters of the BiLSTM model. Finally, the optimized BiLSTM model is used for pharmaceutical quality and safety early warning. To verify the model's performance, the early warning results are compared and evaluated with those of BiLSTM, SSA-BiLSTM, and SG-BiLSTM models. The results show that in pharmaceutical cold chain logistics early warning, the SG-SSA-BiLSTM combined early warning model of this invention has the highest prediction accuracy, more stable performance, and more accurate early warning results. It can effectively reflect the true quality and safety status of pharmaceuticals, thereby helping managers to predict and eliminate risks in advance, which has significant practical implications for ensuring pharmaceutical quality and safety.
[0029] This invention establishes a pharmaceutical quality and safety early warning indicator system covering 5 primary indicators and 22 secondary indicators. The weights of the indicators are determined by a combination of the analytic hierarchy process and the entropy method, thus achieving a scientific and comprehensive pharmaceutical quality and safety early warning system. Attached Figure Description
[0030] Figure 1 This is a schematic diagram of the hierarchical structure of the warning indicator system using specific indicators in this embodiment of the invention. Detailed Implementation
[0031] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments.
[0032] Example:
[0033] A method for quality early warning in pharmaceutical cold chain logistics includes the following steps:
[0034] Step 1) Construct a full-process indicator system for pharmaceutical quality early warning and preprocess the relevant indicator data using normalization.
[0035] The entire pharmaceutical cold chain logistics process is analyzed, which involves classifying and screening risk factors that may affect the quality and safety of pharmaceuticals in the production, inspection, storage, transportation, and usage stages, and identifying the key factors affecting quality and safety.
[0036] like Figure 1 As shown, for the quality and safety of pharmaceutical cold chain logistics, a hierarchical structure model consisting of 5 primary indicators and 22 secondary indicators was ultimately selected.
[0037] The primary indicators are established for the five stages of production, inspection, storage, transportation, and use.
[0038] Secondary indicators include pasture information, quality of pharmaceutical raw materials and excipients, level of pharmaceutical production equipment, level of standardized operation by personnel, level of pharmaceutical production technology, pH value, bacterial endotoxins, high molecular weight proteins, phenol or m-cresol content, zinc content, insoluble particulate content, sterility testing, storage temperature, storage humidity and level of storage equipment, frequency of pharmaceutical expiration date inspection, disposal of expired pharmaceuticals, transportation temperature, level of transportation equipment, transportation humidity, transportation road conditions, physician professional level and level of standardized medication use.
[0039] This embodiment selects a representative human insulin injection solution as the research object.
[0040] 2) The combined weighting method is used to calculate the weights of each early warning indicator;
[0041] This embodiment uses raw data obtained from field surveys and principal component analysis to establish the weights of human insulin injection indicators.
[0042] The steps of the combined weighting method are as follows:
[0043] The Analytic Hierarchy Process (AHP) is used to establish a progressive hierarchical structure based on the indicator system. This structure comprises an objective layer, a criterion layer, and a solution layer, constructing a judgment matrix. Indicators within the same layer are compared pairwise, and their relative importance is represented using a 9-level scaling method. A consistency check is performed to verify the logical inconsistencies within the judgment matrix. A progressive hierarchical structure is established. Indicators are divided layer by layer according to the pharmaceutical cold chain logistics quality and safety early warning indicator system. A judgment matrix is constructed. Based on enterprise surveys and professional consultations, criterion and solution layer judgment matrices are established according to the pharmaceutical cold chain logistics quality and safety early warning indicator system.
[0044] In the criteria layer, since the pharmaceutical production process manufactures pharmaceuticals, the quality of pharmaceutical production plays a decisive role in the quality of pharmaceutical cold chain logistics. Therefore, the production stage (B1) is the most important. After pharmaceutical production is completed, various indicators need to be verified and qualified before it can continue to circulate to subsequent stages. Therefore, the verification stage (B2) is of equal importance to the production stage (B1). The other three stages are ranked according to the number of influencing factors. The criteria layer indicator judgment matrix is shown in Table 1. The production stage mainly has four indicators. The quality of pharmaceutical raw materials and excipients (C1) determines the quality of the produced pharmaceuticals, so it is the most important. The level of pharmaceutical production equipment (C2) determines whether the important components in pharmaceutical raw materials and other compounds can be fully extracted, so its importance is second. The level of pharmaceutical production technology (C3) is more important than the level of standardized operation of personnel (C4). The production stage indicator judgment matrix is shown in Table 2.
[0045] Table 1: Criterion Layer Indicator Judgment Matrix
[0046] Table 2: Judgment Matrix of Solution-Level Indicators (Production Process)
[0047] The testing process mainly involves seven indicators. Among the other five indicators, sterility indicator C11 and bacterial endotoxin indicator C6 are the most important. If either of these two indicators fails, the other five indicators being qualified are also invalid. Therefore, these two indicators are the most important and equally important. Similarly, failure in any of the other five indicators also determines that the produced pharmaceutical product is substandard; thus, these five indicators are of equal importance. The indicator judgment matrix for the testing process is shown in Table 3.
[0048] Table 3: Judgment Matrix of Scheme-Level Indicators (Verification Process)
[0049] There are five main indicators in the storage process. Storage temperature (C12) and storage humidity (C13) are the two most sensitive indicators for pharmaceuticals, having the greatest impact on pharmaceutical quality; therefore, storage temperature and humidity are of paramount importance. Storage equipment (C14) affects storage temperature and humidity. The importance of the other two indicators is determined by the severity of the event. Expired pharmaceutical disposal (C16) involves special disposal of expired pharmaceuticals to prevent cross-contamination between expired and qualified pharmaceuticals; therefore, its importance is significantly higher than the frequency of pharmaceutical expiration date checks (C15). The index judgment matrix for the storage process is shown in Table 4.
[0050] Table 4: Judgment Matrix of Scheme Layer Indicators (Storage Link)
[0051] There are four main indicators in the transportation process. The transportation temperature (C17), transportation equipment level (C18), and transportation humidity (C19) are the same as the first three indicators in the storage process. Therefore, the importance of these three indicators is the same as that in the storage process. However, due to the uncertainty of the transportation road conditions (C20), the quality of the transportation road conditions is a matter of probability. Therefore, its importance is significantly lower than that of the first three indicators. The judgment matrix of the transportation process indicators is shown in Table 5.
[0052] Table 5: Judgment Matrix of Scheme-Level Indicators (Transportation Link)
[0053] There are two main indicators in the usage stage: the physician's professional level (C21) is significantly more important than the level of medication standardization (C22). The indicator judgment matrix for the usage stage is shown in Table 6.
[0054] Table 6: Judgment Matrix of Solution-Level Indicators (Usage Stage)
[0055] Consistency verification and indicator weight calculation. Consistency verification is performed at the criterion level and the scheme level based on consistency index CI formula 1 and consistency ratio CR formula 2. The weights of the early warning indicators at the criterion level and the scheme level are calculated respectively based on indicator weight Wi formula 4. The total weight of the early warning indicators is calculated based on the total indicator weight WS formula 5.
[0056] (1)
[0057] (2)
[0058] λmax — Determines the largest eigenvalue of a matrix;
[0059] CI – Consistency Indicator;
[0060] CR – Consistency Test Ratio;
[0061] RI – Average Random Consistency Index.
[0062] The RI values are shown in Table 7. If CR < 0.1, the consistency test is passed; otherwise, the judgment matrix needs to be readjusted.
[0063] Table 7: Initial Eigenvalues
[0064] The indicator weights are calculated by first calculating the eigenvector Mi of the judgment matrix according to Formula 3, and then normalizing it according to Formula 4, i.e., the weights. Finally, the total weight is calculated according to Formula 5. .
[0065] (3)
[0066] (4)
[0067] (5)
[0068] —The weights of the criteria layer indicators relative to the target layer;
[0069] —The weight of the scheme-level indicators relative to the criteria-level indicators.
[0070] Table 8 shows the feature vectors and weights of the five stages in the criterion layer: production B1, inspection B2, storage B3, transportation B4, and use B5. The weight results are sorted in accordance with the evaluation approach of the judgment matrix in the criterion layer. Table 9 shows the consistency verification results of the criterion layer. CR=0.053<0.1, and the consistency verification of the judgment matrix is passed.
[0071] Table 8: Hierarchical Single Ordering of Criterion Layers Table 9: Consistency Test Results of Criterion Layer Judgment Matrix
[0072] Table 10 shows the feature vectors and weights of four indicators in the production process of the scheme layer: quality of pharmaceutical raw materials and excipients (C1), level of pharmaceutical production equipment (C2), level of personnel operation standardization (C3), and level of pharmaceutical production technology (C4). The weight results are ranked in accordance with the evaluation ideas in its judgment matrix. Table 11 shows the consistency verification results of the production process. CR=0.011<0.1, and the consistency verification of the judgment matrix is passed.
[0073] Table 10: Hierarchical Sorting of the Solution Layer (Production Process)
[0074] Table 11 Consistency test results of the decision matrix at the solution level (production stage):
[0075]
[0076] Table 12 shows the feature vectors and weights of seven indicators in the protocol-level verification process: pH value (C5), bacterial endotoxin (C6), high molecular weight protein (C7), and phenol or m-cresol content (C8). The bacterial endotoxin and sterility test indicators have equal and maximum weights, while the other five indicators have equal weights. The weight results are consistent with the evaluation approach of the judgment matrix. Table 13 shows the consistency verification results of the verification process. CR=0<0.1, and the consistency verification of the judgment matrix is passed.
[0077] Table 12: Hierarchical Ranking of the Scheme Layer (Verification Process):
[0078] Table 13: Consistency Test Results of the Judgment Matrix at the Scheme Level (Verification Stage)
[0079] Table 14 shows the feature vectors and weights of five indicators in the storage stage of the solution layer: storage temperature (C12), storage humidity (C13), storage equipment level (C14), frequency of pharmaceutical expiration date inspection (C15), and disposal of expired pharmaceuticals (C16). Storage temperature and humidity are the factors that have the greatest impact on pharmaceuticals, and their weights rank first and second. The weight ranking is consistent with the evaluation approach of the judgment matrix. Table 15 shows the consistency verification results of the storage stage. CR=0.082<0.1, and the consistency verification of the judgment matrix is passed.
[0080] Table 14: Hierarchical Sorting of the Solution Layer (Storage Component)
[0081] Table 15: Consistency Test Results of the Decision Matrix at the Scheme Layer (Storage Component)
[0082] Table 16 shows the feature vectors and weights of four indicators in the transportation process at the scheme layer: transportation temperature (C17), transportation equipment level (C18), transportation humidity (C9), and transportation road condition (C20). The transportation temperature and transportation humidity indicators have the highest and second highest weights, while the transportation equipment level has a higher weight than the transportation road condition. The weight ranking is consistent with the evaluation approach of the judgment matrix. Table 17 shows the consistency verification results of the transportation process. CR=0.011<0.1, so the consistency verification of the judgment matrix is passed.
[0083] Table 16: Hierarchical Ranking of the Solution Layer (Transportation Link)
[0084] index Feature vector Weighting value (%) C17 2.213 46.685 C18 0.76 16.027 C19 1.316 27.759 C20 0.452 9.53
[0085] Table 17: Consistency Test Results of the Decision Matrix at the Solution Level (Transportation Link)
[0086] Table 18 shows the feature vectors and weights of two indicators, physician professional level (C21) and medication standardization level (C22), in the usage stage of the protocol layer. The weight of physician professional level is greater than that of medication standardization level, and the weight ranking results are consistent with the evaluation approach of the judgment matrix. Table 1-19 shows the consistency verification results of the criteria layer. CR=0<0.1, and the consistency verification of the judgment matrix is passed.
[0087] Table 18: Hierarchical Sorting of Solution Layer (Usage Phase)
[0088] Table 19: Consistency Test Results of the Decision Matrix at the Solution Layer (Usage Stage):
[0089] Based on the weights of the 5 indicators in the criteria layer and the 22 indicators in the scheme layer, the total weights of the 22 indicators relative to the target layer are calculated. The weights of the pharmaceutical cold chain logistics quality and safety early warning indicators obtained by the analytic hierarchy process are shown in Table 20.
[0090] Table 20: Weights (%) of Early Warning Indicators Obtained by Analytic Hierarchy Process
[0091] Continued from Table 20:
[0092] (b) Solving the weights of early warning indicators using the entropy method.
[0093] Data consistency and normalization. The entropy method requires converting all indicators to positive values before normalization. Specific indicator processing is as follows:
[0094] Positive indicators: The higher the value of the indicator, the better the result. The formula is:
[0095] (6)
[0096] Negative indicators: Unlike positive indicators, the smaller the value, the better. The formula is:
[0097] (7)
[0098] Interval Indicator: The closer the indicator value is to the ideal interval, the better. Assuming the optimal interval is [a, b], the formula is:
[0099] (8)
[0100] Intermediate indicator: The closer the indicator value is to the ideal value, the better. Assuming xbest is the ideal intermediate value, its formula is:
[0101] (9)
[0102] In the formula:
[0103] xmin — minimum value;
[0104] xmax — Maximum value;
[0105] xnorm — the result of normalization.
[0106] Calculate the entropy value of the index. Formula:
[0107] (10)
[0108] In the formula: n — number of samples; xij — value of sample i on the j-th index.
[0109] Calculate the information entropy redundancy of the indicator. Formula:
[0110] (11)
[0111] Calculate the indicator weights. Formula:
[0112] (12)
[0113] In the formula:
[0114] m — number of indicators.
[0115] The entropy values, information entropy redundancy, and weight calculation results of each early warning indicator are shown in Table 21:
[0116] Table 21: Weights (%) of Early Warning Indicators Obtained by Entropy Method
[0117] Continued from Table 21
[0118]
[0119] (c) Determine the weight of early warning indicators using the analytic hierarchy process (AHP) and entropy method.
[0120] The weights of the early warning indicators are determined by a weighted average of the analytic hierarchy process (AHP) and the entropy method, i.e., the combined weighting method. The formula is as follows:
[0121] (13)
[0122] In the formula:
[0123] WSj — The subjective weight of the j-th indicator;
[0124] WOj — the objective weight of the j-th indicator;
[0125] k — The coefficient ranges from (0, 1).
[0126] In this embodiment, k=0.7 is chosen, emphasizing subjective judgment. The total weight of the early warning indicators is shown in Table 22.
[0127] Table 22: Total Weight (%) of Early Warning Indicators for Pharmaceutical Cold Chain Logistics
[0128] Table 23: Standardized data for various indicators in the production process
[0129] Table 24: Standardized data for each indicator in the verification process
[0130] Table 25: Standardized data for various indicators in the storage process
[0131] Table 26: Standardized data for various indicators in the transportation process
[0132] Table 27: Standardized data for each indicator during the usage phase
[0133] Step 3) To address the issues of noise in pharmaceutical quality data and parameter selection in the BiLSTM model, SG filters and SSA algorithms are introduced to optimize the BiLSTM model, resulting in the SG-SSA-BiLSTM model, which is then trained.
[0134] In the BiLSTM basic model, the input layer receives 22 normalized warning indicator data. The BiLSTM layer is set with a two-layer BiLSTM structure with 150 and 145 neurons respectively and a learning rate of 0.000322. The fully connected layer is set with 95 neurons and ReLU is used as the activation function. The output layer outputs the medical quality assessment value.
[0135] The SG filtering data preprocessing method is used to reduce noise in the sequence of medical quality assessment values. It is described as follows: in a set of data to be processed, n=2M+1 data points are continuously selected from the first data point to the last data point. The n=2M+1 data points are used as a window width. The least squares method is used as the fitting polynomial. An appropriate polynomial order is selected for data fitting. The windows are selected sequentially and cyclically for data fitting until the last window completes the data fitting.
[0136] The fitting polynomial for each set of consecutive n=2M+1 data points is:
[0137] (14)
[0138] The formula for minimum mean square error is:
[0139] (15)
[0140] In Equations 14 and 15:
[0141] y(n) — the fitted value of the data;
[0142] x(n) — the original data value;
[0143] n—the size of the fitting window;
[0144] k — polynomial order;
[0145] a k —Coefficients to be determined.
[0146] According to the fitting polynomial for consecutive data points n = 2M + 1, a total of n k-th degree polynomials can be listed. Only when n > k can the system of equations have a solution. The polynomial coefficients 'a' of the fitted data are calculated to minimize the error using the least mean square error formula (Formula 16). k Then, based on the solved polynomial coefficients, the original data is processed to obtain the data fitting values.
[0147] The SG filter has two important parameters: window width and polynomial order, namely the n and k values in Formula 15. The values of n and k should be selected according to the data characteristics and experimental requirements. In this embodiment, the SG filter window width is 10 and the polynomial order is 7.
[0148] SSA optimization parameters include the number of neurons in the BiLSTM layer, the number of neurons in the fully connected layer, the learning rate, the batch size, and the number of iterations.
[0149] The SSA algorithm is used to automatically search for the optimal parameter combination in the pharmaceutical cold chain logistics quality early warning model of this invention. This algorithm simulates a parameter optimization search process, iteratively searching for the hyperparameter configuration that optimizes model performance within the solution space. Specifically, the algorithm initializes a set of individual parameter configurations, explores and adjusts them in a multidimensional parameter space, and gradually updates the parameter positions to approach the global optimum.
[0150] In the parameter search population, a certain proportion of dominant explorers are designated to guide the search direction and explore parameter regions that may improve model performance. The rest serve as subordinate adjustment populations, performing fine-tuning searches near the optimal regions discovered by the dominant individuals. Additionally, some risk-aware individuals are assigned to monitor the search process and prevent getting trapped in local optima or overfitting. The position update formula for the dominant explorers is as follows:
[0151] (16)
[0152] In the formula:
[0153] —The value of the j-th dimension parameter of the i-th parameter configuration individual in the t-th iteration;
[0154] T—Maximum number of iterations;
[0155] α — Uniformly random number;
[0156] Q—A random value distributed normally;
[0157] L — a 1×d matrix consisting entirely of 1s;
[0158] R2 – Risk Sensitivity Index;
[0159] ST – Risk Response Threshold.
[0160] The number of iterations affects the depth and efficiency of the parameter search. A higher number of iterations helps to explore the parameter space more thoroughly, but if the optimal solution is converged prematurely, continuing to iterate will increase unnecessary computational overhead.
[0161] During parameter optimization, R² and ST are used to control the algorithm's sensitivity to search risk. A higher ST setting encourages individuals to search near their current position, reducing global exploration ability; a lower ST setting makes individuals more active, facilitating global optimization. When R² < ST, the current search environment is relatively safe, and individuals can explore freely; when R² ≥ ST, potential risks exist (such as getting trapped in local optima), and all individuals will adjust their search direction, moving towards a safer parameter region.
[0162] The fitness function evaluates the performance of each parameter configuration individual, i.e., the predictive performance of the corresponding model. Individuals adjust their parameter positions based on their fitness values, gradually clustering towards regions with better performance. The position update formula for subordinate adjustment individuals is:
[0163] (17)
[0164] In the formula:
[0165] —The worst-performing individual in terms of parameter configuration;
[0166] —The optimal parameter configuration in the (t+1)th iteration;
[0167] A – A matrix of size 1×d, with values of 1 or -1.
[0168] When i > n / 2, it indicates that the fitness of the i-th participant is poor; when i ≤ n / 2, the fitness of the i-th participant is good and it can move to another location.
[0169] Risk-aware individuals comprise approximately 10%–20% of the group. Their role is to monitor the search status and guide the entire group to adjust its strategy when risk is detected, thereby enhancing the robustness and adaptability of the search. Their position update formula is:
[0170] (18)
[0171] In the formula:
[0172] K – Step size;
[0173] β—A normally distributed random value;
[0174] ε—an infinitesimal constant;
[0175] fi—the current fitness of the individual;
[0176] fg — Current optimal fitness value;
[0177] fw — the current worst fitness value.
[0178] When fi > fg, it indicates that the individual's performance is poor and needs to be moved closer to the optimal parameter configuration; when fi = fg, it indicates that the current optimal individual may face risks and the group needs to be guided to adjust collaboratively.
[0179] The execution flow of the SSA algorithm in this invention is as follows:
[0180] (a) Parameter initialization: Set population size, parameter range, number of iterations, etc.;
[0181] (b) Fitness evaluation: The fitness function is calculated and ranked using the model prediction accuracy as the fitness function;
[0182] (c) Position Update: Update the parameter configuration of the leading exploration individual, subordinate adjustment individual, and risk perception individual in sequence;
[0183] (d) Convergence judgment: If the stopping condition is met (such as reaching the maximum number of iterations or fitness stabilization), output the optimal parameter combination; otherwise, return to step (b) to continue iteration.
[0184] Step 4) Optimize the trained model to predict alarms for the overall cold chain logistics of pharmaceutical quality and each link in the cold chain logistics of pharmaceutical quality.
[0185] In this embodiment, the prediction results are divided into five levels according to intervals: severe alert, medium alert, light alert, minor alert, and no alert. Combining the weights determined by the analytic hierarchy process and the entropy method, the target output results are calculated. The target output results for the first 10 samples are shown in Table 28.
[0186] Table 28: Early Warning Model Output Values
[0187] The input and output of 100 sets of data were trained using BiLSTM, SSA-BiLSTM, SG-BiLSTM and SG-SSA-BiLSTM respectively. The predicted values were divided into different alarm levels according to the intervals, as shown in Table 29.
[0188] Table 29 Classification of Police Situation Levels
[0189] For different alarm levels, four models—BiLSTM, SSA-BiLSTM, SG-BiLSTM, and SG-SSA-BiLSTM—were used to predict pharmaceutical quality data. The results of different prediction samples were divided, and the corresponding alarm results for each prediction sample (the top ten prediction samples) are shown in Tables 30 and 31.
[0190] Table 30: Medical Emergency Prediction Results of BiLSTM and SSA-BiLSTM Models
[0191] Table 31: Medical Emergency Prediction Results of SG-BiLSTM and SG-SSA-BiLSTM Models
[0192] Table 30 shows that the BiLSTM and SSA-BiLSTM models have relatively large errors between predicted and actual values, resulting in discrepancies between the predicted and actual alarm levels. For example, the alarm level for the 6th sample is "minor alarm," but it is judged as "no alarm." Table 31 shows that the predicted alarm levels of the SG-BiLSTM and SG-SSA-BiLSTM models are consistent with the alarm levels of the actual values after SG filter optimization. Furthermore, the alarm levels of the actual values after SG filter optimization are also consistent with the alarm levels of the unoptimized values. Therefore, it can be concluded that as long as the alarm level determination of the model's predicted values is the same as the alarm level of the actual values after SG filter optimization, the alarm level of the original actual values can be accurately predicted. Thus, both the model's prediction performance and the alarm level determination results demonstrate that the SG-SSA-BiLSTM model proposed in this invention has a better early warning effect and has practical significance for applying it to the quality and safety early warning of pharmaceutical cold chain logistics.
Claims
1. A method for quality early warning in pharmaceutical cold chain logistics, characterized in that, Includes the following steps: 1) Construct a comprehensive early warning indicator system for pharmaceutical quality, and preprocess the specific indicator data using normalization; 2) The combined weighting method is used to calculate the weights of each early warning indicator; 3) Introduce SG filter and SSA algorithm to optimize BiLSTM model, obtain SG-SSA-BiLSTM model and train the model; 4) Optimize the trained model to predict alarms for the overall cold chain logistics of pharmaceutical quality and each link in the cold chain logistics of pharmaceutical quality.
2. The pharmaceutical cold chain logistics quality early warning method according to claim 1, characterized in that: The pharmaceutical quality early warning indicator system in step 1) specifically includes 5 primary indicators and 22 secondary indicators; The primary indicators include the production, inspection, storage, transportation, and usage stages. The secondary indicators of the production process include the quality of pharmaceutical raw materials and excipients, the level of pharmaceutical production equipment, the level of personnel operation standardization, and the level of pharmaceutical production technology. The secondary indicators in the testing process include pH value, bacterial endotoxin, high molecular weight protein, phenol or m-cresol content, zinc content, insoluble particulate content, and sterility test. The secondary indicators of the storage process include storage temperature, storage humidity, storage equipment quality, frequency of pharmaceutical expiration date checks, and disposal of expired pharmaceuticals. The secondary indicators of the transportation process include transportation temperature, transportation equipment level, transportation humidity, and transportation road conditions; The secondary indicators for the usage process include the physician's professional level and the level of standardization in medication use.
3. The pharmaceutical cold chain logistics quality early warning method according to claim 1, characterized in that: In step 2), the combined weighting method is specifically the Analytic Hierarchy Process (AHP)-Entropy Method, as shown in the following formula: In the formula: W Sj —The subjective weight of the j-th indicator; W Oj — The objective weight of the j-th indicator; k — coefficient, with a value range of (0,1).
4. The pharmaceutical cold chain logistics quality early warning method according to claim 1, characterized in that: In the SG-SSA-BiLSTM model of step 3), the BiLSTM basic model includes an input layer, a two-layer BiLSTM layer structure, a fully connected layer, and an output layer, with ReLU selected as the activation function.
5. The pharmaceutical cold chain logistics quality early warning method according to claim 1, characterized in that: The SG filter introduced in step 3) is used to denoise the medical quality assessment value sequence. n data points are selected continuously from the first data point to the last data point as a window width, and the least squares method is used as the fitting polynomial. The window is selected sequentially and cyclically to fit the data until the last window completes the data fitting.
6. The pharmaceutical cold chain logistics quality early warning method according to claim 1, characterized in that: The SSA algorithm optimization parameters in step 3) include the number of neurons in the BiLSTM layer, the number of neurons in the fully connected layer, the learning rate, the batch size, and the number of iterations. The updated formula is: In the formula: — The j-th dimension position of the i-th sparrow in the t-th iteration; T — the maximum number of iterations for the population; α — a uniform random number; Q — a standard normally distributed random value; L — a 1×d matrix filled with 1s; R2 — the sparrow population warning value; ST — the sparrow population safety threshold.