Color titrimetric analysis method and system based on ARIMA model
By using ARIMA models and industrial cameras to capture images during the titration process, the dependence on artificial visual judgment during the titration process and the limitations of preset endpoints of automation equipment are solved, achieving higher titration accuracy and reliability.
Patent Information
- Application Number
- CN202411714835.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-04-18
AI Technical Summary
In the prior art, the dependence on artificial visual judgment during the titration process, the limitations of preset titration end points of automation equipment, and the high maintenance cost and limited accuracy of color sensors.
Using a color titration analysis method based on the ARIMA model, the titration process image was captured by industrial cameras, the HSV mean was calculated, and the real-time titration change curve was generated, and the ARIMA model was trained to generate a titration prediction curve, and the deviation values of the two were compared in real time to judge the end of the titration.
It effectively reduces the dependence on artificial visual judgment, overcomes the limitations of preset end points of automation equipment, reduces the maintenance cost of color sensors, and improves the accuracy and reliability of the titration process.
Smart Images

Figure CN119850754A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of electronic information technology, and in particular to a color titration analysis method and system based on an ARIMA model. Background Art
[0002] Liquid reagents need to be accurately extracted and titrated in various industries and application scenarios. This type of work requires high experience and skills, takes a long time and effort, and requires the accuracy of adding liquid reagents. The entire process has relatively high requirements for the accuracy of the amount of reagent added and the judgment of whether the titration is completed.
[0003] The traditional manual color titration analysis method is to drop the liquid and mix it to observe its color change, repeat the above steps and judge whether the titration is completed according to the change of the solution color at the titration end point. This traditional titration operation method relies on the visual judgment of the human eye, and different sensitivities to color changes may lead to deviations in the results. In addition, due to the large amount of time and energy consumed by titration, the operator is prone to fatigue during the titration work, which may lead to deviations in titration accuracy. If the titration reagent is harmful to personnel, it may also cause physical harm.
[0004] The currently widely used technology is to use the fully automated color titration equipment available on the market to determine the color titration endpoint. In this mode, the color titration endpoint usually needs to be preset in advance, which has certain limitations. If multiple solutions need to be titrated, multiple presets are required. At the same time, this technology also lacks monitoring of the specific conditions during the titration. At present, there are also color titration equipment that uses color sensors. The titration effect of this type basically depends on the sensitivity of the color sensor to color, and the maintenance cost of a good color sensor is high. Summary of the invention
[0005] In view of the above problems, the purpose of the present invention is to provide a color titration analysis method and system based on the ARIMA model to solve the problems of reliance on manual visual judgment in the titration process, the limitation of preset titration endpoint of automated equipment, and high maintenance cost and limited accuracy of color sensors in the prior art. The above invention objectives of the present invention are achieved through the following technical solutions: The present invention provides a color titration analysis method based on an ARIMA model, comprising: Step S1: responding to a titration operation instruction and initializing the system; Step S2: After the initialization is completed, the titration cycle is started according to the titration operation instruction. During the titration cycle, the industrial camera captures the corresponding image frames at fixed time intervals and performs image preprocessing; the HSV mean value of each frame of the image is calculated as the real-time titration color value point, and a real-time titration change curve is generated to record the color change trend during the titration process; Step S3: When the number of collected titration color value points reaches the preset initial sample size, the ARIMA model is started and trained, and a titration prediction curve is generated based on the trained ARIMA model combined with the titration color value points to predict the color change trend in the future titration process; Step S4: compare the deviation values of the real-time titration change curve and the titration prediction curve at the same time point in real time. When the deviation value exceeds a preset deviation threshold and the number of consecutive deviations reaches a preset value, the titration is judged to be finished.
[0006] Further, in step S2, the industrial camera captures the corresponding image frames at fixed time intervals and performs image preprocessing; calculates the HSV mean of each frame of the image as a real-time titration color value point, and generates a real-time titration change curve for recording the color change trend during the titration process, including: The image frames during the titration process are collected by an industrial camera and denoised by Gaussian blur; The HSV mean value of the denoised image frame is calculated as the titration color value point, and the titration change curve is generated according to the titration color value point. At the same time, the real-time titration change curve is processed by exponential moving average.
[0007] Furthermore, the processing formula for moving average processing is: ; in, is the titration color value point after smoothing; t is the current time point; α is the smoothing coefficient, ranging from 0 to 1; 1- α is the weight factor; It is the titration color value point at the current time point.
[0008] Further, in step S3, when the number of collected titration color value points reaches the preset initial sample size, the ARIMA model is started and trained, including: The industrial camera acquires image frames according to the operation instructions, extracts the HSV mean of the image frames as titration color value points, and the number of titration color value points meets the preset initial sample size, wherein the initial sample size is a natural number greater than 10; Based on the titration color value points collected after exceeding the initial sample size, the parameters of the ARIMA model are selected for training. The parameters of the ARIMA model include the order of the autoregressive term, the order of the difference term, and the order of the moving average term. The preprocessed titration color value points are input into the ARIMA model, and the parameters of the ARIMA model are estimated by training through historical titration color value points. The parameters of the ARIMA model are adjusted by minimizing the residual during the training process to make the ARIMA model fit the data.
[0009] Furthermore, the formula of the ARIMA model is: ; in, is the predicted titration color value point at the current time point t; μ is a constant term; is the coefficient of the autoregressive unit, and is the influence value of the first p time points of the sequence; is the coefficient of the moving average unit, which is the influence of the residual of the first q times of the sequence; is the error term at the current time point t, is the residual between the measured titration color value and the predicted titration color value point; p is the order of the autoregressive term; q is the order of the moving average term.
[0010] Further, in step S4, the deviation values of the real-time titration change curve and the titration prediction curve at the same time point are compared in real time. When the deviation value exceeds a preset deviation threshold and the number of consecutive deviations reaches a preset value, the titration is judged to be over, including: Set preset deviation threshold and number of consecutive deviations; The images of the titration process are collected in real time by an industrial camera, and the HSV mean is calculated. The trained ARIMA model is applied to predict the titration color value point at the next time point. Calculate the deviation between the titration color value point collected in real time and the predicted titration color value point; When the deviation value exceeds the preset deviation threshold, and the number of deviations that continuously exceed the deviation threshold is tracked, when the number of deviations exceeds the preset number of consecutive deviations, it is determined that the titration process is ended.
[0011] Based on the same inventive concept, the present invention also provides a color titration analysis system based on the ARIMA model, which is used to perform the color titration method as described above, comprising: An initialization module is used to respond to titration operation instructions and perform system initialization; The data acquisition module is used to start the titration cycle according to the titration operation instruction after the initialization is completed. During the titration cycle, the industrial camera captures the corresponding image frames at fixed time intervals and performs image preprocessing; calculates the HSV mean value of each frame of the image as the real-time titration color value point, and generates a real-time titration change curve to record the color change trend during the titration process; The model training module is used to start the ARIMA model and train it when the number of collected titration color value points reaches the preset initial sample size, and to generate a titration prediction curve based on the trained ARIMA model combined with the titration color value points to predict the color change trend in the future titration process; The data monitoring module is used to compare the deviation values of the real-time titration change curve and the titration prediction curve at the same time point in real time. When the deviation value exceeds the preset deviation threshold and the number of consecutive deviations reaches the preset value, the titration is judged to be over.
[0012] Furthermore, the data acquisition module includes: An image preprocessing unit is used to collect image frames in the titration process through an industrial camera and perform Gaussian blurring to remove noise; the HSV mean value of the denoised image frames is calculated as the titration color value point; The data processing unit generates a titration change curve according to the titration color value points, and performs exponential moving average processing on the real-time titration change curve, wherein the processing formula for the moving average processing is: ;in, is the titration color value point after smoothing; t is the current time point; α is the smoothing coefficient, ranging from 0 to 1; 1- α is the weight factor; It is the titration color value point at the current time point; The data integration unit is used to generate a real-time titration change curve according to the calculated titration color value points.
[0013] Furthermore, the model training module includes, A data preparation unit, used for the industrial camera to collect image frames according to the operation instructions, extract the HSV mean of the image frame as the titration color value point, and the number of the titration color value points meets the preset initial sample size, wherein the initial sample size is a natural number greater than 10; A parameter selection unit, based on the titration color value points collected after exceeding the initial sample size, selects parameters of the ARIMA model for training, the parameters of the ARIMA model including the order of the autoregressive term, the difference order and the order of the moving average term; The model training unit inputs the preprocessed titration color value points into the ARIMA model, trains through historical titration color value points, estimates the parameters of the ARIMA model, and adjusts the parameters of the ARIMA model by minimizing the residual during the training process, so as to make the ARIMA model fit the data.
[0014] Furthermore, the data monitoring module includes: A configuration setting unit is used to set a preset deviation threshold and a number of consecutive deviations; The data prediction unit is used to collect images in the titration process in real time through an industrial camera, calculate the HSV mean, and apply the trained ARIMA model to predict the titration color value point at the next time point; The deviation monitoring unit is used to calculate the deviation between the titration color value point collected in real time and the predicted titration color value point; when the deviation value exceeds the preset deviation threshold, and tracks the number of deviations that continuously exceed the deviation threshold, when the number of deviations exceeds the preset number of consecutive deviations, it is judged that the titration process is over.
[0015] Compared with the prior art, the present invention has at least one of the following beneficial effects: By adopting the ARIMA model to automatically predict and monitor the color titration process, the problems of reliance on manual visual judgment in the titration process, the limitations of preset titration endpoints of automated equipment, and high maintenance costs and limited accuracy of color sensors in the prior art are effectively solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a flow chart of the steps of the color titration analysis method based on the ARIMA model of the present invention; Figure 2 The figure is an algorithm flow chart of the color titration analysis method based on the ARIMA model of the present invention. DETAILED DESCRIPTION
[0017] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0018] Those skilled in the art will appreciate that, unless otherwise stated, the singular forms "a", "an", "said" and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present invention refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.
[0019] First embodiment Titration is a commonly used quantitative analysis method for determining the concentration of a solution of unknown concentration. Traditional titration methods rely on the operator to determine the titration endpoint by visually judging the color change. Although this method is widely used, it has several significant problems. First, the subjectivity of manual visual judgment is relatively large, and different operators may have different sensitivities to color changes, which affects the repeatability and accuracy of the titration results. Secondly, existing automatic titration equipment usually determines the endpoint by a preset color change threshold. Although this method reduces human errors, it is still limited by the accuracy and adaptability of the preset parameters of the equipment. Especially in complex samples or changing environments, the limitations of the preset endpoint may lead to analytical errors. In addition, many automated equipment use color sensors to detect color changes. Although this method can improve the consistency of measurement, the color sensor itself has a high maintenance cost, and the accuracy may decrease in long-term use, requiring regular calibration and maintenance. This increases operating costs, and in fine chemical and pharmaceutical production, any errors caused by equipment problems may lead to significant economic losses and quality control problems.
[0020] In view of the above problems, the inventors have proposed an innovative solution after in-depth thinking about these problems. This solution combines image processing technology and time series analysis models to automate and accurately control the titration process. By using an industrial camera to regularly capture images of the titration process and calculating the HSV mean of each frame of the image as the titration color value point, the reliance on manual visual judgment is reduced. In addition, by predicting the future titration color value changes in real time, the limitations of automated equipment in presetting the titration end point are overcome, providing a more flexible and precise control method. In addition, this solution not only reduces the equipment maintenance cost but also improves the accuracy and reliability of the measurement by using a low-cost industrial camera instead of an expensive color sensor. Thereby fundamentally improving the automation and accuracy of the chemical titration process. This solution can effectively cope with the limitations of the prior art while improving the economy and ease of operation of the titration process. The present invention mainly uses an industrial camera component to combine machine vision technology and the ARIMA model to monitor, analyze, predict and record the titration process. The specific implementation method is as follows: like Figure 1 , 2 As shown, the present invention provides a color titration analysis method based on the ARIMA model, comprising: Step S1: responding to a titration operation instruction and initializing the system; Step S2: After the initialization is completed, the titration cycle is started according to the titration operation instruction. During the titration cycle, the industrial camera captures the corresponding image frames at fixed time intervals and performs image preprocessing; the HSV mean value of each frame of the image is calculated as the real-time titration color value point, and a real-time titration change curve is generated to record the color change trend during the titration process; Step S3: When the number of collected titration color value points reaches the preset initial sample size, the ARIMA model is started and trained, and a titration prediction curve is generated based on the trained ARIMA model combined with the titration color value points to predict the color change trend in the future titration process; Step S4: compare the deviation values of the real-time titration change curve and the titration prediction curve at the same time point in real time. When the deviation value exceeds a preset deviation threshold and the number of consecutive deviations reaches a preset value, the titration is judged to be finished.
[0021] It should be specifically stated that the present application can accurately capture and analyze the color changes during the titration process by using an industrial camera combined with an image processing method, calculate the HSV mean of each frame of the image as the titration color value point, and then use the ARIMA model to predict and analyze future color changes, improve the accuracy of color titration, and provide more accurate and consistent data than traditional manual visual judgment, thereby significantly improving the accuracy of color titration. At the same time, it can also adapt to different types of chemical solutions and reaction environments, easily adapt to different colors and photometric conditions, and be widely used in various titration needs, not limited to a specific type of solution or color reaction. At the same time, using real-time image capture and analysis functions, it can continuously monitor every step of the titration process. This includes not only the gradual change of color, but also any abnormal conditions that may affect the analysis results, such as bubble formation or unexpected turbidity of the solution. This comprehensive monitoring ensures the reliability of the titration results and provides instant feedback to the operator so that the experimental process can be adjusted in time. The real-time titration curve is processed by image denoising techniques such as Gaussian blur and EMA exponential moving average, which has a certain fault tolerance for noise during the titration.
[0022] At the same time, the present invention has taken a number of measures in the design of external devices to optimize the titration process and ensure the stability and accuracy of the experimental conditions. First, in order to avoid the interference of external light sources on the titration results, the device is equipped with a shell to ensure that the titration process is carried out in an environment without external light. The liquid addition adopts a peristaltic pump to ensure the fixation of the liquid addition accuracy and the liquid addition time interval, and the peristaltic pump can add some reagents with higher viscosity. The stirring adopts a magnetic stirrer to avoid the influence of the stirring process on image recognition. In the internal algorithm, the initialization configuration of the operation log, chart, industrial camera parameters, global variables, etc. is first performed. Then enter the titration cycle. Since the training of the ARIMA model requires that the time interval between each data point is fixed, the single running time of this cycle should be fixed to ensure that the time interval of taking the industrial camera frame picture each time is fixed. However, the internal running time of each algorithm is not fixed, so it is necessary to record the start time in the first step of the cycle, and wait for the remaining time of a cycle at the end of the cycle to achieve the purpose of fixed cycle time.
[0023] Further, in step S2, the industrial camera captures the corresponding image frames at fixed time intervals and performs image preprocessing; calculates the HSV mean of each frame of the image as a real-time titration color value point, and generates a real-time titration change curve for recording the color change trend during the titration process, including: The image frames during the titration process are collected by an industrial camera and denoised by Gaussian blur; The HSV mean value of the denoised image frame is calculated as the titration color value point, and the titration change curve is generated according to the titration color value point. At the same time, the real-time titration change curve is processed by exponential moving average.
[0024] It should be specifically noted that the present invention uses a series of refined techniques in image processing to enhance the accuracy and reliability of the titration results. First, the continuous image frames during the titration process are captured by an industrial camera, and these images are converted into the HSV color model format. In the HSV model, H (hue) represents the type of color, S (saturation) represents the intensity of the color, and V (brightness) reflects the brightness of the color. The use of this color model helps to more intuitively display the basic properties of color, and the generated change curves of the three parameters H, S, and V can accurately track the dynamic changes of color during the titration process. In order to optimize the image quality and reduce the impact of noise on the analysis, the Gaussian blur technology is used to pre-process the image. Gaussian blur can effectively smooth image noise without losing color details, which is crucial for subsequent color analysis. In this way, it can be ensured that the image still retains the necessary color information after denoising, so as to perform more accurate color measurement. At the same time, in order to optimize the image quality and reduce the impact of noise on the analysis, the Gaussian blur technology is used to pre-process the image. Gaussian blur can effectively smooth image noise without losing color details, which is crucial for subsequent color analysis. In this way, it can be ensured that the image still retains the necessary color information after denoising, so as to perform more accurate color measurement.
[0025] Furthermore, the processing formula for moving average processing is: ; in, is the titration color value point after smoothing; t is the current time point; α is the smoothing coefficient, ranging from 0 to 1; 1- α is the weight factor; It is the titration color value point at the current time point.
[0026] It should be specifically noted that although the image has been de-noised, the noise brought by the camera itself is still unavoidable, which will cause frequent fluctuations in the data curve, which is not conducive to the comparison of the curve and the prediction of the ARIMA model. The invention uses EMA (exponential moving average) to smooth the curve. This smoothing is suitable for time series data, can effectively eliminate noise and short-term fluctuations in data, and pays more attention to capturing long-term trends in data. And because the proportion of recent data is large, it can sensitively show changes in data. After smoothing the curve, the curve can be generated and displayed to intuitively monitor the color change process of the titration.
[0027] Further, in step S3, when the number of collected titration color value points reaches the preset initial sample size, the ARIMA model is started and trained, including: The industrial camera acquires image frames according to the operation instructions, extracts the HSV mean of the image frames as titration color value points, and the number of titration color value points meets the preset initial sample size, wherein the initial sample size is a natural number greater than 10; Based on the titration color value points collected after exceeding the initial sample size, the parameters of the ARIMA model are selected for training. The parameters of the ARIMA model include the order of the autoregressive term, the order of the difference term, and the order of the moving average term. The preprocessed titration color value points are input into the ARIMA model, and the parameters of the ARIMA model are estimated by training through historical titration color value points. The parameters of the ARIMA model are adjusted by minimizing the residual during the training process to make the ARIMA model fit the data.
[0028] Furthermore, the formula of the ARIMA model is: ; in, is the predicted titration color value point at the current time point t; μ is a constant term; is the coefficient of the autoregressive unit, and is the influence value of the first p time points of the sequence; is the coefficient of the moving average unit, which is the influence of the residual of the first q times of the sequence; is the error term at the current time point t, is the residual between the measured titration color value and the predicted titration color value point; p is the order of the autoregressive term; q is the order of the moving average term.
[0029] It should be specifically explained that, since the training effect of the ARIMA model is not good when there are too few data points, it is necessary to take at least 10 data points before starting the real-time titration curve prediction. Therefore, before comparing the current curve with the predicted curve, it is necessary to first determine whether there is a predicted curve. There is a parameter called the threshold here, which represents the sensitivity of color change perception. If the sensitivity to color change perception is high, the threshold is high, and if the sensitivity to color change perception is low, the threshold is low. This threshold is set in advance and can be modified to adapt to different titration environments and titration reagents. If it is detected multiple times that the current curve and the predicted curve are not within the threshold, it is judged that the titration cycle is over. The threshold and multiple judgments are combined to reduce the interference of noise or some other situations on the titration.
[0030] Further, in step S4, the deviation values of the real-time titration change curve and the titration prediction curve at the same time point are compared in real time. When the deviation value exceeds a preset deviation threshold and the number of consecutive deviations reaches a preset value, the titration is judged to be over, including: Set preset deviation threshold and number of consecutive deviations; The images of the titration process are collected in real time by an industrial camera, and the HSV mean is calculated. The trained ARIMA model is applied to predict the titration color value point at the next time point. It should be specifically explained that the ARIMA model (autoregressive integrated moving average model) is suitable for predicting trending time series data. It can capture the linear relationship of the data, and because of its small amount of calculation, it is suitable for real-time creation, training and prediction. Record the predicted titration curve and wait for the next sampling for comparison, so that a process of real-time prediction and real-time comparison is achieved. Then get the time when the code runs here, and subtract it from the time recorded at the beginning of the current loop to get the running time of the above process. Finally, wait for the time required for the remaining single loop, and then one loop ends.
[0031] Calculate the deviation between the titration color value point collected in real time and the predicted titration color value point; When the deviation value exceeds the preset deviation threshold, and the number of deviations that continuously exceed the deviation threshold is tracked, when the number of deviations exceeds the preset number of consecutive deviations, it is determined that the titration process is ended.
[0032] Second embodiment Based on the same inventive concept, the present invention also provides a color titration analysis system based on the ARIMA model, which is used to perform the color titration method as described above, comprising: An initialization module is used to respond to titration operation instructions and perform system initialization; The data acquisition module is used to start the titration cycle according to the titration operation instruction after the initialization is completed. During the titration cycle, the industrial camera captures the corresponding image frames at fixed time intervals and performs image preprocessing; calculates the HSV mean value of each frame of the image as the real-time titration color value point, and generates a real-time titration change curve to record the color change trend during the titration process; wherein the data acquisition module includes, An image preprocessing unit is used to collect image frames in the titration process through an industrial camera and perform Gaussian blurring to remove noise; the HSV mean value of the denoised image frames is calculated as the titration color value point; The data processing unit generates a titration change curve according to the titration color value points, and performs exponential moving average processing on the real-time titration change curve, wherein the processing formula for the moving average processing is: ;in, is the titration color value point after smoothing; t is the current time point; α is the smoothing coefficient, ranging from 0 to 1; 1- α is the weight factor; It is the titration color value point at the current time point; The data integration unit is used to generate a real-time titration change curve according to the calculated titration color value points.
[0033] The model training module is used to start the ARIMA model and train it when the number of collected titration color value points reaches the preset initial sample size, and generate a titration prediction curve based on the trained ARIMA model combined with the titration color value points to predict the color change trend in the future titration process; wherein the model training module includes, A data preparation unit, used for the industrial camera to collect image frames according to the operation instructions, extract the HSV mean of the image frame as the titration color value point, and the number of the titration color value points meets the preset initial sample size, wherein the initial sample size is a natural number greater than 10; A parameter selection unit, based on the titration color value points collected after exceeding the initial sample size, selects parameters of the ARIMA model for training, the parameters of the ARIMA model including the order of the autoregressive term, the difference order and the order of the moving average term; The model training unit inputs the preprocessed titration color value points into the ARIMA model, trains through historical titration color value points, estimates the parameters of the ARIMA model, and adjusts the parameters of the ARIMA model by minimizing the residual during the training process, so as to make the ARIMA model fit the data.
[0034] The data monitoring module is used to compare the deviation value of the real-time titration change curve and the titration prediction curve at the same time point in real time. When the deviation value exceeds the preset deviation threshold and the number of consecutive deviations reaches the preset value, the titration is judged to be over. The data monitoring module includes: A configuration setting unit is used to set a preset deviation threshold and a number of consecutive deviations; The data prediction unit is used to collect images in the titration process in real time through an industrial camera, calculate the HSV mean, and apply the trained ARIMA model to predict the titration color value point at the next time point; The deviation monitoring unit is used to calculate the deviation between the titration color value point collected in real time and the predicted titration color value point; when the deviation value exceeds the preset deviation threshold, and tracks the number of deviations that continuously exceed the deviation threshold, when the number of deviations exceeds the preset number of consecutive deviations, it is judged that the titration process is over.
[0035] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.
[0036] It should be noted that the above embodiments can be freely combined as needed. The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered as the protection scope of the present invention.
Claims
1. A color titration analysis method based on ARIMA model, characterized in that: include: Step S1: responding to a titration operation instruction and initializing the system; Step S2: After the initialization is completed, the titration cycle is started according to the titration operation instruction. During the titration cycle, the industrial camera captures corresponding image frames at fixed time intervals and performs image preprocessing; Calculate the HSV mean value of each frame of the image as a real-time titration color value point, and generate a real-time titration change curve for recording the color change trend during the titration process; Step S3: When the number of collected titration color value points reaches a preset initial sample size, the ARIMA model is started and trained, and a titration prediction curve is generated based on the trained ARIMA model combined with the titration color value points to predict the color change trend in the future titration process; Step S4: comparing the deviation values of the real-time titration change curve and the titration prediction curve at the same time point in real time, and when the deviation value exceeds a preset deviation threshold and the number of consecutive deviations reaches a preset value, the titration is judged to be finished.
2. The color titration analysis method based on the ARIMA model according to claim 1, characterized in that: In step S2, the industrial camera captures corresponding image frames at fixed time intervals and performs image preprocessing; Calculate the HSV mean of each frame of the image as a real-time titration color value point, and generate a real-time titration change curve to record the color change trend during the titration process, including: The image frames in the titration process are collected by the industrial camera and denoised by Gaussian blur; The HSV mean value of the denoised image frame is calculated as the titration color value point, and the titration change curve is generated according to the titration color value point, and the real-time titration change curve is subjected to exponential moving average processing.
3. The color titration analysis method based on the ARIMA model according to claim 2, characterized in that: The processing formula for the moving average processing is: ; in, is the titration color value point after smoothing; t is the current time point; α is the smoothing coefficient, and the value range is 0~1; 1-α is the weight factor; It is the titration color value point at the current time point.
4. The color titration analysis method based on the ARIMA model according to claim 1, characterized in that: In step S3, when the number of titration color value points collected reaches the preset initial sample size, the ARIMA model is started and trained, including: The industrial camera acquires the image frame according to the operation instruction, extracts the HSV mean of the image frame as the titration color value point, and the number of the titration color value points satisfies the preset initial sample size, wherein the initial sample size is a natural number greater than 10; Based on the titration color value points collected after exceeding the initial sample size, selecting parameters of the ARIMA model for training, the parameters of the ARIMA model including the order of the autoregressive term, the difference order, and the order of the moving average term; The preprocessed titration color value points are input into the ARIMA model, and training is performed through historical titration color value points to estimate the parameters of the ARIMA model, and the parameters of the ARIMA model are adjusted by minimizing the residual during the training process to make the ARIMA model fit the data.
5. The color titration analysis method based on the ARIMA model according to claim 1 or 4, characterized in that: The formula of the ARIMA model is: ; in, is the predicted titration color value point at the current time point t; μ is a constant term; is the coefficient of the autoregressive unit, and is the influence value of the first p time points of the sequence; is the coefficient of the moving average unit, which is the influence of the residual of the first q times of the sequence; is the error term at the current time point t, is the residual between the measured titration color value and the predicted titration color value point; p is the order of the autoregressive term; q is the order of the moving average term.
6. The color titration analysis method based on the ARIMA model according to claim 1, characterized in that: In step S4, the deviation values of the real-time titration change curve and the titration prediction curve at the same time point are compared in real time. When the deviation value exceeds a preset deviation threshold and the number of consecutive deviations reaches a preset value, the titration is judged to be finished. include, Setting the preset deviation threshold and the number of consecutive deviations; The industrial camera is used to collect images of the titration process in real time, and the HSV mean is calculated, and the trained ARIMA model is used to predict the predicted titration color value point at the next time point; Calculating the deviation between the titration color value point collected in real time and the predicted titration color value point; When the deviation value exceeds the preset deviation threshold, and the number of deviations continuously exceeding the deviation threshold is tracked, when the number of deviations exceeds the preset number of continuous deviations, it is determined that the titration process is ended.
7. A color titration analysis system based on an ARIMA model, used to perform the color titration method according to any one of claims 1 to 6, characterized in that: include, An initialization module is used to respond to titration operation instructions and perform system initialization; A data acquisition module, which is used to start a titration cycle according to the titration operation instruction after initialization. During the titration cycle, the industrial camera captures corresponding image frames at fixed time intervals and performs image preprocessing; Calculate the HSV mean value of each frame of the image as a real-time titration color value point, and generate a real-time titration change curve for recording the color change trend during the titration process; A model training module is used to start and train the ARIMA model when the number of collected titration color value points reaches a preset initial sample size, and generate a titration prediction curve based on the trained ARIMA model combined with the titration color value points to predict the color change trend in the future titration process; The data monitoring module is used to compare the deviation value of the real-time titration change curve and the titration prediction curve at the same time point in real time, and when the deviation value exceeds a preset deviation threshold and the number of consecutive deviations reaches a preset value, the titration is judged to be finished.
8. The color titration analysis system based on the ARIMA model according to claim 7, characterized in that: The data acquisition module includes: An image preprocessing unit, used for collecting the image frames in the titration process through the industrial camera and performing Gaussian blurring and denoising; Calculating the HSV mean value of the denoised image frame as the titration color value point; The data processing unit generates the titration change curve according to the titration color value point, and performs exponential moving average processing on the real-time titration change curve, wherein the processing formula of the moving average processing is: ;in, is the titration color value point after smoothing; t is the current time point; α is the smoothing coefficient, ranging from 0 to 1; 1- α is the weight factor; The titration color value point at the current time point; The data integration unit is used to generate the real-time titration change curve according to the calculated titration color value points.
9. The color titration analysis system based on the ARIMA model according to claim 7, characterized in that: The model training module includes: A data preparation unit, used for the industrial camera to collect the image frames according to the operation instruction, extract the HSV mean of the image frames as the titration color value points, and the number of the titration color value points meets the preset initial sample size, wherein the initial sample size is a natural number greater than 10; A parameter selection unit, based on the titration color value points collected after exceeding the initial sample size, selects parameters of the ARIMA model for training, wherein the parameters of the ARIMA model include the order of the autoregressive term, the difference order, and the order of the moving average term; A model training unit inputs the preprocessed titration color value points into the ARIMA model, performs training through historical titration color value points, estimates the parameters of the ARIMA model, and adjusts the parameters of the ARIMA model by minimizing the residual during the training process, so as to make the ARIMA model fit the data.
10. The color titration analysis system based on the ARIMA model according to claim 7, characterized in that: The data monitoring module includes: A configuration setting unit, used to set the preset deviation threshold and the number of consecutive deviations; A data prediction unit, used to collect images in the titration process in real time through the industrial camera, calculate the HSV mean, and apply the trained ARIMA model to predict the predicted titration color value point at the next time point; The deviation monitoring unit is used to calculate the deviation value between the titration color value point collected in real time and the predicted titration color value point; when the deviation value exceeds the preset deviation threshold, and tracks the number of deviations that continuously exceed the deviation threshold, when the number of deviations exceeds the preset number of consecutive deviations, it is determined that the titration process is ended.
Citation Information
Cited By
Color titration identification method, system and equipment based on combined prediction model
CN121010653A