An apparatus and method for detecting abnormal states in a continuous crystallization process.

By using computer vision and principal component analysis techniques, the state of the continuous crystallization process can be detected in real time, which solves the problems of resource consumption and time lag in offline analysis methods and achieves efficient and accurate detection of crystallization process anomalies.

CN121703089BActive Publication Date: 2026-05-26BEIJING INSTITUTE OF PETROCHEMICAL TECHNOLOGY
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING INSTITUTE OF PETROCHEMICAL TECHNOLOGY
Filing Date
2025-12-26
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

In existing technologies, anomaly detection in continuous crystallization processes relies on offline analysis methods, which result in high resource consumption and time lag, making it difficult to achieve timely and effective process control and optimization.

Method used

By employing computer vision technology, images of the crystallization process are acquired in real time through an image acquisition system. Principal component analysis is then used to extract the principal components of the images, and a multivariate statistical process control model is established to achieve real-time detection of the crystallization process status.

Benefits of technology

It has achieved automated and intelligent detection of the continuous crystallization process, reduced the consumption of manpower and material resources, improved the accuracy and timeliness of detection, and can promptly identify abnormal states.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121703089B_ABST
    Figure CN121703089B_ABST
Patent Text Reader

Abstract

This invention discloses an apparatus and method for detecting anomalies in a continuous crystallization process. These are corresponding solutions, in which: image analysis methods are used to extract the color information of each pixel in the crystallization image; based on the color attributes of each pixel in the image, principal component analysis is used to extract principal components; these principal components comprehensively consider the correlation between the color attributes of different pixels and can reflect the essential features of the image; based on the principal components, a multivariate statistical process control model can be constructed, thereby enabling real-time detection of the state of new continuous crystallization process images. Overall, the above-mentioned solutions provided by this invention can effectively support the automation and intelligent development of continuous crystallization process state detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of abnormal state detection technology in crystallization processes, and in particular to an apparatus and method for detecting abnormal state in continuous crystallization processes. Background Technology

[0002] Crystallization is an important industrial technique for solid-liquid separation and product preparation, widely used in chemical, pharmaceutical, materials, and food industries. Industrial crystallization mainly involves two methods: batch crystallization and continuous crystallization. Batch crystallization is a relatively traditional method, offering flexibility and mature technology, but often resulting in poor consistency between batches and complex control. Continuous crystallization represents the current technological trend, offering higher production efficiency, more stable product quality, and easier implementation of process control strategies.

[0003] Continuous crystallization requires stable product quality and yield. Therefore, timely monitoring of the crystallizer's production status and issuing alerts for potential anomalies during the crystallization process is of significant practical importance. The quality assessment of crystal products is mainly based on crystal form, size distribution, and shape distribution, while yield assessment primarily relies on crystal quality. Currently, offline analysis is a widely used method for monitoring continuous crystallization processes. This involves periodically extracting samples from the crystallization reactor and then visually observing and photographing the crystals under a microscope in a laboratory. Qualitative judgments made visually, combined with quantitative indicators from image analysis, reflect the production status information during the continuous crystallization process.

[0004] However, offline analysis methods relying on periodic sampling consume significant human and material resources. A greater problem is the substantial time lag inherent in offline analysis, making timely and effective process control and optimization difficult for potential anomalies. On the other hand, analytical methods based on microscopic observation and image analysis to extract crystal properties are often subject to errors due to image complexity, affecting the accurate assessment of the crystallization process status. Therefore, developing precise and efficient real-time crystal process status monitoring technology is crucial for optimizing continuous crystallization processes and promoting automation and intelligence.

[0005] In view of this, the present invention is hereby proposed. Summary of the Invention

[0006] The purpose of this invention is to provide an apparatus and method for detecting abnormal states in a continuous crystallization process, which, based on computer vision technology, enables real-time intelligent detection of the state of the continuous crystallization process.

[0007] The objective of this invention is achieved through the following technical solution:

[0008] A method for detecting abnormal states in a continuous crystallization process includes:

[0009] Step 1: Collect images of the continuous crystallization process as a historical dataset;

[0010] Step 2: Combining the color attributes of each pixel in each image in the historical dataset, principal component analysis is used to extract the principal components of the historical dataset, and a set number of principal components are selected to establish a multivariate statistical process control model.

[0011] Step 3: For the new continuous crystallization process image, extract the principal components using the method in Step 2, and combine them with the multivariate statistical process control model to determine whether the continuous crystallization process state is abnormal.

[0012] An apparatus for detecting abnormal states in a continuous crystallization process, used in the aforementioned method, comprising:

[0013] An image acquisition system for acquiring images of a continuous crystallization process and transmitting them to a computer includes: a two-dimensional imaging probe and an imaging controller; the two-dimensional imaging probe is built into the continuous crystallizer and continuously acquires images of the continuous crystallization process through a camera at the bottom; the imaging controller is used to control the operation mode of the two-dimensional imaging probe and transmit the continuous crystallization process images acquired by the two-dimensional imaging probe to the computer.

