A machine learning-based pharmaceutical process monitoring method and system

CN122966099APending Publication Date: 2026-10-23BEIJING DEKAI PHARMA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611183959.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-06
Publication Date
2026-10-23

AI Technical Summary

Technical Problem

[0004]但现有技术仍面临一定的挑战:一方面,虽采用多种数据采集手段,但不同生产环节的数据存在异构性与孤立性,数据融合机制不完善,导致监控视角碎片化,难以从全局层面实现生产过程的全面监控;另一方面,多数记录方法仍停留在被动式数据存储阶段,仅依赖预设规则记录信息,缺乏对数据深层关联的动态挖掘能力,既难以揭示数据的内在演化规律,也无法自动识别潜在的工艺偏差或早期异常,进而无法在问题萌芽阶段开展有效干预与预警,难以最大限度降低生产过程中的质量风险

Benefits of technology

1、本发明通过采集多源数据并优化数据源的贡献权重,结合时空卷积神经网络提取动态特征,全面监控生产过程中的关键参数,不仅提升了数据融合能力,还增强了实时性和准确性,确保生产过程中的关键因素得到及时跟踪与控制。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122966099A_ABST
    Figure CN122966099A_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on machine learning's drug process monitoring method and system, it is related to process monitoring technical field, comprising: dynamically optimizing the contribution weight of each data source, and using space-time convolutional neural network to extract dynamic characteristics in production process, generate associated characteristics;Build federal transfer learning framework, identify abnormal risk in production process, abnormal risk propagation path and abnormal risk interval, and build abnormal risk prediction model based on identification result;Combine multi-source data with abnormal risk prediction result, analyze the causal relationship between each production link, and use simulation disturbance technology to define the early warning threshold corresponding to each risk level;Call the preset drug production process emergency atlas, generate hierarchical emergency treatment scheme, and combine blockchain notarization technology and electronic signature record monitoring results.The application not only improves data fusion capability, but also enhances real-time and accuracy, ensures that key factors in production process are tracked and controlled in time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of process monitoring technology, and more specifically, to a method and system for monitoring pharmaceutical processes based on machine learning. Background Technology

[0002] In the pharmaceutical manufacturing sector, ensuring product quality consistency and compliance is a core industry requirement, directly impacting drug safety, clinical efficacy, and market access eligibility. As regulations related to drug quality management become increasingly stringent, higher demands are placed on precise monitoring and real-time recording of the production process, highlighting its growing importance. However, traditional monitoring models rely heavily on decentralized data acquisition systems and manual inspection records, resulting in severe data silos, hindered information flow, numerous blind spots in monitoring, and an inability to capture key changes in the production process in real time.

[0003] With the rapid advancement of intelligent manufacturing, advanced technologies such as the Industrial Internet, big data analytics, and artificial intelligence are gradually penetrating the pharmaceutical industry. Some leading companies have introduced automated data acquisition and visualization monitoring platforms, utilizing tools such as SCADA (Supervisory Control and Data Acquisition) and MES (Manufacturing Execution System) to achieve real-time data recording and alarm management for key processes. These systems can automatically collect equipment operating data, environmental parameters, and production process indicators, and alert to abnormal situations through alarm mechanisms, playing a role in improving the transparency and response efficiency of the production process.

[0004] However, existing technologies still face certain challenges: On the one hand, although various data collection methods are used, the data from different production stages are heterogeneous and isolated, and the data fusion mechanism is imperfect, resulting in a fragmented monitoring perspective and making it difficult to achieve comprehensive monitoring of the production process from a global perspective; on the other hand, most recording methods are still in the stage of passive data storage, relying solely on preset rules to record information, lacking the ability to dynamically mine the deep correlation of data, making it difficult to reveal the inherent evolutionary laws of data, and unable to automatically identify potential process deviations or early anomalies, thus making it impossible to carry out effective intervention and early warning at the nascent stage of problems, and making it difficult to minimize quality risks in the production process.

[0005] No effective solutions have yet been proposed to address the problems in the relevant technologies. Summary of the Invention

[0006] In view of the problems in related technologies, this invention proposes a drug process monitoring method and system based on machine learning to overcome the above-mentioned technical problems existing in the existing related technologies.

[0007] Therefore, the specific technical solution adopted by the present invention is as follows:

[0008] According to one aspect of the present invention, a machine learning-based method for monitoring pharmaceutical processes is provided, the method comprising: S1. Collect data from multiple sources, dynamically optimize the contribution weights of each data source, and use a spatiotemporal convolutional neural network to extract dynamic features in the production process and generate related features. S2. Based on the generated association features, construct a federated transfer learning framework to identify abnormal risks, abnormal risk propagation paths, and abnormal risk ranges in the production process. Based on the identification results, construct an abnormal risk prediction model and output the abnormal risk prediction results. S3. Collect historical deviation data in the drug production process, combine multi-source data and abnormal risk prediction results, analyze the causal relationship between each production link, and use simulation perturbation technology to define the early warning threshold corresponding to each risk level. S4. Based on the defined early warning threshold, call the preset emergency map of the drug production process, generate a graded emergency response plan, and combine blockchain evidence storage technology with electronic signature to record the monitoring results.

