Traditional Chinese medicine particle quality inspection method, program product, electronic equipment and storage medium

By obtaining multi-dimensional spectral data of traditional Chinese medicine particles and using convolutional neural network for feature extraction, the existing traditional Chinese medicine particles detection methods are solved, and automated and intelligent quality inspection is realized, which improves detection efficiency and accuracy.

CN120011860APending Publication Date: 2025-05-16JIANGXI UNIVERSITY OF TRADITIONAL CHINESE MEDICINE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510212345.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-25
Publication Date
2025-05-16

AI Technical Summary

Technical Problem

The existing Chinese medicine particle detection method is based on offline testing after random sampling, which is cumbersome and inefficient, and the detection process may damage the tablets.

Method used

By obtaining multi-dimensional spectral data of traditional Chinese medicine particles, using convolutional neural networks for feature extraction, and using pre-trained quality inspection models for identification, automatic and intelligent quality inspection are achieved.

Benefits of technology

It improves the efficiency and accuracy of Chinese medicine particles detection, reduces human errors and complicated processing processes, and reduces damage to the tablets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120011860A_ABST
    Figure CN120011860A_ABST
Patent Text Reader

Abstract

The invention provides a traditional Chinese medicine particle quality inspection method, a program product, electronic equipment and a storage medium. The method comprises the following steps: acquiring spectral data of traditional Chinese medicine particles in different dimensions; respectively carrying out feature extraction on the spectral data by utilizing a convolutional neural network of a dimension corresponding to the spectral data to obtain spectral feature data corresponding to the spectral data; and identifying the spectral feature data by using a pre-trained traditional Chinese medicine particle quality inspection model to obtain a traditional Chinese medicine particle quality inspection result. The characteristics of the traditional Chinese medicine granules can be comprehensively captured by collecting multi-dimensional spectral data of the traditional Chinese medicine granules. According to the method, the convolutional neural network of the corresponding dimension is selected according to the dimension of the spectral data to perform feature extraction, information in a multi-dimensional spectrum can be utilized to the greatest extent, the pre-trained model can quickly and accurately perform quality evaluation on new spectral feature data, the detection efficiency and accuracy are improved, human errors are reduced, and the detection accuracy is improved. And the damage to the tablets in the detection process is also reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of drug testing, and in particular to a method for quality testing of traditional Chinese medicine granules, a program product, an electronic device and a storage medium. Background Art

[0002] The quality of Chinese medicine granules affects the fluidity, compressibility and stability of the granules. They should be adjusted within an appropriate range. These key quality attributes are related to the safety and effectiveness of the final product, and further affect absorption, metabolism and other behaviors. Therefore, the quality of Chinese medicine granules needs to be strictly controlled. The current detection method is based on offline testing after random sampling. For example, the moisture content is measured using the pharmacopoeia moisture determination method. This detection process is cumbersome, resulting in low detection efficiency, and the tablets will be damaged during the detection process. Summary of the invention

[0003] The purpose of the embodiments of the present application is to provide a method for quality inspection of Chinese medicine granules, a program product, an electronic device and a storage medium, which are used to solve the above-mentioned technical problems.

[0004] In the first aspect, an embodiment of the present application provides a method for quality inspection of Chinese medicine granules, including: obtaining spectral data of different dimensions of Chinese medicine granules; using a convolutional neural network of dimensions corresponding to the spectral data to perform feature extraction on the spectral data respectively, and obtain spectral feature data corresponding to the spectral data; using a pre-trained Chinese medicine granule quality inspection model to identify the spectral feature data and obtain the Chinese medicine granule quality inspection results.

[0005] In the above implementation process, by collecting multi-dimensional spectral data of Chinese medicine granules, the characteristics of Chinese medicine granules can be fully captured. According to the dimension of the spectral data, the convolutional neural network of the corresponding dimension is selected for feature extraction, which can maximize the use of information in the multi-dimensional spectrum and provide more accurate data support for the quality inspection of Chinese medicine granules. The pre-trained model can quickly and accurately evaluate the quality of new spectral feature data, realize automated and intelligent quality inspection of Chinese medicine granules, improve inspection efficiency and accuracy, reduce human errors, reduce complicated processing procedures, and reduce damage to tablets during the inspection process.

[0006] Optionally, in an embodiment of the present application, the spectral data includes one-dimensional spectral data and two-dimensional spectral data; the one-dimensional spectral data includes near-infrared spectral data and mass spectral data; the two-dimensional data includes hyperspectral data; the spectral feature data includes one-dimensional feature data and two-dimensional feature data; and the convolutional neural network of the corresponding dimension of the spectral data is used to extract features from the spectral data respectively to obtain spectral feature data corresponding to the spectral data, including: using a feature selection method to process the near-infrared spectral data and the mass spectral data respectively to obtain one-dimensional spectral sampling data; and using a feature selection method to process the hyperspectral data to obtain two-dimensional spectral sampling data; using a one-dimensional convolutional neural network to extract features from the one-dimensional spectral sampling data to obtain one-dimensional feature data; and using a two-dimensional convolutional neural network to extract features from the two-dimensional spectral sampling data to obtain two-dimensional feature data.

[0007] In the above implementation process, feature selection methods are used to remove redundant and irrelevant information, improve the efficiency of subsequent model training, and reduce the complexity of the model and the risk of overfitting. One-dimensional convolutional neural networks capture local patterns and trends in one-dimensional data through local connections, which matches the characteristics of one-dimensional spectral data because spectral data is usually a continuous sequence of wavelengths. Two-dimensional convolutional neural networks can effectively capture spatial features in images, retain rich spatial information in hyperspectral spectra, and provide support for subsequent direct drop detection. Using convolutional neural networks with corresponding dimensions of spectral data to extract features from spectral data respectively improves the efficiency and accuracy of feature extraction.

[0008] Optionally, in an embodiment of the present application, a pre-trained Chinese medicine granule quality inspection model is used to identify spectral feature data to obtain the quality inspection results of the Chinese medicine granules, including: fusing one-dimensional feature data and two-dimensional feature data to obtain fused features; the fusion processing includes splicing or attention mechanism fusion; using the Chinese medicine granule quality inspection model, the fused features are identified to obtain the quality inspection results of the Chinese medicine granules.

[0009] In the above implementation process, by fusing one-dimensional feature data and two-dimensional feature data to obtain fused features, feature data of different dimensions are effectively combined to obtain a more comprehensive input representation, thereby improving the prediction ability of the model.

[0010] Optionally, in an embodiment of the present application, the spectral feature data includes near-infrared spectral feature data, mass spectral feature data and hyperspectral feature data; the Chinese medicine granule quality inspection model includes a first multivariate analysis model, a second multivariate analysis model and a third multivariate analysis model; the spectral feature data is identified using a pre-trained Chinese medicine granule quality inspection model to obtain the Chinese medicine granule quality inspection result, including: inputting the near-infrared spectral feature data into the first multivariate analysis model to obtain a near-infrared prediction value; inputting the mass spectral feature data into the second multivariate analysis model to obtain a mass spectral prediction value; inputting the hyperspectral feature data into the third multivariate analysis model to obtain a hyperspectral prediction value; and obtaining the Chinese medicine granule quality inspection result based on the near-infrared prediction value, the mass spectral prediction value and the hyperspectral prediction value.