[0014] A computer is used to execute the following process: Step 1: Collect images of the continuous crystallization process as a historical dataset; Step 2: Combine the color attributes of each pixel in each image of the historical dataset, use principal component analysis to extract the principal components of the historical dataset, and select a set number of principal components to establish a multivariate statistical process control model; Step 3: For new images of the continuous crystallization process, extract the principal components using the method in Step 2, and combine them with the multivariate statistical process control model to determine whether the state of the continuous crystallization process is abnormal.

[0015] As can be seen from the technical solution provided by the present invention, image analysis methods are used to extract the color information of each pixel in the crystallization image. Based on the color attributes of each pixel in the image, principal component analysis (PCA) is used to extract principal components. These principal components comprehensively consider the correlation between the color attributes of different pixels and can reflect the essential features of the image. Based on the principal components, a multivariate statistical process control model can be constructed to detect the state of new continuous crystallization process images in real time. Overall, the above-mentioned solution provided by the present invention provides effective support for the automation and intelligent development of continuous crystallization process state detection. Attached Figure Description

[0016] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 This is a flowchart of a method for detecting abnormal states in a continuous crystallization process, provided as an embodiment of the present invention.

[0018] Figure 2 This is a schematic diagram of the technical route for a method of detecting abnormal states in a continuous crystallization process, provided in an embodiment of the present invention.

[0019] Figure 3 This is a schematic diagram of the image attribute processing flow provided in an embodiment of the present invention.

[0020] Figure 4 This is a schematic diagram illustrating the evolution of the cumulative variance explained by the number of principal components, as provided in an embodiment of the present invention.

[0021] Figure 5 T provided for embodiments of the present invention 2 A schematic diagram of a control chart.

[0022] Figure 6 This is a schematic diagram of the detection results of two test set images provided in an embodiment of the present invention.

[0023] Figure 7 This is a schematic diagram of the grayscale value distribution of the training set and the abnormal image provided in an embodiment of the present invention.

[0024] Figure 8 This is a schematic diagram of a continuous crystallization process state abnormality detection device provided in an embodiment of the present invention. Detailed Implementation

[0025] 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 protection scope of the present invention.

[0026] First, the following explanations are provided for the terms that may be used in this article:

[0027] The terms "comprising," "including," "containing," "having," or other similar semantic descriptions should be interpreted as non-exclusive inclusion. For example, including a technical feature element (such as raw material, component, ingredient, carrier, dosage form, material, size, part, component, mechanism, device, step, process, method, reaction conditions, processing conditions, parameter, algorithm, signal, data, product or article of manufacture, etc.) should be interpreted as including not only the expressly listed technical feature element, but also other technical feature elements that are not expressly listed and are well-known in the art.

[0028] The term "composed of" excludes any technical features not expressly listed. When used in a claim, it closes the claim to exclude all technical features other than those expressly listed, except for associated conventional impurities. If the term appears only in a clause of a claim, it limits the claim to the elements expressly listed in that clause; elements recited in other clauses are not excluded from the overall claim.

[0029] The following is a detailed description of the apparatus and method for detecting abnormal states in a continuous crystallization process provided by the present invention. Contents not described in detail in the embodiments of the present invention are prior art known to those skilled in the art. Where specific conditions are not specified in the embodiments of the present invention, conventional conditions in the art or conditions recommended by the manufacturer shall apply. Reagents or instruments used in the embodiments of the present invention whose manufacturers are not specified are all conventional products that can be purchased commercially.

[0030] Example 1

[0031] This invention provides a method for detecting abnormal states in a continuous crystallization process, such as... Figure 1 As shown, it mainly includes the following steps:

[0032] Step 1: Collect images of the continuous crystallization process as a historical dataset.

[0033] Step 2: Combining the color attributes of each pixel in each image of the historical dataset, principal component analysis is used to extract the principal components of the historical dataset, and a set number of principal components are selected to establish a multivariate statistical process control model.

[0034] In this embodiment of the invention, the step of extracting the principal components of the historical dataset by combining the color attributes of each pixel in each image of the historical dataset and using principal component analysis includes: Let the horizontal resolution of the image be W, and the vertical resolution be H, then the total number of pixels is W×H; the grayscale value of each pixel in the image is its color attribute, and by extracting the color attributes of all pixels, the total number of color attributes k is W×H, forming a matrix M. W×H ; the characteristic matrix M W×HPerforming a one-dimensional expansion, we first look at the grayscale values ​​of each pixel in the first row, resulting in W elements. Then we look at the grayscale values ​​of each pixel in the second row, and so on, until the Hth row. The row vector is represented as [C1, C2, C3, ..., C...]. k The row vector [C1', C2', C3', ..., C4'] is a vector whose elements represent the grayscale value of a pixel. Based on these grayscale values, the elements in the row vector are arranged in ascending order to obtain the sorted row vector [C1', C2', C3', ..., C4']. k The principal component analysis method is used to extract the principal components of the historical dataset from the sorted row vectors of all images in the historical dataset.