[0009] Furthermore, multi-source data is collected, the contribution weights of each data source are dynamically optimized, and a spatiotemporal convolutional neural network is used to extract dynamic features in the production process, generating associated features including: S11. Collect and preprocess multi-source data from each stage of the drug production process, construct a real-time streaming framework based on the preprocessing results, and combine a deep learning-driven adaptive fusion mechanism to identify the characteristics of different data sources in order to dynamically optimize the contribution weight of each data source. S12. Based on the dynamic optimization results of contribution weights, the adaptive variational mode decomposition technique is used to perform multi-level time-frequency decomposition on multi-source data to separate feature components at different frequency scales. S13. Use a spatiotemporal convolutional neural network to capture the local correlation and evolution pattern of feature components in time and space dimensions, and extract dynamic features that reflect production process fluctuations, environmental changes and equipment operating status based on the capture results. S14. Based on the extracted dynamic features, construct a production flow chart, and integrate multi-head self-attention mechanism and graph neural network to analyze the nonlinear correlation and spatial dependency between each production link in the production flow chart, and generate correlation features for process monitoring.

[0010] Furthermore, based on the generated association features, a federated transfer learning framework is constructed to identify abnormal risks, abnormal risk propagation paths, and abnormal risk ranges in the production process. Based on the identification results, an abnormal risk prediction model is built, and the output abnormal risk prediction results include: S21. Based on the generated association features, a federated transfer learning framework is constructed using a parallel homomorphic encryption mechanism, and the federated transfer learning framework is trained and optimized by combining association features and gradient selection algorithm. S22. Based on the optimized federated transfer learning framework, identify abnormal risks, abnormal risk propagation paths, and abnormal risk intervals in the production process, and integrate the correlation features of each production link based on the identification results to establish an abnormal risk transmission domain. S23. Using the abnormal risk transmission domain as the sample label and the collected multi-source data as input, construct an abnormal risk prediction model based on a multilayer perceptron and output the abnormal risk prediction results.

[0011] Furthermore, based on the optimized federated transfer learning framework, abnormal risks, their propagation paths, and their ranges in the production process are identified. Based on the identification results, the correlation characteristics of each production stage are integrated to establish an abnormal risk transmission domain, including: S221. Identify abnormal risks in the production process based on the optimized federated transfer learning framework and long short-term memory network. S222. Based on the identified abnormal risks, combine the production flow chart and Bayesian network to calculate the probability of abnormal risks in each production link, and analyze the temporal evolution trend of the probability of abnormal risks in order to deduce the abnormal risk propagation path in the production flow chart. S223. Using sensitivity analysis algorithms, assess the relative contribution of each associated feature to drug quality, construct a production process model, optimize the sampling process in the production process model, and generate abnormal risk intervals for drug quality. S224. Based on the abnormal risks, the abnormal risk propagation paths, and the abnormal risk ranges, integrate the correlation characteristics of each production link to establish an abnormal risk transmission domain.

[0012] Furthermore, sensitivity analysis algorithms are used to assess the relative contribution of each associated feature to drug quality, construct a production process model, optimize the sampling process in the production process model, and generate abnormal risk intervals for drug quality, including: S2231. Using sensitivity analysis algorithms, assess the nonlinear impact of correlation features on quality indicators in each production stage, and combine with a pre-set deep learning regression model to identify and quantify the relative contribution of each correlation feature to drug quality. S2232. Based on the relative contribution of each associated feature, construct a production process model and optimize the sampling process in the production process model to obtain sampling data in the production scenario. S2233. Perform statistical analysis on the sampled data and use the uncertainty propagation algorithm to quantify the fluctuation range of the sampled data to generate the abnormal risk range of drug quality.

[0013] Furthermore, based on the relative contribution of each associated feature, a production process model is constructed, and the sampling process in the production process model is optimized to obtain sampling data in the production scenario, including: S22321. Based on the relative contribution of each associated feature, a production process model is constructed using digital twin technology, and each sampling unit in the production process model is sorted according to its relative contribution. S22322. The sampling process is iteratively optimized using an evolutionary strategy. Combining the current optimization progress with the sorting results of the sampling units, the sampling units are divided into primary sampling regions and secondary sampling regions according to a preset linear ratio. Differentiated virtual sampling strategies are then implemented for different sampling regions to obtain virtual sampling data. S22323: Using virtual sampling data as prior knowledge to guide pre-deployed sensors to perform physical sampling during the production process and obtain sampling data in the production scenario.

[0014] Furthermore, virtual sampling strategies include: An initial sampling unit is selected within the first-level sampling region. An interactive learning mechanism is used to interactively learn between the initial sampling unit and its neighboring sampling units in the lower-level sampling region, as well as other randomly selected sampling units. A first-level virtual sampling strategy is generated based on the interactive learning results. Several candidate sampling units are randomly selected within the secondary sampling region, and the candidate sampling unit with the best relative contribution is selected as the dominant sampling unit. A secondary virtual sampling strategy is generated based on the dominant sampling unit. The first-level virtual sampling strategy is combined with the second-level virtual sampling strategy to generate a virtual sampling strategy.

[0015] Furthermore, historical deviation data from the drug production process is collected, and combined with multi-source data and abnormal risk prediction results, the causal relationships between various production stages are analyzed. Simulation perturbation techniques are then used to define early warning thresholds corresponding to each risk level, including: S31. Collect historical deviation data of environmental data and quality indicators during the drug production process, and establish a dataset by combining multi-source data and abnormal risk prediction results; S32. Using a variable importance ranking algorithm, process variables, environmental factors, and equipment operating parameters related to abnormal risks are selected from the established dataset to construct an associated dataset. S33. Combining Bayesian networks and causal inference algorithms, bidirectional causal mining is performed on the constructed associated dataset to analyze the causal relationships between various production links and generate a risk transmission diagram in the production process. S34. Transform the generated risk transmission diagram into a coupled model, quantify the dynamic impact entropy and functional redundancy of each node through simulation perturbation technology, construct an evaluation matrix, and output the risk assessment results. S35. Based on the output risk assessment results, establish risk linkage rules, and define the early warning thresholds corresponding to each risk level based on the risk linkage rules.

