Intelligent drug quality detection method applying deep learning
By performing feature extrusion processing and dynamic cross-fusion of the time series data and spatial data in drug quality detection, combined with weighted probability prediction and uncertainty evaluation, the shortcomings of feature extraction and uncertainty evaluation in the prior art are solved, and the Higher accuracy and reliability of drug quality testing.
Patent Information
- Application Number
- CN202411467688.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-21
- Publication Date
- 2025-02-11
AI Technical Summary
The existing technology is difficult to fully capture the complex interaction between time series data and spatial data in drug quality detection, resulting in the loss or underestimation of key features, and the feature extraction method is difficult to cope with complex dynamic changes, and the uncertainty evaluation method is relatively single, which affects the impact of Reliability of test results.
By performing multi-layer timing feature extrusion processing and nonlinear spatial feature extrusion processing on timing data and spatial data, timing features and spatial features are extracted, and fusion is carried out through a dynamic cross-fusion mechanism to generate comprehensive features. Combined with weighted probability prediction and uncertainty evaluation terms, the prediction results are evaluated and the final quality level of the drug is determined.
It realizes a comprehensive capture of complex changes in the time and space dimensions of drugs, improves the accuracy and robustness of feature extraction, enhances the reliability and adaptability of test results, and ensures the accuracy and safety of drug quality testing. .
Smart Images