[0035] In this embodiment of the invention, the step of extracting the principal components of the historical dataset from the sorted row vectors of all images in the historical dataset using principal component analysis includes: converting the color attributes of all pixels in all images of the historical dataset into multiple independent principal components through orthogonal linear transformation, thereby obtaining the principal components of the historical dataset [PC1, PC2, PC3, ..., PC...]. k ], where each item represents a principal element, and k is the number of principal elements, which is equivalent to the total number of color attributes.

[0036] In this embodiment of the invention, selecting a predetermined number of principal components and establishing a multivariate statistical process control model includes: selecting q principal components (i.e., a predetermined number) from the principal components of the historical dataset. The number q of principal components is determined by the evolution of the cumulative variance explained by principal components with the number of principal components. Multivariate statistical process control models constructed with different numbers of principal components meet the quality control requirements of different standards. Then, based on Hotelling T... 2 Based on the predicted squared error, a multivariate statistical process control model is established, wherein: Hotelling T is calculated using the selected q principal components. 2 Control limits, and the control limits for the predicted squared error calculated using the selected q principal components; using the calculated Hotelling T 2 Anomaly detection is achieved by using control limits and prediction squared error control limits.

[0037] In this embodiment of the invention, the Hotelling T is calculated by combining the principal components of all images in the historical dataset. 2 Control limits are expressed as:

[0038] ;

[0039] in, For Hotelling T 2 Control limit, F α (q, n - q) is the upper α quantile critical point of the F distribution with q and nq degrees of freedom, where n is the number of images in the historical dataset.

[0040] The F-distribution is a sampling distribution of a statistic derived from the standard normal distribution. Its calculation method is as follows:

[0041] ;

[0042] in, and These are chi-square distributions with degrees of freedom q and nq, respectively.

[0043] Its α-quantile critical point F α (q, n - q) refers to the critical value at a significance level of α that makes the probability of the random variable falling on its right tail equal to that significance level, and is defined as follows:

[0044] ;

[0045] In this embodiment of the invention, the prediction squared error control limit is calculated by combining the principal components of all images in the historical dataset, and is expressed as follows:

[0046] ;

[0047] in, To predict the control limits of the squared error, It is the standard normal distribution value at a significance level of α. The parameters are calculated using θ1, θ2, and θ3: θ1, θ2, and θ3 are parameters calculated using the principal components of all images, and are expressed as follows:

[0048] ;

[0049] ;

[0050] ;

[0051] Where, λ i It is the eigenvalue of the i-th principal component. It represents the variance of the data in the direction of the corresponding principal component, reflecting the explanatory power of that principal component for the total variation of the original data.

[0052] The feature values ​​of the samples are obtained as follows. For the grayscale value row vector [C1', C2', C3', ..., C...] of the image... k Transpose the vector [C1', C2', C3', ..., C] to form a column vector. k '] TBased on all images in the historical dataset, a standardization operation is performed on each column vector, which involves subtracting the mean of each attribute and then dividing by their standard deviation. The covariance matrix S is obtained based on the standardization result of each column vector. k×k Then calculate the k eigenvalues ​​of the matrix.

[0053] Principal component analysis specifies that eigenvalues ​​should be sorted from largest to smallest, i.e.:

[0054] ;

[0055] Each principal component corresponds to an eigenvalue, i.e., the principal component PC. i Corresponding to the eigenvalue λ i The earlier the principal component, the more data variation it will explain.

[0056] The number of principal components q chosen during modeling can be based on the cumulative explained variance EVR. q judge:

[0057] ;

[0058] EVR is typically required. q The value is greater than a certain value. The principal components selected during modeling are [PC1, PC2, PC3, ..., PC...]. q ].

[0059] Step 3: For the new continuous crystallization process image, extract the principal components using the method in Step 2, and combine them with the multivariate statistical process control model to determine whether the continuous crystallization process state is abnormal.

[0060] In this embodiment of the invention, the Hotelling's T of the new continuous crystallization process image is calculated by combining the extracted principal components. 2 Statistic T 2 And the statistic SPE of the predicted squared error; determine Hotelling's T 2 Statistic T 2 Does the statistic SPE of the predicted squared error exceed the corresponding Hotelling T? 2 Control limits and prediction squared error control limits: if any statistic exceeds the corresponding control limit, it indicates that the continuous crystallization process is in an abnormal state.

[0061] In this embodiment of the invention, Hotelling's T is used to calculate the new continuous crystallization process image. 2 Statistic T 2 , represented as:

[0062] ;