[0016] Furthermore, the generated risk transmission diagram is transformed into a coupled model. The dynamic impact entropy and functional redundancy of each node are quantified using simulation perturbation techniques. An evaluation matrix is ​​constructed, and the risk assessment results are output, including: S341. Based on the generated risk transmission graph, define state variables for each node, and according to the causal relationship between nodes, transform the connecting edges into flow equations in system dynamics to construct a coupled model that simulates the risk propagation process. S342. Apply an initial disturbance of standard units to each node in the risk transmission diagram, and collect the state time series data of each node by running the coupled model within a preset time window. Calculate the total state deviation of each node caused by the initial disturbance using an integral algorithm based on the collected results. S343. Perform S342 on all nodes in the risk transmission diagram, summarize the total state deviation of each node, and calculate the dynamic influence entropy value of each node by combining the time parameters of the disturbance simulation. S344. Using node deletion simulation technology, remove each node from the risk transmission diagram in sequence and calculate the global efficiency after each removal. S345. Based on the calculated global efficiency, calculate the ratio of global efficiency before and after removal to quantify the functional redundancy of each node in the risk transmission diagram. S346. Combining the dynamic impact entropy value and functional redundancy of each node, construct an evaluation matrix, and output the risk assessment results by locating the corresponding nodes of each production link to different quadrants of the evaluation matrix.

[0017] According to another aspect of the present invention, a machine learning-based pharmaceutical process monitoring system is also provided, the system comprising: The correlation feature generation module is used to collect multi-source data, dynamically optimize the contribution weights of each data source, and use a spatiotemporal convolutional neural network to extract dynamic features in the production process and generate correlation features. The anomaly risk prediction module is used to construct a federated transfer learning framework based on the generated correlation features, identify anomaly risks, anomaly risk propagation paths, and anomaly risk ranges in the production process, and construct an anomaly risk prediction model based on the identification results, and output anomaly risk prediction results. The warning threshold definition module is used to collect historical deviation data in the drug production process, combine multi-source data and abnormal risk prediction results, analyze the causal relationship between each production link, and use simulation perturbation technology to define the warning threshold corresponding to each risk level. The optimization and recording module is used to generate a graded emergency response plan by calling a preset emergency map of the drug production process based on the defined early warning threshold, and combining blockchain evidence storage technology and electronic signature to record the monitoring results.

[0018] The beneficial effects of this invention are as follows: 1. This invention collects multi-source data and optimizes the contribution weights of the data sources. It also extracts dynamic features using a spatiotemporal convolutional neural network to comprehensively monitor key parameters in the production process. This not only improves data fusion capabilities but also enhances real-time performance and accuracy, ensuring that key factors in the production process are tracked and controlled in a timely manner.

[0019] 2. By employing a federated transfer learning framework and a deep learning model, this invention can accurately identify abnormal risks in the production process and reveal their propagation paths and ranges. By constructing an abnormal risk prediction model, it can provide early warnings of potential quality problems, predict risk evolution trends, help enterprises take timely measures, reduce possible quality fluctuations in the production process, and ensure stable drug quality.

[0020] 3. This invention defines early warning thresholds and automatically generates tiered emergency response plans by simulating disturbance technology. Combined with blockchain evidence storage and electronic signature recording of monitoring results, it improves the efficiency and transparency of emergency management, ensures the traceability and compliance of data, and strengthens quality control and management in the production process. Attached Figure Description