Figure CN119417294A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent drug quality detection, and in particular to an intelligent drug quality detection method using deep learning. Background Art
[0002] With the rapid development of deep learning technology, intelligent drug quality detection has made significant progress. Current methods mainly rely on neural networks and multi-level feature extraction techniques to extract key features related to drug quality from large amounts of time series data and spatial data collected during the drug manufacturing process. The above technologies enable drug quality detection to be performed at a higher level of automation and accuracy, reduce human intervention, and process and analyze complex data sets in a shorter time. In addition, technologies such as dynamic weighting, nonlinear mapping, and covariance matrix have also been introduced to improve the robustness and predictive performance of detection models.
[0003] Although the above-mentioned deep learning technologies have played an important role in drug quality testing, there are still some problems that need to be solved. First, the independent processing of time series data and spatial data makes it difficult to fully capture the complex interactive relationship between time series data and spatial data, which may lead to the loss or underestimation of certain key features; secondly, the feature extraction and fusion methods in the above-mentioned technologies mostly rely on linear or simple nonlinear transformations, which are difficult to effectively cope with the complex dynamic changes of features in the drug manufacturing process, especially in different time steps and spatial dimensions. In addition, the uncertainty assessment method is relatively simple, and it is easy to produce high uncertainty when dealing with complex data environments, which affects the reliability of drug quality prediction results. Therefore, the above-mentioned technologies need to be further improved in terms of the accuracy of feature extraction, the accuracy of uncertainty assessment, and the robustness and adaptability of the overall system. Summary of the invention
[0004] The present invention provides an intelligent drug quality detection method using deep learning to solve the technical problems that the independent processing of time series data and spatial data makes it difficult to fully capture the complex interactive relationship between time series data and spatial data, which may lead to the loss or underestimation of certain key features; most feature extraction and fusion methods rely on linear or simple nonlinear transformations, which are difficult to effectively cope with the complex dynamic changes of features in the drug manufacturing process at different time steps and spatial dimensions; the uncertainty assessment method is relatively single, which is prone to high uncertainty when processing complex data environments, affecting the reliability of drug quality prediction results.
[0005] A method for intelligent drug quality detection using deep learning, comprising the following steps:
[0006] S1: Collect and preprocess the original time series data and original space data of the tested drugs to obtain time series data and space data; perform multi-layer time series feature extrusion processing and nonlinear space feature extrusion processing on the time series data and space data respectively to extract time series features and space features;
[0007] S2: Fuse the temporal features and spatial features to generate comprehensive features; perform weighted probability prediction based on the comprehensive features to obtain prediction results; introduce uncertainty assessment items to evaluate the prediction results, determine the final quality grade of the drug, and generate a quality inspection report.
[0008] Preferably, the S1 specifically includes:
[0009] In the implementation of multi-layer time series feature squeezing processing, logarithmic and exponential operations are introduced to calculate the time step weights.
[0010] Preferably, the S1 specifically includes:
[0011] Based on the time step weight, the time series data is weighted and squeezed to extract the time series features. The time series feature extraction formula is as follows:
[0012]
[0013] in, is the time series feature of sensor i after being processed by the lth time series feature squeezing processing layer, expressed in the form of a vector; is the total number of time steps; W t (l) is the time step weight of time step t in the lth time series feature squeezing processing layer; X t,i is the time series data of sensor i at time step t; σ is the Sigmoid activation function; ⊙ is the element-wise product operation.
[0014] Preferably, the S1 specifically includes:
[0015] In the process of implementing the nonlinear spatial feature extrusion processing, the spatial dimension is combined with the nonlinear feature of the spatial data to calculate the nonlinear mapping vector.
[0016] Preferably, the S1 specifically includes:
[0017] Based on the nonlinear mapping vector, the spatial data is nonlinearly mapped and squeezed to generate spatial features. The specific formula for calculating the spatial features is as follows:
[0018]
[0019] Among them, Y j (l)is the spatial feature of the spatial data acquisition device j at the lth nonlinear spatial feature extrusion processing layer; S is the total number of spatial dimensions; is the nonlinear mapping vector of spatial data acquisition device j on spatial dimension s in the lth nonlinear spatial feature extrusion processing layer; It is the spatial data of spatial data acquisition device j in spatial dimension s.
[0020] Preferably, the S2 specifically includes:
[0021] A dynamic cross-fusion mechanism is introduced to generate comprehensive features by summing up the temporal features and spatial features layer by layer. The formula of the dynamic cross-fusion mechanism is as follows:
[0022]
[0023] Among them, Z is the comprehensive feature; L is the total number of processing layers; N is the total number of sensors; M is the total number of spatial data acquisition devices; tanh is the hyperbolic tangent activation function.
[0024] Preferably, the S2 specifically includes:
[0025] The weighted probability prediction reflects the possibility of the tested drug being classified into different quality grades by calculating the predicted probability of each quality grade; the specific formula for weighted probability prediction is as follows:
[0026]
[0027] Where P(Quality=k) is the predicted probability that the tested drug is classified as the kth quality grade, which is the prediction result of weighted probability prediction; k is the index variable of the quality grade; K is the total number of quality grades; m is the sum index variable; γ k is the weight vector of the kth quality level; is the covariance matrix of weight vectors of different quality levels, through γ k The covariance was calculated using the maximum likelihood estimation method; is the transpose operation.
[0028] Preferably, the S2 specifically includes:
[0029] Uncertainty assessment items are introduced, and the value of the uncertainty assessment items is calculated based on the predicted probability of quality grades combined with weight vectors of different quality grades; based on the value of the uncertainty assessment items, the prediction results are evaluated, and for test drugs whose values of the uncertainty assessment items are less than the set uncertainty threshold, the quality grade with the highest predicted probability in the prediction results is taken as the final test result; for test drugs whose values of the uncertainty assessment items are not less than the set uncertainty threshold, further tests are carried out; the final test results of the test drugs are summarized to obtain the final test results and generate a quality test report.
[0030] The beneficial effects of the technical solution of the present invention are:
[0031] 1. By simultaneously performing feature squeezing processing on time series data and spatial data, the time series features and spatial features of the tested drugs in the production process are extracted in parallel; this parallel processing method ensures the comprehensive capture of the complex changes of the tested drugs in the time and space dimensions, and the generated comprehensive features can more accurately reflect the quality of the tested drugs. The introduction of multi-layer time series feature squeezing and nonlinear spatial feature squeezing processing effectively improves the ability to identify deep-level correlations in drug data, significantly improving the accuracy and robustness of drug quality detection.
[0032] 2. A dynamic cross-fusion mechanism is adopted to deeply explore the interactive relationship between temporal features and spatial features through dual nonlinear activation functions and element-wise product operations. This not only improves the representativeness and adaptability of the comprehensive features, but also significantly improves the effect of feature fusion, enabling drug quality testing to better cope with various interference factors in complex production environments, thereby ensuring the reliability of test results.
[0033] 3. By combining the weighted probability prediction of comprehensive features with uncertainty assessment, the reliability and clarity of drug quality test results can be effectively evaluated. The introduction of uncertainty assessment items enables drugs to identify potential high-risk samples when faced with high complexity or abnormal data, and trigger further testing. This not only ensures the accuracy of drug quality testing, but also provides an important decision-making basis for quality control of the drug production process, ensuring the safety and pass rate of the final product. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 This is a flow chart of the intelligent drug quality detection method using deep learning described in the present invention. DETAILED DESCRIPTION
[0035] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined purpose of the invention, the technical scheme in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0036] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0037] The following is a detailed description of a specific scheme of an intelligent drug quality detection method using deep learning provided by the present invention in conjunction with the accompanying drawings.
[0038] Refer to the attached Figure 1 , which shows a flow chart of a method for intelligent drug quality detection using deep learning provided by an embodiment of the present invention, the method comprising the following steps:
[0039] S1: Collect and preprocess the original time series data and original space data of the tested drugs to obtain time series data and space data; perform multi-layer time series feature extrusion processing and nonlinear space feature extrusion processing on the time series data and space data respectively to extract time series features and space features;
[0040] The original time series data and original space data in the pharmaceutical manufacturing process are collected and preprocessed to obtain time series data and space data; multi-layer time series feature extrusion processing and nonlinear space feature extrusion processing are performed on the time series data and space data respectively to extract time series features and space features.
[0041] First, collect the original drug data of the tested drugs, including original time series data and original spatial data. Specifically, the original time series data is the original drug data that changes with time during the manufacturing process of the tested drugs, such as temperature, humidity, pressure, stirring rate, etc., which are collected through sensors; the original spatial data is the physical and chemical properties of the tested drugs in different spatial dimensions, such as particle size distribution, component ratio, tablet thickness, etc., which are collected through spatial data acquisition equipment. The original drug data is preprocessed to obtain drug data. The drug data contains time series data and spatial data, and the time series data and spatial data are represented in the form of vectors. Preprocessing includes cleaning, denoising, and standardization, which are all existing technologies and will not be repeated here.
[0042] Multi-layer time series feature extrusion processing and nonlinear spatial feature extrusion processing are performed on time series data and spatial data respectively to extract time series features and spatial features. Specifically, in the process of time series feature extraction, the dynamic change characteristics of the tested drugs in the manufacturing process are captured through multi-layer time series feature extrusion processing, and the time series features will show significant fluctuations as the time step goes by; in the process of spatial feature extraction, the nonlinear spatial feature extrusion processing mainly focuses on the distribution characteristics and structural information of the tested drugs in different spatial dimensions, which is used to reveal the deep relationship between spatial features and drug quality; at the same time, the total number of time series feature extrusion processing layers and nonlinear spatial feature extrusion processing layers is L.
[0043] The multi-layer temporal feature extrusion processing process is as follows:
[0044] First, by calculating the time step weight, the influence of the time series data on the time step is dynamically adjusted. The time step weight formula introduces logarithmic and exponential operations, combining the time step weights in different time series feature extrusion processing layers with the nonlinear change characteristics of the time series data; by dynamically adjusting the time step weights of different time steps, the accuracy of the time series feature extrusion processing is improved;
[0045] The time step weight formula is as follows:
[0046]
[0047] Among them, W t (l) is the time step weight of time step t at the lth time series feature squeezing processing layer, l∈[1,L]; the initial time step weight is the total number of time steps; t is the time step; l is the index variable of the temporal feature squeezing processing layer and the nonlinear spatial feature squeezing processing layer; exp is the exponential operation;
[0048] Next, the time-step weight is used to perform weighted processing and squeeze extraction on the time series data to extract the time series features of each time series feature squeeze processing layer; the introduction of time step weight, nonlinear activation function and logarithmic operation in the time series feature extraction formula is conducive to mining the interactive relationship between time steps, making the time series features more representative;
[0049] The time series feature extraction formula is as follows:
[0050]
[0051] in, is the time series feature of sensor i after the lth time series feature extrusion processing layer, expressed in the form of a vector. The initial time series feature of sensor i i is the index variable of the sensor; X t,iis the time series data of sensor i at time step t; σ is the Sigmoid activation function, which is used to introduce nonlinearity; ⊙ is the element-wise product operation.
[0052] In the process of extracting time series features, nonlinear spatial feature extrusion processing is performed on spatial data to extract spatial features. Nonlinear spatial feature extrusion processing compresses and aggregates spatial data by applying nonlinear transformation and vector operations to spatial data, enhances the ability to identify the correlation of spatial data, and generates more representative spatial features.
[0053] The nonlinear spatial feature extrusion processing process is as follows:
[0054] First, the nonlinear mapping vector is calculated for subsequent extrusion processing of spatial data. The nonlinear mapping vector formula introduces trigonometric functions, combines the spatial dimension with the nonlinear characteristics of spatial data, enhances the accuracy of spatial feature extrusion processing, and captures the deep correlation in spatial data;
[0055] The nonlinear mapping vector formula is as follows:
[0056]
[0057] in, is the nonlinear mapping vector of spatial data acquisition device j on spatial dimension s in the lth nonlinear spatial feature extrusion processing layer; s is the index variable of the spatial dimension; j is the index variable of the spatial data acquisition device; S is the total number of spatial dimensions; Y j (l-1) is the spatial feature of the l-1th nonlinear spatial feature extrusion processing layer, and sets the initial spatial feature of spatial data acquisition device j Used to calculate the nonlinear mapping vector of spatial data acquisition device j in spatial dimension s in the first nonlinear spatial feature extrusion processing layer is the spatial data of spatial data acquisition device j in spatial dimension s;
[0058] Next, the nonlinear mapping vector is used to perform nonlinear spatial feature extrusion processing on the spatial data. The spatial feature calculation formula introduces nonlinear activation functions and element products. Through logarithmic transformation, the spatial data is nonlinearly mapped and squeezed, which enhances the nonlinear expression ability of spatial features, improves the accuracy and robustness of spatial feature extraction, and increases the practical application value of spatial features.
[0059] The specific formula for calculating spatial characteristics is as follows:
[0060]
[0061] Among them, Y j (l)It is a spatial data acquisition device. The spatial features in the lth nonlinear spatial feature extrusion processing layer are expressed in the form of vectors.
[0062] The temporal characteristics describe the dynamic changes of the tested drugs in the time series, while the spatial characteristics reflect the distribution and characteristics of the tested drugs at different spatial points. In practical applications, the temporal characteristics and spatial characteristics can help understand the complex relationship between the quality of the tested drugs in the manufacturing process and the temporal evolution and spatial distribution.
[0063] S2: Fuse the temporal features and spatial features to generate comprehensive features; perform weighted probability prediction based on the comprehensive features to obtain prediction results; introduce uncertainty assessment items to evaluate the prediction results, determine the final quality grade of the drug, and generate a quality inspection report.
[0064] The temporal features of different time steps and the spatial features of different spatial dimensions are fused, and comprehensive features are generated by summing up all the temporal features and spatial features layer by layer. Specifically, a dynamic cross-fusion mechanism is introduced to capture independent features in the temporal and spatial dimensions through dual nonlinear activation functions, and the interactive relationship between temporal features and spatial features is mined through element product. Representative and robust comprehensive features are generated through layer-by-layer summation to reflect the complex characteristics of the tested drugs in the temporal and spatial dimensions.
[0065] The dynamic cross-fusion mechanism formula is as follows:
[0066]
[0067] Among them, Z is the comprehensive feature, expressed in vector form; N is the total number of sensors; M is the total number of spatial data acquisition devices; tanh is the hyperbolic tangent activation function, which is used to introduce nonlinearity.
[0068] Next, a weighted probability prediction is performed on the comprehensive features. The weighted probability prediction reflects the possibility of the tested drug being classified into different quality grades by calculating the predicted probability of each quality grade. The weighted probability prediction formula introduces the square root operation of the covariance matrix. By considering the relationship between the weight vectors of different quality grades, the accuracy of the weighted probability prediction is improved, and the complex relationship between the comprehensive features and the quality grade can be reflected. In addition, the covariance matrix is calculated by the maximum likelihood estimation method, which can dynamically adapt to the distribution of the comprehensive features of different tested drugs and optimize the prediction performance.
[0069] The specific formula for weighted probability prediction is as follows:
[0070]
[0071] Wherein, P(Quality=k) is the predicted probability that the tested drug is classified as the kth quality grade, which is the prediction result of weighted probability prediction; k is the index variable of the quality grade; K is the total number of quality grades; m is the sum index variable; y k is the weight vector of the kth quality grade, which is obtained by training a drug data set of known quality grades (including temporal features and spatial features) using a multi-layer neural network. The multi-layer neural network is an existing technology and will not be described in detail here; is the covariance matrix of weight vectors of different quality levels, which is used to capture the relationship between weight vectors of different quality levels. k The covariance is calculated using the maximum likelihood estimation method; T is the transpose operation.
[0072] Based on the prediction results, the possibility of the tested drugs being classified into different quality grades can be obtained, but the reliability and certainty of the prediction results cannot be fully evaluated. Therefore, the uncertainty assessment item is introduced to measure the clarity of the prediction results and evaluate the confidence of the current testing task.
[0073] The uncertainty assessment term formula is used to calculate the correction term after the prediction probability and covariance matrix adjustment to measure the confidence of the current detection task and the reliability of the prediction result. The correction term takes into account the interaction between the weight vectors of different quality levels, so that the uncertainty assessment term not only depends on the prediction probability, but also accurately reflects the influence between different quality levels, thereby improving the reliability of the uncertainty assessment term.
[0074] The uncertainty assessment formula is as follows:
[0075]
[0076] Among them, U(Z) is the uncertainty assessment term, which is a numerical value used to measure the clarity of the prediction results and the confidence of the current detection task; is the correction term after the covariance matrix is adjusted. A larger value of the uncertainty assessment term indicates that the prediction result has a higher uncertainty; if the value of the uncertainty assessment term is smaller, it indicates that the prediction result is more reliable.
[0077] According to experiments or expert experience, an uncertainty threshold is set. If the value of the uncertainty assessment item of the tested drug is lower than the uncertainty threshold, the quality grade with the highest predicted probability in the predicted result is directly used as the final test result. If the value of the uncertainty assessment item of the tested drug is not lower than the uncertainty threshold, manual review or re-verification is required, and the test results of the tested drug with the quality grade confirmed after manual review or re-verification are updated. If the quality grade of the tested drug cannot be determined after review, the tested drug will be transferred to a higher-level testing system for more detailed analysis to ensure that no potential quality problems are missed. Finally, the final test results of the tested drugs are summarized and a quality inspection report is generated for decision-making and quality control to ensure the quality and safety of the drug production process.
[0078] In summary, an intelligent drug quality detection method using deep learning has been completed.
[0079] The order of the embodiments of the invention is for description only and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0080] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
[0081] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that the technical solutions described in the above embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention.
Claims
1. A method for intelligent drug quality detection using deep learning, characterized in that: The following steps are involved: S1: Collect and preprocess the original time series data and original space data of the tested drugs to obtain time series data and space data; perform multi-layer time series feature extrusion processing and nonlinear space feature extrusion processing on the time series data and space data respectively to extract time series features and space features; S2: Fuse temporal features and spatial features to generate comprehensive features; Based on the comprehensive characteristics, weighted probability prediction is performed to obtain the prediction results; uncertainty assessment items are introduced to evaluate the prediction results, and the final quality grade of the drug is determined to generate a quality inspection report.
2. According to claim 1, a method for intelligent drug quality detection using deep learning is characterized in that: The S1 specifically includes: In the implementation of multi-layer time series feature squeezing processing, logarithmic and exponential operations are introduced to calculate the time step weights.
3. According to claim 2, a method for intelligent drug quality detection using deep learning is characterized in that: The S1 specifically includes: Based on the time step weight, the time series data is weighted and squeezed to extract the time series features. The time series feature extraction formula is as follows: in, is the time series feature of sensor i after being processed by the lth time series feature squeezing processing layer, expressed in the form of a vector; is the total number of time steps; W t (l) is the time step weight of time step t in the lth time series feature squeezing processing layer; X t,i is the time series data of sensor i at time step t; σ is the Sigmoid activation function; ⊙ is the element-wise product operation.
4. According to claim 1, a method for intelligent drug quality detection using deep learning is characterized in that: The S1 specifically includes: In the process of implementing the nonlinear spatial feature extrusion processing, the spatial dimension is combined with the nonlinear feature of the spatial data to calculate the nonlinear mapping vector.
5. According to claim 4, a method for intelligent drug quality detection using deep learning is characterized in that: The S1 specifically includes: Based on the nonlinear mapping vector, the spatial data is nonlinearly mapped and squeezed to generate spatial features. The specific formula for calculating the spatial features is as follows: Among them, Y j (l) is the spatial feature of the spatial data acquisition device j at the lth nonlinear spatial feature extrusion processing layer; S is the total number of spatial dimensions; is the nonlinear mapping vector of spatial data acquisition device j on spatial dimension s in the lth nonlinear spatial feature extrusion processing layer; It is the spatial data of spatial data acquisition device j in spatial dimension s.
6. The method for intelligent drug quality detection using deep learning according to claim 1, characterized in that: The S2 specifically includes: A dynamic cross-fusion mechanism is introduced to generate comprehensive features by summing up the temporal features and spatial features layer by layer. The formula of the dynamic cross-fusion mechanism is as follows: Among them, Z is the comprehensive feature; L is the total number of processing layers; N is the total number of sensors; M is the total number of spatial data acquisition devices; tanh is the hyperbolic tangent activation function.
7. The method for intelligent drug quality detection using deep learning according to claim 1, characterized in that: The S2 specifically includes: The weighted probability prediction reflects the possibility of the tested drug being classified into different quality grades by calculating the predicted probability of each quality grade; the specific formula for weighted probability prediction is as follows: Where P(Quality=k) is the predicted probability that the tested drug is classified as the kth quality grade, which is the prediction result of weighted probability prediction; k is the index variable of the quality grade; K is the total number of quality grades; m is the sum index variable; γ k is the weight vector of the kth quality level; is the covariance matrix of weight vectors of different quality levels, through γ k The covariance was calculated using the maximum likelihood estimation method; is the transpose operation.
8. The method for intelligent drug quality detection using deep learning according to claim 7, characterized in that: The S2 specifically includes: Uncertainty assessment items are introduced, and the value of the uncertainty assessment items is calculated based on the predicted probability of quality grades combined with weight vectors of different quality grades; based on the value of the uncertainty assessment items, the prediction results are evaluated, and for test drugs whose values of the uncertainty assessment items are less than the set uncertainty threshold, the quality grade with the highest predicted probability in the prediction results is taken as the final test result; for test drugs whose values of the uncertainty assessment items are not less than the set uncertainty threshold, further tests are carried out; the final test results of the test drugs are summarized to obtain the final test results and generate a quality test report.