Deep learning-based traditional Chinese medicine quality intelligent detection method and system
Through a high-resolution camera and multi-spectral imager combined with a deep learning algorithm, the oil cell clustering area of Chinese herbal medicines was identified, and the distribution pattern was analyzed using Ripley'sL function to solve the accuracy and objectivity of traditional Chinese medicine detection, and the rapid, accurate detection and dynamic monitoring of Chinese medicine quality were achieved.
Patent Information
- Application Number
- CN202510881046.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-27
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2045-06-27
AI Technical Summary
Traditional Chinese medicine quality detection methods are difficult to accurately judge the oil cell aggregation area and cell distribution patterns, and lack objectivity and quantitative standards, which cannot meet the needs of rapid and accurate detection of Chinese medicine quality.
A high-resolution industrial camera and multi-spectral imager were used to collect multi-angle RGB images and spectral images of different bands of medicinal tablets, combined with deep learning algorithms to identify the oil cell aggregation area, used Ripley'sL function to analyze the oil cell distribution, combined with titration analysis to determine the acid value, generate judgment information and trigger corresponding instructions.
It has achieved the accuracy and reliability of quality testing of traditional Chinese herbal medicines, can timely identify spoilage risks, ensure the safety of traditional Chinese medicine market supply and the safety of patients' medication, reduce economic losses, and provide a comprehensive and meticulous quality assessment basis.
Smart Images

