Drug identification method, device and equipment based on spectrum correlation dimension raising and medium

Through a method based on spectral correlation dimensionality-up, drug samples are preprocessed and feature screened, combined with correlation analysis and heat map recognition, the portability and accuracy problems of traditional drug detection technology are solved, and efficient drug recognition is achieved.

CN119810575AActive Publication Date: 2025-04-11NATIONAL INSTITUTE OF METROLOGY CHINA +3
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202510289705.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-12
Publication Date
2025-04-11
Estimated Expiration
2045-03-12

AI Technical Summary

Technical Problem

Traditional drug detection technology cannot meet portable needs, it is cumbersome and time-consuming, making it difficult to achieve rapid on-site detection, and the recognition accuracy of multi-spectral fusion technology is less than 90%.

Method used

Using a method based on spectral correlation dimensionality-up, the near-infrared and mid-infrared spectral data of drug samples were obtained, pre-processing, feature spectral screening, correlation analysis and heat map recognition, and the pre-trained recognition model was used for identification.

Benefits of technology

The accuracy and robustness of drug identification have been improved, the negative impact of dopants has been reduced, and the recognition accuracy has been increased to 94.44%.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119810575A_ABST
    Figure CN119810575A_ABST
Patent Text Reader

Abstract

The invention provides a drug identification method, device, equipment and medium based on spectrum correlation dimension raising, and relates to the field of drug identification, the method comprises the following steps: obtaining spectrum data of a drug sample, and adopting at least two preprocessing methods to preprocess the spectrum data to obtain target spectrum data, the target spectrum data comprises near infrared data and intermediate infrared spectrum data; screening the target spectral data by adopting a spectral variable selection method to obtain characteristic spectral data; constructing a spectrum matrix according to the wavelength of the characteristic spectrum data to obtain a near-infrared matrix and a middle-infrared matrix, carrying out correlation analysis on the near-infrared matrix and the middle-infrared matrix to obtain a correlation coefficient matrix, converting the correlation coefficient matrix into a heat map, and recognizing the heat map by adopting a pre-trained recognition model to obtain a recognition result. According to the method, the characteristic variables are screened and correlation analysis is carried out, one-dimensional data is upgraded to two-dimensional data, spectral information of drugs is highlighted, and the recognition accuracy of the established model reaches 94% or above.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of drug identification, and in particular to a drug identification method, device, equipment and medium based on spectral correlation dimensionality upgrading. Background Art

[0002] Although traditional drug detection technology has high accuracy, it is limited by the expensive detection equipment, the reserve of professional technicians, and the large area occupied by the instrument. It cannot meet the portability requirements and can only be tested in the laboratory. The operation is cumbersome and time-consuming, which makes it difficult to meet the needs of rapid on-site detection in drug control. Mid-infrared spectroscopy (MIR) and near-infrared spectroscopy (NIR) technologies have great application potential in rapid on-site drug detection due to their fast detection speed, simple operation, non-invasiveness, and simultaneous analysis of multiple components. In particular, they have unique advantages in non-destructiveness to samples and protection of the integrity of evidence. Multispectral fusion technology is a method that comprehensively utilizes different types or the same type of spectral information. By integrating and optimizing multiple spectral information, it makes up for the lack of characteristic information reflected by a single spectrum and realizes the complementary advantages between multiple spectra. However, the existing multispectral fusion technology cannot identify drugs with an accuracy rate of more than 90%, and the recognition success rate still needs to be improved. Summary of the invention

[0003] The purpose of the present invention is to provide a drug identification method, device, equipment and medium based on spectral correlation dimension upgrading to improve the above problems. In order to achieve the above purpose, the technical solution adopted by the present invention is as follows: In a first aspect, the present application provides a drug identification method based on spectral correlation dimension upgrading, comprising: Acquire spectral data of drug samples and preprocess them using at least two preprocessing methods to obtain target spectral data, wherein the target spectral data includes near-infrared data and mid-infrared spectral data; Using a spectral variable selection method to screen the target spectral data to obtain characteristic spectral data; A spectral matrix is ​​constructed according to the wavelength of the characteristic spectral data to obtain a near-infrared matrix and a mid-infrared matrix, correlation analysis is performed on the near-infrared matrix and the mid-infrared matrix to obtain a correlation coefficient matrix, the correlation coefficient matrix is ​​converted into a heat map, and the heat map is recognized using a pre-trained recognition model to obtain a recognition result.