[0011] In the above implementation process, by combining spectral data of different dimensions and using its individually trained multivariate analysis model, a comprehensive analysis of the quality of Chinese medicine granules is achieved. Not only does it improve the accuracy and robustness of the prediction, but it also provides more comprehensive quality inspection results by integrating information from multiple data sources, which helps to improve the quality control level of Chinese medicine granules and reduce the deviation that may be introduced by a single data source.

[0012] Optionally, in an embodiment of the present application, the quality inspection results of the Chinese medicine granules are obtained according to the near-infrared prediction values, mass spectrometry prediction values ​​and hyperspectral prediction values, including: using a multivariate analysis method to obtain the quality inspection results of the Chinese medicine granules according to the near-infrared prediction values, mass spectrometry prediction values ​​and hyperspectral prediction values; the multivariate analysis method includes multiple linear regression or statistical methods.

[0013] In the above implementation process, the multivariate analysis method is used to obtain the quality inspection results of Chinese medicine granules based on the near-infrared prediction value, mass spectrometry prediction value and hyperspectral prediction value. The multivariate analysis method can comprehensively consider multiple prediction values ​​to improve the prediction accuracy of the quality attributes of Chinese medicine granules. This method allows each data to be predicted using an appropriate multivariate analysis model without the need for more complex feature processing, which improves the flexibility of quality detection.

[0014] Optionally, in an embodiment of the present application, the spectral characteristic data includes near-infrared spectral characteristic data, mass spectral characteristic data and hyperspectral characteristic data; obtaining spectral data of different dimensions of Chinese medicine particles includes: sampling the Chinese medicine particles after they are made to obtain sampled particles; adjusting instrument parameters of a near-infrared spectrometer, a direct mass spectrometer and a hyperspectral imager based on the type of Chinese medicine particles; collecting near-infrared spectral data of the sampled particles using a near-infrared spectrometer; collecting mass spectral data of the sampled particles using a direct mass spectrometer; and collecting hyperspectral data of the sampled particles using a hyperspectral imager.

[0015] In the above implementation process, through scientific and reasonable sampling methods, the collected samples can represent the quality characteristics of the entire batch of Chinese medicine granules. Appropriate instrument parameters can improve the quality of spectral data and the accuracy of analysis, ensuring that the data can accurately reflect the characteristics of Chinese medicine granules. By comprehensively utilizing near-infrared spectroscopy, mass spectrometry and hyperspectral imaging technology, comprehensive quality analysis of Chinese medicine granules is achieved.

[0016] Optionally, in an embodiment of the present application, after obtaining spectral feature data corresponding to the spectral data, the method also includes: using an attention mechanism to process the spectral feature data to obtain attention data; the attention mechanism includes a channel attention mechanism or a pixel attention mechanism; inputting the attention data into a convolutional neural network of a preset dimension to obtain enhanced features; using a pre-trained Chinese medicine granule quality inspection model to identify the spectral feature data to obtain the Chinese medicine granule quality inspection results, including: using the Chinese medicine granule quality inspection model to identify the enhanced features to obtain the Chinese medicine granule quality inspection results.

[0017] In the above implementation process, the attention mechanism can identify and emphasize the most relevant features, and improve the model's sensitivity to key information in the spectral feature data. This improves the accuracy of the analysis. Enhanced features can provide richer and more abstract data representations, which helps improve the performance of subsequent recognition tasks. Convolutional neural networks help capture complex patterns and relationships in the data. By combining the advantages of the attention mechanism and convolutional neural networks, the process of extracting key features from spectral data and performing quality inspection is realized.

[0018] In the second aspect, the embodiment of the present application also provides a Chinese medicine granule quality inspection device, including: a data acquisition module, used to obtain spectral data of different dimensions of Chinese medicine granules; a feature extraction module, used to use the convolutional neural network of the dimensions corresponding to the spectral data to extract features of the spectral data respectively, and obtain spectral feature data corresponding to the spectral data; a quality prediction module, used to use a pre-trained Chinese medicine granule quality inspection model to identify the spectral feature data and obtain the Chinese medicine granule quality inspection result.

[0019] In a third aspect, an embodiment of the present application further provides a computer program product, including computer program instructions, which, when executed by a processor, execute the method provided by the first aspect or any one of the implementations of the first aspect.

[0020] In a fourth aspect, an embodiment of the present application further provides an electronic device, comprising: a processor and a memory, the memory storing computer program instructions, and the computer program instructions, when executed by the processor, execute the method provided by the first aspect or any one of the implementations of the first aspect.

[0021] In a fifth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the method provided by the first aspect or any one of the implementations of the first aspect is executed.

[0022] By adopting a Chinese medicine granule quality inspection method, program product, electronic device and storage medium provided by the present application, the characteristics of Chinese medicine granules can be fully captured by collecting multi-dimensional spectral data of Chinese medicine granules. According to the dimension of the spectral data, a convolutional neural network of corresponding dimensions is selected for feature extraction, which can maximize the use of information in the multi-dimensional spectrum and provide more accurate data support for the quality inspection of Chinese medicine granules. The pre-trained model can quickly and accurately evaluate the quality of new spectral feature data, realize automated and intelligent quality inspection of Chinese medicine granules, improve inspection efficiency and accuracy, reduce human errors, reduce complicated processing procedures, and reduce the damage to tablets during the inspection process. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application 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 paying creative work.

[0024] Figure 1 A schematic diagram of a process for quality inspection of traditional Chinese medicine granules provided in an embodiment of the present application;

[0025] Figure 2 A schematic diagram of the process of detecting Chinese medicine granules by the Chinese medicine granule quality inspection device provided in an embodiment of the present application;

[0026] Figure 3 A schematic diagram of the structure of a Chinese medicine granule quality inspection device provided in an embodiment of the present application;

[0027] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0028] The following embodiments of the technical solution of the present application are described in detail in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present application, and are therefore only used as examples, and cannot be used to limit the scope of protection of the present application.

[0029] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by technicians in the technical field to which this application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application.

[0030] In the description of the embodiments of the present application, the technical terms "first", "second", etc. are only used to distinguish different objects, and cannot be understood as indicating or implying relative importance or implicitly indicating the number, specific order or primary and secondary relationship of the indicated technical features. In the description of the embodiments of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.

[0031] Tablets are the most common dosage form on the market and are also the most studied drug dosage form. The quality of tablets is affected by many attributes, among which the granulation process is one of the most important factors. Therefore, the quality attributes of Chinese medicine granules must be controlled before the drug is put on the market. The key quality attributes of Chinese medicine granules include ingredient content and water content, particle size and density, which affect the fluidity, compressibility and stability of the granules. They should be adjusted within an appropriate range. These key quality attributes are related to the safety and efficacy of the final product, and further affect the in vivo behaviors such as absorption, metabolism, distribution and excretion.