[0063] Among them, ti The score of the new continuous crystallization process image for the i-th principal element is represented by principal component analysis. Let be the variance of the score of the i-th principal component in the historical dataset; q is the number of principal components selected.

[0064] In this embodiment of the invention, the statistic SPE for calculating the predicted squared error of the new continuous crystallization process image is expressed as:

[0065] ;

[0066] Where k represents the total number of color attributes. Let j represent the j-th attribute of the new continuous crystallization process image x. The reconstructed value based on the principal component analysis model is calculated as follows:

[0067] ;

[0068] ;

[0069] ;

[0070] Among them, P i P represents the loading matrix P corresponding to the first q principal components in the principal component analysis method. k×q The i-th column; For P i The row vector after transposition. For the load matrix P k×q The element in the j-th row and i-th column.

[0071] Let [C1', C2', C3', ..., C] be the column vectors corresponding to the original sample x. k '] T The result after standardized procedures; and These are the mean and standard deviation of attribute j used in the standardization operation, respectively.

[0072] To more clearly demonstrate the technical solution and its effects provided by the present invention, the method provided by the embodiments of the present invention will be described in detail below with reference to specific examples.

[0073] I. Overall Overview of the Plan

[0074] The purpose of this invention is to establish an online detection platform for the quality of continuously crystallized products based on computer vision technology, enabling real-time intelligent detection of the continuous crystallization process status. The continuous crystallization process is imaged in real-time using in-situ microscopic imaging technology. Image analysis methods are used to extract the color information of each pixel in the crystallization image, and then multivariate statistical process control (MSPC) is employed to detect abnormal crystallization process states. MSPC is a data-driven multivariate data analysis technique that projects multiple interrelated variables onto a low-dimensional feature space and uses statistical models to analyze whether state points exceed control limits. Specifically, based on the color attributes of each pixel in the image, principal component analysis (PCA) is used to extract principal components. These principal components comprehensively consider the correlation between the color attributes of different pixels, reflecting the essential characteristics of the image. Furthermore, by selecting different numbers of principal components, multiple different multivariate statistical process control models are established to meet the product quality control requirements of different standards. This invention will provide effective support for the automation and intelligent development of continuous crystallization process status detection.

[0075] like Figure 2 As shown, the main technical flow of the present invention is provided, which mainly includes:

[0076] 1. Online imaging of the crystallization process. Using an imaging controller to set the relevant parameters of the in-situ microscopic imaging probe, in-situ images of the continuous crystallization process are acquired in real time.

[0077] 2. Extract the color information of each pixel in the image using image processing methods. Arrange the grayscale values ​​of all pixels in a row, and then sort them from smallest to largest.

[0078] 3. Principal Component Analysis (PCA) is used to extract principal components. Each image in the historical dataset is treated as a sample, and the grayscale value of each sorted pixel is treated as an attribute. These attributes are then input into PCA to extract principal components. Simultaneously, the evolution curve of the cumulative variance explained as a function of the number of principal components is obtained.

[0079] 4. Obtain the control limits of multivariate statistical process control based on a certain number of principal components. Select an appropriate number of principal components based on the cumulative variance explained rate curve. Establish multivariate statistical process control models at different levels by selecting different principal components, thereby meeting the quality control requirements of different standards. Determine Hotelling's T based on historical data. 2 Control limits for the SPE statistic and the SPE statistic.

[0080] 5. Perform online monitoring of the continuous crystallization process status. For a new sample image, extract and sort the pixel grayscale values ​​using image analysis methods, and obtain their respective T values. 2 The statistical values ​​and SPE statistical values. If any of the above values ​​for an image exceeds their respective control limits, the image is determined to be in an abnormal state and an alarm is triggered.

[0081] 6. Verify abnormal states. By using the principal components of the corresponding multivariate statistical process control model, images representing abnormal states can be reconstructed. Comparing the reconstructed image with the original image can determine the accuracy of the model.

[0082] The above-described solution provided by the embodiments of the present invention has the following main advantages:

[0083] (1) An automated and intelligent detection scheme for the continuous crystal process state based on online microscopic imaging, image processing, principal component analysis, and multivariate statistical process control is proposed. This scheme can overcome the manpower and material resources consumption and lag of offline detection of continuous crystal growth state.

[0084] (2) A multivariate statistical process control model based on the color values ​​of all pixels in a two-dimensional graphic is proposed, which makes full use of the original information of the image and ensures that the established model can fully reflect the essential characteristics of the continuous crystallization process.

[0085] (3) The proposed method converts the pixel information of a two-dimensional image into a row vector, and further sorts the pixel gray values ​​from small to large, which effectively ensures the consistency of information features under geometric operations such as image rotation and flipping.

[0086] (4) It is proposed to establish multiple multivariate statistical process control models at different levels by selecting different principal components. These models have different identification criteria and sensitivities for abnormal states in continuous crystallization processes, thereby meeting the requirements for continuous crystallization production state detection with different requirements.