[0004] In a second aspect, the present application also provides a drug identification device based on spectral correlation dimension upgrading, comprising: A preprocessing module, used for acquiring spectral data of drug samples and preprocessing them using at least two preprocessing methods to obtain target spectral data, wherein the target spectral data includes near-infrared data and mid-infrared spectral data; A screening module, used for screening the target spectral data by using a spectral variable selection method to obtain characteristic spectral data; The recognition module is used to construct a spectral matrix according to the wavelength of the characteristic spectral data to obtain a near-infrared matrix and a mid-infrared matrix, perform correlation analysis on the near-infrared matrix and the mid-infrared matrix to obtain a correlation coefficient matrix, convert the correlation coefficient matrix into a heat map, and use a pre-trained recognition model to recognize the heat map to obtain a recognition result.

[0005] In a third aspect, the present application also provides a drug identification device based on spectral correlation dimensionality upgrading, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the drug identification method based on spectral correlation dimensionality upgrading as described above when executing the computer program.

[0006] In a fourth aspect, the present application also provides a readable storage medium, characterized in that a computer program is stored on the readable storage medium, and when the computer program is executed by a processor, the steps of the drug identification method based on spectral correlation dimensionality upgrading as described above are implemented.

[0007] The beneficial effects of the present invention are: The present invention selects characteristic variables of spectral data, screens out the main characteristic information, combines the characteristic spectra under different spectral preprocessing conditions, and finally upgrades the data dimension through correlation analysis and makes a heat map, thereby optimizing the model input features, reducing the negative impact of adulteration in actual samples, and effectively improving the accuracy and robustness of recognition.

[0008] Other features and advantages of the present invention will be set forth in the following description, and in part will become apparent from the description, or may be understood by practicing embodiments of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments 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.

[0010] Figure 1 This is a flow chart of a drug identification method based on spectral correlation dimension upgrading in an embodiment of the present application; Figure 2 The NIR spectral data (A) and MIR spectral data (B) collected for the methamphetamine sample in the embodiment of the present application; Figure 3 NIR spectral data (A) and MIR spectral data (B) collected for a heroin sample in an embodiment of the present application; Figure 4 The VIP screening results of NIR spectrum (A) and MIR spectrum (B) without pretreatment in the examples of this application; Figure 5 The MIV screening results of NIR spectrum (A) and MIR spectrum (B) under the conditions without pretreatment in the examples of this application; Figure 6 This is a structural diagram of a drug identification device based on spectral correlation dimension upgrading in an embodiment of the present application; Figure 7 This is a structural diagram of a drug identification device based on spectral correlation dimensionality upgrading in an embodiment of the present application.

[0011] Markings in the figure: 100-preprocessing module; 200-screening module; 210-first building unit; 220-first calculation unit; 230-selection unit; 310-third building unit; 320-fourth calculation unit; 330-second recognition unit; 300-recognition module; 800-drug recognition device with spectral correlation dimensionality upgrade; 801-processor; 802-memory; 803-multimedia component; 804-I / O interface; 805-communication component. DETAILED DESCRIPTION

[0012] 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, rather than all of the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. 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.

[0013] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings. Example 1

[0014] See also Figure 1 , the present application provides a drug identification method based on spectral correlation dimension upgrading, comprising steps S100, S200 and S300; S100, obtaining spectral data of a drug sample and preprocessing it using at least two preprocessing methods to obtain target spectral data, wherein the target spectral data includes near-infrared spectral data and mid-infrared spectral data; In this example, 24 groups of heroin samples and 30 groups of methamphetamine sample data were collected. The calibration set and validation set were randomly divided into a 2:1 ratio. The calibration set samples were used to build the model, and the validation set samples were used to measure the external validation performance of the model. At the same time, the near infrared (NIR) data and mid infrared (MIR) data of the above samples were collected, such as Figure 2 and Figure 3 As shown. NIR images and MIR images are curves formed by connecting multiple points, each point corresponds to a spectrum data, which includes wavelength data (horizontal axis) and the intensity corresponding to the wavelength (vertical axis); Since the infrared spectrum of the sample to be tested contains not only rich chemical structure information, but also external redundant data, such as instrument noise, sample background or stray light, etc., eliminating some redundant data can improve the prediction performance of the model to a certain extent without losing effective spectral data. Therefore, the spectral preprocessing method aims to eliminate this part of redundant data. Commonly used spectral preprocessing methods include normalization, smoothing, derivative, standard normal variable transformation, multivariate scattering correction, etc.

