A method and device for visualizing the endpoint determination of traditional Chinese medicine volatile oil extraction
By using industrial cameras and image processing algorithms to monitor the extraction process of volatile oils from traditional Chinese medicine in real time, the diameter of oil droplets can be automatically determined, which solves the problem of insufficient automation in the determination of the extraction endpoint of volatile oils from traditional Chinese medicine, and improves extraction efficiency and product consistency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-08
- Publication Date
- 2026-03-24
AI Technical Summary
Existing technologies rely on manual experience for endpoint determination during the extraction of volatile oils from traditional Chinese medicines. They have low automation levels and weak real-time monitoring capabilities, resulting in limitations in extraction efficiency and quality control.
An industrial camera is used to monitor the oil-water mixture in real time. The diameter of the oil droplets is extracted through image processing algorithms. The endpoint standard is set using a vision analysis system. Combined with modular design, the endpoint determination is automated.
It improves the accuracy and consistency of the volatile oil extraction process, reduces misjudgments and missed detections, lowers equipment costs and maintenance difficulty, and enhances production efficiency and product quality.
Smart Images

Figure CN119540931B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of traditional Chinese medicine, and particularly relates to a visual traditional Chinese medicine volatile oil extraction endpoint determination method and device. BACKGROUND
[0002] With the continuous development of the pharmaceutical industry, traditional Chinese medicine volatile oil gradually becomes the focus of research and production due to its unique pharmacological effects and wide application value. In the extraction process of volatile oil, the extraction endpoint needs to be accurately controlled to ensure the stability of product quality and efficacy. However, in the traditional extraction process, the endpoint determination mainly relies on manual experience and simple sampling analysis, which is difficult to meet the needs of continuous and accurate control in modern pharmaceutical production.
[0003] At present, the extraction process of traditional Chinese medicine volatile oil usually uses temperature control and pressure monitoring parameters as extraction control basis, and relies on the experience of operators to determine whether the extraction is completed. Although the process control is achieved to some extent, there is a great subjectivity and uncertainty. In order to improve production efficiency and product consistency, some modern pharmaceutical factories begin to introduce process analysis technology and continuous manufacturing concept. The PAT technology realizes a certain degree of automation by monitoring the production process through sensors and data analysis. The traditional PAT system mainly relies on spectral analysis to detect the change of substances, and the hardware equipment is expensive, the data analysis is complex, and the requirement for the on-site environment is high, which limits the popularization of these technologies in the extraction endpoint control of traditional Chinese medicine volatile oil.
[0004] In summary, the existing technology has significant deficiencies in the endpoint determination of traditional Chinese medicine volatile oil extraction, mainly in the aspects of relying on manual judgment, lack of automation, weak real-time monitoring capability and complex and expensive equipment. The above defects lead to certain limitations in the efficiency and quality control of volatile oil extraction process, and a new method and device are urgently needed to realize the accurate determination of the extraction endpoint of volatile oil and process optimization. SUMMARY
[0005] One object of the present application is to provide a visual traditional Chinese medicine volatile oil extraction endpoint determination method and device, which realizes real-time monitoring and accurate determination of the change of oil droplet diameter.
[0006] According to the visual traditional Chinese medicine volatile oil extraction endpoint determination method of the present application, the following steps are included:
[0007] S1, obtaining real-time image data of oil-water mixture through an industrial camera installed on a glass view column to form an oil droplet image data set;
[0008] S2, inputting the oil droplet image data set into an image processing unit for image preprocessing, including color space conversion, denoising, contrast enhancement and edge detection;
[0009] S3, analyzing the pre-processed oil bead images through the visual analysis system, extracting the oil bead contours using image segmentation algorithms, and measuring the diameter of the oil beads in real time;
[0010] S4, setting the corresponding oil bead diameter determination criteria according to the volatile oil extraction characteristics of different traditional Chinese medicinal materials, determining that the volatile oil extraction process is complete when the oil bead diameter reaches the preset value, and automatically issuing an extraction endpoint signal;
[0011] S5, the system automatically stops the extraction process according to the extraction endpoint signal, and records the oil bead diameter data and related parameters during the extraction process;
[0012] S6, the system continuously monitors the change of the oil bead diameter through the real-time monitoring function, and automatically determines the extraction endpoint through the preset diameter threshold.
[0013] Optionally, the S1 includes the following steps:
[0014] S11, installing an industrial camera on the glass view column and selecting a stable and vibration-free viewing angle, positioning the industrial camera at a distance h from the surface of the oil-water mixture through the industrial camera fixing structure, and setting the camera resolution to R img ;
[0015] S12, placing the oil-water mixture in the transparent view column to mix the oil beads with the water phase, and collecting oil bead images at different time points t i during the mixing process, wherein t i represents the i-th collection time, and the collection frequency is set to f s ;
[0016] S13, acquiring the RGB channel data of the oil bead images using the industrial camera, and representing each frame of oil bead image as a three-dimensional matrix I(x,y,c), wherein x and y are pixel coordinates, and c represents the red, green, and blue channels;
[0017] S14, time-sequencing the continuously collected oil bead images to construct a preliminary oil bead image dataset:
[0018] D raw ={I t |t=t1,t2,…,t n};
[0019] Wherein, I t represents the oil bead image collected at the t-th time point, and n is the total number of collected oil bead images;
[0020] S15, through the camera internal parameter matrix K and the external parameter matrix [R|T], the three-dimensional space point P w (X w ,Y w ,Zw ) mapping to a two-dimensional point P on the oil droplet image plane i (u,v) :
[0021]
[0022] where K represents the camera intrinsic matrix, [R|T] represents the extrinsic matrix, (X w , Y w , Z w ) represents the spatial point coordinates, and (u,v) represents the oil droplet image plane coordinates.
[0023] S16, setting an oil droplet image quality threshold Q th , and only when the signal-to-noise ratio of the oil droplet image I t satisfies SNR(I t ) ≥ Q th , the oil droplet image is retained into the oil droplet image dataset;
[0024] S17, the finally generated oil droplet image dataset D final contains all the effective oil droplet images after screening:
[0025]
[0026] where D final represents the oil droplet image dataset, containing all the effective oil droplet images meeting the signal-to-noise ratio requirement under the image quality screening condition, I t represents the oil droplet image collected at time point t, recording the visible morphology of the oil droplet at that time, m x n represents the pixel size of each image, and m and n represent the resolution of the image in the x direction and the y direction, respectively, SNR(I t ) represents the signal-to-noise ratio of the image I t , which is an index representing the image quality, represents the average pixel intensity of the image I t , which is used to calculate the deviation of each pixel point relative to the average value, Q th represents the image quality threshold, which is set as the lower limit of the signal-to-noise ratio for the system to judge whether the image is retained or not, when SNR(I t ) ≥ Q th , the image SNR(I t ) ≥ Q th is considered to be effective and added to the oil droplet image dataset D final .
[0027] Optionally, the S2 comprises the following steps:
[0028] S21, performing color space conversion on the oil droplet image dataset D final , and aiming at the RGB channel oil droplet image It (x, y, c) to YCbCr color space to optimize the effect of illumination variation on analysis:
[0029] Y = 0.2627 R + 0.6780 G + 0.0593 B,
[0030] Cb = 128 - 0.148 R - 0.291 G + 0.439 B,
[0031] Cr = 128 + 0.439 R - 0.368 G - 0.071 B,
[0032] where R, G, B are intensity values of pixels in RGB channels, Y is the luminance component used to highlight the reflective features of volatile oil, and Cb and Cr components are used to distinguish the color information of oil droplets from the background water phase;
[0033] S22, the converted oil droplet image I t ′ (x, y) is subjected to Gaussian filter denoising, and the filtered oil droplet image is represented as:
[0034]
[0035] where σ is the standard deviation of Gaussian distribution, and k is the size of the filter window used to control the filtering strength;
[0036] S23, the denoised oil droplet image I t ″ (x, y) is subjected to histogram equalization to make the oil droplet edge clearer:
[0037]
[0038] where L is the maximum value of the gray level, h(i) is the number of pixel points with gray value i, and m x n represents the pixel size of each image;
[0039] S24, the Canny edge detection algorithm is used to detect the edges of the oil droplet image after contrast enhancement, and the edge profile of the oil droplet is extracted by calculating the gradient change of the image, and the gradient G is defined as:
[0040]
[0041] where G x and G y are the gradients of the oil droplet image in x and y directions, respectively, calculated by Sobel operator:
[0042]
[0043] where the symbol * represents convolution operation;
[0044] S25, the oil droplet image data after edge detection is saved and updated as the oil droplet image data set:
[0045]
[0046] Optionally, the S3 comprises the following steps:
[0047] S31, the pre-processed oil droplet image data is saved and updated as the oil droplet image data set: The visual analysis system is input, and the Otsu threshold method is used to preliminarily segment the oil droplets and the background to calculate an adaptive threshold T to minimize the intra-class variance:
[0048]
[0049] wherein ω1(T) and ω2(T) are the proportions of the two classes of pixels under the threshold T, and are the variances of the two classes of pixels;
[0050] S32, morphological processing is performed on the segmented binary oil droplet image, and an opening operation is adopted to remove noise:
[0051]
[0052] wherein represents the opening operation, is the erosion operation, and is the inflation operation, B is the structural element, and is used to eliminate small noise points and connect broken oil droplet contours;
[0053] S33, the contour point set {P j (u,v)∣j=1,2,…,N i} of the oil droplets is extracted by a contour detection algorithm, wherein N i is the number of oil droplets detected in the oil droplet image , and the contour of each oil droplet is represented by a set of two-dimensional pixel coordinates (u,v);
[0054] S34, the minimum enclosing circle radius r j of the oil droplets is calculated as the basis for the oil droplet diameter:
[0055]
[0056] wherein is the center point coordinate of the jth oil droplet, and (u k ,v k ) is an arbitrary point on the contour of the oil droplet;
[0057] S35, the diameter d j of the oil droplets is calculated::
[0058] d j =2·r j ;
[0059] Where, d j This represents the diameter of the j-th oil droplet, used to determine whether the volatile oil extraction process has reached its endpoint.
[0060] Optionally, step S4 includes the following steps:
[0061] S41. Based on the extraction characteristics of volatile oils from different Chinese medicinal herbs, the system sets a specific endpoint oil droplet diameter threshold d for each volatile oil. th,k ;
[0062] S42, The system will measure the oil droplet diameter d in real time. j (t) and the corresponding variety's endpoint diameter threshold d th,k The comparison is performed to determine whether the preset extraction endpoint criteria have been met.
[0063] d j (t)≥d th,k ;
[0064] Where, d j (t) represents the measured diameter of the j-th oil droplet at time t;
[0065] S43. When the diameter of all oil droplets meets the corresponding endpoint threshold:
[0066]
[0067] The system determines that the extraction process is complete and immediately sends an extraction endpoint signal S. end ;
[0068] S44, The system automatically sends the endpoint signal S end The data is sent to the control unit to stop the extraction process, and the corresponding time t is recorded. end and all relevant parameters d j (t end Accessing the database:
[0069] Record = {d j (t end |j=1,2,…,N i}
[0070] Optionally, step S6 includes the following steps:
[0071] S61. The system obtains continuous time t∈[t0,t...] through the real-time monitoring module. end Data on the variation in oil droplet diameter within [D] diameter ={dj (t) | j = 1, 2, …, N i ; t = t1, t2, …, t n} for real-time analysis of the dynamic trend of oil droplet diameter;
[0072] S62, the system differentiates the oil droplet diameter at each time point t i , defines the oil droplet diameter change rate v j (t i ) as:
[0073]
[0074] Where d j (t i ) and d j (t i-1 ) represent the diameter of the jth oil droplet at time t i and t i-1 , respectively, and v j (t i ) represents the diameter change rate of the oil droplet in the time interval;
[0075] S63, the system monitors the stability of the oil droplet diameter according to the preset diameter change rate threshold v th , and when the change rate of all oil droplets meets the following condition:
[0076]
[0077] The system determines that the oil droplet diameter tends to be stable and enters the endpoint detection state;
[0078] S64, the system determines whether the extraction endpoint is reached according to the endpoint diameter threshold d th,k in the endpoint detection state, and meets the following condition:
[0079]
[0080] The system automatically sends an extraction endpoint signal S end ;
[0081] S65, the system stores the extraction endpoint time t end and the oil droplet diameter data d j (t end ) at the corresponding time in the database for process record and quality tracking:
[0082] Record end = {d j (t end ) | j = 1, 2, …, N i};
[0083] S66, if the rate of change of the diameter of a certain oil droplet exceeds the threshold value during continuous monitoring:
[0084]
[0085] The system will automatically issue an abnormal reminder signal S alert , prompting the operator to check or adjust the extraction process;
[0086] S67, after the extraction end signal S end is issued, the system automatically stops the extraction process and archives all monitoring data.
[0087] A visual traditional Chinese medicine volatile oil extraction endpoint determination device, comprising the following devices:
[0088] An industrial camera module is installed on a glass viewing column for collecting real-time images of oil droplets in an oil-water mixture in RGB channels at a set distance, generating a time series of oil droplet image data sets;
[0089] An image preprocessing module receives the original oil droplet image data set collected by the industrial camera, performs color space conversion, denoising, contrast enhancement and edge detection, and forms a preprocessed oil droplet image data set;
[0090] A visual analysis system module is used to analyze the preprocessed oil droplet image data set, extract the outline of the oil droplet through an image segmentation algorithm, calculate the diameter of the oil droplet, and generate an oil droplet diameter data set;
[0091] A determination standard module sets corresponding oil droplet diameter determination standards according to the extraction characteristics of different traditional Chinese medicinal materials, and stores the threshold values of different varieties in a threshold value set;
[0092] A real-time monitoring module continuously monitors the change of the oil droplet diameter, analyzes the change trend of the oil droplet diameter, determines whether it has reached a stable state, and determines whether endpoint detection is needed;
[0093] An endpoint determination module automatically issues an extraction endpoint signal when the diameters of all oil droplets reach the corresponding preset threshold values and the change trend is stable;
[0094] An abnormal reminder module automatically issues an abnormal reminder signal if it finds that the change of some oil droplets exceeds the normal range during monitoring, prompting the operator to check or adjust the extraction process;
[0095] A control and data recording module receives the extraction endpoint signal, controls the extraction process to stop, and records the extraction endpoint time and all monitoring data to a database for subsequent quality tracking and process review;
[0096] The man-machine interface displays real-time monitoring data and determination results through a visual interface, so that the operator can view the change trend and end state of the oil bead diameter and provide an abnormal processing prompt.
[0097] The beneficial effects of the present application are:
[0098] (1) The present application adopts color space conversion, Canny edge detection and Otsu threshold segmentation of multiple image processing algorithms to convert RGB images into YCbCr space, optimizes the influence of light changes on image quality, uses morphological opening operation and Otsu threshold method in the image segmentation link to ensure the clear separation of oil beads and background water phase, and avoids the missing detection problem of small oil beads in the traditional algorithm under complex background. Experiments show that the oil bead contour extraction accuracy of the present application is improved by more than 12% after the above improvements, and the misjudgment and missing detection situation is significantly reduced.
[0099] (2) The present application introduces real-time calculation of the oil bead diameter change rate in the monitoring module, and judges whether the oil bead tends to be stable by setting a rate threshold. Compared with the traditional single time point determination method, the present application captures the dynamic change trend of the oil bead diameter by using time series analysis and triggers the end point detection when the oil bead diameter change is stable, effectively avoiding the problem of early or delayed end point determination. Experimental data shows that the end point determination error of the present application under complex extraction conditions is reduced by 18%, improving the extraction efficiency and product consistency.
[0100] (3) The present application adopts modular design, independently configures industrial cameras, image preprocessing, visual analysis and end point determination modules, allows users to freely combine and adjust detection modules according to the characteristics of different traditional Chinese medicinal materials, and compared with the traditional expensive spectrum analysis system, the system structure of the present application is simple, the cost is low and the maintenance is convenient. By seamlessly integrating visual analysis and control system, the present application realizes automatic closed-loop control, reduces the risk of manual intervention and misoperation. Experimental results show that the modular design of the present application improves the production efficiency by more than 15%, and reduces the maintenance and adjustment cost of the system by about 20%. BRIEF DESCRIPTION OF DRAWINGS
[0101] The accompanying drawings are included to provide a further understanding of the present application, and constitute a part of the specification, together with the embodiments of the present application, to explain the present application, and do not constitute a limitation on the present application:
[0102] Figure 1 A flowchart of a visual traditional Chinese medicine volatile oil extraction end point determination method and device is provided for the present application;
[0103] Figure 2 A hardware connection schematic diagram of each module of the present application device in the visual traditional Chinese medicine volatile oil extraction end point determination method and device is provided for the present application. DETAILED DESCRIPTION
[0104] The application will now be described in further detail with reference to the drawings. These drawings are simplified schematic illustrations of the basic structure of the application and therefore only show the components relevant to the application.
[0105] Example 1: Reference Figures 1-2 A method for visualizing the endpoint determination of traditional Chinese medicine volatile oil extraction, comprising the following steps:
[0106] S1, obtaining real-time image data of the oil-water mixture through an industrial camera installed on a glass view column to form an oil bead image data set;
[0107] S2, inputting the oil bead image data set into an image processing unit for image preprocessing, including color space conversion, denoising, contrast enhancement and edge detection;
[0108] S3, analyzing the preprocessed oil bead image through a visual analysis system, extracting the oil bead contour using an image segmentation algorithm, and measuring the diameter of the oil bead in real time;
[0109] S4, setting corresponding oil bead diameter determination criteria according to the volatile oil extraction characteristics of different traditional Chinese medicinal materials, and determining that the volatile oil extraction process is complete when the oil bead diameter reaches the preset value, and automatically issuing an extraction endpoint signal;
[0110] S5, the system automatically stops the extraction process according to the extraction endpoint signal, and records the oil bead diameter data and related parameters in the extraction process;
[0111] S6, the system continuously monitors the change of the oil bead diameter through real-time monitoring function, and automatically determines the extraction endpoint through the preset diameter threshold.
[0112] In this embodiment, S1 includes the following steps:
[0113] S11, installing an industrial camera on a glass view column and selecting a stable and vibration- unaffected viewing angle, positioning the industrial camera at a distance h from the surface of the oil-water mixture through the industrial camera fixing structure, and setting the camera resolution to R img ;
[0114] S12, placing the oil-water mixture in the transparent view column to mix the oil beads with the water phase, and collecting oil bead images at different time points t i during the mixing process, where t i represents the i-th collection time, and the collection frequency is set to f s ;
[0115] S13. Use an industrial camera to acquire RGB channel data of oil droplet images, and represent each frame of oil droplet image as a three-dimensional matrix I(x,y,c), where x and y are pixel coordinates, and c represents the red, green, and blue channels.
[0116] S14. Perform time-series processing on the continuously acquired oil droplet images to construct a preliminary oil droplet image dataset:
[0117] D raw ={I t |t=t1,t2,…,t n};
[0118] Among them, I t This represents the oil droplet image collected at time t, where n is the total number of oil droplet images collected.
[0119] S15. Using the camera's intrinsic parameter matrix K and extrinsic parameter matrix [R|T], the 3D spatial point P in the view column is... w (X w ,Y w Z w Mapped to a two-dimensional point P on the oil droplet image plane. i (u,v):
[0120]
[0121] Where K represents the camera intrinsic parameter matrix, [R|T] represents the extrinsic parameter matrix, (X w ,Y w Z w (u,v) represents the coordinates of a point in space, and (u,v) represents the plane coordinates of the oil droplet image.
[0122] S16. Set the oil droplet image quality threshold Q. th Only when oil droplet image I t The signal-to-noise ratio satisfies SNR(I t )≥Q th At that time, the oil droplet image is saved and added to the oil droplet image dataset;
[0123] S17, The final generated oil droplet image dataset D final Includes images of all valid oil droplets after filtering:
[0124]
[0125] Among them, D final This represents an oil droplet image dataset containing all valid oil droplet images that meet the signal-to-noise ratio requirements under image quality screening conditions. trepresents the oil droplet image collected at time point t, recording the visible form of the oil droplet at this moment, m x n represents the pixel size of each image, and m x n represents the resolution of the image in the x direction and the y direction, respectively, SNR(I t ) represents the signal-to-noise ratio of the image I t , which is an index representing the quality of the image, represents the average pixel intensity of the image I t , which is used to calculate the deviation of each pixel point relative to the average value, Q th represents the image quality threshold, which is set as the lower limit of the signal-to-noise ratio for the system to judge whether the image is retained, when SNR(I t ) ≥ Q th , the image SNR(I t ) ≥ Q th is considered valid and added to the oil droplet image data set D final .
[0126] In this embodiment, S2 includes the following steps:
[0127] S21, color space conversion is performed on the oil droplet image data set D final , and YCbCr color space conversion is performed on the RGB channel oil droplet image I t (x, y, c) according to the characteristics of traditional Chinese medicine volatile oil, so as to optimize the influence of light change on analysis:
[0128] Y = 0.2627R + 0.6780G + 0.0593B,
[0129] Cb = 128 - 0.148R - 0.291G + 0.439B;
[0130] Cr = 128 + 0.439R - 0.368G - 0.071B,
[0131] wherein R, G and B are the intensity values of the pixel in the RGB channel, Y is the luminance component, which is used to highlight the reflection characteristics of the volatile oil, and Cb and Cr components are used to distinguish the color information of the oil droplet and the background water phase;
[0132] S22, Gaussian filter denoising processing is performed on the converted oil droplet image I t ′ (x, y), and the filtered oil droplet image is represented as:
[0133]
[0134] wherein σ is the standard deviation of the Gaussian distribution, and k is the size of the filter window, which is used to control the filter strength;
[0135] S23, the denoised oil droplet image It ″ (x, y) to make the oil droplet edge clearer:
[0136]
[0137] wherein L is the maximum value of the gray level, h(i) is the number of pixel points with the gray value i, and mxn represents the pixel size of each image;
[0138] S24, the Canny edge detection algorithm is used to detect the edge of the oil droplet image after contrast enhancement, and the edge profile of the oil droplet is extracted by calculating the gradient change of the image, and the gradient G is defined as:
[0139]
[0140] wherein G x and G y are the gradients of the oil droplet image in x and y directions, respectively, which are calculated by Sobel operator:
[0141]
[0142] wherein the symbol * represents convolution operation;
[0143] S25, the oil droplet image data after edge detection is saved and the oil droplet image data set is updated:
[0144]
[0145] In this embodiment, S3 includes the following steps:
[0146] S31, the preprocessed oil droplet image data is input into the visual analysis system, and the Otsu threshold method is used to preliminarily segment the oil droplet and the background to calculate the adaptive threshold T to minimize the intra-class variance:
[0147]
[0148] wherein ω1(T) and ω2(T) are the proportions of two types of pixels under the threshold T, and are the variances of two types of pixels;
[0149] S32, morphological processing is performed on the segmented binary oil droplet image, and the open operation is used to remove noise:
[0150]
[0151] wherein represents the open operation, For corrosion operation, ⊕ is for expansion operation, and B is a structural element used to eliminate small noise and connect broken oil droplet contours.
[0152] S33. Extract the contour point set {P} of oil droplets using a contour detection algorithm. j (u,v)|j=1,2,…,N i}, where N i For oil droplet images The number of oil droplets detected in the sample, and the outline of each oil droplet is represented by a set of two-dimensional pixel coordinates (u,v);
[0153] S34. Calculate the minimum enclosing radius r of the oil droplet. j As a basis for oil droplet diameter:
[0154]
[0155] in, Let u be the coordinates of the center point of the j-th oil droplet. k ,v k () represents any point on the outline of the oil droplet;
[0156] S35. Calculate the diameter d of the oil droplet. j :
[0157] d j =2·r j ;
[0158] Where, d j This represents the diameter of the j-th oil droplet, used to determine whether the volatile oil extraction process has reached its endpoint.
[0159] In this embodiment, S4 includes the following steps:
[0160] S41. Based on the extraction characteristics of volatile oils from different Chinese medicinal herbs, the system sets a specific endpoint oil droplet diameter threshold d for each volatile oil. th,k For example: for leafy or fruity varieties such as perilla, mint, mugwort, camphor leaves, schizonepeta, schizonepeta spikes, dried tangerine peel, immature bitter orange, immature bitter orange, white cardamom, amomum villosum, tsaoko, alpinia oxyphylla, fennel, lavender, myrtle, evodia rutaecarpa, and schisandra chinensis, the endpoint oil droplet diameter threshold is set at 0.05mm; for varieties such as sandalwood, frankincense, myrrh, asafoetida, styrax chinensis resin, notopterygium incisum, cyperus rotundus, cnidium monnieri, arborvitae leaves, angelica dahurica, atractylodes macrocephala, nard, costus root, cyperus rotundus, dried ginger, turmeric, acorus tatarinowii, bupleurum chinense, houttuynia cordata, turmeric, elsholtzia ciliata, asarum heterotropoides, magnolia biondii, fresh ginger, and cloves, the endpoint oil droplet diameter threshold is set at 0.035mm; for varieties such as cinnamon twig, cinnamon bark, chuanxiong rhizome, and angelica sinensis, the endpoint oil droplet diameter threshold is set at 0.02mm.
[0161] S42, The system will measure the oil droplet diameter d in real time. j(t) ≥ d th,k A comparison is made to determine whether the preset extraction endpoint criterion is met:
[0162] d j (t) ≥ d th,k ;
[0163] wherein d j (t) represents the measured diameter of the jth oil bead at time t;
[0164] S43, when it is detected that the diameters of all oil beads meet the corresponding endpoint threshold value:
[0165]
[0166] The system determines that the extraction process has been completed and immediately issues an extraction endpoint signal S end ;
[0167] S44, the system automatically sends the endpoint signal S end to the control unit, stops the extraction process, and records the corresponding time t end and all related parameters d j (t end ) into the database:
[0168] Record = {d j (t end ) | j = 1, 2,..., N i}.
[0169] In this embodiment, S6 includes the following steps:
[0170] S61, the system obtains the oil bead diameter change data D end = {d diameter (t) | j = 1, 2,..., N j ; t = t1, t2,..., t n} within the continuous time t ∈ [t0, t i ] through the real-time monitoring module, for real-time analysis of the dynamic change trend of the oil bead diameter;
[0171] S62, the system performs a difference calculation on the oil bead diameter at each time point t i , and defines the oil bead diameter change rate v j (t i ) as:
[0172]
[0173] wherein d j (t i ) and d j (t i-1Dj(t) represents the diameter of the jth oil droplet at time t i and t i-1 , respectively, v j (t i ) represents the rate of change of the diameter of the oil droplet in this time interval.
[0174] S63, the system monitors the stability of the oil droplet diameter according to the preset diameter change rate threshold v th , and when the change rate of all oil droplets meets the following condition:
[0175]
[0176] The system determines that the oil droplet diameter tends to be stable and enters the endpoint detection state;
[0177] S64, the system determines whether the extraction endpoint is reached according to the endpoint diameter threshold d th,k in the endpoint detection state, which meets the following condition:
[0178]
[0179] The system automatically sends an extraction endpoint signal S end ;
[0180] S65, the system stores the extraction endpoint time t end and the oil droplet diameter data d j (t end ) at the corresponding time in the database for process record and quality tracking:
[0181] Record end = {d j (t end ) | j = 1, 2, …, N i};
[0182] S66, if the diameter change rate of an oil droplet exceeds the threshold value in continuous monitoring:
[0183]
[0184] The system will automatically send an abnormal reminder signal S alert to prompt the operator to check or adjust the parameters of the extraction process;
[0185] S67, after the extraction endpoint signal S end is sent, the system automatically stops the extraction process and archives all monitoring data.
[0186] Embodiment 2: A visual Chinese medicine volatile oil extraction endpoint determination device, comprising the following devices:
[0187] An industrial camera module is installed on a glass view column to collect real-time images of oil droplets in an oil-water mixture in the RGB channel at a set distance, generating a time-series oil droplet image dataset.
[0188] An image preprocessing module receives the raw oil droplet image dataset collected by the industrial camera, performs color space conversion, denoising, contrast enhancement, and edge detection, and forms a preprocessed oil droplet image dataset.
[0189] A visual analysis system module is used to analyze the preprocessed oil droplet image dataset, extract the outline of the oil droplets through image segmentation algorithms, calculate the diameter of the oil droplets, and generate an oil droplet diameter dataset.
[0190] A decision criterion module sets corresponding oil droplet diameter decision criteria based on the extraction characteristics of volatile oil from different traditional Chinese medicinal materials, and stores the threshold values for different varieties in a threshold set.
[0191] A real-time monitoring module continuously monitors the changes in oil droplet diameter, analyzes the trend of oil droplet diameter changes, determines whether it has reached a stable state, and determines whether end-point detection is needed.
[0192] An end-point determination module automatically sends an extraction end-point signal when the diameters of all oil droplets reach the corresponding pre-set threshold values and the trend is stable.
[0193] An abnormality reminder module automatically sends an abnormality reminder signal if some oil droplets change beyond the normal range during monitoring, prompting the operator to check or adjust the extraction process.
[0194] A control and data recording module receives the extraction end-point signal, controls the extraction process to stop, and records the extraction end-point time and all monitoring data to a database for subsequent quality tracking and process review.
[0195] A human-computer interaction interface displays real-time monitoring data and decision results through a visual interface, allowing the operator to view the trend of oil droplet diameter changes and end-point status, and provides abnormality handling prompts.
[0196] Example 3: In September 2024, a traditional Chinese medicine pharmaceutical enterprise in City A was conducting volatile oil extraction from cassia twig and used the visual traditional Chinese medicine volatile oil extraction end-point determination system to solve the instability problem caused by relying on manual experience for previous extraction end-point judgment. The main purpose of this test was to optimize the volatile oil extraction process and improve production efficiency and product consistency through automated monitoring and end-point detection of the system.
[0197] At 10:00 AM on September 12, 2024, the enterprise began extracting volatile oil from a batch of 200-kilogram guizhi samples. The samples were mixed with water at a ratio of 1:4 and heated to 70°C under a temperature control system. The heated water-oil mixture flowed through a pipeline into a glass view column with a height of 60 centimeters and a diameter of 15 centimeters. The industrial camera module in the system was located 30 centimeters above the view column, configured to capture one frame of image per second, and set the image resolution to 4096x2160 pixels to ensure the complete morphology of the oil droplets was captured.
[0198] At 10:05, the system began collecting the first set of images and generated a preliminary oil droplet dataset in the visual analysis system. The system detected that there were few oil droplets in the view column, with diameters generally around 0.008mm. At this time, the system displayed the status "extraction not started".
[0199] At 11:15, as the temperature continued to rise, more oil droplets began to appear in the view column. The system processed the image data through Gaussian filtering and Canny edge detection, detecting that the diameter of the oil droplets gradually increased to 0.015mm. At the same time, the real-time monitoring module recorded abnormal fluctuations in the rate of change of the oil droplet diameter. According to the set algorithm, the system determined that the extraction process had entered a critical stage.
[0200] At 12:30, the system detected that the diameter of the oil droplets had approached the set threshold of 0.02mm. The monitoring data showed that the rate of change of the oil droplet diameter gradually stabilized, with a change rate of less than 0.001mm / min in the last 5 minutes. The system compared this information with the extraction criteria in the database and automatically determined that the extraction was approaching the end.
[0201] At 12:35, the system automatically issued a "end point approaching" signal and recorded the final diameter of the oil droplets in the visual analysis system as 0.0201mm. Five seconds later, the system detected that all oil droplets had reached or exceeded 0.02mm in diameter, and the end point determination module issued a "extraction end" signal and immediately stopped the heating system.
[0202] System operation and data recording
[0203] During the extraction process, the system recorded multiple data in real time, including the start time: 10:05 on September 12, 2024, the end time of extraction: 12:35 on September 12, 2024, the average oil droplet diameter change rate: 0.0015mm / min, the highest temperature during extraction: 72°C, the final diameter of the oil droplets: 0.0201mm, and the time the system issued the end point signal: 12:35:05.
[0204] The system stores the above data in the database and shows the trend of the oil bead diameter change in the whole process through a visual interface. The operator checks the recorded oil bead diameter change chart on the system terminal and confirms that all parameters of the extraction process meet the set standard.
[0205] To verify the superiority of the system of the application, the technical team simultaneously conducted a comparative test of the traditional manual monitoring method. Under the same conditions, the end time of the traditional extraction method was 13:10, which was 35 minutes later than the system of the application. This delay led to the over-extraction of part of the oil, and the concentration of volatile oil decreased by 2%. In addition, during the manual monitoring process, the operator entered the site for inspection several times, resulting in the omission of part of the data record:
[0206] Table 1 Comparison of traditional method and method of the application
[0207] Indicator Conventional method Method of the invention Extraction time 3 hours 5 minutes 2 hours 30 minutes Error in oil bead diameter detection ± 0.05 mm ± 0.01 mm Final volatile oil concentration 85% 87% Operator inspection frequency Every 30 minutes Fully automatic process Extraction time error ± 10 minutes ± 2 minutes
[0208] As can be seen from Example 1, the system of the application can realize the whole-process automatic control of the volatile oil extraction process without relying on manual monitoring. Compared with the traditional method, the end point detection error of the system is reduced by 80%, the product volatile oil concentration is increased by 2%, and in addition, the system reduces the intervention of the operator through real-time monitoring and automatic determination function, and reduces the risk of human error. The present embodiment shows that the system of the application has significant advantages in improving extraction efficiency, ensuring product quality consistency and reducing production cost.
[0209] The application adopts color space conversion, Canny edge detection and Otsu threshold segmentation multiple image processing algorithms to convert the RGB image into YCbCr space, optimizes the influence of light change on image quality, and in the image segmentation link, morphological opening operation and Otsu threshold method are used to ensure the clear separation of oil beads and background water phase, avoiding the missing detection problem of small oil beads in the traditional algorithm under complex background. Experiments show that the oil bead contour extraction accuracy of the application is improved by more than 12% after the above improvement, and the misjudgment and missing detection are significantly reduced.
[0210] The application introduces real-time calculation of the oil bead diameter change rate in the monitoring module, and judges whether the oil bead tends to be stable by setting the rate threshold. Compared with the traditional single time point determination method, the application captures the dynamic change trend of the oil bead diameter by using time series analysis and triggers the end point detection when the oil bead diameter change is stable, effectively avoiding the problem of early or delayed end point determination. Experimental data shows that the end point determination error of the application under complex extraction conditions is reduced by 18%, improving the extraction efficiency and product consistency.
[0211] The application adopts modular design, independently configures industrial camera, image preprocessing, visual analysis and endpoint determination module, allows users to freely combine and adjust detection module according to different characteristics of traditional Chinese medicinal materials, compared with traditional expensive spectrum analysis system, the system of the application is simple in structure, low in cost and convenient in maintenance, realizes automatic closed-loop control by seamlessly integrating visual analysis and control system, reduces the risk of manual intervention and misoperation, and experimental results show that the modular design of the application improves production efficiency by more than 15%, and reduces the maintenance and adjustment cost of the system by about 20%.
[0212] The above merely describes a preferred specific embodiment of the present application, but the protection scope of the present application is not limited thereto, any person skilled in the art can make equivalent replacements or changes within the technical range disclosed by the present application according to the technical solution and inventive concept of the present application, which should be covered within the protection scope of the present application.
Claims
1. A method for determining the endpoint of extraction of volatile oils from traditional Chinese medicine using visualization, characterized in that, Includes the following steps: S1. Real-time image data of oil-water mixture is acquired by an industrial camera installed on a glass viewing column to form an oil droplet image dataset; S2. Input the oil droplet image dataset into the image processing unit for image preprocessing, including color space conversion, noise reduction, contrast enhancement and edge detection; S3. Analyze the preprocessed oil droplet image using a visual analysis system, extract the oil droplet contour using an image segmentation algorithm, and measure the diameter of the oil droplet in real time. S4. Based on the volatile oil extraction characteristics of different Chinese medicinal materials, set corresponding oil droplet diameter judgment criteria. When the oil droplet diameter reaches the preset value, the volatile oil extraction process is judged to be over, and an extraction endpoint signal is automatically issued. S5. The system automatically stops the extraction process based on the extraction endpoint signal and records the oil droplet diameter data and relevant parameters during the extraction process; S6. The system continuously monitors the change in oil droplet diameter through real-time monitoring and automatically determines the extraction endpoint based on the preset diameter threshold. S3 includes the following steps: S31. Transfer the preprocessed oil droplet image data The input visual analysis system uses the Otsu thresholding method to perform preliminary segmentation of oil droplets and background, and calculates an adaptive threshold T to minimize the intra-class variance. ; in, and Let T represent the proportion of the two types of pixels at threshold T. and Let V be the variance of the two classes of pixels; S32. Perform morphological processing on the segmented binary oil droplet image, using opening operations. Noise removal: ; in, This indicates the opening operation. For corrosion operation, For the expansion operation, B is the structural element used to eliminate small noise and connect broken oil droplet profiles; S33. Extract the contour point set of oil droplets using a contour detection algorithm. ,in For oil droplet images The number of oil droplets detected in the sample, and the outline of each oil droplet is represented by a set of two-dimensional pixel coordinates (u, v); S34. Calculate the minimum enclosing radius of the oil droplet. As a basis for oil droplet diameter: ; in, Let J be the coordinates of the center point of the j-th oil droplet. Let be any point on the outline of the oil droplet; S35. Calculate the diameter of the oil droplets. : ; in, This represents the diameter of the j-th oil droplet, used to determine whether the volatile oil extraction process has reached its endpoint.
2. The method for determining the endpoint of extraction of volatile oils from traditional Chinese medicine according to claim 1, characterized in that, S1 includes the following steps: S11. Install an industrial camera on the glass viewing column and select a stable viewing angle unaffected by vibration. Position the industrial camera at a distance h from the surface of the oil-water mixture using the industrial camera fixing structure, and set the camera resolution to [value missing]. ; S12. Place the oil-water mixture inside a transparent viewing column to allow oil droplets to mix with the water phase, and record the mixing process at different time points. Oil droplet image acquisition was performed, among which This represents the time of the i-th data acquisition, and the acquisition frequency is set to... ; S13. Use an industrial camera to acquire RGB channel data of oil droplet images, and represent each frame of oil droplet image as a three-dimensional matrix I(x, y, c), where x and y are pixel coordinates, and c represents the red, green, and blue channels. S14. Perform time-series processing on the continuously acquired oil droplet images to construct a preliminary oil droplet image dataset: ; in, This represents the oil droplet image collected at time t, where n is the total number of oil droplet images collected. S15, using the camera's intrinsic parameter matrix K and extrinsic parameter matrix , to view the three-dimensional spatial points in the column Mapped to two-dimensional points on the oil droplet image plane : ; Where K represents the camera intrinsic parameter matrix, and [R|T] represents the extrinsic parameter matrix. Let (u, v) be the coordinates of a point in space, and (u, v) be the plane coordinates of the oil droplet image. S16. Set the oil droplet image quality threshold. Only when oil droplet image The signal-to-noise ratio satisfies At that time, the oil droplet image is saved and added to the oil droplet image dataset; S17, Final generated oil droplet image dataset Includes images of all valid oil droplets after filtering: ; in, This represents an oil droplet image dataset, containing all valid oil droplet images that meet the signal-to-noise ratio requirements under image quality screening conditions. This represents an image of oil droplets acquired at time point t, recording the visible morphology of the oil droplets at that moment. This represents the pixel size of each image, and represents the resolution of the image in the x and y directions, respectively. Representing an image The signal-to-noise ratio (SNR) is an indicator that characterizes image quality. Representing an image The average pixel intensity is used to calculate the deviation of each pixel from the average value. This represents the image quality threshold, set as the lower limit of the signal-to-noise ratio for the system to determine whether an image should be retained. At that time, the image It was deemed valid and added to the oil droplet image dataset. .
3. The method for determining the endpoint of extraction of volatile oils from traditional Chinese medicine according to claim 1, characterized in that, S2 includes the following steps: S21. Oil droplet image dataset Color space conversion was performed on the RGB channel oil droplet images to target the characteristics of volatile oils in traditional Chinese medicine. Perform YCbCr color space conversion to optimize the impact of illumination changes on the analysis: ; Wherein, R, G, B are the intensity values of the pixel in the RGB channel, Y is the luminance component, used to highlight the reflective characteristics of volatile oil, and Cb and Cr components are used to distinguish the color information of oil droplets from the background water phase. S22. The converted oil droplet image After Gaussian filtering for noise reduction, the filtered oil droplet image is represented as follows: ; in, is the standard deviation of the Gaussian distribution, and k is the size of the filter window, used to control the filter strength; S23. The denoised oil droplet image Perform histogram equalization to make the edges of the oil droplets clearer: ; Where L is the maximum value of the gray level, and h(i) is the number of pixels with gray level i. This indicates the pixel size of each image; S24. The Canny edge detection algorithm is used to perform edge detection on the contrast-enhanced oil droplet image. The edge contour of the oil droplet is extracted by calculating the gradient change of the image. The gradient G is defined as: ; in, and The gradients of the oil droplet image in the x and y directions are calculated using the Sobel operator, respectively. ; Among them, symbols This represents the convolution operation; S25. Transfer the oil droplet image data after edge detection. Save and update the oil droplet image dataset: 。 4. The method for determining the endpoint of extraction of volatile oils from traditional Chinese medicine according to claim 1, characterized in that, S4 includes the following steps: S41. Based on the extraction characteristics of volatile oils from different Chinese medicinal herbs, the system sets a specific threshold for the diameter of the endpoint oil droplets for each volatile oil. ; S42, The system will measure the oil droplet diameter in real time. The corresponding endpoint diameter threshold The comparison is performed to determine whether the preset extraction endpoint criteria have been met. ; in, This represents the measured diameter of the j-th oil droplet at time t; S43. When the diameter of all oil droplets meets the corresponding endpoint threshold: ; The system determines that the extraction process is complete and immediately sends an extraction endpoint signal. ; S44, The system automatically sends the endpoint signal Send the data to the control unit to stop the extraction process and record the corresponding time. and all relevant parameters Accessing the database: 。 5. The method for determining the endpoint of extraction of volatile oils from traditional Chinese medicine according to claim 4, characterized in that, S6 includes the following steps: S61. The system obtains continuous time through the real-time monitoring module. Data on the variation in the diameter of oil droplets inside It is used to analyze the dynamic change trend of oil droplet diameter in real time; S62, The system records each time point The oil droplet diameter is calculated using a difference method, and the rate of change of the oil droplet diameter is defined. for: ; in, and These represent the time intervals of the j-th oil droplet. and The diameter at that time This indicates the rate of change of the oil droplet's diameter within that time interval; S63, The system determines the diameter change rate threshold based on the preset threshold. Monitor the stability of oil droplet diameter. The condition is met when the rate of change of all oil droplets satisfies the following condition: ; The system determines that the oil droplet diameter is stabilizing and enters the endpoint detection state; S64. In the endpoint detection state, the system uses the endpoint diameter threshold. To determine whether the extraction endpoint has been reached, the following conditions must be met: ; The system automatically sends an extraction endpoint signal. ; S65, The system will extract the endpoint time. and corresponding oil droplet diameter data at the time. Stored in a database for process recording and quality tracking: ; S66. If the rate of change of the diameter of an oil droplet exceeds the threshold during continuous monitoring: ; The system will automatically send an abnormality alert signal. The operator is prompted to check or adjust the parameters of the extraction process. S67. Extracting the endpoint signal After the data is sent, the system automatically stops the extraction process and archives all monitoring data.
6. A visual device for determining the endpoint of extraction of volatile oils from traditional Chinese medicine, used to perform the method described in any one of claims 1-5, characterized in that, include: An industrial camera module, mounted on a glass viewing column, is used to acquire real-time RGB channel images of oil droplets in an oil-water mixture at a set distance, generating a time-series oil droplet image dataset. The image preprocessing module receives the raw oil droplet image dataset acquired by the industrial camera, performs color space conversion, noise reduction, contrast enhancement, and edge detection to form a preprocessed oil droplet image dataset. The visual analysis system module is used to analyze the preprocessed oil droplet image dataset, extract the contours of the oil droplets through image segmentation algorithms, calculate the diameter of the oil droplets, and generate an oil droplet diameter dataset. The judgment criteria module sets corresponding oil droplet diameter judgment criteria based on the volatile oil extraction characteristics of different Chinese medicinal materials, and stores the thresholds for different varieties in the threshold set; The real-time monitoring module continuously monitors the changes in oil droplet diameter, analyzes the trend of oil droplet diameter changes to determine whether it has reached a stable state, and determines whether endpoint detection is required. The endpoint determination module automatically sends an extraction endpoint signal when the diameter of all oil droplets reaches the corresponding preset threshold and the trend of change is stable. The anomaly alert module automatically sends an anomaly alert signal if changes in certain oil droplets exceed the normal range during monitoring, prompting the operator to check or adjust the extraction process. The control and data recording module, upon receiving the extraction endpoint signal, controls the extraction process to stop and records the extraction endpoint time and all monitoring data to the database for subsequent quality tracking and process review. The human-machine interface displays real-time monitoring data and judgment results through a visual interface, allowing operators to view the changing trend and endpoint status of oil droplet diameter, and providing abnormal handling prompts.
Citation Information
Patent Citations
Quality analysis method and system for low-carbon lubricating oil
CN117723739A
Improved KNN-based 6lowpan network intrusion detection method
WO2020042702A1