[0032] Traditional analysis of Chinese medicine particles is mainly based on offline testing after random sampling. For example, the particle size distribution of Chinese medicine particles is measured using a Malvern laser particle size analyzer, the moisture content is measured using the pharmacopoeia moisture determination method, and the fluidity is measured using an intelligent powder property tester. However, these methods require the samples to be processed through multiple processes, and the processing steps are cumbersome, resulting in low detection efficiency, and the tablets will be damaged during the detection process.

[0033] A method for quality inspection of Chinese medicine granules provided in an embodiment of the present application can comprehensively capture the characteristics of Chinese medicine granules by collecting multi-dimensional spectral data of Chinese medicine granules. According to the dimension of the spectral data, a convolutional neural network of corresponding dimensions is selected for feature extraction, which can maximize the use of information in the multi-dimensional spectrum and provide more accurate data support for the quality inspection of Chinese medicine granules. The pre-trained model can quickly and accurately evaluate the quality of new spectral feature data, realize automated and intelligent quality inspection of Chinese medicine granules, improve inspection efficiency and accuracy, reduce human errors, reduce complicated processing procedures, and reduce damage to tablets during the inspection process.

[0034] See also Figure 1The flowchart of a method for quality inspection of Chinese medicine granules provided by an embodiment of the present application is shown. The method for quality inspection of Chinese medicine granules provided by an embodiment of the present application can be applied to electronic devices, which may include physical devices such as servers, PCs, tablet computers, or smart phones, or virtual devices such as virtual machines or containers. The electronic device may be a single device, or a combination of multiple devices or a cluster of a large number of devices. The method for quality inspection of Chinese medicine granules may include:

[0035] Step S110: Acquire spectral data of different dimensions of Chinese medicine particles.

[0036] Step S120: extract features from the spectral data using a convolutional neural network of a dimension corresponding to the spectral data to obtain spectral feature data corresponding to the spectral data.

[0037] Step S130: using a pre-trained Chinese medicine granule quality inspection model to identify the spectral feature data and obtain the Chinese medicine granule quality inspection result.

[0038] In step S110, Chinese herbal medicine granules refer to granular preparations made from Chinese herbal medicines after being processed by extraction, concentration and other processes. Chinese herbal medicine granules can be pure herbal extracts or compound preparations mixed according to a specific formula. Spectral data refers to data obtained by spectral technology, which reflects the characteristics of the interaction between matter and light. Multi-dimensional spectral data refers to a collection of spectral information obtained from different angles or using different technologies. These data can provide comprehensive information about the sample, including its chemical composition, physical structure and biological activity. Multi-dimensional spectral data includes spectral data of wavelength dimension, spatial dimension, etc. It can also include time dimension, polarization dimension, etc.

[0039] Professional spectrometers can be used to collect the spectral data of Chinese medicine granules. During the data collection process, environmental conditions such as temperature and humidity need to be controlled to reduce the impact of environmental factors on the spectral data of Chinese medicine granules. Before using the spectrometer, the spectrometer needs to be adjusted and calibrated regularly to improve the accuracy of the collected spectral data.

[0040] Optionally, in order to improve data quality, after obtaining the spectral data of different dimensions of the traditional Chinese medicine particles, the spectral data may be preprocessed and converted, and the preprocessing process will be introduced later.

[0041] In step S120, the spectral characteristic data corresponding to the spectral data refers to the key information extracted from the original spectral data that can represent or describe the characteristics of the substance. The spectral characteristic data, for example, the absorption peak or absorption valley at a specific wavelength in the spectrum, corresponds to the vibration energy level of a specific chemical bond in the substance. The spectral characteristic data can also reflect the concentration or content of the Chinese medicine granules, such as the spectral intensity at a specific wavelength or wavelength range. It can also include the slope, curvature, area, etc. of the spectral curve, which can be used as features to distinguish different substances in the Chinese medicine granules.

[0042] Of course, the spectral feature data corresponding to the spectral data may also include some complex features containing more information such as second-order and higher-order derivative features and multivariate statistical analysis features. The second-order and higher-order derivative features are derived from the spectral data to obtain features reflecting the spectral change rate, which helps to identify overlapping peaks or valleys. Multivariate statistical analysis features such as principal component analysis (PCA) scores, partial least squares regression (PLSR) scores, etc., are dimensionality reduction features extracted from the original spectral data. The embodiments of the present application do not limit the type and form of the spectral feature data.

[0043] When performing feature extraction, it is necessary to use the convolutional neural network of the corresponding dimension of the spectral data to extract features of the spectral data respectively. Continuing with the above embodiment, the spectral data of the wavelength dimension is one-dimensional spectral data, and the spectral data of the space dimension is two-dimensional spectral data. For one-dimensional spectral data, a one-dimensional convolutional neural network (1D CNN) can be used for feature extraction; for two-dimensional spectral data, a two-dimensional convolutional neural network (2D CNN) can be used for feature extraction.

[0044] In an optional embodiment, if the spectral data of the Chinese medicine particles include spectral data of the Chinese medicine particles in the time dimension and spectral data in the polarization dimension, feature extraction can be performed in the following manner:

[0045] Spectral data in the time dimension are usually represented as time series, where each time point has a set of spectral data. This data structure is one-dimensional, so a one-dimensional convolutional neural network can be used for feature extraction. A one-dimensional convolutional neural network captures local patterns and changing trends in time by sliding the convolution kernel over the time series, effectively extracting features in the time dimension, such as the changing patterns of spectral data over time.

[0046] Polarization-dimensional spectral data usually involves changes in the polarization state of light. This data structure may be one-dimensional (such as circular dichroism) or two-dimensional (such as ellipsometry). Depending on the dimension of the data, a convolutional neural network of the corresponding dimension can be used for feature extraction. For example, for one-dimensional polarization spectral data, such as circular dichroism, a one-dimensional convolutional neural network can be used to extract features. For two-dimensional polarization spectral data, such as ellipsometry, a two-dimensional convolutional neural network can be used to extract features.

[0047] In step S130, the Chinese medicine granule quality inspection model is used to identify the spectral feature data to obtain the Chinese medicine granule quality inspection results. The Chinese medicine granule quality inspection model can be a machine learning model or a deep learning model.

[0048] In order to more comprehensively capture the spectral data from different data sources, data fusion is required. The final quality inspection results of Chinese herbal granules will reflect the results of data fusion, thereby improving the accuracy and robustness of the analysis.

[0049] For example, the spectral feature data corresponding to spectral data of different dimensions can be fused, and then the fused features can be identified using the Chinese medicine granule quality inspection model to obtain the Chinese medicine granule quality inspection results.

[0050] The quality inspection model for Chinese herbal granules includes a multivariate analysis model. As another method, a multivariate analysis model can be trained based on each type of spectral data, and the spectral feature data corresponding to different types of spectral data can be input into the corresponding multivariate analysis model to obtain an analysis result; then, multiple analysis results can be fused to obtain the quality inspection result of the Chinese herbal granules.