[0015] This embodiment adopts four preprocessing methods to preprocess NIR data and MIR data respectively, including: Vector normalization: The purpose of normalization is to unify the scale of spectral data to prevent the large difference in spectral data at different wave numbers from causing negative optimization of the model, including area normalization, maximum and minimum value normalization, and vector normalization (VN). VN is the most commonly used normalization method. The calculation formula for a spectral intensity x is as follows: ; ;

[0016] Where, m is the number of points of the spectrum curve (number of wavelength points), k=1, 2, ..., m, is the spectral intensity, is the average spectral intensity, is the normalized spectral intensity, is the kth point.

[0017] Savitzkg-Golag smoothing: Smoothing is the most commonly used method to eliminate background noise, which helps to eliminate random errors in spectral data. SG (Savitzkg-Golag) smoothing assumes that the background noise is zero uniform random white noise, and achieves the smoothing effect by applying a set of sliding windows and polynomial fitting to the data. The weight of the spectral data in the center of the window is larger, while the weight of the spectral data at the edge of the window is smaller. The deconvolution smoothing performed by this method can better preserve the original shape and characteristics of the spectral data, and is suitable for spectral data with obvious peaks and valleys. The calculation formula is as follows: First, SG smoothing needs to select a smoothing window width, such as 2w+1. Then each window is composed of an odd number of points, with a point in the spectrum as the center, and the average value of the measured values ​​of the w points before and after is calculated. As the smoothing value. The specific formula is as follows: ; ; Among them, h i is the smoothing coefficient (need to query the SG smoothing coefficient table according to different window widths), k=1, 2, ..., m; H is the normalization factor; Indicates the smoothness of the k-th point, also used express; Relative to The value of the data point shifted by i positions.

[0018] Derivative: The first-order derivative (1st Derivative, 1st D) and the second-order derivative (2nd Derivative, 2nd D) of the spectrum are two commonly used preprocessing methods for baseline correction of the spectrum. 1stD usually uses numerical differentiation methods to calculate the slope or rate of change of spectral data to highlight the peaks or valleys in the spectral data and amplify the characteristic signals of the spectrum. 2nd D usually calculates the curvature of the spectral data or the rate of change of the rate of change by again differentiating the first-order derivative to highlight the broad peaks and platforms in the spectral data. Savitzky-Golay smoothing can also be used for derivative calculation of spectral data. The smoothing coefficient in SG smoothing can be replaced by the derivative coefficient, and the SG derivative coefficient table can be queried according to different window widths. SG derivatives are usually more stable and accurate than traditional numerical differentiation methods. While highlighting the characteristics of spectral signals, they can also effectively eliminate the impact of baseline drift on data analysis and modeling.

[0019] Standard normal transformation: Standard normal transformation (SNV) is often used in spectral preprocessing to eliminate scattering effects caused by factors such as optical path differences and particle size differences. SNV is calculated by subtracting the average value of all wavelength points from each spectral data point and then dividing it by the standard deviation of the spectrum, so that all spectral data conform to a normal distribution with a mean of 0 and a standard deviation of 1. The specific formula is as follows: ;

[0020] in, is the spectral intensity after standard normal transformation; m is the number of points of the spectral curve, k=1, 2, ..., m; is the spectral intensity, is the average spectral intensity, is the spectral intensity of the kth point.

[0021] Based on the technical concept of the present application, the optional spectral preprocessing methods are not limited to the above four methods, but can also be replaced by technologies such as multivariate scattering correction.

[0022] S200, screening the target spectral data using a spectral variable selection method to obtain characteristic spectral data; The infrared spectrum data processed in step S100 usually contains a large amount of chemical structure information, but not all spectrum data have a high correlation with the property to be measured. Therefore, the role of the spectrum variable selection method is to screen out characteristic spectra with a high correlation with the property to be measured from all spectrum data, aiming to reduce the spectral dimension and improve the prediction performance of the model.

[0023] This embodiment preferably adopts two spectral variable selection methods, one is the variable importance projection method (VIP), and the other is the mean influence value method (MIV).

[0024] Variable importance projection method: A partial least squares regression model (PLS) is established based on the target spectral data, and the model parameters are recorded. The model parameters include the load, score and principal component of each target spectral data, and the model parameters are all represented by vectors; Based on the model parameters, the variable importance projection method is used to calculate the VIP value of each target spectral data; when the VIP value is large, it means that the spectral data has a strong ability to explain the dependent variable. Usually, wavelengths with VIP greater than 1 are selected as feature data.

[0025] The target spectral data with a VIP value greater than 1 are selected as the characteristic spectral data.

