Traditional Chinese medicine material trait identification method and system based on deep learning and microscopic image analysis
By using deep learning and microscopic image analysis technology, the processing of Chinese medicinal materials is dynamically monitored, and changes in microstructure are identified and evaluated. This solves the problem that it is difficult to accurately determine the degree of carbonization inside Chinese medicinal materials in existing technologies, and achieves precise control of the endpoint of processing Chinese medicinal materials.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HUBEI JURUI BIOTECHNOLOGY CO LTD
- Filing Date
- 2025-12-29
- Publication Date
- 2026-08-04
AI Technical Summary
In the processing of Chinese medicinal materials, existing technologies rely on manual experience or macroscopic images to make it difficult to accurately assess the degree of carbonization inside the medicinal materials, resulting in inconsistent quality. Furthermore, microscopic analysis technology lacks dynamic evaluation methods and cannot accurately determine the end point of processing.
A method based on deep learning and microscopic image analysis is adopted to acquire images of the Chinese medicinal materials processing process at preset time intervals, perform white balance correction and brightness normalization, use U-Net segmentation network to identify key microscopic structural regions, calculate the microscopic edge roughness entropy and its rate of change, and construct the critical discrimination coefficient of processing by combining color features to realize dynamic monitoring of the processing endpoint.
It improves the accuracy and objectivity of the processing of Chinese medicinal materials, reduces under- or over-processing caused by macroscopic color lag or human experience, and enhances quality consistency and process stability.
Smart Images

