An adaptively corrected pharmaceutical process quality detection method and robot
By extracting key spectral features from hyperspectral data, building a multivariate correction model and automatically updating it in real time, the problem of difficult to adapt to dynamic changes in drug quality detection is solved, and real-time high-precision prediction of drug quality detection is achieved.
Patent Information
- Application Number
- CN202411586823.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-08
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2044-11-08
AI Technical Summary
The prior art is difficult to effectively adapt to dynamic changes in the production process in drug quality testing, resulting in an increase in prediction errors. The traditional methods lack the ability to automatically iterative update correction modeling, and insufficient computing efficiency, which affects the accuracy of the quality of the pharmaceutical process.
By extracting key spectral features from hyperspectral data, building a multivariate correction model, and using machine learning algorithms such as convolutional neural networks to automatically update in real time, and dynamically adjusting model parameters to adapt to changes in the production process.
Real-time high-precision prediction of drug quality detection is realized, reducing prediction errors caused by changes, improving the robustness and computing efficiency of the model, and reducing the dependence on offline laboratory testing.
Smart Images

Figure CN119104505B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of drug quality detection, and in particular relates to a self-adaptive correction pharmaceutical process quality detection method and a robot. Background Art
[0002] At present, drug quality assessment and evaluation data usually rely on laboratory tests to obtain, and use standardized statistical methods for offline modeling and correction to predict a single or a few key quality indicators (CQAs), such as content, purity, dissolution, etc., while ignoring the complexity of drug quality and its multidimensional quality attributes in the production process. Building such correction models usually requires a large amount of experimental data, which may be time-consuming and costly in actual production. In addition, models based on static data sets and predefined parameters are difficult to adapt to dynamic changes in the production process, such as raw material variations and changes in production environment factors, which can easily lead to increased prediction errors. In addition, to update and maintain such preset models, multiple cross-sectional remodeling is required, further increasing the cost. On the other hand, when multiple quality indicators are involved, the complexity and computational cost of correction modeling increase significantly. In scenarios that require real-time intervention and decision-making, traditional technical methods lack the ability to automatically iterate and update correction modeling, and the computational efficiency may be insufficient, especially when dealing with complex nonlinear relationships. This may lead to misjudgment of pharmaceutical process quality, thereby affecting the safety and effectiveness of the final product. Summary of the invention
[0003] In order to solve the above problems in the prior art, the present invention proposes an adaptively corrected pharmaceutical process quality detection method and robot, which extracts key spectral features from hyperspectral data, constructs a multivariate correction model, continuously learns, and automatically updates the multivariate correction model in real time to adapt to the dynamic changes in the pharmaceutical process, maintain the high accuracy and robustness of the model, reduce the prediction errors caused by changes and the dependence on offline laboratory tests, and achieve the transition from a preset offline correction model to an online correction model, thereby innovating the process quality detection method, providing instant quality prediction results and quality control suggestions in production, and improving production efficiency and quality control accuracy.
[0004] To achieve the above object, the present invention adopts the following technical solutions:
[0005] A pharmaceutical process quality detection method with adaptive correction, comprising:
[0006] Step S1: acquiring historical hyperspectral image data of drugs, and performing data preprocessing on the historical hyperspectral image data;
[0007] Step S2: extract key spectral features from historical data of hyperspectral images and construct a multivariate correction model;
[0008] Step S3: collecting real-time data of hyperspectral images of drugs, forming and dynamically updating data sets;
[0009] Step S4: When the dynamic capacity of the data set reaches the set threshold, it is used for real-time training of the multivariate correction model. By dynamically adjusting the parameters, the multivariate correction model is adaptively corrected and automatically updated in real time, and the updated multivariate correction model is used for drug quality detection.
[0010] Furthermore, in step S1, data preprocessing includes image normalization, noise filtering and baseline correction.
[0011] Furthermore, in step S2, the key spectral features include absorption peaks, reflection peaks, infrared characteristic bands, spectral slopes and areas, and the methods for extracting key spectral features include principal component analysis, minimum noise separation, partial least squares regression, characteristic band selection, spectral index method, wavelet transform, and convolutional neural network feature extraction. The modeling algorithms of the multivariate correction model include linear regression, partial least squares method, support vector machine, least squares support vector machine, artificial neural network, extreme learning machine, and convolutional neural network.
[0012] Furthermore, the multivariate correction model is constructed using a convolutional neural network (CNN), and the multivariate correction model includes a convolution module, which includes a convolution layer, a ReLU activation function, a channel attention module (ChannelAttention), a soft threshold attention module (SoftThresholdAttention), a residual module (ResidualBlock), and a maximum pooling layer connected in sequence.
[0013] Furthermore, the channel attention module includes a first channel and a second channel connected in parallel. After the first channel and the second channel are fused, the score is converted into a weight through a first sigmoid activation function and output to the soft threshold attention module.
[0014] Furthermore, the first channel includes a first one-dimensional adaptive pooling layer, a second convolutional layer, a second ReLU activation function, and a third convolutional layer connected in sequence; the second channel includes a second one-dimensional adaptive pooling layer, a fourth convolutional layer, a third ReLU activation function, and a fifth convolutional layer connected in sequence.
[0015] Furthermore, the soft threshold attention module includes a sixth convolutional layer, a second sigmoid activation function and a first soft threshold function connected in sequence, and outputs several thresholds to the residual module through the first soft threshold function.
[0016] Furthermore, the residual module includes a seventh convolutional layer, a first normalization layer, a fourth ReLU activation function, an eighth convolutional layer, a second normalization layer, a jump connection layer and a fifth ReLU activation function connected in sequence.
[0017] Furthermore, the multivariate correction model has three layers of convolution operations to extract the key spectral features layer by layer.
[0018] A pharmaceutical process quality inspection robot with adaptive correction includes a data acquisition module and a quality inspection module connected to each other; the data acquisition module integrates a hyperspectral imaging device for real-time acquisition of hyperspectral image data of drugs; the quality inspection module carries a multivariate correction model in the pharmaceutical process quality inspection method with adaptive correction, is used for real-time quality inspection of drugs, and provides instant quality prediction results and quality control suggestions.
[0019] Compared with the prior art, the present invention has the following beneficial effects:
[0020] 1. The present invention introduces hyperspectral detection big data into the quality inspection of the pharmaceutical process, and uses its rich spectral information to capture the differences in physical and chemical properties in samples, thereby improving the accuracy of quality control;
[0021] A feature extraction and selection method for hyperspectral data is proposed to extract features related to key process quality attributes of drugs from high-dimensional spectral data to ensure modeling efficiency and model accuracy.
[0022] 2. Continuously update the correction model so that the model can adapt to dynamic changes in the production process in real time. In each production cycle, the robot uses the newly collected data as a "+1" increment, iteratively updates the multi-dimensional correction modeling, enhances the robot's ability to cope with changes in the dynamic production environment, and enables the model to maintain efficient and accurate correction performance under changing conditions. The continuous self-learning method can overcome the overfitting and computational complexity problems that traditional machine learning methods are prone to when processing high-dimensional data, and effectively solves the problem that traditional static modeling methods are difficult to adapt to changes in the production environment, significantly improving the real-time performance and prediction accuracy of the model.
[0023] 3. Adaptive correction technology is used to dynamically adjust and optimize the multivariate correction model parameters based on the real-time collected hyperspectral data to cope with changes in raw materials, process conditions and environmental factors during the production process, ensuring the high accuracy and stability of the model under dynamic production conditions, and reducing the prediction errors caused by the inability of traditional methods to adapt to changes.
[0024] 4. The machine learning algorithm can effectively process the complex nonlinear relationships in hyperspectral data. The robot has the ability to adaptively adjust the weights of each quality indicator to optimize the overall quality prediction and evaluation effect.
[0025] 5. A complete automated operation process is set up to automatically perform data collection, model update, calibration and quality prediction, significantly reducing manual intervention, operational errors and costs. The intelligent decision support module can automatically trigger alarms and provide adjustment suggestions when abnormal situations occur, further enhancing quality control decision support. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 A flow chart of a pharmaceutical process quality detection method with adaptive correction according to an embodiment of the present invention;
[0027] Figure 2 A schematic diagram of a self-learning and continuous adaptive correction process according to an embodiment of the present invention;
[0028] Figure 3 A schematic diagram of a multivariate calibration model processing flow in one embodiment of the present invention;
[0029] Figure 4 A schematic diagram of a channel attention module processing flow of a multivariate correction model in one embodiment of the present invention;
[0030] Figure 5 A schematic diagram of a soft threshold attention module processing flow of a multivariate correction model in one embodiment of the present invention;
[0031] Figure 6 The figure is a schematic diagram of the residual module processing flow of the multivariate correction model in one embodiment of the present invention. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0033] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0034] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be fixedly connected, detachably connected, or integrated; it can be directly connected, or indirectly connected through an intermediate medium. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0035] In addition, if "and / or" or "and / or" appears in the full text, its meaning includes three parallel solutions. Taking "A and / or B" as an example, it includes solution A, solution B, or solutions that satisfy both A and B. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such combination of technical solutions does not exist and is not within the protection scope required by the present invention.
[0036] In order to better understand the purpose, structure and function of the present invention, a detailed description is given below in conjunction with the accompanying drawings.
[0037] Example 1
[0038] like Figure 1-Figure 6 As shown, this embodiment provides a pharmaceutical process quality detection method with adaptive correction, comprising:
[0039] Step S1: acquiring historical hyperspectral image data of drugs, and performing data preprocessing on the historical hyperspectral image data;
[0040] Step S2: Extract hyperspectral image (spectral resolution at 10 -2 Spectral images within the range of λ are called hyperspectral images) Key spectral features in historical data are used to build a multivariate correction model;
[0041] Step S3: collecting real-time data of hyperspectral images of drugs, forming and dynamically updating data sets;
[0042] Step S4: When the dynamic capacity of the data set reaches the set threshold, it is used for real-time training of the multivariate correction model. By dynamically adjusting the parameters, the multivariate correction model is adaptively corrected and automatically updated in real time, and the updated multivariate correction model is used for drug quality detection.
[0043] Furthermore, in step S1, data preprocessing includes image normalization, noise filtering and baseline correction.
[0044] Furthermore, in step S2, the key spectral features include absorption peaks, reflection peaks, infrared characteristic bands, spectral slopes and areas, and the methods for extracting key spectral features include principal component analysis, minimum noise separation, partial least squares regression, characteristic band selection, spectral index method, wavelet transform, and convolutional neural network feature extraction. The modeling algorithms of the multivariate correction model include linear regression, partial least squares method, support vector machine, least squares support vector machine, artificial neural network, extreme learning machine, and convolutional neural network.
[0045] Key spectral features are wavelength information that can accurately characterize the chemical composition, structure, purity, etc. of drugs. These features are often used in drug ingredient analysis, quality control, etc., including:
[0046] Absorption peak: The characteristic absorption band of different components in medicines, which is used to identify active ingredients, excipients, etc. in medicines. For example, the moisture content in medicines can be monitored through the characteristic absorption bands of water such as 970 nm and 1450 nm.
[0047] Reflection peak: The spectral reflectance characteristic of the surface or internal substance of the drug, used to analyze the purity or surface characteristics of the substance.
[0048] Infrared characteristic bands: Common chemical groups in drugs (such as CH, OH, NH, etc.) have absorption characteristics in specific bands. For example, the 1500 nm to 2500 nm band can detect the presence of these groups.
[0049] Spectral slope and area: Within certain wavelength ranges, the slope or integrated area of the spectral curve can reflect the concentration changes of certain ingredients in the drug.
[0050] By selecting characteristic bands or extracting key spectral features through statistical analysis, machine learning or spectral information processing algorithms, the key bands that can best distinguish different ingredients or different production batches in drugs are selected. The key spectral features here are actually the results of spectral feature extraction, that is, the original feature variables are reduced in dimension, thereby reducing information redundancy.
[0051] Commonly used spectral feature extraction methods are:
[0052] Principal Component Analysis (PCA): Through linear transformation, the original high-dimensional spectral data is reduced in dimension and the principal components that best explain the data variance are extracted. PCA helps reduce redundant information and focus on retaining spectral features that have a significant impact on the composition of the drug.
[0053] Minimum Noise Fractionation (MNF): Similar to PCA, but takes the influence of noise into account, further optimizes the dimensionality reduction effect, and can extract spectral features with high signal-to-noise ratio.
[0054] Partial Least Squares Regression (PLS): Combines hyperspectral data with actual measurements (such as the chemical content of a drug) and extracts the most relevant spectral features through regression analysis. PLS is particularly suitable for the construction of multivariate calibration models.
[0055] Feature Selection: Select bands from high-dimensional bands that can significantly distinguish different drug ingredients or production batches through statistical methods, correlation analysis, decision trees, LASSO and other methods.
[0056] Spectral index method: Spectral index is calculated based on the combination of specific bands (similar to vegetation indices such as NDVI) to enhance the response of specific ingredients. Specific spectral indices can be designed in medicines to distinguish different chemical groups or substances.
[0057] Wavelet transform: decomposes spectral data into different scales and extracts spectral features of specific frequency components. It is suitable for analyzing complex drugs with multi-level structures.
[0058] Convolutional Neural Network (CNN) feature extraction: For large data sets, deep learning-based convolutional neural networks can automatically extract complex nonlinear spectral features. These features are often more representative than traditional methods.
[0059] Feature extraction methods can be divided into supervised and unsupervised methods. Supervised feature extraction methods (also known as variable selection methods) aim to select spectral feature bands that are closely related to the target attributes and remove redundant band information. Common supervised feature extraction algorithms include Competitive Adaptive Reweighted Sampling (CARS), Successive Projections Algorithm (SPA), Genetic Algorithm (GA), Uninformative Variable Elimination (UVE), Least Angle Regression (LARS) and Variable Importance in Projection (VIP). Unsupervised feature extraction methods (also known as feature compression methods) are usually used to reduce data dimensions and remove redundant features. Classic methods include principal component analysis (PCA) and autoencoder (AE) based on neural networks. PCA maps high-dimensional data to low-dimensional space through linear transformation, while autoencoders realize automatic learning and compression of features through neural network structures. These methods can effectively reduce the dimension of complex data and highlight features that are useful for modeling.
[0060] The purpose of constructing a multivariate calibration model is to establish the relationship between hyperspectral data and the actual properties of drugs (such as composition, purity, concentration, etc.). Commonly used spectral quantitative multivariate calibration modeling algorithms include Linear Regression (LR), Partial Least Squares (PLS), Support Vector Machine (SVM), Least Squares Support Vector Machines (LS-SVM), Artificial Neural Networks (ANN), Extreme Learning Machine (ELM) and Convolutional Neural Network (CNN).
[0061] Some of these algorithms are characterized by:
[0062] Partial least squares regression (PLS): This is one of the most commonly used multivariate correction methods in hyperspectral data analysis. It uses regression methods to find the best linear relationship between spectral data and actual measurements, and is suitable for high-dimensional data dimensionality reduction and regression modeling. The PLS model can correct the complex relationship between multiple drug components.
[0063] Multiple Linear Regression (MLR): This method directly establishes the relationship between spectral data and drug properties through a linear model, which is suitable for scenarios with fewer spectral features and more obvious linear relationships.
[0064] Support Vector Regression (SVR): A regression version of the support vector machine that can handle high-dimensional data and has nonlinear modeling capabilities, making it suitable for modeling complex relationships between drug components and spectral features.
[0065] Artificial Neural Network (ANN): Through a multi-layer neuron model, it can capture the complex nonlinear relationship between hyperspectral data and drug properties, and is suitable for large-scale, multivariate correction models.
[0066] Random Forest Regression: An integrated algorithm based on decision trees that can process high-dimensional and complex spectral data and is suitable for nonlinear, multivariate drug spectral correction models.
[0067] Ridge Regression: By introducing regularization terms into the regression model, the multicollinearity problem in hyperspectral data is solved and the stability of the model is improved.
[0068] Principal component regression (PCR): First, PCA is used to reduce the dimension, and then linear regression is performed. It is suitable for processing redundant information in high-dimensional spectral data.
[0069] Deep Learning: Convolutional Neural Networks (CNN) or Recurrent Neural Networks (RNN) can be used to build complex nonlinear multivariate correction models, which are particularly suitable for modeling large-scale hyperspectral data.
[0070] Furthermore, the multivariate correction model is constructed using convolutional neural networks (CNN), such as Figure 3 As shown, the multivariate correction model includes a convolution module, such as Figure 3In the first column, the convolution module includes a one-dimensional convolution layer (1, 64, convolution kernel size = 3, padding = 1), a ReLU activation function, a channel attention module (64), a soft threshold attention module (SoftThresholdAttention) (threshold = 0.3), a residual module (ResidualBlock) (64), and a maximum pooling layer (kernel size = 2) connected in sequence. Furthermore, the multivariate correction model has three layers of convolution operations, which only transform different parameters to extract the key spectral features layer by layer, such as Figure 3 In the figure, the first, second and third columns are three layers of convolution operations. In the second column, there are one-dimensional convolution layers (64, 128, kernel size = 3, padding = 1), channel attention (128), residual modules (128). In the third column, there are one-dimensional convolution layers (128, 256, kernel size = 3, padding = 1), channel attention (256), residual modules (256). Finally, the above processing results are output to the ReLU activation function, and then the dimension is flattened, and then input to the linear layer ( Then input the ReLU activation function and the linear layer (128, 1) in sequence and output.
[0071] like Figure 4 As shown, further, the channel attention module includes a first channel and a second channel connected in parallel, the left side of the upper part is the first channel, and the right side is the second channel. After the first channel and the second channel are fused, the score is converted into a weight through a first sigmoid activation function and output to the soft threshold attention module.
[0072] Furthermore, the first channel includes a first one-dimensional adaptive pooling layer, a second convolution layer (input channel number, input channel number, convolution kernel size = 1, bias = no), a second ReLU activation function, and a third convolution layer (input channel number, input channel number, convolution kernel size = 1, bias = no) connected in sequence; the second channel includes a second one-dimensional adaptive pooling layer, a fourth convolution layer (input channel number, input channel number, convolution kernel size = 1, bias = no), a third ReLU activation function, and a fifth convolution layer (input channel number, input channel number, convolution kernel size = 1, bias = no) connected in sequence.
[0073] like Figure 5 As shown, further, the soft threshold attention module includes a sixth convolutional layer (input channel number, input channel number, convolution kernel size = 1, bias = no), a second sigmoid activation function and a first soft threshold function connected in sequence, and a plurality of thresholds are output to the residual module by multiplying the input eigenvalue by the first soft threshold function (threshold = 0.3).
[0074] like Figure 6As shown, further, the residual module includes a seventh convolution layer (input channel number, input channel number, convolution kernel size = 1, padding = 1, bias = no), a first normalization layer (output channel number), a fourth ReLU activation function, an eighth convolution layer (input channel number, input channel number, convolution kernel size = 1, padding = 1, bias = no), a second normalization layer (output channel number), a jump connection layer () input value and a fifth ReLU activation function, and then outputs.
[0075] Example 2
[0076] In this embodiment, an adaptively corrected pharmaceutical process quality inspection robot is provided, comprising a data acquisition module and a quality inspection module connected to each other; the data acquisition module integrates a hyperspectral imaging device for real-time acquisition of hyperspectral image data of drugs; the quality inspection module is equipped with the multivariate correction model in the above-mentioned adaptively corrected pharmaceutical process quality inspection method, which is used for real-time quality inspection of drugs and provides instant quality prediction results and quality control suggestions.
[0077] Example 3
[0078] The difference from Embodiments 1 and 2 is that, in this embodiment, the pharmaceutical process quality detection method with adaptive correction includes:
[0079] 1. Hyperspectral data collection and feature extraction:
[0080] Hyperspectral data acquisition: The robot integrates high-precision hyperspectral imaging equipment to collect spectral data in real time at various stages of drug production (including raw material inspection, intermediate quality inspection, and finished product quality inspection). Hyperspectral data has rich spectral information and can capture subtle differences in the chemical composition and physical structure of drugs, thereby providing basic data for the prediction and quality evaluation of multiple quality indicators.
[0081] Data preprocessing: For the collected hyperspectral data, this robot uses a series of preprocessing technologies, such as spectral normalization, noise filtering and baseline correction, to eliminate the impact of ambient light changes, instrument drift and other noise factors on the data, ensuring the stability and reliability of the data.
[0082] Feature extraction and selection: This robot uses advanced spectral feature extraction algorithms (such as principal component analysis PCA, independent component analysis ICA, local linear embedding LLE, etc.) to extract spectral features related to process quality attributes from hyperspectral data. Through feature selection algorithms, the key spectral features that best reflect process quality changes are screened out for multivariate correction modeling.
[0083] 2. Continuous learning and online adaptive correction:
[0084] Initial modeling of multivariate correction of quality indicators: Based on hyperspectral data and extracted key features, this robot uses modeling algorithms such as partial least squares regression (PLSR), support vector regression (SVR) and deep learning models (such as convolutional neural network CNN) to build an initial multivariate correction model (i.e. Figure 1 The historical training model in is used to predict multiple quality indicators (such as content, purity, dissolution, etc.).
[0085] Dynamic update: This robot creatively adopts the "N+1" architecture to continuously collect hyperspectral data of production process samples, continuously learn, and automatically update the multivariate correction model in real time to adapt to dynamic changes in the pharmaceutical process, such as raw material batch variation, process parameter adjustment, and changes in production environment factors.
[0086] Data set expansion and model iteration: Taking "N+1" self-learning as an example, the newly collected hyperspectral data in each round of production is used as the "+1" increment. Combined with historical data (N), the correction model is continuously updated through continuous learning algorithms to improve its adaptability to new environments and production conditions.
[0087] Online adaptive correction: Based on the continuously collected hyperspectral data and by integrating advanced self-learning algorithms, this robot can more effectively handle complex nonlinear relationships and dynamically adjust the parameters of the multivariate correction model to cope with changes in raw materials, process conditions and environmental factors during the production process, reducing the risk of misjudgment caused by the limitations of conventional linear models. Through adaptive correction, the robot can maintain the high accuracy and robustness of the model, reduce prediction errors caused by changes and reliance on offline laboratory testing, thereby providing instant quality prediction results and quality control recommendations in production, improving production efficiency and quality control accuracy.
[0088] 3. Quality fusion evaluation modeling and optimization:
[0089] Simultaneous monitoring of multiple quality attributes: This robot is equipped with multiple adaptive correction modeling modules to simultaneously predict and monitor multiple quality indicators (such as content, purity, dissolution, etc.). The model uses advanced machine learning algorithms (such as deep neural network DNN, random forest RF, etc.) to handle complex nonlinear relationships in hyperspectral data and optimize the prediction of multiple quality indicators.
[0090] Adaptive weighted fusion: Based on the real-time data in the production process and the importance and relevance of different quality indicators, this robot can adaptively and dynamically optimize and adjust the weight of each quality indicator in the model to maintain the best balance of contribution to the overall quality, thereby optimizing the overall quality evaluation.
[0091] 4. Automation and intelligent process quality monitoring:
[0092] Process-based operation: This robot automates the quality inspection and evaluation process of the pharmaceutical process to reduce the risk of manual error. It can automatically collect data, update models, and perform real-time analysis and output quality prediction results during the production process, ensuring that quality change information can be captured in a timely manner at all stages of production, thereby achieving rapid response and adjustment.
[0093] Intelligent decision support and feedback mechanism: This robot has a built-in intelligent decision support module. When abnormal hyperspectral signals are detected or the predicted quality indicators exceed the threshold, the robot can automatically trigger an alarm and provide adjustment suggestions or directly perform operational adjustments. In addition, the robot supports a regular feedback mechanism to continuously optimize the correction model and process quality evaluation model to ensure the long-term effectiveness of the model and the robot.
[0094] Efficient computing power: In order to cope with the high-dimensional characteristics of hyperspectral data and the complexity of multiple quality indicators, this robot adopts an efficient computing architecture and parallel processing technology to ensure that data processing and model correction can be completed quickly and accurately in scenarios requiring real-time decision-making.
[0095] This embodiment significantly improves the efficiency and reliability of pharmaceutical process quality detection, enhances the adaptability of the model to dynamic changes in production factors, improves the automation and real-time level of pharmaceutical process quality detection, optimizes the comprehensive evaluation of pharmaceutical process quality, and reduces production costs and operational complexity.
[0096] Example 4
[0097] The difference from Example 1 to Example 3 is that Figure 2-Figure 6As shown, this embodiment uses convolutional neural networks (CNN) for multivariate correction modeling, the model input is hyperspectral image data, and the output is the content prediction value. The model architecture is mainly composed of three groups of convolution modules (starting from "Conv1d"), introducing channel attention mechanism, residual structure and soft threshold attention mechanism. Each group of modules contains the following components: convolution layer, ReLU activation function, channel attention mechanism (ChannelAttention), soft threshold attention mechanism (SoftThresholdAttention), residual module (ResidualBlock), maximum pooling layer. By introducing three convolution modules, the network can extract more complex and abstract features layer by layer, thereby improving the expressiveness of the model. At the same time, increasing the depth of the network can improve the expressiveness and generalization ability of the model. However, the problems of gradient disappearance and gradient explosion are prone to occur in deep networks. By introducing residual connections, the gradient is allowed to be directly transferred from the back layer to the front layer, which alleviates the problem of gradient disappearance in deep networks and helps to train deeper networks. The channel attention mechanism is introduced to weight the importance of each channel, adaptively select and emphasize important channel features, and suppress unimportant channel features, thereby enhancing the model's attention to important features. The soft threshold attention function is introduced to provide a smooth transition when approaching the threshold to avoid excessive amplification or complete neglect of noise. By introducing sparsity and nonlinear feature selection, some unimportant features are suppressed, thereby reducing noise and redundant information and enhancing the response to important features. Finally, through a fully connected layer, the multidimensional feature map is flattened into 1 dimension, and the content prediction value of size 1 is output: Flatten: Flatten the multidimensional feature map into one dimension. Linear (256 * (input_length / 8), 128): fully connected layer, input size is 256 * (input_length / 8), output size is 128. ReLU: activation function. Linear (128, 1): fully connected layer, input size is 128, output size is 1.
[0098] And adopt "N+1" self-learning and continuous adaptive correction process, such as Figure 2As shown: First, use a larger scale of data (such as 100) to form a data set, use the data set to train the model and save it as the initial model. Then, determine whether the amount of new data reaches the threshold. When the amount of new data reaches the threshold, return to the data set and start a new training round. When the amount of new data does not reach the threshold, proportional sampling is performed, and samples are taken from historical data according to the amount of new data. The closer to the latest data, the greater the sampling weight, and the new and old data form a new input data set. Load the historical correction model, freeze the parameters of the convolutional layer and the residual layer, redefine the optimizer, only optimize the parameters of the fully connected layer, update the model and determine whether the multivariate correction effect is improved at this time. If so, replace the original model. If not, keep the original model.
[0099] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A pharmaceutical process quality detection method with adaptive correction, characterized in that: include: Step S1: acquiring historical hyperspectral image data of drugs, and performing data preprocessing on the historical hyperspectral image data; Step S2: extract key spectral features from historical data of hyperspectral images and construct a multivariate correction model; Step S3: collecting real-time data of hyperspectral images of drugs, forming and dynamically updating data sets; Step S4: When the dynamic capacity of the data set reaches the set threshold, it is used for real-time training of the multivariate correction model, and adaptive correction and real-time automatic update of the multivariate correction model are performed by dynamically adjusting parameters, and the updated multivariate correction model is used for drug quality detection; specifically: Determine whether the amount of new data has reached the threshold. When the amount of new data has reached the threshold, return the data set and start a new training round. When the amount of new data has not reached the threshold, proportional sampling is performed. Sample from historical data according to the amount of new data. The closer to the latest data, the greater the sampling weight. The new and old data form a new input data set. Load the historical correction model, freeze the parameters of the convolutional layer and the residual layer, redefine the optimizer, only optimize the parameters of the fully connected layer, update the model, and determine whether the multivariate correction effect is improved at this time. If so, replace the original model; if not, keep the original model. The multivariate correction model is constructed using a convolutional neural network, and the multivariate correction model includes a convolution module, which includes a convolution layer, a ReLU activation function, a channel attention module, a soft threshold attention module, a residual module, and a maximum pooling layer connected in sequence; Among them, multiple adaptive correction modeling modules are set up to simultaneously predict and synchronously monitor multiple quality indicators. Machine learning algorithms are used to process complex nonlinear relationships in hyperspectral real-time data and optimize the prediction of multiple quality indicators. According to the hyperspectral real-time data in the production process, the weights of each quality indicator in the adaptive correction modeling model are adaptively and dynamically optimized according to the importance and correlation of different quality indicators.
2. The pharmaceutical process quality detection method with adaptive correction as claimed in claim 1, characterized in that: In step S1, data preprocessing includes image normalization, noise filtering and baseline correction.
3. The pharmaceutical process quality detection method with adaptive correction as claimed in claim 1, characterized in that: In step S2, the key spectral features include absorption peaks, reflection peaks, infrared characteristic bands, spectral slopes and areas. The methods for extracting the key spectral features include principal component analysis, minimum noise separation, partial least squares regression, characteristic band selection, spectral index method, wavelet transform, and convolutional neural network feature extraction. The modeling algorithms of the multivariate correction model include linear regression, partial least squares method, support vector machine, least squares support vector machine, artificial neural network, extreme learning machine, and convolutional neural network.
4. The pharmaceutical process quality detection method with adaptive correction as claimed in claim 3, characterized in that: The channel attention module includes a first channel and a second channel connected in parallel. After the first channel and the second channel are fused, the score is converted into a weight through a first sigmoid activation function and output to the soft threshold attention module.
5. The pharmaceutical process quality detection method with adaptive correction as claimed in claim 4, characterized in that: The first channel includes a first one-dimensional adaptive pooling layer, a second convolutional layer, a second ReLU activation function, and a third convolutional layer connected in sequence; the second channel includes a second one-dimensional adaptive pooling layer, a fourth convolutional layer, a third ReLU activation function, and a fifth convolutional layer connected in sequence.
6. The pharmaceutical process quality detection method with adaptive correction as claimed in claim 3, characterized in that: The soft threshold attention module includes a sixth convolutional layer, a second sigmoid activation function and a first soft threshold function connected in sequence, and outputs several thresholds to the residual module through the first soft threshold function.
7. The pharmaceutical process quality detection method with adaptive correction as claimed in claim 3, characterized in that: The residual module includes a seventh convolutional layer, a first normalization layer, a fourth ReLU activation function, an eighth convolutional layer, a second normalization layer, a skip connection layer and a fifth ReLU activation function connected in sequence.
8. The pharmaceutical process quality detection method with adaptive correction as claimed in claim 3, characterized in that: The multivariate correction model has three layers of convolution operations to extract the key spectral features layer by layer.
9. An adaptively corrected pharmaceutical process quality inspection robot, characterized in that: It comprises a data acquisition module and a quality detection module which are interconnected; the data acquisition module integrates a hyperspectral imaging device for real-time acquisition of hyperspectral image data of drugs; the quality detection module is equipped with a multivariate correction model in the pharmaceutical process quality detection method with adaptive correction as described in any one of claims 1 to 8, which is used for real-time quality detection of drugs and provides immediate quality prediction results and quality control suggestions.
Citation Information
Patent Citations
Deep learning fruit spectral analysis model updating method
CN114002167A
Quality analysis method for gastric rejuvenation granulation process based on hyperspectrum
CN117330655A