[0026] ; in, h is the number of PLS ​​principal components; w k is the weight vector of the kth principal component, wjk is the weight vector of the jth data in the kth principal component; t k is the score vector of the kth principal component, t k T t k The transpose of q k is the load vector of the kth principal component; m is the number of wavelengths, i.e. the number of data; j represents the jth data point, j =1, 2, ..., m; is the kth principal component The sum of the squares of the weight vectors; for the jth data VIP value.

[0027] The spectral parameters are screened according to the VIP value of each spectral parameter to obtain characteristic spectral data.

[0028] Mean influence value: MIV is a new method for screening feature variables based on the importance of input variables to output variables. The calculation method is as follows: construct multiple training samples based on target spectral data, each of which includes multiple spectral parameters, and construct a neural network recognition model based on the training samples; The training sample is represented by P, with a total of z training samples. Each training sample includes n spectral parameters, and a training sample is the data of a point on a spectral curve; the output parameter corresponding to the training sample is represented by A, that is, P is the spectral data, and A is the predicted value (drug type).

[0029] ; ; Among them, X represents the spectral parameter, and Y represents the predicted value; The i-th spectral parameter in each training sample is transformed by the same value increase and decrease to obtain multiple groups of prediction samples, where each group of prediction samples contains two transformed samples obtained by the same training sample through the value increase and decrease transformation (increase or decrease by 10%); that is: ; The set of transformed samples after the i-th spectral parameter of the z training samples is changed; The transformed samples in each group of prediction samples are input into the neural network recognition model to obtain the first prediction result and the second prediction result; among them, the prediction result with an increase of 10% is recorded as A i (1), the prediction result with 10% reduction is recorded as A i (2); Perform a difference operation on the first prediction result and the second prediction result to obtain the influence value of the i-th spectral parameter on the model prediction result; ;

[0030] I v, i is the influence value of the i-th spectral parameter on the model prediction results; Calculate the influence of the i-th spectral parameter on the model prediction results in all training samples, and average the influence values ​​according to the number of training samples to obtain the average influence value of the i-th spectral parameter; ;

[0031] in, is the influence value of the i-th spectral parameter of the j-th training sample, is the average influence value of the i-th spectral parameter; z is the number of training samples; Thus, the average influence value of each spectral parameter can be obtained; The spectral parameters are screened according to the average influence value of each spectral parameter to obtain characteristic spectral data.

[0032] After calculating the spectral data using VIP or MIV, in addition to determining the characteristic spectral data by screening the VIP value and the MIV value by setting a threshold, the spectra can also be sorted from large to small according to the degree of spectral importance (i.e., VIP value and MIV value), and the spectral parameters with the highest ranking, such as the first 200 spectral parameters, can be selected as the characteristic spectral data.

[0033] It should be noted that the first 200 spectral parameters were screened out based on experience, and the number of screened parameters can be appropriately adjusted based on the actual model prediction effect.

[0034] It should be noted that the spectral variable selection method is not limited to VIP and MIV, but can also be other methods, such as competitive adaptive weighted sampling, Monte Carlo uninformative variable elimination algorithm, etc. When using different spectral variable screening methods to screen data, the accuracy of the final recognition model will be slightly different.

[0035] S300. Construct a spectral matrix according to the wavelength of the characteristic spectral data to obtain a near-infrared matrix and a mid-infrared matrix, perform correlation analysis on the near-infrared matrix and the mid-infrared matrix to obtain a correlation coefficient matrix, convert the correlation coefficient matrix into a heat map, and use a pre-trained recognition model to recognize the heat map to obtain a recognition result.

[0036] The wavelength of the characteristic spectrum is used as the column of the spectrum matrix, the preprocessing method is used as the row of the spectrum matrix, and the characteristic spectrum data corresponding to different wavelengths and different preprocessing methods are used as the elements of the spectrum matrix to construct a spectrum matrix, wherein the spectrum matrix includes a near-infrared matrix and a mid-infrared matrix; For example, this application selects 200 characteristic spectral data (corresponding to 200 wavelength points) in both the near-infrared moment data and the mid-infrared data, and adopts four preprocessing methods, then the size of the near-infrared matrix and the mid-infrared matrix is ​​4×200; Performing a Pearson correlation coefficient analysis on each column of the near infrared matrix and the mid infrared matrix to obtain a correlation coefficient matrix; For example, the near infrared matrix and the mid-infrared matrix each have 200 columns, and the size of the correlation coefficient matrix is ​​200×200; The correlation coefficient matrix is ​​converted into a heat map, and the pre-trained Bayes-CNN model is used to identify the heat map to obtain the recognition result.

