A hyperspectral-based traditional Chinese medicine decocting intelligent monitoring method and system
By using hyperspectral technology to identify regions of the medicinal liquid, eliminate interference, extract reliable band spectral data, and calculate the stability index, the instability and safety risks in the decoction process of traditional Chinese medicine are solved, and intelligent adaptive control and quality assurance of the decoction process are realized.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUOJIAN PHARM (SHENZHEN) GRP CO LTD
- Filing Date
- 2026-04-03
- Publication Date
- 2026-06-09
AI Technical Summary
During the decoction process of traditional Chinese medicine, existing technologies cannot achieve objective and quantitative monitoring of the process status, resulting in unstable decoction quality and safety risks. There is a lack of real-time monitoring and control of the dissolution and destruction of medicinal components.
Hyperspectral technology is used to identify regions of interest in the medicinal liquid area. Through band separation and image fusion, interference from steam and foam is eliminated, reliable band spectral data is extracted, stability index and rate of change are calculated, and intelligent identification of the decoction stage is achieved by combining safety boundary parameters.
It has significantly improved the stability and safety of the decoction process of traditional Chinese medicine. Through the intelligent monitoring system, it has achieved objective and accurate evaluation and adaptive control of the decoction temperature, ensuring that the active ingredients are fully dissolved and avoiding over-decoction.
Smart Images

