A pharmaceutical production data processing system and method based on data mining
By constructing a preprocessing model for pharmaceutical production characteristics and optimizing multi-layer perceptron model, the problem of quality control relies on manual experience in traditional pharmaceutical production is solved, and intelligent monitoring of the pharmaceutical production process and quality stability and controllability are achieved.
Patent Information
- Application Number
- CN202510252127.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-05
- Publication Date
- 2025-04-04
AI Technical Summary
In traditional pharmaceutical production processes, quality control relies on manual experience and post-event testing, making it difficult to achieve real-time monitoring and prediction adjustments. At the same time, data preprocessing methods cannot fully adapt to the complexity and diversity of pharmaceutical production.
By constructing a preprocessing model for pharmaceutical production characteristics data, removing outliers, filling missing values and normalizing them, combining with particle swarm algorithms to optimize the multi-layer perceptron model, efficient preprocessing and model training of pharmaceutical production data is achieved.
It improves the stability and controllability of product quality, realizes intelligent monitoring and adjustment of the production process, reduces the complexity of manual parameter adjustment, and improves the learning efficiency and prediction performance of the model.
Smart Images

Figure CN119761922A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of data processing, and in particular, relates to a pharmaceutical production data processing system and method based on data mining. Background Art
[0002] With the rapid development of the modern pharmaceutical industry, the stability and controllability of product quality have become key factors in corporate competition. In the pharmaceutical production process, equipment characteristics such as reactor temperature, stirring speed, pressure, and environmental characteristics such as workshop temperature, humidity, and cleanliness have an important impact on the quality characteristics of the final product, such as purity and impurity content. However, traditional quality control methods often rely on manual experience and post-testing, making it difficult to achieve real-time monitoring and predictive adjustment of the production process.
[0003] In addition, the data generated during the pharmaceutical production process often have problems such as outliers and missing values. How to effectively preprocess this data and extract useful features is also the key to building an accurate prediction model; traditional data preprocessing methods cannot fully adapt to the complexity and diversity of pharmaceutical production. Summary of the invention
[0004] 1. Technical issues to be resolved In response to the problems in the related technology, the present invention provides a pharmaceutical production data processing method based on data mining. The present invention solves the problems of quality control relying on manual experience, post-testing and inaccurate data in the traditional pharmaceutical production process through data processing and training of deep learning models, effectively improves the stability and controllability of product quality, and realizes intelligent monitoring and adjustment of the production process.
[0005] (II) Technical solution In order to solve the above technical problems, the present invention is achieved through the following technical solutions: S1. Construct a preprocessing model for pharmaceutical production characteristic data; S2, extracting historical pharmaceutical production characteristic data processed by the pharmaceutical production characteristic data preprocessing model from the database, and constructing a historical pharmaceutical production process characteristic data matrix and a product quality label matrix; S3, constructing an initial multilayer perceptron model and setting relevant parameters, using a particle swarm algorithm combined with a historical pharmaceutical production process feature data matrix and a product quality label matrix, training, testing, and optimizing the initial multilayer perceptron model, adjusting the parameters of the initial multilayer perceptron model, and obtaining a final multilayer perceptron model; S4, collect real-time pharmaceutical production process characteristic data and predict product quality based on the final multi-layer sensor model; Preferably, the S1 comprises the following steps: S11. Collect pharmaceutical production equipment data, pharmaceutical production environment data and quality inspection data, extract features, and obtain pharmaceutical production feature data set ,in a i Represents the pharmaceutical production feature dataset i feature data, m Indicates the total number of features in the pharmaceutical production feature data set; pharmaceutical production equipment features include reactor temperature, stirring speed, pressure, etc., pharmaceutical production environment feature data include workshop temperature, humidity, cleanliness, etc., and product quality feature data include purity, impurity content, etc.; S12. Pharmaceutical production feature dataset Remove outliers to obtain the pharmaceutical production feature data set after removal c ; S13. Pharmaceutical production feature dataset after removal Filling missing values to obtain a filled pharmaceutical production feature data set, normalizing the filled pharmaceutical production feature data set to obtain a preprocessed pharmaceutical production feature data set after preprocessing; The above steps collect pharmaceutical production equipment data, environmental data and quality inspection data, extract features to form a data set, and then remove outliers, fill in missing values and normalize them to build a model for preprocessing pharmaceutical production data, which can effectively improve the quality and availability of data.
[0006] Preferably, the S12 comprises the following steps: S121. According to the specific characteristics, production conditions and process requirements, adjust the abnormal coefficient to b ; S122, when m When +1 is an integer multiple of 4, Q 1=No. feature data, Q 3=No. Characteristic data; when m When +1 is not an integer multiple of 4, Q 1= The average value of two adjacent feature data. Q 3= The average value of two adjacent feature data. Q 1 represents the first quartile, Q 3 represents the third quartile; S123, , IOR represents the interquartile range, , , R1 represents the upper bound, R 2 represents the lower bound; traverse the pharmaceutical production feature data set The production feature data in the pharmaceutical production feature dataset is marked as outliers, and the values less than the lower bound or greater than the upper bound are removed from the pharmaceutical production feature dataset to obtain the pharmaceutical production feature dataset after removal. ;in c i Represents the first i feature data, p Represents the total number of features in the pharmaceutical production feature dataset after removing outliers; The above steps can effectively purify the pharmaceutical production characteristic data set and ensure the accuracy of the data set by setting the abnormal coefficient according to the specific pharmaceutical production characteristic data, calculating the quartiles and interquartile ranges, and identifying and removing outliers based on these statistics.
[0007] Preferably, the S13 comprises the following steps: S131. Calculate the mean of all feature data in the removed pharmaceutical production feature data set to obtain the mean d , the formula is as follows, ; S132, the pharmaceutical production feature dataset after removal Fill in the missing data points in the dataset to obtain the filled pharmaceutical production feature dataset ,in e i Represents the filled pharmaceutical production feature dataset. i Characteristic data; S133, set the zoom ratio to f , extract the filled pharmaceutical production feature dataset The smallest feature data e min , the largest feature data e max ; S134, the filled pharmaceutical production feature dataset Each feature data in is scaled to obtain the preprocessed pharmaceutical production feature data set ;in g i Represents the first i feature data; the scaling formula is as follows, ; The above steps ensure the integrity and continuity of the data set by calculating the mean to fill in the missing data; The consistency and comparability of the data were achieved by setting the scaling factor and scaling the data; these steps effectively eliminated dimensional differences and enhanced the comparability between feature data.
[0008] Preferably, S2 comprises the following steps: S21. Preprocess all feature data in the pharmaceutical production data in combination with the pharmaceutical production feature data preprocessing model to obtain preprocessed data, store the preprocessed data in a database, and classify and label the data by product batch and date; S22. Extract the production equipment characteristic data and production environment data from the historical pharmaceutical production characteristic data from the database according to the product batch, and construct a historical pharmaceutical production process characteristic data matrix A ,as follows, ; in, A ih Represents the first i Batch of products h Production process characteristic data, n Represents the total number of product batches in the historical production process characteristic data matrix; S23. Extract production quality characteristic data from historical pharmaceutical production characteristic data from the database and construct a product quality label matrix B ,as follows, ; in, B ik Represents the historical pharmaceutical production process characteristic data matrix i Batch of products k Product quality label data, k Indicates the total number of product quality labels for each batch of products; The above steps standardize the pharmaceutical production data in combination with the preprocessing model and store it in the database, and classify and label it by product batch and date, which can effectively organize and manage a large amount of production data and improve the efficiency of data retrieval and analysis; further, by extracting historical production equipment characteristic data and production environment data to construct a characteristic data matrix, and extracting product quality characteristic data to construct a quality label matrix, it provides data support for subsequent data analysis, model training and product quality prediction, which helps to achieve refined management of the pharmaceutical production process, continuous improvement of product quality and scientific decision-making.
[0009] Preferably, S3 comprises the following steps: S31, construct an initial multilayer perceptron model, and set the training ratio and test ratio of the initial multilayer perceptron model to r 1. r 2. Set the training accuracy threshold to u 1. The test accuracy threshold is v ; S32. According to the training ratio and test ratio of the initial multilayer perceptron model, r 1. r 2. Divide the historical pharmaceutical production process feature data matrix into a historical pharmaceutical production process feature data training matrix and a historical pharmaceutical production process feature data test matrix, and divide the product quality label matrix into a product quality training label matrix and a product quality test label matrix; S33, using a particle swarm algorithm in combination with the historical pharmaceutical production process characteristic data training matrix and the product quality training label matrix to train the initial multilayer perceptron model, adjusting the number of hidden layers, the number of neurons, and the learning rate of the initial multilayer perceptron model to obtain a trained multilayer perceptron model; S34, testing the trained multilayer perceptron model, and obtaining the final multilayer perceptron model after the test optimization is completed; The above steps ensure the rationality and effectiveness of model training and verification by constructing the initial multilayer perceptron model and setting the training and testing ratios as well as the accuracy threshold. The model is optimized using the particle swarm algorithm to adjust the number of hidden layers, the number of neurons and the learning rate, which significantly improves the performance and generalization ability of the model. The final multilayer perceptron model obtained through test verification can more accurately predict product quality.
[0010] Preferably, the S33 comprises the following steps: S331, construct a particle swarm; set the size of the particle swarm to C , then the particle group is expressed as ,in D i represents the particle swarm i particles, each particle represents a parameter combination of the number of hidden layers, the number of neurons and the learning rate; the maximum number of training iterations is set to w ; S332, randomly generate the initial position set of the particle swarm ; F i1 , F i2 and F i3 Respectively represent the number of particles in the iThe first dimension coordinates, second dimension coordinates and third dimension coordinates of the initial position of each particle, the first dimension coordinates, second dimension coordinates and third dimension coordinates represent the number of hidden layers, the number of neurons and the learning rate respectively; Initialize the particle speed ,in E i Indicates i The speed of each particle; initialize the optimal position of each particle ,in H i Indicates i The best position reached by each particle; Initialize the global best position K for H Any position in S333. For each particle, update the speed ,in t Indicates the current moment, t +1 means the next moment, L is the inertia weight, c 1 and c 2 is the learning factor, r 1 and r 2 is a random number in the range of 0 to 1, yes t Moment i The best position that a particle can reach is yes t Moment i The global optimal position reached by each particle; Update Location , the updated position is used as the new parameter combination of the number of hidden layers, the number of neurons, and the learning rate. The updated parameter combination of the number of hidden layers, the number of neurons, and the learning rate is used to train the initial multilayer perceptron model and evaluate the training accuracy of the multilayer perceptron model. If the updated position The training accuracy of the multilayer perceptron model is higher than , then update H i If the new position The training accuracy of the multilayer perceptron model is no higher than , keep the original F i ; at the time t +1, traverse the historical best positions of all particles F i , and select the position with the highest training accuracy of the multilayer perceptron model as the new global optimal position ; S334, repeat S332, S333, when the training accuracy of the multilayer perceptron model is ≥ the training accuracy threshold u 1 or the number of iterations reaches w When , the iteration process is stopped, and the parameter combination of the number of hidden layers, the number of neurons, and the learning rate corresponding to the global optimal position is output to obtain the trained multilayer perceptron model; The above steps construct a particle swarm and set its parameters such as size and maximum number of training iterations, and use the optimization mechanism of the particle swarm algorithm to efficiently search and adjust the number of hidden layers, number of neurons and learning rate of the multilayer perceptron model; by randomly generating the initial position, initialization speed and optimal position, and iteratively updating the speed and position of the particles, the model parameter combination is continuously optimized until the preset training accuracy threshold or maximum number of iterations is reached; the training efficiency and performance of the multilayer perceptron model are effectively improved, and the prediction accuracy and stability of the model in the pharmaceutical production process are ensured.
[0011] Preferably, the S34 comprises the following steps: S341, inputting the input into the trained multilayer perceptron model for testing to obtain a test output result, and comparing the test output result with the product quality test label matrix to obtain the test accuracy; S342, when the test accuracy ≥ v , using the trained multilayer perceptron model as the final multilayer perceptron model; S343, when the test accuracy < v When , the maximum number of iterations in the particle swarm algorithm is increased, and the increased maximum number of iterations is x ; S344, use the increased maximum number of iterations x , continue to train the trained multilayer perceptron model through the particle swarm algorithm, and test it after each round of training; S345, repeat S344, when the maximum number of iterations is reached x Or test accuracy ≥ v When , the iteration stops and the final multi-layer perceptron model is obtained; The above steps can accurately evaluate the performance of the model by testing the trained multilayer perceptron model and comparing the test output results with the historical label set; if the test accuracy reaches the preset threshold, the validity of the model is confirmed; if the threshold is not reached, the model is continuously trained and tested by increasing the maximum number of iterations of the particle swarm algorithm until the accuracy requirement is met or a new maximum number of iterations is reached; this method further ensures that the final multilayer perceptron model has high accuracy and reliability.
[0012] Preferably, S4 comprises the following steps: S41, collecting real-time production equipment characteristic data and production environment data to obtain real-time pharmaceutical production process characteristic data, and preprocessing the real-time pharmaceutical production process characteristic data in combination with a pharmaceutical production characteristic data preprocessing model to obtain preprocessed real-time pharmaceutical production process characteristic data; S42, bringing the pre-processed real-time pharmaceutical production process characteristic data set into the final multi-layer sensor model to obtain real-time product quality characteristic data; S43, judging whether the product quality meets the standard according to the real-time product quality characteristic data, if the product quality does not meet the standard, adjusting the production equipment parameters and the production environment parameters, and repeating S41 and S42 until the product quality meets the standard; On the contrary, there is no need to adjust the production equipment parameters and production environment parameters; By collecting production equipment characteristic data and production environment data in real time and using a preprocessing model for standardized processing, the real-time and accuracy of the data can be ensured; the preprocessed real-time data is input into the final multi-layer perceptron model to quickly obtain real-time product quality characteristic data, thereby realizing real-time monitoring and prediction of product quality; according to the prediction results, the production equipment parameters and production environment parameters can be adjusted in time to ensure that product quality always meets the standards; this closed-loop control mechanism effectively improves the flexibility and response speed of the pharmaceutical production process, reduces the generation of unqualified products, improves production efficiency and product quality, and provides a strong guarantee for the intelligent and refined production of the pharmaceutical industry.
[0013] A pharmaceutical production data processing system based on data mining, used to implement the above-mentioned pharmaceutical production data processing method based on data mining, including a data preprocessing module, a data storage and extraction module, a model building and optimization module, and a real-time prediction and adjustment module; The data preprocessing module is used to collect pharmaceutical production equipment data, environmental data and quality inspection data, extract features; adjust the abnormal coefficient, calculate the quartile and interquartile range, remove outliers, calculate the mean, fill in missing values, and perform data normalization; The data storage and extraction module is used to store the pre-processed data into a database and classify and label it by product batch and date; extract historical pharmaceutical production characteristic data and product quality characteristic data from the database, and construct a characteristic data matrix and a product quality label matrix; The model building and optimization module is used to build an initial multi-layer perceptron model, set the training and testing ratios and accuracy thresholds, use a particle swarm algorithm combined with historical data to train the model, adjust parameters such as the number of hidden layers, the number of neurons, and the learning rate, test the trained model, and further optimize the model according to the test results until the set test accuracy threshold is reached to obtain the final multi-layer perceptron model; The real-time prediction and adjustment module is used to collect real-time production equipment feature data and environmental data, perform preprocessing, and input the preprocessed real-time data into the final multi-layer perceptron model to predict product quality. According to the prediction results, it is judged whether the product quality meets the standards. If it does not meet the standards, the production equipment parameters and environmental parameters are adjusted, and the prediction is repeated until the product quality meets the standards.
[0014] (III) Beneficial effects The present invention has the following beneficial effects: The present invention constructs a pharmaceutical production characteristic data preprocessing model, effectively removes outliers, fills in missing values and normalizes the data, thereby significantly improving the quality and availability of the data; this preprocessing step ensures the accuracy of subsequent model training and prediction, and provides a reliable data basis for real-time monitoring and predictive adjustment in the pharmaceutical production process.
[0015] The present invention uses a particle swarm algorithm to train, test and optimize the initial multilayer perceptron model, automatically adjusts the model parameters, and obtains a final multilayer perceptron model with high accuracy; this method not only reduces the complexity and uncertainty of manual parameter adjustment, but also greatly improves the learning efficiency and prediction performance of the model, thereby achieving accurate prediction of product quality.
[0016] The present invention collects pharmaceutical production process characteristic data in real time and combines it with the final multi-layer perceptron model to predict product quality, so as to timely discover problems in the production process and adjust production equipment parameters and production environment parameters; this real-time monitoring and adjustment mechanism effectively ensures the stability and controllability of product quality, improves production efficiency, reduces production costs, and brings significant economic benefits and competitive advantages to pharmaceutical companies.
[0017] Of course, any product implementing the present invention does not necessarily need to achieve all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the invention, the drawings required for describing the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the invention. For ordinary technicians in this field, they can also obtain drawings based on these drawings without paying creative work.
[0019] Figure 1 It is a schematic diagram of a process of constructing a pharmaceutical production characteristic data preprocessing model in a pharmaceutical production data processing system and method based on data mining of the present invention; Figure 2 A schematic diagram of a process of training, testing and optimizing a multilayer perceptron model in a pharmaceutical production data processing system and method based on data mining according to the present invention; Figure 3 The present invention is a flowchart of a pharmaceutical production data processing system and method based on data mining. DETAILED DESCRIPTION
[0020] The following will be combined with the drawings in the embodiments of the invention to clearly and completely describe the technical solutions in the embodiments of the invention. Obviously, the described embodiments are only part of the embodiments of the invention, not all of the embodiments. Based on the embodiments in the invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the invention.
[0021] In the description of the present invention, it is necessary to understand that the terms "opening", "upper", "lower", "top", "middle", "inside" and the like indicating orientation or positional relationship are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the components or elements referred to must have a specific orientation, be constructed and operate in a specific orientation, and therefore cannot be understood as limiting the invention.
[0022] Embodiment 1: See also Figure 1 , Figure 2 , Figure 3 The present invention discloses a pharmaceutical production data processing method based on data mining, comprising the following steps: S1. Construct a preprocessing model for pharmaceutical production characteristic data; The S1 comprises the following steps: S11. Collect pharmaceutical production equipment data, pharmaceutical production environment data and quality inspection data, extract features, and obtain pharmaceutical production feature data set ,in a i Represents the pharmaceutical production feature dataset i feature data, m Represents the total number of features in the pharmaceutical production feature dataset; S12. Pharmaceutical production feature dataset a Remove outliers to obtain the pharmaceutical production feature data set after removal c ; The S12 comprises the following steps: S121. According to the specific characteristics, production conditions and process requirements, adjust the abnormal coefficient to b ; S122, when m When +1 is an integer multiple of 4, Q 1=No. feature data, Q 3=No. Characteristic data; whenm When +1 is not an integer multiple of 4, Q 1= The average value of two adjacent feature data. Q 3= The average value of two adjacent feature data. Q 1 represents the first quartile, Q 3 represents the third quartile; S123, , IOR represents the interquartile range, , , R 1 represents the upper bound, R 2 represents the lower bound; traverse the pharmaceutical production feature data set The production feature data in the pharmaceutical production feature dataset is marked as outliers, and the values less than the lower bound or greater than the upper bound are removed from the pharmaceutical production feature dataset to obtain the pharmaceutical production feature dataset after removal. ;in c i Represents the first i feature data, p Represents the total number of features in the pharmaceutical production feature dataset after removing outliers; S13. Pharmaceutical production feature dataset after removal Filling missing values to obtain a filled pharmaceutical production feature data set, normalizing the filled pharmaceutical production feature data set to obtain a preprocessed pharmaceutical production feature data set after preprocessing; The S13 comprises the following steps: S131. Calculate the mean of all feature data in the removed pharmaceutical production feature data set to obtain the mean d , the formula is as follows, ; S132, the pharmaceutical production feature dataset after removal Fill in the missing data points in the dataset to obtain the filled pharmaceutical production feature dataset ,in e i Represents the filled pharmaceutical production feature dataset. i Characteristic data; S133, set the zoom ratio to f , extract the filled pharmaceutical production feature dataset The smallest feature data e min , the largest feature data e max ; S134, the filled pharmaceutical production feature dataset Each feature data in is scaled to obtain the preprocessed pharmaceutical production feature data set ;in g i Represents the first i feature data; the scaling formula is as follows, ; S2, extracting historical pharmaceutical production characteristic data processed by the pharmaceutical production characteristic data preprocessing model from the database, and constructing a historical pharmaceutical production process characteristic data matrix and a product quality label matrix; The S2 comprises the following steps: S21. Preprocess all feature data in the pharmaceutical production data in combination with the pharmaceutical production feature data preprocessing model to obtain preprocessed data, store the preprocessed data in a database, and classify and label the data by product batch and date; S22. Extract the production equipment characteristic data and production environment data from the historical pharmaceutical production characteristic data from the database according to the product batch, and construct a historical pharmaceutical production process characteristic data matrix A ,as follows, ; in, A ih Represents the first i Batch of products h Production process characteristic data, n Represents the total number of product batches in the historical production process characteristic data matrix; S23. Extract production quality characteristic data from historical pharmaceutical production characteristic data from the database and construct a product quality label matrix B ,as follows, ; in, B ik Represents the historical pharmaceutical production process characteristic data matrix i Batch of products k Product quality label data, k Indicates the total number of product quality labels for each batch of products; S3, constructing an initial multilayer perceptron model and setting relevant parameters, using a particle swarm algorithm combined with a historical pharmaceutical production process feature data matrix and a product quality label matrix, training, testing, and optimizing the initial multilayer perceptron model, adjusting the parameters of the initial multilayer perceptron model, and obtaining a final multilayer perceptron model; The S3 comprises the following steps: S31, construct an initial multilayer perceptron model, and set the training ratio and test ratio of the initial multilayer perceptron model to r 1. r 2. Set the training accuracy threshold to u 1. The test accuracy threshold is v ; S32. According to the training ratio and test ratio of the initial multilayer perceptron model, r 1. r 2. Divide the historical pharmaceutical production process feature data matrix into a historical pharmaceutical production process feature data training matrix and a historical pharmaceutical production process feature data test matrix, and divide the product quality label matrix into a product quality training label matrix and a product quality test label matrix; S33, training the initial multilayer perceptron model, and adjusting the parameters of the initial multilayer perceptron model using an optimization algorithm to obtain a trained multilayer perceptron model; The S33 comprises the following steps: S331, using a particle swarm algorithm in combination with the historical pharmaceutical production process feature data training matrix and the product quality training label matrix to train the initial multilayer perceptron model, adjusting the number of hidden layers, the number of neurons, and the learning rate of the initial multilayer perceptron model to obtain a trained multilayer perceptron model; The S331 includes the following steps: S3311, construct a particle swarm; set the size of the particle swarm to C , then the particle group is expressed as ,in D i represents the particle swarm i particles; set the maximum number of training iterations to w ; S3312, randomly generate the initial position set of the particle swarm ; F i1 , F i2 and F i3 Respectively represent the number of particles in the i The first dimension coordinates, second dimension coordinates and third dimension coordinates of the initial position of each particle; Initialize the particle speed ,in E i Indicates i The speed of each particle; initialize the optimal position of each particle ,in H i Indicatesi The best position reached by each particle; Initialize the global best position K for H Any position in S3313. For each particle, update the speed ,in t Indicates the current moment, t +1 means the next moment, L is the inertia weight, c 1 and c 2 is the learning factor, r 1 and r 2 is a random number in the range of 0 to 1, yes t Moment i The best position that a particle can reach is yes t Moment i The global optimal position reached by each particle; Update Location , the updated position is used as the new parameter combination of the number of hidden layers, the number of neurons, and the learning rate. The updated parameter combination of the number of hidden layers, the number of neurons, and the learning rate is used to train the initial multilayer perceptron model and evaluate the training accuracy of the multilayer perceptron model. If the updated position The training accuracy of the multilayer perceptron model is higher than , then update H i , if the new position The training accuracy of the multilayer perceptron model is no higher than , keep the original F i ; at the time t +1, traverse the historical best positions of all particles F i , and select the position with the highest training accuracy of the multilayer perceptron model as the new global optimal position ; S3314, repeat S3312, S3313, when the training accuracy of the multilayer perceptron model ≥ the training accuracy threshold u 1 or the number of iterations reaches w When , the iteration process is stopped, and the parameter combination of the number of hidden layers, the number of neurons, and the learning rate corresponding to the global optimal position is output to obtain the trained multilayer perceptron model; S34, testing the trained multilayer perceptron model, and obtaining the final multilayer perceptron model after the test optimization is completed; The S34 comprises the following steps: S341, inputting the input into the trained multilayer perceptron model for testing to obtain a test output result, and comparing the test output result with the product quality test label matrix to obtain the test accuracy; S342, when the test accuracy ≥ v , using the trained multilayer perceptron model as the final multilayer perceptron model; S343, when the test accuracy < v When , the maximum number of iterations in the particle swarm algorithm is increased, and the increased maximum number of iterations is x ; S344, use the increased maximum number of iterations x , continue to train the trained multilayer perceptron model through the particle swarm algorithm, and test it after each round of training; S345, repeat S344, when the maximum number of iterations is reached x Or test accuracy ≥ v When , the iteration stops and the final multi-layer perceptron model is obtained; S4, collect real-time pharmaceutical production process characteristic data and predict product quality based on the final multi-layer sensor model; The S4 comprises the following steps: S41, collecting real-time production equipment characteristic data and production environment data to obtain real-time pharmaceutical production process characteristic data, and preprocessing the real-time pharmaceutical production process characteristic data in combination with a pharmaceutical production characteristic data preprocessing model to obtain preprocessed real-time pharmaceutical production process characteristic data; S42, bringing the pre-processed real-time pharmaceutical production process characteristic data set into the final multi-layer sensor model to obtain real-time product quality characteristic data; S43, judging whether the product quality meets the standard according to the real-time product quality characteristic data, if the product quality does not meet the standard, adjusting the production equipment parameters and the production environment parameters, and repeating S41 and S42 until the product quality meets the standard; On the contrary, there is no need to adjust production equipment parameters and production environment parameters.
[0023] Embodiment 2: A pharmaceutical production data processing system based on data mining, used to implement the above-mentioned pharmaceutical production data processing method based on data mining, including a data preprocessing module, a data storage and extraction module, a model building and optimization module, and a real-time prediction and adjustment module; The data preprocessing module is used to collect pharmaceutical production equipment data, environmental data and quality inspection data, extract features; adjust the abnormal coefficient, calculate the quartile and interquartile range, remove outliers, calculate the mean, fill in missing values, and perform data normalization; The data storage and extraction module is used to store the pre-processed data into a database and classify and label it by product batch and date; extract historical pharmaceutical production characteristic data and product quality characteristic data from the database, and construct a characteristic data matrix and a product quality label matrix; The model building and optimization module is used to build an initial multi-layer perceptron model, set the training and testing ratios and accuracy thresholds, use a particle swarm algorithm combined with historical data to train the model, adjust parameters such as the number of hidden layers, the number of neurons, and the learning rate, test the trained model, and further optimize the model according to the test results until the set test accuracy threshold is reached to obtain the final multi-layer perceptron model; The real-time prediction and adjustment module is used to collect real-time production equipment feature data and environmental data, perform preprocessing, and input the preprocessed real-time data into the final multi-layer perceptron model to predict product quality. According to the prediction results, it is judged whether the product quality meets the standards. If it does not meet the standards, the production equipment parameters and environmental parameters are adjusted, and the prediction is repeated until the product quality meets the standards.
[0024] In the description of this specification, the description with reference to the terms "one embodiment", "example", "specific example", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0025] The preferred embodiments of the invention disclosed above are only used to help explain the invention. The preferred embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the invention, so that those skilled in the art can understand and use the invention well.
Claims
1. A pharmaceutical production data processing method based on data mining, characterized in that: The following steps are involved: S1. Construct a preprocessing model for pharmaceutical production characteristic data; S2, extracting historical pharmaceutical production characteristic data processed by the pharmaceutical production characteristic data preprocessing model from the database, and constructing a historical pharmaceutical production process characteristic data matrix and a product quality label matrix; S3, constructing an initial multilayer perceptron model and setting relevant parameters, using a particle swarm algorithm combined with a historical pharmaceutical production process feature data matrix and a product quality label matrix, training, testing, and optimizing the initial multilayer perceptron model, adjusting the parameters of the initial multilayer perceptron model, and obtaining a final multilayer perceptron model; S4. Collect real-time pharmaceutical production process characteristic data and predict product quality based on the final multi-layer sensor model.
2. A pharmaceutical production data processing method based on data mining according to claim 1, characterized in that: The S1 comprises the following steps: S11. Collect pharmaceutical production equipment data, pharmaceutical production environment data and quality inspection data, extract features, and obtain pharmaceutical production feature data set ,in a i Represents the pharmaceutical production feature dataset i feature data, m Represents the total number of features in the pharmaceutical production feature dataset; S12. Pharmaceutical production feature dataset a Remove outliers to obtain the pharmaceutical production feature data set after removal c ; S13. Pharmaceutical production feature dataset after removal c Fill in missing values to obtain the filled pharmaceutical production feature data set e , the filled pharmaceutical production feature data set is normalized to obtain the preprocessed pharmaceutical production feature data set g .
3. A pharmaceutical production data processing method based on data mining according to claim 2, characterized in that: The S12 comprises the following steps: S121. According to the specific characteristics, production conditions and process requirements, adjust the abnormal coefficient to b ; S122, when m When +1 is an integer multiple of 4, Q 1=No. feature data, Q 3=No. Characteristic data; when m When +1 is not an integer multiple of 4, Q 1= The average value of two adjacent feature data. Q 3= The average value of two adjacent feature data. Q 1 represents the first quartile, Q 3 represents the third quartile; S123, , IOR represents the interquartile range, , , R 1 represents the upper bound, R 2 represents the lower bound; traverse the pharmaceutical production feature data set The production feature data in the pharmaceutical production feature dataset is marked as outliers, and the values less than the lower bound or greater than the upper bound are removed from the pharmaceutical production feature dataset to obtain the pharmaceutical production feature dataset after removal. ;in c i Represents the first i feature data, p Represents the total number of features in the pharmaceutical production feature dataset after outliers are removed.
4. The pharmaceutical production data processing method based on data mining according to claim 2, characterized in that: The S13 comprises the following steps: S131. Calculate the mean of all feature data in the removed pharmaceutical production feature data set to obtain the mean d , the formula is as follows, ; S132, the pharmaceutical production feature dataset after removal Fill in the missing data points in the dataset to obtain the filled pharmaceutical production feature dataset ,in e i Represents the filled pharmaceutical production feature dataset. i Characteristic data; S133, set the zoom ratio to f , extract the filled pharmaceutical production feature dataset The smallest feature data e min , the largest feature data e max ; S134, the filled pharmaceutical production feature dataset Each feature data in is scaled to obtain the preprocessed pharmaceutical production feature data set ;in g i Represents the first i feature data; the scaling formula is as follows, 。 5. The pharmaceutical production data processing method based on data mining according to claim 1, characterized in that: The S2 comprises the following steps: S21. Preprocess all feature data in the pharmaceutical production data in combination with the pharmaceutical production feature data preprocessing model to obtain preprocessed data, store the preprocessed data in a database, and classify and label the data by product batch and date; S22. Extract the production equipment characteristic data and production environment data from the historical pharmaceutical production characteristic data from the database according to the product batch, and construct a historical pharmaceutical production process characteristic data matrix A ; S23. Extract production quality characteristic data from historical pharmaceutical production characteristic data from the database and construct a product quality label matrix B .
6. The pharmaceutical production data processing method based on data mining according to claim 1, characterized in that: The S3 comprises the following steps: S31, construct an initial multilayer perceptron model, and set the training ratio and test ratio of the initial multilayer perceptron model to r 1. r 2. Set the training accuracy threshold to u 1. The test accuracy threshold is v ; S32. According to the training ratio and test ratio of the initial multilayer perceptron model, r 1. r 2. Divide the historical pharmaceutical production process feature data matrix into a historical pharmaceutical production process feature data training matrix and a historical pharmaceutical production process feature data test matrix, and divide the product quality label matrix into a product quality training label matrix and a product quality test label matrix; S33, using a particle swarm algorithm in combination with the historical pharmaceutical production process characteristic data training matrix and the product quality training label matrix to train the initial multilayer perceptron model, adjusting the number of hidden layers, the number of neurons, and the learning rate of the initial multilayer perceptron model to obtain a trained multilayer perceptron model; S34, testing the trained multilayer perceptron model, and after the test optimization is completed, obtaining the final multilayer perceptron model.
7. A pharmaceutical production data processing method based on data mining according to claim 6, characterized in that: The S33 comprises the following steps: S331, construct a particle swarm; set the size of the particle swarm to C , then the particle group is expressed as ,in D i represents the particle swarm i particles; set the maximum number of training iterations to w ; S332, randomly generate the initial position set of the particle swarm ; F i1 , F i2 and F i3 Respectively represent the number of particles in the i The first dimension coordinates, second dimension coordinates and third dimension coordinates of the initial position of each particle; Initialize the particle speed ,in E i Indicates i The speed of each particle; initialize the optimal position of each particle ,in H i Indicates i The best position reached by each particle; Initialize the global best position K for H Any position in S333. For each particle, update the speed ,in t Indicates the current moment, t +1 means the next moment, L is the inertia weight, c 1 and c 2 is the learning factor, r 1 and r 2 is a random number in the range of 0 to 1, yes t Moment i The best position that a particle can reach is yes t Moment i The global optimal position reached by each particle; Update Location , the updated position is used as the new parameter combination of the number of hidden layers, the number of neurons, and the learning rate. The updated parameter combination of the number of hidden layers, the number of neurons, and the learning rate is used to train the initial multilayer perceptron model and evaluate the training accuracy of the multilayer perceptron model. If the updated position The training accuracy of the multilayer perceptron model is higher than , then update H i , if the new position The training accuracy of the multilayer perceptron model is no higher than , keep the original F i ; at the time t +1, traverse the historical best positions of all particles F i , and select the position with the highest training accuracy of the multilayer perceptron model as the new global optimal position ; S334, repeat S332, S333, when the training accuracy of the multilayer perceptron model is ≥ the training accuracy threshold u 1 or the number of iterations reaches w When , the iteration process is stopped, and the parameter combination of the number of hidden layers, the number of neurons, and the learning rate corresponding to the global optimal position is output to obtain the trained multilayer perceptron model.
8. The pharmaceutical production data processing method based on data mining according to claim 6, characterized in that: The S34 comprises the following steps: S341, inputting the historical pharmaceutical production process characteristic data test matrix into the trained multilayer perceptron model for testing to obtain a test output result, and comparing the test output result with the product quality test label matrix to obtain a test accuracy; S342, when the test accuracy ≥ v , using the trained multilayer perceptron model as the final multilayer perceptron model; S343, when the test accuracy < v When , the maximum number of iterations in the particle swarm algorithm is increased, and the increased maximum number of iterations is x ; S344, use the increased maximum number of iterations x , continue to train the trained multilayer perceptron model through the particle swarm algorithm, and test it after each round of training; S345, repeat S344, when the maximum number of iterations is reached x Or test accuracy ≥ v When , the iteration stops and the final multi-layer perceptron model is obtained.
9. The pharmaceutical production data processing method based on data mining according to claim 1, characterized in that: The S4 comprises the following steps: S41, collecting real-time production equipment characteristic data and production environment data to obtain real-time pharmaceutical production process characteristic data, and preprocessing the real-time pharmaceutical production process characteristic data in combination with a pharmaceutical production characteristic data preprocessing model to obtain preprocessed real-time pharmaceutical production process characteristic data; S42, bringing the pre-processed real-time pharmaceutical production process characteristic data set into the final multi-layer sensor model to obtain real-time product quality characteristic data; S43, judging whether the product quality meets the standard according to the real-time product quality characteristic data, if the product quality does not meet the standard, adjusting the production equipment parameters and the production environment parameters, and repeating S41 and S42 until the product quality meets the standard; On the contrary, there is no need to adjust production equipment parameters and production environment parameters.
10. A pharmaceutical production data processing system based on data mining, used to implement a pharmaceutical production data processing method based on data mining as described in any one of claims 1 to 9.
Citation Information
Patent Citations
Data-driven traditional Chinese medicine manufacturing process technological parameter optimization method
CN116414095A
High-speed motor parameter optimization method and system based on parameterization analysis
CN119514190A
Proposed improved particle swarm optimization.
IN201611017244A