[0037] Select a suitable drawing library to draw a heat map and color each cell in the matrix. The input of the pre-trained Bayes-CNN model is the heat map training set. The heat map training set is obtained by pre-processing the spectral samples, screening the characteristic spectral data, constructing the correlation matrix and converting them in sequence according to the above method of the present application; the output of the model is the drug type.

[0038] Based on the technical concept of the present application, the correlation analysis technology that can be used is not only Pearson correlation analysis, but can also be replaced by Spearman correlation analysis, Kendall correlation analysis, etc.

[0039] This embodiment constructs multiple models according to different spectral variable screening methods and different correlation analysis methods, and tests the performance of different Bayes-CNN models respectively. The results are shown in Table 1. Table 1. Performance of correlation analysis heatmaps of different Bayes-CNN models

[0040] In the table, TP is a true positive example, FN is a false negative example, TN is a true negative example, FP is a false positive example, and ACC is the accuracy.

[0041] It can be seen that the data processing method of feature screening through VIP and dimensionality upgrading through Pearson correlation analysis enables the model to have a higher recognition accuracy.

[0042] In addition, the present application also establishes other spectral recognition models and tests the performance of the models to compare with the model of the present invention, as follows: Single spectrum recognition model:

[0043] The single spectral model is to use NIR and MIR data to establish partial least squares discriminant (PLS-DA) models. In order to eliminate the noise in NIR and MIR spectral data and avoid the large difference in spectral absorption intensity between NIR and MIR, spectral preprocessing is required for NIR and MIR, such as SG first derivative (SG 1 st D), SG smoothing and vector normalization (VN). After the spectra were preprocessed by the above methods, a single spectral model was established using the calibration set samples, and the model was used to predict the validation set samples for external validation. The external validation prediction results are shown in Table 2. st Under the D condition, the single spectrum MIR-PLS-DA model has the highest recognition accuracy of 83.33% for methamphetamine and heroin samples.

[0044] Table 2 Performance of single spectrum PLS-DA model under different preprocessing methods Low-level and mid-level data fusion recognition model:

[0045] After vector splicing of the preprocessed spectra, a low-level data fusion (LLDF)-PLS-DA model was established, and the performance results are shown in Table 3. Furthermore, the NIR and MIR spectral data of the drug samples were filtered by VIP spectral variables. Taking the unpreprocessed condition as an example, the results of NIR and MIR spectral data after VIP screening are shown in Table 3. Figure 4 As shown in the figure, the spectral variables with VIP values ​​greater than 1 are used as feature variables, and vector splicing is performed to establish the VIP-mid-level data fusion (MLDF)-PLS-DA model. Similarly, the results of NIR and MIR spectral data after MIV screening are shown in the figure. Figure 5 As shown in the figure, the MIV average value is taken as the screening threshold, and the spectral variables greater than the MIV average value are screened out as feature variables to establish the MIV-MLDF-PLS-DA model. st Under the D pretreatment condition, the VIP-MLDF-PLS-DA model established after VIP screening has the highest recognition accuracy for methamphetamine and heroin, reaching 88.89%, and can accurately identify heroin samples. The reason why the MIV-MLDF-PLS-DA model is slightly worse may be that the spectral variables screened by the MIV algorithm are irrelevant to the characteristic information of methamphetamine and heroin, resulting in poor prediction performance of the model. At the same time, it should be noted that whether it is VIP or MIV algorithm, or even other algorithms such as CARS (competitive adaptive reweighted sampling), the model recognition success rate depends on the correlation between the characteristic spectrum and the property to be measured. If the property to be measured changes, the most suitable spectral variable selection algorithm may be different, which requires detailed model comparison to screen out spectral variable selection algorithms suitable for different properties to be measured.

[0046] Table 3 Performance of LLDF-PLS-DA and VIP-MLDF-PLS-DA models under different preprocessing methods

[0047] It can be seen that the recognition accuracy of the method provided by this application for identifying methamphetamine and heroin is 94.44%. Under various pre-processing conditions, the recognition accuracy of other recognition models cannot reach 90%. By comparison, it can be seen that the recognition success rate of the drug recognition method based on spectral correlation dimension increase in this application is improved by 5.55%-27.77%. Example 2