[0051] Based on different data fusion methods, the training process of the Chinese medicine granule quality inspection model has corresponding adjustments. The multivariate analysis model and the training process of the Chinese medicine granule quality inspection model under various circumstances will be described later.

[0052] As an implementation method, the quality inspection results of Chinese medicine granules are the quality inspection results for various physical and chemical properties of Chinese medicine granules, including: water content, particle size, fluidity, hesperidin content and naringin content. There is a close relationship between spectral data and various physical and chemical properties of Chinese medicine granules, and different spectral techniques can provide unique information about the physical and chemical properties of Chinese medicine granules.

[0053] Near-infrared spectroscopy is sensitive to the OH bond vibration of water molecules and can therefore be used to accurately determine the water content in TCM granules. Mass spectrometry data provides precise measurements of molecular mass, which helps identify specific compounds in TCM granules, including hesperidin and naringin. Hyperspectral data can provide spatial and spectral information of TCM granules, and by analyzing the texture and shape characteristics of the image, the particle size and distribution can be assessed.

[0054] Combining near-infrared, mass spectrometry and hyperspectral data, the physicochemical properties of TCM granules can be comprehensively evaluated from multiple dimensions, including physical properties (such as fluidity, particle size, and moisture content) and chemical indicators (such as hesperidin content and naringin content). Multi-dimensional spectral data provides a comprehensive view of the physicochemical properties of TCM granules, which helps to improve the accuracy and reliability of quality testing.

[0055] In the above implementation process, by collecting multi-dimensional spectral data of Chinese medicine granules, the characteristics of Chinese medicine granules can be fully captured. According to the dimension of the spectral data, the convolutional neural network of the corresponding dimension is selected for feature extraction, which can maximize the use of information in the multi-dimensional spectrum and provide more accurate data support for the quality inspection of Chinese medicine granules. The pre-trained model can quickly and accurately evaluate the quality of new spectral feature data, realize automated and intelligent quality inspection of Chinese medicine granules, improve inspection efficiency and accuracy, reduce human errors, reduce complicated processing procedures, and reduce damage to tablets during the inspection process.

[0056] Optionally, in an embodiment of the present application, the spectral data includes one-dimensional spectral data and two-dimensional spectral data; one-dimensional spectral data refers to spectral information recorded in a single dimension, such as a wavelength dimension. Two-dimensional spectral data refers to spectral information recorded in two dimensions, usually including wavelength and spatial information. Two-dimensional spectral data can provide detailed information on the spatial distribution and chemical composition of traditional Chinese medicine particles.

[0057] One-dimensional spectral data includes near-infrared spectral data and mass spectral data. Near-infrared spectral data refers to spectral data obtained in the near-infrared band (approximately 700 nanometers to 2500 nanometers). Near-infrared spectroscopy can provide information about the hydrogen bonding state and molecular structure in molecules, and can be used to analyze the content of water, protein, fat and other components in traditional Chinese medicine granules. Mass spectral data refers to data obtained by a mass spectrometer, which shows the relative abundance of ions of different masses in traditional Chinese medicine granules. Mass spectrometry can measure the mass of molecules, so it can be used for qualitative and quantitative analysis of traditional Chinese medicine granules.

[0058] Two-dimensional data includes hyperspectral data; hyperspectral data refers to spectral data obtained within a continuous wide wavelength range. Hyperspectral data contains not only spectral information but also spatial information of the image. Hyperspectral imaging technology can provide detailed information about the spatial and spectral characteristics of traditional Chinese medicine particles.

[0059] Correspondingly, spectral feature data includes one-dimensional feature data and two-dimensional feature data. By using near-infrared spectral data, mass spectral data and hyperspectral data to analyze the quality of Chinese medicine particles, the problem of inaccurate analysis that may be caused by single spectral data can be compensated, making the quality inspection analysis more comprehensive and accurate.

[0060] The convolutional neural network of the corresponding dimension of the spectral data is used to extract the features of the spectral data respectively, and the spectral feature data corresponding to the spectral data is obtained, including:

[0061] The near-infrared spectrum data and the mass spectrum data are processed respectively by using the feature selection method to obtain one-dimensional spectrum sampling data; and the hyperspectral data are processed by using the feature selection method to obtain two-dimensional spectrum sampling data.

[0062] Considering that the information contained in spectral data is very complex, including both redundant data and effective information for molecular detection and analysis of traditional Chinese medicine particles, feature selection methods are used to simplify the model, shorten the model running time, and improve the model performance. Feature selection includes at least one of competitive adaptive resampling (CARS), random frog (RF), and Monte Carlo-uninformation variable elimination (MC-UVE).

[0063] It should be noted that the feature selection method used to obtain the one-dimensional spectrum sampling data may be the same as or different from the feature selection method used to obtain the two-dimensional spectrum sampling data. Different feature selection methods may require adaptive adjustment for subsequent fusion processing, which will be introduced later.

[0064] A one-dimensional convolutional neural network is used to extract features from one-dimensional spectral sampling data to obtain one-dimensional feature data; a two-dimensional convolutional neural network is used to extract features from two-dimensional spectral sampling data to obtain two-dimensional feature data.

[0065] One-dimensional convolutional neural networks capture local patterns and trends in sequence data through sliding windows. The one-dimensional convolutional neural network structure can include convolutional layers, activation functions (such as ReLU), pooling layers, etc. to automatically learn features in the data.

[0066] A two-dimensional convolutional neural network is used to extract features from two-dimensional spectral sampling data. A two-dimensional convolutional neural network captures spatial and spectral features by sliding convolution kernels over the two-dimensional space of the image. The two-dimensional convolutional neural network structure can also include convolution layers, activation functions, pooling layers, etc. to automatically learn features in the data.

[0067] In an optional embodiment, after obtaining the spectral data of different dimensions of Chinese medicine particles, in order to reduce the errors caused by external factors, random noise and baseline drift to the spectral data and improve the prediction performance of the model, a spectral preprocessing method is used to improve the quality of the spectral data, thereby improving the prediction ability of the model. The spectral data can be preprocessed, and the preprocessing methods include multiple scatter correction (MSC), standard canonical transformation (SNV), first-order derivative (1st), second-order derivative (2nd), 1st+SG smoothing filtering, 2nd+SG smoothing filtering and other preprocessing methods. Among them, MSC uses the least squares method to correct the spectrum, thereby reducing the scattering caused by the size and uneven distribution of Chinese medicine particles; SNV reduces the scattering effect by centering and scaling the spectrum; the first-order derivative can eliminate the baseline drift caused by the constant in the background; the second-order derivative can eliminate the baseline drift caused by the linear background; SG uses a polynomial to fit the data in the window, which can effectively eliminate spike noise. By comparing the model performance of different preprocessing methods, the optimal preprocessing method is determined.

