Intelligent traditional Chinese medicinal material processing equipment and method based on AI assistance
By introducing AI technology into the preparation equipment for Chinese medicinal materials, real-time detection and regulation of the shape and composition of Chinese medicinal materials has been solved, and the problems of unstable production quality and lack of intelligence in existing equipment have been improved, and the preparation efficiency and quality of Chinese medicinal materials have been improved.
Patent Information
- Application Number
- CN202510287201.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-12
- Publication Date
- 2025-04-11
AI Technical Summary
The technical level of existing Chinese medicinal materials preparation equipment is backward and lacks intelligence and automation, resulting in unstable production quality and inability to achieve precise control.
Using intelligent manufacturing equipment based on AI, Chinese medicinal materials are tested and monitored in real time through appearance and form detection module and chemical composition detection module, and combined with the main control module to control temperature and humidity in real time to achieve accurate control of the manufacturing process.
The preparation efficiency and quality of traditional Chinese medicinal materials are improved, and the preparation process is automated and intelligent, ensuring accurate judgment of the preparation end point and rapid analysis of key biological potency components.
Smart Images

Figure CN119792086A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of Chinese medicinal material processing, and specifically relates to an AI-assisted Chinese medicinal material intelligent processing device and method. Background Art
[0002] The processing of Chinese herbal medicines is an indispensable part of the clinical application of Chinese medicines. It is of great significance in improving the efficacy of herbal medicines, reducing the toxicity of herbal medicines and improving the adaptability of herbal medicines. Since the continuous innovation of the Chinese herbal medicine processing industry in the 1970s, the application of Chinese herbal medicine processing equipment has improved the efficiency and quality of Chinese herbal medicine processing. The use of Chinese herbal medicine processing equipment can reduce the interference of human factors, improve the stability, controllability and consistency of the processing process, thereby ensuring the quality and stability of the efficacy of Chinese herbal medicines. In addition, the introduction of Chinese herbal medicine processing equipment can realize the automated monitoring and data recording of the Chinese herbal medicine processing process, improve the traceability and controllability of the processing process, and also improve the utilization rate and production efficiency of Chinese herbal medicine resources, save labor costs, and meet the needs of large-scale production.
[0003] However, the overall technical level of Chinese medicinal materials processing equipment on the market is still relatively backward. Specifically: ① The endpoint of traditional processing often relies on manual operation and experience judgment. There are differences in processing techniques in various regions and lack of standardization, resulting in uneven processing quality; ② The correlation between the appearance morphological characteristics of Chinese medicinal materials during the processing process and the changes in key biological efficacy components is unclear, and cannot be used as an indicator control point for the processing process, so there is a lack of objective and quantitative indicators; ③ The degree of automation and intelligence is poor.
[0004] Therefore, the development of an intelligent processing equipment that can automatically identify Chinese medicinal materials, intelligently monitor the processing process and control the processing parameters is of great significance to promoting the advancement of Chinese medicinal materials processing technology and industrial upgrading. Summary of the invention
[0005] In order to overcome the shortcomings of the prior art, the present invention provides an AI-assisted intelligent processing equipment for Chinese medicinal materials, which can perform real-time detection and monitoring of the shape and composition of Chinese medicinal materials during the processing to determine the end point of the processing of Chinese medicinal materials, thereby achieving precise control of the processing process and rapid analysis of key biological efficacy components, thereby improving the processing efficiency and the quality of Chinese medicinal materials.
[0006] The second object of the present invention is to provide an AI-assisted intelligent processing method for Chinese medicinal materials.
[0007] The technical solution of the present invention to solve the above technical problems is:
[0008] An AI-assisted intelligent processing equipment for Chinese herbal medicines includes a processing room, an appearance morphology detection module for detecting the appearance morphology characteristics of the Chinese herbal medicines in the processing room, a chemical component detection module for analyzing the key biological efficacy components of the Chinese herbal medicines in the processing room, and a main control module, wherein:
[0009] The processing room is used to process Chinese medicinal materials;
[0010] The appearance morphology detection module includes an image acquisition module and an AI image recognition module, wherein the image acquisition module is used to collect image information of Chinese medicinal materials in the processing room, and send the collected Chinese medicinal materials processing images to the AI image recognition module; the AI image recognition module analyzes the Chinese medicinal materials processing images based on its internal Chinese medicinal materials recognition model to determine the processing process of the Chinese medicinal materials, and the AI image recognition module sends the recognition results to the main control module;
[0011] The chemical component detection module includes a sampling module and a chemical component analysis module for detecting the chemical components in the sample taken out by the sampling module; when the AI image recognition module recognizes that the Chinese medicinal materials in the processing room need to be detected, the main control module controls the sampling module to take out the sample from the processing room; the chemical component analysis module analyzes the chemical components in the sample and sends the analysis results to the main control module;
[0012] The main control module controls the temperature and humidity in the preparation room in real time based on the recognition result of the AI image recognition module and the analysis result of the chemical composition detection module.
[0013] Preferably, it further comprises a control logic module, wherein the control logic module comprises a temperature control module for controlling the temperature in the processing room and a humidity control module for controlling the humidity in the processing room, wherein:
[0014] The temperature control module includes a temperature sensor and a temperature control unit arranged in the processing room; the temperature sensor is used to detect the temperature data in the processing room and transmit the temperature data to the main control module; the temperature control unit is used to receive the temperature control instruction issued by the main control module to drive the heater in the processing room to work and adjust the temperature in the processing room;
[0015] The humidity control module includes a humidity sensor and a humidity control unit arranged in the processing room. The humidity sensor is used to detect the humidity data in the processing room and transmit the humidity data to the main control module; the humidity control unit is used to receive the humidity control instructions issued by the main control module to drive the humidifier and dehumidifier in the processing room to work and adjust the humidity in the processing room.
[0016] Preferably, it also includes a human-computer interaction module, which is used for operators to set key process parameters, and the key process parameters include the temperature, humidity and detection frequency of Chinese medicinal materials during the processing process; the human-computer interaction module is also used to display in real time the environmental status in the processing room, the recognition results of the AI image recognition module, and the analysis results of the chemical composition analysis module.
[0017] Preferably, the main control module includes an input unit, a CPU processor, a feedback unit, an analog-to-digital conversion unit and a communication module, wherein the input unit receives the temperature, humidity and detection frequency set by the human-computer interaction module, and transmits them to the CPU processor; the CPU processor generates an optimization control signal; the analog-to-digital conversion unit is used to convert the temperature signal and humidity signal collected by the temperature sensor and the humidity sensor into digital signals and transmit them to the feedback unit; the feedback unit dynamically adjusts the temperature signal and the humidity signal through a built-in feedback adjustment algorithm, and uploads the adjusted temperature signal and humidity signal to the CPU processor; the communication module is used to transmit the recognition results of the AI image recognition module and the analysis results of the chemical composition analysis module to the CPU processor, and synchronize them to the display interface of the human-computer interaction module for real-time monitoring by the operator.
[0018] Preferably, the image acquisition module is a COMS camera; and the chemical composition analysis module adopts a liquid chromatography-mass spectrometer.
[0019] An AI-assisted intelligent processing method for Chinese herbal medicines comprises the following steps:
[0020] Step 1: The operator inputs key process parameters through the human-computer interaction module, wherein the key process parameters include the temperature, humidity and detection frequency of the Chinese medicinal materials during the processing;
[0021] Step 2: The main control module generates a temperature control instruction and a humidity control instruction according to the input temperature parameters and humidity parameters, and sends the temperature control instruction and the humidity control instruction to the temperature control unit and the humidity control unit respectively; the temperature control unit controls the temperature in the processing room by controlling the power of the heater in the processing room; the humidity control unit controls the humidity in the processing room by controlling the power of the humidifier or dehumidifier in the processing room;
[0022] Step 3: When the set detection time is reached, the image acquisition module collects the processing images of the Chinese medicinal materials in the processing room, and transmits the collected processing images of the Chinese medicinal materials to the AI image recognition module. The AI image recognition module recognizes the processing images of the Chinese medicinal materials through the constructed Chinese medicinal materials recognition model to judge the processing process of the Chinese medicinal materials, and sends the recognition results to the main control module; when it is necessary to detect the Chinese medicinal materials in the processing room, the main control module controls the sampling module to take out part of the Chinese medicinal materials in the processing room as samples and transmit them to the chemical composition analysis module. The chemical composition analysis module analyzes the chemical components in the samples and sends the analysis results to the main control module;
[0023] Step 4: The main control module adjusts the temperature and humidity in the preparation room in real time according to the recognition results of the AI image recognition module and the analysis results of the chemical composition detection module.
[0024] Preferably, in step 3, the Chinese medicinal material identification model includes a Chinese medicinal material processing image segmentation model and a processing degree comprehensive scoring model, and the specific construction steps are:
[0025] Step S1: collecting images of Chinese medicinal material processing;
[0026] Step S2: pre-processing the Chinese medicinal material processing image;
[0027] Step S3: performing data enhancement on the preprocessed Chinese medicinal material processing images to obtain a data set of Chinese medicinal material processing images; the data enhancement includes horizontal flipping, vertical flipping and adjusting image contrast;
[0028] Step S4: randomly dividing the dataset of Chinese medicinal material processing images into a training set, a validation set, and a test set in a ratio of 7:2:1;
[0029] Step S5: determining a loss function and an evaluation index for evaluating the segmentation performance of the Chinese medicinal material processing image segmentation model, wherein the loss function adopts a weighted cross entropy loss function; and the evaluation index adopts a Dice similarity coefficient, a relative color difference, and a color error coverage rate;
[0030] Step S6: construct a multi-scale attention module and integrate it into the Attention-UNet model to obtain a Chinese medicinal material processing image segmentation model;
[0031] Step S7: using the training set to train the constructed Chinese medicinal material processing image segmentation model, recording the loss value after each round of training, selecting the round number corresponding to the minimum loss value in the entire training cycle, and taking the weight parameter of the Chinese medicinal material processing image segmentation model at the end of the round of training as the final weight; loading the final weight obtained in the training stage into the Chinese medicinal material processing image segmentation model, and sending the Chinese medicinal material processing images divided into the test set into the Chinese medicinal material processing image segmentation model for testing, and finally obtaining the predicted segmentation image of the Chinese medicinal material processing image and the corresponding index parameters;
[0032] Step S8: construct a comprehensive scoring model for the degree of processing, and send the index parameters output by the Chinese medicinal material processing image segmentation model into the comprehensive scoring model for the degree of processing. The comprehensive scoring model for the degree of processing outputs a comprehensive score, and determines whether the processing has reached the end by judging whether the comprehensive score is greater than a preset threshold; when the comprehensive score is greater than or equal to the preset threshold, it is determined that the processing process has reached the end; when the comprehensive score is less than the preset threshold, it is determined that the processing process has not reached the end.
[0033] Preferably, in step S8, the steps of constructing the comprehensive scoring model for the processing degree are:
[0034] Step S801: Obtain the morphological features in the index parameters predicted by the Chinese medicinal material processing image segmentation model, perform weighted processing on the obtained morphological features, compare the current morphological features after weighted processing with the corresponding morphological features in the standard sample, calculate the similarity between the two, and express the calculated score in normalized form. The final morphological feature score S is:
[0035] ; Where: actual morphological feature value: the morphological feature value collected in real time during the processing of Chinese medicinal materials; initial value: the morphological feature value extracted from the high-definition image of the Chinese medicinal materials before processing; target value: the ideal morphological feature value established according to the processing endpoint quality standard;
[0036] Step S802: Obtain the color features in the index parameters predicted by the Chinese medicinal material processing image segmentation model, extract the color space parameters, and calculate the color deviation and color uniformity index by weighted calculation. The final color feature score C is:
[0037] ;
[0038] in, Indicates the difference between the current color and the target color; Indicates the maximum color difference value;
[0039] Step S803: Calculate the final comprehensive score:
[0040] ;
[0041] Where S is the morphological feature score and C is the color feature score.
[0042] Preferably, in step S8, the preset threshold is 0.85; when Score ≥ 0.85, it indicates that the preparation process has reached the predetermined level and the preparation is completed; when Score < 0.85, it indicates that the preparation process is not yet completed and needs to be further monitored and adjusted.
[0043] Preferably, in step 4, when the temperature and humidity in the processing room need to be controlled in real time, the temperature sensor and humidity sensor arranged in the processing room respectively detect the temperature data and humidity data in the processing room in real time, and transmit the detected temperature data and humidity data to the main control module; the main control module is adjusted through the PID algorithm, and outputs the optimized temperature signal and humidity signal to the CPU processor, and the CPU processor sends the optimized temperature signal and humidity signal to the temperature control unit and the humidity control unit respectively.
[0044] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0045] 1. The intelligent processing equipment for Chinese medicinal materials of the present invention is used to monitor and detect the shape and composition of medicinal materials in real time during the processing process, so as to intelligently judge the end point of processing; through efficient data acquisition and processing, image recognition technology and integrated linkage of liquid phase mass spectrometer, precise control of the processing process and rapid analysis of key biological efficacy components are achieved, thereby improving the processing efficiency and the quality of Chinese medicinal materials.
[0046] 2. The intelligent processing equipment for Chinese medicinal materials of the present invention realizes fully automated operation from processing process monitoring to real-time sample analysis through the collaborative work of the processing room, image recognition module, sampling module and liquid chromatography-mass spectrometry, ensuring the accuracy of the processing process and the reliability of the results. The collaborative work of each module can significantly improve the experimental efficiency, enhance the level of intelligence, and make the processing process more efficient and accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 This is a structural block diagram of the AI-assisted intelligent processing equipment for Chinese medicinal materials of the present invention. DETAILED DESCRIPTION
[0048] The present invention is further described in detail below in conjunction with embodiments and drawings, but the embodiments of the present invention are not limited thereto.
[0049] See also Figure 1The AI-assisted intelligent processing equipment for Chinese medicinal materials of the present invention comprises a processing room, an appearance morphology detection module for detecting the appearance morphology characteristics of the Chinese medicinal materials in the processing room, a chemical component detection module for analyzing the key biological efficacy components of the Chinese medicinal materials in the processing room, and a main control module, wherein:
[0050] The processing room is used to process Chinese medicinal materials;
[0051] The appearance morphology detection module includes an image acquisition module and an AI image recognition module, wherein the image acquisition module is used to collect image information of Chinese medicinal materials in the processing room, and send the collected Chinese medicinal materials processing images to the AI image recognition module; the AI image recognition module analyzes the Chinese medicinal materials processing images based on its internal Chinese medicinal materials recognition model to determine the processing process of the Chinese medicinal materials, and the AI image recognition module sends the recognition results to the main control module;
[0052] The chemical component detection module includes a sampling module and a chemical component analysis module for detecting the chemical components in the sample taken out by the sampling module; when the AI image recognition module recognizes that the Chinese medicinal materials in the processing room need to be detected, the main control module controls the sampling module to take out the sample from the processing room; the chemical component analysis module analyzes the chemical components in the sample and sends the analysis results to the main control module;
[0053] The main control module controls the temperature and humidity in the preparation room in real time based on the recognition result of the AI image recognition module and the analysis result of the chemical composition detection module.
[0054] In this embodiment, the components of Chinese herbal medicines are tested in the following two situations:
[0055] First, when the AI image recognition module recognizes that the processing has reached the end point, the main control module controls the sampling module to take out part of the Chinese medicinal materials in the processing room as samples and transport them to the chemical composition analysis module. The chemical composition analysis module analyzes the chemical components in the sample and sends the analysis results to the main control module;
[0056] Second, when the operator needs to extract Chinese medicinal materials for testing, the sampling module can also be manually started to take out part of the Chinese medicinal materials in the processing room as samples and transport them to the chemical composition analysis module. The chemical composition analysis module analyzes the chemical composition in the sample and sends the analysis results to the main control module.
[0057] See also Figure 1The AI-assisted intelligent processing equipment for Chinese medicinal materials of the present invention also includes a control logic module, which includes a temperature control module for regulating the temperature in the processing room and a humidity control module for regulating the humidity in the processing room, wherein the temperature control module includes a temperature sensor and a temperature control unit arranged in the processing room; the temperature sensor is used to detect the temperature data in the processing room and transmit the temperature data to the main control module; the temperature control unit is used to receive the temperature control instruction issued by the main control module to drive the heater in the processing room to work to adjust the temperature in the processing room; the humidity control module includes a humidity sensor and a humidity control unit arranged in the processing room, the humidity sensor is used to detect the humidity data in the processing room and transmit the humidity data to the main control module; the humidity control unit is used to receive the humidity control instruction issued by the main control module to drive the humidifier and dehumidifier in the processing room to adjust the humidity in the processing room.
[0058] In this embodiment, the module operation processing unit in the temperature control unit and the humidity control unit performs real-time analysis of the input signal based on a preset control algorithm, judges and dynamically optimizes the control output through multi-level thresholds, and the output interface transmits the optimized instructions to the execution device. The module operation processing unit has a closed-loop feedback function and can respond quickly according to changes in environmental parameters to ensure the stability and accuracy of the preparation conditions.
[0059] See also Figure 1 The AI-assisted intelligent processing equipment for Chinese medicinal materials of the present invention also includes a human-computer interaction module (HMI), which is used for operators to set key process parameters, and the key process parameters include the temperature, humidity and detection frequency of Chinese medicinal materials during the processing process; the human-computer interaction module is also used to display the environmental status in the processing room, the recognition results of the AI image recognition module and the analysis results of the chemical composition analysis module in real time.
[0060] The above settings have the following advantages:
[0061] The human-machine interaction module (HMI) serves as an interactive bridge between the system and the operator. It supports the setting of key process parameters such as temperature, humidity and detection frequency during the preparation process, and displays the environmental status, AI image recognition results and liquid mass spectrometry detection data in real time. Through the human-machine interaction module (HMI), operators can intuitively monitor the preparation process, adjust the operation strategy, and ensure the precise control of the preparation conditions and the efficient execution of the experimental process; the design of the human-machine interaction interface should focus on the convenience of operation and the comprehensive presentation of information to improve the intelligence level of the system.
[0062] See also Figure 1The main control module includes an input unit, a CPU processor, a feedback unit, an analog-to-digital conversion (ADC) unit and a communication module, wherein the input unit receives the temperature, humidity and detection frequency set by the human-computer interaction module and transmits them to the CPU processor; the CPU processor generates an optimization control signal according to the set value; the analog-to-digital conversion unit is used to convert the temperature signal and humidity signal collected by the temperature sensor and the humidity sensor into digital signals and transmit them to the feedback unit; the feedback unit dynamically adjusts the temperature signal and humidity signal through a built-in feedback adjustment algorithm, and uploads the adjusted temperature signal and humidity signal to the CPU processor; the communication module (based on a unified communication protocol) is used to transmit the recognition results of the AI image recognition module and the analysis results of the chemical composition analysis module to the CPU processor, and synchronize them to the HMI display interface for real-time monitoring by operators, so as to realize precise control of the preparation process and data-driven intelligent management.
[0063] See also Figure 1 The image acquisition module is an industrial camera or a high-resolution COMS camera.
[0064] See also Figure 1 The chemical composition analysis module adopts liquid chromatography-mass spectrometry (LC-MS) technology to perform qualitative and quantitative analysis on samples collected by the sampling module in the processing room. The chemical composition analysis module separates the components in the sample by high performance liquid chromatography, and uses a mass spectrometer to detect the components and analyze the structure to generate detailed detection data. The detection data includes substance concentration, molecular weight and characteristic peak information. The chemical composition analysis module has high sensitivity and high resolution, and can accurately identify trace substances and complex mixtures. The detection results are transmitted to the main control module through the communication module and displayed on the HMI for reference by the operator, so as to assist in judging the processing status and optimizing the process conditions, and realize in-depth analysis and intelligent control of the processing process. In this embodiment, the chemical composition analysis module adopts a liquid chromatography-mass spectrometer.
[0065] In this system, the operator sets the process parameters such as temperature, humidity and detection frequency required in the processing process through the human-machine interface (HMI). These set values are collected by the input unit and transmitted to the main control module; the CPU processor in the main control module receives the set values and generates an optimization control signal based on the preset control algorithm (PID algorithm); the optimization control signal is processed and transmitted to the control logic module, and the temperature control unit and the humidity control unit respectively drive the heater, humidifier and dehumidifier to work to ensure the stability of the ambient temperature and humidity in the processing room; wherein, the temperature sensor and humidity sensor in the processing room monitor the environmental parameters in the processing room in real time, and the collected analog signals (temperature data and humidity data) are converted into digital signals by the analog-to-digital conversion (ADC) unit and transmitted to the feedback unit in the main control module; the feedback unit compares the real-time monitoring value with the set value to generate deviation information, and the CPU processor dynamically adjusts the control signal according to the deviation information to form a closed-loop control, thereby accurately adjusting the environmental parameters in the processing room; at the same time, the image acquisition module continuously obtains the processing images of Chinese medicinal materials in the processing room through a high-resolution CMOS camera, and transmits them The AI image recognition module analyzes the processing image of the Chinese medicinal materials based on the pre-trained Chinese medicinal materials recognition model, determines the processing process of the Chinese medicinal materials (such as morphological characteristics, color changes, etc.) and determines whether the processing process has reached the end point; the recognition result is sent to the main control module through the communication module, and is synchronously displayed on the HMI interface for the operator to monitor the processing status in real time; when the processing process reaches the end point determined by the AI image recognition module or needs to be detected, the sampling module (such as a manipulator) automatically extracts the sample from the processing room and transmits the sample to a liquid chromatography-mass spectrometer (LC-MS) for qualitative and quantitative analysis; the liquid chromatography-mass spectrometer uses its high sensitivity and high resolution to accurately detect the chemical composition, structure and concentration of the sample; the detection data is returned to the main control module via the communication module, and is displayed in the HMI interface after being processed by the CPU processor, and is linked with the data of the processing status of the Chinese medicinal materials to provide the operator with comprehensive processing process and result information.
[0066] See also Figure 1 The AI-assisted intelligent processing method of Chinese herbal medicine of the present invention comprises the following steps:
[0067] Step 1: The operator inputs key process parameters through the human-computer interaction module, wherein the key process parameters include the temperature, humidity and detection frequency of the Chinese medicinal materials during the processing process;
[0068] Step 2: The main control module generates a temperature control instruction and a humidity control instruction according to the input temperature parameters and humidity parameters, and sends the temperature control instruction and the humidity control instruction to the temperature control unit and the humidity control unit respectively; the temperature control unit controls the temperature in the processing room by controlling the power of the heater in the processing room; the humidity control unit controls the humidity in the processing room by controlling the power of the humidifier or dehumidifier in the processing room;
[0069] Step 3: When the set detection time is reached, the image acquisition module collects the processing images of the Chinese medicinal materials in the processing room, and transmits the collected processing images of the Chinese medicinal materials to the AI image recognition module. The AI image recognition module recognizes the processing images of the Chinese medicinal materials through the constructed Chinese medicinal materials recognition model to judge the processing process of the Chinese medicinal materials, and sends the recognition results to the main control module; when it is necessary to detect the Chinese medicinal materials in the processing room, the main control module controls the sampling module to take out part of the Chinese medicinal materials in the processing room as samples and transmit them to the chemical composition analysis module. The chemical composition analysis module analyzes the chemical components in the samples and sends the analysis results to the main control module;
[0070] Step 4: The main control module adjusts the temperature and humidity in the preparation room in real time according to the recognition results of the AI image recognition module and the analysis results of the chemical composition detection module.
[0071] In step 3, the Chinese medicinal material recognition model includes a Chinese medicinal material processing image segmentation model and a processing degree comprehensive scoring model, and the specific construction steps are:
[0072] Step S1: collecting images of Chinese medicinal material processing;
[0073] Step S2: preprocessing the processed Chinese medicinal materials images; wherein the preprocessing step is: while keeping the resolution ratio unchanged, by cropping the image boundary and centering the image, using histogram equalization and elastic deformation on the data, the final resolution of the processed Chinese medicinal materials images is 512×512;
[0074] In this embodiment, after preprocessing the Chinese medicinal material processing images, a total of 5000 two-dimensional Chinese medicinal material processing images are obtained;
[0075] Step S3: performing data enhancement on the preprocessed Chinese medicinal material processing images to obtain a data set of Chinese medicinal material processing images; the data enhancement includes horizontal flipping, vertical flipping and adjusting the image contrast to enhance the generalization ability of the model;
[0076] Step S4: randomly dividing the dataset of Chinese medicinal material processing images into a training set, a validation set, and a test set in a ratio of 7:2:1;
[0077] In this embodiment, the training set, validation set, and test set contain 3500, 1000, and 500 images of Chinese medicinal material processing, respectively;
[0078] Step S5: Determine a loss function and an evaluation index for evaluating the segmentation performance of the Chinese medicinal material processing image segmentation model, wherein:
[0079] Since the image segmentation problem of Chinese medicinal materials processing is a pixel-level classification problem, the number of pixels is different compared with the number of pixels in different processing stages, and there is a problem of sample imbalance. If it is not properly handled, the learning ability of the model will be reduced. Therefore, the loss function in this embodiment adopts a weighted cross entropy loss function;
[0080] ; Where: y is the true label of the sample; y takes the value of 0 or 1; when y=1, it means that the sample belongs to the positive class; when y=0, it means that the sample belongs to the negative class; p represents the probability that the model predicts that the sample belongs to the positive class, and the value range is [0,1]; (1-p) is the probability that the model predicts that the sample belongs to the negative class; a is the weight coefficient, calculated based on: ,in represents the number of negative samples (the number of pixels processed), Represents the number of positive samples (the number of pixels that are not completed);
[0081] The evaluation indexes include Dice similarity coefficient, relative color difference (RCD) and color error coverage (COE), where:
[0082] The Dice similarity coefficient represents the ratio of the total area occupied by the intersection between the predicted result and the true label, and its value range is 0 to 1. The larger the value, the closer the predicted result is to the true label, that is, the better the segmentation effect.
[0083] ;
[0084] The relative color difference (RCD) indicates the relative difference in color area between the predicted result and the true label. The value can be positive or negative. When this coefficient is less than 0, it means under-segmentation, and when it is greater than 0, it means over-segmentation.
[0085] ;
[0086] Color Error Overlap (COE) indicates the proportion of the non-overlapping part between the predicted color area and the true color area in the total area, which measures the prediction error of the color area. Similar to the Dice coefficient above, the value range is 0 to 1. The larger the value, the smaller the overlap between the predicted result and the true label, that is, the worse the segmentation performance.
[0087] ;
[0088] In the above formula, P represents the segmentation result predicted by the model, and T represents the actual segmentation result.
[0089] Step S6: construct a multi-scale attention module and integrate it into the Attention-UNet model to obtain a Chinese medicinal material processing image segmentation model;
[0090] In this embodiment, the image segmentation task requires generating a cut region at a specified position of the original image. Therefore, this embodiment adopts the structure of an encoder and a decoder to ensure the size and proportion of the output image; uses the basic architecture of the U-net model, and introduces the AG gating mechanism to focus on the target area; in addition, the multi-scale attention mechanism is used to better extract feature information at different resolution levels by weighting feature maps of different scales, and effectively focus on the key areas of the image, thereby improving the segmentation effect;
[0091] In addition, feature maps of different scales are extracted through the encoder and input into the attention module, which automatically assigns different weights to each scale. The attention mechanism of the attention module can help the model focus on important areas, suppress irrelevant information, and avoid the occurrence of feature tearing problems. Multi-scale convolution and pooling operations are used to enable the model to process targets of different sizes at the same time, enhancing the ability to capture details and contextual information.
[0092] Step S7: using the training set to train the constructed Chinese medicinal material processing image segmentation model, recording the loss value after each round of training, selecting the round number corresponding to the minimum loss value in the entire training cycle, and taking the weight parameter of the Chinese medicinal material processing image segmentation model at the end of the round of training as the final weight; loading the final weight obtained in the training stage into the Chinese medicinal material processing image segmentation model, and sending the Chinese medicinal material processing images divided into the test set into the Chinese medicinal material processing image segmentation model for testing, and finally obtaining the predicted segmentation image of the Chinese medicinal material processing image and the corresponding index parameters; In this embodiment, the index parameters include morphological features (such as aspect ratio, surface roughness) and color features;
[0093] Step S8: construct a comprehensive scoring model for the degree of processing, and send the index parameters output by the Chinese medicinal material processing image segmentation model into the comprehensive scoring model for the degree of processing. The comprehensive scoring model for the degree of processing outputs a comprehensive score, and determines whether the processing has reached the end point by judging whether the comprehensive score is greater than a preset threshold; when the comprehensive score is greater than or equal to the preset threshold, it is determined that the processing has reached the end point; when the comprehensive score is less than the preset threshold, it is determined that the processing has not reached the end point.
[0094] In step S8, the steps of constructing the comprehensive scoring model for the processing degree are as follows:
[0095] Step S801: Obtain the morphological features (such as aspect ratio, surface roughness) in the index parameters predicted by the Chinese medicinal material processing image segmentation model, then perform weighted processing on the obtained morphological features, compare the current morphological features after weighted processing with the corresponding features in the standard sample, calculate the similarity between the two, and express the calculated score in normalized form. The final morphological feature score S is:
[0096] ; Among them, actual morphological feature value: the morphological feature value collected in real time during the processing of Chinese medicinal materials, which is obtained by quantitative analysis of the processing images of Chinese medicinal materials collected in real time during the processing, reflecting the apparent morphological evolution of materials in dynamic processing; initial value: the morphological feature value extracted based on the high-definition image of the Chinese medicinal materials before processing; including digital representation values such as morphological contour and texture features; target value: the ideal morphological feature value established according to the processing endpoint quality standard, which is obtained by feature mining the historical high-quality processed product image database.
[0097] The morphological feature score is quantified by evaluating the changes in the shape, surface state and size of the Chinese medicinal materials during the processing process. The calculation results of the morphological feature score can evaluate the appearance changes of the processing process in real time.
[0098] Step S802: Obtain the color features in the index parameters predicted by the Chinese medicinal material processing image segmentation model, extract the color space parameters (such as RGB, HSV, Lab), and calculate the color deviation and color uniformity index by weighted calculation. The final color feature score is:
[0099] ;
[0100] in, Indicates the difference between the current color and the target color; Indicates the maximum color difference value;
[0101] The color feature score quantifies the degree and uniformity of color changes in Chinese medicinal materials through a multi-scale attention mechanism. This color feature score can accurately capture the dynamic characteristics of color changes during the processing process.
[0102] Step S803: Calculate the final comprehensive score:
[0103] ;
[0104] Where S is the morphological feature score and C is the color feature score.
[0105] In step S8, the preset threshold is 0.85; when Score ≥ 0.85, it means that the preparation process has reached the predetermined level and the preparation is completed; when Score < 0.85, it means that the preparation process is not yet completed and needs to be further monitored and adjusted.
[0106] In step 4, when the temperature and humidity in the processing room need to be controlled in real time, the temperature sensor and humidity sensor installed in the processing room respectively detect the temperature data and humidity data in the processing room in real time, and transmit the detected temperature data and humidity data to the main control module; the main control module adjusts through the PID algorithm, and outputs the optimized temperature signal and humidity signal to the CPU processor, and the CPU processor sends the optimized temperature signal and humidity signal to the temperature control unit and the humidity control unit respectively.
[0107] Finally, if the AI image recognition module determines that the processed form of the Chinese herbal medicine meets the standard (comprehensive score ≥ 0.85), but the chemical composition analysis shows that the key components of the Chinese herbal medicine (such as the concentration of the active ingredient) do not meet the standard, the main control module will start the dynamic control mode; if the concentration of the target ingredient A is insufficient, the system may increase the temperature to a specific range (such as increasing the temperature from 60°C to 70°C) to accelerate the chemical reaction. At the same time, the system will automatically extend the processing time (such as extending it by 30 minutes) and monitor the changes in the chemical composition of the Chinese herbal medicine in real time until it meets the standard or reaches the maximum allowable processing time.
[0108] If the chemical composition of the Chinese medicinal materials still does not meet the standard after three consecutive dynamic adjustments, the system will trigger an alarm and display the specific deviation data (such as "the concentration of ingredient B is 20% lower than the standard value") through the human-computer interaction module (HMI); at this time, manual judgment (expert experience judgment) will be made to determine whether the processing of the Chinese medicinal materials has reached the processing endpoint or the Chinese medicinal materials cannot be processed; at the same time, all operation logs (including adjustment parameters and test results) are automatically stored in the database for subsequent analysis.
[0109] The above is a preferred embodiment of the present invention, but the embodiment of the present invention is not limited to the above content. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.
Claims
1. An AI-assisted intelligent processing device for Chinese herbal medicine, characterized in that: It includes a processing room, an appearance morphology detection module for detecting the appearance morphology characteristics of the Chinese medicinal materials in the processing room, a chemical component detection module for analyzing the key biological efficacy components of the Chinese medicinal materials in the processing room, and a main control module, wherein: The processing room is used to process Chinese medicinal materials; The appearance morphology detection module includes an image acquisition module and an AI image recognition module, wherein the image acquisition module is used to collect image information of Chinese medicinal materials in the processing room, and send the collected Chinese medicinal materials processing images to the AI image recognition module; the AI image recognition module analyzes the Chinese medicinal materials processing images based on its internal Chinese medicinal materials recognition model to determine the processing process of the Chinese medicinal materials, and the AI image recognition module sends the recognition results to the main control module; The chemical component detection module includes a sampling module and a chemical component analysis module for detecting the chemical components in the sample taken out by the sampling module; when the AI image recognition module recognizes that the Chinese medicinal materials in the processing room need to be detected, the main control module controls the sampling module to take out the sample from the processing room; the chemical component analysis module analyzes the chemical components in the sample and sends the analysis results to the main control module; The main control module controls the temperature and humidity in the preparation room in real time based on the recognition result of the AI image recognition module and the analysis result of the chemical composition detection module.
2. The AI-assisted intelligent processing equipment for Chinese herbal medicine according to claim 1 is characterized in that: It also includes a control logic module, which includes a temperature control module for controlling the temperature in the processing room and a humidity control module for controlling the humidity in the processing room, wherein: The temperature control module includes a temperature sensor and a temperature control unit arranged in the processing room; the temperature sensor is used to detect the temperature data in the processing room and transmit the temperature data to the main control module; the temperature control unit is used to receive the temperature control instruction issued by the main control module to drive the heater in the processing room to work and adjust the temperature in the processing room; The humidity control module includes a humidity sensor and a humidity control unit arranged in the processing room. The humidity sensor is used to detect the humidity data in the processing room and transmit the humidity data to the main control module; the humidity control unit is used to receive the humidity control instructions issued by the main control module to drive the humidifier and dehumidifier in the processing room to work and adjust the humidity in the processing room.
3. The AI-assisted intelligent processing equipment for Chinese herbal medicine according to claim 2 is characterized in that: It also includes a human-computer interaction module, which is used for operators to set key process parameters, including the temperature, humidity and detection frequency of Chinese medicinal materials during the processing process; the human-computer interaction module is also used to display in real time the environmental status in the processing room, the recognition results of the AI image recognition module, and the analysis results of the chemical composition analysis module.
4. The AI-assisted intelligent processing equipment for Chinese herbal medicine according to claim 3 is characterized in that: The main control module includes an input unit, a CPU processor, a feedback unit, an analog-to-digital conversion unit and a communication module, wherein the input unit receives the temperature, humidity and detection frequency set by the human-computer interaction module and transmits them to the CPU processor; the CPU processor generates an optimization control signal; the analog-to-digital conversion unit is used to convert the temperature signal and humidity signal collected by the temperature sensor and the humidity sensor into digital signals and transmit them to the feedback unit; the feedback unit dynamically adjusts the temperature signal and the humidity signal through a built-in feedback adjustment algorithm, and uploads the adjusted temperature signal and humidity signal to the CPU processor; the communication module is used to transmit the recognition results of the AI image recognition module and the analysis results of the chemical composition analysis module to the CPU processor, and synchronize them to the display interface of the human-computer interaction module for real-time monitoring by the operator.
5. The AI-assisted intelligent processing equipment for Chinese herbal medicine according to claim 1, characterized in that: The image acquisition module is a COMS camera; the chemical composition analysis module adopts a liquid chromatography-mass spectrometer.
6. A method for intelligent processing of Chinese medicinal materials using the AI-assisted intelligent processing equipment for Chinese medicinal materials according to any one of claims 1 to 5, characterized in that: The following steps are involved: Step 1: The operator inputs key process parameters through the human-computer interaction module, wherein the key process parameters include the temperature, humidity and detection frequency of the Chinese medicinal materials during the processing; Step 2: The main control module generates a temperature control instruction and a humidity control instruction according to the input temperature parameters and humidity parameters, and sends the temperature control instruction and the humidity control instruction to the temperature control unit and the humidity control unit respectively; the temperature control unit controls the temperature in the processing room by controlling the power of the heater in the processing room; the humidity control unit controls the humidity in the processing room by controlling the power of the humidifier or dehumidifier in the processing room; Step 3: When the set detection time is reached, the image acquisition module collects the processing images of the Chinese medicinal materials in the processing room, and transmits the collected processing images of the Chinese medicinal materials to the AI image recognition module. The AI image recognition module recognizes the processing images of the Chinese medicinal materials through the constructed Chinese medicinal materials recognition model to judge the processing process of the Chinese medicinal materials, and sends the recognition results to the main control module; when it is necessary to detect the Chinese medicinal materials in the processing room, the main control module controls the sampling module to take out part of the Chinese medicinal materials in the processing room as samples and transmit them to the chemical composition analysis module. The chemical composition analysis module analyzes the chemical components in the samples and sends the analysis results to the main control module; Step 4: The main control module adjusts the temperature and humidity in the preparation room in real time according to the recognition results of the AI image recognition module and the analysis results of the chemical composition detection module.
7. The intelligent processing method of Chinese herbal medicine according to claim 6, characterized in that: In step 3, the Chinese medicinal material recognition model includes a Chinese medicinal material processing image segmentation model and a processing degree comprehensive scoring model, and the specific construction steps are: Step S1: collecting images of Chinese medicinal material processing; Step S2: pre-processing the Chinese medicinal material processing image; Step S3: performing data enhancement on the preprocessed Chinese medicinal material processing images to obtain a data set of Chinese medicinal material processing images; the data enhancement includes horizontal flipping, vertical flipping and adjusting image contrast; Step S4: randomly dividing the dataset of Chinese medicinal material processing images into a training set, a validation set, and a test set in a ratio of 7:2:1; Step S5: determining a loss function and an evaluation index for evaluating the segmentation performance of the Chinese medicinal material processing image segmentation model, wherein the loss function adopts a weighted cross entropy loss function; and the evaluation index adopts a Dice similarity coefficient, a relative color difference, and a color error coverage rate; Step S6: construct a multi-scale attention module and integrate it into the Attention-UNet model to obtain a Chinese medicinal material processing image segmentation model; Step S7: using the training set to train the constructed Chinese medicinal material processing image segmentation model, recording the loss value after each round of training, selecting the round number corresponding to the minimum loss value in the entire training cycle, and using the weight parameter of the Chinese medicinal material processing image segmentation model at the end of the round of training as the final weight; The final weights obtained in the training phase are loaded into the Chinese medicinal materials processing image segmentation model, and the Chinese medicinal materials processing images classified into the test set are sent to the Chinese medicinal materials processing image segmentation model for testing, and finally the predicted Chinese medicinal materials processing image segmentation image and the corresponding index parameters are obtained; Step S8: construct a comprehensive scoring model for the degree of processing, and send the index parameters output by the Chinese medicinal material processing image segmentation model into the comprehensive scoring model for the degree of processing. The comprehensive scoring model for the degree of processing outputs a comprehensive score, and determines whether the processing has reached the end by judging whether the comprehensive score is greater than a preset threshold; when the comprehensive score is greater than or equal to the preset threshold, it is determined that the processing process has reached the end; when the comprehensive score is less than the preset threshold, it is determined that the processing process has not reached the end.
8. The intelligent processing method of Chinese medicinal materials according to claim 7, characterized in that: In step S8, the steps of constructing the comprehensive scoring model for the processing degree are as follows: Step S801: Obtain the morphological features in the index parameters predicted by the Chinese medicinal material processing image segmentation model, perform weighted processing on the obtained morphological features, compare the current morphological features after weighted processing with the corresponding morphological features in the standard sample, calculate the similarity between the two, and express the calculated score in normalized form. The final morphological feature score S is: ; Among them, actual morphological feature value: the morphological feature value that represents the real-time collection of Chinese medicinal materials during the processing process; initial value: the morphological feature value extracted based on the high-definition image of the Chinese medicinal materials before processing; target value: the ideal morphological feature value established according to the processing endpoint quality standard; Step S802: Obtain the color features in the index parameters predicted by the Chinese medicinal material processing image segmentation model, extract the color space parameters, and calculate the color deviation and color uniformity index by weighted calculation. The final color feature score C is: ; in, Indicates the difference between the current color and the target color; Indicates the maximum color difference value; Step S803: Calculate the final comprehensive score: ; Where S is the morphological feature score and C is the color feature score.
9. The intelligent processing method of Chinese medicinal materials according to claim 8, characterized in that: In step S8, the preset threshold is 0.85; when Score ≥ 0.85, it means that the preparation process has reached the predetermined level and the preparation is completed; when Score < 0.85, it means that the preparation process is not yet completed and needs to be further monitored and adjusted.
10. The intelligent processing method of Chinese herbal medicine according to claim 6, characterized in that: In step 4, when the temperature and humidity in the processing room need to be controlled in real time, the temperature sensor and humidity sensor installed in the processing room respectively detect the temperature data and humidity data in the processing room in real time, and transmit the detected temperature data and humidity data to the main control module; the main control module adjusts through the PID algorithm, and outputs the optimized temperature signal and humidity signal to the CPU processor, and the CPU processor sends the optimized temperature signal and humidity signal to the temperature control unit and the humidity control unit respectively.
Citation Information
Patent Citations
Automatic detecting system for quality of traditional Chinese medicines
CN101975845A
Processing method of decoction pieces of cape jasmine fruit
CN105079180A
Automatic titration device capable of detecting change in colour of solution based on machine vision and detection method thereof
CN105717111A
Traditional Chinese medicinal material identification method based on improved Resnet neural network
CN115761709A
Breast ultrasonic tomographic image segmentation model establishment method and segmentation method
CN116433586A
Cited By
Traditional Chinese medicinal material character identification method and system based on deep learning and microscopic image analysis
CN121811400A