[0048] See also Figure 6 The present application also provides a drug identification device based on spectral correlation dimension upgrading, comprising: A preprocessing module 100, for acquiring spectral data of drug samples and preprocessing the data using at least two preprocessing methods to obtain target spectral data, wherein the target spectral data includes near-infrared spectral data and mid-infrared spectral data; A screening module 200 is used to screen the target spectrum data using a spectrum variable selection method to obtain characteristic spectrum data; The recognition module 300 is used to construct a spectral matrix according to the wavelength of the characteristic spectral data to obtain a near-infrared matrix and a mid-infrared matrix, perform correlation analysis on the near-infrared matrix and the mid-infrared matrix to obtain a correlation coefficient matrix, convert the correlation coefficient matrix into a heat map, and use a pre-trained recognition model to recognize the heat map to obtain a recognition result.

[0049] As an optional implementation, the screening module includes: A first construction unit 210 is used to establish a partial least squares regression model based on the target spectrum data and record model parameters, wherein the model parameters include a load, a score and a principal component of each target spectrum data; A first calculation unit 220 is used to calculate the VIP value of each target spectral data by using a variable importance projection method based on the model parameters; The selection unit 230 is used to select target spectrum data with a VIP value greater than 1 as characteristic spectrum data.

[0050] As another optional implementation, the screening module includes: A second construction unit is used to construct a plurality of training samples according to the target spectral data, each of the training samples includes a plurality of spectral parameters, and to construct a neural network recognition model based on the training samples; A transformation unit is used to perform the same numerical increase and decrease transformation on the i-th spectral parameter in each training sample to obtain multiple groups of prediction samples, wherein each group of prediction samples includes two transformed samples obtained by respectively increasing and decreasing the numerical value of the same training sample; A first recognition unit is used to input the transformed samples in each group of prediction samples into the neural network recognition model to obtain a first prediction result and a second prediction result; The second calculation unit is used to perform a difference operation on the first prediction result and the second prediction result to obtain an influence value of the i-th spectral parameter on the model prediction result; The third calculation unit is used to calculate the influence value of the i-th spectral parameter in all training samples on the model prediction result, and average the influence values ​​according to the number of training samples to obtain the average influence value of the i-th spectral parameter; The screening unit is used to screen the spectral parameters according to the average influence value of each spectral parameter to obtain characteristic spectral data.

[0051] The above two screening modules can be used either one.

[0052] As an optional implementation, the identification module includes: A third construction unit 310 is used to construct a spectrum matrix using the wavelength of the characteristic spectrum as the column of the spectrum matrix, using the preprocessing method as the row of the spectrum matrix, and using the characteristic spectrum data corresponding to different wavelengths and different preprocessing methods as the elements of the spectrum matrix, wherein the spectrum matrix includes a near-infrared matrix and a mid-infrared matrix; A fourth calculation unit 320 is used to perform a Pearson correlation coefficient analysis between each column of the near infrared matrix and the mid-infrared matrix to obtain a correlation coefficient matrix; The second recognition unit 330 is used to convert the correlation coefficient matrix into a heat map, and use the pre-trained Bayes-CNN model to recognize the heat map to obtain a recognition result. Example 3

[0053] Corresponding to the above method embodiment, this embodiment also provides a drug identification device based on spectral correlation dimensionality upgrading. The drug identification device based on spectral correlation dimensionality upgrading described below and the drug identification method based on spectral correlation dimensionality upgrading described above can be referenced to each other.

[0054] Figure 7 FIG. 8 is a block diagram of a drug identification device 800 based on spectral correlation dimension upgrading according to an exemplary embodiment. Figure 7As shown, the drug identification device 800 based on spectral correlation dimensionality upgrading includes a processor 801 and a memory 802. The drug identification device 800 based on spectral correlation dimensionality upgrading may also include one or more of a multimedia component 803, an input / output (I / O) interface 804, and a communication component 805. Among them, the processor 801 is used to control the overall operation of the drug identification device 800 based on spectral correlation dimensionality upgrading to complete all or part of the steps in the above-mentioned drug identification method based on spectral correlation dimensionality upgrading. The memory 802 is used to store various types of data to support the operation of the drug identification device 800 based on spectral correlation dimensionality upgrading, and these data may include, for example, commands for any application or method operating on the drug identification device 800 based on spectral correlation dimensionality upgrading, as well as application-related data, such as contact data, messages sent and received, pictures, audio, video, etc. The memory 802 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, disk or optical disk.

[0055] The multimedia component 803 may include a screen and an audio component. The screen may be, for example, a touch screen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone, and the microphone is used to receive external audio signals.