[0068] In the implementation process of the above embodiment: redundant and irrelevant information is removed by feature selection method, the efficiency of subsequent model training is improved, and the complexity of the model can be reduced to reduce the risk of overfitting. The one-dimensional convolutional neural network captures local patterns and trends in one-dimensional data through local connections, which matches the characteristics of one-dimensional spectral data because spectral data is usually a continuous sequence of wavelengths. The two-dimensional convolutional neural network can effectively capture the spatial features in the image, retain the rich spatial information in the hyperspectrum, and provide support for subsequent quality inspection. The convolutional neural network with the corresponding dimension of the spectral data is used to extract features from the spectral data respectively, which improves the efficiency and accuracy of feature extraction.

[0069] Optionally, in the embodiment of the present application, a pre-trained Chinese medicine granule quality inspection model is used to identify the spectral feature data to obtain the Chinese medicine granule quality inspection results, including:

[0070] The one-dimensional feature data and the two-dimensional feature data are fused to obtain fused features; the fusion processing includes splicing or attention mechanism fusion.

[0071] Concatenation is used to merge features in the dimension; fusion processing also includes stacking, which is to directly stack different feature sets together to form a new feature set. Attention mechanism fusion uses an attention network (such as an attention layer) to learn the importance of different features; based on the learned weights, the one-dimensional feature data and the two-dimensional feature data are weighted and summed to generate the final feature representation, that is, the fused feature.

[0072] As an implementation mode, if the feature selection method used to obtain the one-dimensional spectrum sampling data is the same as the feature selection method used to obtain the two-dimensional spectrum sampling data, the above-mentioned fusion processing can be directly used to perform feature fusion.

[0073] If the feature selection method used to obtain the one-dimensional spectral sampling data is different from the feature selection method used to obtain the two-dimensional spectral sampling data, for example, multiple feature selection methods (CARS, RF, MC-UVE) are used to extract features from near-infrared data, hyperspectral data, and direct mass spectrometry data, and the best feature variable sets extracted from the three different data types are fused to form a comprehensive feature set. This comprehensive feature set contains the most informative features from different data sources and can provide more comprehensive sample information.

[0074] Because different spectral data types may contain information of different properties, different methods can be used to effectively extract features. Different feature selection methods are used on different spectral data to expand the possibilities of variable results, explore a wider feature space, and increase the chances of finding better feature combinations.

[0075] The TCM granule quality inspection model is used to identify the fusion features and obtain the quality inspection results of the TCM granules. It should be noted that the TCM granule quality inspection model in this embodiment is obtained by training the fusion features obtained from historical data, and the training process is explained below.

[0076] Collect historical data, including spectral data (near infrared, mass spectrometry, hyperspectral, etc.) of Chinese medicine particles as training spectral data, and perform data preprocessing on the training spectral data, including noise removal, outlier processing, baseline correction, etc. Use feature selection methods (such as CARS, RF, MC-UVE) to reduce the number of features and retain the most informative features. Fusion the spectral features corresponding to the training spectral data from different sources to form a fusion feature set. After dividing the data into training set, validation set, and test set, select a suitable machine learning model, use the data on the training set to train the selected model, adjust the model parameters through optimization algorithms (such as gradient descent), and minimize the loss function. Adjust the model's hyperparameters, such as learning rate, regularization parameter, tree depth, etc., through cross-validation, grid search, etc. to improve the performance of the model. The validation set can be used to evaluate the performance of the model, adjust the model structure or parameters to avoid overfitting, and the test set can be used to further evaluate the generalization ability of the model to ensure that the model performs well on unseen data.

[0077] In the implementation process of the above embodiment: by fusing one-dimensional feature data and two-dimensional feature data to obtain fused features, feature data of different dimensions are effectively combined to obtain a more comprehensive input representation, thereby improving the prediction ability of the model.

[0078] Optionally, in an embodiment of the present application, the spectral feature data includes near-infrared spectral feature data, mass spectral feature data and hyperspectral feature data; the Chinese medicine granule quality inspection model includes a first multivariate analysis model, a second multivariate analysis model and a third multivariate analysis model.

[0079] The first multivariate analysis model is used to predict near-infrared spectral characteristic data; the second multivariate analysis model is used to predict mass spectral characteristic data; and the third multivariate analysis model is used to predict hyperspectral characteristic data.

[0080] Taking the first multivariate analysis model as an example, we will explain how to train a multivariate analysis model. First, data preparation is performed. For each type of spectral data (near infrared, mass spectrometry, hyperspectral), corresponding training data sets are collected. These data sets should contain spectral features and corresponding quality attribute labels. Select a suitable multivariate analysis model, such as partial least squares regression (PLSR), multivariate linear regression (MLR), or other suitable machine learning models. Train each model using labeled training data sets. For example, for near-infrared spectral data, train a PLS model to predict specific quality attributes, namely the near-infrared prediction value.

[0081] By training the model specifically for each data type, the relationship between each data type and the quality attribute can be captured more accurately. The model can be optimized for the characteristics of each spectral data type to improve the accuracy of the prediction.

[0082] Using the pre-trained TCM granule quality inspection model, the spectral feature data is identified to obtain the TCM granule quality inspection results, including:

[0083] The near infrared spectral feature data is input into the first multivariate analysis model to obtain the near infrared prediction value. As mentioned above, near infrared spectroscopy (NIR) mainly provides information about the hydrogen bonding state and molecular structure in molecules. Therefore, this near infrared prediction value is related to the chemical composition content, moisture, protein, fat and other properties in the traditional Chinese medicine granules. The near infrared prediction value can be used to evaluate whether the content of active ingredients in traditional Chinese medicine granules meets the standards, or to monitor quality changes during the production process.

[0084] The mass spectrum characteristic data is input into the second multivariate analysis model to obtain a mass spectrum prediction value, which can be used to determine whether a specific compound in the traditional Chinese medicine granules exists.

[0085] The hyperspectral feature data is input into the third multivariate analysis model to obtain the hyperspectral prediction value. The hyperspectral prediction value can be used to analyze the physical state and distribution characteristics of traditional Chinese medicine particles, such as identifying the spatial distribution of different components or evaluating the uniformity of particles.

[0086] According to the near infrared prediction value, mass spectrum prediction value and hyperspectral prediction value, the quality inspection results of the Chinese medicine granules are obtained. For example, weighted average, voting, stacking or other fusion technologies can be used to obtain the final quality inspection results. The final quality inspection results are output. The quality inspection results of the Chinese medicine granules can be quality grade, whether it is qualified or the probability of qualification, etc.

[0087] In the implementation process of the above embodiment: by combining spectral data of different dimensions and using its individually trained multivariate analysis model, a comprehensive analysis of the quality of Chinese medicine granules is achieved. Not only the accuracy and robustness of the prediction are improved, but also by integrating information from multiple data sources, a more comprehensive quality inspection result is provided, which helps to improve the quality control level of Chinese medicine granules and reduce the deviation that may be introduced by a single data source.