[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 This is a flowchart of a machine learning-based pharmaceutical process monitoring method according to an embodiment of the present invention; Figure 2 This is a schematic diagram of a machine learning-based pharmaceutical process monitoring system according to an embodiment of the present invention.

[0023] In the picture: 1. Association Feature Generation Module; 2. Anomaly Risk Prediction Module; 3. Early Warning Threshold Definition Module; 4. Optimization and Recording Module. Detailed Implementation

[0024] To further illustrate the various embodiments, the present invention provides accompanying drawings, which are part of the disclosure of the present invention. These drawings are mainly used to illustrate the embodiments and can be used in conjunction with the relevant descriptions in the specification to explain the operating principles of the embodiments. With reference to these drawings, those skilled in the art should be able to understand other possible implementation methods and the advantages of the present invention.

[0025] According to embodiments of the present invention, a method and system for monitoring pharmaceutical processes based on machine learning are provided.

[0026] The present invention will now be further described in conjunction with the accompanying drawings and specific embodiments, such as... Figure 1 As shown, according to an embodiment of the present invention, a machine learning-based pharmaceutical process monitoring method includes: S1. Collect data from multiple sources, dynamically optimize the contribution weights of each data source, and use a spatiotemporal convolutional neural network to extract dynamic features in the production process and generate related features.

[0027] In this optional embodiment, multi-source data is collected, the contribution weights of each data source are dynamically optimized, and a spatiotemporal convolutional neural network is used to extract dynamic features in the production process to generate associated features, including: S11. Collect and preprocess multi-source data from each stage of the drug production process, construct a real-time streaming framework based on the preprocessing results, and combine a deep learning-driven adaptive fusion mechanism to identify the characteristics of different data sources in order to dynamically optimize the contribution weight of each data source. S12. Based on the dynamic optimization results of contribution weights, the adaptive variational mode decomposition technique is used to perform multi-level time-frequency decomposition on multi-source data to separate feature components at different frequency scales. S13. Use a spatiotemporal convolutional neural network to capture the local correlation and evolution pattern of feature components in time and space dimensions, and extract dynamic features that reflect production process fluctuations, environmental changes and equipment operating status based on the capture results. S14. Based on the extracted dynamic features, construct a production flow chart, and integrate multi-head self-attention mechanism and graph neural network to analyze the nonlinear correlation and spatial dependency between each production link in the production flow chart, and generate correlation features for process monitoring.

[0028] It should be further explained that the process of collecting data from multiple sources, dynamically optimizing the contribution weights of each data source, and using a spatiotemporal convolutional neural network to extract dynamic features in the production process and generate correlated features specifically includes: Multiple types of sensors and edge acquisition devices are deployed in the pharmaceutical manufacturing process to collect key process parameters such as temperature, humidity, pressure, flow rate, stirring speed, and pH value, with a data frequency of up to 1Hz. Structured and unstructured data from MES, LIMS, and SCADA systems are integrated. After preprocessing the collected multi-source data, including denoising, missing value imputation, and format standardization, a data streaming access framework supporting Kafka or Flume is constructed to ensure data flows into the processing pipeline with low latency (<200ms). A deep learning-driven adaptive fusion mechanism is introduced, such as a fusion network based on attention weight allocation, to identify the characteristics of different data sources, such as stability, response latency, and information gain, and to process data in real time. The contribution weights of each data source are dynamically adjusted. Based on the dynamic weight results, an adaptive variational mode decomposition algorithm is used to decompose the data into multiple time-frequency components. For example, the 1–100Hz frequency band is decomposed into 5 sub-bands, and low-frequency trend terms and high-frequency disturbance terms are extracted respectively. A spatiotemporal convolutional neural network is used to extract multi-level convolutional features within a 10-second sliding window to identify abnormal dynamic features caused by equipment aging or environmental changes. The extracted dynamic features are mapped to a structured production flow chart. A heterogeneous graph structure is constructed with process units as nodes and process sequence as edges. A multi-head self-attention mechanism and graph neural network are introduced to perform feature propagation and graph enhancement analysis, revealing the complex nonlinear process coupling relationship and spatial dependence between each link, and generating associated features.

[0029] S2. Based on the generated association features, construct a federated transfer learning framework to identify abnormal risks, abnormal risk propagation paths, and abnormal risk ranges in the production process. Based on the identification results, construct an abnormal risk prediction model and output the abnormal risk prediction results.

[0030] In this optional embodiment, a federated transfer learning framework is constructed based on the generated association features to identify abnormal risks, abnormal risk propagation paths, and abnormal risk ranges in the production process. An abnormal risk prediction model is then constructed based on the identification results, and the output abnormal risk prediction results include: S21. Based on the generated association features, a federated transfer learning framework is constructed using a parallel homomorphic encryption mechanism, and the federated transfer learning framework is trained and optimized by combining association features and gradient selection algorithm.

[0031] It should be further explained that, based on the generated association features, a federated transfer learning framework is constructed using a parallel homomorphic encryption mechanism, and the federated transfer learning framework is trained and optimized by combining association features and gradient selection algorithms. Specifically, this includes: Based on the generated associated features, a federated transfer learning framework under a parallel homomorphic encryption mechanism is constructed. In this framework, each data source (such as different production lines or factories) protects its local data through homomorphic encryption to ensure privacy is not compromised. Simultaneously, data training and encrypted computation are completed locally, with only the encrypted gradient information uploaded to the central server. Homomorphic encryption allows computation directly on the ciphertext, ensuring data security during training. The central server aggregates the encrypted gradients uploaded by each participant through the federated learning mechanism and efficiently updates the global model using parallel computing, achieving cross-regional and cross-system collaborative learning. Combined with a gradient selection algorithm, the importance of gradients from different data sources is evaluated, and key data sources are given higher weights. For example, when the characteristics of a certain production link have a particularly significant impact on process fluctuations, its gradient will occupy a larger proportion in the global update. This not only enables efficient data utilization while protecting privacy but also significantly improves the training efficiency and accuracy of the model.

[0032] S22. Based on the optimized federated transfer learning framework, identify abnormal risks, abnormal risk propagation paths, and abnormal risk intervals in the production process, and integrate the correlation features of each production link based on the identification results to establish an abnormal risk transmission domain.

[0033] It should be further explained that, in specific embodiments, fluctuations in temperature and humidity, equipment failures, or process deviations during production may lead to fluctuations in product quality. These fluctuations can be transmitted to each other through different stages, forming abnormal risk propagation paths. By deeply exploring the causal relationships and dynamic characteristics between each stage, an abnormal risk transmission domain can be constructed. This domain covers the nonlinear correlations and spatial dependencies between each production stage, thereby enabling more accurate prediction and identification of potential abnormal risks in the production process and their transmission methods.

[0034] In this optional embodiment, based on the optimized federated transfer learning framework, abnormal risks, abnormal risk propagation paths, and abnormal risk intervals in the production process are identified. Based on the identification results, the correlation features of each production stage are integrated to establish an abnormal risk transmission domain, including: S221. Identify abnormal risks in the production process based on the optimized federated transfer learning framework and long short-term memory network.

[0035] S222. Based on the identified abnormal risks, combine the production flow chart and Bayesian network to calculate the probability of abnormal risks in each production link, and analyze the temporal evolution trend of the probability of abnormal risks in order to deduce the abnormal risk propagation path in the production flow chart.

[0036] S223. Using sensitivity analysis algorithms, assess the relative contribution of each associated feature to drug quality, construct a production process model, optimize the sampling process in the production process model, and generate abnormal risk intervals for drug quality.

[0037] In this optional embodiment, a sensitivity analysis algorithm is used to evaluate the relative contribution of each associated feature to drug quality, construct a production process model, optimize the sampling process in the production process model, and generate abnormal risk intervals for drug quality, including: S2231. Using sensitivity analysis algorithms, assess the nonlinear impact of correlation features on quality indicators in each production stage, and combine with a pre-set deep learning regression model to identify and quantify the relative contribution of each correlation feature to drug quality.

[0038] S2232. Based on the relative contribution of each associated feature, construct a production process model and optimize the sampling process in the production process model to obtain sampling data in the production scenario.

[0039] In this optional embodiment, a production process model is constructed based on the relative contribution of each associated feature, and the sampling process in the production process model is optimized to obtain sampling data in the production scenario, including: S22321. Based on the relative contribution of each associated feature, a production process model is constructed using digital twin technology, and each sampling unit in the production process model is sorted according to its relative contribution.

[0040] S22322. The sampling process is iteratively optimized using an evolutionary strategy. Combining the current optimization progress with the sorting results of the sampling units, the sampling units are divided into primary sampling regions and secondary sampling regions according to a preset linear ratio. Differentiated virtual sampling strategies are then implemented for different sampling regions to obtain virtual sampling data.

[0041] In this optional embodiment, the virtual sampling strategy includes: An initial sampling unit is selected within the first-level sampling region. An interactive learning mechanism is used to interactively learn between the initial sampling unit and its neighboring sampling units in the lower-level sampling region, as well as other randomly selected sampling units. A first-level virtual sampling strategy is generated based on the interactive learning results. Several candidate sampling units are randomly selected within the secondary sampling region, and the candidate sampling unit with the best relative contribution is selected as the dominant sampling unit. A secondary virtual sampling strategy is generated based on the dominant sampling unit. The first-level virtual sampling strategy is combined with the second-level virtual sampling strategy to generate a virtual sampling strategy.

[0042] S22323: Using virtual sampling data as prior knowledge to guide pre-deployed sensors to perform physical sampling during the production process and obtain sampling data in the production scenario.

[0043] S2233. Perform statistical analysis on the sampled data and use the uncertainty propagation algorithm to quantify the fluctuation range of the sampled data to generate the abnormal risk range of drug quality.

[0044] S224. Based on the abnormal risks, the abnormal risk propagation paths, and the abnormal risk ranges, integrate the correlation characteristics of each production link to establish an abnormal risk transmission domain.

[0045] S23. Using the abnormal risk transmission domain as the sample label and the collected multi-source data as input, construct an abnormal risk prediction model based on a multilayer perceptron and output the abnormal risk prediction results.

[0046] It should be further explained that a multilayer perceptron is a neural network model with multiple hidden layers, which learns the complex nonlinear relationship between input features and output through forward and backward propagation algorithms. In this invention, the anomaly risk prediction model can capture the deep nonlinear correlation between different production stages, equipment operating states, and quality indicators, thereby effectively predicting anomaly risks at a future moment. For example, the model can analyze historical data and current production conditions to predict that key factors such as temperature, humidity, and pressure may cause equipment failures or quality problems in the future. By predicting these potential risks in advance, the model can output anomaly risk warnings to help operators take timely preventive measures, thereby avoiding potential problems in the production process, reducing potential losses and waste, and improving production efficiency and quality control levels.

[0047] S3. Collect historical deviation data in the drug production process, combine multi-source data with abnormal risk prediction results, analyze the causal relationship between each production link, and use simulation perturbation technology to define the early warning threshold corresponding to each risk level.

[0048] In this optional embodiment, historical deviation data during the drug production process is collected, and combined with multi-source data and abnormal risk prediction results, the causal relationships between various production stages are analyzed. Simulation perturbation technology is then used to define early warning thresholds corresponding to each risk level, including: S31. Collect historical deviation data of environmental data and quality indicators during the drug production process, and establish a dataset by combining multi-source data and abnormal risk prediction results.

[0049] It should be further explained that environmental data, including temperature, humidity, pressure, flow rate, and equipment operating status, as well as historical deviation data of quality indicators, are collected from the drug production process. These data include monthly average temperature deviations and vibration data when equipment malfunctions. These data come from different sensors, production equipment, and historical production records. After preprocessing and cleaning, they are combined with real-time multi-source data and abnormal risk prediction results to establish a comprehensive dataset. This dataset not only includes normal data during the production process but also records of multiple abnormal situations, enabling subsequent model training to cover various scenarios.

[0050] S32. Using a variable importance ranking algorithm, process variables, environmental factors, and equipment operating parameters related to abnormal risks are selected from the established dataset to construct an associated dataset.

[0051] It should be further explained that variable importance ranking algorithms, such as feature selection methods based on random forests, are used to screen out key process variables, environmental factors, and equipment operating parameters related to abnormal risks from the established dataset. For example, temperature changes, pressure fluctuations, or equipment aging in a certain production process can have a significant impact on quality indicators. After ranking, features that have an important impact on risk are extracted to form an associated dataset for subsequent modeling and analysis.

[0052] S33. Combining Bayesian networks and causal inference algorithms, bidirectional causal mining is performed on the constructed associated dataset to analyze the causal relationships between various production links and generate a risk transmission diagram in the production process.

[0053] It should be added that Bayesian network analysis can reveal how temperature changes affect equipment performance, thereby affecting the final drug quality, and generate a clear production process risk transmission diagram. Each node represents a production link or environmental factor, and the edges between nodes represent causal dependencies. This can help identify which links have a significant impact on the transmission of risks in the production process and reveal the implicit connections between links.

[0054] S34. Transform the generated risk transmission diagram into a coupled model, quantify the dynamic impact entropy and functional redundancy of each node through simulation perturbation technology, construct an evaluation matrix, and output the risk assessment results.

[0055] In this optional embodiment, the generated risk transmission diagram is transformed into a coupled model. The dynamic impact entropy and functional redundancy of each node are quantified using simulated perturbation techniques. An evaluation matrix is ​​constructed, and the risk assessment results are output, including: S341. Based on the generated risk transmission graph, define state variables for each node, and according to the causal relationship between nodes, transform the connecting edges into flow equations in system dynamics to construct a coupled model that simulates the risk propagation process. S342. Apply an initial disturbance of standard units to each node in the risk transmission diagram, and collect the state time series data of each node by running the coupled model within a preset time window. Calculate the total state deviation of each node caused by the initial disturbance using an integral algorithm based on the collected results. S343. Perform S342 on all nodes in the risk transmission diagram, summarize the total state deviation of each node, and calculate the dynamic influence entropy value of each node by combining the time parameters of the disturbance simulation. S344. Using node deletion simulation technology, remove each node from the risk transmission diagram in sequence and calculate the global efficiency after each removal. S345. Based on the calculated global efficiency, calculate the ratio of global efficiency before and after removal to quantify the functional redundancy of each node in the risk transmission diagram. S346. Combining the dynamic impact entropy value and functional redundancy of each node, construct an evaluation matrix, and output the risk assessment results by locating the corresponding nodes of each production link to different quadrants of the evaluation matrix.

[0056] It should be further explained that the dynamic impact entropy value can measure the information contribution of each production link in the risk propagation process, while the functional redundancy measure the redundancy backup capability of a node in the entire system. These quantitative indicators are comprehensively analyzed by constructing an evaluation matrix to output the risk assessment results. The different quadrants of the evaluation matrix include: Quadrant I (High Impact Entropy, Low Redundancy): Critical bottleneck area, highest priority risk, requiring immediate implementation of redundant design (e.g., backup equipment, alternative processes) and enhanced monitoring; Quadrant II (High Impact Entropy, High Redundancy): Core risk source area, key monitoring area, requiring the use of its high redundancy to establish a buffer mechanism to prevent frequent risk occurrences; Quadrant III (Low Impact Entropy, Low Redundancy): System vulnerability area, potential risk amplification area, requiring enhanced reliability of this link to prevent small risks from evolving into major accidents due to system vulnerability; Quadrant IV (Low Impact Entropy, High Redundancy): Stable operation area, routine monitoring is sufficient.

[0057] S35. Based on the output risk assessment results, establish risk linkage rules, and define early warning thresholds corresponding to each risk level based on the risk linkage rules.

[0058] It should be further explained that the risk levels include low, medium, high, and very high. The risk linkage rule refers to the fact that in the drug production process, when the causal relationship between different variables is clear and their influence is mutually transmitted, when a certain key variable triggers a risk signal, the system will automatically link its related variables for synchronous judgment and response. For example, when the equipment vibration intensity exceeds a set threshold (e.g., >5mm / s) and the temperature fluctuation is synchronously abnormal, it is judged as a high-risk level, and the downstream control parameters are dynamically adjusted and the abnormality confirmation process is triggered. Another example is that when the ambient humidity is consistently higher than 60% and the product moisture content deviates from the standard range, the air purification and batch isolation procedures are initiated.

[0059] S4. Based on the defined early warning threshold, call the preset emergency map of the drug production process, generate a graded emergency response plan, and combine blockchain evidence storage technology with electronic signature to record the monitoring results.

[0060] It should be further explained that the emergency map of the drug production process combines expert knowledge with historical emergency response experience, covering common production anomaly scenarios such as critical equipment failure, environmental anomalies, and parameter drift. When a warning threshold is triggered, the system will automatically match the corresponding emergency strategy template based on the map and generate a tiered emergency handling plan. For example, in high-risk situations, the system will immediately implement batch isolation, suspend production, and urgently notify the quality control team, while simultaneously initiating a risk backtracking mechanism for traceability analysis. In addition, to ensure the traceability and compliance of the entire monitoring and emergency response process, the system uploads all trigger records, response instructions, and execution results to the blockchain in real time for tamper-proof storage and uses electronic signature technology to bind the operator's identity, ensuring the authenticity, completeness, and legal validity of the records.

[0061] like Figure 2 As shown, according to another embodiment of the present invention, a pharmaceutical process monitoring system based on machine learning is also provided, the system comprising: The associated feature generation module 1 is used to collect multi-source data, dynamically optimize the contribution weights of each data source, and use a spatiotemporal convolutional neural network to extract dynamic features in the production process and generate associated features. The anomaly risk prediction module 2 is used to construct a federated transfer learning framework based on the generated correlation features, identify anomaly risks, anomaly risk propagation paths and anomaly risk ranges in the production process, and construct an anomaly risk prediction model based on the identification results, and output anomaly risk prediction results. The warning threshold definition module 3 is used to collect historical deviation data in the drug production process, combine multi-source data and abnormal risk prediction results, analyze the causal relationship between each production link, and use simulation perturbation technology to define the warning threshold corresponding to each risk level. The optimization and recording module 4 is used to call the preset emergency map of the drug production process based on the defined early warning threshold, generate a graded emergency response plan, and combine blockchain evidence storage technology and electronic signature to record the monitoring results.

[0062] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for monitoring pharmaceutical processes based on machine learning, characterized in that, The method includes: S1. Collect data from multiple sources, dynamically optimize the contribution weights of each data source, and use a spatiotemporal convolutional neural network to extract dynamic features in the production process and generate related features. S2. Based on the generated association features, construct a federated transfer learning framework to identify abnormal risks, abnormal risk propagation paths, and abnormal risk ranges in the production process. Based on the identification results, construct an abnormal risk prediction model and output the abnormal risk prediction results. S3. Collect historical deviation data in the drug production process, combine multi-source data and abnormal risk prediction results, analyze the causal relationship between each production link, and use simulation perturbation technology to define the early warning threshold corresponding to each risk level. S4. Based on the defined early warning threshold, call the preset emergency map of the drug production process, generate a graded emergency response plan, and combine blockchain evidence storage technology with electronic signature to record the monitoring results.

2. The pharmaceutical process monitoring method based on machine learning according to claim 1, characterized in that, The process of collecting multi-source data, dynamically optimizing the contribution weights of each data source, and using a spatiotemporal convolutional neural network to extract dynamic features in the production process and generate associated features includes: S11. Collect and preprocess multi-source data from each stage of the drug production process, construct a real-time streaming framework based on the preprocessing results, and combine a deep learning-driven adaptive fusion mechanism to identify the characteristics of different data sources in order to dynamically optimize the contribution weight of each data source. S12. Based on the dynamic optimization results of contribution weights, the adaptive variational mode decomposition technique is used to perform multi-level time-frequency decomposition on multi-source data to separate feature components at different frequency scales. S13. Use a spatiotemporal convolutional neural network to capture the local correlation and evolution pattern of feature components in time and space dimensions, and extract dynamic features that reflect production process fluctuations, environmental changes and equipment operating status based on the capture results. S14. Based on the extracted dynamic features, construct a production flow chart, and integrate multi-head self-attention mechanism and graph neural network to analyze the nonlinear correlation and spatial dependency between each production link in the production flow chart, and generate correlation features for process monitoring.

3. The pharmaceutical process monitoring method based on machine learning according to claim 1, characterized in that, The process involves constructing a federated transfer learning framework based on the generated association features to identify abnormal risks, abnormal risk propagation paths, and abnormal risk ranges in the production process. Based on the identification results, an abnormal risk prediction model is built, and the output abnormal risk prediction results include: S21. Based on the generated association features, a federated transfer learning framework is constructed using a parallel homomorphic encryption mechanism, and the federated transfer learning framework is trained and optimized by combining association features and gradient selection algorithm. S22. Based on the optimized federated transfer learning framework, identify abnormal risks, abnormal risk propagation paths, and abnormal risk intervals in the production process, and integrate the correlation features of each production link based on the identification results to establish an abnormal risk transmission domain. S23. Using the abnormal risk transmission domain as the sample label and the collected multi-source data as input, construct an abnormal risk prediction model based on multilayer perceptron and output the abnormal risk prediction results.

4. The pharmaceutical process monitoring method based on machine learning according to claim 3, characterized in that, The process of identifying abnormal risks, their propagation paths, and risk ranges in the production process based on the optimized federated transfer learning framework, and then integrating the correlation features of each production stage based on the identification results to establish an abnormal risk transmission domain, includes: S221. Identify abnormal risks in the production process based on the optimized federated transfer learning framework and long short-term memory network. S222. Based on the identified abnormal risks, combined with the production flow chart and Bayesian network, calculate the probability of abnormal risks in each production link, and analyze the temporal evolution trend of the probability of abnormal risks in order to deduce the abnormal risk propagation path in the production flow chart. S223. Using sensitivity analysis algorithms, assess the relative contribution of each associated feature to drug quality, construct a production process model, optimize the sampling process in the production process model, and generate abnormal risk intervals for drug quality. S224. Based on the abnormal risks, the abnormal risk propagation paths, and the abnormal risk ranges, integrate the correlation characteristics of each production link to establish an abnormal risk transmission domain.

5. The pharmaceutical process monitoring method based on machine learning according to claim 4, characterized in that, The process of using sensitivity analysis algorithms to assess the relative contribution of each associated feature to drug quality, constructing a production process model, optimizing the sampling process in the production process model, and generating abnormal risk intervals for drug quality includes: S2231. Using sensitivity analysis algorithms, assess the nonlinear impact of correlation features on quality indicators in each production stage, and combine with a pre-set deep learning regression model to identify and quantify the relative contribution of each correlation feature to drug quality. S2232. Based on the relative contribution of each associated feature, construct a production process model and optimize the sampling process in the production process model to obtain sampling data in the production scenario. S2233. Perform statistical analysis on the sampled data and use the uncertainty propagation algorithm to quantify the fluctuation range of the sampled data to generate the abnormal risk range of drug quality.

6. The pharmaceutical process monitoring method based on machine learning according to claim 5, characterized in that, The process of constructing a production process model based on the relative contribution of each associated feature, and optimizing the sampling process in the production process model to obtain sampling data in the production scenario includes: S22321. Based on the relative contribution of each associated feature, a production process model is constructed using digital twin technology, and each sampling unit in the production process model is sorted according to its relative contribution. S22322. The sampling process is iteratively optimized using an evolutionary strategy. Combining the current optimization progress with the sorting results of the sampling units, the sampling units are divided into primary sampling regions and secondary sampling regions according to a preset linear ratio. Differentiated virtual sampling strategies are then implemented for different sampling regions to obtain virtual sampling data. S22323: Using virtual sampling data as prior knowledge to guide pre-deployed sensors to perform physical sampling during the production process and obtain sampling data in the production scenario.

7. A pharmaceutical process monitoring method based on machine learning according to claim 6, characterized in that, The virtual sampling strategy includes: An initial sampling unit is selected within the first-level sampling region. An interactive learning mechanism is used to interactively learn with the adjacent sampling units in the lower-level sampling region and other randomly selected sampling units. A first-level virtual sampling strategy is generated based on the interactive learning results. Several candidate sampling units are randomly selected within the secondary sampling region, and the candidate sampling unit with the best relative contribution is selected as the dominant sampling unit. A secondary virtual sampling strategy is generated based on the dominant sampling unit. The first-level virtual sampling strategy is combined with the second-level virtual sampling strategy to generate a virtual sampling strategy.

8. The pharmaceutical process monitoring method based on machine learning according to claim 1, characterized in that, The process of collecting historical deviation data during drug production, combining multi-source data with abnormal risk prediction results, analyzes the causal relationships between various production stages, and uses simulation perturbation technology to define early warning thresholds corresponding to each risk level, including: S31. Collect historical deviation data of environmental data and quality indicators during the drug production process, and establish a dataset by combining multi-source data and abnormal risk prediction results; S32. Using a variable importance ranking algorithm, process variables, environmental factors, and equipment operating parameters related to abnormal risks are selected from the established dataset to construct an associated dataset. S33. Combining Bayesian networks and causal inference algorithms, bidirectional causal mining is performed on the constructed associated dataset to analyze the causal relationships between various production links and generate a risk transmission diagram in the production process. S34. Transform the generated risk transmission diagram into a coupled model, quantify the dynamic impact entropy and functional redundancy of each node through simulation perturbation technology, construct an evaluation matrix, and output the risk assessment results. S35. Based on the output risk assessment results, establish risk linkage rules, and define the early warning thresholds corresponding to each risk level based on the risk linkage rules.

9. A pharmaceutical process monitoring method based on machine learning according to claim 8, characterized in that, The process involves converting the generated risk transmission diagram into a coupled model, quantifying the dynamic impact entropy and functional redundancy of each node using simulation perturbation techniques, constructing an evaluation matrix, and outputting risk assessment results, including: S341. Based on the generated risk transmission graph, define state variables for each node, and according to the causal relationship between nodes, transform the connecting edges into flow equations in system dynamics to construct a coupled model that simulates the risk propagation process. S342. Apply an initial disturbance of standard units to each node in the risk transmission diagram, and collect the state time series data of each node by running the coupled model within a preset time window. Calculate the total state deviation of each node caused by the initial disturbance using an integral algorithm based on the collected results. S343. Perform S342 on all nodes in the risk transmission diagram, summarize the total state deviation of each node, and calculate the dynamic influence entropy value of each node by combining the time parameters of the disturbance simulation. S344. Using node deletion simulation technology, remove each node from the risk transmission diagram in sequence and calculate the global efficiency after each removal. S345. Based on the calculated global efficiency, calculate the ratio of global efficiency before and after removal to quantify the functional redundancy of each node in the risk transmission diagram. S346. Combining the dynamic impact entropy value and functional redundancy of each node, construct an evaluation matrix, and output the risk assessment results by locating the corresponding nodes of each production link to different quadrants of the evaluation matrix.

10. A machine learning-based pharmaceutical process monitoring system, used to implement the machine learning-based pharmaceutical process monitoring method according to any one of claims 1-9, characterized in that, The system includes: The correlation feature generation module is used to collect multi-source data, dynamically optimize the contribution weights of each data source, and use a spatiotemporal convolutional neural network to extract dynamic features in the production process and generate correlation features. The anomaly risk prediction module is used to construct a federated transfer learning framework based on the generated correlation features, identify anomaly risks, anomaly risk propagation paths, and anomaly risk ranges in the production process, and construct an anomaly risk prediction model based on the identification results, and output anomaly risk prediction results. The warning threshold definition module is used to collect historical deviation data in the drug production process, combine multi-source data and abnormal risk prediction results, analyze the causal relationship between each production link, and use simulation perturbation technology to define the warning threshold corresponding to each risk level. The optimization and recording module is used to generate a graded emergency response plan by calling a preset emergency map of the drug production process based on the defined early warning threshold, and combining blockchain evidence storage technology and electronic signature to record the monitoring results.