A method and system for monitoring extraction and purification based on digital image processing
By using digital image processing technology and temporal generative adversarial networks, the problems of subjectivity and time lag in human judgment during the extraction and purification process of traditional Chinese medicine were solved, enabling real-time and accurate quality control of the extraction and purification process of traditional Chinese medicine materials and improving the uniformity and stability of traditional Chinese medicine products.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 汉中天然谷生物科技股份有限公司
- Filing Date
- 2026-06-04
- Publication Date
- 2026-07-10
AI Technical Summary
Existing extraction and purification monitoring technologies rely on manual judgment, which is highly subjective and has a large time lag, resulting in inconsistent quality and batch-to-batch fluctuations in traditional Chinese medicine products, making it difficult to achieve real-time and accurate quality control.
By employing digital image processing technology, a prediction model based on temporal generative adversarial networks is constructed through process image acquisition and analysis. By combining the similarity and deviation buffer between real-time images and historical processes, the model enables advanced prediction of production status and dynamic quality control.
It enables non-contact real-time monitoring of the extraction and purification process of Chinese medicinal materials, improves the accuracy and consistency of quality control, reduces the generation of unqualified products and waste of resources, and enhances the uniformity and stability of Chinese medicinal products.
Smart Images

Figure CN122368050A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of extraction and purification monitoring technology, and more specifically, to an extraction and purification monitoring method and system based on digital image processing. Background Technology
[0002] The extraction and purification of Chinese medicinal materials is a core link in the pharmaceutical industry chain of Chinese medicine. The level of process control directly determines the content, purity, and clinical efficacy of the effective components of Chinese medicine products.
[0003] Existing extraction and purification monitoring technologies are mainly applied to key monitoring scenarios in batch production. Typically, operators manually take samples from equipment such as extraction tanks and extraction vessels at preset time points and send the samples to the laboratory for physicochemical analysis such as high performance liquid chromatography and ultraviolet spectrophotometry. At the same time, online physical sensors such as temperature, pressure, and pH value are used to monitor the equipment operating parameters in real time. However, manual monitoring relies on the operator's experience, and the judgment criteria are highly subjective. Different personnel have significant differences in their judgment of the extraction endpoint, the layering interface, and the crystallization state, which can easily lead to inconsistent process execution. Offline detection has a significant time lag, and the test results usually take several hours to be obtained. By this time, the production process has already moved to the next stage, and the process parameters cannot be adjusted in time, which can easily cause batch-to-batch quality fluctuations or even produce unqualified products. Therefore, an extraction and purification monitoring method and system based on digital image processing is proposed. Summary of the Invention
[0004] The purpose of this invention is to provide an extraction and purification monitoring method and system based on digital image processing to solve the problems mentioned in the background art.
[0005] To address the aforementioned technical problems, one objective of this invention is to provide an extraction and purification monitoring method based on digital image processing, comprising the following steps: S1. Divide the extraction and purification process into process stages according to the process plan, and at the same time collect process images of the purification device, extract historical process images to divide the process into process stages, and obtain the process stage corresponding to each historical process image. S2. Using the qualified form of the purified material as the boundary of the quantification space, according to the process sequence, the characteristics of the medicinal materials are quantitatively analyzed in each process stage in combination with the corresponding historical process images, and the quantitative values of the medicinal material characteristics corresponding to each historical process image and the qualified range of the quantitative values of the medicinal material characteristics corresponding to each process stage are obtained. S3. Extract real-time process images for quantitative numerical analysis, and combine real-time process images and process plans with historical process images to perform predictive process image analysis. Then, in the list of predicted process images, perform image matching and quantitative analysis on the characteristics of medicinal materials to obtain the predicted quantitative values corresponding to each characteristic of medicinal materials. S4. Compare the real-time process images with historical process images to extract the historical process images with the highest similarity and combine them with the remaining time of the process stage. Set a deviation buffer for the process stage, and then compare the predicted quantitative values with the deviation buffer and the qualified range. Determine the production status based on the comparison results. S5. When S4 determines that the production status is abnormal, the time-series quantization value of the real-time process image is combined with the historical process image of the same period of the process plan to perform real-time deviation rate trend analysis, and the abnormal node is located and the production status abnormality is eliminated based on the real-time deviation rate trend.
[0006] As a further improvement to this technical solution, in step S1, the traditional Chinese medicine purification management terminal is connected, the process plan for the extraction and purification of traditional Chinese medicine is obtained at the traditional Chinese medicine purification management terminal, the process stage analysis is performed in the process plan, and the process stage corresponding to the process plan is obtained. The extraction and purification process is divided into multiple stages according to the process plan.
[0007] As a further improvement to this technical solution, in step S1, an industrial camera and a matching light source system are installed at the sight glass position of each purification device; The exposure time and gain parameters of the industrial camera are automatically adjusted according to the lighting conditions of different process stages. At the same time, anti-fog lenses and automatic fog removal devices are used to eliminate the impact of steam condensation on image quality. Then, process images are acquired at a collection frequency that matches the process stage. Extract images of the entire process of qualified production from the purification and management end of Chinese medicinal materials, and form a historical image sequence in chronological order; Cluster analysis is performed on historical image sequences, and the clustering results are corrected in conjunction with the time nodes of the process plan. Each frame of historical process image is automatically labeled with the corresponding standard process stage, and a mapping relationship between historical process images and process stages is established.
[0008] As a further improvement to this technical solution, in S2, the final qualified form of the purified product is extracted at the purification management end of the Chinese medicinal materials, and the qualified form of the intermediate product at each process stage is deduced in combination with the process plan, and a morphological correlation map from the qualified form to the intermediate product at each process stage is established. The qualified form of intermediate products at each process stage is used as the spatial boundary for quantifying the characteristics of medicinal materials at that stage. According to the process sequence, at each process stage, all qualified historical process images of that stage are extracted, each historical process image is preprocessed, and the medicinal material features are extracted after preprocessing. Then, the extracted medicinal material features are standardized and converted into a quantitative value range of 0-100.
[0009] As a further improvement to this technical solution, in step S2, the contribution of each medicinal material feature to the corresponding qualified form is calculated by principal component analysis. Based on the contribution, a corresponding weight coefficient is assigned to each medicinal material feature. Then, the quantitative values corresponding to each medicinal material feature are combined with the corresponding weight coefficients to obtain the quantitative values of the medicinal material features corresponding to each historical process image. Then, in the historical process images, the final historical process images of each process stage are selected, and the maximum and minimum values are extracted by combining the quantitative values of the selected historical process images. The extracted maximum and minimum values are combined as the qualified range of the qualified quantitative values corresponding to each process stage.
[0010] As a further improvement to this technical solution, in step S3, a real-time process image at the current moment is acquired, and quantitative numerical analysis is performed based on the real-time process image to obtain the quantitative value corresponding to the real-time process image. A process image prediction model based on temporal generative adversarial network is constructed and trained using historical process image sequences as the training set. The real-time process images acquired in real time are used as input and fed into the trained process image prediction model; Among them, the real-time process images acquired in real time include process images of the Chinese medicinal material from the start of the extraction and purification process to the current moment; By combining the remaining time of the current process stage in the process plan, a sequence of predicted process images covering the remaining time is generated, forming a list of predicted process images; For each frame of the predicted process image in the predicted process image list, medicinal material features are extracted, and the extracted medicinal material features are quantized to obtain the predicted quantized value corresponding to each predicted process image. At the same time, the extracted medicinal material features are combined with historical process images of the same process stage for similarity matching. The similarity between each frame of the predicted process image and the historical process image is calculated, and then the predicted quantized value of the predicted process image is corrected based on the similarity corresponding to the historical process image.
[0011] As a further improvement to this technical solution, in step S4, the medicinal material features of the real-time process image are extracted, and the medicinal material features of the real-time process image are combined with the medicinal material features corresponding to all historical process images for similarity comparison to obtain the similarity of medicinal material features between the real-time process image and the historical process image. Extract the corresponding similarity and its corresponding historical process, and combine the highest similarity with the remaining time of the current process stage corresponding to the real-time process image, and set the deviation buffer. The reference deviation range of the historical process is determined based on the highest similarity value. At the same time, the time weight coefficient is calculated based on the remaining time of the current process stage. The longer the remaining time, the larger the time weight coefficient. Multiply the reference deviation range by the time weighting coefficient to obtain the deviation buffer range for the current process stage; The predicted quantitative values are compared with the deviation buffer and the acceptable range; If the predicted quantitative value exceeds the deviation buffer but does not exceed the qualified range, a production warning is issued. If the predicted quantified value does not exceed the deviation buffer and the qualified range, it is considered normal; If the predicted quantitative value exceeds the acceptable range, a production anomaly is determined and sent to S5.
[0012] As a further improvement to this technical solution, in step S5, a production anomaly sent by step S4 is received; Extract time-series quantization values from all real-time process images prior to the occurrence of the anomaly to form a real-time quantization value sequence; Extract the average quantized numerical sequence of historical process images from the same period of the process plan from the historical database; The real-time deviation rate at each time point is calculated by combining the real-time quantized numerical sequence with the average quantized numerical sequence of historical process images, and a trend curve of the real-time deviation rate over time is generated. When the trend range rises continuously, identify the time point in the real-time deviation rate trend curve when the deviation rate begins to rise, and determine that time point as an abnormal node. When the trend range does not rise continuously and the real-time deviation rate falls back to within the deviation buffer range, the anomaly is determined to be eliminated and normal production status is restored.
[0013] The second objective of this invention is to provide an extraction and purification monitoring system based on digital image processing, including any one of the extraction and purification monitoring methods based on digital image processing described above, comprising a process division module, a feature quantification module, and a production determination module; The process division module is used to divide the extraction and purification process into process stages according to the process plan, and at the same time, to acquire process images of the purification device, extract historical process images to divide the process stages, and obtain the process stage corresponding to each historical process image. The feature quantification module is used to take the qualified form of the purified product as the quantification space boundary, and according to the process sequence, to perform quantification analysis of medicinal material features in each process stage in combination with the corresponding historical process images. It obtains the quantified values of medicinal material features corresponding to each historical process image, as well as the qualified range of the quantified values of medicinal material features corresponding to each process stage. At the same time, it extracts real-time process images for quantification analysis, and combines real-time process images and process plans with historical process images for predictive process image analysis. Then, in the list of predicted process images, it performs image matching and quantification analysis on medicinal material features to obtain the predicted quantified values corresponding to each medicinal material feature. The production determination module is used to compare the real-time process images with historical process images for similarity, extract the historical process image with the highest similarity and combine it with the remaining time of the process stage, set a deviation buffer for the process stage, and then compare the predicted quantitative value with the deviation buffer and the qualified interval. The production status is determined based on the comparison result. When the production status is determined to be abnormal, the time-series quantitative value of the real-time process image is combined with the historical process image of the same period of the process plan to perform real-time deviation rate trend analysis, and the abnormal node is located and the production status abnormality is eliminated based on the real-time deviation rate trend.
[0014] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. A method and system for monitoring extraction and purification based on digital image processing. This method constructs a process prediction model and a dynamic quality control system based on historical data. By generating a sequence of future process images through a temporal generative adversarial network, and dynamically setting deviation buffers by combining the similarity between real-time images and historical processes with the remaining time of each process stage, it achieves advanced prediction of production status. This allows for early warnings before quality problems occur, providing sufficient time for process adjustments, effectively avoiding the generation of unqualified products, significantly reducing the waste of raw materials and energy, and significantly reducing the quality differences between different batches, thereby improving the uniformity and stability of traditional Chinese medicine products.
[0015] 2. An extraction and purification monitoring method and system based on digital image processing. This system achieves non-contact real-time monitoring of the entire extraction and purification process of Chinese medicinal materials through digital image processing technology. It replaces the traditional sampling and offline detection methods, completely eliminating the subjectivity of judgment and the time lag of physicochemical detection. At the same time, it uses an industrial camera to collect material images at each process stage in real time. After standardized feature extraction and quantitative analysis, it can objectively and accurately reflect the quality status of the materials. This realizes the transformation from manual experience judgment to data-driven decision-making, and significantly improves the accuracy and consistency of quality control. Attached Figure Description
[0016] Figure 1 This is a schematic flowchart of an extraction and purification monitoring method based on digital image processing according to the present invention. Detailed Implementation
[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0018] like Figure 1As shown, one of the objectives of this invention is to provide an extraction and purification monitoring method based on digital image processing, comprising the following steps: S1. Divide the extraction and purification process into process stages according to the process plan, and at the same time collect process images of the purification device, extract historical process images to divide the process into process stages, and obtain the process stage corresponding to each historical process image. In S1, the system connects to the Chinese herbal medicine purification management terminal, obtains the process plan for the extraction and purification of Chinese herbal medicines from the Chinese herbal medicine purification management terminal, performs process stage analysis in the process plan, and obtains the process stage corresponding to the process plan. The system connects to the Chinese herbal medicine purification management terminal via the Industrial Ethernet OPCUA protocol, establishing a two-way data communication channel. Then, it obtains the complete process plan file for the current batch from the management terminal, including the start and end times of each process stage, preset process parameters (temperature / pressure / stirring speed / solvent flow rate), material input and expected output, and final product quality standards.
[0019] The extraction and purification process is divided into stages according to the process plan, so that the extraction and purification process consists of multiple stages. The process stages include extraction (material is added to the extract and discharged), extraction (extractant is added until the two phases are completely separated), chromatography (from the start of sample loading to the end of elution), and crystallization (concentrate is added until crystallization is complete).
[0020] In S1, an industrial camera and a matching light source system are installed at the sight glass position of each purification unit; The exposure time and gain parameters of the industrial camera are automatically adjusted according to the lighting conditions of different process stages. At the same time, anti-fog lenses and automatic fog removal devices are used to eliminate the impact of steam condensation on image quality. Then, process images are acquired at a collection frequency that matches the process stage. Extract images of the entire process of qualified production from the purification and management end of Chinese medicinal materials, and form a historical image sequence in chronological order; Cluster analysis is performed on historical image sequences, and the clustering results are corrected by combining the time nodes of the process plan. Each frame of historical process image is automatically labeled with the corresponding standard process stage, and a mapping relationship between historical process images and process stages is established. The steps are as follows: Images of the most recent 50 batches of qualified production processes were extracted from the purification and management end of Chinese medicinal materials. Unqualified samples such as overexposed, underexposed, and blurred samples were filtered out. The images were sorted in ascending order by batch number and acquisition time and grouped by process stage. All images were subjected to uniform preprocessing: 3×3 template median filtering for noise reduction, size normalization to 1920×1080 pixels, and automatic cropping of the material area in the sight glass as ROI. The preprocessed images were stored in the historical image database. For each preprocessed historical image, a 6-dimensional feature vector in the HSV color space is extracted, including the mean and standard deviation of the H channel (hue), S channel (saturation), and V channel (luminance). The K-means clustering algorithm is used to perform cluster analysis on all feature vectors. The number of cluster centers is initialized to 4 (consistent with the number in the standard process stage). Each feature vector is assigned to the nearest cluster center through iterative calculation until the cluster centers no longer change significantly or the maximum number of iterations is reached, thus obtaining the initial cluster label for each image.
[0021] Based on the acquisition time and process plan time node of each image frame, the temporal probability of the image belonging to each process stage is calculated. Combining the temporal probability and clustering probability, the final annotation stage of each image is calculated through the time window weighted correction method. A mapping relationship table between historical process images and process stages is established, which includes fields such as image ID, file name, acquisition time, batch number, stage ID, and annotation confidence.
[0022] S2. Using the qualified form of the purified material as the boundary of the quantification space, according to the process sequence, the characteristics of the medicinal materials are quantitatively analyzed in each process stage in combination with the corresponding historical process images, and the quantitative values of the medicinal material characteristics corresponding to each historical process image and the qualified range of the quantitative values of the medicinal material characteristics corresponding to each process stage are obtained. In S2, the final qualified form of the purified product is extracted at the purification management end of Chinese medicinal materials, and the qualified form of the intermediate product at each process stage is derived in combination with the process plan, and a morphological correlation map from the qualified form to the intermediate product at each process stage is established. The qualified form of intermediate products at each process stage is used as the spatial boundary for quantifying the characteristics of medicinal materials at that stage. The quality standards for the final qualified products extracted from the purification management of Chinese medicinal materials are defined, specifying the core morphological indicators such as color, transparency, particle size, uniformity, and impurity content of the final products.
[0023] Based on the physicochemical changes of materials during the extraction and purification process of Chinese medicinal materials, the reverse deduction method is adopted. Combined with the theoretical reaction degree of each stage in the process plan, the qualified morphological characteristics of the intermediate products in the four core stages of extraction, chromatography and crystallization are deduced in turn.
[0024] Establish a correspondence between the qualified form of the final product and the qualified form of intermediate products at each process stage, form a morphological correlation map and store it in the database, and use the qualified form of intermediate products at each stage as the spatial boundary for the quantification of medicinal material characteristics at that stage.
[0025] According to the process sequence, at each process stage, all qualified historical process images of that stage are extracted, each historical process image is preprocessed, and the medicinal material features are extracted after preprocessing. Then, the extracted medicinal material features are standardized and converted into a quantitative value range of 0-100.
[0026] Based on the process sequence, the four core process stages are processed sequentially. Historical process images of all qualified batches for the corresponding stage are extracted from the historical image database, and each image frame is processed using the S1 preprocessing method.
[0027] Four types of medicinal material features were extracted from the preprocessed image: color features (HSV three-channel mean, standard deviation, color moment), texture features (contrast, correlation, energy, entropy of gray-level co-occurrence matrix), shape features (edge density, solid-liquid interface height, average particle size), and motion features (interface change rate, particle settling velocity), for a total of 16-dimensional original feature vectors. The extracted 16-dimensional original features are linearly standardized to map all features to a numerical range of 0-100. The larger the value, the closer the feature is to the ideal state of a qualified form.
[0028] In S2, the contribution of each medicinal material feature to the corresponding qualified form is calculated by principal component analysis. Based on the contribution, a corresponding weight coefficient is assigned to each medicinal material feature. Then, the quantitative values corresponding to each medicinal material feature are combined with the corresponding weight coefficients and summed to obtain the quantitative values of the medicinal material features corresponding to each historical process image. Principal component analysis was used to calculate the contribution of each medicinal material characteristic to the corresponding qualified form. First, a standardized feature data matrix was constructed, the covariance matrix was calculated, and its eigenvalues and eigenvectors were solved. Principal components with a cumulative contribution of ≥95% were selected by sorting the eigenvalues from largest to smallest.
[0029] The overall contribution of each original feature is calculated using the principal component loading matrix. After normalizing the contribution, the weight coefficient of each feature is obtained. Finally, the standardized quantized value of each feature is multiplied by the corresponding weight coefficient and summed to obtain the overall quantized value of each frame of historical process image. Then, in the historical process images, the final historical process images of each process stage are selected, and the maximum and minimum values are extracted by combining the quantitative values of the selected historical process images. The extracted maximum and minimum values are combined as the qualified range of the qualified quantitative values corresponding to each process stage.
[0030] S3. Extract real-time process images for quantitative numerical analysis, and combine real-time process images and process plans with historical process images to perform predictive process image analysis. Then, in the list of predicted process images, perform image matching and quantitative analysis on the characteristics of medicinal materials to obtain the predicted quantitative values corresponding to each characteristic of medicinal materials. In S3, real-time process images at the current moment are acquired, and quantitative numerical analysis is performed based on the real-time process images to obtain the quantitative values corresponding to the real-time process images. The method here is the same as in S2. A process image prediction model based on temporal generative adversarial network is constructed and trained using historical process image sequences as the training set. The model consists of two parts: a generator and a discriminator. The generator uses a hybrid LSTM-CNN structure, taking a sequence of historical images as input and outputting a sequence of future images. The discriminator uses a CNN structure to determine whether the input image sequence is a real historical sequence or a generated sequence.
[0031] Using the historical process image sequence constructed in S1 as the training set, each 15 consecutive images are taken as a training sample (corresponding to a 15-minute process). The Adam optimizer is used to train the model until the loss function converges. The real-time process images acquired in real time are used as input and fed into the trained process image prediction model; Among them, the real-time process images acquired in real time include process images of the Chinese medicinal material from the start of the extraction and purification process to the current moment; By combining the remaining time of the current process stage in the process plan, a sequence of predicted process images covering the remaining time is generated, forming a list of predicted process images; The complete time-series input sequence is composed of all real-time process images of the Chinese medicinal material from the start of extraction and purification to the current moment. This sequence is then input into the trained TS-GAN model to obtain the remaining time of the current process stage in the process plan. Following a prediction step size of 1 frame / minute, a predicted process image sequence covering the entire remaining time is generated, forming a predicted process image list. If there are 30 minutes remaining in the current stage, 30 predictive images will be generated, corresponding to the process status for each minute within the next 30 minutes.
[0032] For each frame of the predicted process image in the predicted process image list, medicinal material features are extracted. The extracted medicinal material features are then quantized to obtain the predicted quantized values corresponding to each predicted process image. Simultaneously, the extracted medicinal material features are combined with historical process images of the same process stage for similarity matching. The similarity between each frame of the predicted process image and the historical process images is calculated. Then, the predicted quantized values of the predicted process images are corrected based on the similarity corresponding to the historical process images. The steps are as follows: For each frame of the predicted process image list, the same feature extraction and quantization methods as S2 are used to calculate the initial predicted quantization value. A 16-dimensional feature vector is extracted from each frame of the predicted image, and its similarity is matched with the feature vectors of all historical process images from the same process stage. The cosine similarity is calculated, and the five historical process images with the highest similarity and their corresponding actual quantization values are selected. A weighted average method is used to correct the initial predicted quantization value to obtain the final predicted quantization value, as shown in the following formula: ; in, To calculate the cosine similarity between the predicted image and the m-th historical image, within the range [-1, 1], P is the 16-dimensional feature vector of the predicted image. Let m be the 16-dimensional feature vector of the m-th historical image;
[0033] in, This represents the final corrected predicted quantized value at time t. Let t be the feature vector of the image predicted at time t. This represents the actual quantization value of the m-th similar historical image.
[0034] S4. Compare the real-time process images with historical process images to extract the historical process images with the highest similarity and combine them with the remaining time of the process stage. Set a deviation buffer for the process stage, and then compare the predicted quantitative values with the deviation buffer and the qualified range. Determine the production status based on the comparison results. In S4, the medicinal material features of the real-time process image are extracted, and the medicinal material features of the real-time process image are combined with the medicinal material features corresponding to all historical process images for similarity comparison to obtain the similarity of medicinal material features between the real-time process image and the historical process image. The cosine similarity algorithm is used to obtain the similarity value between the real-time image and each historical image. The maximum value among all similarity values and its corresponding complete historical process are extracted as the best reference benchmark for the current process. Extract the corresponding similarity and its corresponding historical process, and combine the highest similarity with the remaining time of the current process stage corresponding to the real-time process image, and set the deviation buffer. The reference deviation range of the historical process is determined based on the highest extracted similarity value. The reference deviation range is the maximum fluctuation range of the comprehensive quantitative value in the optimal reference historical process.
[0035] At the same time, the time weighting coefficient is calculated based on the remaining time of the current process stage. The longer the remaining time, the larger the time weighting coefficient, and the greater the allowable range of process fluctuations.
[0036] Multiply the reference deviation range by the time weighting coefficient to obtain the dynamic deviation buffer zone for the current process stage. This zone is located within the qualified zone determined by S2.
[0037] The reference deviation range of the historical process is determined based on the highest similarity value. At the same time, the time weight coefficient is calculated based on the remaining time of the current process stage. The longer the remaining time, the larger the time weight coefficient. Multiply the reference deviation range by the time weighting coefficient to obtain the deviation buffer range for the current process stage; The predicted quantitative values are compared with the deviation buffer and the acceptable range; When the predicted quantitative value exceeds the deviation buffer but does not exceed the qualified range, a production warning is issued, indicating that there is a potential deviation risk in the process, triggering a level one warning to alert operators. If the predicted quantified value does not exceed the deviation buffer and the qualified range, it is considered normal; If the predicted quantitative value exceeds the acceptable range, a production anomaly is determined, triggering a level-two warning, and the anomaly information is immediately sent to S5 for further processing.
[0038] S5. When S4 determines that the production status is abnormal, the time-series quantization value of the real-time process image is combined with the historical process image of the same period of the process plan to perform real-time deviation rate trend analysis, and the abnormal node is located and the production status abnormality is eliminated based on the real-time deviation rate trend.
[0039] In S5, the production exception sent by S4 is received; Extract time-series quantization values from all real-time process images prior to the occurrence of the anomaly to form a real-time quantization value sequence; Receive production anomaly notifications sent by S4, along with the corresponding anomaly timestamp and current process stage ID information. Extract the comprehensive quantitative values corresponding to all real-time process images within 60 minutes prior to the anomaly occurrence, arrange them in ascending order by acquisition time, and form a real-time quantitative value sequence of length N.
[0040] Extract the average quantized numerical sequence of historical process images from the same period of the process plan from the historical database; The real-time deviation rate at each time point is calculated by combining the real-time quantized numerical sequence with the average quantized numerical sequence of historical process images, and a trend curve of the real-time deviation rate over time is generated. When the trend range rises continuously, identify the time point in the real-time deviation rate trend curve when the deviation rate begins to rise, and determine that time point as an abnormal node. The real-time deviation rate trend curve is analyzed by the continuous increasing trend judgment method. When the real-time deviation rate shows a monotonically increasing trend for 5 consecutive time points, it is judged as an abnormal development trend. The first time point when the deviation rate starts to rise is determined as the abnormal starting node by tracing back the continuous increasing interval. When the trend range does not rise continuously and the real-time deviation rate falls back to the deviation buffer range, it is determined that the abnormality has been eliminated and normal production has been restored, which meets two conditions: the real-time deviation rate trend curve no longer shows a continuous upward trend, and the deviation rate at three consecutive time points shows a decreasing or stable state; the comprehensive quantitative value corresponding to the latest real-time deviation rate has fallen back to the dynamic deviation buffer range set by S4.
[0041] The second objective of this invention is to provide an extraction and purification monitoring system based on digital image processing, including any one of the above-mentioned extraction and purification monitoring methods based on digital image processing, comprising a process division module, a feature quantification module, and a production determination module; The process segmentation module is used to divide the extraction and purification process into process stages according to the process plan. At the same time, it acquires process images of the purification device, extracts historical process images to divide the process stages, and obtains the process stage corresponding to each historical process image. The feature quantification module is used to perform quantitative analysis of medicinal material features in each process stage, based on the qualified form of the purified material as the boundary of the quantification space and the corresponding historical process images, according to the process sequence. It obtains the quantified values of medicinal material features corresponding to each historical process image and the qualified range of the quantified values of medicinal material features corresponding to each process stage. At the same time, it extracts real-time process images for quantitative value analysis and combines real-time process images and process plans with historical process images for predicted process image analysis. Then, in the predicted process image list, it performs image matching and quantification analysis on medicinal material features to obtain the predicted quantified values corresponding to each medicinal material feature. The production determination module is used to compare the similarity of real-time process images with historical process images, extract the historical process image with the highest similarity, combine it with the remaining time of the process stage, set a deviation buffer for the process stage, and then compare the predicted quantitative value with the deviation buffer and the qualified interval. Based on the comparison results, the production status is determined. When the production status is determined to be abnormal, the time-series quantitative value of the real-time process image is combined with the historical process image of the same period of the process plan to perform real-time deviation rate trend analysis. Based on the real-time deviation rate trend, abnormal nodes are located and the production status abnormality is eliminated.
[0042] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely preferred examples and are not intended to limit the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for monitoring extraction and purification based on digital image processing, characterized in that: Includes the following steps: S1. Divide the extraction and purification process into process stages according to the process plan, and at the same time collect process images of the purification device, extract historical process images to divide the process into process stages, and obtain the process stage corresponding to each historical process image. S2. Using the qualified form of the purified material as the boundary of the quantification space, according to the process sequence, the characteristics of the medicinal materials are quantitatively analyzed in each process stage in combination with the corresponding historical process images, and the quantitative values of the medicinal material characteristics corresponding to each historical process image and the qualified range of the quantitative values of the medicinal material characteristics corresponding to each process stage are obtained. S3. Extract real-time process images for quantitative numerical analysis, and combine real-time process images and process plans with historical process images to perform predictive process image analysis. Then, in the list of predicted process images, perform image matching and quantitative analysis on the characteristics of medicinal materials to obtain the predicted quantitative values corresponding to each characteristic of medicinal materials. S4. Compare the real-time process images with historical process images to extract the historical process images with the highest similarity and combine them with the remaining time of the process stage. Set a deviation buffer for the process stage, and then compare the predicted quantitative values with the deviation buffer and the qualified range. Determine the production status based on the comparison results. S5. When S4 determines that the production status is abnormal, the time-series quantization value of the real-time process image is combined with the historical process image of the same period of the process plan to perform real-time deviation rate trend analysis, and the abnormal node is located and the production status abnormality is eliminated based on the real-time deviation rate trend.
2. The extraction and purification monitoring method based on digital image processing according to claim 1, characterized in that: In step S1, the process plan for the extraction and purification of Chinese medicinal materials is obtained from the Chinese medicinal material extraction and purification management terminal. The process plan is analyzed to obtain the process stage corresponding to the process plan. The extraction and purification process is divided into multiple stages according to the process plan.
3. The extraction and purification monitoring method based on digital image processing according to claim 1, characterized in that: In S1, an industrial camera and a matching light source system are installed at the sight glass position of each purification device; The exposure time and gain parameters of the industrial camera are automatically adjusted according to the lighting conditions of different process stages. At the same time, anti-fog lenses and automatic fog removal devices are used to eliminate the impact of steam condensation on image quality. Then, process images are acquired at a collection frequency that matches the process stage. Extract images of the entire process of qualified production from the purification and management end of Chinese medicinal materials, and form a historical image sequence in chronological order; Cluster analysis is performed on historical image sequences, and the clustering results are corrected in conjunction with the time nodes of the process plan. Each frame of historical process image is automatically labeled with the corresponding standard process stage, and a mapping relationship between historical process images and process stages is established.
4. The extraction and purification monitoring method based on digital image processing according to claim 1, characterized in that: In S2, the final qualified form of the purified product is extracted at the purification management end of the Chinese medicinal materials, and the qualified form of the intermediate product at each process stage is deduced in combination with the process plan, and a morphological correlation map from the qualified form to the intermediate product at each process stage is established. The qualified form of intermediate products at each process stage is used as the spatial boundary for quantifying the characteristics of medicinal materials at that stage. According to the process sequence, at each process stage, all qualified historical process images of that stage are extracted, each historical process image is preprocessed, and the medicinal material features are extracted after preprocessing. Then, the extracted medicinal material features are standardized and converted into a quantitative value range of 0-100.
5. The extraction and purification monitoring method based on digital image processing according to claim 4, characterized in that: In step S2, the contribution of each medicinal material feature to the corresponding qualified form is calculated by principal component analysis. Based on the contribution, a corresponding weight coefficient is assigned to each medicinal material feature. Then, the quantitative values corresponding to each medicinal material feature are combined with the corresponding weight coefficients to obtain the quantitative values of the medicinal material features corresponding to each historical process image. Then, in the historical process images, the final historical process images of each process stage are selected, and the maximum and minimum values are extracted by combining the quantitative values of the selected historical process images. The extracted maximum and minimum values are combined as the qualified range of the qualified quantitative values corresponding to each process stage.
6. The extraction and purification monitoring method based on digital image processing according to claim 1, characterized in that: In step S3, a real-time process image at the current moment is acquired, and quantitative numerical analysis is performed based on the real-time process image to obtain the quantitative value corresponding to the real-time process image. A process image prediction model based on temporal generative adversarial network is constructed and trained using historical process image sequences as the training set. The real-time process images acquired in real time are used as input and fed into the trained process image prediction model; Among them, the real-time process images acquired in real time include process images of the current batch of Chinese medicinal materials to be purified from the start of the extraction and purification process to the current moment; By combining the remaining time of the current process stage in the process plan, a sequence of predicted process images covering the remaining time is generated, forming a list of predicted process images; For each frame of the predicted process image in the predicted process image list, medicinal material features are extracted, and the extracted medicinal material features are quantized to obtain the predicted quantized value corresponding to each predicted process image. At the same time, the extracted medicinal material features are combined with historical process images of the same process stage for similarity matching. The similarity between each frame of the predicted process image and the historical process image is calculated, and then the predicted quantized value of the predicted process image is corrected based on the similarity corresponding to the historical process image.
7. The extraction and purification monitoring method based on digital image processing according to claim 1, characterized in that: In step S4, the medicinal material features of the real-time process image are extracted, and the medicinal material features of the real-time process image are combined with the medicinal material features corresponding to all historical process images for similarity comparison to obtain the similarity of medicinal material features between the real-time process image and the historical process image. Extract the corresponding similarity and its corresponding historical process, and combine the highest similarity with the remaining time of the current process stage corresponding to the real-time process image, and set the deviation buffer. The reference deviation range of the historical process is determined based on the highest similarity value. At the same time, the time weight coefficient is calculated based on the remaining time of the current process stage. The longer the remaining time, the larger the time weight coefficient. Multiply the reference deviation range by the time weighting coefficient to obtain the deviation buffer range for the current process stage; The predicted quantitative values are compared with the deviation buffer and the acceptable range; If the predicted quantitative value exceeds the deviation buffer but does not exceed the qualified range, a production warning is issued. If the predicted quantified value does not exceed the deviation buffer and the qualified range, it is considered normal; If the predicted quantitative value exceeds the acceptable range, a production anomaly is determined and sent to S5.
8. The extraction and purification monitoring method based on digital image processing according to claim 1, characterized in that: In step S5, the production anomaly sent by step S4 is received; Extract time-series quantization values from all real-time process images prior to the occurrence of the anomaly to form a real-time quantization value sequence; Extract the average quantized numerical sequence of historical process images from the same period of the process plan from the historical database; The real-time deviation rate at each time point is calculated by combining the real-time quantized numerical sequence with the average quantized numerical sequence of historical process images, and a trend curve of the real-time deviation rate over time is generated. When the trend range rises continuously, identify the time point in the real-time deviation rate trend curve when the deviation rate begins to rise, and determine that time point as an abnormal node. When the trend range does not rise continuously and the real-time deviation rate falls back to within the deviation buffer range, the anomaly is determined to be eliminated and normal production status is restored.
9. A digital image processing-based extraction and purification monitoring system, used to implement the digital image processing-based extraction and purification monitoring method according to any one of claims 1-8, characterized in that: This includes a process division module, a feature quantification module, and a production determination module; The process division module is used to divide the extraction and purification process into process stages according to the process plan, and at the same time, to acquire process images of the purification device, extract historical process images to divide the process stages, and obtain the process stage corresponding to each historical process image. The feature quantification module is used to take the qualified form of the purified product as the quantification space boundary, and according to the process sequence, to perform quantification analysis of medicinal material features in each process stage in combination with the corresponding historical process images. It obtains the quantified values of medicinal material features corresponding to each historical process image, as well as the qualified range of the quantified values of medicinal material features corresponding to each process stage. At the same time, it extracts real-time process images for quantification analysis, and combines real-time process images and process plans with historical process images for predictive process image analysis. Then, in the list of predicted process images, it performs image matching and quantification analysis on medicinal material features to obtain the predicted quantified values corresponding to each medicinal material feature. The production determination module is used to compare the real-time process images with historical process images for similarity, extract the historical process image with the highest similarity and combine it with the remaining time of the process stage, set a deviation buffer for the process stage, and then compare the predicted quantitative value with the deviation buffer and the qualified interval. The production status is determined based on the comparison result. When the production status is determined to be abnormal, the time-series quantitative value of the real-time process image is combined with the historical process image of the same period of the process plan to perform real-time deviation rate trend analysis, and the abnormal node is located and the production status abnormality is eliminated based on the real-time deviation rate trend.