[0088] Optionally, in an embodiment of the present application, the quality inspection results of the Chinese medicine granules are obtained according to the near-infrared prediction values, mass spectrometry prediction values ​​and hyperspectral prediction values, including: using a multivariate analysis method to obtain the quality inspection results of the Chinese medicine granules according to the near-infrared prediction values, mass spectrometry prediction values ​​and hyperspectral prediction values; the multivariate analysis method includes multiple linear regression or statistical methods.

[0089] For example, the statistical method may be weighted average, simple average, etc. The multivariate linear regression formula is as follows:

[0090] Y=b+k1x1+k2x2+k3x3

[0091] Among them, Y is the quality inspection result of traditional Chinese medicine granules, b is the intercept of multivariate linear regression, k1 is the weight of near-infrared spectral data, x1 is the near-infrared predicted value, k2 is the weight of mass spectrometry data, x2 is the mass spectrometry predicted value, k3 is the weight of hyperspectral data, and x3 is the hyperspectral predicted value. Among them, the weight can also be a regression coefficient.

[0092] In the implementation process of the above embodiment: the quality inspection results of the Chinese medicine granules are obtained according to the near infrared prediction value, mass spectrum prediction value and hyperspectral prediction value by using the multivariate analysis method. The multivariate analysis method can comprehensively consider multiple prediction values ​​to improve the prediction accuracy of the quality attributes of the Chinese medicine granules. This method allows each data to be predicted using an appropriate multivariate analysis model without the need for more complex feature processing, thereby improving the flexibility of quality detection.

[0093] Optionally, in an embodiment of the present application, the spectral characteristic data includes near-infrared spectral characteristic data, mass spectral characteristic data, and hyperspectral characteristic data; obtaining spectral data of different dimensions of Chinese medicine particles includes:

[0094] After the Chinese medicine granules are made, they are sampled to obtain sampled granules. Sampling can be performed according to certain standards and procedures to improve the representativeness and randomness of the samples. When sampling, attention should be paid to the uniformity and integrity of the samples to avoid deviation and contamination. In an optional embodiment, the sampling frequency of the near-infrared spectrometer is 10-100Hz; the sampling frequency of the Vis / NIR hyperspectral imager is 1-20Hz; the sampling frequency of the direct mass spectrometer is 1000-10000Hz. Of course, other sampling frequencies can also be set, and this embodiment of the present application is not limited to this.

[0095] The instrument parameters of the near-infrared spectrometer, direct mass spectrometer and hyperspectral imager are adjusted based on the type of Chinese medicine particles. The near-infrared spectrometer is used to collect near-infrared spectral data of the sampled particles; the direct mass spectrometer is used to collect mass spectral data of the sampled particles; and the hyperspectral imager is used to collect hyperspectral data of the sampled particles. The instrument parameters may include wavelength range, resolution, scanning speed, light source intensity, etc. The values ​​of the instrument parameters can be set according to actual needs, and the embodiments of the present application do not limit this.

[0096] Exemplarily, an Antaris Fourier transform near-infrared spectrometer is used to collect diffuse reflectance spectra of sampled particles. The parameters of the near-infrared spectrometer are set to scan the full band of the spectral range of 1000-2500nm, and the scanning resolution is 8cm-1. The number of scans is 64 times, and the background spectrum is collected every 1 hour. In order to obtain a stable signal, the detection and analysis are carried out 1 hour after the machine is preheated under environmental conditions of a temperature of 25°C and a humidity of less than 47%. Each sample is scanned 3 times, and the average value is taken for subsequent statistical analysis.

[0097] Hyperspectral images were acquired using the Vis / NIR hyperspectral. The instrument operates in the wavelength range of 400-1000nm, has 128 bands, and a spatial resolution of 640 points. A 17 mm focal length lens was mounted on the camera, which was installed in a dark box environment at a height of 50 cm from the sample. The light source consisted of 2 halogen lamps (120 watts). The exposure time and frame period were set to 5ms depending on the light intensity. In order to reduce the influence of the environment and detector sensitivity, blackboard and whiteboard images must be acquired before acquiring the spectral image. It can be calibrated to a reflectance image by the following formula:

[0098] RC=(RC-RD) / (RW-RD)

[0099] Among them, RW is the whiteboard reference image, RD is the blackboard reference image, RC is the calibration reflection image, and RS is the original reflection image.

[0100] Method for direct mass spectrometry data acquisition: The sample is traditional Chinese medicine granules, and the data acquisition adopts the following settings: Sampling frequency: set to 100Hz to ensure timely capture of ion signals. Ionization method: Use electrospray ionization (ESI) technology to obtain efficient ionization effect. Instrument parameters: Ion source temperature: set to 250℃; Spray voltage: set to 3.5kV; Desolvation temperature: set to 100℃; Nitrogen flow rate: set to 10L / min. The duration of each sample analysis is 5 minutes. During the analysis, three repeated measurements were performed to ensure the reliability and repeatability of the results. Before each measurement, the instrument was calibrated to ensure accuracy.

[0101] In the implementation process of the above embodiment: through a scientific and reasonable sampling method, the collected samples can represent the quality characteristics of the whole batch of Chinese medicine granules. Appropriate instrument parameters can improve the quality of spectral data and the accuracy of analysis, ensuring that the data can accurately reflect the characteristics of Chinese medicine granules. By comprehensively utilizing near-infrared spectroscopy, mass spectrometry and hyperspectral imaging technology, a comprehensive quality analysis of Chinese medicine granules is achieved.

[0102] Optionally, in the embodiment of the present application, after obtaining the spectral feature data corresponding to the spectral data, the method further includes:

[0103] The spectral feature data is processed using an attention mechanism to obtain attention data; the attention mechanism includes a channel attention mechanism or a pixel attention mechanism.

[0104] For example, a channel attention mechanism (such as the Squeeze-and-Excitation module in SENet) or a pixel attention mechanism (such as CBAM) can be selected according to the characteristics of the spectral data. For the channel attention mechanism, the importance weights of different channels are learned through global average pooling and fully connected layers, and then the channels are re-weighted. For the pixel attention mechanism, the key areas in the spectral feature data are emphasized by learning spatial features. After applying the attention mechanism, the weighted feature data obtained can highlight the most important parts of the data, which are called attention data.

[0105] Input the attention data into a convolutional neural network of preset dimensions to obtain enhanced features. According to the dimensions and characteristics of the data, a convolutional neural network architecture of appropriate dimensions is selected. Exemplarily, in order to capture more feature information, a two-dimensional convolutional neural network can be used to enhance the attention data to obtain enhanced features.

[0106] Convolutional neural networks (CNNs) are able to learn higher-level feature representations from attention data, which contain deep information and structures of the original data.

[0107] Using the pre-trained TCM granule quality inspection model, the spectral feature data is identified to obtain the TCM granule quality inspection results, including:

[0108] The TCM granule quality inspection model is used to identify enhanced features and obtain the TCM granule quality inspection results.