[0087] (5) An abnormal state image detected by the principal component reconstruction model based on the multivariate statistical process control model is proposed. The accuracy of the model can be evaluated by comparing the reconstructed image with the original image.

[0088] II. Detailed introduction of the plan.

[0089] The solution provided in this invention is based on a large number of image files acquired from in-situ imaging technology, and employs multivariate statistical process control (MSC) technology to detect the status of the production process. This MSC technology comprises two stages: a modeling stage and a monitoring stage.

[0090] 1. Modeling stage.

[0091] The modeling phase primarily involves building a model based on historical data. For continuous crystallization processes, each image in the historical dataset represents one sample.

[0092] like Figure 3 As shown, each image in the historical dataset undergoes a corresponding processing flow to extract the principal components of the historical dataset. Assuming the horizontal resolution of the continuously crystallizing process images is W and the vertical resolution is H, the total number of pixels in the image is W×H. The image is an 8-bit grayscale image, and the color of each pixel can take values ​​from 0 to 255, for a total of 256 values. The grayscale value of each pixel in the image is its color attribute; therefore, the total number of color attributes k for the samples is W×H, corresponding to the feature matrix M. W×H Since different pixels have different spatial locations, neighboring pixels generally have a special color relationship. Therefore, the attribute values ​​of these pixels are represented by a row vector of length W×H. This row vector first contains the grayscale values ​​of all pixels in the first row, totaling W elements; then the grayscale values ​​of all pixels in the second row, then the third row, and so on, up to the Hth row. The row vector is represented as [C1, C2, C3, ..., C...]. k ].

[0093] Considering that images that are rotated, inverted, or flipped essentially correspond to the same image, the elements in the row vector are arranged in ascending order based on their corresponding grayscale values. The first few elements have a grayscale value of 0, then the grayscale values ​​gradually increase, with the last few pixels having a grayscale value of 255. The row vector after this ordering is represented as [C1', C2', C3', ..., C...]. k ').

[0094] Since the number of original attributes (W×H) of an image is usually very large, principal component analysis (PCA) is used to reduce the dimensionality of historical datasets, extracting principal components that represent essential features and their contributions. PCA projects a high-dimensional data space to a low-dimensional data space, transforming the original correlated variables into a few independent principal components through orthogonal linear transformations. This method simplifies the data structure and reveals the main directions of change in data features while preserving variance information as much as possible. The appropriate number of principal components is determined by observing the evolution of the cumulative variance explained by the principal components with the number of principal components. Generally, the cumulative variance explained needs to be greater than 90%. The number of principal components, q, is usually significantly smaller than the number of original attributes of the image, and the corresponding principal components are represented as [PC1, PC2, PC3, ..., PC...]. q The common values ​​for the number of principal components q are 2, 3, 4, etc.

[0095] Those skilled in the art will understand that principal component analysis is essentially a method for extracting global features. The principal components obtained are information about the entire historical dataset, which is global information. In contrast, different images have different principal component scores (i.e., the projected coordinates of the image on these principal components), which is local information.

[0096] The judgment of abnormal states in the crystallization process is mainly based on Hotelling T. 2 And squared prediction error (SPE). Control limits for these two indicators were determined using statistical methods. 2 The control limits of the statistic are calculated using the F-distribution:

[0097] ;

[0098] Among them, F α (q, n - q) is the upper α quantile critical point of the F distribution with q and nq degrees of freedom. The F distribution is a sampling distribution of a statistic. For specific calculations, please refer to the previous text, which will not be repeated here. The α quantile critical point is the critical value at a significance level of α that makes the probability of the random variable falling on its right tail equal to that significance level. n is the number of samples in the modeling training set.

[0099] The control limits for the SPE statistic are calculated using the following formula:

[0100] ;

[0101] in, It is the standard normal distribution value at a significance level of α. The parameter h0 is calculated as follows: The parameters θ1, θ2, and θ3 are calculated as follows:

[0102] ;

[0103] Where, λ i Let v be the eigenvalue of the i-th principal component, where v = 1, 2, 3.

[0104] The modeling phase is now complete. The next step can be understood as using two types of control limits to detect state anomalies.

[0105] Those skilled in the art will understand that: (1) Hotelling's T² statistic: a generalization of the multivariate t-test, used to measure the degree of difference between a multidimensional sample and the population mean. It is essentially equivalent to the squared Mahalanobis distance of the sample in the covariance-weighted space, used to determine whether there is an abnormal deviation in multidimensional data; (2) SPE statistic (squared prediction error): used to measure the sum of squared residuals of the unexplained portion of the sample in the principal component model. It reflects the degree to which the sample deviates from the model hyperplane and can be used to detect abnormal changes outside the model.

[0106] 2. Monitoring phase.