Figure CN120375370A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of medicine and health, and specifically to an intelligent detection method and system for traditional Chinese medicine quality based on deep learning. Background Technique
[0002] In the field of medicine and health, traditional Chinese medicine, as a treasure of traditional Chinese medicine of the Chinese nation, occupies an important position in the treatment and prevention of diseases with its unique theoretical system and clinical efficacy. The quality of traditional Chinese medicine directly affects its clinical efficacy and safety. Therefore, the quality detection of traditional Chinese medicine has become a key link in the development of the traditional Chinese medicine industry. Among them, the surface characteristics of traditional Chinese medicine decoction pieces vary due to factors such as the type of medicinal materials and the processing methods. For traditional Chinese medicine decoction pieces with smooth, rough or textured surfaces, there may be local oil spots on their surfaces. For example, traditional Chinese medicines containing oil cells include cinnamon, calamus, costus root, magnolia officinalis, and magnolia biondii. In the decoction pieces of these traditional Chinese medicines, the oil cell aggregation area may form oil spots on the surface. For example, the surface of angelica dahurica decoction pieces has longitudinal wrinkles, and there are many brown oil spots scattered in the cortex.
[0003] Traditional methods for detecting the quality of traditional Chinese medicine mostly rely on manual experience to identify the appearance, smell, etc. of traditional Chinese medicine by visual inspection, touch, and smelling, or use detection instruments to detect the defective state of the appearance of traditional Chinese medicine. However, these methods have many deficiencies in detecting texture characteristics such as oil cells and oil components in traditional Chinese medicine. For example, it is difficult for manual identification to accurately judge the oil cell aggregation area and the cell distribution pattern, lacking objectivity and quantification standards, and it is difficult to meet the requirements for rapid and accurate detection of traditional Chinese medicine quality. Summary of the Invention
[0004] In view of the deficiencies of the prior art, the present invention provides an intelligent detection method and system for traditional Chinese medicine quality based on deep learning, which solves the problems in the above background technique.
[0005] To achieve the above objectives, the present invention is realized through the following technical solutions: An intelligent detection method for traditional Chinese medicine quality based on deep learning includes the following steps.
[0006] S1: First, determine the acquisition source of the traditional Chinese medicine decoction pieces to be detected, and preliminarily detect the structural defects of the traditional Chinese medicine decoction pieces to be detected through an ultrasonic detector. The structural defects include cavities and cracks. If not, use a high-resolution industrial camera and a multispectral imager to collect RGB images and spectral images of different bands of the traditional Chinese medicine decoction pieces to be detected from multiple angles, and identify the oil cell aggregation area based on the RGB images and spectral images of different bands.
[0007] S2: Analyze the distribution of oil cells based on the oil cell aggregation region to generate determination information. The determination information is used to reflect the abnormal conditions of the Chinese herbal pieces to be tested distributed for the corresponding origin under the current batch, including the distribution result and the acid range. Generate a deterioration risk signal according to the distribution result;
[0008] S3: When the deterioration risk signal is a deterioration signal, trigger an abort instruction. When the deterioration risk signal is a qualified signal, trigger a distribution instruction to supply the corresponding Chinese herbal pieces. After obtaining the corresponding Chinese herbal pieces, conduct a re-test on the Chinese herbal pieces to generate pre-warehousing information and post-warehousing information;
[0009] S4: Generate comparison information based on the pre-warehousing information and the post-warehousing information, and combine with the backpropagation algorithm in deep learning to determine whether to trigger a warning signal.
[0010] Preferably, use a high-resolution industrial camera and a hyperspectral imager to collect RGB images and spectral images of different bands at multiple angles of the Chinese herbal pieces to be tested;
[0011] Based on the collected RGB images, calculate the color histogram of the RGB images, extract the texture features of the gray-level co-occurrence matrix to initially distinguish the oil point region from the non-oil point region, and combine with the spectral images to compare the spectral curves of the oil point region and the non-oil point region. Use the principal component analysis method to determine the oil point spectral feature vector. Input the color histogram and the spectral images into the U-Net network model to perform end-to-end training on the input images, output the oil point probability map and binarize it, and use the oil point color and spectral features to set the threshold segmentation to generate the oil point recognition result. The oil point recognition result is used to reflect the identified oil point region.
[0012] Preferably, based on the RGB images and the spectral images of different bands, identify the oil cell aggregation region, including:
[0013] Pre-make slices of the Chinese herbal pieces to be tested and take microscopic images with an optical microscope and an electron microscope;
[0014] In the optical microscopic image, use the YOLOv5 deep learning object detection algorithm to identify the oil cell contour and position;
[0015] In the electron microscopic image, use the watershed algorithm to separate the oil cells, obtain the boundary, count the number of oil cells per unit area and calculate its density, and set the density threshold according to the characteristics of the medicinal material to initially screen out the oil cell aggregation region;
[0016] In the preliminarily screened oil cell aggregation regions, identify the final oil cell aggregation regions, specifically: spatially align the oil spot recognition results with the positions of oil cells in the optical microscopic images. If multiple oil cells correspond to an oil spot region and occupy more than half of the oil spot region, then determine the oil spot region as an oil cell aggregation region;
[0017] Obtain regional feature information from the oil cell aggregation regions.
[0018] Preferably, based on the oil cell aggregation regions, analyze the distribution of oil cells to generate determination information, including:
[0019] Use the safranin-fast green double staining method to clearly show the oil cells in the oil cell aggregation regions, and use the optical microscopic images again to determine the position information of the oil cells again;
[0020] Based on the position information of the oil cells, combined with the regional feature information, by using Ripley's L function, analyze the deviation degree of the distribution of oil cells from the Poisson distribution at different distance scales. By traversing each oil cell in the oil cell aggregation region, count the number of oil cells within different distance ranges around it to obtain the Ripley's L function values corresponding to different distances;
[0021] Based on the Ripley's L function values corresponding to different distances, judge whether the aggregation of oil cells in the oil cell aggregation region conforms to the Poisson distribution to generate determination information.
[0022] Preferably, based on the Ripley's L function values corresponding to different distances, judge whether the aggregation of oil cells in the oil cell aggregation region conforms to the Poisson distribution to generate determination information. The determination information includes the distribution result and the acid range, including:
[0023] Draw a distribution curve graph of the Ripley's L function value changing with distance according to the Ripley's L function values corresponding to different distances;
[0024] Preset a confidence interval, and judge the distribution of the curve in the distribution curve graph relative to the confidence interval. If the curve in the distribution curve graph falls within the confidence interval, generate a random distribution flag, otherwise generate a regular distribution flag;
[0025] When generating a random distribution flag, judge that the aggregation of oil cells in the oil cell aggregation region conforms to the Poisson distribution and label it as the first distribution result;
[0026] When generating a regular distribution flag, judge that the aggregation of oil cells in the oil cell aggregation region does not conform to the Poisson distribution and label it as the second distribution result;
[0027] Combine the first distribution result and the second distribution result to generate the distribution result;
[0028] According to the origin information of the corresponding traditional Chinese medicine pieces to be detected, combined with the determination information, distinguish the differences in the distribution of oil cells in the same kind of traditional Chinese medicine pieces from different origins;
[0029] According to the distribution batches of each origin in historical periods, by means of random sampling, analyze the distribution of oil cells in the corresponding traditional Chinese medicine pieces from each origin in turn to obtain the Ripley's L function value, and based on the Ripley's L function value corresponding to this batch, identify whether the distribution result of this batch is the same as that of the historical period batches. If different, generate a deterioration risk signal.
[0030] Preferably, if the distribution result of this batch is different from that of the historical batch, generate a deterioration risk signal, including:
[0031] Randomly select the traditional Chinese medicine pieces to be detected corresponding to the batch generating the deterioration risk signal as samples. Crush and mix the selected multiple samples evenly. Titrate the samples after crushing and mixing evenly respectively to calculate and obtain the acid value and generate an acid range;
[0032] According to the pharmacopoeia standard, obtain the upper limit of the acid value of the sample, and based on the acid range, compare the average acid value of the sample with the upper limit of the acid value. If the average acid value is greater than the upper limit of the acid value, the deterioration risk signal is a deterioration signal, and it is determined that the acid value of the current batch of traditional Chinese medicine pieces exceeds the standard. If the average acid value is less than or equal to the upper limit of the acid value, the deterioration risk signal is a qualified signal, and it is determined that the acid value of the current batch of traditional Chinese medicine pieces does not exceed the standard;
[0033] When the deterioration risk signal is a deterioration signal, trigger an abort instruction, and the abort instruction is used to feedback the corresponding origin and abort the distribution of the corresponding traditional Chinese medicine pieces.
[0034] Preferably, when the deterioration risk signal is a qualified signal, trigger a distribution instruction to supply the corresponding traditional Chinese medicine pieces. After obtaining the corresponding traditional Chinese medicine pieces, conduct a re - inspection on the traditional Chinese medicine pieces to generate pre - warehousing information, including:
[0035] Based on the distribution instruction, obtain the corresponding traditional Chinese medicine pieces, repeat steps S1 and S2 for the corresponding traditional Chinese medicine pieces. After confirming that the distribution result in the determination information of the traditional Chinese medicine pieces matches the corresponding origin and the deterioration risk signal is a qualified signal, generate a warehousing instruction;
[0036] Receive the warehousing instruction, obtain pre - warehousing samples through random sampling, and scan the pre - warehousing samples using a portable near - infrared spectrometer to obtain spectral data. The spectral data is used to reflect the light absorption information of the pre - warehousing samples in the near - infrared band, including the positions and intensities of the characteristic absorption peaks of different fat and oil components;
[0037] Using the Soxhlet extraction method, taking advantage of the property that fat is soluble in organic solvents, the samples before storage are continuously refluxed and extracted with anhydrous ether, so that the fat in the samples before storage enters the anhydrous ether, and then the anhydrous ether is evaporated to dryness to obtain the residue, which is the oil content;
[0038] Combine the oil content and spectral data of the samples before storage to generate the information before storage.
[0039] Preferably, when the deterioration risk signal is a qualified signal, trigger the distribution instruction to supply the corresponding traditional Chinese medicine decoction pieces. After obtaining the corresponding traditional Chinese medicine decoction pieces, conduct a re - inspection on the traditional Chinese medicine decoction pieces to generate the information after storage, including:
[0040] Store the traditional Chinese medicine decoction pieces in the warehouse and set the detection time. Re - perform the detection of the oil content and spectral data on the traditional Chinese medicine decoction pieces during storage to generate the information after storage.
[0041] Preferably, compare the information before storage and the information after storage to obtain the comparison information, including:
[0042] Based on the information before storage and the information after storage, calculate the difference values of the positions and intensities of the characteristic absorption peaks of the fat and oil components before and after storage, as well as the difference value of the oil content, to generate the comparison information;
[0043] Perform weighted fusion on each feature in the comparison information to obtain the storage anomaly evaluation index. If the storage anomaly evaluation index exceeds the preset threshold, trigger a warning signal to prompt adjustment of the storage method.
[0044] Preferably, an intelligent quality detection system for traditional Chinese medicine based on deep learning includes:
[0045] The recognition module is used to determine the acquisition source of the traditional Chinese medicine decoction pieces to be detected in advance, and preliminarily detect the structural defects of the traditional Chinese medicine decoction pieces to be detected through an ultrasonic detector. The structural defects include cavities and cracks. If not present, use a high - resolution industrial camera and a multispectral imager to collect RGB images and spectral images of different bands of the traditional Chinese medicine decoction pieces to be detected from multiple angles, and identify the oil cell aggregation area based on the RGB images and spectral images of different bands;
[0046] The first detection module is used to analyze the distribution of oil cells according to the oil cell aggregation area, generate a determination information, which is used to reflect the abnormal situation of the traditional Chinese medicine decoction pieces to be detected distributed for the corresponding origin under the current batch, including the distribution result and the acid range, and generate a deterioration risk signal according to the distribution result;
[0047] The second detection module is used to trigger an abort instruction when the deterioration risk signal is a deterioration signal, and trigger a distribution instruction when the deterioration risk signal is a qualified signal to supply the corresponding traditional Chinese medicine decoction pieces. After obtaining the corresponding traditional Chinese medicine decoction pieces, conduct a re-detection on the traditional Chinese medicine decoction pieces to generate pre-storage information and post-storage information;
[0048] The third detection module is used to determine whether to trigger a warning signal based on the pre-storage information and the post-storage information, in combination with the backpropagation algorithm in deep learning.
[0049] The present invention provides an intelligent detection method and system for the quality of traditional Chinese medicine based on deep learning, having the following beneficial effects:
[0050] (1) Use a high-resolution industrial camera and a multispectral imager to collect RGB images from multiple angles and spectral images of different bands. Based on these images, identify the oil cell aggregation area, and conduct multi-dimensional detection from the physical structure and microscopic cell levels to ensure the accuracy of the quality detection of traditional Chinese medicine decoction pieces in multiple aspects. According to the identified oil cell aggregation area, deeply analyze the distribution of oil cells, and generate determination information including the distribution result and acid range. This determination information can accurately reflect the abnormal conditions of the to-be-detected traditional Chinese medicine decoction pieces distributed for the corresponding production area under the current batch, providing a more comprehensive and detailed basis for the quality evaluation of traditional Chinese medicine. Through this analysis, it is possible to effectively distinguish the quality differences of traditional Chinese medicine decoction pieces from different production areas, which is of great significance for the quality control of traditional Chinese medicine. Generate a deterioration risk signal based on the distribution result. When the deterioration risk signal is a deterioration signal, promptly trigger an abort instruction to prevent unqualified traditional Chinese medicine decoction pieces from flowing into the market and reduce the medical risks and economic losses that may be caused by the use of inferior traditional Chinese medicine decoction pieces; when the deterioration risk signal is a qualified signal, trigger a distribution instruction to supply the corresponding traditional Chinese medicine decoction pieces to ensure the reliable quality of the traditional Chinese medicine decoction pieces circulating in the market. This risk warning mechanism can effectively guarantee the medication safety of patients and maintain the normal order of the traditional Chinese medicine market. After obtaining the traditional Chinese medicine decoction pieces, conduct a re-detection to generate pre-storage information and post-storage information, and generate comparison information based on these information to determine whether to trigger a warning signal. Once a quality abnormality is found, promptly trigger a warning signal to prompt an adjustment of the storage method, so as to ensure the quality stability of traditional Chinese medicine decoction pieces throughout their life cycle, extend the storage period of traditional Chinese medicine decoction pieces, and reduce resource waste.
[0051] (2)Using the safranin-fast green double staining method can clearly show the oil cells within the area where oil cells aggregate. With the aid of optical microscopic images, the position information of the oil cells can be accurately determined again. The combination of this staining and microscopic technique effectively enhances the recognition of oil cells in the image, overcoming the problem that it is difficult to accurately identify oil cells due to their tiny structure and insignificant difference from the surrounding tissues, laying a solid foundation for the subsequent in-depth analysis of the distribution of oil cells and ensuring the accuracy and reliability of the position information of oil cells. Based on the accurate position information of oil cells, combined with the regional characteristic information, the Ripley's L function is used to analyze the deviation degree of the distribution of oil cells from the Poisson distribution at different distance scales. By traversing each oil cell within the area where oil cells aggregate, counting the number of oil cells within different distances around it, obtaining the Ripley's L function values corresponding to different distances, and then judging the distribution pattern of oil cells. The distribution curve graph is drawn according to the Ripley's L function values corresponding to different distances. By comparing with the pre-set confidence interval, it is judged whether the aggregation of oil cells conforms to the Poisson distribution, and the determination information including the distribution result and the acid range is generated. On this basis, combined with the origin information of the traditional Chinese medicine decoction pieces, the differences in the distribution of oil cells in the same type of traditional Chinese medicine decoction pieces from different origins can be clearly distinguished. At the same time, by comparing the Ripley's L function values and distribution results of this batch with those of historical batches, once a difference is found, a deterioration risk signal can be generated. This mechanism realizes the dynamic monitoring of the quality of traditional Chinese medicine decoction pieces, which not only helps to deeply understand the quality characteristics of traditional Chinese medicine from different origins, but also can timely detect the quality changes of traditional Chinese medicine at the upstream distribution points, early warning of the deterioration risk, thereby effectively ensuring the quality and safety of traditional Chinese medicine and reducing the economic losses and medical risks caused by the deterioration of traditional Chinese medicine.
[0052] (3)Comparing the distribution results of this batch with those of historical batches can sensitively capture the subtle changes in the quality of traditional Chinese medicine decoction pieces. Once a difference appears, a deterioration risk signal is generated, and then random sampling is carried out. The acid value is obtained through titration analysis and compared with the pharmacopoeia standard to accurately determine whether the acid value of the traditional Chinese medicine decoction pieces exceeds the standard. For example, for a certain batch of Astragalus membranaceus decoction pieces, after comparison, it is found that the distribution result is abnormal. After sampling and titration analysis, the average acid value exceeds the upper limit of the pharmacopoeia, and it is timely determined to be deteriorated, triggering an abort instruction to avoid unqualified decoction pieces from flowing into the market and effectively reducing the medication risk.
[0053] (4)By setting the detection time, the traditional Chinese medicine decoction pieces after warehousing are regularly subjected to the detection of oil content and spectral data, generating the information after warehousing, and conducting multi-dimensional comparison with the information before warehousing. The difference values of the position and intensity of the characteristic absorption peaks of the fat and oil components and the difference value of the oil content are calculated to accurately quantify the quality changes of the traditional Chinese medicine decoction pieces during the storage process. Compared with the judgment based on a single index, this method comprehensively considers multiple key quality factors and the judgment is more comprehensive and accurate. Description of the Drawings
[0054] Figure 1Schematic diagram of the process of an intelligent detection method for traditional Chinese medicine quality based on deep learning according to the present invention;
[0055] Figure 2 Logic diagram of an intelligent detection method for traditional Chinese medicine quality based on deep learning according to the present invention;
[0056] Figure 3 Schematic diagram of the acid value comparison of Chinese herbal pieces according to the method of the present invention;
[0057] Figure 4 Block diagram of an intelligent detection system for traditional Chinese medicine quality based on deep learning according to the present invention. Detailed implementation manners
[0058] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0059] Embodiment 1
[0060] Please refer to Figures 1 to 3 , the present invention provides an intelligent detection method for traditional Chinese medicine quality based on deep learning, including the following steps,
[0061] S1: Determine the acquisition source of the Chinese herbal pieces to be detected in advance, and preliminarily detect the structural defects of the Chinese herbal pieces to be detected through an ultrasonic detector. The structural defects include cavities and cracks. If not, use a high-resolution industrial camera and a multispectral imager to collect RGB images and spectral images of different bands of the Chinese herbal pieces to be detected from multiple angles, and identify the oil cell aggregation area based on the RGB images and spectral images of different bands;
[0062] S2: Analyze the distribution of oil cells according to the oil cell aggregation area, and generate determination information. The determination information is used to reflect the abnormal conditions of the Chinese herbal pieces to be detected distributed for the corresponding production areas under the current batch, including the distribution result and the acid range. Generate a deterioration risk signal according to the distribution result;
[0063] S3: When the deterioration risk signal is a deterioration signal, trigger an abort instruction. When the deterioration risk signal is a qualified signal, trigger a distribution instruction to supply the corresponding Chinese herbal pieces. After obtaining the corresponding Chinese herbal pieces, re-detect the Chinese herbal pieces to generate pre-warehouse information and post-warehouse information;
[0064] S4: Generate comparison information based on the pre-warehouse information and the post-warehouse information, and combine the backpropagation algorithm in deep learning to determine whether to trigger a warning signal.
[0065] In this embodiment, in step S1, first, a ultrasonic detector is used to quickly screen the structural defects of traditional Chinese medicine decoction pieces. For example, if problems such as cavities and cracks are detected, defective products can be removed in time to avoid subsequent ineffective detections and save resources. For example, when detecting ginseng decoction pieces, defective products with hollow interiors can be quickly found. Then, a high-resolution industrial camera and a hyperspectral imager are used to collect images, and the RGB images and spectral images are combined to identify the oil cell aggregation regions, laying a foundation for subsequent precise detection. For example, when detecting atractylodes rhizome, its oil spot aggregation regions can be clearly identified.
[0066] In step S2, based on the analysis of the distribution of the oil cell aggregation regions, judgment information is generated by judging the oil cell distribution pattern (such as using Ripley's L function) and measuring the acid value range. For example, if it is found that the oil cells show abnormal aggregated distribution and the acid value exceeds the normal range, it can be determined that there is a risk of deterioration in this batch of traditional Chinese medicine decoction pieces, and a deterioration risk signal is generated in time.
[0067] In step S3, precise decisions are made according to the deterioration risk signal. When it is a deterioration signal, an abort instruction is triggered to prevent unqualified decoction pieces from entering the market; when it is a qualified signal, a distribution instruction is triggered to ensure the supply of high-quality decoction pieces. For example, a certain batch of angelica decoction pieces can enter the market for circulation only after passing the inspection.
[0068] In step S4, information before and after storage is generated through re-detection and compared, and the difference is analyzed using the deep learning backpropagation algorithm. For example, if there are obvious changes in the oil content and spectral characteristics after storage, exceeding the threshold will trigger a warning signal, prompting to adjust the storage conditions, realizing the dynamic monitoring of the whole process of traditional Chinese medicine quality, effectively improving the level of traditional Chinese medicine quality control, and ensuring the safety of medication.
[0069] Specifically, in traditional Chinese medicine decoction pieces, oil spots refer to some dot-like oil substances or oil cell aggregation regions presented on the surface or cross-section of the medicinal materials. These oil spots are usually formed when the medicinal materials contain volatile oils, fats and other oily components, and these oily components ooze out or are exposed on the surface during processing such as slicing or drying.
[0070] The backpropagation algorithm is a very core part of deep learning, especially playing a crucial role in the training process of neural networks. The backpropagation algorithm is not only the basis for neural network training, but also the key for deep learning to efficiently learn complex patterns and optimize models. Specifically, the backpropagation algorithm calculates the gradient (i.e., derivative) of the loss function with respect to each neural network weight, and uses these gradients to update the weights of each layer, so as to minimize the value of the loss function, thereby optimizing the neural network, making its output result gradually closer to the true label when performing weighted fusion on the parameters.
[0071] Using an ultrasonic detector to check traditional Chinese medicinal materials for insect damage, cracks, or other internal defects is a non-destructive testing method. By emitting high-frequency sound waves and analyzing the characteristics of the sound wave propagation within the traditional Chinese medicinal materials, the ultrasonic detector can detect internal structural inhomogeneities, cracks, cavities, insect damage, etc. in the traditional Chinese medicinal materials. The ultrasonic detector generates real-time waveform diagrams or images representing the sound wave propagation and reflection. By observing these images, analyze whether there are the following problems:
[0072] Cracks: Cracks will cause obvious changes in the reflection of ultrasonic waves, usually manifested as a decrease in the signal intensity or a delay in the reflected wave. Cavities or inhomogeneous structures: Cavities or inhomogeneous structures will also cause scattering or weakening of the ultrasonic signal, which can usually be identified by changes in the signal intensity.
[0073] When there are no defects, use a high-resolution industrial camera and a hyperspectral imager to collect RGB images and spectral images of different bands at multiple angles of the traditional Chinese medicinal materials to be detected. Based on the RGB images and spectral images of different bands, identify the oil cell aggregation regions; when there are defects, trigger an abort instruction;
[0074] Example 2
[0075] Please refer to Figure 1 , specifically: Use a high-resolution industrial camera and a hyperspectral imager to collect RGB images and spectral images of different bands at multiple angles of the traditional Chinese medicinal materials to be detected, and preprocess the images. Use the median filtering algorithm to denoise the RGB images to obtain the preprocessed images; perform spectral calibration on the spectral images to remove background noise interference;
[0076] Based on the collected RGB images, calculate the color histogram of the RGB images, extract the texture features of the gray-level co-occurrence matrix to preliminarily distinguish the oil point regions from the non-oil point regions, and combine with the spectral images to compare the spectral curves of the oil point regions and the non-oil point regions. Use the principal component analysis method to determine the oil point spectral feature vectors. Input the color histogram and the spectral images into the U-Net network model to perform end-to-end training on the input images, output the oil point probability map and binarize it, and set the threshold segmentation using the oil point color and spectral features to generate the oil point recognition result, which is used to reflect the identified oil point regions.
[0077] Based on the RGB images and spectral images of different bands, identify the oil cell aggregation regions, including:
[0078] Pre-make slices of the traditional Chinese medicinal materials to be detected and take microscopic images with an optical microscope and an electron microscope;
[0079] In the optical microscopic images, use the YOLOv5 deep learning object detection algorithm to identify the oil cell contours and positions;
[0080] In the electron microscopy image, the watershed algorithm is used to separate the oil cells, obtain the boundaries, count the number of oil cells per unit area and calculate their density, set the density threshold according to the characteristics of the medicinal materials, and preliminarily screen out the oil cell aggregation regions;
[0081] In the preliminarily screened oil cell aggregation regions, the final oil cell aggregation regions are identified. Specifically: the oil spot recognition results are spatially aligned with the positions of the oil cells in the optical microscopy image. If multiple oil cells correspond to the oil spot regions and occupy more than half of the oil spot regions, then the oil spot regions are determined as oil cell aggregation regions, and the regional feature information is obtained from the oil cell aggregation regions.
[0082] In this embodiment, a high-resolution industrial camera and a multispectral imager are used to collect multi-angle RGB images and spectral images, and preprocessing is performed to obtain clear image data. For example, by taking multi-angle photos of Angelica sinensis slices, its surface features can be comprehensively captured. This step provides a basis for subsequent analysis, and different modality images complement each other to avoid information loss.
[0083] Calculate the color histogram of the RGB image, extract the texture features of the gray-level co-occurrence matrix, combine the spectral image comparison and principal component analysis to preliminarily distinguish the oil spot regions. For example, in the Cinnamomum cassia slices, there are differences in the color, texture and spectral curves between the oil spot regions and the non-oil spot regions, and the suspicious regions can be quickly screened. The U-Net network model is used to train and output the oil spot probability map to further refine the recognition results and improve the accuracy.
[0084] Sections are made to obtain optical and electron microscopy images. The YOLOv5 algorithm is used to identify the contour positions of the oil cells in the optical images, and the watershed algorithm is used for the electron images to separate the oil cells and calculate the density, and the threshold is set to screen out the oil cell aggregation regions. For example, by analyzing the sections of Magnolia officinalis slices, the regions with dense distribution of oil cells can be determined at the microscopic level.
[0085] The oil spot recognition results are spatially aligned with the positions of the oil cells in the optical microscopy image. When multiple oil cells occupy more than half of the oil spot regions, they are determined as oil cell aggregation regions. Through multi-scale and multi-method cross-validation, misjudgments are excluded to ensure the reliability of the recognition results and provide accurate basis for the quality evaluation of traditional Chinese medicines.
[0086] Specifically, in the RGB image, calculate the color histogram of the oil spot area and statistically analyze its distribution characteristics in the RGB color space, such as the average hue, saturation, and brightness values. At the same time, use the gray-level co-occurrence matrix (GLCM) to extract the texture features of the oil spots, including parameters such as contrast, entropy, angular second moment, and correlation, and analyze the texture differences between the oil spots and the surrounding tissues. The analysis results are the color and texture quantization indicators of the oil spots, which are used to preliminarily distinguish the oil spots from the non-oil spot areas. Compare the spectral curves of the oil spots and the non-oil spot areas to find the characteristic bands. For example, in the near-infrared spectrum, lipid substances may have obvious absorption peaks at specific wavelengths, such as 1700 - 1800 nm. Perform dimensionality reduction on the spectral data through principal component analysis (PCA), extract the main components, and determine the spectral feature vector of the oil spots. The analysis result is the spectral feature vector of the oil spots, which serves as the basis for oil spot identification.
[0087] Example 3
[0088] Please refer to Figure 1 , specifically: According to the oil cell aggregation area, analyze the distribution of oil cells and generate determination information, including:
[0089] Use the safranin-fast green double staining method to clearly show the oil cells in the oil cell aggregation area, and use the optical microscopic image again to determine the position information of the oil cells again;
[0090] The purpose of safranin-fast green double staining is to enhance the contrast between the oil cells and the surrounding tissues, make the oil cells clearly visible in the optical microscopic image, determine the position information of the oil cells again, provide accurate spatial coordinate data for subsequent analysis, and facilitate the subsequent analysis of cell distribution.
[0091] Based on the position information of the oil cells and combined with the regional feature information, by using Ripley's L function, analyze the deviation degree of the distribution of oil cells from the Poisson distribution (random distribution) at different distance scales. By traversing each oil cell in the oil cell aggregation area, count the number of oil cells within different distance ranges around it to obtain the Ripley's L function values corresponding to different distances; the regional feature information includes the number of oil cells.
[0092] Based on the accurate position information of the oil cells, use the Ripley's L function for analysis, traverse the oil cells and count the number of cells within different distance ranges, in order to calculate the Ripley's L function values corresponding to different distances. The logic of this step is to convert the spatial distribution relationship of the oil cells into quantifiable data.
[0093] Judge the distribution pattern of the oil cells through the Ripley's L function values, so as to quantitatively analyze the differences in the distribution of oil cells in medicinal materials from different origins;
[0094] Based on the Ripley's L function values corresponding to different distances, determine whether the aggregation of oil cells in the oil cell aggregation region conforms to the Poisson distribution to generate determination information.
[0095] Based on the Ripley's L function values corresponding to different distances, determine whether the aggregation of oil cells in the oil cell aggregation region conforms to the Poisson distribution to generate determination information. The determination information includes distribution results and acid ranges, including:
[0096] Draw a distribution curve of the Ripley's L function value changing with distance according to the Ripley's L function values corresponding to different distances;
[0097] Preset a confidence interval, and judge the distribution of the curve in the distribution curve diagram relative to the confidence interval. If the curve in the distribution curve diagram falls within the confidence interval, generate a random distribution flag; otherwise, generate a regular distribution flag. Regular distributions include aggregated distributions and uniform distributions;
[0098] When a random distribution flag is generated, judge that the aggregation of oil cells in the oil cell aggregation region conforms to the Poisson distribution and label it as the first distribution result;
[0099] When a regular distribution flag is generated, judge that the aggregation of oil cells in the oil cell aggregation region does not conform to the Poisson distribution and label it as the second distribution result;
[0100] Combine the first distribution result and the second distribution result to generate a distribution result;
[0101] According to the origin information of the corresponding traditional Chinese medicine pieces to be detected, combined with the determination information, distinguish the differences in the distribution of oil cells in the same kind of traditional Chinese medicine pieces from different origins;
[0102] According to the distribution batches of each origin in the historical period, by means of random sampling, analyze the distribution of oil cells in the corresponding traditional Chinese medicine pieces from each origin in turn to obtain the Ripley's L function value, and according to the Ripley's L function value corresponding to this batch, identify whether the distribution result of this batch is the same as the distribution result of the historical period batches. If different, generate a deterioration risk signal.
[0103] In this embodiment, using the safranin-fast green double staining method can clearly show the oil cells in the oil cell aggregation region. Compared with the traditional observation method, the contrast of the cell structure after staining is significantly improved. Using the optical microscopic image again to determine the position information of the oil cells is like marking precise coordinates for each oil cell, laying a solid foundation for subsequent in-depth analysis. For example, when observing Magnolia officinalis pieces, the distribution pattern of oil cells in the tissue can be clearly seen after staining, avoiding misjudgment caused by unclear observation, and further improving the accuracy and reliability of the oil cell position information.
[0104] The distribution of oil cells was analyzed by means of Ripley's L function. By traversing each oil cell within the oil cell aggregation region and counting the number of oil cells within different distance ranges around it, the Ripley's L function values corresponding to different distances were obtained, thus realizing the quantitative study of the distribution of oil cells. Taking the woody incense slices from different origins as an example, it was found through the calculation of this function that the oil cells of the woody incense from origin a showed an aggregated distribution at a certain distance scale, while those from origin b were closer to a random distribution. Therefore, the differences in the distribution of oil cells in medicinal materials from different origins were accurately quantified, providing a scientific quantitative basis for the identification of the origin and quality evaluation of traditional Chinese medicines. Based on the Ripley's L function values, a distribution curve graph was drawn, and by setting a confidence interval, it was determined whether the aggregation of oil cells conforms to the Poisson distribution, generating a clear distribution result.
[0105] By combining origin information and historical batch data, it is possible to quickly identify abnormal situations in the distribution of oil cells in the current batch of traditional Chinese medicine slices. For example, after testing a certain batch of angelica slices, the curve of the Ripley's L function value of the distribution of its oil cells exceeded the confidence interval, generating a distribution result of No. 2, and being different from the distribution results of the historical batches of this origin. Based on this, the system generated a deterioration risk signal, promptly indicating that there may be quality problems with this batch of slices, effectively preventing unqualified slices from entering the market and ensuring the quality of traditional Chinese medicines and the safety of medication.
[0106] Ripley's L function is a statistical tool commonly used in spatial point pattern analysis and has been widely applied in many fields such as geography, ecology, and materials science. It can be used to analyze the distribution of oil cells in the quality detection of traditional Chinese medicines.
[0107] Example 4
[0108] Please refer to Figure 1 Specifically: If the distribution result of this batch is different from that of the historical batches, a deterioration risk signal will be generated, including:
[0109] Randomly select the traditional Chinese medicine slices to be tested corresponding to the generated deterioration risk signal as samples. Crush and mix evenly each of the selected multiple samples, and perform titration analysis on the samples after crushing and mixing evenly to calculate and obtain the acid value, generating an acid range;
[0110] For different types of medicinal materials, the acid value standards may vary greatly. For example, the Chinese Pharmacopoeia stipulates specific upper limits for the acid value of some medicinal materials containing oils and fats.
[0111] Specific steps of titrimetric analysis: Weigh a certain amount of the sample accurately, place it in a conical flask, add an appropriate amount of neutral ethanol-ether mixed solvent (usually 1:1), heat under reflux to dissolve the free fatty acids in the sample. After cooling, add phenolphthalein indicator, and titrate with a standard potassium hydroxide titrant of known concentration until the solution turns slightly pink and does not fade within 30 seconds as the end point, and record the volume of the standard potassium hydroxide titrant consumed.
[0112] Calculate the acid value based on the volume, concentration of the standard potassium hydroxide titrant consumed and the mass of the sample;
[0113] According to the pharmacopoeia standard, obtain the upper limit of the acid value of the sample, and based on the acid range, compare the average acid value of the sample with the upper limit of the acid value. If the average acid value is greater than the upper limit of the acid value, the deterioration risk signal is a deterioration signal, and it is determined that the acid value of the current batch of traditional Chinese medicine decoction pieces exceeds the standard. If the average acid value is less than or equal to the upper limit of the acid value, the deterioration risk signal is a qualified signal, and it is determined that the acid value of the current batch of traditional Chinese medicine decoction pieces does not exceed the standard;
[0114] As Figure 3 shown, Detection 1 to Detection 5 are all corresponding detection numbers. As can be seen from the figure, the average acid value at Detection 3 is greater than the upper limit of the acid value. At this time, the deterioration risk signal is a deterioration signal, and it is determined that the acid value of the current batch of traditional Chinese medicine decoction pieces exceeds the standard.
[0115] The content of free fatty acids in oils and fats is determined by titration method, and the acid value is expressed by the milligrams of potassium hydroxide required to neutralize the free fatty acids in 1 gram of oil and fat. The higher the acid value, the more serious the degree of oxidative rancidity of the oil and fat, the greater the possibility of producing an oily smell, and there may be a risk of improper storage.
[0116] When the deterioration risk signal is a deterioration signal, trigger an abort instruction, which is used to feedback the corresponding origin and abort the distribution of the corresponding traditional Chinese medicine decoction pieces.
[0117] When the deterioration risk signal is a qualified signal, trigger a distribution instruction to supply the corresponding traditional Chinese medicine decoction pieces. When the corresponding traditional Chinese medicine decoction pieces are obtained, conduct a re-inspection on the traditional Chinese medicine decoction pieces to generate pre-warehousing information, including:
[0118] Based on the distribution instruction, obtain the corresponding traditional Chinese medicine decoction pieces, repeat steps S1 and S2 for the corresponding traditional Chinese medicine decoction pieces. After confirming that the distribution result in the determination information of the traditional Chinese medicine decoction pieces matches the corresponding origin and the deterioration risk signal is a qualified signal, generate a warehousing instruction;
[0119] Receive the warehousing instruction, obtain pre-warehousing samples through random sampling, and scan the pre-warehousing samples with a portable near-infrared spectrometer to obtain spectral data. The spectral data is used to reflect the light absorption information of the pre-warehousing samples in the near-infrared band, including the positions and intensities of the characteristic absorption peaks of different fat and oil components;
[0120] After determining the positions of the characteristic absorption peaks, the intensities of the characteristic absorption peaks can be calculated. The peak height method (measuring the height of the characteristic peak vertex relative to the baseline), the peak area method (calculating the area enclosed between the characteristic peak and the baseline), or the absorbance method (calculating the absorbance value at a specific wavelength according to the Lambert-Beer law) can be used to quantify the intensities of the characteristic absorption peaks.
[0121] Use the Soxhlet extraction method to obtain the oil content in the samples before storage.
[0122] Combine the oil content and spectral data in the samples before storage to generate the information before storage.
[0123] Utilize the property that fat is soluble in organic solvents. Continuously reflux-extract the samples before storage with anhydrous ether so that the fat in the samples before storage enters the anhydrous ether. Then evaporate the anhydrous ether to dryness, and the residue obtained is the oil content.
[0124] During the storage and processing of traditional Chinese medicine, the distribution of the oil content will change. If improper storage conditions lead to the oxidation and rancidity of the oil, the distribution of the oil content will be altered. By monitoring the distribution of the oil content, problems during storage and processing can be detected in a timely manner, and corresponding measures can be taken to ensure the quality of traditional Chinese medicine.
[0125] Perform preprocessing and normalization on the above-collected parameters. Perform normalization on the preprocessed spectral data, adjust the numerical range of the spectral data to between [0, 1], and eliminate the spectral intensity differences caused by differences in concentration, thickness, etc. between samples, which is convenient for subsequent data analysis and comparison. Common normalization methods include min-max normalization and Z-score normalization.
[0126] In this embodiment, by comparing the distribution results of this batch with those of historical batches, the quality fluctuations of traditional Chinese medicine can be keenly captured. If there are differences, it indicates that the state of the traditional Chinese medicine decoction pieces distributed in this batch is different from that in the past, and there may be risks. Generate a deterioration risk signal, and randomly select samples for titration analysis to obtain the acid value. Taking a batch of Angelica sinensis decoction pieces as an example, if the distribution result of this batch is different from that of the historical batch, a deterioration risk signal is generated. After random sampling and titration analysis, if the average acid value exceeds the upper limit of the acid value specified in the pharmacopoeia, it is determined that the acid value of this batch exceeds the standard, and an abort instruction is triggered. The logic is that historical data reflects the conventional quality state of traditional Chinese medicine, and abnormal fluctuations imply potential quality problems, so acid value detection is carried out to preliminarily judge the deterioration risk.
[0127] When it is determined as a qualified signal, after triggering the distribution instruction, the Chinese herbal pieces are still subjected to secondary detection. Repeat steps S1 and S2. After confirming that the distribution result matches the origin characteristics, combine the near-infrared spectrometer to obtain spectral data and use the Soxhlet extraction method to determine the oil content. For example, for a batch of Chuanxiong pieces, when re-detecting, use the near-infrared spectrometer to determine the oil content. While ensuring the quality meets the standard, it provides basic analysis parameters for the subsequent storage process and generates a warehousing instruction. This process is based on the origin characteristics, supplemented by spectral and component detection, forming a dual verification mechanism to ensure the reliable quality of Chinese herbal medicines flowing into the market.
[0128] Titrimetric analysis is based on the production of free fatty acids due to the oxidation of oils and fats, and calculates the acid value through neutralization titration; the Soxhlet extraction method is based on the characteristic that fats are easily soluble in organic solvents to achieve the quantification of oils and fats. By following the pharmacopoeia standards, it ensures the credibility of the detection results, provides solid data support for the quality determination of Chinese herbal medicines, and effectively avoids the risk of inferior Chinese herbal medicines flowing into the market.
[0129] Specifically, for Chinese medicinal materials from different origins and growth environments, the regions where oil cells aggregate will also be different. For example, genuine medicinal materials usually have unique appearance and internal quality characteristics, and the characteristics of the regions where oil cells aggregate may be more typical. Taking Angelica sinensis as an example, for the genuine Angelica sinensis produced in Minxian County, Gansu Province and other places, the regions where oil cells aggregate in the cortex of its pieces are obvious, and the secretory cavities are large and numerous, which is closely related to the local suitable climate, soil and other growth environments. By analyzing the regions where oil cells aggregate, the origin of the medicinal materials can be judged to a certain extent, and whether it is a genuine medicinal material can be evaluated, thus providing a reference for the quality control of Chinese herbal medicines.
[0130] Among them, during the oxidative rancidity of oils and fats, the fatty acids in the oils and fats will undergo oxidation reactions to generate various oxidation products such as hydroperoxides, aldehydes, ketones, and acids. The generation of these products will cause changes in the chemical composition of the original oils and fats, resulting in a relative decrease in the content of oils and fats in the whole.
[0131] Example 5
[0132] Please refer to Figure 1 , specifically: when the deterioration risk signal is a qualified signal, trigger the distribution instruction to supply the corresponding Chinese herbal pieces. When the corresponding Chinese herbal pieces are obtained, conduct a re-detection on the Chinese herbal pieces to generate post-warehousing information, including:
[0133] Warehouse and store the Chinese herbal pieces, set the detection time, and re-perform the detection of the oil content and spectral data on the Chinese herbal pieces during the storage process to generate post-warehousing information.
[0134] Compare the pre-warehousing information and the post-warehousing information to obtain comparison information, including:
[0135] Calculate the difference values of the positions and intensities of the characteristic absorption peaks of the fat and oil components before and after storage, as well as the difference value of the oil content, based on the information before storage and after storage, respectively, to generate comparison information;
[0136] Perform weighted fusion on each characteristic in the comparison information to obtain a storage anomaly evaluation index. If the storage anomaly evaluation index exceeds a preset threshold, trigger a warning signal to prompt adjustment of the storage method.
[0137] If the storage anomaly evaluation index does not exceed the preset threshold, no warning signal is triggered.
[0138] In this embodiment, by setting the detection time, the oil content and spectral data of the Chinese herbal pieces during storage are detected again to generate the information after storage, and compared with the information before storage, the quality change of the Chinese herbal pieces during storage can be grasped in real time. For example, for a batch of Angelica sinensis pieces stored in the warehouse, it is set to be detected once every 3 months. In the detection after 6 months of storage, it is found that the oil content after storage also decreases. By obtaining these change information in time, measures can be taken before the quality of the Chinese herbal pieces deteriorates significantly, avoiding economic losses and medication risks caused by quality problems.
[0139] Calculate the difference values of the positions and intensities of the characteristic absorption peaks of the fat and oil components before and after storage, and the difference value of the oil content respectively, and quantify these differences into comparison information, providing specific data support for the quality change of the Chinese herbal pieces. Taking a batch of Aquilaria sinensis pieces stored as an example, through detection and calculation, it is found that after storage, the position of the carbonyl stretching vibration peak has shifted, and the intensity and oil content have both decreased. These specific quantified data can intuitively reflect the degree of quality change of the Aquilaria sinensis pieces during storage, making the quality assessment more accurate.
[0140] Perform weighted fusion on each characteristic in the comparison information to obtain a storage anomaly evaluation index. According to the comparison result of this index with the preset threshold, intelligently judge whether to trigger a warning signal. If the storage anomaly evaluation index exceeds the preset threshold, trigger a warning signal to prompt adjustment of the storage method, realizing an intelligent process from data detection to risk warning. For example, after a certain batch of Citrus reticulata Blanco pieces are stored for a period of time, through calculation, its storage anomaly evaluation index exceeds the preset threshold, and the system triggers a warning signal. The staff adjusts the storage environment in time according to the prompt, adjusts the originally humid storage environment to a dry environment suitable for storing Citrus reticulata Blanco, effectively preventing quality problems such as mildew and oil oxidation caused by moisture absorption of Citrus reticulata Blanco, extending the shelf life of the Chinese herbal pieces, and ensuring the quality stability of the Chinese herbal pieces during storage.
[0141] Example 6
[0142] Please refer to Figure 4 , specifically: An intelligent quality detection system for traditional Chinese medicine based on deep learning, including:
[0143] The recognition module is used to determine the acquisition source of the Chinese herbal pieces to be detected in advance, and preliminarily detect the structural defects of the Chinese herbal pieces to be detected through an ultrasonic detector. The structural defects include cavities and cracks. If not, use a high-resolution industrial camera and a multispectral imager to collect RGB images and spectral images of different bands of the Chinese herbal pieces to be detected from multiple angles, and identify the oil cell aggregation area based on the RGB images and spectral images of different bands;
[0144] The first detection module is used to analyze the distribution of oil cells according to the oil cell aggregation area and generate a determination message. The determination message is used to reflect the abnormal conditions of the Chinese herbal pieces to be detected distributed for the corresponding origin under the current batch, including the distribution result and the acid range, and generate a deterioration risk signal according to the distribution result;
[0145] The second detection module is used to trigger an abort instruction when the deterioration risk signal is a deterioration signal, and trigger a distribution instruction when the deterioration risk signal is a qualified signal to supply the corresponding Chinese herbal pieces. After obtaining the corresponding Chinese herbal pieces, perform a re-detection on the Chinese herbal pieces to generate pre-warehousing information and post-warehousing information;
[0146] The third detection module is used to determine whether to trigger a warning signal based on the pre-warehousing information and the post-warehousing information, in combination with the backpropagation algorithm in deep learning.
[0147] Although the embodiments of the present invention have been shown and described, for those of ordinary skill in the art, it can be understood that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present invention. The scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. An intelligent detection method for the quality of traditional Chinese medicine based on deep learning, characterized in that: including the following steps, S1: Determine the acquisition source of the traditional Chinese medicine decoction pieces to be detected in advance. Initially detect the structural defects of the traditional Chinese medicine decoction pieces to be detected through an ultrasonic detector. The structural defects include cavities and cracks. If none exist, use a high-resolution industrial camera and a hyperspectral imager to collect RGB images and spectral images of different bands from multiple angles of the traditional Chinese medicine decoction pieces to be detected. Based on the RGB images and spectral images of different bands, identify the oil cell aggregation regions; S2: Analyze the distribution of oil cells according to the oil cell aggregation regions to generate determination information. The determination information is used to reflect the abnormal conditions of the traditional Chinese medicine decoction pieces to be detected distributed for the corresponding producing areas under the current batch, including the distribution results and acid range. Generate a deterioration risk signal according to the distribution results; S3: When the deterioration risk signal is a deterioration signal, trigger an abort instruction. When the deterioration risk signal is a qualified signal, trigger a distribution instruction to supply the corresponding traditional Chinese medicine decoction pieces. After obtaining the corresponding traditional Chinese medicine decoction pieces, conduct a re-detection on the traditional Chinese medicine decoction pieces to generate pre-inventory information and post-inventory information; S4: Generate comparison information based on the pre-inventory information and the post-inventory information, and combine the backpropagation algorithm in deep learning to determine whether to trigger a warning signal.
2. A method for intelligent detection of the quality of traditional Chinese medicine based on deep learning according to claim 1, characterized in that: Use a high-resolution industrial camera and a hyperspectral imager to collect RGB images and spectral images of different bands from multiple angles of the traditional Chinese medicine decoction pieces to be detected; Based on the collected RGB images, calculate the color histogram of the RGB images, extract the texture features of the gray-level co-occurrence matrix to initially distinguish the oil point regions from the non-oil point regions, and combine with the spectral images to compare the spectral curves of the oil point regions and the non-oil point regions. Use the principal component analysis method to determine the oil point spectral feature vectors. Input the color histogram and the spectral images into the U-Net network model to perform end-to-end training on the input images, output the oil point probability map and binarize it, and use the oil point color and spectral features to set threshold segmentation to generate the oil point recognition result. The oil point recognition result is used to reflect the identified oil point regions.
3. A method for intelligent detection of the quality of traditional Chinese medicine based on deep learning according to claim 2, characterized in that: Based on the RGB images and spectral images of different bands, identify the oil cell aggregation regions, including: Pre-make slices of the traditional Chinese medicine decoction pieces to be detected and take microscopic images with an optical microscope and an electron microscope; In the optical microscopic images, use the YOLOv5 deep learning object detection algorithm to identify the contours and positions of the oil cells; In the electron microscopic images, use the watershed algorithm to separate the oil cells, obtain the boundaries, count the number of oil cells per unit area and calculate their density, and set a density threshold according to the characteristics of the medicinal materials to initially screen out the oil cell aggregation regions; In the initially screened oil cell aggregation regions, identify the final oil cell aggregation regions. Specifically: spatially align the oil point recognition result with the positions of the oil cells in the optical microscopic images. If multiple oil cells correspond to the oil point regions and occupy more than half of the oil point regions, then determine the oil point regions as the oil cell aggregation regions; Obtain regional feature information from the oil cell aggregation region.
4. A method for intelligent detection of traditional Chinese medicine quality based on deep learning according to claim 3, characterized in that: Based on the oil cell aggregation region, analyze the distribution of oil cells to generate determination information, including: Use the safranin-fast green double staining method to clearly display the oil cells in the oil cell aggregation region, and use the optical microscopic image again to determine the position information of the oil cells again; Based on the position information of the oil cells, combined with the regional feature information, by using Ripley's L function, analyze the deviation degree of the distribution of oil cells from the Poisson distribution at different distance scales, and by traversing each oil cell in the oil cell aggregation region, count the number of oil cells within different distance ranges around it to obtain the Ripley's L function values corresponding to different distances; Based on the Ripley's L function values corresponding to different distances, judge whether the aggregation of oil cells in the oil cell aggregation region conforms to the Poisson distribution to generate determination information.
5. The intelligent detection method for traditional Chinese medicine quality based on deep learning according to claim 4, characterized in that: Based on the Ripley's L function values corresponding to different distances, judge whether the aggregation of oil cells in the oil cell aggregation region conforms to the Poisson distribution to generate determination information. The determination information includes the distribution result and the acid range, including: Draw a distribution curve of the Ripley's L function value changing with distance according to the Ripley's L function values corresponding to different distances; Preset a confidence interval, and judge the distribution of the curve in the distribution curve relative to the confidence interval. If the curve in the distribution curve falls within the confidence interval, generate a random distribution flag, otherwise generate a regular distribution flag; When generating a random distribution flag, judge that the aggregation of oil cells in the oil cell aggregation region conforms to the Poisson distribution and label it as the first distribution result; When generating a regular distribution flag, judge that the aggregation of oil cells in the oil cell aggregation region does not conform to the Poisson distribution and label it as the second distribution result; Combine the first distribution result and the second distribution result to generate a distribution result; According to the origin information of the corresponding traditional Chinese medicine decoction pieces to be detected, combined with the determination information, distinguish the differences in the distribution of oil cells in the same kind of traditional Chinese medicine decoction pieces from different origins; According to the distribution batches of each origin in the historical period, by means of random sampling, analyze the distribution of oil cells in the corresponding traditional Chinese medicine decoction pieces of each origin in turn to obtain the Ripley's L function value, and according to the Ripley's L function value corresponding to this batch, identify whether the distribution result of this batch is the same as the distribution result of the historical period batches. If different, generate a deterioration risk signal.
6. The intelligent detection method for traditional Chinese medicine quality based on deep learning according to claim 5, characterized in that: If the distribution result of this batch is different from the distribution result of the historical batch, generate a deterioration risk signal, including: Randomly select the traditional Chinese medicine decoction pieces to be detected corresponding to the batch generating the deterioration risk signal as samples, crush and mix the selected samples evenly, and perform titration analysis on the samples after crushing and mixing evenly to calculate and obtain the acid value and generate an acid range; According to the pharmacopoeia standard, obtain the upper limit of the acid value of the sample, and based on the acid range, compare the average acid value of the sample with the upper limit of the acid value. If the average acid value is greater than the upper limit of the acid value, the deterioration risk signal is a deterioration signal, and it is determined that the acid value of the current batch of traditional Chinese medicine decoction pieces exceeds the standard. If the average acid value is less than or equal to the upper limit of the acid value, the deterioration risk signal is a qualified signal, and it is determined that the acid value of the current batch of traditional Chinese medicine decoction pieces does not exceed the standard; When the deterioration risk signal is a deterioration signal, trigger an abort instruction, and the abort instruction is used to feedback the corresponding origin and abort the distribution of the corresponding traditional Chinese medicine decoction pieces.
7. The intelligent quality detection method for traditional Chinese medicine based on deep learning according to claim 6, characterized in that: When the deterioration risk signal is a qualified signal, trigger a distribution instruction to supply the corresponding traditional Chinese medicine decoction pieces. After obtaining the corresponding traditional Chinese medicine decoction pieces, conduct a re-inspection on the traditional Chinese medicine decoction pieces to generate pre-inventory information, including: Based on the distribution instruction, obtain the corresponding traditional Chinese medicine decoction pieces, repeat steps S1 and S2 for the corresponding traditional Chinese medicine decoction pieces. After confirming that the distribution result in the determination information of the traditional Chinese medicine decoction pieces matches the corresponding origin and the deterioration risk signal is a qualified signal, generate an inventory instruction; Receive the inventory instruction, obtain pre-inventory samples through random sampling, and scan the pre-inventory samples using a portable near-infrared spectrometer to obtain spectral data. The spectral data is used to reflect the light absorption information of the pre-inventory samples in the near-infrared band, including the positions and intensities of the characteristic absorption peaks of different fatty oil components; Adopt the Soxhlet extraction method. Utilizing the property that fat is soluble in organic solvents, continuously reflux extract the pre-inventory samples with anhydrous ether, so that the fat in the pre-inventory samples enters the anhydrous ether, and then evaporate the anhydrous ether to dryness to obtain a residue, and this residue is the oil content; Combine the oil content and spectral data of the pre-inventory samples to generate pre-inventory information.
8. The intelligent quality detection method for traditional Chinese medicine based on deep learning according to claim 7, characterized in that: When the deterioration risk signal is a qualified signal, trigger a distribution instruction to supply the corresponding traditional Chinese medicine decoction pieces. After obtaining the corresponding traditional Chinese medicine decoction pieces, conduct a re-inspection on the traditional Chinese medicine decoction pieces to generate post-inventory information, including: Store the traditional Chinese medicine decoction pieces in the warehouse, set the detection time, and re-perform the detection of the oil content and spectral data on the traditional Chinese medicine decoction pieces during the storage process to generate post-inventory information.
9. The intelligent detection method for traditional Chinese medicine quality based on deep learning according to claim 8, characterized in that: Compare the pre-inventory information and the post-inventory information to obtain comparison information, including: Based on the pre-inventory information and the post-inventory information, calculate the difference values of the positions and intensities of the characteristic absorption peaks of the fatty oil components before and after inventory, as well as the difference value of the oil content, to generate comparison information; Perform weighted fusion on each feature in the comparison information to obtain a storage anomaly evaluation index. If the storage anomaly evaluation index exceeds the preset threshold, trigger a warning signal to prompt to adjust the storage method.
10. An intelligent detection system for the quality of traditional Chinese medicine based on deep learning, which is used to implement the intelligent detection method for the quality of traditional Chinese medicine based on deep learning described in any one of the above claims 1 to 9, and is characterized in that: Including: The recognition module is used to determine the acquisition source of the Chinese herbal pieces to be detected in advance, and preliminarily detect the structural defects of the Chinese herbal pieces to be detected through an ultrasonic detector. The structural defects include cavities and cracks. If not, a high-resolution industrial camera and a hyperspectral imager are used to collect RGB images and spectral images of different bands at multiple angles of the Chinese herbal pieces to be detected, and the oil cell aggregation area is recognized based on the RGB images and spectral images of different bands; The first detection module is used to analyze the distribution of oil cells according to the oil cell aggregation area, generate determination information, and the determination information is used to reflect the abnormal conditions of the Chinese herbal pieces to be detected distributed for the corresponding production area under the current batch, including the distribution result and the acid range. According to the distribution result, a deterioration risk signal is generated; The second detection module is used to trigger an abort instruction when the deterioration risk signal is a deterioration signal, and trigger a distribution instruction when the deterioration risk signal is a qualified signal to supply the corresponding Chinese herbal pieces. After obtaining the corresponding Chinese herbal pieces, the Chinese herbal pieces are detected again to generate pre-storage information and post-storage information; The third detection module is used to judge whether to trigger a warning signal based on the pre-storage information and the post-storage information, in combination with the backpropagation algorithm in deep learning.
Citation Information
Patent Citations
Traditional Chinese medicine intelligent management cabinet and storing, taking, metering and monitoring management system thereof
CN112273891A
Traditional Chinese medicine quality automatic detection system
CN117030657A
Method for measuring shelf life of fresh traditional Chinese medicine decoction pieces by Raman spectrum technology
CN117589745A
Online quality monitoring method and system based on traditional Chinese medicine decoction piece production
CN118649914A
Biomaterial-based drug delivery patch, manufacturing method therefor, and use thereof
WO2023132407A1
Cited By
Traditional Chinese medicine decoction piece quality evaluation method based on big data
CN120579901A
Intelligent traditional Chinese medicine decoction piece screening method based on multi-modal data fusion
CN120831338A
An intelligent screening method for traditional Chinese medicine decoction pieces based on multi-modal data fusion
CN120831338B
Propolis quality detection management system based on multi-source data
CN121279855A
A propolis quality detection management system based on multi-source data
CN121279855B
