A method and device for identifying medicinal materials based on terahertz
By acquiring, converting, preprocessing, and extracting terahertz frequency domain signals, and combining them with signal detection models and adjacency matrices, the problem of low efficiency in medicinal material identification was solved, and rapid and accurate identification of medicinal material categories was achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-29
- Publication Date
- 2026-03-10
AI Technical Summary
Existing medicinal herb identification schemes are unable to quickly and accurately identify the medicinal herb categories of multiple samples, resulting in low efficiency in the identification process.
The terahertz time-domain signal of the medicinal material sample to be identified is collected and converted into a frequency-domain signal. Data preprocessing and feature extraction are performed. The category probability matrix is determined by using a pre-trained signal detection model and adjacency matrix, thereby identifying the category of medicinal material.
It enables rapid and accurate identification of multiple medicinal material samples, improving the efficiency of the medicinal material identification process.
Smart Images

Figure CN121415908B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of electric digital data processing, and in particular to a medicine material identification method and device based on terahertz. BACKGROUND
[0002] In the process of using multiple medicine material samples for product manufacturing, it is usually necessary to identify the medicine material categories of the medicine material samples, so as to process the medicine material samples in a suitable manner based on the medicine material categories of the medicine material samples. The medicine material sample is a powder obtained by crushing a specified Chinese medicine material. The medicine material category of the medicine material sample is the name of the Chinese medicine material to which the medicine material sample belongs.
[0003] In the related art, a common medicine material identification scheme is to analyze and detect the images or other feature data of each medicine material sample respectively, and determine the medicine material category of the medicine material sample. The medicine material identification scheme in the related art cannot quickly and accurately identify the medicine material categories of multiple medicine material samples, resulting in low efficiency of the medicine material identification process. SUMMARY
[0004] The present application provides a medicine material identification method and device based on terahertz, to solve the problem that the medicine material identification scheme in the related art cannot quickly and accurately identify the medicine material categories of multiple medicine material samples, resulting in low efficiency of the medicine material identification process.
[0005] According to an aspect of the present application, a medicine material identification method based on terahertz is provided, comprising:
[0006] Collecting terahertz time domain signals of n medicine material samples to be identified, converting the terahertz time domain signals of the n medicine material samples to be identified into frequency domain signals, and obtaining terahertz frequency domain signals of the n medicine material samples to be identified;
[0007] Data preprocessing is performed on the terahertz frequency domain signals of the n medicine material samples to be identified, and standard terahertz frequency domain signals of the n medicine material samples to be identified are obtained;
[0008] Feature extraction is performed on the standard terahertz frequency domain signals of the n medicine material samples to be identified, and core terahertz frequency domain signals of the n medicine material samples to be identified are obtained;
[0009] Through a pre-trained signal detection model, a category probability matrix of the n medicine material samples to be identified is determined according to the core terahertz frequency domain signals of the n medicine material samples to be identified and an adjacency matrix corresponding to the core terahertz frequency domain signals of the n medicine material samples to be identified; wherein the category probability matrix of the n medicine material samples to be identified contains the probability corresponding to c preset medicine material categories of each medicine material sample to be identified.
[0010] Based on the category probability matrix, the medicinal material categories of n samples to be identified are determined from c preset medicinal material categories.
[0011] According to another aspect of the present invention, a terahertz-based medicinal herb identification device is provided, comprising:
[0012] The information acquisition unit is used to acquire the terahertz time-domain signals of n medicinal samples to be identified, convert the terahertz time-domain signals of the n medicinal samples to be identified into frequency-domain signals, and obtain the terahertz frequency-domain signals of the n medicinal samples to be identified.
[0013] The signal preprocessing unit is used to preprocess the terahertz frequency domain signals of n medicinal material samples to be identified, and obtain the standard terahertz frequency domain signals of the n medicinal material samples to be identified.
[0014] The signal feature extraction unit is used to extract features from the standard terahertz frequency domain signals of n medicinal samples to be identified, and obtain the core terahertz frequency domain signals of the n medicinal samples to be identified.
[0015] The signal detection unit is used to determine the category probability matrix of n medicinal samples to be identified by using a pre-trained signal detection model, based on the core terahertz frequency domain signals of the n medicinal samples to be identified and the adjacency matrix corresponding to the core terahertz frequency domain signals of the n medicinal samples to be identified; wherein, the category probability matrix of the n medicinal samples to be identified contains the probability of each medicinal sample to be identified corresponding to c preset medicinal categories;
[0016] The category determination unit is used to determine the medicinal material category of n medicinal material samples to be identified from c preset medicinal material categories based on the category probability matrix.
[0017] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0018] At least one processor;
[0019] and a memory communicatively connected to the at least one processor;
[0020] The memory stores a computer program that is executed by the at least one processor, which enables the at least one processor to perform the terahertz-based medicinal herb identification method according to any embodiment of the present invention.
[0021] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the terahertz-based medicinal material identification method according to any embodiment of the present invention.
[0022] According to another aspect of the present invention, a computer program product is provided, the computer program product comprising a computer program that, when executed by a processor, implements the terahertz-based medicinal herb identification method according to any embodiment of the present invention.
[0023] The technical solution of this invention involves acquiring terahertz time-domain signals from n medicinal material samples to be identified, converting these signals into frequency-domain signals to obtain terahertz frequency-domain signals for the n medicinal material samples; then preprocessing these signals to obtain standard terahertz frequency-domain signals for the n medicinal material samples; extracting features from these standard terahertz frequency-domain signals to obtain core terahertz frequency-domain signals for the n medicinal material samples; and using a pre-trained signal detection model, determining the class probability matrix for the n medicinal material samples based on the core terahertz frequency-domain signals and the adjacency matrix corresponding to these signals. The class probability matrix for the n medicinal material samples includes each... This method calculates the probability of a medicinal herb sample corresponding to c preset medicinal herb categories. Finally, based on the category probability matrix, the medicinal herb categories of n samples to be identified are determined from the c preset categories. This solves the problem that related medicinal herb identification schemes cannot quickly and accurately identify the medicinal herb categories of multiple samples, resulting in low efficiency in the medicinal herb identification process. It can perform data preprocessing and feature extraction on the terahertz frequency domain signals of multiple medicinal herb samples. Based on the processed terahertz frequency domain signals and signal detection model, the category probability matrix of multiple medicinal herb samples can be determined. Then, based on the category probability matrix of multiple medicinal herb samples, the medicinal herb categories of multiple samples can be quickly and accurately determined from each preset category, achieving rapid and accurate identification of the medicinal herb categories of multiple samples and improving the efficiency of the medicinal herb identification process.
[0024] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0025] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0026] Figure 1This is a flowchart of a terahertz-based medicinal herb identification method provided in Embodiment 1 of the present invention.
[0027] Figure 2 This is a schematic diagram of the structure of a signal detection model provided in Embodiment 1 of the present invention.
[0028] Figure 3 This is a flowchart of a terahertz-based medicinal herb identification method provided in Embodiment 2 of the present invention.
[0029] Figure 4 This is a schematic diagram of a terahertz-based medicinal herb identification device provided in Embodiment 3 of the present invention.
[0030] Figure 5 A schematic diagram of the structure of an electronic device for implementing the terahertz-based medicinal herb identification method of this invention. Detailed Implementation
[0031] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0032] It should be noted that the terms "target," "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising," "including," and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0033] Example 1
[0034] Figure 1This is a flowchart illustrating a terahertz-based medicinal herb identification method according to Embodiment 1 of the present invention. This embodiment is applicable to identifying and determining the medicinal herb category of a medicinal herb sample. The method can be executed by a terahertz-based medicinal herb identification device, which can be implemented in hardware and / or software and can be configured in an electronic device. For example, the electronic device can be a server installed in an enterprise for identifying and determining the medicinal herb category of a medicinal herb sample. Figure 1 As shown, the method includes:
[0035] Step 101: Collect the terahertz time-domain signals of n medicinal samples to be identified, and convert the terahertz time-domain signals of the n medicinal samples to be identified into frequency-domain signals to obtain the terahertz frequency-domain signals of the n medicinal samples to be identified.
[0036] Optionally, the n samples to be identified can refer to multiple samples of medicinal materials whose categories need to be determined. n is an integer greater than or equal to 2. For each sample to be identified, the sample is the powder obtained by pulverizing a specified traditional Chinese medicine. The category of the sample is the name of the traditional Chinese medicine to which it belongs. The terahertz time-domain signal of the sample can be the time-domain signal after the terahertz wave emitted towards the sample has passed through it, acquired by a terahertz time-domain detection device. The terahertz time-domain signal of the sample consists of m data points arranged in sequence. m is an integer greater than or equal to 2. For example, m is 1000. The samples to be identified are equipped with identification information. This identification information can be information used to uniquely identify the sample. A terahertz time-domain detection device can be a hardware device installed in an enterprise to emit terahertz waves to medicinal samples placed at a designated location and collect the time-domain signal after the terahertz waves have passed through the samples. It can collect the terahertz time-domain signal of each medicinal sample after receiving identification instruction information sent by a target user. The identification instruction information can be information indicating the identification of the medicinal category of n medicinal samples, thus determining the medicinal category of the n samples. The target user can be a technician responsible for managing the n medicinal samples. The terahertz time-domain detection device can emit terahertz waves to each medicinal sample and collect the time-domain signal after the terahertz waves have passed through each sample, thereby collecting the terahertz time-domain signal of each medicinal sample. The terahertz time-domain signal of each medicinal sample collected by the terahertz time-domain detection device can be obtained from the device, thus collecting the terahertz time-domain signal of n medicinal samples.
[0037] Optionally, for each medicinal sample to be identified, the terahertz frequency domain signal of the medicinal sample can refer to the frequency domain signal obtained by converting the terahertz time domain signal of the medicinal sample. A Fourier transform can be performed on the terahertz time domain signal of the medicinal sample to convert it into a frequency domain signal, thus obtaining the terahertz frequency domain signal of the medicinal sample. The terahertz time domain signal of the medicinal sample consists of m data points arranged in sequence. The terahertz frequency domain signal obtained by converting the terahertz time domain signal of the medicinal sample also consists of m data points arranged in sequence.
[0038] Optionally, after obtaining the terahertz frequency domain signal of the medicinal sample to be identified, the absorption coefficient of the terahertz frequency domain signal can be calculated using the absorption coefficient calculation formula. The absorption coefficient calculation formula can be a pre-set formula used to calculate the absorption coefficient of terahertz frequency domain signals. The absorption coefficient calculation formula can be: .in, denoted as , where is the absorption coefficient of the terahertz frequency domain signal of the medicinal material sample to be identified, and d is the sample thickness of the medicinal material sample to be identified. The refractive index of the medicinal sample to be identified. For the reference frequency domain signal, The reference frequency domain signal is the terahertz frequency domain signal of the medicinal material sample to be identified. The reference frequency domain signal can be a frequency domain signal obtained by converting the time domain signal of the terahertz wave collected when the medicinal material sample to be identified is not placed.
[0039] Step 102: Perform data preprocessing on the terahertz frequency domain signals of the n medicinal material samples to be identified to obtain the standard terahertz frequency domain signals of the n medicinal material samples to be identified.
[0040] Optionally, for each medicinal sample to be identified, the standard terahertz frequency domain signal of the medicinal sample is the terahertz frequency domain signal of the medicinal sample after data preprocessing. Data preprocessing of the terahertz frequency domain signal of the medicinal sample to be identified can refer to noise suppression, scattering effect correction, and data normalization.
[0041] Optionally, data preprocessing is performed on the terahertz frequency domain signals of the n medicinal material samples to be identified to obtain standard terahertz frequency domain signals of the n medicinal material samples. This includes: denoising the terahertz frequency domain signals of the n medicinal material samples using a preset signal denoising algorithm to obtain denoised terahertz frequency domain signals of the n medicinal material samples; performing multivariate scattering correction processing on the terahertz frequency domain signals of the n medicinal material samples based on the average value of the denoised terahertz frequency domain signals of the n medicinal material samples to obtain corrected terahertz frequency domain signals of the n medicinal material samples; and normalizing the terahertz frequency domain signals of the n medicinal material samples based on the minimum and maximum values of the corrected terahertz frequency domain signals of the n medicinal material samples to obtain standard terahertz frequency domain signals of the n medicinal material samples.
[0042] Optionally, for each medicinal sample to be identified, a preset signal denoising algorithm can be used to denoise the terahertz frequency domain signal of the sample, resulting in a denoised terahertz frequency domain signal. The preset signal denoising algorithm can be a pre-set algorithm for denoising the terahertz frequency domain signal of the medicinal sample. This algorithm can be a wavelet denoising algorithm or a smoothing filtering algorithm. The wavelet denoising algorithm used for denoising the terahertz frequency domain signal of the medicinal sample can use either the db8 or sym8 wavelet basis function. Using the db8 wavelet basis function achieves the best balance between feature preservation, noise suppression, and computational efficiency. For terahertz frequency domain signals containing sharp absorption peaks, the sym8 wavelet basis function is preferred. Wavelet denoising algorithms can perform wavelet multi-scale decomposition, thresholding, and wavelet reconstruction.
[0043] Optionally, for each medicinal sample to be identified, multivariate scattering correction is performed on the denoised terahertz frequency domain signal of the sample. This reduces the scattering effect in the terahertz frequency domain signal, thereby enhancing the spectral absorption information related to the components of the medicinal sample itself. Multivariate scattering correction is performed on the terahertz frequency domain signals of the n medicinal samples to be identified based on the average value of the denoised terahertz frequency domain signals. This process includes: calculating the average value of the denoised terahertz frequency domain signals of the n medicinal samples; wherein the average value of the denoised terahertz frequency domain signals of the n medicinal samples is the average value of each group of data points at the same position in the n denoised terahertz frequency domain signals, and each terahertz frequency domain signal consists of m data points arranged in sequence. The average value of the signal includes m average values. The average value of the denoised terahertz frequency domain signal of the n samples of medicinal materials to be identified includes the average value of all data points ranked 1st, 2nd, 3rd, ... mth in the denoised terahertz frequency domain signal. For each data point in the denoised terahertz frequency domain signal of the n samples of medicinal materials to be identified, the correction value of the data point is calculated using the following formula: ;in, These are the corrected values for the data points. , It is the average value of all data points at the corresponding positions in the n denoised terahertz frequency domain signals. It is a preset offset coefficient. It is a preset translation coefficient; for each data point in the denoised terahertz frequency domain signal of n medicinal samples to be identified, the data point is updated from its current value to the corrected value of the data point, thereby obtaining the corrected terahertz frequency domain signal of the n medicinal samples to be identified. The corrected value of the data point is the value of the data point after the scattering effect is reduced. and These are two pre-set coefficients. The electronic device stores... and .
[0044] Optionally, for each medicinal sample to be identified, the corrected terahertz frequency domain signal of the medicinal sample to be identified is normalized. This normalizes the data points in the corrected terahertz frequency domain signal of the medicinal sample to be identified to be in the range of 0 to 1, which can eliminate the influence between dimensions and make the terahertz frequency domain signals of different dimensions comparable. The terahertz frequency domain signals of the n medicinal samples to be identified are normalized based on the minimum and maximum values of the corrected terahertz frequency domain signals, resulting in standard terahertz frequency domain signals for the n medicinal samples. This process includes: determining the minimum value of the corrected terahertz frequency domain signals of the n medicinal samples; wherein the minimum value refers to the minimum value among all data points in the corrected terahertz frequency domain signals of the n medicinal samples; determining the maximum value of the corrected terahertz frequency domain signals of the n medicinal samples; wherein the maximum value refers to the maximum value among all data points in the corrected terahertz frequency domain signals of the n medicinal samples; and for each data point in the corrected terahertz frequency domain signals of the n medicinal samples, the normalized value of the data point is calculated using the following formula: ;in, Here, x is the normalized value of the data point, and y is the current value of the data point. It is the minimum value of the corrected terahertz frequency domain signal of n samples of medicinal materials to be identified. It is the maximum value of the corrected terahertz frequency domain signal of n medicinal samples to be identified; for each data point in the corrected terahertz frequency domain signal of the n medicinal samples to be identified, the data point is updated from the current value to the normalized value of the data point, so as to obtain the standard terahertz frequency domain signal of the n medicinal samples to be identified.
[0045] Step 103: Extract features from the standard terahertz frequency domain signals of the n medicinal samples to be identified, and obtain the core terahertz frequency domain signals of the n medicinal samples to be identified.
[0046] Optionally, for each medicinal sample to be identified, the core terahertz frequency domain signal of the medicinal sample to be identified can be the terahertz frequency domain signal obtained by dimensionality reduction of the standard terahertz frequency domain signal of the medicinal sample to be identified.
[0047] Optionally, feature extraction is performed on the standard terahertz frequency domain signals of the n medicinal material samples to be identified, to obtain the core terahertz frequency domain signals of the n medicinal material samples to be identified. This includes: performing the following operations on the standard terahertz frequency domain signal of each medicinal material sample to be identified: determining the contribution rate of m data points in the standard terahertz frequency domain signal of the medicinal material sample to be identified; sorting the contribution rates of the m data points in descending order of value, retaining the data points with the top k contribution rates in the standard terahertz frequency domain signal and deleting other data points, to obtain the core terahertz frequency domain signal of the medicinal material sample to be identified.
[0048] Optionally, the contribution rate of a data point can be a numerical value used to characterize the importance of the data point. A higher contribution rate indicates greater importance, while a lower contribution rate indicates lower importance. The preset data analysis algorithm can be a pre-set algorithm used to analyze and calculate the contribution rate of m data points in the standard terahertz frequency domain signal of the medicinal material sample to be identified. Alternatively, the preset data analysis algorithm can be a principal component analysis algorithm used to analyze and calculate the contribution rate of m data points in the standard terahertz frequency domain signal of the medicinal material sample to be identified. The preset data analysis algorithm can be used to analyze and calculate the contribution rate of m data points in the standard terahertz frequency domain signal of the medicinal material sample to be identified.
[0049] Optionally, k is a pre-set integer greater than or equal to 2. k is less than m. The contribution rates of the m data points can be sorted in descending order of value, and the data points with the highest contribution rates in the standard terahertz frequency domain signal can be retained while other data points are deleted. This reduces the dimension of the standard terahertz frequency domain signal from m to k, thus obtaining the core terahertz frequency domain signal of the medicinal sample to be identified.
[0050] Step 104: Using a pre-trained signal detection model, determine the category probability matrix of the n medicinal samples to be identified based on the core terahertz frequency domain signals of the n medicinal samples to be identified and the adjacency matrix corresponding to the core terahertz frequency domain signals of the n medicinal samples to be identified.
[0051] The probability matrix of the n medicinal samples to be identified contains the probability of each medicinal sample corresponding to c preset medicinal categories.
[0052] Optionally, the c preset medicinal herb categories can be the names of c different Chinese medicinal herbs that the company might use. c is an integer greater than or equal to 2. For example, the c different Chinese medicinal herbs that the company might use include, but are not limited to, *Codonopsis pilosula* and *Pseudostellaria heterophylla*. Each preset medicinal herb category is the name of a specific Chinese medicinal herb. The c preset medicinal herb categories are not identical. Typically, the c preset medicinal herb categories contain the medicinal herb categories of each medicinal herb sample to be identified. The medicinal herb category of the medicinal herb sample to be identified will be one of the c preset medicinal herb categories. The probability corresponding to a preset medicinal herb category can refer to the probability that the medicinal herb category of the medicinal herb sample to be identified is a preset medicinal herb category. The electronic device stores c preset medicinal herb categories, which are arranged serially.
[0053] Optionally, a pre-trained signal detection model is used to determine the category probability matrix of n medicinal samples to be identified, based on the core terahertz frequency domain signals of the n medicinal samples to be identified and the adjacency matrix corresponding to the core terahertz frequency domain signals of the n medicinal samples to be identified. This includes: constructing the adjacency matrix corresponding to the core terahertz frequency domain signals of the n medicinal samples to be identified; inputting the core terahertz frequency domain signals of the n medicinal samples to be identified and the adjacency matrix into the pre-trained signal detection model to obtain the category probability matrix of the n medicinal samples to be identified output by the signal detection model; wherein, the input of the signal detection model is the core terahertz frequency domain signals of the n medicinal samples to be identified and the adjacency matrix corresponding to the core terahertz frequency domain signals of the n medicinal samples to be identified, and the output of the signal detection model is the category probability matrix of the n medicinal samples to be identified.
[0054] Optionally, based on the core terahertz frequency domain signals of the n medicinal samples to be identified, an adjacency matrix corresponding to the core terahertz frequency domain signals of the n medicinal samples to be identified is constructed, including: arranging the core terahertz frequency domain signals of the n medicinal samples to be identified in a predetermined order; calculating the similarity between the core terahertz frequency domain signals of each medicinal sample and the core terahertz frequency domain signals of other medicinal samples to be identified; and constructing a matrix based on the similarity between the core terahertz frequency domain signals of each medicinal sample and the core terahertz frequency domain signals of other medicinal samples to be identified. The matrix will be constructed The matrix is determined as the adjacency matrix corresponding to the core terahertz frequency domain signals of the n medicinal samples to be identified; where the element in the i-th row and j-th column of the matrix is the similarity between the core terahertz frequency domain signal of the i-th medicinal sample and the core terahertz frequency domain signal of the j-th medicinal sample, 0 or 1; when i is not equal to j and the similarity between the core terahertz frequency domain signal of the i-th medicinal sample and the core terahertz frequency domain signal of the j-th medicinal sample is greater than or equal to a preset value. When i = 1, the element in the i-th row and j-th column of the matrix represents the similarity between the core terahertz frequency domain signal of the i-th ranked medicinal sample and the core terahertz frequency domain signal of the j-th ranked medicinal sample. When i is not equal to j and the similarity between the core terahertz frequency domain signals of the i-th ranked medicinal sample and the j-th ranked medicinal sample is less than a preset value, the element in the i-th row and j-th column of the matrix is 0; when i equals j, the element in the i-th row and j-th column of the matrix is 1. i = 1, 2, ..., n. j = 1, 2, ..., n. Let be the element in the i-th row and j-th column of the matrix. It refers to the elements in the matrix that have the same number of rows and columns. Let be the similarity between the core terahertz frequency domain signal of the medicinal material sample ranked i and the core terahertz frequency domain signal of the medicinal material sample ranked j. This is a preset value.
[0055] Optionally, the preset arrangement order can be a pre-defined sequential arrangement of the core terahertz frequency domain signals of n medicinal material samples to be identified. The core terahertz frequency domain signals of the n medicinal material samples to be identified are arranged sequentially according to the preset order to obtain a serially arranged set of core terahertz frequency domain signals of the n medicinal material samples to be identified. The preset similarity algorithm can be a pre-defined algorithm used to calculate the similarity between two core terahertz frequency domain signals. The preset similarity algorithm can be used to calculate the similarity between the core terahertz frequency domain signals of each medicinal material sample to be identified and the core terahertz frequency domain signals of other medicinal material samples to be identified. The preset value can be a pre-defined numerical value.
[0056] Optionally, the category probability matrix of the n medicinal samples to be identified is a... The matrix is denoted by f(x). The element in the a-th row and b-th column of the matrix represents the probability that the medicinal sample to be identified, ranked a-th, corresponds to the preset medicinal category ranked b-th. a = 1, 2, ..., n. b = 1, 2, ..., c.
[0057] Optionally, the electronic device includes a pre-trained signal detection model. This model is a graph convolutional neural network model used to analyze and detect the core terahertz frequency domain signals of n medicinal material samples to be identified, and the adjacency matrices corresponding to these signals, to determine the class probability matrices of the n samples. The input to the signal detection model is the core terahertz frequency domain signals of the n medicinal material samples and the adjacency matrices corresponding to these signals. The output of the signal detection model is the class probability matrix of the n medicinal material samples. After inputting the core terahertz frequency domain signals of n medicinal material samples to be identified, and the adjacency matrices corresponding to these signals, into the signal detection model, the model analyzes and detects these signals to determine the class probability matrices of the n samples. The model then outputs these class probability matrices. This allows the determination of the class probability matrices of the n medicinal material samples. The signal detection model can be pre-trained and configured in electronic devices by the company's technical personnel.
[0058] Optionally, the signal detection model is a graph convolutional neural network model, which supports non-Euclidean space modeling. The graph convolutional neural network utilizes the structural information between samples, making the samples no longer independent.
[0059] Graph convolutional neural networks can propagate contextual information through "adjacency graphs." Medicinal herb samples may have similar spectra; using graph convolution can enhance "nearest neighbor sample consistency."
[0060] Graph convolutional neural networks (GNNs) support non-Euclidean space modeling, are not limited to linear, sequential, or grid structures, and can model complex similarity graph structures. This is helpful in utilizing and modeling information such as non-local frequency band commonalities that may exist in terahertz frequency domain signals. For example, at 0.85 THz and 2.4 THz, the terahertz frequency domain signal of a certain type of medicinal material sample always shows two absorption peaks simultaneously. These two frequency bands are far apart on the frequency coordinate axis, but in the sense of "characterizing this type of traditional Chinese medicine," they work together; this is a typical example of non-local frequency band commonality. The graph convolutional neural network's graph construction method is related to sample similarity, and non-local frequency band commonalities are indirectly utilized through the propagation of sample structure.
[0061] Graph convolutional neural networks are more robust to small samples. Due to the difficulty in collecting raw materials, defining labels, lack of large-scale public datasets, high spectral redundancy, and long measurement times, terahertz frequency domain signal sets are often relatively small. Graph convolutional neural networks share parameters on the graph structure, making them naturally suitable for small datasets.
[0062] Optionally, the signal detection model includes a first graph convolution module, a second graph convolution module, and a classification module.
[0063] Optionally, the core terahertz frequency domain signals of n medicinal samples to be identified and the adjacency matrix are input into a pre-trained signal detection model to obtain the category probability matrix of the n medicinal samples to be identified output by the signal detection model. This includes: inputting the core terahertz frequency domain signals of the n medicinal samples to be identified and the adjacency matrix into a first graph convolution module; reducing the dimension of the core terahertz frequency domain signals of the n medicinal samples to be identified to a first value through the first graph convolution module; outputting the core terahertz frequency domain signals of the n medicinal samples to be identified with the first dimension to a second graph convolution module; and using the second graph convolution module to output the core terahertz frequency domain signals of the n medicinal samples to be identified. The dimension of the core terahertz frequency domain signal of the n medicinal samples to be identified is reduced from a first value to a second value, and the core terahertz frequency domain signal of the n medicinal samples to be identified with the second value is output to the classification module. Through the classification module, the dimension of the core terahertz frequency domain signal of the n medicinal samples to be identified is reduced from the second value to a third value. Using a preset probability calculation function, the category probability matrix of the n medicinal samples to be identified is determined based on the core terahertz frequency domain signal of the n medicinal samples to be identified with the third value, and the category probability matrix of the n medicinal samples to be identified is output. Wherein, the first value is greater than the second value, the second value is greater than the third value, and the third value is equal to the total number of c preset medicinal categories.
[0064] Optionally, the first graph convolution module can be a graph convolution module used to reduce the dimension of the core terahertz frequency domain signals of the n medicinal samples to be identified from k to a first value. The second graph convolution module can be a graph convolution module used to reduce the dimension of the core terahertz frequency domain signals of the n medicinal samples to be identified from the first value to a second value. The classification module can be a multilayer perceptron used to reduce the dimension of the core terahertz frequency domain signals of the n medicinal samples to be identified from the second value to a third value, using a preset probability calculation function, to determine the class probability matrix of the n medicinal samples to be identified based on the core terahertz frequency domain signals of the n medicinal samples to be identified with the third value, and output the class probability matrix of the n medicinal samples to be identified. The first value, the second value, and the third value are preset integers greater than or equal to 2. k is greater than the first value, the first value is greater than the second value, the second value is greater than the third value, and the third value is equal to the total number of c preset medicinal categories. The preset probability calculation function can be a pre-defined function used to calculate the category probability matrix of n unidentified medicinal material samples based on the core terahertz frequency domain signals of n unidentified medicinal material samples with a third dimension. In a specific example, Figure 2 This is a schematic diagram of the structure of a signal detection model provided in Embodiment 1 of the present invention. The signal detection model includes a first graph convolution module, a second graph convolution module, and a classification module.
[0065] Optionally, the first graph convolution module normalizes the adjacency matrix using the degree matrix of the adjacency matrix to obtain a normalized adjacency matrix. Using a preset activation function, it calculates the core terahertz frequency domain signals of the n medicinal samples to be identified based on the normalized adjacency matrix, the core terahertz frequency domain signals of the n medicinal samples to be identified with the dimension reduced to a first value.
[0066] Optionally, the first convolutional module can calculate the degree matrix of the adjacency matrix, and normalize the adjacency matrix using the degree matrix to obtain a normalized adjacency matrix. A preset activation function can be used to calculate the core terahertz frequency domain signals of the n medicinal samples to be identified, based on the normalized adjacency matrix, the core terahertz frequency domain signals of the n medicinal samples to be identified, and preset weights, thus reducing the dimension of k to a first value. The degree matrix of the adjacency matrix is a... The degree matrix of an adjacency matrix is a diagonal matrix. Each diagonal element of the degree matrix is the sum of the diagonal elements of the adjacency matrix. The diagonal elements of the degree matrix can be represented as... The sum of the diagonal elements of the adjacency matrix can be expressed as: The degree matrix of an adjacency matrix, where each diagonal element is the sum of the diagonal elements of the adjacency matrix, can be represented as: The normalized adjacency matrix is D is the degree matrix of the adjacency matrix, A is the adjacency matrix, and I is... The identity matrix. Normalizing the adjacency matrix using its degree matrix yields a normalized adjacency matrix, which can be represented as: The preset activation function can be expressed as: The core terahertz frequency domain signals of n medicinal samples to be identified can be represented as: The normalized adjacency matrix can be expressed as The preset weights are represented as The core terahertz frequency domain signal of n medicinal material samples to be identified, with the dimension reduced from k to the first value, can be represented as: Using a preset activation function, the process of calculating the core terahertz frequency domain signals of n medicinal samples to be identified, based on the normalized adjacency matrix, the core terahertz frequency domain signals of n samples to be identified, and preset weights, to reduce the dimension from k to the first value, can be represented as follows: .
[0067] Optionally, the loss function of the signal detection model is expressed as: Loss is the loss function of the signal detection model. It is the cross-entropy loss function. It is a pre-set weighting coefficient. It represents the loss function that preserves the graph structure constraints. . It is the element in the i-th row and j-th column of the matrix. It is a vector composed of the data points in the core terahertz frequency domain signal of the i-th medicinal sample to be identified. It is a vector composed of the data points in the core terahertz frequency domain signal of the j-th medicinal sample to be identified.
[0068] Optionally, the evaluation metrics for the signal detection model may include recognition accuracy, false acceptance rate, and false rejection rate. Specifically, the formula for calculating recognition accuracy can be... Accuracy is the recognition accuracy of the signal detection model. TP+TN is the total number of correct class probability matrices output by the signal detection model. TP+FP+TN+FN is the total number of class probability matrices output by the signal detection model. TP represents true positives, TN represents true negatives, FP represents false positives, and FN represents false negatives. The formula for calculating the false acceptance rate is... FAR is the false acceptance rate of the signal detection model, NIRA is the total number of samples in the out-of-set test, which consists of samples from different varieties of medicinal materials, and NFA is the number of samples falsely accepted by the signal detection model. The formula for calculating the false rejection rate is as follows: FRR is the false rejection rate of the signal detection model, NGRA is the total number of tests within the set, and NFR is the number of falsely rejected samples.
[0069] Step 105: Based on the category probability matrix, determine the medicinal material categories of n medicinal material samples to be identified from c preset medicinal material categories.
[0070] Optionally, based on the category probability matrix, the medicinal material categories of n samples to be identified are determined from c preset medicinal material categories. This includes: for each sample to be identified, determining the maximum value among the probabilities of the sample corresponding to the c preset medicinal material categories in the category probability matrix, and determining the preset medicinal material category to which the maximum value belongs as the medicinal material category of the sample to be identified. Typically, the preset medicinal material category to which the probability of the sample corresponding to the c preset medicinal material categories belongs is the medicinal material category of the sample to be identified. Alternatively, the probabilities of the sample to be identified corresponding to the c preset medicinal material categories in the category probability matrix can be statistically analyzed to determine the maximum value among each probability, and the preset medicinal material category to which the maximum value belongs can be determined as the medicinal material category of the sample to be identified, thereby determining the medicinal material category of the sample to be identified from c preset medicinal material categories.
[0071] Optionally, after determining the medicinal material categories of n medicinal material samples to be identified from c preset medicinal material categories based on the category probability matrix, the method further includes: sending the identification information and medicinal material categories of the n medicinal material samples to be identified to the target user's terminal device.
[0072] The technical solution of this invention involves acquiring terahertz time-domain signals from n medicinal material samples to be identified, converting these signals into frequency-domain signals to obtain terahertz frequency-domain signals for the n medicinal material samples; then preprocessing these signals to obtain standard terahertz frequency-domain signals for the n medicinal material samples; extracting features from these standard terahertz frequency-domain signals to obtain core terahertz frequency-domain signals for the n medicinal material samples; and using a pre-trained signal detection model, determining the class probability matrix of the n medicinal material samples based on the core terahertz frequency-domain signals and the adjacency matrix corresponding to these signals. The class probability matrix of the n medicinal material samples... This method includes the probability of each medicinal sample to be identified corresponding to c preset medicinal categories. Finally, based on the category probability matrix, the medicinal categories of n medicinal samples to be identified are determined from the c preset medicinal categories. This solves the problem that the medicinal identification schemes in related technologies cannot quickly and accurately identify the medicinal categories of multiple medicinal samples, resulting in low efficiency in the medicinal identification process. It can perform data preprocessing and feature extraction on the terahertz frequency domain signals of multiple medicinal samples. Based on the processed terahertz frequency domain signals of multiple medicinal samples and the signal detection model, the category probability matrix of multiple medicinal samples can be determined. Then, based on the category probability matrix, the medicinal categories of multiple medicinal samples can be quickly and accurately determined from each preset medicinal category, realizing fast and accurate identification of the medicinal categories of multiple medicinal samples and improving the efficiency of the medicinal identification process.
[0073] The technical solution of this invention can solve the problems of spectral noise, baseline drift, and inconsistency of dimensions in the terahertz frequency domain signal of the medicinal material sample to be identified by performing noise suppression, scattering effect correction, and data normalization on the terahertz frequency domain signal of the medicinal material sample to be identified.
[0074] Example 2
[0075] Figure 3 This is a flowchart illustrating a terahertz-based method for identifying medicinal materials according to Embodiment 2 of the present invention. The embodiments of the present invention can be combined with various optional solutions from one or more of the above embodiments. For example... Figure 3 As shown, the method includes:
[0076] Step 201: Collect terahertz time-domain signals of n medicinal samples to be identified, convert the terahertz time-domain signals of the n medicinal samples to be identified into frequency-domain signals, and obtain the terahertz frequency-domain signals of the n medicinal samples to be identified.
[0077] Step 202: Perform data preprocessing on the terahertz frequency domain signals of the n medicinal material samples to be identified to obtain the standard terahertz frequency domain signals of the n medicinal material samples to be identified.
[0078] Step 203: Extract features from the standard terahertz frequency domain signals of the n medicinal samples to be identified, and obtain the core terahertz frequency domain signals of the n medicinal samples to be identified.
[0079] Step 204: Based on the core terahertz frequency domain signals of the n medicinal samples to be identified, construct an adjacency matrix corresponding to the core terahertz frequency domain signals of the n medicinal samples to be identified.
[0080] Step 205: Input the core terahertz frequency domain signals of the n medicinal samples to be identified and the adjacency matrix into the pre-trained signal detection model to obtain the category probability matrix of the n medicinal samples to be identified output by the signal detection model.
[0081] The input to the signal detection model is the core terahertz frequency domain signal of n medicinal samples to be identified and the adjacency matrix corresponding to the core terahertz frequency domain signal of the n medicinal samples to be identified. The output of the signal detection model is the category probability matrix of the n medicinal samples to be identified, which contains the probability of each medicinal sample to be identified corresponding to c preset medicinal categories.
[0082] Step 206: Based on the category probability matrix, determine the medicinal material category of n medicinal material samples to be identified from c preset medicinal material categories.
[0083] The technical solution of this invention can determine the category probability matrix of multiple medicinal material samples based on the terahertz frequency domain signals and signal detection models of multiple processed medicinal material samples. Then, it can quickly and accurately determine the medicinal material category of multiple medicinal material samples from each preset medicinal material category according to the category probability matrix, thereby realizing the rapid and accurate identification of the medicinal material category of multiple medicinal material samples and improving the efficiency of the medicinal material identification process.
[0084] Example 3
[0085] Figure 4 This is a schematic diagram of a terahertz-based medicinal herb identification device provided in Embodiment 3 of the present invention. The device can be configured in an electronic device. Figure 4As shown, the device includes: an information acquisition unit 301, a signal preprocessing unit 302, a signal feature extraction unit 303, a signal detection unit 304, and a category determination unit 305.
[0086] The system includes: an information acquisition unit 301, used to acquire terahertz time-domain signals of n medicinal material samples to be identified, and convert these signals into frequency-domain signals to obtain terahertz frequency-domain signals of the n medicinal material samples; a signal preprocessing unit 302, used to preprocess the terahertz frequency-domain signals of the n medicinal material samples to obtain standard terahertz frequency-domain signals of the n medicinal material samples; and a signal feature extraction unit 303, used to extract features from the standard terahertz frequency-domain signals of the n medicinal material samples to obtain the core terahertz signals of the n medicinal material samples. The signal detection unit 304 is used to determine the category probability matrix of n medicinal samples to be identified based on the core terahertz frequency domain signals of the n medicinal samples to be identified and the adjacency matrix corresponding to the core terahertz frequency domain signals of the n medicinal samples to be identified through a pre-trained signal detection model; wherein, the category probability matrix of the n medicinal samples to be identified contains the probability of each medicinal sample to be identified corresponding to c preset medicinal categories; the category determination unit 305 is used to determine the medicinal category of the n medicinal samples to be identified from the c preset medicinal categories based on the category probability matrix.
[0087] The technical solution of this invention involves acquiring terahertz time-domain signals from n medicinal material samples to be identified, converting these signals into frequency-domain signals to obtain terahertz frequency-domain signals for the n medicinal material samples; then preprocessing these signals to obtain standard terahertz frequency-domain signals for the n medicinal material samples; extracting features from these standard terahertz frequency-domain signals to obtain core terahertz frequency-domain signals for the n medicinal material samples; and using a pre-trained signal detection model, determining the class probability matrix of the n medicinal material samples based on the core terahertz frequency-domain signals and the adjacency matrix corresponding to these signals. The class probability matrix of the n medicinal material samples... This method includes the probability of each medicinal sample to be identified corresponding to c preset medicinal categories. Finally, based on the category probability matrix, the medicinal categories of n medicinal samples to be identified are determined from the c preset medicinal categories. This solves the problem that the medicinal identification schemes in related technologies cannot quickly and accurately identify the medicinal categories of multiple medicinal samples, resulting in low efficiency in the medicinal identification process. It can perform data preprocessing and feature extraction on the terahertz frequency domain signals of multiple medicinal samples. Based on the processed terahertz frequency domain signals of multiple medicinal samples and the signal detection model, the category probability matrix of multiple medicinal samples can be determined. Then, based on the category probability matrix, the medicinal categories of multiple medicinal samples can be quickly and accurately determined from each preset medicinal category, realizing fast and accurate identification of the medicinal categories of multiple medicinal samples and improving the efficiency of the medicinal identification process.
[0088] In an optional embodiment of the present invention, the signal preprocessing unit 302 is specifically configured to: denoise the terahertz frequency domain signals of the n medicinal material samples to be identified using a preset signal denoising algorithm to obtain denoised terahertz frequency domain signals of the n medicinal material samples; perform multivariate scattering correction processing on the terahertz frequency domain signals of the n medicinal material samples according to the average value of the denoised terahertz frequency domain signals of the n medicinal material samples to obtain corrected terahertz frequency domain signals of the n medicinal material samples; and normalize the terahertz frequency domain signals of the n medicinal material samples according to the minimum and maximum values of the corrected terahertz frequency domain signals of the n medicinal material samples to obtain standard terahertz frequency domain signals of the n medicinal material samples.
[0089] In an optional embodiment of the present invention, the signal feature extraction unit 303 is specifically configured to: perform the following operations on the standard terahertz frequency domain signal of each medicinal sample to be identified: determine the contribution rate of m data points in the standard terahertz frequency domain signal of the medicinal sample to be identified; sort the contribution rates of the m data points in descending order of value, retain the data points with the highest contribution rates in the standard terahertz frequency domain signal and delete other data points to obtain the core terahertz frequency domain signal of the medicinal sample to be identified.
[0090] In an optional embodiment of the present invention, the signal detection unit 304 is specifically configured to: construct an adjacency matrix corresponding to the core terahertz frequency domain signals of the n medicinal samples to be identified, based on the core terahertz frequency domain signals of the n medicinal samples to be identified; input the core terahertz frequency domain signals of the n medicinal samples to be identified and the adjacency matrix to a pre-trained signal detection model to obtain the class probability matrix of the n medicinal samples to be identified output by the signal detection model; wherein, the input of the signal detection model is the core terahertz frequency domain signals of the n medicinal samples to be identified and the adjacency matrix corresponding to the core terahertz frequency domain signals of the n medicinal samples to be identified, and the output of the signal detection model is the class probability matrix of the n medicinal samples to be identified.
[0091] In one optional embodiment of the present invention, the signal detection model may be a graph convolutional neural network model, and the signal detection model supports non-Euclidean space modeling.
[0092] In one optional embodiment of the present invention, the signal detection model may include a first graph convolution module, a second graph convolution module, and a classification module.
[0093] In an optional embodiment of the present invention, the signal detection unit 304, when performing the operation of inputting the core terahertz frequency domain signals of n medicinal samples to be identified and the adjacency matrix into a pre-trained signal detection model to obtain the category probability matrix of the n medicinal samples to be identified output by the signal detection model, is specifically configured to: input the core terahertz frequency domain signals of the n medicinal samples to be identified and the adjacency matrix into the first graph convolution module, reduce the dimension of the core terahertz frequency domain signals of the n medicinal samples to be identified to a first value through the first graph convolution module, and output the core terahertz frequency domain signals of the n medicinal samples to be identified with the first dimension to the second graph convolution module; and reduce the dimension of the core terahertz frequency domain signals of the n medicinal samples to be identified to a first value through the second graph convolution module. The dimension of the core terahertz frequency domain signal of each of the n medicinal samples to be identified is reduced from a first value to a second value. The core terahertz frequency domain signals of the n medicinal samples to be identified with the second value are output to the classification module. Through the classification module, the dimension of the core terahertz frequency domain signals of the n medicinal samples to be identified is reduced from the second value to a third value. Using a preset probability calculation function, the category probability matrix of the n medicinal samples to be identified is determined based on the core terahertz frequency domain signals of the n medicinal samples to be identified with the third value, and the category probability matrix of the n medicinal samples to be identified is output. Wherein, the first value is greater than the second value, the second value is greater than the third value, and the third value is equal to the total number of c preset medicinal categories.
[0094] In an optional embodiment of the present invention, the category determination unit 305 is specifically configured to: for each medicinal material sample to be identified, determine the maximum value among the probabilities of the medicinal material sample to be identified in the category probability matrix corresponding to c preset medicinal material categories, and determine the preset medicinal material category to which the maximum value belongs as the medicinal material category of the medicinal material sample to be identified.
[0095] In an optional embodiment of the present invention, the first graph convolution module may normalize the adjacency matrix using the degree matrix of the adjacency matrix to obtain a normalized adjacency matrix. Then, using a preset activation function, the module calculates the core terahertz frequency domain signals of the n medicinal samples to be identified based on the normalized adjacency matrix, the core terahertz frequency domain signals of the n medicinal samples to be identified, and the preset weights to obtain the core terahertz frequency domain signals of the n medicinal samples to be identified with the dimension reduced to a first value.
[0096] The terahertz-based medicinal herb identification device provided in this embodiment of the invention can execute the terahertz-based medicinal herb identification method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method.
[0097] Example 4
[0098] Figure 5A schematic diagram of an electronic device 10, which can be used to implement the terahertz-based medicinal herb identification method according to embodiments of the present invention, is shown. The electronic device is intended to represent various forms of digital computers. It can also represent various forms of mobile devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0099] like Figure 5 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0100] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0101] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0102] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A method for identifying medicinal materials based on terahertz, characterized in that, The method comprises the following steps: Collecting terahertz time domain signals of n samples of medicinal materials to be identified, and converting the terahertz time domain signals of the n samples of medicinal materials to be identified into frequency domain signals to obtain terahertz frequency domain signals of the n samples of medicinal materials to be identified; Data preprocessing is performed on the terahertz frequency domain signals of the n samples of medicinal materials to be identified to obtain standard terahertz frequency domain signals of the n samples of medicinal materials to be identified; Feature extraction is performed on the standard terahertz frequency domain signals of the n samples of medicinal materials to be identified to obtain core terahertz frequency domain signals of the n samples of medicinal materials to be identified; A class probability matrix of the n samples of medicinal materials to be identified is determined by using a pre-trained signal detection model according to the core terahertz frequency domain signals of the n samples of medicinal materials to be identified and an adjacency matrix corresponding to the core terahertz frequency domain signals of the n samples of medicinal materials to be identified, wherein the class probability matrix of the n samples of medicinal materials to be identified comprises a probability corresponding to each of the n samples of medicinal materials to be identified and c preset medicinal material categories; The medicinal material categories of the n samples of medicinal materials to be identified are determined from the c preset medicinal material categories according to the class probability matrix.
2. The terahertz-based medicinal material identification method according to claim 1, characterized in that, Data preprocessing is performed on the terahertz frequency domain signals of the n samples of medicinal materials to be identified to obtain standard terahertz frequency domain signals of the n samples of medicinal materials to be identified, including: The terahertz frequency domain signals of the n samples of medicinal materials to be identified are denoised by using a preset signal denoising algorithm to obtain denoised terahertz frequency domain signals of the n samples of medicinal materials to be identified; Multivariate scattering correction is performed on the terahertz frequency domain signals of the n samples of medicinal materials to be identified according to the average values of the denoised terahertz frequency domain signals of the n samples of medicinal materials to be identified to obtain corrected terahertz frequency domain signals of the n samples of medicinal materials to be identified; Normalization is performed on the terahertz frequency domain signals of the n samples of medicinal materials to be identified according to the minimum values and the maximum values of the corrected terahertz frequency domain signals of the n samples of medicinal materials to be identified to obtain the standard terahertz frequency domain signals of the n samples of medicinal materials to be identified.
3. The terahertz-based medicinal material identification method according to claim 1, characterized in that, Feature extraction is performed on the standard terahertz frequency domain signals of the n samples of medicinal materials to be identified to obtain core terahertz frequency domain signals of the n samples of medicinal materials to be identified, including: The following operations are performed on the standard terahertz frequency domain signals of each sample of medicinal materials to be identified: The contribution rates of m data points in the standard terahertz frequency domain signals of the sample of medicinal materials to be identified are determined; The contribution rates of the m data points are sorted in descending order of numerical value, the data points with the top k contribution rates in the standard terahertz frequency domain signals are retained, and the other data points are deleted to obtain the core terahertz frequency domain signals of the sample of medicinal materials to be identified. 4.The terahertz-based medicinal material identification method according to claim 1, characterized in that, A class probability matrix of the n samples of medicinal materials to be identified is determined by using a pre-trained signal detection model according to the core terahertz frequency domain signals of the n samples of medicinal materials to be identified and an adjacency matrix corresponding to the core terahertz frequency domain signals of the n samples of medicinal materials to be identified, including: An adjacency matrix corresponding to the core terahertz frequency domain signals of the n samples of medicinal materials to be identified is constructed according to the core terahertz frequency domain signals of the n samples of medicinal materials to be identified; inputting the core terahertz frequency domain signals of the n to-be-identified medicinal material samples and the adjacency matrix into a pre-trained signal detection model to obtain a category probability matrix of the n to-be-identified medicinal material samples output by the signal detection model; wherein the input of the signal detection model is the core terahertz frequency domain signals of the n to-be-identified medicinal material samples and the adjacency matrix corresponding to the core terahertz frequency domain signals of the n to-be-identified medicinal material samples, and the output of the signal detection model is a category probability matrix of the n to-be-identified medicinal material samples.
5. The terahertz-based medicinal material identification method according to claim 4, characterized in that, The signal detection model is a graph convolutional neural network model, and the signal detection model supports non-Euclidean space modeling. 6.The terahertz-based medicinal material identification method according to claim 5, characterized in that, The signal detection model comprises a first graph convolution module, a second graph convolution module, and a classification module. 7.The terahertz-based medicinal material identification method according to claim 6, characterized in that, inputting the core terahertz frequency domain signals of the n to-be-identified medicinal material samples and the adjacency matrix into a pre-trained signal detection model to obtain a category probability matrix of the n to-be-identified medicinal material samples output by the signal detection model, comprising: inputting the core terahertz frequency domain signals of the n to-be-identified medicinal material samples and the adjacency matrix into the first graph convolution module, reducing the dimension of the core terahertz frequency domain signals of the n to-be-identified medicinal material samples to a first value through the first graph convolution module, and outputting the core terahertz frequency domain signals of the n to-be-identified medicinal material samples with the dimension of the first value to the second graph convolution module; reducing the dimension of the core terahertz frequency domain signals of the n to-be-identified medicinal material samples from the first value to a second value through the second graph convolution module, and outputting the core terahertz frequency domain signals of the n to-be-identified medicinal material samples with the dimension of the second value to the classification module; reducing the dimension of the core terahertz frequency domain signals of the n to-be-identified medicinal material samples from the second value to a third value through the classification module, using a preset probability calculation function, determining a category probability matrix of the n to-be-identified medicinal material samples according to the core terahertz frequency domain signals of the n to-be-identified medicinal material samples with the dimension of the third value, and outputting the category probability matrix of the n to-be-identified medicinal material samples; wherein the first value is greater than the second value, the second value is greater than the third value, and the third value is equal to the total number of the c preset medicinal material categories. 8.The terahertz-based medicinal material identification method according to claim 1, characterized in that, According to the category probability matrix, the medicinal material categories of the n to-be-identified medicinal material samples are determined from the c preset medicinal material categories, comprising: for each to-be-identified medicinal material sample, determining the maximum value of the probabilities corresponding to the c preset medicinal material categories of the to-be-identified medicinal material sample in the category probability matrix, and determining the preset medicinal material category to which the maximum value belongs as the medicinal material category of the to-be-identified medicinal material sample. 9.The terahertz-based medicinal material identification method according to claim 6, characterized in that, The first graph convolution module normalizes the adjacency matrix through a degree matrix of the adjacency matrix to obtain a normalized adjacency matrix, and uses a preset activation function to calculate according to the normalized adjacency matrix, the core terahertz frequency domain signals of the n to-be-identified medicinal material samples, and a preset weight to obtain the core terahertz frequency domain signals of the n to-be-identified medicinal material samples with the dimension reduced to the first value. 10.A terahertz-based medicinal material identification device, characterized in that, comprising: The information collection unit is configured to collect terahertz time domain signals of n samples of medicinal materials to be identified, convert the terahertz time domain signals of the n samples of medicinal materials to be identified into frequency domain signals, and obtain terahertz frequency domain signals of the n samples of medicinal materials to be identified. The signal preprocessing unit is configured to perform data preprocessing on the terahertz frequency domain signals of the n samples of medicinal materials to be identified, and obtain standard terahertz frequency domain signals of the n samples of medicinal materials to be identified. The signal feature extraction unit is configured to perform feature extraction on the standard terahertz frequency domain signals of the n samples of medicinal materials to be identified, and obtain core terahertz frequency domain signals of the n samples of medicinal materials to be identified. The signal detection unit is configured to determine a category probability matrix of the n samples of medicinal materials to be identified according to the core terahertz frequency domain signals of the n samples of medicinal materials to be identified and an adjacency matrix corresponding to the core terahertz frequency domain signals of the n samples of medicinal materials to be identified by using a pre-trained signal detection model, wherein the category probability matrix of the n samples of medicinal materials to be identified comprises probabilities corresponding to c preset categories of medicinal materials for each sample of medicinal materials to be identified. The category determination unit is configured to determine categories of medicinal materials of the n samples of medicinal materials to be identified from the c preset categories of medicinal materials according to the category probability matrix.
Citation Information
Patent Citations
Terahertz-based genuine medicinal material detection method, system, equipment and medium
CN115905909A
Drug terahertz absorption spectrum data generation method based on conditional diffusion
CN119811540A