[0107] During the monitoring phase, the T² value (statistic T) of the continuously crystallizing process images acquired in real time will be calculated based on the previously selected principal components. 2 The T² control chart is used to determine whether new sample points, after being projected onto the principal component space, fall within the control range defined by the reference data. The SPE control chart is used to determine whether the deviation of new samples from the principal component projection space is within acceptable limits. If a novel anomaly occurs that was not used to build a controlled PCA model, the new observation points will deviate from the principal component hyperplane; this anomaly can be identified by calculating the SPE value.

[0108] Hotelling's T, a new image of a continuous crystallization process 2 Statistic T 2 It can be calculated using the following formula:

[0109] ;

[0110] Among them, t i The score of the new continuous crystallization process image for the i-th principal element is represented by principal component analysis. Let be the estimated variance of the i-th principal component in the historical dataset; q is the number of principal components selected.

[0111] The statistic SPE for predicting the squared error of a new continuous crystallization process image can be calculated using the following formula:

[0112] ;

[0113] Where k represents the number of attributes, Let j represent the j-th attribute of the new continuous crystallization process image x. This represents the reconstructed value based on the principal component analysis model.

[0114] The calculation methods for the relevant parameters involved in this section can be found in the previous text, and will not be repeated here.

[0115] In continuous industrial crystallization processes, images of the crystallization process acquired in real time using in-situ imaging technology can be used to continuously calculate Hotelling's T for each image. 2 Statistic T 2 The statistic SPE of the predicted squared error. When Hotelling's T 2 Statistic T 2 Exceeding its control limit Or the statistic SPE of the predicted squared error exceeds its control limit. This will trigger an alarm for abnormal crystallization process status, thereby enabling real-time monitoring of the continuous crystallization process.

[0116] III. Test Conclusions.

[0117] To intuitively demonstrate the effects of the above-mentioned solution of the present invention, the following explanation is provided through testing.

[0118] Based on the above technical solution, a large number of in-situ images of the continuous crystallization process are acquired online. The training data is divided into a training set and a test set, which are used to train the analysis model and test the model accuracy, respectively. Figure 4 This is the cumulative variance explained curve obtained based on principal component analysis. The cumulative variance explained rate initially increases rapidly with the number of principal components, then gradually slows down. The cumulative variance explained rate reaches 80.57% when the number of principal components is 1, indicating that the corresponding model can effectively reflect the shape information of different particles in the system. The cumulative variance explained rates for principal components of 2, 3, and 4 further reach 94.05%, 97.67%, and 98.87%, respectively. Models built with different numbers of principal components essentially correspond to different standards for judging abnormal states in continuous crystallization processes. As the number of principal components increases, the corresponding model has higher requirements for the stability of the crystallization process, leading to more crystallization process images being judged as abnormal states. However, while improving the anomaly detection rate, it may introduce the problem of "false positives," where a few normal crystallization process states are judged as abnormal. Therefore, models corresponding to different numbers of principal components have different functions, and the specific choice depends on the actual needs.

[0119] Figure 5 Given T under two principal components 2 Control chart. Lines 1 and 2 correspond to the control limits at 95% and 99% confidence levels, respectively. The T values ​​for each sample in the chart... 2The statistics are inconsistent, reflecting that even in continuous crystallization processes, the state at various points within the crystallizer undergoes small, dynamic changes over time. Compared to a 95% confidence level, a 99% confidence level has a larger control limit, corresponding to a higher standard for judging abnormal continuous crystallization states. For example... Figure 7 As shown, at a 95% confidence level, the model is able to detect a relatively large number of outliers, i.e., those samples that exceed the control limits. In contrast, at a 99% confidence level, the number of outliers detected by the model decreases significantly.

[0120] Figure 6 The results of the corresponding model's detection of the two test images are further presented at a confidence level of 95%. Most crystals appear almost black in the images, therefore the majority of their corresponding pixel grayscale values ​​will be equal to or slightly greater than 0. The solution appears almost white in the images, therefore the majority of its corresponding pixel grayscale values ​​will be equal to or slightly less than 255.

[0121] Figure 6 In the image, (a) represents a normal continuous crystallization state, and (b) represents an abnormal state. The solid fraction in (b) is significantly lower than that in (a). The abnormality detected by the model matches the actual image information. Furthermore, Figure 6 The first row shows the original graph, and the second row shows the reconstructed graph based on two principal components. The images in the first and second rows are almost identical, which fully demonstrates the accuracy of the multivariate statistical process control model. Therefore, the solution provided by this invention can effectively detect the crystallization state and thus provide timely early warning of abnormal states.

[0122] Figure 7 Furthermore, the average value (a) of the entire training set data is given. Figure 6 The grayscale distribution of the abnormal image (b). Figure 7 In part (a), the gray values ​​close to 0 or close to 255 have a relatively large proportion on both sides. However, Figure 7 In part (b), the gray values ​​close to 255 on the right are significantly larger than [the values ​​on the right]. Figure 7 The corresponding value in part (a); Figure 7 In part (b), the gray values ​​close to 0 are significantly smaller on the left. Figure 7 The corresponding values ​​in part (a). Therefore, the abnormal state detected by the model does indeed reflect the abnormal crystallization process state.