[0109] In the implementation process of the above embodiment: the attention mechanism can identify and emphasize the most relevant features, and improve the model's sensitivity to key information in the spectral feature data. This improves the accuracy of the analysis. The enhanced features can provide a richer and more abstract data representation, which helps to improve the performance of subsequent recognition tasks, and the convolutional neural network helps to capture complex patterns and relationships in the data. By combining the advantages of the attention mechanism and the convolutional neural network, the process of extracting key features from spectral data and performing quality inspection is realized.

[0110] See also Figure 2 The schematic diagram of the process of detecting Chinese medicine particles of the Chinese medicine particle quality inspection device provided in the embodiment of the present application is shown. The Chinese medicine particle quality inspection device includes a hyperspectral imager probe 6, a halogen lamp 7, a near-infrared spectrometer probe 8, a direct mass spectrometer ionization injection port 9, a hyperspectral imager 10, a near-infrared spectrometer 11, a direct mass spectrometer 12, a hyperspectral data processor 13, a direct mass spectrometer data processor 14, and a near-infrared data processor 15.

[0111] The near infrared spectrometer 11 is used to collect near infrared spectrum data through the near infrared spectrometer probe 8; the direct mass spectrometer 12 is used to collect mass spectrum data through the direct mass spectrometer ionization injection port 9; the hyperspectral imager 10 is used to collect hyperspectral data through the hyperspectral imager probe 6. The hyperspectral data processor 13, the direct mass spectrum data processor 14, and the near infrared data processor 15 are respectively used to perform operations such as preprocessing or filtering on the corresponding spectral data.

[0112] As an implementation method, the following is a process for real-time detection of Chinese medicine particles. In the Chinese medicine granulation process, the Chinese medicine extract powder and other auxiliary materials are first placed in a fluidized bed granulator, and the adhesive is sprayed into the fluidized bed using a spraying device 1. The temperature can also be detected by a temperature detector 2 to control the appropriate temperature in real time.

[0113] When the Chinese medicine particles are being formed, the Chinese medicine particles are led out by the special discharge port 3 and pushed into the Chinese medicine particle quality detection equipment along the track 4. The halogen lamp 5 and the halogen lamp 7 are kept turned on to provide a suitable fixed light environment and reduce the influence of visible light, because the spectrum formation will be affected by light. The hyperspectral imager 10, the near-infrared spectrometer 11, and the direct mass spectrometer 12 can also be turned on in advance for half an hour of pre-heating to adjust the instrument parameters. The hyperspectral imager 10, the near-infrared spectrometer 11, and the direct mass spectrometer 12 simultaneously detect the Chinese medicine particles, and the collected data is processed by the hyperspectral data processor 13, the near-infrared data processor 15, and the direct mass spectrometry data processor 14. After that, the spectral data after the output is feature extracted to obtain the spectral feature data corresponding to the spectral data; the spectral feature data is identified by using the pre-trained Chinese medicine particle quality inspection model to obtain the Chinese medicine particle quality inspection results. Through the above-mentioned real-time detection of Chinese medicine particles, real-time feedback can be achieved, the response speed of Chinese medicine particle detection can be improved, and manual intervention and damage to tablets can be reduced.

[0114] See also Figure 3 The schematic diagram of the structure of the Chinese medicine granule quality inspection device provided in the embodiment of the present application is shown; the embodiment of the present application provides a Chinese medicine granule quality inspection device 200, comprising:

[0115] The data acquisition module 210 is used to acquire spectral data of different dimensions of Chinese medicine particles;

[0116] A feature extraction module 220 is used to extract features from the spectral data using a convolutional neural network of a dimension corresponding to the spectral data to obtain spectral feature data corresponding to the spectral data;

[0117] The quality prediction module 230 is used to use a pre-trained Chinese medicine granule quality inspection model to identify the spectral feature data and obtain the Chinese medicine granule quality inspection results.

[0118] Optionally, in an embodiment of the present application, the Chinese medicine particle quality inspection device 200, the spectral data includes one-dimensional spectral data and two-dimensional spectral data; the one-dimensional spectral data includes near-infrared spectral data and mass spectral data; the two-dimensional data includes hyperspectral data; the spectral feature data includes one-dimensional feature data and two-dimensional feature data; the feature extraction module 220 is used to use the convolutional neural network of the corresponding dimension of the spectral data to perform feature extraction on the spectral data respectively, and obtain spectral feature data corresponding to the spectral data, including: using a feature selection method to process the near-infrared spectral data and the mass spectral data respectively to obtain one-dimensional spectral sampling data; and using a feature selection method to process the hyperspectral data to obtain two-dimensional spectral sampling data; using a one-dimensional convolutional neural network to extract features from the one-dimensional spectral sampling data to obtain one-dimensional feature data; using a two-dimensional convolutional neural network to extract features from the two-dimensional spectral sampling data to obtain two-dimensional feature data.

[0119] Optionally, in an embodiment of the present application, the Chinese medicine granule quality inspection device 200 and the quality prediction module 230 are used to fuse one-dimensional feature data and two-dimensional feature data to obtain fused features; the fusion processing includes splicing or attention mechanism fusion; and the Chinese medicine granule quality inspection model is used to identify the fused features to obtain the quality inspection results of the Chinese medicine granules.

[0120] Optionally, in an embodiment of the present application, the Chinese medicine granule quality inspection device 200, the spectral feature data includes near-infrared spectral feature data, mass spectral feature data and hyperspectral feature data; the Chinese medicine granule quality inspection model includes a first multivariate analysis model, a second multivariate analysis model and a third multivariate analysis model; the quality prediction module 230 is also used to input the near-infrared spectral feature data into the first multivariate analysis model to obtain a near-infrared prediction value; input the mass spectral feature data into the second multivariate analysis model to obtain a mass spectral prediction value; input the hyperspectral feature data into the third multivariate analysis model to obtain a hyperspectral prediction value; and obtain the Chinese medicine granule quality inspection result based on the near-infrared prediction value, the mass spectral prediction value and the hyperspectral prediction value.

[0121] Optionally, in an embodiment of the present application, the Chinese medicine granule quality inspection device 200 and the quality prediction module 230 are also used to obtain the Chinese medicine granule quality inspection results based on near-infrared prediction values, mass spectrum prediction values ​​and hyperspectral prediction values ​​using a multivariate analysis method; the multivariate analysis method includes multiple linear regression or statistical methods.

[0122] Optionally, in an embodiment of the present application, the Chinese medicine particle quality inspection device 200, the spectral characteristic data includes near-infrared spectral characteristic data, mass spectral characteristic data and hyperspectral characteristic data; the data acquisition module 210 is used to sample the Chinese medicine particles after they are made to obtain sampled particles; the instrument parameters of the near-infrared spectrometer, the direct mass spectrometer and the hyperspectral imager are adjusted based on the type of the Chinese medicine particles; the near-infrared spectrometer is used to collect near-infrared spectral data of the sampled particles; the direct mass spectrometer is used to collect mass spectral data of the sampled particles; and the hyperspectral imager is used to collect hyperspectral data of the sampled particles.