[0056] The received audio signal can be further stored in the memory 802 or sent through the communication component 805. The audio component also includes at least one speaker for outputting audio signals. The I / O interface 804 provides an interface between the processor 801 and other interface modules, and the above-mentioned other interface modules can be keyboards, mice, buttons, etc. These buttons can be virtual buttons or physical buttons. The communication component 805 is used for wired or wireless communication between the drug identification device 800 based on spectral correlation dimensionality upgrading and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G or 4G, or a combination of one or more of them, so the corresponding communication component 805 can include: Wi-Fi module, Bluetooth module, NFC module.

[0057] In an exemplary embodiment, the device 800 for mutual signing and verification of digital files can be implemented by one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), controllers, microcontrollers, microprocessors or other electronic components to execute the above-mentioned drug identification method based on spectral correlation dimensionality upgrading.

[0058] In another exemplary embodiment, a computer-readable storage medium including program commands is also provided, and when the program commands are executed by a processor, the steps of the above-mentioned drug identification method based on spectral correlation dimensionality increase are implemented. For example, the computer-readable storage medium can be the above-mentioned memory 802 including program commands, and the above-mentioned program commands can be executed by the processor 801 of the drug identification device 800 based on spectral correlation dimensionality increase to complete the above-mentioned drug identification method based on spectral correlation dimensionality increase.

[0059] Example 4 Corresponding to the above method embodiment of drug identification based on spectral correlation dimensionality upgrading, a readable storage medium is also provided in this embodiment. The readable storage medium described below and the drug identification method based on spectral correlation dimensionality upgrading described above can be referenced to each other.

[0060] A readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-mentioned drug identification method embodiment based on spectral correlation dimensionality upgrading.

[0061] The readable storage medium may specifically be a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or other readable storage medium that can store program codes.

[0062] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0063] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A drug identification method based on spectral correlation dimension upgrading, characterized in that: include: Acquire spectral data of drug samples and preprocess them using at least two preprocessing methods to obtain target spectral data, wherein the target spectral data includes near-infrared data and mid-infrared spectral data; Using a spectral variable selection method to screen the target spectral data to obtain characteristic spectral data; A spectral matrix is ​​constructed according to the wavelength of the characteristic spectral data to obtain a near-infrared matrix and a mid-infrared matrix, correlation analysis is performed on the near-infrared matrix and the mid-infrared matrix to obtain a correlation coefficient matrix, the correlation coefficient matrix is ​​converted into a heat map, and the heat map is recognized using a pre-trained recognition model to obtain a recognition result.

2. The drug identification method based on spectral correlation dimension upgrading according to claim 1 is characterized in that: The method of selecting a spectral variable to select the target spectral data to obtain characteristic spectral data includes: A partial least squares regression model is established based on the target spectral data, and model parameters are recorded, wherein the model parameters include the load, score and principal component of each target spectral data; Based on the model parameters, the VIP value of each target spectral data is calculated using the variable importance projection method; The target spectral data with a VIP value greater than 1 are selected as the characteristic spectral data.

3. The drug identification method based on spectral correlation dimension upgrading according to claim 1 is characterized in that: The method of selecting a spectral variable to select the target spectral data to obtain characteristic spectral data includes: Constructing a plurality of training samples according to the target spectral data, each of the training samples including a plurality of spectral parameters, and constructing a neural network recognition model based on the training samples; Perform the same numerical increase and decrease transformation on the i-th spectral parameter in each training sample to obtain multiple groups of prediction samples, wherein each group of prediction samples includes two transformed samples obtained by respectively increasing and decreasing the numerical value of the same training sample; Inputting the transformed samples in each group of prediction samples into the neural network recognition model respectively to obtain a first prediction result and a second prediction result; Perform a difference operation on the first prediction result and the second prediction result to obtain the influence value of the i-th spectral parameter on the model prediction result; Calculate the influence of the i-th spectral parameter on the model prediction results in all training samples, and average the influence values ​​according to the number of training samples to obtain the average influence value of the i-th spectral parameter; The spectral parameters are screened according to the average influence value of each spectral parameter to obtain characteristic spectral data.