Figure CN121811400B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology. More specifically, this invention relates to a method and system for identifying the characteristics of traditional Chinese medicinal materials based on deep learning and microscopic image analysis. Background Technology
[0002] In the field of traditional Chinese medicine (TCM) manufacturing and quality control, the processing of medicinal materials is a core step in ensuring efficacy and medication safety. In particular, the traditional charring process requires the surface of the medicinal materials to be carbonized at high temperatures to enhance hemostatic effects, while simultaneously retaining some of the active ingredients internally and preventing complete ash formation. This process demands precise control over heat and time, which is crucial to the clinical efficacy of the finished product and represents a key challenge in the modernization of TCM.
[0003] Currently, the industry mainly relies on human experience or basic machine vision technology to determine the degree of processing. Traditional manual methods rely on pharmacists to observe color or distinguish odor, which has the drawbacks of strong subjectivity and difficulty in standardization. Existing automated equipment mainly collects macroscopic images of the surface of medicinal materials and uses color thresholds to determine whether the carbonization standard has been met.
[0004] However, the aforementioned existing technologies still have shortcomings in practical applications. On the one hand, the color change on the surface of medicinal materials often lags behind the pyrolysis changes of the internal tissues, and medicinal materials of different textures are prone to the phenomenon of blackening on the outside and charring on the inside or blackening on the outside and burning on the inside. Relying on macroscopic images cannot reveal the degree of carbonization of microscopic tissues, resulting in insufficient accuracy in defining the nature of the material and making it difficult to ensure the consistency of quality between batches. On the other hand, existing microscopic analysis techniques are mostly used for static identification of the authenticity of varieties, lacking assessment methods for the dynamic evolution of microstructures during processing, and unable to establish a mathematical mapping between microscopic morphological changes such as cell wall disintegration or starch granule gelatinization and the processing endpoint. In addition, general image processing algorithms have limited feature extraction capabilities when faced with complex microscopic backgrounds such as Chinese medicine powders or slices containing noise and adhesion, making it difficult to achieve automated discrimination. Summary of the Invention
[0005] To address the aforementioned technical problem of inaccurate determination of the processing endpoint, the present invention provides solutions in the following aspects.
[0006] In a first aspect, the present invention provides a method for identifying the morphological characteristics of traditional Chinese medicinal materials based on deep learning and microscopic image analysis, comprising: Original images of the Chinese medicinal materials during the processing are acquired at preset time intervals to form a microscopic image sequence. White balance correction and brightness normalization are performed on the original images at each moment in the microscopic image sequence to obtain the standard input image for each moment. The standard input image at each moment is then input into a pre-trained U-Net segmentation network to identify and segment key microscopic structural regions in the standard input image, and outputs the corresponding binarized mask image. Based on the morphological characteristics and degree of change of the binarized mask image within the key microscopic structural regions at each moment, the microscopic edge roughness entropy at each moment is calculated. The real-time change rate of the microscopic edge roughness entropy at each moment is calculated, and the critical discrimination coefficient for processing at each moment is constructed by combining the color features within the key microscopic structural regions. When the critical discrimination coefficient for processing meets the preset stopping condition, a processing endpoint control command is issued.
[0007] This invention acquires a sequence of microscopic images of Chinese medicinal materials during the processing at preset time intervals, and performs white balance correction and brightness normalization on the images to reduce environmental interference caused by light source fluctuations. Furthermore, it utilizes a deep learning network to identify and segment key microstructural regions, enabling the location of microscopic tissues undergoing qualitative changes, such as stone cells or vessels, from complex backgrounds, thus eliminating impurity interference. Based on this, the invention calculates the microscopic edge roughness entropy and its real-time change rate, and combines this with color features to obtain the critical discrimination coefficient for processing. It evaluates the evolution of the microscopic morphology of medicinal materials from intact to disintegrated, as well as the color fading process. By monitoring whether the critical discrimination coefficient for processing meets preset stopping conditions, it can capture the critical point of the medicinal material's external blackening and internal growth or carbonization, reducing under- or over-processing caused by macroscopic color lag or subjective human experience. This improves the accuracy and objectivity of the identification of Chinese medicinal material properties in the monitoring of the processing process, and achieves dynamic intelligent monitoring of the processing temperature.
[0008] Preferably, the step of acquiring original images of the Chinese medicinal materials during the processing at preset time intervals, forming a microscopic image sequence, and performing white balance correction and brightness normalization on the original images at each moment in the microscopic image sequence to obtain the standard input image at each moment includes: Using a microscope equipped with a CCD camera, original images of Chinese medicinal materials during the processing are continuously acquired at preset time intervals to form a microscopic image sequence. The original images at each moment in the microscopic image sequence are processed using the grayscale world algorithm and brightness normalization to obtain the standard input image at each moment.
[0009] Preferably, the step of inputting the standard input image at each time step into a pre-trained U-Net segmentation network, identifying and segmenting key microstructure regions in the standard input image, and outputting a binarized mask image at the corresponding time step includes: A U-Net segmentation network integrating a convolutional block attention module is pre-trained; standard input images at each time step are input into the U-Net segmentation network; the U-Net segmentation network performs pixel-by-pixel classification on the standard input images, distinguishing key microstructure regions from background regions; the U-Net segmentation network finally outputs a binary mask image, in which pixels belonging to key microstructure regions are marked as 1, and pixels in the background region are marked as 0.
[0010] This invention processes standard input images by pre-training a U-Net segmentation network that integrates a convolutional block attention module. It utilizes the attention mechanism to adaptively weight features in the channel and spatial dimensions, which can simulate the focusing characteristics of human vision. This allows the network to focus more on key microstructural regions and suppress background noise when extracting features, thereby reducing the missegmentation phenomenon caused by edge blurring or gray-level crossover in traditional threshold segmentation algorithms and improving the accuracy of binarized mask generation.
[0011] Preferably, the acquisition of the microscopic edge roughness entropy includes: Obtain the contour morphological complexity of key microstructural regions at the current moment; Obtain the logarithmic gain factor of the edge mean gradient change within the key microstructural region at the current moment; The microscopic edge roughness entropy at the current moment is obtained by adding the contour morphology complexity and the logarithmic gain factor.
[0012] Preferably, obtaining the contour morphological complexity of the key microstructure region at the current moment includes: Based on the binarized mask image of the key microstructure region at the current moment, the total area and total perimeter of the key microstructure region are obtained by pixel statistics method; The contour morphology complexity of the key microstructure region at the current moment is obtained by dividing the square of the total perimeter of the key microstructure region by four times pi and the product of the total area and the preset infinitesimal value.
[0013] This invention calculates the contour morphology complexity based on a binary mask image of the key microstructural region at the current moment. By multiplying the square of the total perimeter by four times pi and the sum of the total area and preset minute values, it can assess the degree of physical deformation of the medicinal material's microstructure during heating. As the processing temperature increases, microstructures such as cell walls will undergo dehydration, curling, or even bursting, resulting in changes in the perimeter-to-area ratio. By capturing this evolution of contour morphology complexity, this invention can transform the physical disintegration process into a calculable numerical index, thereby assisting in determining whether the medicinal material has reached the required degree of microstructural qualitative change for preservation.
[0014] Preferably, the step of obtaining the logarithmic gain factor of the edge mean gradient change within the key microstructural region at the current moment includes: Canny edge detection is performed on the key microstructure region to obtain the gradient magnitude of the pixels in the key microstructure region, and the arithmetic mean of all extracted gradient magnitudes is calculated to obtain the average edge gradient of the key microstructure region at the current time. Calculate 1 plus the ratio of the current edge average gradient to the initial edge average gradient baseline value, and take the natural logarithm to obtain the logarithmic gain factor of the edge average gradient change in the key microstructure region at the current time.
[0015] This invention performs Canny edge detection on key microstructural regions and calculates the average edge gradient. It further obtains the logarithmic gain factor of the average edge gradient change, reflecting the cumulative change in the surface roughness of medicinal materials. Since microcracks or charred particles appear on the surface of medicinal materials during carbonization, leading to an increase in image gradient amplitude, this invention uses logarithmic operations to evaluate the growth rate of the current gradient relative to the initial baseline. This not only smooths numerical fluctuations but also highlights the trend of texture changes, thereby revealing the gradual process of medicinal materials transforming from raw to carbonized products and enhancing the sensitivity of micro-edge roughness entropy to the degree of processing.
[0016] Preferably, the acquisition of the critical discrimination coefficient for processing includes: Set a morphological weighting factor, calculate the sum of the square of the difference between the red channel mean at the initial time and the current time and the square of the difference between the saturation mean at the initial time and the current time, divide the arithmetic square root of the sum of the two by the maximum gray level of the 8-bit image depth, and multiply by 1 minus the difference obtained by the morphological weighting factor; finally, add the product of the morphological weighting factor and the absolute value of the rate of change of rough entropy to obtain the critical discrimination coefficient of the current time.
[0017] This invention calculates the critical discrimination coefficient for processing, which can simultaneously take into account the decay of macroscopic color and the abrupt change characteristics of microstructure. The changes in red channel and saturation reflect the evolution of carbonization color on the surface of medicinal materials, while the rate of change of roughness entropy reflects the disintegration rate of internal microstructure. Thus, it can dynamically adjust the contribution ratio of morphology and color for medicinal materials of different textures, reduce the risk of misjudgment such as black on the outside and raw inside or black on the outside and burnt inside that is easy to make by relying solely on color judgment, and improve the comprehensiveness and robustness of the determination of the end point of processing Chinese medicinal materials.
[0018] Preferably, obtaining the rough entropy change rate includes: The difference between the current micro-edge roughness entropy and the previous micro-edge roughness entropy is calculated to obtain the rate of change of roughness entropy.
[0019] Preferably, the step of issuing a processing endpoint control command when the critical discrimination coefficient of processing meets the preset stop condition includes: Set a preset stop condition: Set a judgment threshold; Compare the critical discrimination coefficient of processing at any time with the judgment threshold: If the critical discrimination coefficient of processing is less than the judgment threshold, it is determined that the Chinese medicinal material has not reached the processing endpoint, and the current heating power is maintained to continue processing; If the critical discrimination coefficient of processing is greater than or equal to the judgment threshold, or when the critical discrimination coefficient of processing shows a trend of changing from rising to falling, the preset stop condition is triggered, it is determined that the Chinese medicinal material has reached the optimal processing endpoint, and a processing endpoint control command is issued to stop heating or start the discharge device.
[0020] Secondly, the present invention provides a system for identifying the characteristics of Chinese medicinal materials based on deep learning and microscopic image analysis, including a processor and a memory. The memory stores computer program instructions, and when the computer program instructions are executed by the processor, the above-mentioned method for identifying the characteristics of Chinese medicinal materials based on deep learning and microscopic image analysis is implemented.
[0021] By adopting the above technical solution, the above-mentioned method for identifying the characteristics of Chinese medicinal materials based on deep learning and microscopic image analysis is generated into a computer program and stored in a memory so that it can be loaded and executed by a processor. In this way, a terminal device can be made based on the memory and processor for convenient use.
[0022] The beneficial effects of this invention are as follows: By utilizing deep learning and microscopic image analysis technology, this invention enables online monitoring of the entire processing process of traditional Chinese medicine (TCM) materials. Addressing the challenges of background adhesion and complex textures in TCM powders or slices under microscopic conditions, it employs a U-Net segmentation network with an integrated attention mechanism to accurately extract key microstructural regions. Based on this, it evaluates the evolution trend of microscopic edge roughness entropy and the attenuation of macroscopic color features. By flexibly adjusting the proportions of microstructural disintegration and macroscopic color changes in the identification system using morphological weighting factors, it can address the process challenges of asynchronous color change and degradation of different textures of medicinal materials, such as rhizomes and leaves, during heating. This provides an adaptive discrimination criterion for hard medicinal materials with the risk of external blackening and internal growth, or for rapidly changing thin-walled medicinal materials. Combined with the real-time change rate of the discrimination coefficient and the threshold determination mechanism, this invention can promptly issue control commands at the critical moment when the microstructure of the medicinal material undergoes a qualitative change, reducing quality fluctuations caused by subjective experience differences or surface artifacts in traditional methods, and improving the scientific accuracy and process stability of TCM processing endpoint determination. Attached Figure Description
[0023] Figure 1 This is a flowchart illustrating the method for identifying the properties of Chinese medicinal materials based on deep learning and microscopic image analysis in this invention; Figure 2It is a schematic diagram illustrating the dynamic monitoring effect of the change of microscopic edge roughness entropy with processing time; Figure 3 It is a clustering diagram that schematically illustrates the spatial distribution of microscopic features in the processing method; Figure 4 This diagram schematically illustrates the comparison between the monitoring sensitivity of the method of the present invention and the prior art. Detailed Implementation
[0024] This invention discloses a method for identifying the morphological properties of traditional Chinese medicinal materials based on deep learning and microscopic image analysis, referring to... Figure 1 This includes steps S100-S400: S100. Acquire original images of Chinese medicinal materials during the processing according to preset time intervals, form a microscopic image sequence, perform white balance correction and brightness normalization on the original images at each moment in the microscopic image sequence, and obtain the standard input image at each moment.
[0025] It should be noted that, due to the influence of voltage on the light source during long-term operation of the microscope, there may be slight disturbances in light intensity and color temperature. The color presented in the original image may have a non-essential deviation from the actual medicinal material. Considering that the color evolution from yellow to charred during the processing of Chinese medicinal materials is an intuitive physical basis for judging the degree of processing, and that the subsequent feature extraction process requires a high degree of consistency in the lighting environment, this invention performs a white balance correction algorithm on the microscopic image sequence to restore the essential color of the medicinal material tissue, and performs brightness normalization processing to map the grayscale mean of the image to a fixed range, thereby reducing the difference in image brightness caused by the flicker of the light source intensity.
[0026] Specifically, using a microscope equipped with a CCD camera, original images of the Chinese medicinal materials during the processing are continuously acquired at preset time intervals to form a microscopic image sequence. For the original images at each moment in the microscopic image sequence, a white balance correction algorithm is executed to adjust the color temperature of the images to a standard white reference. Furthermore, the original images at each moment are converted into grayscale images, and brightness normalization processing is performed to stretch the grayscale mean of the images to a fixed range, thus obtaining the standard input images at each moment.
[0027] For example, the time interval is 30 seconds, and the white balance correction algorithm is the grayscale world algorithm, which is existing technology and will not be described in detail here.
[0028] At this point, the standard input images for each moment in the microscopic image sequence are obtained.
[0029] S200: Input the standard input images at each time step into the pre-trained U-Net segmentation network, identify and segment the key microstructure regions in the standard input images, and output the corresponding binarized mask images at each time step.
[0030] It should be noted that, since Chinese medicinal powders or slices often contain background interference such as bubbles or impurities under a microscope, and during continuous heating, the morphological structure of medicinal tissues such as stone cells or starch granules will expand or contract and deform, making it difficult to determine the geometric boundaries; considering that convolutional neural networks have the ability to extract features of non-rigid objects, especially the attention mechanism can simulate the visual characteristics of the human eye focusing on high-value areas, this invention introduces a U-Net segmentation network that integrates a convolutional block attention module; the U-Net segmentation network can suppress the weight of background noise in microscopic images, automatically focus and segment key microstructural regions, and generate a binary mask image.
[0031] Specifically, a U-Net segmentation network integrating a convolutional block attention module is pre-trained; standard input images at each time step are input into the U-Net segmentation network; the U-Net segmentation network performs pixel-by-pixel classification on the standard input images, distinguishing key microstructure regions from background regions; the U-Net segmentation network finally outputs a binary mask image, in which pixels belonging to key microstructure regions are marked as 1, and pixels in the background region are marked as 0.
[0032] Thus, the binarized mask images for each moment in the microscopic image sequence were obtained.
[0033] S300. Based on the morphological characteristics and degree of change of the binarized mask image in the key microstructural region at each time step, calculate the micro-edge roughness entropy at each time step.
[0034] It should be noted that during the charring process, Chinese medicinal materials not only undergo color deepening but also experience qualitative changes such as cell wall dehydration and disintegration, and surface cracking. Considering that the drastic changes in pixel edge gradients can reflect the degree of surface breakage and roughness, and that the morphological features of key microstructural regions characterize the irregularity of shape, this invention constructs a micro-edge roughness entropy by integrating the morphological features and the degree of change of key microstructural regions, thus characterizing the physical state of the evolution of the microstructure of Chinese medicinal materials from complete and rounded to dry and broken.
[0035] Specifically, based on the morphological characteristics and degree of change of the binarized mask image within the key microstructural region, the microscopic edge roughness entropy at each time step in the microscopic image sequence is calculated, including: Based on a binary mask image, the total area and total perimeter of key microstructural regions are obtained using a computer vision algorithm. For example, the computer vision algorithm is a pixel-based statistical method, which is existing technology and will not be elaborated upon here.
[0036] Edge detection is performed on key microstructural regions to obtain the gradient magnitude of pixels in these regions. The arithmetic mean of all extracted gradient magnitudes is then calculated to obtain the average edge gradient. For example, the edge detection method used is Canny edge detection, which is existing technology and will not be elaborated upon here.
[0037] Current moment The microscopic edge roughness entropy satisfies the following relationship: ; In the formula, Indicates the current time Microscopic edge roughness entropy; Indicates the current time The total perimeter of key microstructural regions; Represents pi; Indicates the current time The total area of key microstructural regions; This represents a preset microvalue to prevent the denominator from being 0; it can be set to 0.001. Indicates the current time The average gradient at the edge of the key microstructural region; This represents the baseline value of the edge average gradient of the key microstructure region at the initial moment. It is the natural logarithm function.
[0038] In this relation, The complexity of the outline morphology of key microstructural regions is indicated. The greater the complexity of the outline morphology, the more irregular jagged edges or curling appear, reflecting the severe degree of cell rupture after the Chinese medicinal material is heated. Conversely, the less complex the outline morphology, the more intact the cell structure of the Chinese medicinal material is and the surface is rounded. This indicates the relative growth of the marginal average gradient; The logarithmic gain factor represents the average gradient change at the edges within a key microstructural region. A larger logarithmic gain factor indicates a more significant cumulative effect of texture changes; conversely, a smaller logarithmic gain factor indicates a smoother texture change.
[0039] For example, suppose at the current moment The total perimeter of the key microstructural region was measured. Pixels, total area Pixels, set preset micro values Pi Simultaneously, the marginal average gradient at the current time is measured. Initial marginal average gradient benchmark value Then the microscopic edge roughness entropy at that moment is: .
[0040] For example, such as Figure 2 This is a dynamic monitoring graph showing the change of micro-edge roughness entropy with processing time. It demonstrates the dynamic change of micro-edge roughness entropy with processing time, and the curve shows a typical S-shaped nonlinear upward trend, reflecting the physical process of cell structure disintegration due to heat.
[0041] For example, such as Figure 3 This is a clustering effect diagram of the spatial distribution of microscopic features during the processing. The raw sample group is concentrated in the lower right corner, showing complete structure and small changes in texture gradient. As the processing progresses, the raw samples migrate to the upper left along the processing evolution path indicated by the gray arrow. The genuine sample group is located in the middle area of the path, where the microstructure has undergone moderate physical deformation and the surface texture features have been enhanced, corresponding to the optimal state of preservation. The charred sample group is clustered in the upper left corner, where the integrity of the microstructure is low, indicating that the cell wall has severely disintegrated and the gray gradient change rate has reached its peak.
[0042] Thus, the microscopic edge roughness entropy at each moment in the microscopic image sequence was obtained.
[0043] S400: Calculate the real-time change rate of the micro-edge roughness entropy at each time step, and construct the critical discrimination coefficient for processing at each time step by combining the color features in the key micro-structure region; when the critical discrimination coefficient for processing meets the preset stop condition, issue a processing endpoint control command.
[0044] It should be noted that, due to the carbonization reaction on the surface of Chinese medicinal materials during high-temperature processing, their optical properties are mainly manifested as the brightness decay of the original warm hue and the loss of color purity. Considering that the decrease in the mean value of the red channel reflects the brightness drop process when the medicinal material changes from its yellowish-brown color to charred black, while the decrease in the mean value of saturation characterizes the degree of fading as the medicinal material evolves from a colored state to a non-colored gray state, this invention constructs macroscopic color features by combining multidimensional colorimetric features. In addition, due to the differences in physical texture and thermal conductivity of different types of Chinese medicinal materials, the synchronicity of their color change and denaturation processes is not consistent. For example, hard-textured root and rhizome medicinal materials are prone to the phenomenon of blackening on the outside and growing inside. Therefore, this invention weights the macroscopic color features and the rate of change of roughness entropy, and dynamically adjusts the contribution ratio of microstructural mutation features and macroscopic color decay features in the discrimination system by setting differentiated weights for different materials, so as to achieve a comprehensive discrimination of the processing endpoint of medicinal materials with different textures.
[0045] Specifically, the critical discrimination coefficients for processing are calculated at each time step in the microscopic image sequence based on microscopic edge roughness entropy and multidimensional chromaticity features, including: The rate of change of roughness entropy is obtained by calculating the difference between the current micro-edge roughness entropy and the previous micro-edge roughness entropy.
[0046] Extract the mean value of the red channel in the RGB channel and the mean value of the saturation in the HSV space within the key microstructure region.
[0047] For example, a morphological weighting factor can be set. For medicinal materials that are hard or rich in starch, such as roots or fruits, the morphological weighting factor can be set to 0.8; for medicinal materials that are loose and thin, such as flowers, leaves or bark, the morphological weighting factor can be set to 0.5; and for certain flammable or high-sugar medicinal materials, the morphological weighting factor can be set to 0.6.
[0048] Current moment The critical discrimination coefficients for processing satisfy the following relationship: ; In the formula, Indicates the current time The critical discrimination coefficient for processing; Indicates the shape weighting factor; Indicates the current time The rate of change of rough entropy; This represents the mean value of the red channel in the RGB channels of the key microstructure region at the initial moment; Indicates the current time The mean value of the red channel in the RGB channels of key microstructural regions; This represents the mean saturation in the HSV space of the key microstructure region at the initial moment; Indicates the current time The mean saturation in the HSV space of key microstructural regions; This represents the maximum gray level of an 8-bit image depth, with a value of 255.
[0049] In this relation, The rough entropy contribution component represents the contribution of the rough entropy change rate after weight adjustment to the discrimination result. The larger the rough entropy contribution component, the more it indicates that the current critical discrimination coefficient of processing is mainly dominated by the drastic change of micro-texture, and the current determination of the processing endpoint depends on the drastic change of micro-texture. Conversely, the smaller the rough entropy contribution component, the more stable the micro-morphology is at this time, and no physical disintegration has occurred. The value represents the attenuation energy of the red channel color decay. The higher the attenuation energy value of the red channel color decay, the deeper the carbonization and blackening of the surface of the medicinal material, and the original red pigment has been covered by charred black substances; conversely, it means that the color of the medicinal material has hardly changed and it is still in a raw state. The decay energy value represents the saturation decay. The larger the decay energy value, the more the color purity of the medicinal material's surface has decreased relative to its initial state; conversely, the smaller the decay energy value, the more the color purity of the medicinal material remains stable and no obvious fading has occurred.
[0050] In this relation, It represents the macroscopic color characteristics at the current moment, indicating the mean decay of the red channel and the comprehensive evolution modulus in the saturation feature space; The color contribution component represents the overall evolution modulus after normalization and weight allocation in the critical discrimination coefficient of processing. The larger the color contribution component, the more likely the change in macroscopic color is the main factor constituting the critical discrimination coefficient of processing under the current weight setting; conversely, the smaller the color contribution component, the lower the contribution of color change.
[0051] For example, setting a shape weight factor Maximum gray level of 8-bit image depth The calculated microscopic edge roughness entropy at the current moment is: Assume the microscopic edge roughness entropy at the previous moment is... Then the rate of change of rough entropy Assuming the initial red channel mean Mean saturation The current average value of the red channel Mean saturation Then the critical discrimination coefficient of processing at the current moment .
[0052] Thus, the critical discrimination coefficients for processing at each moment in the microscopic image sequence were obtained.
[0053] Preferably, preset stop conditions are set, including: Set a judgment threshold; for example, the judgment threshold can be set to 0.5.
[0054] The critical discrimination coefficient for processing at any given time is compared with the judgment threshold. If the critical discrimination coefficient for processing is less than the judgment threshold, it is determined that the medicinal material has not yet reached the processing endpoint, and the current heating power is maintained to continue processing.
[0055] If the critical discrimination coefficient of processing is greater than or equal to the judgment threshold, or when the critical discrimination coefficient of processing shows a trend of changing from rising to falling, the preset stop condition is triggered, it is determined that the Chinese medicinal material has reached the optimal processing endpoint, and a processing endpoint control command is issued to stop heating or start the discharge device.
[0056] For example, such as Figure 4 This is a comparison diagram of the monitoring sensitivity between the method of the present invention and the prior art. It shows that the critical discrimination coefficient curve of the present invention shows a clear peak at the optimal processing endpoint, while the curve of the prior art is flat, which proves that the present solution has good sensitivity.
[0057] This invention also discloses a system for identifying the characteristics of traditional Chinese medicinal materials based on deep learning and microscopic image analysis, including a processor and a memory. The memory stores computer program instructions, and when the computer program instructions are executed by the processor, the method for identifying the characteristics of traditional Chinese medicinal materials based on deep learning and microscopic image analysis according to this invention is implemented.
[0058] The system also includes other components well known to those skilled in the art, such as communication buses and communication interfaces, the settings and functions of which are known in the art and will not be described in detail here.
[0059] While this specification has shown and described numerous embodiments of the invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Many modifications, alterations, and alternatives will occur to those skilled in the art without departing from the spirit and essence of the invention. It should be understood that various alternatives to the embodiments of the invention described herein may be employed in the practice of this invention.
Claims
1. A method for identifying the properties of traditional Chinese medicinal materials based on deep learning and microscopic image analysis, characterized in that, include: Original images of Chinese medicinal materials during the processing are acquired at preset time intervals and arranged into a microscopic image sequence. White balance correction and brightness normalization are performed on the original images at each moment in the microscopic image sequence to obtain the standard input image at each moment. The standard input images at each time step are input into the pre-trained U-Net segmentation network to identify and segment key microstructure regions in the standard input images and output the corresponding binarized mask images. Based on the morphological characteristics and degree of change of the binary mask images in the key microstructural regions at each time step, the micro-edge roughness entropy at each time step is calculated, including: Obtain the contour morphological complexity of key microstructural regions at the current moment; Obtain the logarithmic gain factor of the edge mean gradient change within the key microstructural region at the current moment; The micro-edge roughness entropy at the current moment is obtained by adding the contour morphology complexity and the logarithmic gain factor. The real-time change rate of the microscopic edge roughness entropy at each time step is calculated, and the critical discrimination coefficients for processing at each time step are constructed by combining the color features within the key microstructural regions, including: Set a morphological weighting factor, calculate the sum of the square of the difference between the red channel mean at the initial time and the current time and the square of the difference between the saturation mean at the initial time and the current time, divide the arithmetic square root of the sum of the two by the maximum gray level of the 8-bit image depth, and multiply by 1 by the difference obtained by subtracting the morphological weighting factor; finally, add the product of the morphological weighting factor and the absolute value of the rate of change of rough entropy to obtain the critical discrimination coefficient of the current time. When the critical discrimination coefficient of the processing meets the preset stop condition, a processing endpoint control command is issued.
2. The method according to claim 1, wherein, The process involves acquiring original images of the medicinal materials during processing at preset time intervals, forming a microscopic image sequence, and performing white balance correction and brightness normalization on the original images at each moment in the microscopic image sequence to obtain the standard input image at each moment, including: Using a microscope equipped with a CCD camera, original images of Chinese medicinal materials during the processing are continuously acquired at preset time intervals to form a microscopic image sequence. The original images at each moment in the microscopic image sequence are processed using the grayscale world algorithm and brightness normalization to obtain the standard input image at each moment. 3.The method of identifying the property of traditional Chinese medicinal materials based on deep learning and microscopic image analysis according to claim 1, characterized in that, The step of inputting the standard input images at each time step into a pre-trained U-Net segmentation network, identifying and segmenting key microstructure regions in the standard input images, and outputting a binarized mask image at the corresponding time step includes: A U-Net segmentation network integrating a convolutional block attention module is pre-trained; standard input images at each time step are input into the U-Net segmentation network; the U-Net segmentation network performs pixel-by-pixel classification on the standard input images, distinguishing key microstructure regions from background regions; the U-Net segmentation network finally outputs a binary mask image, in which pixels belonging to key microstructure regions are marked as 1, and pixels in the background region are marked as 0.
4. The method according to claim 1, wherein the method is characterized by, The process of obtaining the contour morphological complexity of the key microstructure region at the current moment includes: Based on the binarized mask image of the key microstructure region at the current moment, the total area and total perimeter of the key microstructure region are obtained by pixel statistics method; The contour morphology complexity of the key microstructure region at the current moment is obtained by dividing the square of the total perimeter of the key microstructure region by four times pi and multiplying it by the sum of the total area and the preset infinitesimal value.
5. The method according to claim 1, wherein the method is characterized by, The method for obtaining the logarithmic gain factor of the edge average gradient change within the key microstructural region at the current moment includes: Canny edge detection is performed on the key microstructure region to obtain the gradient magnitude of the pixels in the key microstructure region, and the arithmetic mean of all extracted gradient magnitudes is calculated to obtain the average edge gradient of the key microstructure region at the current time. Calculate 1 plus the ratio of the current edge average gradient to the initial edge average gradient baseline value, and take the natural logarithm to obtain the logarithmic gain factor of the edge average gradient change in the key microstructure region at the current time.
6. The method according to claim 1, wherein the method is characterized by, The acquisition of the rough entropy change rate includes: The difference between the current micro-edge roughness entropy and the previous micro-edge roughness entropy is calculated to obtain the rate of change of roughness entropy.
7. The method according to claim 1, wherein the method is characterized by, When the critical discrimination coefficient of the processing meets the preset stopping condition, a processing endpoint control command is issued, including: Set a preset stop condition: Set a judgment threshold; Compare the critical discrimination coefficient of processing at any time with the judgment threshold: If the critical discrimination coefficient of processing is less than the judgment threshold, it is determined that the Chinese medicinal material has not reached the processing endpoint, and the current heating power is maintained to continue processing; If the critical discrimination coefficient of processing is greater than or equal to the judgment threshold, or when the critical discrimination coefficient of processing shows a trend of changing from rising to falling, the preset stop condition is triggered, it is determined that the Chinese medicinal material has reached the optimal processing endpoint, and a processing endpoint control command is issued to stop heating or start the discharge device.
8. A traditional Chinese medicinal material property identification system based on deep learning and microscopic image analysis, characterized in that, include: The processor and memory, wherein the memory stores computer program instructions that, when executed by the processor, implement the method for identifying the characteristics of Chinese medicinal materials based on deep learning and microscopic image analysis according to any one of claims 1-7.