[0123] Optionally, in an embodiment of the present application, the Chinese medicine granule quality inspection device 200 also includes: a feature enhancement module, which is used to process the spectral feature data using an attention mechanism to obtain attention data; the attention mechanism includes a channel attention mechanism or a pixel attention mechanism; the attention data is input into a convolutional neural network of a preset dimension to obtain enhanced features; the spectral feature data is identified using a pre-trained Chinese medicine granule quality inspection model to obtain the Chinese medicine granule quality inspection result, including: using the Chinese medicine granule quality inspection model to identify the enhanced features to obtain the Chinese medicine granule quality inspection result.

[0124] It should be understood that the device corresponds to the above-mentioned embodiment of the method for quality inspection of traditional Chinese medicine particles, and can perform the various steps involved in the above-mentioned method embodiment. The specific functions of the device can be found in the description above. To avoid repetition, the detailed description is appropriately omitted here. The device includes at least one software function module that can be stored in a memory in the form of software or firmware or solidified in the operating system (OS) of the device.

[0125] See also Figure 4 The electronic device 300 provided in the embodiment of the present application includes: a processor 310 and a memory 320, wherein the memory 320 stores machine-readable instructions executable by the processor 310, and when the machine-readable instructions are executed by the processor 310, the above method is executed.

[0126] Figure 4 Each component shown in can be implemented by hardware, software or a combination thereof. The electronic device 300 may be a physical device, such as a server, a PC, etc., or a virtual device, such as a virtual machine, a virtualized container, etc. Moreover, the electronic device 300 is not limited to a single device, but may also be a combination of multiple devices or a cluster consisting of a large number of devices.

[0127] An embodiment of the present application further provides a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the above method is executed.

[0128] Among them, the storage medium 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 red-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, disk or optical disk.

[0129] In several embodiments provided by the embodiments of the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to the multiple embodiments of the embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and a part of the module, program segment or code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0130] In addition, the functional modules in each embodiment of the present application can be integrated together to form an independent part, or each module can exist separately, or two or more modules can be integrated to form an independent part.

[0131] The above description is only an optional implementation manner of the embodiments of the present application, but the protection scope of the embodiments of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or replacements within the technical scope disclosed in the embodiments of the present application, which should be covered within the protection scope of the embodiments of the present application.

Claims

1. A method for quality inspection of Chinese medicine granules, characterized in that: include: Obtain spectral data of different dimensions of Chinese medicine particles; Using a convolutional neural network of a dimension corresponding to the spectral data to extract features of the spectral data respectively, to obtain spectral feature data corresponding to the spectral data; The spectral feature data is identified using a pre-trained quality inspection model for Chinese medicine granules to obtain quality inspection results for Chinese medicine granules.

2. The method according to claim 1, characterized in that The spectral data includes one-dimensional spectral data and two-dimensional spectral data; the one-dimensional spectral data includes near-infrared spectral data and mass spectral data; the two-dimensional data includes hyperspectral data; the spectral feature data includes one-dimensional feature data and two-dimensional feature data; The convolutional neural network of the corresponding dimension of the spectral data is used to extract features of the spectral data to obtain spectral feature data corresponding to the spectral data, including: The near infrared spectrum data and the mass spectrum data are processed respectively by a feature selection method to obtain one-dimensional spectrum sampling data; and the hyperspectral data are processed by a feature selection method to obtain two-dimensional spectrum sampling data; A one-dimensional convolutional neural network is used to perform feature extraction on the one-dimensional spectral sampling data to obtain the one-dimensional feature data; and a two-dimensional convolutional neural network is used to perform feature extraction on the two-dimensional spectral sampling data to obtain the two-dimensional feature data.

3. The method according to claim 2, characterized in that The method of using a pre-trained Chinese medicine granule quality inspection model to identify the spectral feature data and obtain the Chinese medicine granule quality inspection result includes: The one-dimensional feature data and the two-dimensional feature data are fused to obtain fused features; the fusion process includes concatenation or attention mechanism fusion; The fusion features are identified using the Chinese medicine granule quality inspection model to obtain the quality inspection results of the Chinese medicine granules.

4. The method according to claim 1, characterized in that The spectral feature data includes near-infrared spectral feature data, mass spectral feature data and hyperspectral feature data; the Chinese medicine granule quality inspection model includes a first multivariate analysis model, a second multivariate analysis model and a third multivariate analysis model; The method of using a pre-trained Chinese medicine granule quality inspection model to identify the spectral feature data and obtain the Chinese medicine granule quality inspection result includes: Inputting the near infrared spectrum characteristic data into the first multivariate analysis model to obtain a near infrared prediction value; Inputting the mass spectrum characteristic data into the second multivariate analysis model to obtain a mass spectrum prediction value; Inputting the hyperspectral feature data into the third multivariate analysis model to obtain the hyperspectral prediction value; The quality inspection result of the traditional Chinese medicine granules is obtained according to the near-infrared prediction value, the mass spectrum prediction value and the hyperspectral prediction value.

5. The method according to claim 4, characterized in that According to the near infrared prediction value, the mass spectrum prediction value and the hyperspectral prediction value, the quality inspection result of the traditional Chinese medicine granules is obtained, including: The quality inspection result of the traditional Chinese medicine granules is obtained by using a multivariate analysis method according to the near-infrared prediction value, the mass spectrum prediction value and the hyperspectral prediction value; the multivariate analysis method includes multiple linear regression or a statistical method.

6. The method according to claim 1, characterized in that The spectral characteristic data includes near-infrared spectral characteristic data, mass spectral characteristic data and hyperspectral characteristic data; the spectral data of different dimensions of the traditional Chinese medicine particles are obtained, including: After the traditional Chinese medicine granules are prepared, the traditional Chinese medicine granules are sampled to obtain sampled granules; Adjusting instrument parameters of a near infrared spectrometer, a direct mass spectrometer and a hyperspectral imager based on the type of the traditional Chinese medicine particles; The near-infrared spectrometer is used to collect the near-infrared spectrum data of the sampling particles; the direct mass spectrometer is used to collect the mass spectrum data of the sampling particles; and the hyperspectral imager is used to collect the hyperspectral data of the sampling particles.

7. The method according to any one of claims 1 to 6, characterized in that: After obtaining the spectral characteristic data corresponding to the spectral data, the method further includes: The spectral feature data is processed by using an attention mechanism to obtain attention data; the attention mechanism includes a channel attention mechanism or a pixel attention mechanism; Inputting the attention data into a convolutional neural network of a preset dimension to obtain enhanced features; The method of using a pre-trained Chinese medicine granule quality inspection model to identify the spectral feature data and obtain the Chinese medicine granule quality inspection result includes: The enhanced features are identified using the Chinese medicine granule quality inspection model to obtain the Chinese medicine granule quality inspection results.

8. A computer program product, characterized in that The method comprises computer program instructions, and when the computer program instructions are executed by a processor, the method according to any one of claims 1 to 7 is executed.

9. An electronic device, characterized in that: include: A processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the method according to any one of claims 1 to 7 is executed.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the method according to any one of claims 1 to 7 is executed.