[0123] Through the above description of the embodiments, those skilled in the art can clearly understand that the above embodiments can be implemented by software, or by using software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solutions of the above embodiments can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, mobile hard drive, etc.), including several instructions to cause a computer device (such as a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0124] Example 2

[0125] This invention provides an apparatus for detecting abnormal states in a continuous crystallization process, which is mainly used to implement the method provided in the aforementioned embodiments. The apparatus mainly includes:

[0126] An image acquisition system for acquiring images of a continuous crystallization process and transmitting them to a computer includes: a two-dimensional imaging probe and an imaging controller; the two-dimensional imaging probe is built into the continuous crystallizer and continuously acquires images of the continuous crystallization process through a camera at the bottom; the imaging controller is used to control the operation mode of the two-dimensional imaging probe and transmit the continuous crystallization process images acquired by the two-dimensional imaging probe to the computer.

[0127] A computer is used to execute the following process: Step 1: Collect images of the continuous crystallization process as a historical dataset; Step 2: Combine the color attributes of each pixel in each image of the historical dataset, use principal component analysis to extract the principal components of the historical dataset, and select a set number of principal components to establish a multivariate statistical process control model; Step 3: For new images of the continuous crystallization process, extract the principal components using the method in Step 2, and combine them with the multivariate statistical process control model to determine whether the state of the continuous crystallization process is abnormal.

[0128] like Figure 8 The diagram shown is an example of the apparatus. In addition to the aforementioned components, the diagram also illustrates the crystallizer, temperature control equipment, and stirring system (bottom of the crystallizer). Continuous crystallization utilizes a mixed-suspension-mixed-product removal (MSMPR) crystallizer. The MSMPR crystallizer can maintain stable supersaturation and crystal growth environment through different stages, yielding products with relatively narrow crystal size distribution, high purity, and stable crystal form, making it suitable for large-scale production.

[0129] During operation, raw materials continuously flow in from one port of the crystallizer, while products continuously flow out from the other port. The imaging probe employs an immersion design, directly embedding its specially structured probe within the continuous crystallizer; the insertion depth generally depends on the solution height. A high-resolution camera is mounted at the bottom of the probe, and its front-end optical components directly contact the solution through a specially designed open observation cavity, thereby continuously acquiring images of the crystallization process. Under the continuous action of the stirring system, the solution continuously flows through the observation cavity. The system is equipped with a high-speed camera and a synchronous strobe LED light source, achieving clear capture of crystal dynamics through precise timing control. The imaging control equipment can control the probe's operation, including adjusting the camera's image acquisition frequency. The selected image acquisition rate must ensure image quality while considering data processing efficiency. The in-situ image files of the crystallization process are transmitted in real time to the computer host for data analysis (i.e., the method provided in the aforementioned embodiments), and the original images and related analysis results are then displayed on the computer screen.

[0130] Since the computer processing involved in this part has been described in detail in the previous embodiments, it will not be repeated here.

[0131] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0132] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims. The information disclosed in the background section is intended only to enhance the understanding of the overall background technology of the present invention and should not be construed as an admission or implication in any way that such information constitutes prior art known to those skilled in the art.

Claims

1. A method for detecting abnormal states in a continuous crystallization process, characterized in that, include: Step 1: Collect images of the continuous crystallization process as a historical dataset; Step 2: Combining the color attributes of each pixel in each image in the historical dataset, principal component analysis is used to extract the principal components of the historical dataset, and a set number of principal components are selected to establish a multivariate statistical process control model. Step 3: For a new continuous crystallization process image, extract the principal components using the method in Step 2, and combine them with the multivariate statistical process control model to determine whether the continuous crystallization process state is abnormal. The process of extracting principal components from the historical dataset by combining the color attributes of each pixel in each image and using principal component analysis includes: Let the horizontal resolution of the image be W, and the vertical resolution be H, then the total number of pixels is W×H; the grayscale value of each pixel in the image is its color attribute, and by extracting the color attributes of all pixels, the total number of color attributes k is W×H, forming the feature matrix M. W×H ; the characteristic matrix M W×H Performing a one-dimensional expansion, we first look at the grayscale values ​​of each pixel in the first row, resulting in W elements. Then we look at the grayscale values ​​of each pixel in the second row, and so on, until the Hth row. The row vector is represented as [C1, C2, C3, ..., C...]. k The row vector [C1', C2', C3', ..., C4'] is a vector whose elements represent the grayscale value of a pixel. Based on these grayscale values, the elements in the row vector are arranged in ascending order to obtain the sorted row vector [C1', C2', C3', ..., C4']. k Principal component analysis was used to extract the principal components of the historical dataset from the sorted row vectors of all images in the historical dataset. The method of extracting the principal components of the historical dataset from the sorted row vectors of all images in the historical dataset using principal component analysis includes: transforming the color attributes of all pixels in all images of the historical dataset into multiple independent principal components through orthogonal linear transformation, thereby obtaining the principal components of the historical dataset [PC1, PC2, PC3, ..., PC2]. k ], where each item represents a principal element, and k is the number of principal elements, which is equivalent to the total number of color attributes; The step of selecting a predetermined number of principal components and establishing a multivariate statistical process control model includes: selecting q principal components from the principal components of the historical dataset. The number q of principal components is determined by the evolution of the cumulative variance explained by the principal components as a function of the number of principal components. The corresponding principal components are [PC1, PC2, PC3, ..., PC...]. q Multivariate statistical process control models constructed with different numbers of principal components meet the quality control requirements of different standards; subsequently, based on Hotelling T... 2 Based on the predicted squared error, a multivariate statistical process control model is established, wherein: Hotelling T is calculated using the selected q principal components. 2 Control limits, and the control limits for the predicted squared error calculated using the selected q principal components; using the calculated Hotelling T 2 Anomaly detection is achieved by using control limits and prediction squared error control limits.