Figure CN122176641A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent decoction technology, specifically to a method and system for intelligent monitoring of traditional Chinese medicine decoction based on hyperspectral imaging. Background Technology
[0002] In the modern production of traditional Chinese medicine, the decoction is a core link that affects the dissolution of medicinal components and clinical efficacy. The process is essentially a complex physicochemical process in which various chemical components in medicinal materials are dynamically dissolved, transferred, reacted and possibly degraded under the action of heat. The "heat" and "time" of decoction directly determine the quality and safety of the decoction.
[0003] Currently, both traditional manual decoction and modern automated decoction equipment face two major fundamental challenges: The process is invisible and unquantifiable: the decoction process has long relied on subjective human experience (such as observing color, smelling odor, and tasting), or simplified to a single time control. The lack of objective, quantifiable indicators to reflect the dynamic changes of the chemical components inside the decoction in real time makes it impossible to accurately determine when the decoction is ready, resulting in large fluctuations and poor consistency in decoction quality.
[0004] Inefficient control and lack of safety assurance: Existing automated equipment mostly operates based on fixed programs (such as setting uniform duration and power), and cannot adaptively adjust according to batch differences of medicinal materials, changes in water volume, or real-time decoction status. At the same time, there is a lack of real-time monitoring and rigid prevention mechanisms for "under-decoction" (the effective components are not fully dissolved) and "over-decoction" (the effective components are destroyed or harmful substances are produced), which poses quality and safety risks. Summary of the Invention
[0005] This application aims to provide a method and system for intelligent monitoring of traditional Chinese medicine decoction based on hyperspectral imaging, which can improve the stability and safety of traditional Chinese medicine decoction.
[0006] The technical solution of this application is implemented as follows: In a first aspect, embodiments of this application provide a method for intelligent monitoring of traditional Chinese medicine decoction based on hyperspectral imaging, the method comprising: Acquire traditional Chinese medicine prescription information, the standard decoction spectral feature map and safety boundary parameters corresponding to the traditional Chinese medicine prescription information, and the hyperspectral image of the decoction area during the decoction process corresponding to the traditional Chinese medicine prescription information; Based on the hyperspectral image of the drug liquid region, the effective region of interest is identified to obtain the effective region of interest; Data extraction and filtering are performed based on the effective region of interest to determine a reliable band spectral data sequence; wherein, the reliable band spectral data sequence includes reliable band spectral data at multiple consecutive time points; Based on the reliable band spectral data sequence and the standard decoction spectral feature map, a stability index is calculated to obtain a normalized comprehensive stability index and a normalized comprehensive stability index change rate; wherein, the normalized comprehensive stability index is used for decoction stage identification, and the normalized comprehensive stability index change rate is used for decoction completion determination. The current cooking stage is determined by identifying the cooking stage based on the normalized comprehensive stability index, the rate of change of the normalized comprehensive stability index, and the safety boundary parameter.
[0007] In the above scheme, the step of identifying the effective region of interest based on the hyperspectral image of the drug liquid region to obtain the effective region of interest includes: The hyperspectral image of the drug liquid region is subjected to band separation to obtain a visible light band image sequence and a near-infrared band image sequence. Then, the visible light band image sequence and the near-infrared band image sequence are subjected to image fusion processing to obtain a visible light spectral fusion image and a near-infrared spectral fusion image. Based on the visible light spectral fusion image and the near-infrared spectral fusion image, pixel difference calculation and normalization are performed to obtain the residual spectral image; Based on the residual spectral image and the hyperspectral image of the drug solution region, effective regions of interest are screened to determine the effective regions of interest.
[0008] In the above scheme, the step of filtering effective regions of interest based on the residual spectral image and the hyperspectral image of the drug solution region to determine the effective regions of interest includes: Based on the first preset pixel step size, the residual spectral image and the hyperspectral image of the drug liquid region are respectively divided into regions to obtain multiple first rectangular sub-regions corresponding to the residual spectral image and multiple second rectangular sub-regions corresponding to each frame of the hyperspectral image of the drug liquid region. Based on the multiple first rectangular sub-regions corresponding to the residual spectral image, a non-smoke region is determined, and based on the multiple second rectangular sub-regions corresponding to each frame of the hyperspectral image of the drug liquid region, a stable region is determined. Based on the non-smoke region and the stable region, an intersection operation is performed to determine the effective region of interest.
[0009] In the above scheme, determining the non-smoke region based on multiple first rectangular sub-regions corresponding to the residual spectral image, and determining the stable region based on multiple second rectangular sub-regions corresponding to each frame of the hyperspectral image of the drug liquid region, includes: The first gray mean and first variance of each of the multiple first rectangular sub-regions corresponding to the residual spectral image are calculated respectively. The first rectangular sub-region corresponding to the first gray mean with the highest frequency is determined as the first marked region. The first target rectangular sub-region in the first marked region with a first variance less than a first preset variance threshold is determined as the non-smoky region. The second gray mean and second variance of each of the multiple second rectangular sub-regions corresponding to each frame of the hyperspectral image of the drug liquid region are calculated respectively. The second rectangular sub-region corresponding to the second gray mean with the highest frequency is determined as the second marked region. The second target rectangular sub-region in the second marked region with a second variance less than the second preset variance threshold is determined as the third marked region. The stable region is determined by calculating the spatial intersection of the third marked region in each frame of the hyperspectral image of the drug liquid region.
[0010] In the above scheme, the step of extracting and filtering data based on the effective region of interest to determine the reliable band spectral data sequence includes: For each frame of the hyperspectral image of the drug liquid region, spectral feature data of the effective region of interest is extracted, and the volatility index of the effective region of interest is calculated; wherein, the spectral feature data is the gray value of all pixels in the corresponding band within the effective region of interest; and the volatility index is the standard deviation or variance of the pixel values within the effective region of interest. Based on the spectral feature data, median calculation and data construction are performed to determine the full-band spectral data at each time point; Based on the volatility index, calculate the stability confidence level; Based on the full-band spectral data and the stability confidence level, data is filtered using a stability confidence level threshold and a minimum number of spectra threshold to determine the reliable band spectral data for each moment. Based on the reliable band spectral data at each time point, the reliable band spectral data sequence is determined.
[0011] In the above scheme, the step of calculating the stability index based on the reliable band spectral data sequence and the standard decoction spectral feature map to obtain the normalized comprehensive stability index and the normalized comprehensive stability index change rate includes: Based on the reliable band spectral data sequence and the standard decoction spectral feature map, time alignment and data format processing are performed to determine the reliable band spectral data, time sequence matrix, and standard spectral matrix at the current moment; wherein, the time sequence matrix includes reliable band spectral data at k+1 moments; where k is a positive integer greater than 0; Based on the reliable band spectral data at the current moment and the standard spectral matrix, spectral features are extracted to determine the spectral features; Based on the time series matrix and the standard graph matrix, time series trend features are extracted to determine the time series trend features; The spectral features and the temporal trend features are fused to obtain comprehensive feature data. Based on the comprehensive feature data, a stability index is calculated to obtain the normalized comprehensive stability index and the normalized comprehensive stability index change rate.
[0012] In the above scheme, the safety boundary parameters include a minimum cooking time threshold; Accordingly, the step of identifying the current decoction stage based on the normalized comprehensive stability index, the rate of change of the normalized comprehensive stability index, and the safety boundary parameter includes: Based on the normalized comprehensive stability index and the rate of change of the normalized comprehensive stability index, the decoction stage is identified, and the initial decoction stage is determined. Obtain the duration of the initial simmering stage and the current simmering time; If the normalized comprehensive stability index is greater than or equal to a first threshold, the rate of change of the normalized comprehensive stability index is less than a second threshold, the current simmering time is greater than the minimum simmering time threshold, and the stage maintenance time is greater than a preset maintenance time threshold, then the current simmering stage is determined to be simmering complete.
[0013] Secondly, embodiments of this application provide a hyperspectral-based intelligent monitoring system for traditional Chinese medicine decoction. This system includes: an acquisition module, a determination module, a calculation module, and a judgment module. The acquisition module is used to acquire traditional Chinese medicine prescription information, standard decoction spectral feature map and safety boundary parameters corresponding to the traditional Chinese medicine prescription information, and hyperspectral image of the decoction area during the decoction process corresponding to the traditional Chinese medicine prescription information. The determining module is used to identify effective regions of interest based on the hyperspectral image of the drug liquid region to obtain effective regions of interest; and to extract and filter data based on the effective regions of interest to determine a reliable band spectral data sequence; wherein, the reliable band spectral data sequence includes reliable band spectral data at multiple consecutive time points; The calculation module is used to calculate the stability index based on the reliable band spectral data sequence and the standard decoction spectral feature map, to obtain the normalized comprehensive stability index and the normalized comprehensive stability index change rate; wherein, the normalized comprehensive stability index is used for decoction stage identification, and the normalized comprehensive stability index change rate is used for decoction completion determination. The judgment module is used to identify the current decocting stage based on the normalized comprehensive stability index, the rate of change of the normalized comprehensive stability index, and the safety boundary parameter.
[0014] Thirdly, embodiments of this application provide a hyperspectral-based intelligent monitoring device for traditional Chinese medicine decoction, comprising: a processor and a memory; wherein, The memory is used to store computer programs; The processor is configured to call and run the computer program from the memory to perform the method as described in the first aspect.
[0015] Fourthly, embodiments of this application provide a computer-readable storage medium storing executable instructions for causing a processor to perform the method described in the first aspect.
[0016] This application provides a method and system for intelligent monitoring of traditional Chinese medicine decoction based on hyperspectral imaging. The method includes: acquiring traditional Chinese medicine prescription information, a standard decoction spectral feature map corresponding to the prescription information, safety boundary parameters, and a hyperspectral image of the decoction liquid area during the decoction process corresponding to the prescription information; identifying effective regions of interest (ROIs) based on the hyperspectral image of the decoction liquid area; extracting and filtering data based on the ROIs to determine a reliable band spectral data sequence, wherein the reliable band spectral data sequence includes reliable band spectral data at multiple consecutive time points; calculating a stability index based on the reliable band spectral data sequence and the standard decoction spectral feature map to obtain a normalized comprehensive stability index and a normalized comprehensive stability index change rate; wherein the normalized comprehensive stability index is used for decoction stage identification, and the normalized comprehensive stability index change rate is used for decoction completion determination; and identifying the current decoction stage based on the normalized comprehensive stability index, the normalized comprehensive stability index change rate, and the safety boundary parameters. In the above scheme, firstly, by identifying the region of interest in the acquired hyperspectral image of the medicinal liquid area, interference from steam and foam can be effectively eliminated, achieving stable and reliable acquisition of monitoring data under complex decoction conditions. Secondly, based on the effective region of interest, data extraction and screening are performed to determine the reliable band spectral data sequence. Based on the reliable band spectral data sequence and the standard decoction spectral feature map, the stability index is calculated, which can transform the decoction temperature into a quantifiable stability index, achieving an objective and accurate assessment of the process state. Finally, based on the stability index (i.e., the normalized comprehensive stability index and the normalized comprehensive stability index change rate), stage identification is performed, realizing a leap from experience-based control to intelligent adaptation, significantly improving the stability and safety of traditional Chinese medicine decoction. Attached Figure Description
[0017] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the specification, serve to explain the technical solutions of this application. Obviously, the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.
[0018] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.
[0019] Figure 1This is an optional flowchart illustrating a method for intelligent monitoring of traditional Chinese medicine decoction based on hyperspectral imaging, provided in an embodiment of this application. Figure 2 A schematic diagram illustrating the screening of non-smoke regions in a hyperspectral-based intelligent monitoring method for traditional Chinese medicine decoction, provided in an embodiment of this application. Figure 3 A schematic diagram illustrating the stable region screening of a hyperspectral-based intelligent monitoring method for traditional Chinese medicine decoction, provided in an embodiment of this application. Figure 4 A schematic diagram illustrating the determination of the Region of Interest (ROI) in a hyperspectral-based intelligent monitoring method for traditional Chinese medicine decoction, provided in an embodiment of this application. Figure 5 A schematic diagram of the structure of a hyperspectral-based intelligent monitoring system for traditional Chinese medicine decoction provided in this application embodiment; Figure 6 This is a schematic diagram of the structure of a hyperspectral-based intelligent monitoring device for traditional Chinese medicine decoction, provided in an embodiment of this application. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the specific technical solutions of this application will be further described in detail below with reference to the accompanying drawings of the embodiments of this application. The following embodiments are used to illustrate this application, but are not intended to limit the scope of this application.
[0021] Unless otherwise defined, all technical and scientific terms used in this application have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. The terminology used in this application is for the purpose of describing embodiments of this application only and is not intended to be limiting of this application.
[0022] In the following description, references to "some embodiments," "this embodiment," "this application embodiment," and examples, etc., describe a subset of all possible embodiments. However, it is understood that "some embodiments" may be the same subset or different subset of all possible embodiments and may be combined with each other without conflict.
[0023] If the application documents contain similar descriptions such as "first / second", the following explanation shall be added: In the following description, the terms "first / second / third" are used only to distinguish similar objects and do not represent a specific order of objects. It is understood that "first / second / third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0024] Based on this, embodiments of this application provide a method for intelligent monitoring of traditional Chinese medicine decoction based on hyperspectral imaging. Figure 1This is an optional flowchart illustrating an intelligent monitoring method for traditional Chinese medicine decoction based on hyperspectral imaging, provided as an embodiment of this application. Figure 1 The steps shown are explained.
[0025] S101. Obtain the traditional Chinese medicine prescription information, the standard decoction spectral feature map and safety boundary parameters corresponding to the traditional Chinese medicine prescription information, and the hyperspectral image of the medicinal liquid area during the decoction process corresponding to the traditional Chinese medicine prescription information.
[0026] In some embodiments of this application, the information in a traditional Chinese medicine prescription includes the type of medicinal materials, the precise dosage, and the decoction requirements.
[0027] In some embodiments of this application, a hyperspectral-based intelligent monitoring method for traditional Chinese medicine decoction is adapted to the traditional Chinese medicine decoction scenario.
[0028] In some embodiments of this application, a hyperspectral-based intelligent monitoring method for traditional Chinese medicine decoction is adapted to a hyperspectral-based intelligent monitoring system for traditional Chinese medicine decoction.
[0029] In some embodiments of this application, after obtaining the traditional Chinese medicine prescription information, the standard decoction spectral feature map corresponding to the prescription information is retrieved from the knowledge base. The standard decoction spectral feature map consists of a sequence of full-band spectral data at multiple time points, with each time point containing complete full-band spectral feature data for that moment. Based on the prescription information, safety boundary parameters corresponding to the prescription information are obtained; these parameters include a minimum decoction time threshold and a maximum decoction time threshold.
[0030] It should be noted that setting a minimum decoction time threshold is to prevent under-decoction and ensure that the medicinal components are fully dissolved; setting a maximum decoction time threshold is to prevent over-decoction and avoid damage to the effective components or the generation of harmful substances.
[0031] In some embodiments of this application, after determining the traditional Chinese medicine prescription information, the standard decoction spectral feature map corresponding to the traditional Chinese medicine prescription information, and the safety boundary parameters, the medicine is decocted, and hyperspectral images of the liquid area are acquired at a fixed frequency, wherein the hyperspectral images contain images of multiple different wavebands.
[0032] For example, for any given traditional Chinese medicine prescription, the corresponding standard decoction spectral characteristic spectrum is shown in Table 1. The standard decoction spectral characteristic spectrum specifically includes the following data file: Time series: [t0, t1, ..., t z ]; Full-band spectral data matrix: Dimensions are (z×n), where n is the total number of bands. Values in the full-band spectral data matrix can be typical pixel values or normalized typical pixel values; typical pixel values can be median values. Stage label: The cooking stage to which each time point belongs (e.g., stages 1-4).
[0033] Table 1 Taking the traditional Chinese medicine prescription Dang Gui Bu Xue Tang as an example, the prescription information includes: Composition of medicinal materials: Angelica sinensis 15g and Astragalus membranaceus 30g; Cooking requirements: Regular cooking method, no special processing required; Expected cooking time: 45 minutes (traditionally recommended).
[0034] Based on traditional Chinese medicine prescription information, the standard optimal spectral spectrum corresponding to the traditional Chinese medicine prescription information is obtained, as specifically implemented as follows: The system automatically matches the standard decoction record of Dang Gui Bu Xue Tang (Angelica Blood-Nourishing Decoction) and loads the standard optimal spectral spectrum. The standard optimal spectral spectrum includes the spectral characteristics at the following time points: 0 minutes (initial state); 15 minutes (initial dissolution period); 30 minutes (main dissolution period); 45 minutes (cooking time).
[0035] Each time point contains full-band spectral data ranging from 400 to 1000 nm.
[0036] The security boundary parameters for traditional Chinese medicine prescription information are set as follows: Minimum cooking time threshold: 30 minutes (to prevent undercooking); Maximum cooking time threshold: 60 minutes (to prevent overcooking).
[0037] S102. Based on the hyperspectral image of the drug liquid region, identify the effective region of interest to obtain the effective region of interest.
[0038] In some embodiments of this application, the hyperspectral image of the drug liquid region is subjected to band separation to obtain a visible light band image sequence and a near-infrared band image sequence; the visible light band image sequence and the near-infrared band image sequence are then subjected to image fusion processing to obtain a visible light spectral fusion image and a near-infrared spectral fusion image; based on the visible light spectral fusion image and the near-infrared spectral fusion image, pixel difference calculation and normalization processing are performed to obtain a residual spectral image; based on the residual spectral image and the hyperspectral image, effective regions of interest are screened to determine the effective regions of interest.
[0039] It should be noted that the effective region of interest (ROI) is defined as follows: For each spectral image in the hyperspectral image, areas interfering with foam and steam are automatically excluded to maintain the effective monitoring area. The ROI identification process is repeated for each hyperspectral image, dynamically adapting to changes in the scene such as liquid surface fluctuations, foam generation or dissipation during the cooking process, to ensure the real-time accuracy of the effective monitoring area.
[0040] S103. Based on the effective region of interest, perform data extraction and filtering to determine the reliable band spectral data sequence; wherein, the reliable band spectral data sequence includes reliable band spectral data at multiple consecutive time points.
[0041] In some embodiments of this application, for each frame of the hyperspectral image of the drug liquid region, spectral feature data of the effective region of interest is extracted, and the volatility index of the effective region of interest is calculated. The spectral feature data consists of the grayscale values of all pixels within the effective region of interest in their corresponding bands. Based on the spectral feature data, median calculation and data construction are performed to determine the full-band spectral data at each time step. Based on the volatility index, a stability confidence score is calculated. Based on the full-band spectral data and the stability confidence score, data is filtered using a stability confidence score threshold and a minimum number of spectra threshold to determine the reliable band spectral data at each time step. Based on the reliable band spectral data at each time step, a reliable band spectral data sequence is determined.
[0042] S104. Based on the reliable band spectral data sequence and the standard decoction spectral feature map, the stability index is calculated to obtain the normalized comprehensive stability index and the normalized comprehensive stability index change rate. Among them, the normalized comprehensive stability index is used for decoction stage identification, and the normalized comprehensive stability index change rate is used for decoction completion determination.
[0043] In some embodiments of this application, based on the reliable band spectral data sequence and the standard decoction spectral feature map, time alignment and data format processing are performed to determine the reliable band spectral data, time series matrix, and standard map matrix at the current moment. The time series matrix includes reliable band spectral data for k+1 moments, where k is a positive integer greater than 0. Based on the reliable band spectral data and the standard map matrix at the current moment, spectral features are extracted to determine spectral features. Based on the time series matrix and the standard map matrix, time series trend features are extracted to determine time series trend features. The spectral features and time series trend features are fused to obtain comprehensive feature data. Based on the comprehensive feature data, a stability index is calculated to obtain a normalized comprehensive stability index and a normalized rate of change of the comprehensive stability index.
[0044] S105. Based on the normalized comprehensive stability index, the normalized comprehensive stability index change rate, and the safety boundary parameters, the decoction stage is identified to determine the current decoction stage.
[0045] In some embodiments of this application, the decoction stage is identified based on the normalized comprehensive stability index and the normalized comprehensive stability index change rate to determine the initial decoction stage; the stage maintenance time corresponding to the initial decoction stage and the current decoction time are obtained; if the normalized comprehensive stability index is greater than or equal to a first threshold, the normalized comprehensive stability index change rate is less than a second threshold, the current decoction time is greater than the minimum decoction time threshold, and the stage maintenance time is greater than the preset maintenance time threshold, the current decoction stage is determined to be the completion of decoction.
[0046] For example, the normalized Comprehensive Stability Index (CSI) is used as the core criterion for judgment, combined with the normalized Comprehensive Stability Index Change Rate (CSI_RTO), to divide the decoction stages; an adaptive heating strategy is simultaneously matched to achieve dynamic linkage between stages and power, ensuring that the decoction effect of each stage meets the standards. Four core stages are set by default (which can be added or removed according to the characteristics of the prescription), and the details of the judgment and control of each stage are as follows: Phase 1 (Initial heating period): CSI < 0.3, CSI_RTO > 5% / min; Phase 2 (Effective Dissolution Period): 0.3 ≤ CSI < 0.8, 1% / min ≤ CSI_RTO ≤ 5% / min; Phase 3 (Steady equilibrium period): 0.8 ≤ CSI < 0.95, 0.5% / min ≤ CSI_RTO < 1% / min; Phase 4 (Completely stationary): CSI ≥ 0.95, CSI_RTO < 0.5% / min.
[0047] It should be noted that the power percentage is a percentage relative to the rated power of the equipment.
[0048] Determine whether the decocting process is complete by combining multiple conditions: Based on CSI and CSI_RTO, preset minimum cooking time thresholds, preset maximum cooking time thresholds, and preset stage maintenance times are used to determine when heating ends, stop heating, and issue a notification. The following is an example using a first threshold of 0.98 and a second threshold of 0.5% as an example: When the following conditions are met, the cooking process is considered complete, heating is stopped, and a notification is issued indicating completion: Condition A: CSI ≥ 0.98 and CSI_RTO < 0.5%; Condition B: Current cooking time ≥ minimum cooking time threshold; For example, the minimum decoction time threshold is 30 minutes. The reason for this setting is to ensure sufficient time for the active ingredients in the herbs to dissolve, avoiding under-decoction. Traditional Chinese medicine decoction often involves two stages: "boiling over high heat" and "simmering over low heat." The first 30 minutes are typically the main dissolution period for the active ingredients. If the time is too short, the medicinal components will not be fully extracted, affecting the therapeutic effect.
[0049] Condition C: The duration of the phase is greater than or equal to the preset duration threshold; For example, the preset duration threshold is 3 minutes. The reason for this setting is to ensure that the current cooking stage (such as the "fully stable period") is stable and continuous, rather than experiencing brief fluctuations. This avoids misjudging "cooking complete" due to momentary foam or steam interference. Setting the duration improves the robustness and reliability of the judgment.
[0050] Understandably, firstly, by identifying the region of interest in the acquired hyperspectral image of the medicinal liquid area, interference from steam and foam can be effectively eliminated, achieving stable and reliable acquisition of monitoring data under complex decoction conditions. Secondly, based on the effective region of interest, data extraction and screening are performed to determine the reliable band spectral data sequence. Based on the reliable band spectral data sequence and the standard decoction spectral feature map, the stability index is calculated, which can transform the decoction temperature into a quantifiable stability index, achieving an objective and accurate assessment of the process state. Finally, based on the stability index (i.e., the normalized comprehensive stability index and the normalized comprehensive stability index change rate), stage identification is performed, realizing a leap from experience-based control to intelligent adaptation, significantly improving the stability and safety of traditional Chinese medicine decoction.
[0051] In some embodiments of this application, S102 can be implemented by S201-S203, as follows: S201. Perform band separation on the hyperspectral image of the drug liquid area to obtain a visible light band image sequence and a near-infrared band image sequence. Then, perform image fusion processing on the visible light band image sequence and the near-infrared band image sequence to obtain a visible light spectral fusion image and a near-infrared spectral fusion image.
[0052] For example, a visible light band image sequence (400-760nm) and a near-infrared band image sequence (760-2500nm) are separated from the hyperspectral image of the drug liquid area; pixel-wise mean fusion is performed on the two band sequences respectively, that is, the mean gray value is calculated for the same pixel coordinate position of all images in the same band sequence, and finally a single visible light spectral fusion image and a single near-infrared spectral fusion image are generated.
[0053] S202. Based on the visible light spectral fusion image and the near-infrared spectral fusion image, perform pixel difference calculation and normalization processing to obtain the residual spectral image.
[0054] For example, pixel-by-pixel difference calculation is performed on the visible light spectral fusion image and the near-infrared spectral fusion image, and then the difference result is normalized to the [0,1] interval to obtain the residual spectral image.
[0055] S203. Based on the residual spectral image and the hyperspectral image of the drug liquid region, perform effective region of interest screening to determine the effective region of interest.
[0056] In some embodiments of this application, based on a first preset pixel step size, the residual spectral image and the hyperspectral image of the drug liquid region are respectively divided into regions to obtain multiple first rectangular sub-regions corresponding to the residual spectral image and multiple second rectangular sub-regions corresponding to each frame of the hyperspectral image of the drug liquid region; based on the multiple first rectangular sub-regions corresponding to the residual spectral image, non-smoke regions are determined, and based on the multiple second rectangular sub-regions corresponding to each frame of the hyperspectral image of the drug liquid region, stable regions are determined; based on the non-smoke regions and stable regions, an intersection operation is performed to determine the effective region of interest.
[0057] In some embodiments of this application, the first gray-scale mean and first variance of each of the multiple first rectangular sub-regions corresponding to the residual spectral image are calculated respectively. The first rectangular sub-region corresponding to the first gray-scale mean with the highest frequency is determined as the first marked region. The first target rectangular sub-region in the first marked region with a first variance less than a first preset variance threshold is determined as the non-smoke region. The second gray-scale mean and second variance of each of the multiple second rectangular sub-regions corresponding to each frame of the hyperspectral image of the drug liquid region are calculated respectively. The second rectangular sub-region corresponding to the second gray-scale mean with the highest frequency is determined as the second marked region. The second target rectangular sub-region in the second marked region with a second variance less than a second preset variance threshold is determined as the third marked region. The spatial intersection of the third marked regions in each frame of the hyperspectral image of the drug liquid region is calculated to determine the stable region.
[0058] For example, non-smoke area filtering is as follows: Figure 2 As shown, the residual spectral image is divided into M×N non-overlapping first rectangular sub-regions according to a first preset pixel step size. For each first rectangular sub-region, a first gray-level mean and a first variance are calculated. The first gray-level mean of all first rectangular sub-regions is statistically analyzed, and the first gray-level mean with the highest frequency is selected as the benchmark mean. Sub-regions whose first gray-level mean equals the benchmark mean are marked as first marked regions. A first preset variance threshold is set, and sub-regions whose first variance is less than the first preset variance threshold are selected from the first marked regions and uniformly marked as non-smoky regions.
[0059] Stable region screening, such as Figure 3As shown, using a first preset pixel step size, each frame of the hyperspectral image of the drug liquid region is divided into M×N non-overlapping second rectangular sub-regions. For each second rectangular sub-region within a single frame of the hyperspectral image (i.e., each frame of the spectral image), the second gray-level mean and the second variance are calculated. The mean distribution of all second rectangular sub-regions is statistically analyzed, and the second gray-level mean with the highest frequency is selected as the benchmark mean. The second rectangular sub-regions whose second gray-level mean is equal to the benchmark mean are marked as second marked regions. A second preset variance threshold is set, and sub-regions whose second variance is less than the second preset variance threshold are selected from the second marked regions and uniformly marked as third marked regions. The spatial intersection of the third marked regions in each frame of the hyperspectral image of the drug liquid region (i.e., sub-regions that are marked as second marked regions in each frame of the hyperspectral image of the drug liquid region) is calculated and merged, and defined as a stable region.
[0060] It should be noted that the second preset variance threshold is an adaptively determined threshold based on the variance statistical characteristics of the second rectangular sub-region of the current frame, preferably 20%–30% of the mean variance of all second rectangular sub-regions of the current frame; through the above method, rolling, bubble and liquid surface fluctuation areas can be effectively screened out, and areas with stable spatial grayscale distribution can be retained, thereby improving the accuracy and robustness of stable area identification.
[0061] ROI region determination as follows Figure 4 As shown, the spatial intersection of the non-smoky region and the stable region is calculated, and this intersection region is the ROI region of the current frame hyperspectral image.
[0062] In some embodiments of this application, S103 can be implemented by S301-S305, as follows: S301. For each frame of the hyperspectral image of the drug liquid area, extract the spectral feature data of the effective region of interest, and calculate the fluctuation index of the effective region of interest; wherein, the spectral feature data is the gray value of all pixels in the corresponding band within the effective region of interest; the fluctuation index is the standard deviation or variance of the pixel values within the effective region of interest.
[0063] S302. Based on spectral feature data, perform median calculation and data construction to determine the full-band spectral data at each time point.
[0064] For example, determining the full-band spectral data at each moment can be achieved in the following specific ways: Pixel value statistics: For each valid interest identified in the hyperspectral image of the drug liquid area, extract the gray values (i.e., spectral feature data) of all pixels within the interest in the corresponding band.
[0065] Median calculation: To reduce the interference of extreme pixel values (such as tiny impurities), the median of the spectral feature data of all pixels within each area of interest is calculated as the representative value for that band.
[0066] Data Construction: Integrate representative values from all bands at this moment to generate full-band spectral data for the current moment (t), expressed as: S(t) = [λ1, λ2, ..., λ n ], where t is the current acquisition time (accurate to the second), n is the total number of bands acquired at this time, and λ i (i=1,2,...,n) is the median of the i-th band.
[0067] S303. Calculate the stability confidence level based on the volatility index.
[0068] For example, the specific process for calculating the stability confidence is as follows: Volatility analysis: For all spectral images of the drug liquid region, calculate the volatility index of the spectral data of all effective pixels within the region of interest. The volatility index can be the standard deviation or variance of the pixel values within the effective region of interest.
[0069] Confidence conversion: Stability confidence is calculated inversely based on the volatility index. Each spectral image has a corresponding stability confidence, calculated as follows: Stability confidence = (1 - coefficient of variation / maximum permissible coefficient of variation), where the maximum permissible coefficient of variation is determined through preset sample calibration. The stability confidence value ranges from [0,1]. The closer the value is to 1, the more stable the spectral data of that hyperspectral image frame is, and the less affected it is by interference; the closer the value is to 0, the greater the data volatility and the lower the reliability.
[0070] S304. Based on full-band spectral data and stability confidence, data is filtered through stability confidence threshold and minimum number of spectra threshold to determine the reliable band spectral data at each moment.
[0071] For example, the process of filtering reliable band spectral data at the current moment is illustrated below: Dual threshold settings: Two core thresholds are preset to ensure the reliability and integrity of the screened data. The first is a stability confidence threshold (e.g., 0.7, which can be fine-tuned according to prescription sensitivity) used to screen reliable spectral data; the second is a minimum number of spectra threshold (e.g., 60% of the total number of spectra n across all bands, which can be calibrated according to monitoring accuracy requirements). The purpose is to preserve data integrity and avoid insufficient effective spectra due to over-screening, which would fail to fully and accurately reflect the spectral characteristics of the current drug solution, ensuring sufficient data support for subsequent stability index calculations.
[0072] Data filtering: For the full-band spectral data S(t) generated at the current time, a dual filtering logic is performed. The first step is to remove data with a corresponding band stability confidence level lower than the confidence threshold λ. i The first step is to retain band data with a confidence level greater than or equal to the threshold. The second step is to verify the number of bands remaining after screening. If the number is lower than the preset minimum number of spectra threshold, then select the minimum number of spectra threshold data from the unselected bands according to the stability confidence level from high to low, to ensure that the screened data is both reliable and complete.
[0073] Reliable data output: The filtered band data is re-integrated to generate reliable band spectral data for the current moment, expressed as: B(t) = [λ1, λ2, ..., λ m ], where m is the total number of credible bands (m≤n), and this data serves as the core input data for subsequent stability index calculation.
[0074] S305. Based on the reliable band spectral data at each time moment, determine the reliable band spectral data sequence.
[0075] In some embodiments of this application, S104 can be implemented by S401-S404, as follows: S401. Based on the reliable band spectral data sequence and the standard decoction spectral feature map, perform time alignment and data format processing to determine the reliable band spectral data, time sequence matrix and standard map matrix at the current time; wherein, the time sequence matrix includes reliable band spectral data at k+1 times.
[0076] S402. Based on the current reliable band spectral data and standard spectral matrix, perform spectral feature extraction and determine the spectral features.
[0077] S403. Based on the time series matrix and the standard spectral matrix, extract the time series trend features and determine the time series trend features.
[0078] S404. The spectral features and temporal trend features are fused to obtain comprehensive feature data; and based on the comprehensive feature data, the stability index is calculated to obtain the normalized comprehensive stability index and the normalized comprehensive stability index change rate.
[0079] For example, a dedicated neural network model is used to mine and fuse temporal features to calculate the normalized Comprehensive Stability Index (CSI) and the normalized Comprehensive Stability Index Change Rate (CSI_RTO), providing core quantitative basis for subsequent decoction stage determination and endpoint identification. Its core logic is as follows: using reliable continuous-time spectral data and standard decoction spectral feature maps as input, the model learns the variation law of spectral features with decoction time, quantitatively characterizing the stability state and trend of the decoction process, ensuring accurate, reliable calculation results that meet real-time monitoring needs.
[0080] The neural network model for evaluating the stability of time-series spectra (i.e., the dedicated neural network model) includes: an input layer, a time-series feature extraction layer, a feature fusion layer, a prediction head layer, and an output layer.
[0081] The execution flow of the dedicated neural network model is as follows: 1. Simultaneously receive reliable band spectral data (i.e., reliable band spectral data sequence) and standard decoction spectral feature maps at k+1 consecutive time points; 2. Extract the spectral features at each time point and the trend of these features over time (i.e., time series variation features). 3. Integrate single-moment spectral features with temporal variation features to form comprehensive feature data; 4. Parallel computation of CSI and CSI_RTO; 5. Output the normalized CSI value and CSI_RTO value for subsequent stage judgment.
[0082] The specific functions of each layer in the dedicated neural network model are as follows: Input layer: Input 1: Spectral data of reliable bands at k+1 consecutive time points, where the data dimension at each time point dynamically changes with the total number of reliable bands (m respectively). t , m t-1 , ..., m t-k , where m t m represents the total number of reliable bands at the current moment. t-i (This represents the total number of reliable bands at the i-th historical moment).
[0083] a. Input data at a single time step: B(ti) = [λ1, λ2, ..., λ mt-i (i=0,1,...,k), where m t-i The total number of reliable bands at time ti (m t-i ≥ the minimum number of spectra at the corresponding time), and m at different times t-i Differences may exist, and the specific bands of a reliable band may also differ.
[0084] b. Temporal dimension: The data dimension at time k+1 varies with m. t-i Dynamic adjustments are required. Before input, the data must be aligned according to the full band list (e.g., 400-1000nm) (filling missing bands with 0 and removing redundant bands), and uniformly converted to a fixed dimension (e.g., n dimensions for the total number of full bands) to ensure that the time series format is standardized.
[0085] c. Data format: The time series is organized into a two-dimensional matrix input (rows: time, columns: spectral bands) to ensure that the time sequence strictly corresponds to the order of cooking time.
[0086] Input 2: Standard decoction spectral feature map corresponding to the traditional Chinese medicine prescription information (used for matching by time point; the total sampling time in the map is z, and the dimension of each sampling time is uniformly n-dimensional; this standard decoction spectral feature map is n-dimensional spectral data of z time points). For example, with n=5 and k=3, the specific content of the standard decoction spectral feature map is shown in Table 2.
[0087] Table 2 Temporal feature extraction layer: The temporal feature extraction layer adopts a dual-branch structure of "single-time-point feature extraction + temporal trend extraction" to extract core features in parallel: Branch A: Spectral feature extraction at time t (capturing the spectral features at each time). The input to branch A is the spectral data aligned to the current time t (1×n) and the standard spectral matrix (z×n).
[0088] Path A includes: a fully connected layer and a ReLU activation layer; the fully connected layer transforms n-dimensional data into 32-dimensional data. Pathway B includes: 2D convolutional layers and ReLU activation layers; wherein, the 2D convolutional layers transform z×n dimensional data into 32×n dimensional data; The outputs of pathways A and B are spliced together and then processed by a 2D convolutional layer and normalized to output 32-dimensional spectral features.
[0089] It should be noted that n is the total number of all bands, and the data at each time point are n-dimensional after alignment processing.
[0090] Branch B: Extraction of temporal trend features at time k+1 (capturing the changing pattern of spectral features over time). The input of branch B is the temporal sequence matrix ((k+1)×n) at time k+1 and the standard spectral matrix (z×n).
[0091] Path A includes: 2D convolutional layers and ReLU activation layers; wherein, the 2D convolutional layers transform (k+1)×n dimensional data into 16×n dimensional data; Pathway B includes: 2D convolutional layers and ReLU activation layers; wherein, the 2D convolutional layers transform z×n dimensional data into 32×n dimensional data; After the outputs of pathways A and B are concatenated, they are processed through a 2D convolutional layer, a normalization layer, a max pooling layer, a 1D convolutional layer, a ReLU activation layer, a normalization layer, and a global average pooling layer to output 32-dimensional temporal trend features.
[0092] Feature fusion layer: Connects the 32-dimensional spectral features after pooling in branch A and the 32-dimensional temporal trend features output in branch B to form 64-dimensional comprehensive feature data.
[0093] The prediction head layer consists of two parallel sub-networks (simultaneously outputting two core metrics), as detailed below: Subnetwork 1: CSI prediction head; Subnetwork 2: CSI_RTO prediction head.
[0094] Subnetwork 1 and subnetwork 2 are the same, both consisting of 2 fully connected layers, a ReLU activation layer and a Sigmoid activation layer, and the final output is a CSI scalar normalized to [0,1] (i.e. [0,100%]).
[0095] The output layer includes two outputs, as detailed below: Output 1: CSI scalar, with a value range of [0,1], used for identification during the decocting stage; Output 2: CSI_RTO scalar, with a value range of [0, 100%] and a unit of % / min, used to determine the end point of decoction (the lower the rate of change, the more stable the state).
[0096] By using a dedicated neural network model to mine and fuse time-series features, the normalized Comprehensive Stability Index (CSI) and the normalized Comprehensive Stability Index Change Rate (CSI_RTO) are calculated, as shown in the following example: Taking the conventional decoction prescription of 15g Angelica sinensis + 30g Astragalus membranaceus as an example, the calculation process is as follows: Input data: Select reliable spectral data at three consecutive time points (30, 31, and 32 minutes) with k=2. After alignment across the entire 400-1000nm band, each data point is 200-dimensional (n=200). Simultaneously load standard spectra (4 time points × 200-dimensional).
[0097] Temporal feature extraction: Branch A processes 32 minutes of 1×200 data and standard spectra, and outputs 32-dimensional spectral features after passing through fully connected layers and convolutional layers; Branch B processes 3×200 time series data and standard spectra, and outputs 32-dimensional temporal trend features after passing through multiple rounds of convolution and pooling.
[0098] Feature fusion: The outputs of the two branches are combined to form 64-dimensional comprehensive feature data.
[0099] Predicted output: The normalized results obtained by the dual predictor network are: CSI=0.65 (in the range of 0.3-0.8) and CSI_RTO=3% / min (in the range of 1%-5% / min), which corresponds to the second stage of decoction (effective dissolution period), providing the core quantitative basis for subsequent power regulation (maintaining 60% of rated power).
[0100] Before using a dedicated neural network model for temporal feature mining and fusion, model training is required. The core principle of dedicated neural network model training is to quickly complete model training and adaptation by using "a small amount of labeled data + a simplified training process." The specific steps are as follows: First, prepare the training data.
[0101] a. Small sample adaptation, requiring only 3-5 typical prescription data points, without the need for large-scale datasets; b. Simplified labeling: CSI is qualitatively labeled according to the decoction stage, and the difference is calculated as CSI_RTO, eliminating the need for complex quantitative labeling; c. The data is divided simply, with a 7:3 ratio for the training / validation set, which is suitable for small sample scenarios.
[0102] Second, training parameter configuration.
[0103] a. The loss function is simplified and MSE is adopted; b. The optimizer and parameters are fixed, using the Adam optimizer with a fixed learning rate of 0.001 and a batch size of 8; c. Iterative control core, with a total number of iterations of 50-100 rounds, combined with an early stopping mechanism (stopping if the verification loss does not decrease for 10 consecutive rounds) to effectively avoid overfitting.
[0104] Third, the model training process.
[0105] a. Simplified initialization: Default random initialization is used, and pre-trained weights are not required; b. Validation core: evaluate and validate the loss in each round, and only save the optimal model weights to ensure the model's generalization ability.
[0106] The embodiments of this application have the following beneficial effects: First, dynamic interest identification technology effectively eliminates interference from steam and foam, enabling stable and reliable acquisition of monitoring data under complex decoction conditions. Second, time-series spectral analysis combined with a dedicated neural network model transforms the decoction temperature into a quantifiable stability index, achieving objective and accurate assessment of the process status. Finally, stage identification based on real-time stability indicators enables a leap from experience-based control to intelligent self-adaptation, significantly improving the stability and safety of traditional Chinese medicine decoction.
[0107] Based on the above embodiments, this application also provides a hyperspectral-based intelligent monitoring system for traditional Chinese medicine decoction, such as... Figure 5 As shown, Figure 5 This application provides a schematic diagram of the structure of a hyperspectral-based intelligent monitoring system for traditional Chinese medicine decoction. The system includes: an acquisition module 501, a determination module 502, a calculation module 503, and a judgment module 504. The acquisition module 501 is used to acquire traditional Chinese medicine prescription information, standard decoction spectral feature map and safety boundary parameters corresponding to the traditional Chinese medicine prescription information, and hyperspectral image of the liquid area during the decoction process corresponding to the traditional Chinese medicine prescription information. The determining module 502 is used to identify effective regions of interest based on the hyperspectral image of the drug liquid region to obtain effective regions of interest; and to extract and filter data based on the effective regions of interest to determine a reliable band spectral data sequence; wherein, the reliable band spectral data sequence includes reliable band spectral data at multiple consecutive time points; The calculation module 503 is used to calculate the stability index based on the reliable band spectral data sequence and the standard decoction spectral feature map, to obtain the normalized comprehensive stability index and the normalized comprehensive stability index change rate; wherein, the normalized comprehensive stability index is used for decoction stage identification, and the normalized comprehensive stability index change rate is used for decoction completion determination. The judgment module 504 is used to identify the current decocting stage based on the normalized comprehensive stability index, the rate of change of the normalized comprehensive stability index, and the safety boundary parameter.
[0108] Based on the above embodiments, this application also provides a hyperspectral-based intelligent monitoring device for traditional Chinese medicine decoction, such as... Figure 6 As shown, Figure 6 This is a schematic diagram of a hyperspectral-based intelligent monitoring device for traditional Chinese medicine decoction, provided in an embodiment of this application. The device includes a processor 601 and a memory 602. The memory 602 stores a computer program; the processor 601 retrieves and runs the computer program from the memory to execute the hyperspectral-based intelligent monitoring method for traditional Chinese medicine decoction as described in the above embodiment.
[0109] In the embodiments of this application, the processor 601 described above can be at least one of the following: Application-Specific Integrated Circuit (ASIC), Digital Signal Processor (DSP), Digital Signal Processing Device (DSPD), Programmable Logic Device (PLD), Field Programmable Gate Array (FPGA), Central Processing Unit (CPU), Controller, Microcontroller, and Microprocessor. It is understood that for different devices, the electronic device used to implement the above processor function can also be other types, and the embodiments of this application do not specifically limit it.
[0110] This application provides a computer-readable storage medium storing a computer program for implementing, when executed by a processor, a method for intelligent monitoring of traditional Chinese medicine decoction based on hyperspectral imaging as described in any of the above embodiments.
[0111] For example, the program instructions corresponding to the intelligent monitoring method for decoction of traditional Chinese medicine based on hyperspectral imaging in this embodiment can be stored on storage media such as optical discs, hard disks, and USB flash drives. When the program instructions corresponding to the intelligent monitoring method for decoction of traditional Chinese medicine based on hyperspectral imaging in the storage media are read or executed by an electronic device, the intelligent monitoring method for decoction of traditional Chinese medicine based on hyperspectral imaging as described in any of the above embodiments can be realized.
[0112] Furthermore, the functional modules in the embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional module.
[0113] If the integrated unit is implemented as a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the method of this embodiment. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0114] It should be understood that the phrases "one embodiment," "an embodiment," or "some embodiments" mentioned throughout the specification mean that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment," "in one embodiment," or "in some embodiments" appearing throughout the specification do not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of this application, the sequence numbers of the above-described processes do not imply a sequential order of execution; the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. The sequence numbers of the embodiments in this application are merely for descriptive purposes and do not represent the superiority or inferiority of the embodiments. The descriptions of the various embodiments above tend to emphasize the differences between the various embodiments; their similarities or commonalities can be referred to mutually, and for the sake of brevity, these will not be repeated here.
[0115] The modules described above as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules. They may be located in one place or distributed across multiple network units. Some or all of the modules may be selected to achieve the purpose of this embodiment according to actual needs.
[0116] In addition, each functional module in the various embodiments of this application can be integrated into one processing unit, or each module can be a separate unit, or two or more modules can be integrated into one unit; the integrated modules can be implemented in hardware or in the form of hardware plus software functional units.
[0117] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as mobile storage devices, read-only memory (ROM), magnetic disks, or optical disks.
[0118] The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
[0119] The features disclosed in the several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0120] The features disclosed in the several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method or device embodiments.
[0121] The above description is merely an implementation method of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present application should be included within the protection scope of the present application.
Claims
1. A method for intelligent monitoring of traditional Chinese medicine decoction based on hyperspectral imaging, characterized in that, The method includes: Acquire traditional Chinese medicine prescription information, the standard decoction spectral feature map and safety boundary parameters corresponding to the traditional Chinese medicine prescription information, and the hyperspectral image of the decoction area during the decoction process corresponding to the traditional Chinese medicine prescription information; Based on the hyperspectral image of the drug liquid region, the effective region of interest is identified to obtain the effective region of interest; Data extraction and filtering are performed based on the effective region of interest to determine a reliable band spectral data sequence; wherein, the reliable band spectral data sequence includes reliable band spectral data at multiple consecutive time points; Based on the reliable band spectral data sequence and the standard decoction spectral feature map, a stability index is calculated to obtain a normalized comprehensive stability index and a normalized comprehensive stability index change rate; wherein, the normalized comprehensive stability index is used for decoction stage identification, and the normalized comprehensive stability index change rate is used for decoction completion determination. The current cooking stage is determined by identifying the cooking stage based on the normalized comprehensive stability index, the rate of change of the normalized comprehensive stability index, and the safety boundary parameter.
2. The method according to claim 1, characterized in that, The identification of effective regions of interest based on the hyperspectral image of the drug liquid region, to obtain the effective regions of interest, includes: The hyperspectral image of the drug liquid region is subjected to band separation to obtain a visible light band image sequence and a near-infrared band image sequence. Then, the visible light band image sequence and the near-infrared band image sequence are subjected to image fusion processing to obtain a visible light spectral fusion image and a near-infrared spectral fusion image. Based on the visible light spectral fusion image and the near-infrared spectral fusion image, pixel difference calculation and normalization are performed to obtain the residual spectral image; Based on the residual spectral image and the hyperspectral image of the drug solution region, effective regions of interest are screened to determine the effective regions of interest.
3. The method according to claim 2, characterized in that, The process of filtering effective regions of interest based on the residual spectral image and the hyperspectral image of the drug solution region, and determining the effective regions of interest, includes: Based on the first preset pixel step size, the residual spectral image and the hyperspectral image of the drug liquid region are respectively divided into regions to obtain multiple first rectangular sub-regions corresponding to the residual spectral image and multiple second rectangular sub-regions corresponding to each frame of the hyperspectral image of the drug liquid region. Based on the multiple first rectangular sub-regions corresponding to the residual spectral image, a non-smoke region is determined, and based on the multiple second rectangular sub-regions corresponding to each frame of the hyperspectral image of the drug liquid region, a stable region is determined. Based on the non-smoke region and the stable region, an intersection operation is performed to determine the effective region of interest.
4. The method according to claim 3, characterized in that, The process of determining non-smoke regions based on multiple first rectangular sub-regions corresponding to the residual spectral image, and determining stable regions based on multiple second rectangular sub-regions corresponding to each frame of the hyperspectral image of the drug liquid region, includes: The first gray mean and first variance of each of the multiple first rectangular sub-regions corresponding to the residual spectral image are calculated respectively. The first rectangular sub-region corresponding to the first gray mean with the highest frequency is determined as the first marked region. The first target rectangular sub-region in the first marked region with a first variance less than a first preset variance threshold is determined as the non-smoky region. The second gray mean and second variance of each of the multiple second rectangular sub-regions corresponding to each frame of the hyperspectral image of the drug liquid region are calculated respectively. The second rectangular sub-region corresponding to the second gray mean with the highest frequency is determined as the second marked region. The second target rectangular sub-region in the second marked region with a second variance less than the second preset variance threshold is determined as the third marked region. The stable region is determined by calculating the spatial intersection of the third marked region in each frame of the hyperspectral image of the drug liquid region.
5. The method according to claim 1, characterized in that, The step of extracting and filtering data based on the effective region of interest to determine a reliable band spectral data sequence includes: For each frame of the hyperspectral image of the drug liquid region, spectral feature data of the effective region of interest is extracted, and the volatility index of the effective region of interest is calculated; wherein, the spectral feature data is the gray value of all pixels in the corresponding band within the effective region of interest; and the volatility index is the standard deviation or variance of the pixel values within the effective region of interest. Based on the spectral feature data, median calculation and data construction are performed to determine the full-band spectral data at each time point; Based on the volatility index, calculate the stability confidence level; Based on the full-band spectral data and the stability confidence level, data is filtered using a stability confidence level threshold and a minimum number of spectra threshold to determine the reliable band spectral data for each moment. Based on the reliable band spectral data at each time point, the reliable band spectral data sequence is determined.
6. The method according to claim 1, characterized in that, The stability index is calculated based on the reliable band spectral data sequence and the standard decoction spectral feature map to obtain the normalized comprehensive stability index and the normalized comprehensive stability index change rate, including: Based on the reliable band spectral data sequence and the standard decoction spectral feature map, time alignment and data format processing are performed to determine the reliable band spectral data, time sequence matrix, and standard spectral matrix at the current moment; wherein, the time sequence matrix includes reliable band spectral data at k+1 moments; where k is a positive integer greater than 0; Based on the reliable band spectral data at the current moment and the standard spectral matrix, spectral features are extracted to determine the spectral features; Based on the time series matrix and the standard graph matrix, time series trend features are extracted to determine the time series trend features; The spectral features and the temporal trend features are fused to obtain comprehensive feature data. Based on the comprehensive feature data, a stability index is calculated to obtain the normalized comprehensive stability index and the normalized comprehensive stability index change rate.
7. The method according to claim 1, characterized in that, The safety boundary parameters include a minimum cooking time threshold. Accordingly, the step of identifying the current decoction stage based on the normalized comprehensive stability index, the rate of change of the normalized comprehensive stability index, and the safety boundary parameter includes: Based on the normalized comprehensive stability index and the rate of change of the normalized comprehensive stability index, the decoction stage is identified, and the initial decoction stage is determined. Obtain the duration of the initial simmering stage and the current simmering time; If the normalized comprehensive stability index is greater than or equal to a first threshold, the rate of change of the normalized comprehensive stability index is less than a second threshold, the current simmering time is greater than the minimum simmering time threshold, and the stage maintenance time is greater than a preset maintenance time threshold, then the current simmering stage is determined to be simmering complete.
8. A hyperspectral-based intelligent monitoring system for traditional Chinese medicine decoction, characterized in that, The hyperspectral-based intelligent monitoring system for traditional Chinese medicine decoction includes: an acquisition module, a determination module, a calculation module, and a judgment module, wherein... The acquisition module is used to acquire traditional Chinese medicine prescription information, standard decoction spectral feature map and safety boundary parameters corresponding to the traditional Chinese medicine prescription information, and hyperspectral image of the decoction area during the decoction process corresponding to the traditional Chinese medicine prescription information. The determining module is used to identify effective regions of interest based on the hyperspectral image of the drug liquid region to obtain effective regions of interest; and to extract and filter data based on the effective regions of interest to determine a reliable band spectral data sequence; wherein, the reliable band spectral data sequence includes reliable band spectral data at multiple consecutive time points; The calculation module is used to calculate the stability index based on the reliable band spectral data sequence and the standard decoction spectral feature map, to obtain the normalized comprehensive stability index and the normalized comprehensive stability index change rate; wherein, the normalized comprehensive stability index is used for decoction stage identification, and the normalized comprehensive stability index change rate is used for decoction completion determination. The judgment module is used to identify the current decocting stage based on the normalized comprehensive stability index, the rate of change of the normalized comprehensive stability index, and the safety boundary parameter.
9. A smart monitoring device for traditional Chinese medicine decoction based on hyperspectral imaging, characterized in that, include: Processor and memory, of which, The memory is used to store computer programs; The processor is configured to call and run the computer program from the memory to perform the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The device stores executable instructions for causing a processor to execute the method according to any one of claims 1 to 7.