Method for establishing Akafen powder identification model based on support vector machine
Based on the infrared spectral analysis method based on support vector machines, the problem of distinguishing difficulties in the distinction of glycolic scattered in drug detection is solved, and a fast and accurate distinction is achieved, and the detection efficiency and safety are improved.
Patent Information
- Application Number
- CN202411209397.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2025-01-28
AI Technical Summary
The prior art is difficult to quickly and accurately distinguish Aca Powder from its adulteration or adulterated products in drug production and market supervision, resulting in inaccurate testing results, long time-consuming, and polluting the environment and resources.
Based on the method of support vector machine (SVM), a qualitative classification model is established by collecting and preparing infrared spectrum data of glycaols and other standard samples. This model includes SVM classifier training of data standardization, main component analysis (PCA) dimension and linear nuclear function, which is used to distinguish with glycolin and non -glycoltic drugs.
The accuracy and efficient distinction between glycols and non -glycolic scattered drugs are realized, the testing time and resource consumption are reduced, the efficiency of drug quality control is improved, and the risk of environmental pollution is reduced.
Smart Images

Figure CN119380846A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of drug inspection, and in particular, relates to the technical field of a detection method for acetaminophen powder based on a support vector machine. Background Art
[0002] With the rapid expansion of the global pharmaceutical market and the growing demand for healthcare, the quality control and safety monitoring of drugs are particularly critical. Acacia phenol powder is mainly a compound preparation composed of aspirin, acetaminophen and caffeine, of which aspirin and acetaminophen can inhibit prostaglandin synthesis and have antipyretic and analgesic effects; caffeine is a central nervous system stimulant that can enhance the antipyretic and analgesic effects of the above-listed drugs. Acacia phenol powder is one of the commonly used clinical drugs for treating fever caused by the common cold or influenza and relieving mild to moderate pain. The product has a large output and a wide market demand, and is very common in daily market supervision and random inspections. Due to the high market share of this product and the large number of random inspections each year, a large amount of manpower, material resources and financial resources need to be repeatedly consumed in inspections and tests, and the daily inspection cycle is long, requiring the consumption of a large amount of chemical reagents, reference substances, etc., which pollutes the environment and causes waste of resources. Therefore, as a drug widely used in clinical practice, the safe and effective use of Acacia phenol powder depends on a strict quality control process to ensure that it can be accurately distinguished from other drugs. However, traditional methods of drug identification, including chromatography and mass spectrometry, although highly accurate, usually involve complex sample processing, long analysis cycles and high operating costs, which limit their application in routine rapid drug testing.
[0003] As a non-destructive, highly sensitive and selective analytical method, infrared spectroscopy provides innovative solutions for the field of chemical and pharmaceutical analysis. By analyzing the absorption characteristics of molecules to infrared spectra, IR technology can provide detailed information on molecular structure and chemical composition. If combined with advanced data processing technology and algorithms, it will have the potential to achieve rapid and accurate analysis of complex samples.
[0004] The Chinese patent application number CN201410589498.X discloses a method for identifying furs by near-infrared spectroscopy based on grouping support vector machines, and the steps are as follows: (1) collecting near-infrared spectral data of different types of furs, and preprocessing and KPCA feature extraction of these near-infrared spectral data; (2) establishing a training set of fur near-infrared spectral data; (3) using a grouping support vector machine to train the training set to form a fur classifier; (4) using the fur classifier to identify the fur samples to be identified. The invention discloses the use of near-infrared spectroscopy technology, and the data obtained through spectral preprocessing and feature extraction can capture the subtle difference information of the near-infrared spectra of different types of furs; and using a grouping support vector machine to identify the types of furs, the classification of different types of furs can be achieved. However, the application requires the number of fur types to be preset and combined in pairs. For single furs with complex chemical compositions and mutual interference between the infrared spectrum peaks, the above technical solutions are often not well operated and used.
[0005] The Chinese patent application number CN201710541051.9 discloses a method for grading peach quality based on a noise-resistant support vector machine based on boundary points, and the steps are as follows: (1) collecting visible / near-infrared spectral data of peaches of different quality grades, and preprocessing and PCA feature extraction of the visible / near-infrared spectral data; (2) combining the visible / near-infrared spectral sample sets of peaches of different quality grades in pairs to establish multiple sets of visible / near-infrared spectral training sets of peaches; (3) using the noise-resistant support vector machine based on boundary points to train the training set to obtain multiple peach quality grade classifiers; (4) using the peach quality grade classifier to detect the visible / near-infrared spectra of peaches to be graded. The invention uses the noise-resistant support vector machine based on boundary points to detect the visible / near-infrared spectra of peaches, and can realize the grading of peach quality grades in a noise detection environment. The application also discloses the use of near-infrared spectral data sets to train SVM classifiers to obtain corresponding identification and classification methods, but the classification is still performed under the condition of known original data. For scenarios where adulteration may exist in corporate production lines or market supervision, how to conduct targeted training on the classifier to make its division boundaries clearer, so as to make it more suitable for various identification and identification scenarios of acetaminophen powder, the above method does not provide a corresponding solution.
[0006] In summary, although the above patents all disclose the collection of infrared spectral data as raw data, and after pre-processing, it is used to train the SVM classifier to obtain the corresponding classification system for the identification or classification of unknown samples, but none of them indicates whether the process is applicable to acetaminophen powder. In other words, in the classification and identification process of acetaminophen powder, it is not known in advance what kind of adulteration and counterfeiting exists in the production, and how it affects the infrared spectral data, so it is impossible to predict in advance the possible complex classification situations. Therefore, finding a qualitative classification model of infrared spectroscopy for acetaminophen powder that can accurately and specifically identify and distinguish has become a technical problem that needs to be solved urgently by those skilled in the art. Summary of the invention
[0007] In view of the existence of adulteration and doping in the production process of acetaminophen powder, when infrared spectroscopy is used for detection, in addition to the interference caused by its own complex components, it will also be affected by other additives, resulting in inaccurate detection results and a long time consumption. The purpose of the present invention is to provide a method for modeling based on support vector machines, to obtain an infrared qualitative classification model of acetaminophen powder, which can accurately and efficiently distinguish acetaminophen powder drugs from non-acetaminophen powder drugs.
[0008] The technical solution adopted by the present invention to solve its technical problem is:
[0009] A method for establishing an identification model of acetaminophen powder based on a support vector machine comprises the following steps:
[0010] S1: Raw data collection: Collect raw data as modeling samples, the raw data including: infrared spectrum data of standard acetaminophen powder sample and infrared spectrum data of other standard samples.
[0011] The quantity ratio of the above-mentioned standard acetaminophen powder sample to other standard samples is 90-150:5-20; further preferably 90 and 5 respectively; among which, other standard samples can be: Acetophenone capsules, compound acetaminophen tablets, compound acetaminophen granules, vitamin C and sucrose.
[0012] In this step, select the appropriate number of samples and the proportional relationship. Since infrared spectral data usually contains rich chemical information, but may also contain noise, a sufficient number of samples helps the model capture the real changes in the data. Combined with the needs of SVM (support vector machine), SVM performs classification by finding the optimal decision boundary for dividing different categories in the feature space. The present application sets the number ratio of standard acetaminophen powder samples to other standard samples at 90-150:5-20. By setting appropriate sample data to help the model learn better and obtain the decision boundary, the types of other standard samples are optimized, which enables the machine to autonomously learn the characteristics of acetaminophen powder for classification based on sufficient sample data, and at the same time, it can better find the difference between it and non-acetaminophen powder, making the classification boundary between the two clearer, so as to finally achieve the distinction between acetaminophen powder and non-acetaminophen powder.
[0013] Standard acetaminophen powder samples and other standard samples were collected separately, and infrared scanning was performed to obtain corresponding spectral data. The infrared spectral data of other standard products were used together as the original data for modeling, and Aciclovine Capsules, Compound Aciclovine Tablets, Compound Aciclovine Granules, Vitamin C and sucrose were selected as the preferred six other standard samples. The above five drugs can usually be used as adulterants in the production process of acetaminophen powder. Among them, the product of Aciprofloxacin Capsules is in powder form and its color is similar to that of acetaminophen powder. The preparation contains the same acetaminophen and caffeine ingredients as acetaminophen powder, and the infrared spectra are similar. The functions, indications and use are similar to those of acetaminophen powder; the product of Compound Aciprofloxacin Tablets is in powder form and its color is similar to that of acetaminophen powder. The preparation contains the same acetaminophen and caffeine ingredients as acetaminophen powder, and the infrared spectra are similar. The functions, indications and use are similar to those of acetaminophen powder; the product of Compound Aciprofloxacin Granules is in powder form and its color is similar to that of acetaminophen powder. The preparation contains the same acetaminophen and caffeine ingredients as acetaminophen powder, and the infrared spectra are similar. The functions, indications and use are similar to those of acetaminophen powder; Vitamin C and sucrose are general additives in the pharmaceutical process. The sources of raw materials are wide, the production, circulation and use are not strictly supervised, and they are cheap and widely used, so they are easily used in the production of fake and inferior drugs. The other standard drugs mentioned above were added to participate in the modeling process as category 2 in the label array, that is, "non-acetaminophen powder". In addition to considering the actual adulteration situation in production and life, general additives such as vitamin C and sucrose were selected. At the same time, drugs that overlap and interfere with acetaminophen in the infrared spectrum were selected. This allows the obtained model to take into account the commonalities of the infrared spectrum of acetaminophen powder and the differences from similar substances, making the obtained infrared qualitative analysis model more credible.
[0014] S2: Data preprocessing and standardization: Perform Z-Score standardization preprocessing on the above raw data to obtain standardized data.
[0015] In this step, Z-Score standardization is used as a key step in data preprocessing for spectral data collected by infrared spectroscopy (IR). Z-Score standardization, also known as standard deviation standardization, is a data standardization method that aims to eliminate the impact of dimension by adjusting the scale of the data while reducing the variability between different samples. Specifically, the Z-Score value of each spectral data point is calculated by subtracting the average value of the entire data set at that wavenumber point from its original value, and then dividing it by the standard deviation of that wavenumber point. The mathematical formula is expressed as: Z = (X-μ) / σ, where X corresponds to the spectral intensity value of each sample at a specific wavenumber (or frequency), μ is the average spectral intensity value of all samples at that wavenumber, and σ is the standard deviation of the spectral intensity values of all samples at that wavenumber. In this way, the data at each wavenumber point is converted to a distribution centered on 0 with a standard deviation of 1.
[0016] The data after Z-Score standardization has a unified dimension and scale, which is crucial for subsequent model building and analysis. It not only helps to improve the convergence speed of the model, but also ensures that all features have the same scale, so that the PCA and subsequent SVM training process are not biased towards certain features, that is, it enhances the adaptability of the model to features of different scales. In addition, Z-Score standardization can also improve the generalization ability of the model, making it more robust and having better predictive performance for unknown samples. By performing Z-Score standardization on spectral data, the consistency and comparability of the data can be ensured, creating favorable conditions for establishing an accurate and effective IR qualitative analysis model. This preprocessing step is an indispensable part of the data processing process of this study, and provides a solid foundation for in-depth analysis and understanding of the spectral differences between samples.
[0017] S3: Prepare the label array: initialize the label array, mark the infrared spectrum data of the standard acetaminophen powder sample as category 1, and mark the infrared spectrum data of other standard samples as category 2.
[0018] In this step, the label array is initialized to make it the same size as the target label array. The target label array refers to an array containing the true categories of all original data. Its main function is to provide the true category labels of all samples to facilitate the training of the model. The data is divided into different corresponding categories according to the true category information in the target label array. Then, during the training process, the standardized data and label array are used as input. The support vector machine (SVM) uses the true category information in the label array to learn the decision boundary. The SVM will learn how to distinguish between the standard acetaminophen powder sample and other standard samples based on the category information in the label array, thereby achieving classification.
[0019] S4: SVM model training: Use the PCA algorithm to reduce the above standardized data to a low dimension, and select the first two principal components PC1 and PC2 for training the SVM classifier. Set the kernel function of SVM to a linear kernel, and the standardize parameter is set to true to obtain an SVM model containing a decision boundary. The basic formula for the above decision boundary is: w·x+b=0, where w is a weight vector, which is determined autonomously during the training process, x is an input data vector, and b is a bias term. When the first two principal components PC1 and PC2 are preferred for model training, the formula for the decision boundary is: w 1 PC1+w 2 PC2+b=0.
[0020] In this step, the SVM model is finally obtained, which includes the following parts.
[0021] Dataset: Data used to train and test the model. In this application, the dataset contains infrared spectral data of standard acetaminophen powder samples and other standard samples.
[0022] Feature extraction: The main features of the original data are extracted through principal component analysis (PCA), which retains the main variation information of the data.
[0023] Classifier: Such as the SVM model of this application, which uses training data to find an optimal decision boundary to distinguish different categories of data. As an important part of the detection model, the decision boundary is obtained by the SVM classifier through data training and is used to separate different categories of data. This application uses a linear SVM, and the decision boundary is a hyperplane with the formula: w·x+b=0, where w is the weight vector (i.e., the normal vector of the hyperplane), which is determined by the training process; x is the input data vector; and b is the bias term. In practical applications, this formula is concretized as: w 1 x 1 +w 2 x 2 +…+w n x n +b=0.
[0024] In this model, the specific meaning of the decision boundary is the classification boundary that divides the infrared spectrum data of Acacia phenol powder into different categories. The parameters of the decision boundary (weight vector w and deviation b) do not directly represent a certain characteristic or component of Acacia phenol powder, but are calculated based on the spectral characteristics of this characteristic and component. In other words, the decision boundary parameter is a segmentation plane of the infrared spectrum data of Acacia phenol powder in the high-dimensional feature space, and this segmentation plane is calculated based on the statistical characteristics of the data. Through the selection of original data and the specific adjustment of modeling parameters, the characteristic classification of Acacia phenol powder in the model is clearer, and the boundary with the non-Acacia phenol powder part is also clearer and more accurate, so that it can be better applied to the classification and identification process in production and life.
[0025] Principal component refers to the projection of raw data into a new coordinate system by PCA through linear transformation. These new coordinate axes are called principal components. Each principal component is a linear combination of the original features, and the principal components are mutually orthogonal. PCA (principal component analysis) is used to reduce the dimension of high-dimensional infrared spectral data to low dimensions to remove noise and redundant features, and reduce the complexity of the data, while retaining the main information of the data as much as possible, and improving the performance of the SVM model. In infrared spectral data, the absorption intensity of each wavelength is a feature. PCA uses linear transformation to find the direction that best explains the data variance.
[0026] The preferred technical solution uses the first two principal components. Since infrared spectral data is usually high in dimension, PCA can reduce the dimension and reduce the computational cost. Furthermore, the first two principal components (PC1, PC2) are the first two important directions of the transformed data in the new coordinate system. These two directions can explain the largest part of the data variance. And the use of the first two principal components (PC1 and PC2) can easily visualize the data in two dimensions, which helps to observe the distribution and classification effect of the data.
[0027] The technical solution can also use more principal components, and the number of principal components selected depends on the complexity of the data and the amount of information retained after dimensionality reduction. For this application, 2 to 10 principal components can be selected, and the specific number depends on the proportion of the total variance explained, so that the principal components explain most of the variance as much as possible.
[0028] Then, the SVM model is trained on the reduced-dimensional data. The linear kernel function is chosen, which is simple and efficient to calculate. It is used for linearly separable data sets, has fast training and prediction speeds, and is highly adaptable. For infrared spectral data, the linear kernel function is sufficient, and the processing process is relatively simple. Compared with other kernel functions, such as Gaussian kernel / Laplacian kernel, it can process nonlinearly separable data, but has high computational complexity and is prone to overfitting, especially in infrared spectral data with a large number of features. As for the polynomial kernel, it is more suitable for nonlinear data of certain specific patterns, and the parameter selection is more complicated, which easily leads to increased model complexity.
[0029] The 'Standardize' parameter, that is, the standardization parameter is set to true, which means that the data is standardized during the prediction process. Since different wavelengths of infrared spectral data may have different dimensions and ranges, the standardized setting can adjust all feature data to the same scale, thereby avoiding the excessive influence of certain features on PCA transformation and SVM classification, which helps to improve the robustness of the model. In addition, the standardized data is more suitable for algorithms such as PCA and SVM, because these algorithms are sensitive to the scale of the data. Standardization can speed up the convergence speed and improve the classification accuracy, thereby improving the performance of the algorithm. Failure to use standardization will lead to unbalanced feature contributions. Unstandardized data will make the model biased towards certain features, especially in high-dimensional data. Some feature values have a large range and will dominate the PCA and SVM training process, resulting in increased errors and decreased model performance. Furthermore, with respect to the characteristics of the infrared spectral data of the acetaminophen powder of the present application, the absorption intensity of different wavelengths may vary significantly. If no standardization is performed, PCA may favor wavelengths with a larger numerical range and ignore other wavelengths with important information. Standardization can ensure that the absorption intensity of each wavelength contributes information in a balanced manner during the PCA and SVM training process, thereby improving the generalization ability and prediction accuracy of the model.
[0030] Compared with the prior art, the embodiments of the present invention have at least the following beneficial effects:
[0031] 1. The data processed by PCA dimensionality reduction is used to train the SVM model, and a clear classification boundary is obtained. As shown in the visualization result Figure 1 As shown, SVM successfully distinguished two types of samples, namely, acetaminophen and non-acetaminophen. The certainty of the decision boundary and the classification loss in cross-validation proved the excellent performance and robustness of the SVM model obtained in this application on the data set, and it can be well applied to the identification and discrimination of acetaminophen.
[0032] 2. In addition to acetaminophen powder, the application also selected other common adulterants or similar substances to participate in the modeling process. The resulting qualitative analysis method can not only optimize the quality control in the drug production process and improve the efficiency of drug testing, but also serve as an important safety measure in the drug circulation and consumption links, greatly reducing the risk of drug confusion and misuse, and protecting consumer health.
[0033] 3. Before using the SVM classifier for model training, Z-Score standardization is used to enable the classification process to more sensitively capture subtle differences between samples, thereby improving the accuracy and reliability of modeling; and after obtaining the predicted response value, the appropriate threshold is selected according to the degree of difference between different categories of drugs in the original data to make the qualitative identification process more accurate.
[0034] 4. The identification model of this application can not only be used to optimize the quality control in the drug production process and improve the efficiency of drug inspection, but also can be used as an important safety measure in the drug circulation and consumption links, greatly reducing the risk of drug confusion and misuse, and protecting consumer health. In addition, this application also aims to explore the application potential of infrared spectroscopy technology in drug quality control and safety supervision, provide scientific and efficient technical support for drug regulatory authorities and the pharmaceutical industry, and promote the widespread application of infrared spectroscopy technology in the field of pharmaceutical analysis. Through this research, it is expected to contribute to ensuring drug quality and safety and protecting public health, and also provide new ideas and methods for research in related scientific and technological fields. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments and comparative examples are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0036] Figure 1 It is a visualization diagram of the support vector machine (SVM) model of the present invention. DETAILED DESCRIPTION
[0037] In order to make the purpose, technical scheme and advantages of the embodiments of the present invention clearer, the technical scheme in the embodiments of the present invention will be described clearly and completely below. If the specific conditions are not specified in the embodiments, they are carried out according to conventional conditions or conditions recommended by the manufacturer. If the manufacturer of the reagents or instruments used is not specified, they are all conventional products that can be purchased commercially.
[0038] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments can be combined with each other. The present invention will be described in detail below with reference to specific embodiments.
[0039] S1: Raw data collection: Raw data is collected, including infrared spectral data of 90 standard acetaminophen powder samples and infrared spectral data of 5 other standard samples, including aminocaproamine capsules, compound aminocaproamine tablets, compound aminocaproamine granules, vitamin C and sucrose. The category labels contained in the above raw data are target label arrays.
[0040] S2: Data preprocessing and standardization: Perform Z-Score standardization preprocessing on the above raw data to obtain standardized data.
[0041] S3: Prepare the label array: initialize the label array to make it the same size as the target label array, mark the infrared spectrum data of the standard acetaminophen powder sample as category 1, and mark the infrared spectrum data of other standard samples as category 2.
[0042] S4: SVM model training: Use the PCA algorithm to reduce the standardized data to a low dimension, select the first two principal components PC1 and PC2 for training the SVM classifier; set the kernel function of the SVM to a linear kernel, and set the standardization parameter to true, indicating that the data is standardized during the prediction process, and obtain the SVM model. The above SVM model includes a decision boundary, and the basic formula is: w·x+b=0, where w is a weight vector determined during the training process, x is an input data vector, and b is a bias term; when the first two principal components PC1 and PC2 are selected for model training, the formula for the decision boundary is: w 1 PC1+w 2 PC2+b=0.
[0043] For this application, after the model is established, the specific implementation process also includes: S5: cross validation; S6: data visualization; S7: drawing the decision boundary.
[0044] Among them, S5 cross-validation includes the following steps: create a stratified K-fold and cross-validate partition object, set K=5, ensure that the category ratio of each fold is the same as the complete dataset, use the above cross-validation partition object, perform cross-validation on the above SVM model, and calculate the cross-validation loss.
[0045] Cross-validation is a technique for evaluating model performance. It measures the average error of the model by dividing the dataset into multiple subsets, training and validating the model on each subset, thereby obtaining an evaluation of the robustness and generalization ability of the model. Calculating the loss is an important step in the modeling process.
[0046] This model uses 5-fold cross validation, which means that the dataset is divided into 5 parts. In 5 iterations, 4 parts are used for training each time, and the remaining 1 part is used for validation. This parameter can be adjusted according to the size of the dataset. Generally, more folds will increase the accuracy of model validation, but it will also increase the computational cost. And by setting the 'Stratify' parameter to true, it ensures that the category ratio of each fold is consistent with the complete dataset, which is very important for unbalanced datasets to avoid bias during training or validation.
[0047] Calculating loss is used to evaluate the model. Cross-validation loss can provide average performance indicators of the model on different data subsets, such as error rate, accuracy, etc., to help evaluate the stability and generalization ability of the model. It can also avoid overfitting. By evaluating the model on different data subsets, calculating loss can detect whether the model performs well on specific data but poorly on other data, thereby avoiding overfitting.
[0048] Computational loss can also be used for model selection and tuning, including hyperparameter tuning: During cross-validation, computational loss can help select the best hyperparameter combination to improve model performance. For example, select the optimal regularization parameter, kernel function parameter, etc. During different model training processes, by comparing the cross-validation losses of different models, the model with the best performance can be selected for practical applications.
[0049] The application obtains the result of calculating the classification loss: Classification Loss is: 0, which means that the obtained model did not produce any classification errors during the cross-validation process, which shows that the model fits the training data very well.
[0050] S6: Data Visualization: Draw a scatter plot of the PCA-transformed data, use different colors and markers to represent different categories, and highlight the support vectors of the SVM model.
[0051] In this step, using data visualization to enhance understanding can help understand data characteristics and model behavior, make complex mathematical concepts intuitive, and facilitate the presentation and explanation of model results to others, especially when communicating with non-technical personnel. And through visualization, it is easier to find outliers, noise, and other potential problems in the data.
[0052] S7: Plot the decision boundary: Determine the coordinate range and create a grid, use the predict function to calculate the decision values on the grid, use the contour function to plot the decision boundary (solid line) and margin (dashed line), and add it to the above scatter plot.
[0053] The prediction function is a standard interface for classifying new data. For a trained SVM model, the prediction function can be used to calculate the classification results of the grid points. The prediction function simplifies the process of classifying new data points, eliminating the need to manually calculate the classification results and draw the decision boundary. By using the prediction function, the low-dimensional data after PCA transformation can be classified, and a clear decision boundary can be drawn to demonstrate the classification ability of the model.
[0054] like Figure 1 As shown, Figure 1 It is a visualization diagram of the support vector machine (SVM) model of the present invention. According to the content of the diagram, the red "X" and blue "O" marks in the figure represent the positions of samples of two different categories in the two-dimensional space after PCA conversion. The points marked with black circles represent the support vectors in the SVM model, which are the key data points that determine the dividing line of the model. In SVM, the support vectors are those points closest to the dividing line, which directly affect the position and direction of the dividing line. The black solid line in the figure is the decision boundary learned by the SVM model, which divides the data points into two categories, and this line provides the maximum interval between the two categories as much as possible. The black dotted lines on both sides represent the interval of the decision boundary, that is, the "safety margin" of the classification, and the points closest to these two dotted lines are the support vectors.
[0055] Figure 1 The combination of the PCA and classification loss illustrates the classification performance of the SVM model on this particular data. The two categories of data are clearly separated after PCA dimensionality reduction, and the model is able to accurately distinguish between them. The chart intuitively shows how the data points processed by PCA are successfully classified by the SVM model, and how the model determines the decision boundary based on these data points. It is possible to clearly see the distribution of the data points and how the model establishes the decision boundary based on these points, and since the classification loss is zero, it means that the model performs perfectly on the current dataset.
[0056] In summary, the classification loss of SVM is zero, proving the effectiveness of the chosen classification strategy. The application of PCA transformed data in combination with SVM not only provides decision boundaries for classification, but these boundaries also show excellent performance during validation. The decision boundaries are clearly shown in the visualization, confirming that the two classes of the data can be clearly separated.
[0057] The present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0058] Example
[0059] like Figure 1 As shown, Figure 1 It is a visualization diagram of the support vector machine (SVM) model of the present invention.
[0060] The modeling process of the embodiment is implemented according to the above technical solution.
[0061] In support vector machines (SVM), the equation of the classification function is usually a linear equation: f(x) = w T x+b, where w is the weight vector, X is the input feature vector, and B is the bias term.
[0062] For SVM with linear kernel, the decision boundary is defined by this linear equation. When f(x) = 0, the decision boundary is obtained; when f(x) > 0 or f(x) < 0, the data points are classified into different categories.
[0063] The instruments and equipment used in this embodiment include: Perkin Elmer Spectrum 100 Fourier transform infrared spectrometer; application software version: Spectrum IR 10.6.2.1159, MATLAB R2023b23.2.0.2365128; computer model: Lenovo; operating system: Microsoft Windows 11Pro for Workstations; processor: IntelCore i7-12800HX@4.80GHz; installed memory (RAM): 32.00GB; system type: 64-bit operating system.
[0064] The standard acetaminophen powder sample selected in this example comes from:
[0065] Chongqing Heping Pharmaceutical Co., Ltd. 37 batches (batch number: 230244, 230344, 230238, 230342, 230228, 230204, 221138, 221235, 221206, 221207, 230209, 230207, 220807, 230215, 230 40, 230417, 230435, 230314, 230451, 230540).
[0066] 22 batches from Baiyunshan Hejigong Pharmaceutical Factory of Guangzhou Baiyunshan Pharmaceutical Group Co., Ltd. (Batch No.: J1782 for 2 batches, K1076 for 2 batches, K1094 for 2 batches, J1757, K1123, J1780, K1075, J1759, J1737, J1341, J1428, J1830, J1794, J1781, J1769, J1766, K1146, J1220, K1006).
[0067] 12 batches from Chongqing Shengao Biochemical Pharmaceutical Co., Ltd. (batch numbers: 221202 for a total of 2 batches, 230304 for a total of 2 batches, 230102 for a total of 2 batches, 230103, 230301, 230302, 230104, 230305, 221101).
[0068] 4 batches of Sichuan Zilinggong Pharmaceutical Co., Ltd. (Batch numbers: 230305, 230301, 230404, 230101).
[0069] 3 batches from Guangdong Nanguo Pharmaceutical Co., Ltd. (Batch numbers: 230315, 230404, 230225).
[0070] 3 batches from Gaitianli Pharmaceutical Holding Group Huadong Pharmaceutical Co., Ltd. (Batch No.: 2302001 for a total of 2 batches, and 2302002).
[0071] 2 batches from Chongqing Core Pharmaceutical (Group) Co., Ltd. (batch numbers: 833004, 813009).
[0072] 2 batches from Chongqing Dikang Changjiang Pharmaceutical Co., Ltd. (batch numbers: 230301, 230401).
[0073] 2 batches from Youhua Pharmaceutical (Leshan) Co., Ltd. (batch numbers: 2023005, 2023001).
[0074] 1 batch from Guizhou Miyi Health Pharmaceutical Co., Ltd. (batch number: 1230204).
[0075] 1 batch from Kangmeibaoning (Sichuan) Pharmaceutical Co., Ltd. (batch number: 221205).
[0076] 1 batch from Yunnan Yizhihao Pharmaceutical Co., Ltd. (batch number: 23020901).
[0077] Other standard samples selected in this embodiment include: Compound Paracetamol Granules, Sichuan Emeishan Pharmaceutical Co., Ltd., product batch number: 20220901 (250 mg of paracetamol, 15 mg of caffeine, 1 mg of chlorpheniramine maleate, 10 mg of artificial bezoar); Aminocacin Capsules, Sichuan Deyuan Pharmaceutical Group Co., Ltd., product batch number: 230401 (250 mg of paracetamol, 15 mg of caffeine, 1 mg of chlorpheniramine maleate, 10 mg of artificial bezoar); Compound acetaminophen tablets, Sichuan Yike Pharmaceutical Co., Ltd., product batch number: 211202 (acetaminophen 250 mg, amantadine hydrochloride 100 mg, chlorpheniramine maleate 2 mg, artificial bezoar 10 mg, caffeine 15 mg); Vitamin C tablets, Sichuan Yike Pharmaceutical Co., Ltd., product batch number: 230403; Sucrose, China Food and Drug Inspection Institute, product batch number: 111507-202105.
[0078] The obtained identification model was used for qualitative identification to test its reliability and stability. 19 batches of acetaminophen powder samples were purchased from Chongqing Dikang Changjiang Pharmaceutical Co., Ltd., Chongqing Shengao Biochemical Pharmaceutical Co., Ltd., Guizhou Guangzheng Pharmaceutical Co., Ltd., and Yunnan Yizhihao Pharmaceutical Co., Ltd.; 3 batches of compound acetaminophen capsules, 4 batches of compound acetaminophen granules and 10 other batches of drugs with similar functions and indications were selected from the Sichuan Provincial Drug Supervision Sampling Task undertaken by Neijiang Food and Drug Inspection and Testing Center in 2023 and 2024 for verification. The information of each sample and the model judgment results are shown in Table 1.
[0079] The 36 samples involved in this verification were reviewed and tested in accordance with the "National Drug Standards". High performance liquid chromatography and other methods were used to determine the content of the main components of samples 1 to 36. The results are shown in Table 1.
[0080] Table 11 to 36 sample identification and verification results
[0081]
[0082]
[0083] It can be seen from Table 1 that the identification model obtained in this application can accurately judge each sample with an accuracy rate of 100%.
[0084] The embodiments described above are part of the embodiments of the present invention, rather than all of the embodiments. The detailed description of the embodiments of the present invention is not intended to limit the scope of the application 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 making creative work are within the scope of protection of the present invention.
Claims
1. A method for establishing an identification model of acetaminophen powder based on a support vector machine, characterized in that: The following steps are involved: S1: Raw data collection: Collect raw data as modeling samples, the raw data including: infrared spectrum data of standard acetaminophen powder sample and infrared spectrum data of other standard samples; S2: Data preprocessing and standardization: performing Z-Score standardization preprocessing on the raw data to obtain standardized data; S3: Prepare the label array: initialize the label array to make it the same size as the target label array, mark the infrared spectrum data of the standard acetaminophen powder sample as category 1, and mark the infrared spectrum data of other standard samples as category 2; S4: SVM model training: Use the PCA algorithm to reduce the standardized data to a low dimension, select the number of principal components as 2, train the SVM classifier, and generate an SVM model containing a decision boundary.
2. The method for establishing an identification model of acetaminophen powder based on a support vector machine according to claim 1, characterized in that: When training the SVM classifier in S4, the kernel function is set to a linear kernel and the normalization parameter is set to true.
3. The method for establishing an identification model of acetaminophen powder based on a support vector machine according to claim 1, characterized in that: In S4, when the first two principal components PC1 and PC2 are selected for training, the formula of the decision boundary is: w1PC1+w2PC2+b=0.
4. The method for establishing an identification model of acetaminophen powder based on a support vector machine according to claim 1, characterized in that: The quantity ratio of the standard acetaminophen powder sample to the other standard samples is 90-150:5-20.
5. The method for establishing an identification model of acetaminophen powder based on a support vector machine according to claim 4, characterized in that: There are 90 standard acetaminophen powder samples and 5 other standard samples.
6. The method for establishing an identification model of acetaminophen powder based on a support vector machine according to claim 5, characterized in that: The other standard samples include: aminophenamine capsules, compound aminophenamine tablets, compound aminophenamine granules, vitamin C and sucrose.
Citation Information
Patent Citations
Fur near-infrared spectral discrimination method based on packet support vector machine
CN104318260A
A method for quality grading of peaches based on boundary point-based noise-resistant support vector machine
CN107463942B
