A method and system for intelligent detection of traditional Chinese medicine quality based on deep learning
Through deep learning technology combined with high-resolution cameras and spectral imagers, the oil cell aggregation area of Chinese herbal medicines is identified, and the traditional detection methods are solved using Ripley'sL function and titration analysis, and the shortcomings of traditional detection methods are achieved, precise detection and dynamic monitoring of Chinese herbal medicines are ensured, and the safety and stability of Chinese herbal medicines are ensured.
Patent Information
- Application Number
- CN202510881046.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-27
- Publication Date
- 2025-08-22
- 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 deep learning-based method is adopted, combined with high-resolution industrial cameras, multi-spectral imagers and deep learning algorithms, the oil cell aggregation area of Chinese herbal medicines is identified, and the oil cell distribution is analyzed through RGB images and spectral images. The risk of deterioration is judged using Ripley'sL function and titration analysis, and judgment information is generated and corresponding instructions are triggered.
Accurate detection and dynamic monitoring of the quality of Chinese herbal medicines have been realized, timely identifying the risk of spoilage, ensuring the quality and safety of Chinese herbal medicines, reducing economic losses and medical risks, and ensuring the stability of Chinese herbal medicines in the life cycle.
Smart Images

Figure CN120375370B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of medicine and health technology, and specifically to a method and system for intelligent detection of traditional Chinese medicine quality based on deep learning. Background Art
[0002] In the field of medicine and health, Chinese medicine, as a treasure of traditional Chinese medicine, occupies an important position in the treatment and prevention of diseases with its unique theoretical system and clinical efficacy. The quality of Chinese medicine directly affects its clinical efficacy and safety, so the quality inspection of Chinese medicine has become a key link in the development of the Chinese medicine industry. Among them, the surface characteristics of Chinese herbal medicine slices vary depending on factors such as the type of medicinal materials and the processing method. For Chinese herbal medicine slices with smooth, rough or textured surfaces, there may be local oil spots on the surface. For example, Chinese herbal medicines containing oil cells include cinnamon, calamus, costus root, magnolia bark, magnolia, etc. In the slices of these Chinese herbal medicines, areas where oil cells gather may form oil spots on the surface. For example, the surface of Angelica dahurica slices has longitudinal wrinkles and many brown oil spots scattered on the skin.
[0003] Traditional methods for testing the quality of traditional Chinese medicine (TCM) rely heavily on manual experience, using methods like visual inspection, touch, and smell to identify the appearance and odor of TCMs, or using instrumentation to detect defects. However, these methods have numerous shortcomings when it comes to detecting textural characteristics such as oil cells and oil content. For example, manual identification struggles to accurately determine oil cell clusters and distribution patterns, lacks objectivity and quantitative standards, and fails to meet the demands for rapid and accurate TCM quality testing. Summary of the Invention
[0004] In response to the shortcomings of the existing technology, the present invention provides a method and system for intelligent detection of traditional Chinese medicine quality based on deep learning, which solves the problems in the above-mentioned background technology.
[0005] To achieve the above objectives, the present invention is implemented through the following technical solutions: a method for intelligent detection of Chinese medicine quality based on deep learning, comprising the following steps:
[0006] S1: Determine the source of the TCM pieces to be tested in advance, and use an ultrasonic detector to preliminarily detect structural defects in the TCM pieces to be tested. Structural defects include voids and cracks. If they do not exist, use a high-resolution industrial camera and a multispectral imager to collect RGB images from multiple angles and spectral images of different bands of the TCM pieces to be tested. Based on the RGB images and spectral images of different bands, identify the oil cell aggregation area;
[0007] S2: Analyze the distribution of oil cells based on the oil cell aggregation area and generate judgment information. The judgment information is used to reflect the abnormality of the Chinese herbal medicine pieces to be tested distributed from the corresponding production area in the current batch, including the distribution results and acid range. Based on the distribution results, a deterioration risk signal is generated;
[0008] S3: When the deterioration risk signal is a deterioration signal, a stop instruction is triggered. When the deterioration risk signal is a qualified signal, a distribution instruction is triggered to supply the corresponding Chinese herbal medicine slices. After the corresponding Chinese herbal medicine slices are obtained, the Chinese herbal medicine slices are retested to generate pre-warehousing information and post-warehousing information;
[0009] S4: Generate comparative information based on the information before and after storage, and combine it with the back propagation algorithm in deep learning to determine whether a warning signal is triggered.
[0010] Preferably, a high-resolution industrial camera and a multispectral imager are used to collect RGB images of the Chinese herbal medicine to be tested at multiple angles and spectral images of different bands;
[0011] Based on the collected RGB image, the color histogram of the RGB image is calculated, and the texture features of the gray-level co-occurrence matrix are extracted to preliminarily distinguish the oil spot area from the non-oil spot area. Combined with the spectral image, the spectral curves of the oil spot area and the non-oil spot area are compared. The principal component analysis method is used to determine the spectral feature vector of the oil spot. The color histogram and spectral image are input into the U-Net network model to perform end-to-end training of the image input model. The oil spot probability map is output and binarized. The oil spot color and spectral features are used to set the threshold segmentation to generate the oil spot recognition result. The oil spot recognition result is used to reflect the identified oil spot area.
[0012] Preferably, identifying oil cell aggregation areas based on RGB images and spectral images of different bands includes:
[0013] Prepare slices of the Chinese herbal medicine to be tested in advance and take microscopic images using an optical microscope and an electron microscope;
[0014] In optical microscopy images, the YOLOv5 deep learning object detection algorithm is used to identify the outline and location of oil cells;
[0015] In electron microscopic images, a watershed algorithm is used to separate oil cells, obtain boundaries, count the number of oil cells per unit area, and calculate their density. The density threshold is set according to the characteristics of the medicinal material to preliminarily screen out the oil cell aggregation area;
[0016] The final oil cell aggregation area is identified in the initially screened oil cell aggregation areas by spatially aligning the oil spot identification results with the oil cell positions in the optical microscope image. If multiple oil cells are present in the corresponding oil spot area and occupy more than half of the oil spot area, the oil spot area is determined to be an oil cell aggregation area.
[0017] Obtain regional feature information from oil cell aggregation areas.
[0018] Preferably, the distribution of oil cells is analyzed according to the oil cell aggregation area to generate determination information, including:
[0019] The oil cells in the oil cell aggregation area were clearly displayed using the safranin-fast green double staining method, and the position information of the oil cells was re-determined using optical microscopic images;
[0020] Based on the location information of oil cells and regional feature information, the Ripley's L function is used to analyze the degree of deviation of the distribution of oil cells from the Poisson distribution at different distance scales. By traversing each oil cell in the oil cell cluster area and counting the number of oil cells within different distance ranges around it, the Ripley's L function values corresponding to different distances are obtained.
[0021] Based on the Ripley's L function values corresponding to different distances, it is determined whether the aggregation of oil cells in the oil cell aggregation area conforms to the Poisson distribution to generate judgment information.
[0022] Preferably, based on the Ripley's L function values corresponding to different distances, it is determined whether the oil cell aggregation in the oil cell aggregation area conforms to the Poisson distribution to generate determination information, which includes the distribution result and the acid range, including:
[0023] Draw a distribution curve of Ripley'sL function value versus distance based on the Ripley'sL function value corresponding to different distances;
[0024] Preset the 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 into the confidence interval, a random distribution mark is generated, otherwise a regular distribution mark is generated.
[0025] If a random distribution mark is generated, it is determined that the aggregation of oil cells in the oil cell aggregation area conforms to the Poisson distribution and is marked as the number one distribution result;
[0026] If a regular distribution mark is generated, it is determined that the aggregation of oil cells in the oil cell aggregation area does not conform to the Poisson distribution and is marked as a No. 2 distribution result;
[0027] Combine the results of distribution No. 1 and distribution No. 2 to generate a distribution result;
[0028] According to the origin information of the corresponding Chinese herbal medicine pieces to be tested, combined with the judgment information, the differences in the distribution of oil cells in the same type of Chinese herbal medicine pieces from different origins are distinguished;
[0029] According to the distribution batches of each production area in the historical period, the distribution of oil cells in the corresponding Chinese herbal medicine slices of each production area is analyzed in turn by random sampling to obtain the Ripley's L function value. Based on the Ripley's L function value corresponding to this batch, it is identified whether the distribution result of this batch is the same as the distribution result of the batch in the historical period. If different, a deterioration risk signal is generated.
[0030] Preferably, if the distribution result of the current batch is different from the distribution result of the historical batch, a spoilage risk signal is generated, including:
[0031] Randomly select the batches of Chinese herbal medicine slices to be tested corresponding to the deterioration risk signal as samples, crush and mix the selected samples respectively, and perform titration analysis on the crushed and mixed samples respectively to calculate the acid value and generate the acid range;
[0032] According to the pharmacopoeia standard, the acid value upper limit of the sample is obtained, and based on the acid range, the average acid value of the sample is compared with the acid value upper limit. If the average acid value is greater than the acid value upper limit, the deterioration risk signal is a deterioration signal, and it is determined that the acid value of the current batch of Chinese herbal medicine slices exceeds the standard. If the average acid value is less than or equal to the acid value upper limit, the deterioration risk signal is a qualified signal, and it is determined that the acid value of the current batch of Chinese herbal medicine slices does not exceed the standard;
[0033] When the deterioration risk signal is a deterioration signal, a stop instruction is triggered, and the stop instruction is used to feedback the corresponding origin and stop the distribution of the corresponding Chinese herbal medicine slices.
[0034] Preferably, when the deterioration risk signal is a qualified signal, a distribution instruction is triggered to supply the corresponding Chinese herbal medicine slices. After the corresponding Chinese herbal medicine slices are obtained, the Chinese herbal medicine slices are retested to generate pre-warehousing information, including:
[0035] Based on the distribution instruction, the corresponding Chinese herbal medicine pieces are obtained, and steps S1 and S2 are repeatedly performed on the corresponding Chinese herbal medicine pieces. After confirming that the distribution result in the determination information of the Chinese herbal medicine pieces matches the corresponding origin and the deterioration risk signal is a qualified signal, a storage instruction is generated;
[0036] 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 absorption information of the pre-warehousing samples in the near-infrared band, including the position and intensity of the characteristic absorption peaks of different fat and oil components;
[0037] Soxhlet extraction is used. Taking advantage of the fact that fat is soluble in organic solvents, the pre-storage sample is continuously refluxed with anhydrous ether to extract the fat in the pre-storage sample. The anhydrous ether is then evaporated to dryness to obtain the residue, which is the oil content.
[0038] The oil content and spectral data of the samples before storage are combined to generate pre-storage information.
[0039] Preferably, when the deterioration risk signal is a qualified signal, a distribution instruction is triggered to supply the corresponding Chinese herbal medicine slices. After the corresponding Chinese herbal medicine slices are obtained, the Chinese herbal medicine slices are retested to generate post-warehousing information, including:
[0040] Put the Chinese herbal medicine pieces into storage and store them, set the detection time, and perform oil content and spectral data detection on the Chinese herbal medicine pieces during storage again to generate post-storage information.
[0041] Preferably, the pre-warehousing information and the post-warehousing information are compared to obtain comparative information, including:
[0042] By using the information before and after storage, the difference values of the position and intensity 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, are calculated to generate comparative information;
[0043] The features in the comparison information are weighted and fused to obtain the storage anomaly evaluation index. If the storage anomaly evaluation index exceeds the preset threshold, a warning signal is triggered, prompting you to adjust the storage method.
[0044] Preferably, a deep learning-based intelligent detection system for traditional Chinese medicine quality includes:
[0045] The identification module is used to pre-determine the source of the TCM pieces to be tested, and use an ultrasonic detector to preliminarily detect structural defects in the TCM pieces to be tested. Structural defects include voids and cracks. If they are not present, a high-resolution industrial camera and a multispectral imager are used to collect RGB images from multiple angles and spectral images of different bands of the TCM pieces to be tested. Based on the RGB images and spectral images of different bands, the oil cell aggregation area is identified;
[0046] The first detection module is used to analyze the distribution of oil cells according to the oil cell aggregation area and generate judgment information. The judgment information is used to reflect the abnormality of the Chinese herbal medicine pieces to be tested distributed from the corresponding production area in the current batch, including the distribution result and the acid range. Based on the distribution result, a deterioration risk signal is generated;
[0047] The second detection module is used to trigger a stop 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 medicine slices. After obtaining the corresponding Chinese herbal medicine slices, the Chinese herbal medicine slices are re-tested to generate pre-warehousing information and post-warehousing information;
[0048] The third detection module is used to determine whether a warning signal is triggered based on pre-warehousing information and post-warehousing information combined with the back propagation algorithm in deep learning.
[0049] The present invention provides a method and system for intelligent detection of traditional Chinese medicine quality based on deep learning, which has the following beneficial effects:
[0050] (1) Using high-resolution industrial cameras and multispectral imagers to collect multi-angle RGB images and spectral images of different bands, the oil cell aggregation areas are identified based on these images, and multi-dimensional detection is performed at the physical structure and microscopic cell levels to ensure the accuracy of the quality detection of Chinese herbal medicine slices in many aspects. Based on the identified oil cell aggregation areas, the distribution of oil cells is deeply analyzed to generate judgment information including distribution results and acid range. This judgment information can accurately reflect the abnormal conditions of the Chinese herbal medicine slices to be tested in the current batch and the corresponding origin, providing a more comprehensive and detailed basis for the quality assessment of Chinese herbal medicine. Through this analysis, the quality differences of Chinese herbal medicine slices from different origins can be effectively distinguished, which is of great significance for the quality control of Chinese herbal medicine. Generate a deterioration risk signal based on the distribution results. When the deterioration risk signal is a deterioration signal, trigger the suspension instruction in time to prevent unqualified Chinese herbal medicines from entering the market and reduce the medical risks and economic losses that may be caused by the use of inferior Chinese herbal medicines. When the deterioration risk signal is a qualified signal, trigger the distribution instruction to supply the corresponding Chinese herbal medicines to ensure the quality of the Chinese herbal medicines circulating on the market. This risk warning mechanism can effectively protect the safety of patients' medication and maintain the normal order of the Chinese medicine market. After the Chinese herbal medicines are obtained, they are re-tested to generate pre-warehousing information and post-warehousing information, and comparative information is generated based on this information to determine whether a warning signal is triggered. Once a quality abnormality is found, a warning signal is triggered in time to prompt the adjustment of the storage method, thereby ensuring the stability of the quality of the Chinese herbal medicines throughout their life cycle, extending the storage period of the Chinese herbal medicines, and reducing resource waste.
[0051] (2) The double staining method of safranin and fast green can clearly display the oil cells in the oil cell aggregation area. With the help of optical microscopy, the location information of the oil cells can be accurately determined again. This combination of staining and microscopy effectively enhances the recognition of oil cells in the image, overcomes the problem that oil cells are difficult to accurately identify due to their small structure and unclear difference from surrounding tissues, lays a solid foundation for subsequent in-depth analysis of oil cell distribution, and ensures the accuracy and reliability of oil cell location information. Based on the accurate oil cell location information and combined with regional feature information, the Ripley's L function is used to analyze the degree of deviation of oil cell distribution from Poisson distribution at different distance scales. By traversing each oil cell in the oil cell aggregation area, the number of oil cells within different distance ranges around it is counted, and the Ripley's L function values corresponding to different distances are obtained. Then, the distribution pattern of oil cells is determined. The distribution curve is drawn according to the Ripley's L function values corresponding to different distances. By comparing with the pre-set confidence interval, it is determined whether the oil cell aggregation conforms to the Poisson distribution, and judgment information containing the distribution results and acid range is generated. On this basis, combined with the origin information of Chinese herbal medicine slices, it is possible to clearly distinguish the differences in the distribution of oil cells within the same type of Chinese herbal medicine slices from different origins. At the same time, by comparing the Ripley's L function values and distribution results of the current batch with those of historical batches, a deterioration risk signal can be generated if a difference is found. This mechanism realizes the dynamic monitoring of the quality of Chinese herbal medicine slices. It not only helps to gain a deeper understanding of the quality characteristics of Chinese medicines from different origins, but also can promptly detect changes in the quality of Chinese medicines at upstream distribution points, and provide early warning of deterioration risks, thereby effectively ensuring the quality and safety of Chinese medicines and reducing the economic losses and medical risks caused by deterioration of Chinese medicines.
[0052] (3) Comparing the distribution results of the current batch with those of historical batches can keenly capture subtle changes in the quality of Chinese herbal medicine slices. Once a difference occurs, a deterioration risk signal is generated. Subsequently, random sampling is performed, and the acid value is obtained through titration analysis and compared with the pharmacopoeial standard to accurately determine whether the acid value of the Chinese herbal medicine slices exceeds the standard. For example, a batch of Astragalus slices was found to have an abnormal distribution result after comparison. After sampling and titration analysis, the average acid value exceeded the pharmacopoeial upper limit. It was promptly determined to be deteriorated and a suspension order was triggered to prevent unqualified slices from entering the market, effectively reducing the risk of medication use.
[0053] (4) By setting the detection time, the oil content and spectral data of the Chinese herbal medicine slices after storage are regularly tested, and the post-storage information is generated. It is then compared with the pre-storage information in multiple dimensions to calculate the characteristic absorption peak position and intensity difference of fat and oil components, as well as the oil content difference, to accurately quantify the quality changes of the Chinese herbal medicine slices during storage. Compared with the judgment of a single indicator, this method comprehensively considers multiple key quality factors and makes the judgment more comprehensive and accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1This is a flow chart of an intelligent detection method for Chinese medicine quality based on deep learning of the present invention;
[0055] Figure 2 This is a logic diagram of a method for intelligent detection of traditional Chinese medicine quality based on deep learning in the present invention;
[0056] Figure 3 Schematic diagram of the comparison of acid values of Chinese herbal medicine slices according to the method of the present invention;
[0057] Figure 4 This is a block diagram of the intelligent detection system for traditional Chinese medicine quality based on deep learning in the present invention. DETAILED DESCRIPTION
[0058] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0059] Example 1
[0060] See also Figures 1 to 3 The present invention provides a method for intelligent detection of Chinese medicine quality based on deep learning, comprising the following steps:
[0061] S1: Determine the source of the TCM pieces to be tested in advance, and use an ultrasonic detector to preliminarily detect structural defects in the TCM pieces to be tested. Structural defects include voids and cracks. If they do not exist, use a high-resolution industrial camera and a multispectral imager to collect RGB images from multiple angles and spectral images of different bands of the TCM pieces to be tested. Based on the RGB images and spectral images of different bands, identify the oil cell aggregation area;
[0062] S2: Analyze the distribution of oil cells based on the oil cell aggregation area and generate judgment information. The judgment information is used to reflect the abnormality of the Chinese herbal medicine pieces to be tested distributed from the corresponding production area in the current batch, including the distribution results and acid range. Based on the distribution results, a deterioration risk signal is generated;
[0063] S3: When the deterioration risk signal is a deterioration signal, a stop instruction is triggered. When the deterioration risk signal is a qualified signal, a distribution instruction is triggered to supply the corresponding Chinese herbal medicine slices. After the corresponding Chinese herbal medicine slices are obtained, the Chinese herbal medicine slices are retested to generate pre-warehousing information and post-warehousing information;
[0064] S4: Generate comparative information based on the information before and after storage, and combine it with the back propagation algorithm in deep learning to determine whether a warning signal is triggered.
[0065] In this embodiment, in step S1, an ultrasonic detector is first used to quickly screen the structural defects of Chinese herbal medicine slices. If problems such as cavities and cracks are detected, defective products can be promptly eliminated to avoid subsequent invalid detection and save resources. For example, when testing ginseng slices, defective products with hollow interiors can be quickly discovered. Then, a high-resolution industrial camera and a multispectral imager are used to capture images, and the RGB image and spectral image are combined to identify the oil cell aggregation area, laying the foundation for subsequent accurate detection. For example, when testing Atractylodes lancea, its oil point aggregation area can be clearly identified.
[0066] Step S2 analyzes the distribution of oil cell clusters, determining the oil cell distribution pattern (e.g., using Ripley's L function) and measuring the acid value range to generate judgment information. For example, if abnormal oil cell clustering and acid values are found, the batch of Chinese herbal medicine slices can be determined to be at risk of deterioration, and a deterioration risk signal can be generated promptly.
[0067] Step S3 makes precise decisions based on spoilage risk signals. A spoilage signal triggers a halt instruction to prevent substandard slices from entering the market; a qualified signal triggers a distribution instruction to ensure the supply of high-quality slices. For example, a batch of angelica slices can only be released to the market after passing the test.
[0068] In step S4, the data before and after storage are retested and compared, with the difference analyzed using a deep learning backpropagation algorithm. For example, if the oil content and spectral characteristics change significantly after storage, exceeding a threshold, a warning signal is triggered, prompting the adjustment of storage conditions. This enables dynamic monitoring of the quality of traditional Chinese medicine throughout the entire process, effectively improving the level of quality control and ensuring medication safety.
[0069] Specifically, in Chinese herbal medicines, oil spots refer to some point-like oily substances or oil cell aggregation areas on the surface or cross-section of the medicinal materials. These oil spots are usually caused by the presence of volatile oils, greases and other oily components in the medicinal materials. During the slicing or drying process, these oily components seep out or are exposed on the surface.
[0070] The backpropagation algorithm is a core component of deep learning, playing a crucial role in the training of neural networks. It is not only the foundation of neural network training but also the key to deep learning's ability 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 each layer's weights to minimize the loss function, thereby optimizing the neural network. This ensures that, when weighted fusion of parameters is performed, the output gradually approaches the true label.
[0071] Using an ultrasonic detector to inspect Chinese medicinal materials for insect infestation, cracks, or other internal defects is a non-destructive testing method. Ultrasonic waves emit high-frequency sound waves and analyze the propagation characteristics of the sound waves within the medicinal material. This can detect structural unevenness, cracks, cavities, insect infestation, and other problems within the material. The ultrasonic detector generates real-time waveforms or images that depict the propagation and reflection of the sound waves. By observing these images, analyze whether the following problems exist:
[0072] Cracks: Cracks can cause noticeable changes in ultrasonic reflections, typically manifesting as a decrease in signal intensity or a delay in the reflected wave. Holes or uneven structures: Holes or uneven structures can also cause ultrasonic signals to scatter or weaken, which can usually be identified by changes in signal intensity.
[0073] When there are no defects, a high-resolution industrial camera and a multi-spectral imager are used to collect RGB images from multiple angles and spectral images of different bands of the Chinese herbal medicine to be tested. Based on the RGB images and spectral images of different bands, the oil cell aggregation area is identified; when defects are present, an abort command is triggered;
[0074] Example 2
[0075] Please refer to Figure 1 Specifically: Use a high-resolution industrial camera and a multispectral imager to collect RGB images of the Chinese herbal medicine to be tested at multiple angles and spectral images of different bands, and pre-process the images. Use the median filter algorithm to denoise the RGB images to obtain the pre-processed images; perform spectral correction on the spectral images to remove background noise interference;
[0076] Based on the collected RGB image, the color histogram of the RGB image is calculated, and the texture features of the gray-level co-occurrence matrix are extracted to preliminarily distinguish the oil spot area from the non-oil spot area. Combined with the spectral image, the spectral curves of the oil spot area and the non-oil spot area are compared. The principal component analysis method is used to determine the spectral feature vector of the oil spot. The color histogram and spectral image are input into the U-Net network model to perform end-to-end training of the image input model. The oil spot probability map is output and binarized. The oil spot color and spectral features are used to set the threshold segmentation to generate the oil spot recognition result. The oil spot recognition result is used to reflect the identified oil spot area.
[0077] Identify oil cell aggregation areas based on RGB images and spectral images of different bands, including:
[0078] Prepare slices of the Chinese herbal medicine to be tested in advance and take microscopic images using an optical microscope and an electron microscope;
[0079] In optical microscopy images, the YOLOv5 deep learning object detection algorithm is used to identify the outline and location of oil cells;
[0080] In electron microscopic images, a watershed algorithm is used to separate oil cells, obtain boundaries, count the number of oil cells per unit area, and calculate their density. The density threshold is set according to the characteristics of the medicinal material to preliminarily screen out the oil cell aggregation area;
[0081] In the oil cell aggregation area preliminarily screened out, the final oil cell aggregation area is identified. Specifically, the oil spot identification results are spatially aligned with the oil cell positions in the optical microscope image. If multiple oil cells exist in the oil spot area and occupy more than half of the oil spot area, the oil spot area is judged to be the oil cell aggregation area, and the regional feature information is obtained from the oil cell aggregation area.
[0082] In this example, a high-resolution industrial camera and a multispectral imager were used to capture multi-angle RGB and spectral images, and preprocessed to obtain clear image data. For example, by photographing angelica slices from multiple angles, we can fully capture their surface features. This step provides a foundation for subsequent analysis, as images from different modalities complement each other and avoid information loss.
[0083] By calculating the RGB image color histogram and extracting texture features from the gray-level co-occurrence matrix, combined with spectral image comparison and principal component analysis, we can initially identify oil spot areas. For example, in cinnamon slices, the color, texture, and spectral curves of oil spot areas differ from those of non-oil spot areas, enabling rapid screening of suspicious areas. Using a U-Net network model, we can output an oil spot probability map to further refine the identification results and improve accuracy.
[0084] Slices are prepared to obtain optical and electron microscopic images. The YOLOv5 algorithm is used to identify the outlines of oil cells in optical images, while the watershed algorithm is used to separate oil cells and calculate their density in electron images. A threshold is then set to identify areas of oil cell concentration. For example, analyzing slices of Magnolia officinalis can identify areas of dense oil cell distribution at a microscopic level.
[0085] The oil spot identification results are spatially aligned with the oil cell locations in the optical microscopy image. When multiple oil cells occupy more than half of the oil spot area, it is identified as an oil cell cluster. Through multi-scale and multi-method cross-validation, false positives are eliminated, ensuring the reliability of the identification results and providing an accurate basis for the quality assessment of traditional Chinese medicine.
[0086] Specifically, within an RGB image, the color histogram of the oil spot area is calculated, and its distribution characteristics in the RGB color space, such as average hue, saturation, and brightness, are statistically analyzed. Furthermore, the gray-level co-occurrence matrix (GLCM) is used to extract the texture characteristics of the oil spot, including parameters such as contrast, entropy, angular second moment, and correlation, to analyze the textural differences between the oil spot and the surrounding tissue. The analysis results provide quantitative color and texture indicators for the oil spot, which are used to preliminarily distinguish between oil spots and non-oil spots. The spectral curves of the oil spot and non-oil spot areas are compared to identify characteristic bands. For example, oily substances may exhibit distinct absorption peaks in the near-infrared spectrum at specific wavelengths, such as 1700-1800nm. Principal component analysis (PCA) is used to reduce the dimensionality of the spectral data, extract the main components, and determine the spectral feature vector of the oil spot. The resulting spectral feature vector 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, the distribution of oil cells is analyzed to generate judgment information, including:
[0089] The oil cells in the oil cell aggregation area were clearly displayed using the safranin-fast green double staining method, and the position information of the oil cells was re-determined using optical microscopic images;
[0090] The purpose of safranin-fast green double staining is to enhance the contrast between oil cells and surrounding tissues, make oil cells clearly visible in optical microscopic images, and re-determine the position information of oil cells, providing accurate spatial coordinate data for subsequent analysis, thereby facilitating subsequent analysis of cell distribution.
[0091] Based on the location information of oil cells and regional feature information, the Ripley's L function is used to analyze the degree of deviation 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 cluster area and counting the number of oil cells within different distance ranges around it, the Ripley's L function values corresponding to different distances are obtained. Regional feature information includes the number of oil cells.
[0092] Based on the accurate oil cell location information, the Ripley's L function is used for analysis. The oil cells are traversed and the number of cells within different distance ranges is counted 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 oil cells into quantifiable data.
[0093] The distribution pattern of oil cells was determined by the Ripley's L function value, so as to quantitatively analyze the differences in oil cell distribution among medicinal materials from different origins.
[0094] Based on the Ripley's L function values corresponding to different distances, it is determined whether the aggregation of oil cells in the oil cell aggregation area conforms to the Poisson distribution to generate judgment information.
[0095] Based on the Ripley's L function values corresponding to different distances, it is determined whether the oil cell aggregation in the oil cell aggregation area conforms to the Poisson distribution to generate judgment information. The judgment information includes the distribution result and the acid range, including:
[0096] Draw a distribution curve of Ripley'sL function value versus distance based on the Ripley'sL function value corresponding to different distances;
[0097] Preset the 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, a random distribution mark is generated, otherwise a regular distribution mark is generated; regular distribution includes clustered distribution and uniform distribution;
[0098] If a random distribution mark is generated, it is determined that the aggregation of oil cells in the oil cell aggregation area conforms to the Poisson distribution and is marked as the number one distribution result;
[0099] If a regular distribution mark is generated, it is determined that the aggregation of oil cells in the oil cell aggregation area does not conform to the Poisson distribution and is marked as a No. 2 distribution result;
[0100] Combine the results of distribution No. 1 and distribution No. 2 to generate a distribution result;
[0101] According to the origin information of the corresponding Chinese herbal medicine pieces to be tested, combined with the judgment information, the differences in the distribution of oil cells in the same type of Chinese herbal medicine pieces from different origins are distinguished;
[0102] According to the distribution batches of each production area in the historical period, the distribution of oil cells in the corresponding Chinese herbal medicine slices of each production area is analyzed in turn by random sampling to obtain the Ripley's L function value. Based on the Ripley's L function value corresponding to this batch, it is identified whether the distribution result of this batch is the same as the distribution result of the batch in the historical period. If different, a deterioration risk signal is generated.
[0103] In this example, the use of a safranin-fast green double staining method enables the clear display of oil cells within the oil cell aggregation area. Compared to traditional observation methods, the contrast of the cell structure after staining is significantly improved. The optical microscopic image is then used again to determine the location information of the oil cells, which is like marking the precise coordinates of each oil cell, laying a solid foundation for subsequent in-depth analysis. For example, when observing Magnolia officinalis slices, the distribution morphology of oil cells in the tissue can be clearly seen after staining, avoiding misjudgment due to unclear observation, and further improving the accuracy and reliability of the oil cell location information.
[0104] The Ripley's L function was used to analyze the distribution of oil cells. By traversing each oil cell within the oil cell cluster area and counting the number of oil cells within different distance ranges around it, the corresponding Ripley's L function values were obtained, enabling a quantitative study of oil cell distribution. Taking Aucklandia lappa slices from different origins as an example, the function calculations revealed that Aucklandia lappa oil cells from origin A exhibited a clustered distribution at a certain distance scale, while those from origin B were more closely distributed randomly. This accurately quantified the differences in oil cell distribution between medicinal materials from different origins, providing a scientific quantitative basis for the identification and quality assessment of traditional Chinese medicine origins. A distribution curve was plotted based on the Ripley's L function values, and confidence intervals were set to determine whether the oil cell aggregation conformed to a Poisson distribution, generating clear distribution results.
[0105] By combining origin information with historical batch data, the system can quickly identify abnormalities in the oil cell distribution of a batch of Chinese herbal medicine slices. For example, if the Ripley's L function curve for the oil cell distribution of a batch of Chinese angelica slices tested exceeded the confidence interval, generating a Type II distribution result that differed from the distribution results of historical batches from that origin, the system would generate a deterioration risk signal, promptly alerting the patient to potential quality issues, effectively preventing substandard slices from entering the market and ensuring the quality and safety of Chinese medicine.
[0106] Ripley's L function is a statistical tool commonly used for spatial point pattern analysis. It is widely used in many fields such as geography, ecology, and materials science. It can be used to analyze the distribution of oil cells in the quality inspection of traditional Chinese medicine.
[0107] Example 4
[0108] Please refer to Figure 1 Specifically: If the distribution results of this batch are different from the distribution results of historical batches, a spoilage risk signal is generated, including:
[0109] Randomly select the batches of Chinese herbal medicine slices to be tested corresponding to the deterioration risk signal as samples, crush and mix the selected samples respectively, and perform titration analysis on the crushed and mixed samples respectively to calculate the acid value and generate the acid range;
[0110] The acidity standards for different types of medicinal materials may vary greatly. For example, the Chinese Pharmacopoeia stipulates a specific upper limit for the acidity of certain oil-containing medicinal materials.
[0111] Titration analysis steps: Accurately weigh a certain amount of sample and place it in an Erlenmeyer flask. Add an appropriate amount of a neutral ethanol-ether mixture (generally a 1:1 ratio) and heat under reflux to dissolve the free fatty acids in the sample. After cooling, add phenolphthalein as an indicator and titrate with a known concentration of potassium hydroxide standard titrant. The endpoint is when the solution turns slightly red and does not fade within 30 seconds. Record the volume of potassium hydroxide standard titrant consumed.
[0112] The acid value is calculated based on the volume and concentration of the consumed potassium hydroxide standard titration solution and the mass of the sample;
[0113] According to the pharmacopoeia standard, the acid value upper limit of the sample is obtained, and based on the acid range, the average acid value of the sample is compared with the acid value upper limit. If the average acid value is greater than the acid value upper limit, the deterioration risk signal is a deterioration signal, and it is determined that the acid value of the current batch of Chinese herbal medicine slices exceeds the standard. If the average acid value is less than or equal to the acid value upper limit, the deterioration risk signal is a qualified signal, and it is determined that the acid value of the current batch of Chinese herbal medicine slices does not exceed the standard;
[0114] like Figure 3 As shown, tests 1 to 5 are corresponding test numbers. It can be seen from the figure that the average acid value at test 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 Chinese herbal medicine slices exceeds the standard.
[0115] The free fatty acid content of oils and fats is measured by titration, with the acid value expressed as the number of milligrams of potassium hydroxide required to neutralize 1 gram of free fatty acids in the oil and fat. A higher acid value indicates a more severe degree of oxidative rancidity in the oil and fat, a greater likelihood of developing a foul odor, and a potential risk of improper storage.
[0116] When the deterioration risk signal is a deterioration signal, a stop instruction is triggered, and the stop instruction is used to feedback the corresponding origin and stop the distribution of the corresponding Chinese herbal medicine slices.
[0117] When the deterioration risk signal is a qualified signal, a distribution instruction is triggered to supply the corresponding Chinese herbal medicine slices. After the corresponding Chinese herbal medicine slices are obtained, they are retested to generate pre-warehousing information, including:
[0118] Based on the distribution instruction, the corresponding Chinese herbal medicine pieces are obtained, and steps S1 and S2 are repeatedly performed on the corresponding Chinese herbal medicine pieces. After confirming that the distribution result in the determination information of the Chinese herbal medicine pieces matches the corresponding origin and the deterioration risk signal is a qualified signal, a storage instruction is generated;
[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 absorption information of the pre-warehousing samples in the near-infrared band, including the position and intensity of the characteristic absorption peaks of different fat and oil components;
[0120] After determining the position of the characteristic absorption peak, the intensity of the characteristic absorption peak is calculated. The peak height method (measuring the height of the characteristic peak apex 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 intensity of the characteristic absorption peak.
[0121] Soxhlet extraction was used to obtain the oil content of samples before storage;
[0122] The oil content and spectral data of the samples before storage are combined to generate pre-storage information.
[0123] Taking advantage of the fact 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. The residue obtained is the oil content.
[0124] During the storage and processing of traditional Chinese medicines, the distribution of oil content can change. Improper storage conditions can lead to oxidation and rancidity of the oil, which can alter the distribution of oil content. By monitoring the distribution of oil content, problems during storage and processing can be identified promptly, allowing appropriate measures to be taken to ensure the quality of traditional Chinese medicine.
[0125] The collected parameters are preprocessed and normalized. The preprocessed spectral data is normalized to a value between [0, 1]. This eliminates spectral intensity differences between samples due to differences in concentration, thickness, and other factors, facilitating 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, it is possible to keenly capture fluctuations in the quality of traditional Chinese medicine. If there is a difference, it indicates that the status of the Chinese herbal medicine slices distributed in this batch is different from the previous one, and there may be risks. A deterioration risk signal is generated, and samples are randomly taken for titration analysis to obtain the acid value. Taking a batch of angelica slices as an example, if the distribution results of this batch are different from those of the historical batches, a deterioration risk signal is generated. After random sampling and titration analysis, the average acid value exceeds the upper limit of the acid value specified in the pharmacopoeia, and the acid value of the batch is determined to be excessive, triggering a termination instruction. The logic behind this is that historical data reflects the conventional quality status of traditional Chinese medicine, and abnormal fluctuations indicate potential quality problems. Acid value detection is then performed to preliminarily determine the risk of deterioration.
[0127] When a qualified signal is determined, the distribution instruction is triggered and the Chinese herbal medicine slices are still tested for a second time. Repeat steps S1 and S2 to confirm that the distribution results match the origin characteristics. Then, combine the near-infrared spectrometer to obtain spectral data and Soxhlet extraction to determine the oil content. For example, when testing a batch of Chuanxiong slices again, the oil content is determined by a near-infrared spectrometer. This ensures that the quality meets the standards while providing basic analysis parameters for the subsequent storage process and generating storage instructions. This process is based on the origin characteristics and supplemented by spectral and component testing to form a double verification mechanism to ensure the quality of Chinese medicine entering the market.
[0128] Titration analysis is based on the production of free fatty acids from oil oxidation, and the acid value is calculated through neutralization titration. The Soxhlet extraction method achieves oil quantification based on the property that fat is easily soluble in organic solvents. By following the pharmacopoeia standards, the test results are ensured to be credible, providing solid data support for the quality determination of traditional Chinese medicine and effectively avoiding the risk of inferior traditional Chinese medicine entering the market.
[0129] Specifically, the oil cell aggregation areas of Chinese medicinal materials from different origins and growth environments will also be different. For example, authentic medicinal materials usually have unique appearance and internal quality characteristics, and the characteristics of their oil cell aggregation areas may be more typical. Taking angelica as an example, the authentic angelica produced in Minxian County, Gansu Province and other places has obvious oil cell aggregation areas on the skin of its medicinal pieces, and large and numerous secretory cavities, which is closely related to the local suitable climate, soil and other growth environments. By analyzing the oil cell aggregation area, it is possible to determine the origin of the medicinal material to a certain extent and evaluate whether it is an authentic medicinal material, thereby providing a reference for the quality control of traditional Chinese medicine.
[0130] Among them, during the oxidation and 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 the original chemical composition of the oils and fats to change, resulting in a relative decrease in the overall oil and fat content.
[0131] Example 5
[0132] Please refer to Figure 1 Specifically: When the deterioration risk signal is a qualified signal, a distribution instruction is triggered to supply the corresponding Chinese herbal medicine slices. After obtaining the corresponding Chinese herbal medicine slices, the Chinese herbal medicine slices are re-tested and the storage information is generated, including:
[0133] Put the Chinese herbal medicine pieces into storage and store them, set the detection time, and perform oil content and spectral data detection on the Chinese herbal medicine pieces during storage again to generate post-storage information.
[0134] Compare pre-warehousing information with post-warehousing information to obtain comparative information, including:
[0135] By using the information before and after storage, the difference values of the position and intensity 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, are calculated to generate comparative information;
[0136] The features in the comparison information are weighted and fused to obtain the storage anomaly evaluation index. If the storage anomaly evaluation index exceeds the preset threshold, a warning signal is triggered, prompting you to adjust the storage method.
[0137] If the storage anomaly assessment indicator 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 detection of the Chinese herbal medicine slices in the storage process are performed again to generate the information after storage, and compared with the information before storage, the quality changes of the Chinese herbal medicine slices during storage can be grasped in real time. For example, for a batch of angelica slices stored in the warehouse, it is set to be tested once every 3 months. In the test after 6 months of storage, it was found that the oil content had also decreased after storage. By obtaining this change information in a timely manner, measures can be taken before the quality of the Chinese herbal medicine slices deteriorates significantly, avoiding economic losses and medication risks caused by quality problems.
[0139] The differences in the positions and intensities of the characteristic absorption peaks of fat and oil components before and after storage, as well as the differences in oil content, were calculated and quantified as comparative information, providing concrete data support for changes in the quality of Chinese herbal medicine pieces. Taking a batch of stored agarwood pieces as an example, testing and calculation revealed that the position of their carbonyl stretching vibration peak shifted after storage, and both their intensity and oil content decreased. These specific quantitative data can intuitively reflect the degree of quality change of agarwood pieces during storage, making quality assessment more accurate.
[0140] The features in the comparison information are weighted and fused to obtain a storage anomaly assessment index. Based on the comparison result between the index and the preset threshold, an intelligent judgment is made as to whether a warning signal is triggered. If the storage anomaly assessment index exceeds the preset threshold, a warning signal is triggered, prompting the user to adjust the storage method, thus realizing an intelligent process from data detection to risk warning. For example, after a batch of dried tangerine peel slices has been stored for a period of time, its storage anomaly assessment index is calculated to exceed the preset threshold, and the system triggers a warning signal. According to the prompt, the staff promptly adjusted the storage environment, changing the originally high humidity storage environment to a dry environment suitable for the preservation of dried tangerine peel, effectively preventing the dried tangerine peel from mildewing, oil oxidation and other quality problems due to moisture, extending the shelf life of Chinese herbal medicine slices, and ensuring the stability of the quality of Chinese herbal medicine slices during storage.
[0141] Example 6
[0142] Please refer to Figure 4 Specifically: A deep learning-based intelligent detection system for traditional Chinese medicine quality, including:
[0143] The identification module is used to pre-determine the source of the TCM pieces to be tested, and use an ultrasonic detector to preliminarily detect structural defects in the TCM pieces to be tested. Structural defects include voids and cracks. If they are not present, a high-resolution industrial camera and a multispectral imager are used to collect RGB images from multiple angles and spectral images of different bands of the TCM pieces to be tested. Based on the RGB images and spectral images of different bands, the oil cell aggregation area is identified;
[0144] The first detection module is used to analyze the distribution of oil cells according to the oil cell aggregation area and generate judgment information. The judgment information is used to reflect the abnormality of the Chinese herbal medicine pieces to be tested distributed from the corresponding production area in the current batch, including the distribution result and the acid range. Based on the distribution result, a deterioration risk signal is generated;
[0145] The second detection module is used to trigger a stop 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 medicine slices. After obtaining the corresponding Chinese herbal medicine slices, the Chinese herbal medicine slices are re-tested to generate pre-warehousing information and post-warehousing information;
[0146] The third detection module is used to determine whether a warning signal is triggered based on pre-warehousing information and post-warehousing information combined with the back propagation algorithm in deep learning.
[0147] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to these embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the appended claims and their equivalents.
Claims
1. A method for intelligent detection of traditional Chinese medicine quality based on deep learning, characterized by: The following steps are included: S1: Determine the source of the TCM pieces to be tested in advance, and use an ultrasonic detector to preliminarily detect structural defects in the TCM pieces to be tested. Structural defects include voids and cracks. If they do not exist, use a high-resolution industrial camera and a multispectral imager to collect RGB images from multiple angles and spectral images of different bands of the TCM pieces to be tested. Based on the RGB images and spectral images of different bands, identify the oil cell aggregation area; S2: Analyze the distribution of oil cells based on the oil cell aggregation area and generate judgment information. The judgment information is used to reflect the abnormality of the Chinese herbal medicine pieces to be tested distributed from the corresponding production area in the current batch, including the distribution results and acid range. Based on the distribution results, a deterioration risk signal is generated; S3: When the deterioration risk signal is a deterioration signal, a stop instruction is triggered. When the deterioration risk signal is a qualified signal, a distribution instruction is triggered to supply the corresponding Chinese herbal medicine slices. After the corresponding Chinese herbal medicine slices are obtained, the Chinese herbal medicine slices are retested to generate pre-warehousing information and post-warehousing information; S4: Generate comparative information based on the information before and after storage, and combine it with the back propagation algorithm in deep learning to determine whether a warning signal is triggered.
2. The method for intelligent detection of Chinese medicine quality based on deep learning according to claim 1, characterized in that: Use high-resolution industrial cameras and multispectral imagers to collect RGB images from multiple angles and spectral images of different bands of the Chinese herbal medicines to be tested; Based on the collected RGB image, the color histogram of the RGB image is calculated, and the texture features of the gray-level co-occurrence matrix are extracted to preliminarily distinguish the oil spot area from the non-oil spot area. Combined with the spectral image, the spectral curves of the oil spot area and the non-oil spot area are compared. The principal component analysis method is used to determine the spectral feature vector of the oil spot. The color histogram and spectral image are input into the U-Net network model to perform end-to-end training of the image input model. The oil spot probability map is output and binarized. The oil spot color and spectral features are used to set the threshold segmentation to generate the oil spot recognition result. The oil spot recognition result is used to reflect the identified oil spot area.
3. The method for intelligent detection of Chinese medicine quality based on deep learning according to claim 2, characterized in that: Identify oil cell aggregation areas based on RGB images and spectral images of different bands, including: Prepare slices of the Chinese herbal medicine to be tested in advance and take microscopic images using an optical microscope and an electron microscope; In optical microscopy images, the YOLOv5 deep learning object detection algorithm is used to identify the outline and location of oil cells; In electron microscopic images, a watershed algorithm is used to separate oil cells, obtain boundaries, count the number of oil cells per unit area, and calculate their density. The density threshold is set according to the characteristics of the medicinal material to preliminarily screen out the oil cell aggregation area; The final oil cell aggregation area is identified in the initially screened oil cell aggregation areas by spatially aligning the oil spot identification results with the oil cell positions in the optical microscope image. If multiple oil cells are present in the corresponding oil spot area and occupy more than half of the oil spot area, the oil spot area is determined to be an oil cell aggregation area. Obtain regional feature information from oil cell aggregation areas.
4. The method for intelligent detection of Chinese medicine quality based on deep learning according to claim 3, characterized in that: According to the oil cell aggregation area, the distribution of oil cells is analyzed to generate judgment information, including: The oil cells in the oil cell aggregation area were clearly displayed using the safranin-fast green double staining method, and the position information of the oil cells was re-determined using optical microscopic images; Based on the location information of oil cells and regional feature information, the Ripley's L function is used to analyze the degree of deviation of the distribution of oil cells from the Poisson distribution at different distance scales. By traversing each oil cell in the oil cell cluster area and counting the number of oil cells within different distance ranges around it, the Ripley's L function values corresponding to different distances are obtained. Based on the Ripley's L function values corresponding to different distances, it is determined whether the aggregation of oil cells in the oil cell aggregation area conforms to the Poisson distribution to generate judgment information.
5. The method for intelligent detection of 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, it is determined whether the oil cell aggregation in the oil cell aggregation area conforms to the Poisson distribution to generate judgment information. The judgment information includes the distribution result and the acid range, including: Draw a distribution curve of Ripley'sL function value versus distance based on the Ripley'sL function value corresponding to different distances; Preset the 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 into the confidence interval, a random distribution mark is generated, otherwise a regular distribution mark is generated. If a random distribution mark is generated, it is determined that the aggregation of oil cells in the oil cell aggregation area conforms to the Poisson distribution and is marked as the number one distribution result; If a regular distribution mark is generated, it is determined that the aggregation of oil cells in the oil cell aggregation area does not conform to the Poisson distribution and is marked as a No. 2 distribution result; Combine the results of distribution No. 1 and distribution No. 2 to generate a distribution result; According to the origin information of the corresponding Chinese herbal medicine pieces to be tested, combined with the judgment information, the differences in the distribution of oil cells in the same type of Chinese herbal medicine pieces from different origins are distinguished; According to the distribution batches of each production area in the historical period, the distribution of oil cells in the corresponding Chinese herbal medicine slices of each production area is analyzed in turn by random sampling to obtain the Ripley's L function value. Based on the Ripley's L function value corresponding to this batch, it is identified whether the distribution result of this batch is the same as the distribution result of the batch in the historical period. If different, a deterioration risk signal is generated.
6. The method for intelligent detection of Chinese medicine quality based on deep learning according to claim 5, characterized in that: If the distribution results of the current batch are different from those of the historical batches, a spoilage risk signal is generated, including: Randomly select the batches of Chinese herbal medicine slices to be tested corresponding to the deterioration risk signal as samples, crush and mix the selected samples respectively, and perform titration analysis on the crushed and mixed samples respectively to calculate the acid value and generate the acid range; According to the pharmacopoeia standard, the acid value upper limit of the sample is obtained, and based on the acid range, the average acid value of the sample is compared with the acid value upper limit. If the average acid value is greater than the acid value upper limit, the deterioration risk signal is a deterioration signal, and it is determined that the acid value of the current batch of Chinese herbal medicine slices exceeds the standard. If the average acid value is less than or equal to the acid value upper limit, the deterioration risk signal is a qualified signal, and it is determined that the acid value of the current batch of Chinese herbal medicine slices does not exceed the standard; When the deterioration risk signal is a deterioration signal, a stop instruction is triggered, and the stop instruction is used to feedback the corresponding origin and stop the distribution of the corresponding Chinese herbal medicine slices.
7. The method for intelligent detection of Chinese medicine quality based on deep learning according to claim 6, characterized in that: When the deterioration risk signal is a qualified signal, a distribution instruction is triggered to supply the corresponding Chinese herbal medicine slices. After the corresponding Chinese herbal medicine slices are obtained, they are retested to generate pre-warehousing information, including: Based on the distribution instruction, the corresponding Chinese herbal medicine pieces are obtained, and steps S1 and S2 are repeatedly performed on the corresponding Chinese herbal medicine pieces. After confirming that the distribution result in the determination information of the Chinese herbal medicine pieces matches the corresponding origin and the deterioration risk signal is a qualified signal, a storage instruction is generated; 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 absorption information of the pre-warehousing samples in the near-infrared band, including the position and intensity of the characteristic absorption peaks of different fat and oil components; Soxhlet extraction is used. Taking advantage of the fact that fat is soluble in organic solvents, the pre-storage sample is continuously refluxed with anhydrous ether to extract the fat in the pre-storage sample. The anhydrous ether is then evaporated to dryness to obtain the residue, which is the oil content. The oil content and spectral data of the samples before storage are combined to generate pre-storage information.
8. The method for intelligent detection of Chinese medicine quality based on deep learning according to claim 7, characterized in that: When the deterioration risk signal is a qualified signal, a distribution instruction is triggered to supply the corresponding Chinese herbal medicine slices. After the corresponding Chinese herbal medicine slices are obtained, they are retested and the post-warehousing information is generated, including: Put the Chinese herbal medicine pieces into storage and store them, set the detection time, and perform oil content and spectral data detection on the Chinese herbal medicine pieces during storage again to generate post-storage information.
9. The method for intelligent detection of Chinese medicine quality based on deep learning according to claim 8, characterized in that: Compare pre-warehousing information with post-warehousing information to obtain comparative information, including: By using the information before and after storage, the difference values of the position and intensity 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, are calculated to generate comparative information; The features in the comparison information are weighted and fused to obtain the storage anomaly evaluation index. If the storage anomaly evaluation index exceeds the preset threshold, a warning signal is triggered, prompting you to adjust the storage method.
10. A deep learning-based intelligent detection system for Chinese medicine quality, used to implement the deep learning-based intelligent detection method for Chinese medicine quality according to any one of claims 1 to 9, characterized in that: include: The identification module is used to pre-determine the source of the TCM pieces to be tested, and use an ultrasonic detector to preliminarily detect structural defects in the TCM pieces to be tested. Structural defects include voids and cracks. If they are not present, a high-resolution industrial camera and a multispectral imager are used to collect RGB images from multiple angles and spectral images of different bands of the TCM pieces to be tested. Based on the RGB images and spectral images of different bands, the oil cell aggregation area is identified; The first detection module is used to analyze the distribution of oil cells according to the oil cell aggregation area and generate judgment information. The judgment information is used to reflect the abnormality of the Chinese herbal medicine pieces to be tested distributed from the corresponding production area in the current batch, including the distribution result and the acid range. Based on the distribution result, a deterioration risk signal is generated; The second detection module is used to trigger a stop 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 medicine slices. After obtaining the corresponding Chinese herbal medicine slices, the Chinese herbal medicine slices are re-tested to generate pre-warehousing information and post-warehousing information; The third detection module is used to determine whether a warning signal is triggered based on pre-warehousing information and post-warehousing information combined with the back propagation 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