4. The drug identification method based on spectral correlation dimension upgrading according to claim 1 is characterized in that: A spectral matrix is ​​constructed according to the wavelength of the characteristic spectral data to obtain a near-infrared matrix and a mid-infrared matrix, the near-infrared matrix and the mid-infrared matrix are subjected to correlation analysis to obtain a correlation coefficient matrix, the correlation coefficient matrix is ​​converted into a heat map, and the heat map is recognized using a pre-trained recognition model to obtain a recognition result, including: The wavelength of the characteristic spectrum is used as the column of the spectrum matrix, the preprocessing method is used as the row of the spectrum matrix, and the characteristic spectrum data corresponding to different wavelengths and different preprocessing methods are used as the elements of the spectrum matrix to construct a spectrum matrix, wherein the spectrum matrix includes a near-infrared matrix and a mid-infrared matrix; Performing a Pearson correlation coefficient analysis on each column of the near infrared matrix and the mid infrared matrix to obtain a correlation coefficient matrix; The correlation coefficient matrix is ​​converted into a heat map, and the pre-trained Bayes-CNN model is used to identify the heat map to obtain the recognition result.

5. A drug identification device based on spectral correlation dimension upgrading, characterized in that: include: A preprocessing module, used for acquiring spectral data of drug samples and preprocessing them using at least two preprocessing methods to obtain target spectral data, wherein the target spectral data includes near-infrared data and mid-infrared spectral data; A screening module, used for screening the target spectral data by using a spectral variable selection method to obtain characteristic spectral data; The recognition module is used to construct a spectral matrix according to the wavelength of the characteristic spectral data to obtain a near-infrared matrix and a mid-infrared matrix, perform correlation analysis on the near-infrared matrix and the mid-infrared matrix to obtain a correlation coefficient matrix, convert the correlation coefficient matrix into a heat map, and use a pre-trained recognition model to recognize the heat map to obtain a recognition result.

6. The drug identification device based on spectral correlation dimension upgrading according to claim 5 is characterized in that: The screening module comprises: A first construction unit is used to establish a partial least squares regression model based on the target spectral data and record model parameters, wherein the model parameters include a load, a score and a principal component of each target spectral data; A first calculation unit is used to calculate the VIP value of each target spectral data by using a variable importance projection method based on the model parameters; The selection unit is used to select target spectrum data with a VIP value greater than 1 as characteristic spectrum data.

7. The drug identification device based on spectral correlation dimension upgrading according to claim 5 is characterized in that: The screening module comprises: A second construction unit is used to construct a plurality of training samples according to the target spectral data, each of the training samples includes a plurality of spectral parameters, and to construct a neural network recognition model based on the training samples; A transformation unit is used to perform the same numerical increase and decrease transformation on the i-th spectral parameter in each training sample to obtain multiple groups of prediction samples, wherein each group of prediction samples includes two transformed samples obtained by respectively increasing and decreasing the numerical value of the same training sample; A first recognition unit is used to input the transformed samples in each group of prediction samples into the neural network recognition model to obtain a first prediction result and a second prediction result; The second calculation unit is used to perform a difference operation on the first prediction result and the second prediction result to obtain an influence value of the i-th spectral parameter on the model prediction result; The third calculation unit is used to calculate the influence value of the i-th spectral parameter in all training samples on the model prediction result, and average the influence values ​​according to the number of training samples to obtain the average influence value of the i-th spectral parameter; The screening unit is used to screen the spectral parameters according to the average influence value of each spectral parameter to obtain characteristic spectral data.

8. The drug identification device based on spectral correlation dimension upgrading according to claim 5 is characterized in that: The identification module comprises: A third construction unit is used to construct a spectrum matrix using the wavelength of the characteristic spectrum as the column of the spectrum matrix, using the preprocessing method as the row of the spectrum matrix, and using the characteristic spectrum data corresponding to different wavelengths and different preprocessing methods as the elements of the spectrum matrix, wherein the spectrum matrix includes a near-infrared matrix and a mid-infrared matrix; A fourth calculation unit is used to perform a Pearson correlation coefficient analysis between each column of the near infrared matrix and the mid-infrared matrix to obtain a correlation coefficient matrix; The second recognition unit is used to convert the correlation coefficient matrix into a heat map, and use the pre-trained Bayes-CNN model to recognize the heat map to obtain a recognition result.

9. A drug identification device based on spectral correlation dimension upgrading, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the drug identification method based on spectral correlation dimensionality upgrading as described in any one of claims 1 to 4 are implemented.

10. A readable storage medium, characterized in that: The readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the drug identification method based on spectral correlation dimensionality upgrading as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Model online updating method and device, equipment, storage medium and computer product

    CN114429220A

  • Associated effective characteristic spectrum section selection method and oil product index content rapid detection method

    CN115372309A

  • Informatization management method and system for biochar-based fertilizer preparation

    CN118839827A

  • Bill identification method and device based on machine vision

    CN119068504A

  • Drug open set identification method based on interval variable-free elimination feature selection algorithm

    CN119252365A