A method and system for intelligent control of the proportioning of a pharmaceutical hard tablet compression calender material
By establishing a relational model for the material ratio of pharmaceutical hard tablets, and using BP network and particle swarm optimization algorithm to optimize the excipient ratio, the problem of unstable quality in traditional methods was solved, and efficient production and quality control of pharmaceutical hard tablet products were achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHEJIANG DUOLING PHARM PACKAGING MATERIALS CO LTD
- Filing Date
- 2025-12-12
- Publication Date
- 2026-04-10
AI Technical Summary
Traditional pharmaceutical hard tablet production lacks the ability to respond to dynamic factors in material ratio control, resulting in unstable product quality. Furthermore, existing intelligent control methods ignore the coupling relationship between quality indicators, leading to inaccurate ratio results.
By constructing a relationship model of main ingredient feature vector, auxiliary ingredient ratio vector and quality index vector, using BP network to train and select the optimal network, and combining particle swarm optimization algorithm to optimize auxiliary ingredient ratio, accurate prediction and real-time adjustment of main ingredient feature and auxiliary ingredient ratio information can be achieved.
This has achieved stability and consistency in the quality of pharmaceutical hard tablets, improved production efficiency, reduced resource waste, and ensured that key quality indicators meet the standards.
Smart Images

Figure CN121331264B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of data processing. In particular, it relates to a method and system for intelligent control of material proportioning in hard tablet compression. BACKGROUND
[0002] In the production process of pharmaceutical hard tablets, material proportioning is a key factor affecting the final quality of the product. Traditional proportioning control methods rely mostly on manual experience or fixed formulations, lacking the ability to respond to dynamic factors such as batch differences in raw materials, changes in environmental temperature and humidity, and fluctuations in equipment state, resulting in poor product quality stability and frequent problems such as insufficient hardness, uneven thickness, and disintegration time exceeding the standard.
[0003] In the prior art, some intelligent control methods introduce neural networks, genetic algorithms, or particle swarm optimization to optimize proportioning, but often treat each quality indicator as an independent target, ignoring the coupling relationship between them, which can result in inaccurate proportioning results. SUMMARY
[0004] To solve the above technical problems, the present application provides solutions in the following aspects.
[0005] In a first aspect, an intelligent control method for material proportioning in hard tablet compression is provided, comprising: constructing a main material feature vector, an auxiliary material proportioning vector, and a quality indicator vector based on acquired historical production data, training a preset network based on the main material feature vector, the auxiliary material proportioning vector, and the quality indicator vector to obtain a plurality of initial networks, and selecting an optimal network based on the calculated correlation error; collecting a main material feature vector to be detected, initializing a particle swarm to obtain an initial auxiliary material proportioning vector to be detected, inputting the main material feature vector and the initial auxiliary material proportioning vector into the optimal network to obtain an initial quality indicator vector, calculating a fitness value based on the initial quality indicator vector and a preset standard quality indicator vector, updating the particle swarm based on the fitness value, until a preset maximum number of iterations is reached, obtaining an optimal auxiliary material proportioning vector, obtaining the weight of any auxiliary material based on the optimal auxiliary material proportioning vector, and completing the proportioning control.
[0006] Preferably, the training of the preset network includes: the preset network is a BP network, the main material feature vector and the auxiliary material proportioning vector in the historical production data are used as inputs, the true value of the quality indicator vector in the historical production data is used as the network label, a set of training sets is obtained, the training sets are input into the BP network, the loss value of the predicted value and the true value of the quality indicator vector in the historical production data is calculated using the mean square error loss function, the network parameters of the BP network are updated using the gradient descent method, until the BP network reaches a preset maximum training number or the loss value is less than a preset threshold, and the training is stopped.
[0007] Preferably, the calculation of the correlation error comprises: constructing the true values of the quality indicator vector in the historical production data in all quality indicator values in the same dimension into a true quality indicator sequence, and traversing to obtain the true quality indicator sequence in each dimension; constructing the predicted values of the quality indicator vector in the historical production data in all quality indicator values in the same dimension into a predicted quality indicator sequence, and traversing to obtain the predicted quality indicator sequence in each dimension; optionally taking two different dimensions as a first dimension and a second dimension, calculating a first correlation coefficient of the true quality indicator sequence in the first dimension and the true quality indicator sequence in the second dimension, calculating a second correlation coefficient of the predicted quality indicator sequence in the first dimension and the predicted quality indicator sequence in the second dimension, and calculating a first difference square of the first correlation coefficient and the second correlation coefficient, traversing to obtain the first difference square of any two dimensions, and taking the average of all first difference squares as the correlation error.
[0008] Preferably, the screening of the initial network to select the optimal network comprises: for any initial network, obtaining the mean square error value and the correlation error of the initial network, calculating a first product of a preset first weight and the correlation error, calculating a second product of a preset second weight and the mean square error value, and taking the sum of the first product and the second product as a model score value of any initial network, and taking the initial network corresponding to the minimum value of the model score value as the optimal network.
[0009] Preferably, the initialization of the particle swarm to obtain the initial auxiliary material ratio vector to be detected comprises: a preset particle quantity, and one particle corresponds to one initial auxiliary material ratio vector; wherein, a preset first proportion of particles are randomly selected from the database of quality meeting in the historical production data, and a preset second proportion of particles are randomly generated according to the particle swarm algorithm, and the sum of the preset first proportion and the preset second proportion is 1.
[0010] Preferably, the calculation of the fitness value comprises: taking any initial auxiliary material ratio vector as a target vector, obtaining an initial quality indicator vector corresponding to the target vector; for any dimension of the initial quality indicator value in the initial quality indicator vector, calculating a second difference square of the initial quality indicator value and the standard quality indicator value in the same dimension, and taking the square root of the sum of all dimensions of the second difference square as the fitness value.
[0011] Preferably, the calculation of the fitness value comprises:
[0012] taking any initial auxiliary material ratio vector as a target vector, obtaining an initial quality indicator vector corresponding to the target vector;
[0013] For the initial quality index value of any dimension in the initial quality index vector, a second difference square value of the initial quality index value and the standard quality index value of the same dimension is calculated, a third product of the second difference square value and the weight coefficient is calculated, and the sum of the third products of all dimensions is taken as the fitness value by taking the square root of the sum;
[0014] Wherein, the weight coefficient comprises: taking any dimension in the quality index vector as a target dimension, taking any dimension except the target dimension as a control dimension, calculating a first correlation coefficient of the target dimension and the control dimension, and calculating a sum of the first correlation coefficients of the target dimension and each control dimension as an influence score of the target dimension;Traverse the influence score of each dimension, calculate the influence score cumulative value of all dimensions, and take the ratio of the influence score of the target dimension and the influence score cumulative value as the weight coefficient of the target dimension.
[0015] In a second aspect, an intelligent control system for material ratio of a pharmaceutical hard tablet compression material includes a processor and a memory, the memory stores computer program instructions, when the computer program instructions are executed by the processor, any one of the intelligent control methods for material ratio of a pharmaceutical hard tablet compression material is realized.
[0016] The present application has the following effects:
[0017] The present application establishes a relationship model between the main material feature vector, the auxiliary material ratio vector and the quality index vector, and uses a method combining machine learning and particle swarm optimization algorithm to efficiently and accurately optimize the batching process. Specifically, the main material features and auxiliary material ratio information are trained by a BP network to obtain an optimal network, thereby accurately predicting the quality index in actual production, and adjusting the auxiliary material ratio in real time according to the prediction results to ensure product quality stability and consistency. At the same time, through the global search ability of the particle swarm optimization algorithm, the optimal auxiliary material ratio can be found in a wide range of ratio space, thereby improving production efficiency, reducing resource waste, and ensuring that each batch of products meets the standard requirements in terms of hardness, friability, dissolution rate and other key quality indicators.
[0018] The present application particularly emphasizes the synergistic consistency of quality control, not only pursuing accurate prediction of a single index, but also considering the internal correlation between multiple quality dimensions, thereby avoiding the decline of other performances caused by excessive optimization of a single index. BRIEF DESCRIPTION OF DRAWINGS
[0019] Figure 1 is a flowchart of an intelligent control method for material ratio of a pharmaceutical hard tablet compression material according to an embodiment of the present application. DETAILED DESCRIPTION
[0020] With reference to the accompanying drawings, the technical solutions in the embodiments of the present application will be clearly and completely described below, obviously, the described embodiments are some of the embodiments of the present application, rather than all the embodiments.
[0021] The specific implementation of the present application will be described in detail below with reference to the accompanying drawings.
[0022] Referring to Figure 1 A pharmaceutical hard tablet compression material proportioning intelligent control method includes steps S1-S2, and specifically as follows:
[0023] S1: constructing a main material feature vector, an auxiliary material proportioning vector and a quality index vector according to the obtained historical production data, training a preset network based on the main material feature vector, the auxiliary material proportioning vector and the quality index vector, obtaining a plurality of initial networks, and selecting an optimal network based on the calculated correlation error.
[0024] In one embodiment, complete data of a plurality of continuous historical production batches is collected from historical production data to construct a data set containing a main material feature vector, an auxiliary material proportioning vector and a quality index vector.
[0025] The main material feature vector is composed of five key physical and chemical properties, namely, melt viscosity, weight average molecular weight, particle size distribution, apparent density and moisture content, which comprehensively reflect the performance differences between main material batches; the auxiliary material proportioning vector includes the proportions of heat stabilizer, internal lubricant, external lubricant, plasticizer, processing aid and calcium stearate; and the quality index vector, as the target label for model training, includes five core quality characteristics, namely, hardness, friability, transparency, dissolution rate and thickness uniformity.
[0026] In order to guarantee the quality and reliability of the modeling data, the original data is systematically cleaned and preprocessed: first, according to the three times standard deviation principle, abnormal values are identified and removed to avoid extreme noise interference with model learning; second, a small amount of missing data is filled by linear interpolation to maintain the continuity and rationality of the time series; and finally, the main material features and auxiliary material proportioning data are normalized to eliminate the bias caused by the differences in dimensions and orders of magnitude between different variables, and to improve the convergence speed and generalization ability of subsequent machine learning or optimization algorithms.
[0027] The preset network is trained by using the pretreated main material feature vector, the auxiliary material ratio vector and the quality index vector. The preset network is a BP (Back Propagation) network. The main material feature vector and the auxiliary material ratio vector in the historical production data are taken as inputs, and the true value of the quality index vector in the historical production data is taken as a network label to obtain a set of training sets. The training sets are input into the BP network. The loss value of the predicted value and the true value of the quality index vector in the historical production data is calculated by using a mean square error loss function. The network parameters of the BP network are updated by using a gradient descent method until the BP network reaches a preset maximum training number or the loss value is less than a preset threshold value, and the training is stopped. For example, when the training number reaches 500 or the loss value is less than 0.001, the training is stopped.
[0028] It should be explained that when the main material feature vector and the auxiliary material ratio vector are taken as inputs, the main material feature vector and the auxiliary material ratio vector in the training set are spliced to construct an input vector of the preset network. A multi-layer BP network is constructed. The number of nodes in the input layer is consistent with the dimension of the spliced input vector, and is used to receive all material features and ratio information. The BP network includes two hidden layers. The first hidden layer has 64 nodes, and the second hidden layer has 32 nodes. ReLU (Rectified Linear Unit) activation functions are used to introduce non-linear mapping capabilities. The number of nodes in the output layer is exactly the same as the dimension of the quality index vector, and a Sigmoid activation function is used to ensure that all predicted values are constrained in the interval of 0 to 1.
[0029] The true values of all quality index values of the quality index vector in the historical production data in the same dimension are constructed into a true quality index sequence to obtain a true quality index sequence of each dimension by traversal. The predicted values of all quality index values of the quality index vector in the historical production data in the same dimension are constructed into a predicted quality index sequence to obtain a predicted quality index sequence of each dimension by traversal. Two different dimensions are selected as a first dimension and a second dimension. A first correlation coefficient of the true quality index sequence of the first dimension and the true quality index sequence of the second dimension is calculated. A second correlation coefficient of the predicted quality index sequence of the first dimension and the predicted quality index sequence of the second dimension is calculated. A first difference square of the first correlation coefficient and the second correlation coefficient is calculated. The first difference square of any two dimensions is obtained by traversal. The mean value of all first difference squares is taken as a correlation error.
[0030] Exemplarily, the actual value of the quality index vector and the predicted value of the quality index vector can be obtained by the main material feature vector and the auxiliary material ratio vector in all production batches collected in the historical production data. That is, the real hardness value and the predicted hardness value, the real friability and the predicted friability in each production batch can be obtained, the first correlation of the real hardness value sequence and the real friability sequence in all production batches is calculated, and the second correlation of the predicted hardness value sequence and the predicted friability sequence in all production batches is calculated, so as to calculate the first difference square of the hardness value dimension and the friability dimension. Similarly, the first difference square of any two dimensions can be obtained to calculate the correlation error.
[0031] For any initial network, the mean square error value and the correlation error of the initial network are obtained, the first product of the preset first weight and the correlation error is calculated, the second product of the preset second weight and the mean square error value is calculated, the sum of the first product and the second product is taken as the model score value of any initial network, and the initial network corresponding to the minimum value of the model score value is taken as the optimal network.
[0032] It should be noted that the second correlation coefficient of any initial network is different, because the same input data is input into different initial networks, and the predicted value of the quality index vector is different.
[0033] The preset first weight and the preset second weight can be set by those skilled in the art. Exemplarily, the preset first weight is 0.5, and the preset second weight is 0.5.
[0034] By weighting and fusing the mean square error and the correlation error into a unified model score value, the accuracy of the model in predicting the quality index value and the ability to maintain the inherent correlation structure between multiple indexes are effectively taken into account, so that not only the approximation accuracy of a single quality index is pursued in the optimization process, but also the collaborative consistency of the overall quality characteristics is emphasized. This scoring mechanism enables the selected optimal network to more truly reflect the physical coupling relationship between hardness, friability, dissolution rate and other key indicators in actual production, avoids sacrificing other performances due to one-sided optimization of a certain index, and significantly improves the engineering practicability and stability of the optimization result.
[0035] S2: collecting the main material feature vector to be detected, initializing the particle swarm to obtain the initial auxiliary material ratio vector to be detected, inputting the main material feature vector and the initial auxiliary material ratio vector into the optimal network to obtain the initial quality index vector, calculating the fitness value according to the initial quality index vector and the preset standard quality index vector, updating the particle swarm based on the fitness value, until the preset maximum iteration number is reached, obtaining the optimal auxiliary material ratio vector, obtaining the quality of any auxiliary material based on the optimal auxiliary material ratio vector, and completing the ratio control.
[0036] In one embodiment, the number of preset particles is set, and one particle corresponds to one initial excipient ratio vector; wherein the particles with a preset first proportion are randomly selected from the database of historical production data with qualified quality, and the particles with a preset second proportion are randomly generated according to the particle swarm algorithm, and the sum of the preset first proportion and the preset second proportion is 1.
[0037] For example, the number of particles is set to 50, that is, 50 initial excipient ratio vectors are searched at the same time. Among them, 20% (that is, 10) of the initial particles are randomly selected from the batches with qualified quality index vectors screened from the historical production database. The actual production data corresponding to these ratios show that the key quality indicators such as hardness, friability and dissolution of the products meet the pharmacopoeia or enterprise internal control standards, and represent the verified feasible process path. As the initial solution, it can effectively guide the search process to quickly enter the high-quality ratio area, improve the convergence speed and enhance the engineering feasibility of the results; the remaining 80% (that is, 40) of the initial particles are randomly generated within the feasible solution space according to the process allowable range of each excipient (such as 0.5-2.0 parts of thermal stabilizer and 1.0-5.0 parts of plasticizer), which ensures the diversity of the initial population and helps to fully explore potential better new formula combinations and avoid falling into local optimum too early.
[0038] Any initial excipient ratio vector is taken as a target vector, spliced with the collected main material feature vector to be detected, and input into the optimal network to obtain an initial quality index vector, that is, the initial quality index vector corresponding to the target vector can be obtained; for any dimension of the initial quality index value in the initial quality index vector, the second difference square of the initial quality index value and the standard quality index value of the same dimension is calculated, and the sum of the second difference squares of all dimensions is taken as the fitness value.
[0039] According to the fitness value, the optimal position (that is, the individual historical best solution) experienced by each particle itself in the iteration process is dynamically updated, and the global optimal position (that is, the best ratio currently searched) shared by the whole particle swarm is also updated. The iteration update process is a known technology for those skilled in the art, and will not be described in detail here.
[0040] When the iteration reaches a preset maximum number of iterations (100 times in this embodiment), it is considered that the particle swarm has fully explored the solution space and tends to converge, and the optimization search process is terminated at this time. In the iteration process, the group constantly approaches the optimal solution through the cooperative exchange of individual and global information, and finally takes the initial excipient ratio vector corresponding to the global optimal position shared by the whole population as the optimal excipient ratio vector.
[0041] The weight of each excipient can be calculated according to the optimal excipient proportioning vector, and the value of any dimension in the optimal excipient proportioning vector represents the number of parts of the corresponding excipient (i.e. the number of parts added corresponding to 100 parts of the main material). For example, the value of the dimension of the number of parts of the heat stabilizer in the optimal excipient proportioning vector is 2, indicating that 2 kg of heat stabilizer needs to be added to 100 kg of main material.
[0042] For a production process, the actual total weight of the main material in the current production process is calculated, and the ratio of the actual total weight of the main material to 100 is multiplied by the value of the corresponding excipient in the optimal excipient proportioning vector to obtain the total weight of the excipient in the current production process.
[0043] The discharge port of each excipient bin is controlled by a PLC (Programmable Logic Controller) control system. The total weight of the excipient is controlled according to PID (Proportional-Integral-Derivative) control, and when the weight of the excipient discharged reaches the total weight of the excipient, the discharge port is closed to complete the batching.
[0044] The system comprises a processor and a memory, and the memory stores computer program instructions which, when executed by the processor, implement the intelligent control method for batching of a pharmaceutical hard tablet compression material according to the first aspect of the application.
[0045] The system also comprises a communication bus and a communication interface, as well as other components well known to those skilled in the art, the settings and functions of which are known in the art, and therefore will not be described here.
[0046] It should be noted that, for those skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are all within the scope of the present application. Therefore, the protection scope of the present application patent should be subject to the appended claims.
Claims
1. A method for intelligent control of the proportioning of pharmaceutical hard sheet calendering materials, characterized in that, include: Based on the acquired historical production data, construct the main material feature vector, auxiliary material ratio vector, and quality index vector. Train a preset network based on the main material feature vector, auxiliary material ratio vector, and quality index vector to obtain several initial networks. Select the optimal network based on the calculated correlation error of the initial networks. The main material feature vector to be detected is collected, the particle swarm is initialized to obtain the initial auxiliary material ratio vector to be detected, the main material feature vector and the initial auxiliary material ratio vector are input into the optimal network to obtain the initial quality index vector, the fitness value is calculated based on the initial quality index vector and the preset standard quality index vector, the particle swarm is updated based on the fitness value until the preset maximum number of iterations is reached to obtain the optimal auxiliary material ratio vector, and the weight of any auxiliary material is obtained based on the optimal auxiliary material ratio vector to complete the ratio control. The calculation of the correlation error includes: Construct a true quality indicator sequence by taking the true values of all quality indicator values in the same dimension of the quality indicator vector in the historical production data, and then iterate through the true quality indicator sequence of each dimension. The predicted quality index sequence is constructed by constructing the predicted values of all quality index values in the same dimension of the quality index vector in the historical production data, and the predicted quality index sequence for each dimension is obtained by traversing it. Choose any two different dimensions as the first dimension and the second dimension. Calculate the first correlation coefficient between the true quality index sequence of the first dimension and the true quality index sequence of the second dimension. Calculate the second correlation coefficient between the predicted quality index sequence of the first dimension and the predicted quality index sequence of the second dimension. Calculate the first squared difference between the first correlation coefficient and the second correlation coefficient. Iterate through the first squared difference between any two dimensions and take the mean of all the first squared differences as the correlation error.
2. The intelligent control method for the proportioning of pharmaceutical hard sheet calendering materials according to claim 1, characterized in that, The training preset network includes: The default network is a BP network. The main material feature vector and auxiliary material ratio vector in the historical production data are used as inputs, and the true values of the quality index vector in the historical production data are used as network labels to obtain a training set. The training set is input into the BP network, and the loss value between the predicted value and the true value of the quality index vector in the historical production data is calculated using the mean squared error loss function. The network parameters of the BP network are updated using the gradient descent method until the BP network reaches the preset maximum number of training times or the loss value is less than the preset threshold, at which point training stops.
3. The intelligent control method for the proportioning of pharmaceutical hard sheet calendering materials according to claim 1, characterized in that, The process of selecting the optimal network from the initial network includes: For any initial network, obtain the mean squared error and correlation error of the initial network, calculate the first product of the preset first weight and the correlation error, calculate the second product of the preset second weight and the mean squared error, use the sum of the first product and the second product as the model score of any initial network, and take the initial network corresponding to the minimum model score as the optimal network.
4. The intelligent control method for the proportioning of pharmaceutical hard sheet calendering materials according to claim 1, characterized in that, The initial particle swarm optimization process for obtaining the initial excipient ratio vector to be detected includes: The preset number of particles is used, with one particle corresponding to one initial auxiliary material ratio vector. Among them, the particles with the first preset proportion are randomly selected from the database of quality-compliant historical production data, and the particles with the second preset proportion are randomly generated according to the particle swarm algorithm. The sum of the first preset proportion and the second preset proportion is 1.
5. The intelligent control method for the proportioning of pharmaceutical hard sheet calendering materials according to claim 4, characterized in that, The calculation of fitness values includes: Take any initial excipient ratio vector as the target vector and obtain the initial quality index vector corresponding to the target vector; For any dimension of the initial quality index value in the initial quality index vector, calculate the second squared difference between the initial quality index value and the standard quality index value of the same dimension, and take the square root of the sum of the second squared differences of all dimensions as the fitness value.
6. The intelligent control method for the proportioning of pharmaceutical hard sheet calendering materials according to claim 1, characterized in that, The calculation of fitness values includes: Take any initial excipient ratio vector as the target vector and obtain the initial quality index vector corresponding to the target vector; For any dimension of the initial quality index value in the initial quality index vector, calculate the second squared difference between the initial quality index value and the standard quality index value of the same dimension, calculate the third product of the second squared difference and the weight coefficient, and take the square root of the sum of the third products of all dimensions as the fitness value. The acquisition of weighting coefficients includes: Take any dimension in the quality indicator vector as the target dimension and any dimension other than the target dimension as the control dimension. Calculate the first correlation coefficient between the target dimension and the control dimension. Calculate the sum of the first correlation coefficients between the target dimension and each control dimension as the influence score of the target dimension. Iterate through each dimension to obtain its influence score, calculate the cumulative influence score of all dimensions, and use the ratio of the target dimension's influence score to the cumulative influence score as the target dimension's weight coefficient.
7. A smart control system for the proportioning of pharmaceutical hard sheet calendering materials, characterized in that, include: The processor and memory, wherein the memory stores computer program instructions, which, when executed by the processor, implement the intelligent control method for the proportioning of pharmaceutical hard sheet calendering materials according to any one of claims 1-6.
Citation Information
Patent Citations
High-barrier pharmaceutical PVC hard sheet and preparation method thereof
CN108164866A
Multi-target control optimization method for concrete mix proportion
CN113836811A