2. The method for detecting abnormal states in a continuous crystallization process according to claim 1, characterized in that, The Hotelling T is calculated by combining the selected q principal components. 2 Control limits are expressed as: ; in, For Hotelling T 2 Control limit, F α (q, n - q) is the upper α quantile critical point of an F distribution with q and nq degrees of freedom. The F distribution is a statistical sampling distribution. The α quantile critical point is the critical value at a significance level of α that makes the probability of the random variable falling on its right tail equal to that significance level. n is the number of images in the historical dataset, and q is the number of principal components.

3. The method for detecting abnormal states in a continuous crystallization process according to claim 1, characterized in that, The prediction squared error control limit is calculated by combining the selected q principal components, and is expressed as follows: ; in, To predict the control limits of the squared error, It is the standard normal distribution value at a significance level of α. The parameters are calculated using θ1, θ2, and θ3: θ1, θ2, and θ3 are parameters calculated using the principal components of all images, and are expressed as follows: ; Where k is the number of principal elements, which is equivalent to the total number of color attributes, q is the number of selected principal elements, which is the set number, and λ is the number of principal elements selected. i Let v be the eigenvalue of the i-th principal component, where v = 1, 2, 3.

4. The method for detecting abnormal states in a continuous crystallization process according to claim 1, characterized in that, The step of determining whether the state of the continuous crystallization process is abnormal by combining the multivariate statistical process control model includes: Hotelling's T values ​​for the new continuous crystallization process images were calculated by combining the extracted principal components. 2 Statistic T 2 , and the statistic SPE of the predicted squared error; Determine Hotelling's T 2 Statistic T 2 Does the statistic SPE of the predicted squared error exceed the corresponding Hotelling T? 2 Control limits and prediction squared error control limits: if any statistic exceeds the corresponding control limit, it indicates that the continuous crystallization process is in an abnormal state.

5. The method for detecting abnormal states in a continuous crystallization process according to claim 2, characterized in that, Hotelling's T for calculating the new continuous crystallization process image 2 Statistic T 2 , is represented as: ; Among them, t i The score of the new continuous crystallization process image for the i-th principal element is represented by principal component analysis. q represents the estimated variance of the i-th principal component in the historical dataset; q represents the number of principal components selected, i.e., the set number.

6. The method for detecting abnormal states in a continuous crystallization process according to claim 2, characterized in that, The statistic SPE for predicting the squared error of the new continuous crystallization process image is calculated and expressed as: ; Where k represents the total number of color attributes. Let j represent the j-th attribute of the new continuous crystallization process image x. This represents the reconstructed value based on the principal component analysis model.

7. A device for detecting abnormal states in a continuous crystallization process, characterized in that, To implement the method according to any one of claims 1 to 6, comprising: An image acquisition system for acquiring images of a continuous crystallization process and transmitting them to a computer includes: a two-dimensional imaging probe and an imaging controller; the two-dimensional imaging probe is built into the continuous crystallizer and continuously acquires images of the continuous crystallization process through a camera at the bottom; the imaging controller is used to control the operation mode of the two-dimensional imaging probe and transmit the continuous crystallization process images acquired by the two-dimensional imaging probe to the computer. A computer is used to execute the following process: Step 1: Collect images of the continuous crystallization process as a historical dataset; Step 2: Combine the color attributes of each pixel in each image of the historical dataset, use principal component analysis to extract the principal components of the historical dataset, and select a set number of principal components to establish a multivariate statistical process control model; Step 3: For new images of the continuous crystallization process, extract the principal components using the method in Step 2, and combine them with the multivariate statistical process control model to determine whether the state of the continuous crystallization process is abnormal.