Titration end point judgment method based on machine vision

Through high-resolution camera and image processing technology, the error problem of manual judgment of titration endpoints in traditional titration methods is solved, accurate and automated control of titration endpoints is achieved, and the reliability and repeatability of titration results are improved.

CN120254166APending Publication Date: 2025-07-04SUZHOU CHUANG CHUANG ENVIRONMENTAL PROTECTION TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510578958.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-07
Publication Date
2025-07-04

AI Technical Summary

Technical Problem

In traditional titration methods, the accuracy of the titration endpoint depends on manual observation, with large errors, especially when approaching the endpoint, it is difficult to distinguish slight color changes, which affects the reliability and repetition of the experimental results.

Method used

A high-resolution camera is used to obtain the titration process images, perform light correction and noise removal, and the dynamic change characteristics of the solution color are extracted through image processing technology, a solution end point status prediction model is constructed, and the titration speed is adjusted in real time to reach the end point.

Benefits of technology

It improves the accuracy and efficiency of the titration process, reduces artificial errors, and realizes accurate and automated judgment of the titration end point.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120254166A_ABST
    Figure CN120254166A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of machine vision, in particular to a titration end point judgment method based on machine vision. The method comprises the following steps: acquiring a solution image set in a titration process through a high-resolution camera, and performing bilinear Laplace illumination correction to obtain an initial titration solution image set; performing data preprocessing and enhancement on the initial titration solution image set to obtain a to-be-analyzed titration solution image set; performing solution color dynamic change mode dynamic feature integration according to the to-be-analyzed titration solution image set to obtain a solution dynamic feature set; acquiring historical titration experiment data, and constructing a solution end point state prediction model based on the solution dynamic feature set and the historical titration experiment data; acquiring a real-time titration solution image set; and performing solution state prediction on the real-time titration solution image set through the solution end point state prediction model, and adjusting the titration speed until the titration solution reaches the end point state. The precision and efficiency of solution titration can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of machine vision, and in particular to a method for judging the titration end point based on machine vision. Background Art

[0002] Titration is a quantitative method widely used in chemical analysis. It relies on the color change of an indicator to determine the end point of the reaction. The purpose is to determine the concentration of the analyte by reacting a titrant with a known concentration with the analyte. In traditional titration analysis, accurately judging the titration end point is a crucial step. However, this process usually depends on manual observation and the color change of the indicator. Due to the differences in the observation abilities and judgment criteria of different operators, there are often large errors in accurately judging the titration end point, thus affecting the reliability and repeatability of the experimental results. Traditional titration methods mainly include the visual method, the instrumental method, and the titrant volume method. The visual method usually relies on adding an indicator during the reaction and indicating the end point through color change. However, the color change of the indicator is often relatively fuzzy, especially when approaching the end point, and it is difficult for the naked eye to distinguish small changes. In addition, the selection of the indicator is affected by the reaction system, and different reactions may require different indicators, which makes the operation complex and requires high experience of the user. For some color changes that are difficult to observe or transparent solutions, the traditional visual judgment method can hardly provide a reliable determination of the titration end point. Summary of the Invention

[0003] Based on this, it is necessary for the present invention to provide a method for judging the titration end point based on machine vision to solve at least one of the above technical problems.

[0004] To achieve the above object, a method for judging the titration end point based on machine vision includes the following steps: Step S1: Obtain a set of solution images of the titration process through a high-resolution camera, and perform bilinear Laplacian illumination correction on the set of solution images of the titration process to obtain an initial set of titration solution images; Step S2: Remove edge noise from the initial set of titration solution images through panoramic bilateral filtering to obtain a set of denoised titration solution images, and perform adaptive hue enhancement on the set of denoised titration solution images to obtain a set of titration solution images to be analyzed; Step S3: Integrate the dynamic characteristics of the dynamic change mode of the solution color according to the set of titration solution images to be analyzed to obtain a set of solution dynamic characteristics; Step S4: Obtain historical titration experiment data, and construct a solution end state prediction model based on the set of solution dynamic characteristics and the historical titration experiment data; Step S5: Obtain a set of real-time titration solution images through a high-resolution camera; perform solution state prediction on the set of real-time titration solution images using a solution end state prediction model, and adjust the titration speed according to the solution state prediction result until the titration solution reaches the end state.

[0005] The present invention obtains a set of solution images during the titration process through a high-resolution camera and performs illumination correction, which can effectively eliminate the influence brought by illumination changes, ensure that the true representation of the solution in the image is clearer, especially in a complex illumination environment, and guarantee the stability and consistency of the images. Further, through edge noise removal technology, the possible small noises in the image can be removed, unnecessary interference can be reduced, the edge features of the solution can be enhanced, and the accuracy of subsequent analysis can be improved. This process makes the image cleaner and has a high contrast, laying a good foundation for the accurate capture and analysis of the color change of the solution. After image denoising, adaptive hue enhancement is performed. By enhancing the hue features, the color change of the solution becomes more obvious and clear, so that the tiny color changes during the titration process can be more accurately identified, which is crucial for judging the titration end point. The hue enhancement technology can cope with the color differences in different solutions, and the color changes of the solutions under different reaction systems can be better presented in the images, providing accurate data support for the subsequent integration of the color dynamic change pattern. The integration of the color dynamic change pattern of the solution can further refine the color change law during the titration process. Through the analysis of dynamic features, the system can identify the rate and trend of color change, and even predict the approach of the end point at the initial stage of titration, greatly improving the intelligence and automation level of the titration process. This set of dynamic features provides rich basic data for constructing a solution end state prediction model and can be calibrated through historical titration experiment data, making the prediction result more accurate and reliable. Through the acquisition of real-time titration solution images and in combination with the established solution end state prediction model, the system can continuously predict the current state of the solution according to the real-time image data, and then intelligently adjust the titration speed. The real-time adjustment of the titration speed can ensure that when the solution reaches the end state, the addition amount and speed of the titrant can be accurately controlled, thereby minimizing human error to the greatest extent and improving the accuracy and repeatability of the titration result. The present invention greatly improves the accuracy and efficiency of the traditional titration method through the combination of image processing, data analysis and real-time feedback mechanism, avoids the interference of human factors on the judgment of the titration end point, and makes the titration process more automated and intelligent.

[0006] Optionally, step S1 is specifically: Step S11: Obtain a set of solution images during the titration process through a high-resolution camera; Step S12: Calculate the brightness of the image area based on the set of solution images during the titration process to obtain local image area brightness data; Step S13: Calculate the regional brightness difference of the local area brightness data of the image, and calculate the image brightness compensation value according to the result of the regional brightness difference; Step S14: Remove the light spots on the surface of the solution from the solution image set during the titration process to obtain a light-spot-removed image set; Step S15: Perform illumination transformation compensation on the light-spot-removed image set according to the image brightness compensation value to obtain an initial titration solution image set.

[0007] The present invention obtains the solution image set during the titration process through a high-resolution camera, which can ensure capturing high-quality images of the solution, reduce the loss of details caused by low resolution, and provide more accurate color and morphological features. After calculating the image regional brightness and obtaining the local area brightness data, it can provide an accurate brightness basis for subsequent image processing, which helps to identify the minute changes in the solution during the titration process. By calculating the brightness difference and obtaining the compensation value, it effectively eliminates the inconsistency of the image brightness caused by uneven illumination, and further improves the stability and reliability of the image. The light spot removal step solves the interference caused by light reflection on the surface of the solution, ensuring the accurate extraction of key information in the image. Through illumination transformation compensation, it can automatically adjust according to different illumination conditions, optimize the brightness and contrast of the image, make the details of the titration solution clearer, lay a solid foundation for the subsequent analysis of color changes, and overall improve the accuracy and efficiency of image processing.

[0008] Optionally, step S14 is specifically: Step S141: Extract the high-brightness region feature of the image according to the solution image set during the titration process to obtain the high-brightness image region feature data; Step S142: Identify the high-brightness difference region based on the result of the regional brightness difference for the high-brightness image region feature data to obtain the light spot region image set; Step S143: Perform local image bilinear interpolation substitution on the light spot region image set to obtain the light spot region substitution image set; Step S144: Perform Laplacian pyramid fusion on the light spot region substitution image set and the solution image set during the titration process to obtain the light-spot-removed image set.

[0009] By extracting the features of the high-brightness regions in the solution images during the titration process, the present invention can accurately identify the high-brightness regions generated by light reflection in the solution, providing a precise basis for removing the light spots in the subsequent process. Identifying the light spot regions based on the results of the regional brightness difference helps to distinguish between the normal solution region and the light spot region, ensuring that important solution information will not be misprocessed by mistake. Performing bilinear interpolation substitution on the light spot region image set can effectively remove the unnecessary interference caused by the light spots, while maintaining the natural transition and continuity of the image, and avoiding image distortion caused by simple removal. By fusing the de-spotting image set and the original image set through Laplacian pyramid fusion, the information of the two can be more finely fused, retaining the real changes of the solution during the titration process, while reducing the influence of the light spots and optimizing the overall quality of the image, providing more accurate and reliable image data support for the determination of the titration endpoint.

[0010] Optionally, the panoramic bilateral filtering edge noise removal in step S2 is specifically as follows: Perform edge detection on the initial titration solution image set to obtain the titration solution edge data, and select seed pixels according to the titration solution edge data to obtain the seed pixels; Calculate the similarity of the seed pixels, and segment the image background of the initial titration solution image set according to the seed pixel similarity results to obtain the titration solution foreground image set and the titration solution background image set; Identify the background random noise based on the titration solution background image set to obtain the background random noise feature data; Perform Gaussian filtering of the background noise on the titration solution foreground image set according to the background random noise feature data to obtain the foreground image set with removed background noise; Identify the solution-container edge region of the titration solution foreground image set based on the seed pixel similarity results to obtain the solution-container edge region image set; Perform bilateral filtering on the solution-container edge region image set to obtain the solution-container edge region denoised image set; Replace the corresponding image regions in the foreground image set with removed background noise according to the solution-container edge region denoised image set to obtain a multi-layer denoised image set; Perform adaptive histogram equalization on the multi-layer denoised image set to obtain the denoised titration solution image set.

[0011] Through edge detection and seed pixel selection, the present invention can effectively calibrate the key areas in the titrant solution image, laying a foundation for subsequent image segmentation and processing, and ensuring the accurate identification of the boundary between the solution and the background. Similarity calculation helps to improve the accuracy of image segmentation, making the segmentation of the foreground and background more accurate and avoiding the influence of interfering substances on the true state of the solution. Background noise recognition and Gaussian filtering can effectively remove unnecessary background interference, improve the image quality, and reduce the influence of noise on the determination of the titration endpoint. By identifying the edge area between the solution and the container and performing bilateral filtering, the edge noise can be removed while retaining important solution information, making the image clearer and more delicate. Through pixel point replacement and multi-layer denoising processing, the image quality can be further optimized, the tiny noise and interference in the solution can be eliminated, and the reliability of the analysis can be enhanced. Adaptive histogram equalization optimizes the contrast of the image, making the color change of the solution during the titration process more obvious, and further improving the accuracy of endpoint determination.

[0012] Optionally, the adaptive hue enhancement of the solution image set in step S2 is specifically as follows: Perform local area contrast-limited equalization on the denoised titrant solution image set to obtain a secondarily equalized titrant solution image set; Convert the color space of the secondarily equalized titrant solution image set to obtain a titrant solution HSV image set; Separate the color channels of the titrant solution HSV image set to obtain a hue channel image set and a saturation channel image set; Perform joint enhancement of hue and saturation based on the hue channel image set and the saturation channel image set to obtain an image set of the titrant solution to be analyzed.

[0013] Through local area contrast-limited equalization, the present invention can effectively enhance the contrast of important areas in the titrant solution image, making the color change more obvious, especially helpful for the identification of subtle changes when approaching the titration endpoint. After converting to the HSV color space, the color information can be better separated and analyzed, especially the changes in hue and saturation, making the color change of the solution during the titration process more prominent. The separation of the hue and saturation channels further simplifies the image processing, enabling more accurate capture of the solution state changes in subsequent analysis. Through the joint enhancement of hue and saturation, the key features of the solution color can be maximally strengthened, especially in different stages of titration, ensuring that the color information in the image highly matches the progress of the chemical reaction, thereby improving the accuracy and reliability of titration endpoint determination.

[0014] Optionally, step S3 is specifically as follows: Step S31: Extract the time series of the image set of the titrant solution to be analyzed to obtain the time series data of the solution image; Step S32: Calculate the time derivative of hue and the time derivative of saturation for the time series data of the solution images, obtaining the time derivative of the hue channel of the solution images and the time derivative of the saturation of the solution images; Step S33: Calculate the color change rate of the solution based on the time derivative of the hue channel of the solution images and the time derivative of the saturation of the solution images, obtaining the color change rate data of the solution; Step S34: Conduct time series statistics on the color distribution of the solution images for the time series data of the solution images, obtaining the time series data of the color distribution of the solution; Step S35: Perform dynamic classification of the solution color change patterns based on the color change rate data of the solution and the time series data of the color distribution of the solution, obtaining the solution dynamic feature set.

[0015] Through the time series extraction of the titration solution images, the present invention can capture the details of the solution color change over time during titration, providing dynamic change data for subsequent analysis. Calculating the time derivatives of hue and saturation helps accurately capture the rate of color change, especially crucial for identifying minute changes near the titration endpoint. Meanwhile, through the time series statistics of the solution color distribution, the change pattern of the color during titration can be analyzed to understand the overall color distribution characteristics of the solution at different time points. The dynamic classification processing of these data can reflect different stages of the solution color change during titration, thereby more precisely identifying the progress of titration and optimizing the accuracy of endpoint determination.

[0016] Optionally, step S35 is specifically as follows: Perform data standardization on the color change rate data of the solution and the time series data of the color distribution of the solution, obtaining the standardized color change rate data of the solution and the standardized time series data of the color distribution of the solution; Conduct sliding window dynamic change trend analysis on the standardized color change rate data of the solution, obtaining the color change trend data, and perform color change stage pattern recognition based on the color change trend data, obtaining the color change stage pattern data; Based on the time derivative of the hue channel of the solution images and the time derivative of the saturation of the solution images, perform rate peak recognition on the color change stage pattern data, obtaining the turning point marked color change stage pattern data; Describe the color distribution evolution trend of the time series data of the color distribution of the solution with a Gaussian distribution, obtaining the solution color distribution pattern data; Based on the turning point marked color change stage pattern data and the solution color distribution pattern data, perform stage pattern association of the solution color change pattern, obtaining the solution titration stage pattern data; Obtain the historical titration stage experimental data, and set the color change rate threshold for the titration stage according to the historical titration stage experimental data; Using a predefined grading standard and dynamically grading the solution titration stage mode data based on the color change rate threshold in the titration stage to obtain color change mode grading data; Summarize the feature sets of the color change mode grading data and perform multi-dimensional data fusion on the summary results to obtain the dynamic feature set of the solution.

[0017] Through data standardization processing, the present invention can eliminate the dimensional differences in the solution color change rate and color distribution data under different experimental conditions, ensuring the comparability of the analysis results. The sliding window dynamic change trend analysis helps to capture the subtle trends of color changes during the titration process, identify different stages of color changes, and thus improve the accuracy and reliability of the titration process. The rate peak identification can accurately locate the key turning points of the reaction, providing a clear reference for the judgment of the titration end point. By describing the evolution trend of the solution color distribution with a Gaussian distribution, the change law of the solution color can be understood more accurately, providing a more accurate modeling basis for the analysis in the subsequent stages. The association of the color change mode stage mode can not only identify the key stages during the titration process, but also combine them with the experimental data to optimize the control of the titration process. By setting the color change rate threshold in the titration stage and combining the grading standard, the dynamic grading of the solution color change is realized, providing a more operable and accurate basis for judging the titration end point. Through feature set summary and multi-dimensional data fusion, various data are integrated to obtain a complete dynamic feature set of the solution, laying a foundation for the optimization and automatic control of the subsequent titration process.

[0018] Optionally, step S4 is specifically as follows: Step S41: Obtain historical titration experiment data and perform data preprocessing on the historical titration experiment data to obtain the historical titration experiment data to be analyzed; Step S42: Integrate the solution titration end state based on the historical titration experiment data to be analyzed to obtain the solution titration end state data; Step S43: Perform feature association based on the solution dynamic feature set and the solution titration end state data to obtain a solution titration state feature association data set; Step S44: Construct an initial solution end state prediction model according to the solution titration state feature association data set; Step S45: Use the historical titration experiment data to be analyzed to train the initial solution end state prediction model to obtain a solution end state prediction model.

[0019] The present invention preprocesses historical titration experiment data, which can remove redundant and inconsistent factors, ensure the quality and consistency of the data, and provide a reliable basis for subsequent analysis. Through the integration of the end state of the solution titration, the end state of each experiment can be clearly calibrated, thereby providing an accurate reference for subsequent prediction and model establishment. Based on the feature correlation between the dynamic feature set of the solution and the end state data of the titration, it helps to reveal the key factors and trends during the titration process, and then establish a more accurate titration state prediction model. By constructing an initial solution end state prediction model, it can lay a foundation for further optimization and automatic control, and provide early prediction ability. Using the historical titration experiment data to be analyzed to train the model can not only improve the generalization ability of the model, but also dynamically adjust according to the actual data situation, and finally form an efficient and accurate solution end state prediction model to help improve the automation and accuracy of the titration process.

[0020] Optionally, step S5 is specifically as follows: Step S51: Obtain a real-time titration solution image set through a high-resolution camera; Step S52: Perform data preprocessing on the real-time titration solution image set to obtain a real-time titration solution image set to be analyzed; Step S53: Integrate the time-series features of the titration solution according to the real-time titration solution image set to be analyzed to obtain time-series feature data of the titration solution; Step S54: Perform solution state prediction on the time-series feature data of the titration solution through the solution end state prediction model to obtain solution state prediction data of the titration solution; Step S55: Adjust the parameters of the solution titration parameter group according to the solution state prediction data of the titration solution to obtain an optimized parameter group for the solution titration of the titration device, and transmit it to the control end of the solution titration device to execute the device control task; Step S56: Repeat steps S51 to S55 until the titration solution reaches the end state.

[0021] The present invention acquires a real-time titration solution image set through a high-resolution camera, which can monitor the color change of the solution in real time to ensure the accuracy and comprehensiveness of the experimental process. Data preprocessing of the real-time titration solution image set can eliminate noise and interference to ensure the reliability of subsequent analysis. Through the integration of the time-series characteristics of the titration solution, the time-series characteristics of the solution color change can be extracted to provide effective data support for the prediction of the solution state. Using the solution end-state prediction model to predict the time-series characteristic data of the titration solution can track the state change of the solution in real time and accurately determine whether it is approaching the end point, thereby improving the automation and accuracy of the titration process. Adjusting the solution titration parameters of the titration device based on the prediction data can optimize the titration rate and accuracy in real time, reduce human intervention and improve the experimental efficiency. Real-time monitoring and adjustment of the titration parameters until the solution reaches the end state ensure that the titration process is more accurate, stable and efficient.

[0022] Optionally, step S55 is specifically as follows: Step S551: Obtain the solution titration parameter set of the titration device; Step S552: Extract the critical time of the solution end state according to the prediction data of the titration solution state to obtain the critical time data of the solution end state; Step S553: Quantify the influence of the titration parameters based on the solution titration parameter set of the titration device and the prediction data of the titration solution state to obtain the influence degree data of the titration parameters; Step S554: Optimize the titration parameters for the critical time data of the solution end state according to the influence degree data of the titration parameters to obtain the optimized solution titration parameter set of the titration device, and transmit it to the control end of the solution titration device to execute the device control task.

[0023] The present invention can ensure that the device always uses the most suitable parameters for control during the titration process by obtaining the solution titration parameter set of the titration device, guaranteeing the accuracy and efficiency of the experiment. Extracting the critical time of the solution end state using the prediction data of the titration solution state helps to accurately predict the completion time of the titration reaction, providing a time reference for subsequent optimization and adjustment. Quantifying the influence of the titration parameters based on the solution titration parameter set of the titration device and the solution state prediction data can quantify the specific influence of different parameters on the titration reaction, thereby helping to optimize the experimental conditions and improve the reaction accuracy and response speed. By optimizing the titration parameters for the critical time data of the solution end state, the experimental process can be adjusted more precisely to ensure that the solution titration is completed at the best time, minimizing errors to the greatest extent. Finally, transmitting the optimized solution titration parameter set of the titration device to the control end of the solution titration device ensures that the device executes tasks according to the new parameters, thereby improving the automation and precision of the titration process, reducing human intervention, and enhancing the reliability and efficiency of the experiment. Description of the Drawings

[0024] Other features, objects, and advantages of the present invention will become more apparent from the following detailed description of non - restrictive embodiments read in conjunction with the accompanying drawings: Figure 1 It is a schematic flow chart of the steps of the method for judging the titration end point based on machine vision of the present invention; Figure 2 It is a detailed schematic flow chart of step S1 in the present invention; Figure 3 It is a detailed schematic flow chart of step S3 in the present invention; The realization of the object of the present invention, functional characteristics, and advantages will be further described in conjunction with embodiments with reference to the drawings. Detailed Embodiments

[0025] The technical method of the present invention will be clearly and completely described below with reference to the drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of them. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts belong to the scope of protection of the present invention.

[0026] In addition, the drawings are only schematic diagrams of the present invention and are not necessarily drawn to scale. The same reference numerals in the drawings represent the same or similar parts, and thus repeated descriptions thereof will be omitted. Some of the block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. The functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor methods and / or microcontroller methods.

[0027] It should be understood that although the terms "first", "second", etc. may be used here to describe various units, these units should not be limited by these terms. These terms are only used to distinguish one unit from another. For example, without departing from the scope of the exemplary embodiments, the first unit can be called the second unit, and similarly the second unit can be called the first unit. The term "and / or" used here includes any and all combinations of one or more of the listed related items.

[0028] To achieve the above object, please refer to Figures 1 to 3 , the present invention provides a method for judging the titration end point based on machine vision, and the method includes the following steps: Step S1: Obtain a set of titration process solution images through a high - resolution camera, and perform bilinear Laplacian illumination correction on the set of titration process solution images to obtain an initial set of titration solution images; In this embodiment, in order to ensure the acquisition of high-quality titration process images, an industrial camera with a resolution of 20MP and supporting 60fps is selected and installed on the side of the titration container to ensure that the solution images during each titration process are clearly visible. During image capture, the bilinear Laplacian illumination correction algorithm is used to perform illumination equalization processing on the images. In specific operations, local illumination correction is performed on each frame of the image, and the kernel size of the Laplacian filter used is 3×3 to avoid over-adjustment and ensure the clarity of image details. The processed image is the initial titration solution image set, ensuring that it will not be interfered by illumination changes during the subsequent processing process.

[0029] Step S2: Perform panoramic bilateral filtering edge noise removal on the initial titration solution image set to obtain a denoised titration solution image set, and perform solution image adaptive hue enhancement on the denoised titration solution image set to obtain a titration solution image set to be analyzed; In this embodiment, in order to remove the edge noise in the titration solution image, the panoramic bilateral filtering algorithm is adopted, and the filtering radius is set to 5 pixels and the weight coefficient is set to 10. This filter can effectively smooth the solution image while retaining important edge features. Next, solution image adaptive hue enhancement is performed. By adjusting the hue gain parameter of the image and setting the enhancement factor to 2.0, the hue of the solution during the titration process becomes more prominent, which helps to improve the sensitivity to color changes. This step ensures that the final titration solution image set to be analyzed can effectively present the dynamic changes in the solution color.

[0030] Step S3: Perform dynamic feature integration on the dynamic change pattern of the solution color based on the titration solution image set to be analyzed to obtain a solution dynamic feature set; In this embodiment, based on the processed titration solution image set, first, color features such as hue, saturation, and brightness in the images are extracted. Then, these features are tracked at each moment during the titration process through a time series method. In order to analyze the dynamic changes in the solution color, a dynamic feature integration algorithm is adopted to calculate the change rate of the color at each moment. For example, during the hue change process of the solution, the change amount of the hue between the front and back frames is calculated to obtain the solution color change rate. The finally generated solution dynamic feature set is convenient for subsequent prediction and analysis of the solution end state.

[0031] Step S4: Obtain historical titration experiment data, and construct a solution end state prediction model based on the solution dynamic feature set and the historical titration experiment data; In this embodiment, during the acquisition of historical titration experiment data, a data set containing information such as titrant concentration, titration speed, and reaction time was collected. After preprocessing the data, a machine learning method was used to construct a prediction model for the end state of the solution. Specifically, a support vector machine (SVM) model was used to construct a classification model through the correlation analysis of historical experimental data and the solution dynamic feature set to predict whether the titration process is approaching the end point. Through cross-validation, the best model parameters were selected to enable the model to accurately predict the end state in different titration experiments.

[0032] Step S5: Obtain a set of real-time titration solution images through a high-resolution camera; perform solution state prediction on the set of real-time titration solution images through the solution end state prediction model, and adjust the titration speed according to the solution state prediction result until the titration solution reaches the end state.

[0033] In this embodiment, the images of the solution during the titration process are captured in real time by a high-resolution camera and input into the aforementioned solution end state prediction model. During this process, the solution state prediction data (such as color change rate and state trend) is used to adjust the titration speed in real time. For example, when the solution is approaching the end point, the model predicts its state as "approaching the end point", and at this time, the titration speed is reduced from the initial 2 ml / min to 1 ml / min to ensure the accuracy of titration. This process continues until the model detects that the solution has reached the end state, avoiding over-titration and experimental errors.

[0034] Optionally, step S1 is specifically: Step S11: Obtain a set of solution images during the titration process through a high-resolution camera; In this embodiment, during the titration experiment, the images of the solution during the titration process are captured by using a high-resolution camera (such as 12 million pixels or higher resolution). The camera is set at a fixed position and focused on the middle section of the solution in the titration container to ensure clear images. In order to obtain a continuous image sequence, the shooting interval of the camera is set to once per second to capture the subtle changes during the color change process of the solution. The lighting during this process should be kept uniform and non-flickering, using artificial LED light sources or optically stable laboratory lighting equipment.

[0035] Step S12: Calculate the brightness of the image area based on the set of solution images during the titration process to obtain the local area brightness data of the image; In this embodiment, the acquired solution image set is analyzed. First, the brightness of different regions in each image is calculated through an image processing algorithm. The image is converted into a single brightness channel using grayscale processing, and then the average brightness value and local area brightness distribution of the image area are calculated to obtain the local area brightness data of the image. Assuming that each image contains multiple regions (for example, a 5×5 pixel area is a region), the brightness of these small regions is analyzed to calculate their brightness changes. The image processing tools in OpenCV are used to calculate the brightness of the region, and the numerical data of each region is obtained for subsequent processing. Subsequently, the solution image set during the titration process is converted back to an RGB image.

[0036] Step S13: Calculate the regional brightness difference of the local area brightness data of the image, and calculate the image brightness compensation value according to the result of the regional brightness difference; In this embodiment, according to the obtained local area brightness data of the image, the regional brightness difference is calculated. In this process, a pixel-level difference algorithm (such as the Sobel operator or the Laplacian operator) is used to evaluate the brightness change between adjacent regions. This will help calculate the amplitude of the brightness change, thereby obtaining the illumination change in the image. The illumination compensation value is further deduced using these difference results, and the compensation value is set as the weighted average or maximum value of the brightness value according to the difference results. For example, if the difference in some regions is large, the compensation value will be high, further affecting the subsequent image processing effect.

[0037] Step S14: Remove the light spots on the solution surface from the solution image set during the titration process to obtain a light-spot-removed image set; In this embodiment, in order to remove the light spots during the titration process, an algorithm based on image filtering and morphological operations is used. For example, first, the local area is blurred through mean filtering or Gaussian filtering to reduce the interference of high-brightness regions. Then, morphological operations (such as opening or closing operations) are used to remove irregular light spots. In actual operation, OpenCV is used for background denoising and light-spot removal, and appropriate filtering radii and thresholds are set. For example, a Gaussian kernel with a radius of 3 pixels is used for image smoothing to remove abnormal high-brightness regions caused by light spots.

[0038] Step S15: Perform illumination transformation compensation on the light-spot-removed image set according to the image brightness compensation value to obtain the initial titration solution image set.

[0039] In this embodiment, after removing the light spot, the calculated brightness compensation value is used to perform illumination transformation compensation on the image without light spot. The purpose of this step is to correct the brightness deviation of the solution image caused by uneven illumination. In specific operations, adaptive histogram equalization (AHE) or a global illumination compensation algorithm can be used to optimize the image. Suppose in the experiment, the brightness difference of the solution image is large. Using AHE can adjust the brightness distribution of the image to ensure the uniformity of the overall illumination. According to the compensation value, the brightness parameter of the image is adjusted using OpenCV to ensure that the final image set has a consistent visual effect.

[0040] Optionally, step S14 is specifically as follows: Step S141: Extract the characteristics of the high-brightness region of the image based on the solution image set during the titration process to obtain the characteristic data of the high-brightness image region; In this embodiment, based on the solution image set during the titration process, an image processing algorithm is used to extract the characteristics of the high-brightness region. In this step, a brightness threshold (for example, the brightness value is greater than 200) is set to identify the high-brightness regions in the image. Usually, these regions are caused by uneven illumination or reflection on the surface of the solution. Through a region segmentation method based on brightness (such as the Otsu algorithm or simple threshold segmentation), the regions with brightness values exceeding the set threshold are extracted. For each frame of the image, the characteristics such as the area, shape, and position of the high-brightness region are extracted to form the characteristic data of the high-brightness image region. During this operation process, the threshold is set to be automatically adjusted and changes flexibly according to the change of the image content to avoid being too rigid with a fixed value.

[0041] Step S142: Identify the high-brightness difference region based on the region brightness difference result for the characteristic data of the high-brightness image region to obtain the image set of the light spot region; In this embodiment, based on the extracted characteristic data of the high-brightness image region, the high-brightness difference region is identified through the region brightness difference result. An image difference algorithm (such as the Sobel operator or Canny edge detection) is used to calculate the brightness difference between regions to identify the light spot region. In the experiment, if it is found that the brightness difference of a certain region exceeds the set threshold (for example, 50 brightness units), this region will be marked as the light spot region. The key to this process is the setting of the difference threshold. Setting an appropriate brightness difference range can effectively reduce excessive interference and accurately identify the light spot region. During specific operations, the brightness difference threshold can be adjusted according to the change of the light source in the experiment.

[0042] Step S143: Perform local image bilinear interpolation substitution on the image set of the light spot region to obtain the image set of the substituted light spot region; In this embodiment, bilinear interpolation of local images is used to replace the image set of the light spot area. The identified light spot area is locally magnified, and the bilinear interpolation method is applied to smoothly replace the pixel values of the light spot area. During the interpolation process, the weighted average of surrounding pixels is used to replace the abnormal pixels in the light spot area, ensuring that the replacement area is smooth and no obvious image distortion occurs. For example, the interpolation window size is set to 3×3 pixels, the pixel values of the light spot area are calculated by bilinear interpolation, and the pixel values of this area are gradually replaced to make the illumination consistent with the surrounding area. The cv2.resize function of OpenCV combined with the interpolation mode is used to perform this operation.

[0043] Step S144: Perform Laplacian pyramid fusion on the image set of the light spot area replacement images and the image set of the titration process solution images to obtain a defocused image set.

[0044] In this embodiment, Laplacian pyramid fusion is performed on the image set of the light spot area replacement images and the image set of the titration process solution images to obtain a defocused image set. In this step, first, the preset Laplacian pyramid is used to decompose the image into different scale levels. Each image level is processed by different filters to gradually remove the interference caused by the light spots. During the pyramid fusion, each layer of the image set of the light spot area replacement images is merged with the corresponding level of the original image, and the weighted average method is used to synthesize the final image, ensuring that no detail information is lost during the fusion process. In the experiment, different fusion weight coefficients can be set, such as 0.7 and 0.3, corresponding to the original image and the replacement image respectively, to achieve the best fusion effect. Finally, the generated defocused image set will be smoother and have no obvious light spot interference, improving the accuracy of titration image analysis.

[0045] Optionally, the panoramic bilateral filtering edge noise removal in step S2 is specifically: Perform edge detection on the initial titration solution image set to obtain titration solution edge data, and select seed pixels according to the titration solution edge data to obtain seed pixels; In this embodiment, the Canny edge detection algorithm is used to extract edges from the initial titration solution image set. By setting the low threshold of the Canny algorithm to 50 and the high threshold to 150, obvious edges in the solution are identified. Subsequently, based on this edge data, seed pixels, that is, edge pixels in the image, are selected as the starting point for subsequent region segmentation and image processing. These seed pixels represent important boundary information in the image. The selection rule for seed pixels is: select obvious pixel points in the edge region as seeds. These seed pixels are located near the boundary of the solution or the edge of the container and have strong gray-scale changes. In specific operations, pixel points with an edge intensity greater than 200 are selected in the image, and the most representative seed pixels are screened out through the local maximum algorithm. For example, the seed pixels can be the edge points where the solution contacts the container, or the obvious turning points between the surface of the solution and the background.

[0046] Calculate the similarity of the seed pixels, and segment the background of the initial titration solution image set according to the similarity results of the seed pixels to obtain the foreground image set of the titration solution and the background image set of the titration solution; In this embodiment, after the seed pixels are selected, similarity calculation is performed. The structural similarity index (SSIM) is used to calculate the similarity between the seed pixels and other pixels. The threshold is set to 0.85. If the similarity is greater than this threshold, it is considered that the pixel belongs to the foreground. The similarity calculation process is completed through the sliding window algorithm. The window size is set to 5x5. The SSIM value within the current window is calculated each time, and classification is performed according to the calculation results. If the similarity of the current pixel exceeds 0.85, it is marked as the foreground area and incorporated into the foreground image set of the titration solution. The background area is separated according to pixel points with a similarity lower than 0.85, and finally the foreground image set and the background image set are obtained.

[0047] Identify the background random noise based on the background image set of the titration solution to obtain the background random noise feature data; In this embodiment, for the background image set of the titration solution, a noise detection algorithm based on wavelet transform is used to identify the random noise in the background. The background image is decomposed into frequency components of multiple scales by wavelet transform, and the fluctuations in the high-frequency part are analyzed. The threshold is set to 5% fluctuation as the standard for noise. When the fluctuation of a certain frequency band exceeds this threshold, it is marked as noise. Finally, the background random noise feature data is extracted, including the frequency distribution and energy characteristics of the noise area.

[0048] Perform Gaussian filtering of the background noise on the foreground image set of the titration solution according to the background random noise feature data to obtain the foreground image set with background noise removed; In this embodiment, according to the background random noise characteristic data, the Gaussian filtering method is used to remove the noise from the foreground image set of the titration solution. A 3x3 Gaussian filter is selected, and the standard deviation is set to 1.5. The Gaussian filter smooths the noise in the foreground image while retaining the main features of the solution. After removing the background noise, the solution area in the image becomes clearer, and the interference is minimized.

[0049] Based on the seed pixel similarity results, identify the solution-container edge region in the foreground image set of the titration solution to obtain the solution-container edge region image set; In this embodiment, based on the similarity results of the seed pixels, identify the solution-container edge region in the foreground image set. To improve the accuracy of edge detection, this step adopts a combined method of the Sobel operator and the Canny edge detection algorithm. First, perform preliminary gradient calculation in the image through the Sobel operator to detect the boundary between the solution and the container. Then, apply the Canny edge detection algorithm to further improve the accuracy of the edge. Set the high and low thresholds of the Canny algorithm to 50 and 150 respectively to ensure that the boundary line between the solution and the container can be accurately detected. The edge detection process pays special attention to edge details to ensure that the boundary line between the solution and the container can be accurately marked as the solution-container edge region image set. Through this combined method, the morphological features of the solution can be accurately extracted, and accurate data can be provided for subsequent denoising and filtering.

[0050] Perform bilateral filtering on the solution-container edge region image set to obtain the solution-container edge region denoised image set; In this embodiment, after obtaining the solution-container edge region image set, in order to remove the noise in the region between the solution and the container, bilateral filtering is used for smoothing. Bilateral filtering is an image smoothing method that combines spatial information and pixel value similarity, which can keep the edges of the image clear while denoising. The spatial standard deviation is set to 2.0, and the color standard deviation is set to 25. The spatial standard deviation controls the range of the filtering operation, and a larger spatial standard deviation can make more pixels participate in the filtering calculation; the color standard deviation determines whether to smooth pixels with large color differences. This operation can effectively smooth the high-frequency noise in the solution and container regions while keeping the image edges clear, avoiding edge blurring, and ensuring a clear boundary line at the junction of the solution and the container.

[0051] According to the solution-container edge region denoised image set, replace the corresponding image regions in the foreground image set with background noise removed to obtain a multi-layer denoised image set; In this embodiment, for the image set after denoising the solution-container edge region, a pixel replacement operation is performed. According to the edge information of the denoised image set of the solution-container edge region, the corresponding regions in the foreground image set with background noise removed are replaced with pixel points. This operation is mainly used to repair the missing image regions that appear after background noise removal. For example, the internal region of the solution and the edge part of the container are pixel-replaced to ensure the integrity and continuity of the image. The image set after replacement forms a multi-layer denoised image set. Based on the denoised image set of the solution-container edge region, the pixel points inside the solution and on the container edge are determined, and the interpolation algorithm is used to replace the missing or discontinuous regions with pixels. Specifically, a bilinear interpolation algorithm based on neighborhood pixel values is used to replace the missing parts of the solution region and the container edge. In this way, the blank regions that may appear after denoising can be effectively repaired, making the boundary regions of the image more coherent and complete. After this step, the obtained image is a multi-layer denoised image set, in which the details of the solution region and the container edge are more accurate.

[0052] Adaptive histogram equalization is performed on the multi-layer denoised image set to obtain a denoised titration solution image set.

[0053] In this embodiment, adaptive histogram equalization is performed on the multi-layer denoised image set to enhance the image contrast. Histogram equalization adjusts the brightness distribution of the image, making the details of the solution region more prominent and further improving the background. In this embodiment, the equalization operation uses a local histogram equalization algorithm, and the local window size is set to 8×8. The histogram of each local region is equalized separately to enhance local details and reduce the risk of over-lightening or darkening. The finally processed image is clearer in details, and the changes in the solution and the boundaries of the container are more obvious, further enhancing the visual effect of the image. After histogram equalization processing, the visual effect of the image is significantly improved, the boundaries and details of the solution are clearer, and finally a denoised titration solution image set is obtained.

[0054] Optionally, the adaptive hue enhancement of the solution image set in step S2 is specifically: Local region contrast-limited equalization is performed on the denoised titration solution image set to obtain a secondarily equalized titration solution image set; In this embodiment, the local contrast-limited equalization (CLAHE) algorithm is adopted. This method can improve local details while avoiding artifacts caused by over-enhancement. The local window size of CLAHE is set to 8x8, and the contrast limit parameter is set to 2.0. This method can dynamically adjust the contrast according to the local regions of the image, effectively highlighting the details of the solution and avoiding the overall distortion of the image after global equalization. Local region contrast-limited equalization helps to enhance the local contrast of the image, improve the distinguishability of the solution change region, and provide more refined image details for subsequent image analysis.

[0055] Convert the color space of the images in the secondary equalization titration solution image set to obtain the HSV image set of the titration solution; In this embodiment, the images are converted from the RGB color space to the HSV color space to better analyze and process the color characteristics of the solution. During the conversion process, first calculate the values of the three RGB channels, and then use the standard RGB-to-HSV conversion formula to obtain the hue, saturation, and value. After conversion, the color characteristics of the solution are more prominent, especially in the hue and saturation channels, which can effectively distinguish the color changes of the solution and provide more stable color information, reducing the influence caused by light changes. The converted HSV image set of the titration solution is more suitable for subsequent color feature extraction and enhancement.

[0056] Separate the color channels of the HSV image set of the titration solution to obtain the hue channel image set and the saturation channel image set; In this embodiment, the color channels of the HSV image set of the titration solution are separated, and the images are decomposed into the hue channel image set and the saturation channel image set. In the hue channel image set, the hue represents the main color of the solution; in the saturation channel image, the saturation reflects the color concentration of the solution. To ensure the complete retention of contrast and color information, the hue channel image set and the saturation channel image set are enhanced using independent histogram equalization techniques respectively. For the hue channel, histogram equalization enhances its color distribution to make the color representation more uniform; for the saturation channel, adaptive histogram equalization is used to ensure better retention of color details of the solution at different concentrations.

[0057] Perform joint enhancement of hue and saturation based on the hue channel image set and the saturation channel image set to obtain the image set of the titration solution to be analyzed.

[0058] In this embodiment, joint enhancement of hue and saturation is performed based on the hue channel image set and the saturation channel image set. To enhance the color contrast of the solution, a joint enhancement method of hue and saturation based on weighted average is used. First, the hue channel and the saturation channel are enhanced separately, and their details are improved through the adaptive equalization method, and then the enhanced results of these two channels are fused through weighted average. The weighting coefficient of the hue channel is set to 0.7, and the weighting coefficient of the saturation channel is set to 0.3 to ensure the naturalness of the color. After this step, the color information of the image set of the titration solution to be analyzed is significantly enhanced, the color difference and detail changes in the solution are more prominent, the recognition rate of the image is improved, and it is helpful for subsequent solution analysis and endpoint prediction.

[0059] Optionally, step S3 is specifically: Step S31: Perform time series extraction on the titration solution image set to be analyzed to obtain solution image time series data; In this embodiment, a high-resolution camera is used to capture multiple consecutive image frames during the titration process. The time interval is set to 1 second, and each captured frame is arranged in chronological order to form an image time series. This time series data contains the color change information of the solution during the titration process. The image captured at each time point captures the color and state of the solution at different titration stages. Extract the time series recorded in the titration solution image set to be analyzed to obtain solution image time series data. The time series extraction provides basic data for subsequent dynamic change analysis.

[0060] Step S32: Calculate the time derivative of hue and the time derivative of saturation for the solution image time series data to obtain the time derivative of the hue channel of the solution image and the time derivative of the saturation channel of the solution image; In this embodiment, calculate the time derivative of hue and the time derivative of saturation for the solution image time series data. The hue (H) and saturation (S) in each frame of the image can be obtained through color space conversion. For each frame of the image, after extracting its hue and saturation channels, calculate the time derivative of hue and the time derivative of saturation for each pair of adjacent frames. For example, assume that at time points t and t−1, the hues are H(t) and H(t−1) respectively, then the time derivative of hue is \(\Delta H = H(t)-H(t - 1)\). Similarly, the time derivative of saturation is \(\Delta S = S(t)-S(t - 1)\). In this way, the change amounts of hue and saturation for each frame are obtained, reflecting the change rate of the solution color during the titration process.

[0061] Step S33: Calculate the solution color change rate based on the time derivative of the hue channel of the solution image and the time derivative of the saturation channel of the solution image to obtain solution color change rate data; In this embodiment, calculate the solution color change rate based on the time derivative of the hue channel of the solution image and the time derivative of the saturation channel of the solution image. The time derivatives of hue and saturation represent the change rate of the solution color. To calculate the solution color change rate, the weighted average method is used to combine the hue derivative and the saturation derivative. Specifically, set the weight of the hue derivative to 0.7 and the weight of the saturation derivative to 0.3. The calculation formula is: \(\text{Change rate}=0.7\times|\Delta H| + 0.3\times|\Delta S|\); The color change rate calculated in this way reflects the intensity of the solution color change during the titration process. This data will be used for subsequent solution dynamic analysis to help judge the change trend of the solution.

[0062] Step S34: Perform time series statistics on the solution image time series data for the solution color distribution to obtain the solution color distribution time series data; In this embodiment, time series statistics are performed on the solution image time series data for the solution color distribution to obtain the solution color distribution time series data. By segmenting the hue and saturation channels of each frame of the image, they are divided into a number of hue and saturation intervals. For example, the hue is divided into 36 intervals from 0° to 360°, with each interval having a width of 10°; the saturation is divided into 10 intervals from 0 to 1, with each interval having a width of 0.1. Then, the number of pixels in each interval is calculated, and the color distribution of each frame of the image is statistically analyzed. These data will reflect the pattern of the solution color changing over time in the time series, such as the color gradually changing from red to yellow, or the change trend of the solution saturation. These statistical data provide an accurate description for the subsequent analysis of the solution state change.

[0063] Step S35: Perform dynamic classification of the solution color change pattern based on the solution color change rate data and the solution color distribution time series data to obtain the solution dynamic feature set.

[0064] In this embodiment, dynamic classification of the solution color change pattern is performed based on the solution color change rate data and the solution color distribution time series data to obtain the solution dynamic feature set. By analyzing the color change rate and the color distribution time series data, the K-means clustering algorithm is used to classify the change of the solution color. Specifically, the solution color change rate and the solution color distribution time series data are used as inputs, and 5 clustering centers are set, and the data is subjected to clustering analysis. Each clustering center represents a color change stage of the solution, such as a rapid change stage, a slow change stage, or a stable stage. Finally, the obtained solution dynamic feature set will contain the time range, change rate, and color distribution information of each stage. This feature set is used to guide the subsequent adjustment of the titration process and endpoint prediction.

[0065] Optionally, step S35 is specifically: Perform data standardization on the solution color change rate data and the solution color distribution time series data to obtain the standardized solution color change rate data and the standardized solution color distribution time series data; In this embodiment, in order to ensure that the data is analyzed under the same dimension, the standardization method is first used to process the solution color change rate data and the color distribution time series data. Specifically, for each item of data, its mean and standard deviation are calculated, and then the formula is used for standardization: $X_{norm}=\frac{X-\mu}{\sigma}$; where $X$ is the original data, $\mu$ is the data mean, and $\sigma$ is the data standard deviation. After standardization, the obtained solution color change rate data and the solution color distribution time series data will both be in the range of 0 to 1, which is convenient for subsequent trend analysis and pattern recognition.

[0066] Perform sliding window dynamic change trend analysis on the standardized solution color change rate data to obtain color change trend data, and perform color change stage pattern recognition based on the color change trend data to obtain color change stage pattern data; In this embodiment, a window size of 10 frames is set, and the step size of the sliding window is 1 frame. The dynamic change trend of the standardized solution color change rate data is analyzed through the sliding window, the data change trend within each window is calculated, and the color change trend of the solution is judged according to the change direction of the data. Then, based on the color change trend data, the K-means clustering method is used to divide the data into different phased patterns. For example, a stable phase, a slow change phase, and a rapid change phase, etc. Set the window size to 10 frames, use the sliding window to calculate the solution color change rate within each frame and generate color change trend data. Then, based on the color change trend data, use the K-means clustering algorithm to analyze the trend data. Arrange all the solution color change rate data in a time series to form a data matrix, where each row represents the color change rate information at a time point. Extract features such as the color change amplitude, change rate, and change direction within each time period from the color change trend data. For example, calculate the average value, maximum value, and standard deviation of the color change rate. Use the K-means clustering algorithm to cluster the extracted features. First, set K to 3, indicating that the color change process is divided into 3 phases: a stable phase, a slow change phase, and a rapid change phase, etc. The K-means algorithm automatically divides the data into 3 different categories by minimizing the distance between each data point and its cluster center. The K-means algorithm divides the color change trend data into three categories, which represent different color change phases respectively. For example, the data points in the stable phase will be concentrated in one cluster, the data points in the slow change phase will be concentrated in another cluster, and the data points in the rapid change phase will be distributed in the last cluster. According to the clustering results, mark the color change phased pattern for each data cluster respectively. For example, the stable phase can be marked as "Phase 1", the slow change phase is marked as "Phase 2", and the rapid change phase is marked as "Phase 3". These marks can help further analyze the patterns and rules of the solution color change during the titration process. Finally, obtain the color change phased pattern data, which describes the different phases of the color change during the titration process.

[0067] Based on the time derivative of the hue channel of the solution image and the time derivative of the saturation of the solution image, identify the rate peak of the color change phased pattern data to obtain the turning point marked color change phased pattern data; In this embodiment, by analyzing the hue and saturation time derivative data, the peak detection algorithm is used to identify the peak rate of color change. For example, setting the peak threshold to 0.05, when the time derivatives of hue and saturation exceed this threshold, it can be considered that the turning point of color change has occurred. These turning points mark the key stages of color change. By applying these turning points to the color change stage pattern data, the color change stage pattern data with turning point marks is obtained, which helps to determine the critical moment of the solution color change during the titration process.

[0068] Perform Gaussian distribution description on the time series data of the solution color distribution to obtain the solution color distribution pattern data; In this embodiment, in order to more accurately describe the color change of the solution, Gaussian distribution is used to fit the time series data of the solution color distribution. For example, the color distribution data at each time point is regarded as high-dimensional data, and the Gaussian distribution parameters are solved by the least squares method to obtain the mean and variance of the solution color. According to these parameters, the evolution trend of the solution color is constructed and described as a Gaussian distribution. These Gaussian distribution data reflect the change law of the solution color during the titration evolution process, thus providing data support for subsequent pattern recognition.

[0069] Based on the turning point marked color change stage pattern data and the solution color distribution pattern data, perform solution color change pattern stage pattern association to obtain the solution titration stage pattern data; In this embodiment, by combining the turning point marked color change stage pattern data with the solution color distribution pattern data, and adopting a weighted association algorithm, different stages of color change are matched with the change trend of color distribution. For example, setting the weighted coefficients of the color change rate and the distribution trend to 0.6 and 0.4, and combining the two by the weighted method to obtain the solution titration stage pattern data. These data represent the color change pattern of the solution during the titration process, providing a basis for predicting the titration end point and process control.

[0070] Obtain the historical titration stage experimental data, and set the color change rate threshold for the titration stage according to the historical titration stage experimental data; In this embodiment, the color change data generated during the determined titration stage in the historical experiment is obtained through the experimental database of solution titration. According to the historical titration experimental data, the relationship between the color change rate and the titration process is analyzed. For example, after multiple experiments, it is concluded that in the final stage of titration, the threshold of the color change rate is usually greater than 0.02. Therefore, the color change rate threshold for the titration stage is set to 0.02, which is used to determine whether the titration enters the final stage and provides a basis for subsequent determination of the titration end point.

[0071] Using a predefined grading standard, and dynamically grading the solution titration stage mode data based on the color change rate threshold in the titration stage to obtain color change mode grading data; In this embodiment, according to the color change rate threshold in the titration stage (such as 0.05 and 0.02), combined with the color change mode data of the solution, the titration process is graded in real time through a predefined grading standard (such as stable, slow change, rapid change, etc.). For example, if the color change rate is lower than 0.005, it is determined as the "stable stage"; if the change rate is greater than or equal to 0.005 but less than 0.02, it is determined as the "slow change stage"; when the change rate is greater than or equal to 0.02, it is determined as the "rapid change stage". According to this predefined grading standard, the color change state of the entire titration process is dynamically marked, thereby generating color change mode grading data, which reflects the change trends in different stages of the titration process.

[0072] Summarize the feature sets of the color change mode grading data, and perform multi-dimensional data fusion on the summary results to obtain the solution dynamic feature set.

[0073] In this embodiment, the color change mode grading data is summarized, and the main features of the color change are extracted, such as the change rate, change mode, distribution trend, etc. Then, these features are processed through multi-dimensional data fusion technology to obtain the solution dynamic feature set. For example, using PCA (Principal Component Analysis) to compress multiple features into fewer principal components for comprehensive analysis to obtain the final solution dynamic feature set. This feature set provides a key decision-making basis for the subsequent optimization and automatic control of the titration process.

[0074] Optionally, step S4 is specifically as follows: Step S41: Obtain historical titration experiment data, and perform data preprocessing on the historical titration experiment data to obtain the historical titration experiment data to be analyzed; In this embodiment, the historical titration experiment data is obtained through the experimental database of solution titration, including data such as the color change, pH value change, and solution volume change of the solution. These data are usually automatically recorded by experimental equipment and stored in the database. To ensure data quality, data preprocessing is performed. The first step of preprocessing is to remove missing values and outliers. For example, missing data is filled by the mean value or abnormal fluctuations are repaired using the median method. After that, the data is standardized to unify different measurement standards in different experiments to the same dimension. For example, all color change data is uniformly converted to the standard format in the RGB or HSV color space. During this process, the time alignment of the solution color also needs to be performed to ensure that the timestamps of each experimental data are consistent, thus facilitating subsequent analysis.

[0075] Step S42: Integrate the solution titration endpoint states based on the historical titration experiment data to be analyzed, and obtain the solution titration endpoint state data; In this embodiment, the solution titration endpoint states are integrated based on the historical titration experiment data to be analyzed. The titration endpoint state refers to the final state of the solution, which includes information such as color and volume. In this step, first, the color change rate in the experiment is used to determine whether the titration process is approaching the endpoint. For example, when the color change rate is greater than 0.05 units / s, it is considered that the titration is approaching the end. At the same time, the solution color change is used as auxiliary information. When the color change is obvious, it is further confirmed that the titration process is approaching the endpoint. The result of the integration of the solution titration endpoint state data is a data set containing multiple dimensions (such as color, volume, etc.). Each data item corresponds to the specific state of the titration endpoint, forming an integrated titration endpoint state data set. The titration endpoint is the point with the maximum change rate, and the change rate after the endpoint is relatively small. Specifically, during the entire titration process, the total titration volume H and the titration rate v are continuously recorded. Therefore, a table T with a one-to-one correspondence between H and v can be generated. The endpoint should be judged as the change rate being greater than 0.20 units / s, and the change rate is less than 0.03 units / s thereafter. When this condition is met, the titration stops. By looking up the table T, it is sufficient to compare and find the H value corresponding to the maximum value of v. This H value is the titration endpoint volume.

[0076] Step S43: Perform feature association based on the solution dynamic feature set and the solution titration endpoint state data to obtain the solution titration state feature association data set; In this embodiment, feature association is performed based on the solution dynamic feature set and the solution titration endpoint state data. First, the dynamic feature set of the solution is extracted, including the color change rate, the change in the solution color distribution, etc. Statistical methods (such as the Pearson correlation coefficient, mutual information quantification method, etc.) are used to analyze the correlation between these dynamic features and the titration endpoint state. For example, the feature set closely related to the titration endpoint is identified through cluster analysis. Through these analyses, a feature association data set containing the association information between the dynamic features and the titration endpoint state is obtained. This data set can provide an important basis for the establishment of the subsequent solution endpoint state prediction model.

[0077] Step S44: Construct an initial solution endpoint state prediction model according to the solution titration state feature association data set; In this embodiment, an initial solution endpoint state prediction model is constructed based on the solution titration state feature correlation dataset. First, a suitable machine learning algorithm is selected, such as support vector machine (SVM), random forest, or neural network, etc., and the model is trained using the obtained feature correlation data. For example, a support vector machine regression (SVR) model can be used, where the input features are the dynamic features of the solution (such as the color change rate, etc.), and the target output is the titration endpoint state. To improve the prediction accuracy, cross-validation (such as 10-fold cross-validation) is adopted during model training to avoid overfitting, and the model parameters (such as the C value, kernel function type, etc.) are adjusted through grid search to obtain the best prediction result.

[0078] Step S45: Use the historical titration experiment data to be analyzed to train the initial solution endpoint state prediction model to obtain a solution endpoint state prediction model.

[0079] In this embodiment, the initial solution endpoint state prediction model is trained using the historical titration experiment data to be analyzed. First, a representative historical titration experiment dataset is selected from the experimental data and subjected to the same preprocessing as in step S41 to ensure the quality and consistency of the data. Then, this data is input into the initial solution endpoint state prediction model for training. For example, training is carried out through the gradient boosting decision tree (GBDT) algorithm, and the model optimizes the prediction accuracy by continuously adjusting the structure of the tree. During the training process, an error metric standard (such as the mean squared error MSE) is used to evaluate the performance of the model, and the model parameters are adjusted to improve the prediction ability of the model. After the training is completed, a solution endpoint state prediction model is obtained, which can predict the endpoint state of the solution based on the input dynamic feature data and has high accuracy and generalization ability.

[0080] Optionally, step S5 is specifically as follows: Step S51: Obtain a real-time titration solution image set through a high-resolution camera; In this embodiment, a real-time titration solution image set is obtained through a high-resolution camera. Select a high-definition camera with a resolution of at least 12MP and configure a special bracket in the laboratory to ensure that the camera can be stably aligned with the titration container. When obtaining images, the exposure time of the camera is set to 50ms to ensure that the color change of the solution is clearly presented and to avoid errors caused by solution flickering. The distance between the camera and the titration container is set to 2 to 5 centimeters to obtain image data with sufficient details. During the data acquisition process, one image is automatically taken every second regularly, and the image data is transmitted to the computer in the form of an image sequence for further processing.

[0081] Step S52: Perform data preprocessing on the real-time titration solution image set to obtain a real-time titration solution image set to be analyzed; In this embodiment, data preprocessing is performed on the real-time titration solution image set. First, the captured images are denoised, and noise removal is carried out through the median filtering algorithm, with the filtering window size set to 3×3. Then, image grayscale processing is performed to convert the color image into a grayscale image, which helps improve the calculation efficiency and focus on the brightness change of the solution. The histogram equalization algorithm is applied to the grayscale image to enhance the contrast of the image, especially the difference between the solution and the background. Finally, the solution edge is extracted through an edge detection algorithm (such as Canny edge detection) to further remove irrelevant background information, obtaining the preprocessed real-time titration solution image set to be analyzed.

[0082] Step S53: Integrate the temporal features of the titration solution according to the real-time titration solution image set to be analyzed to obtain the temporal feature data of the titration solution; In this embodiment, the temporal features of the titration solution are integrated according to the real-time titration solution image set to be analyzed. First, the color features of each image are extracted, including the RGB or HSV values of the solution, and the edge features of the image are captured to detect the changing trend of the solution color. By analyzing the time difference between images, the change rate of the solution color on the time axis is calculated, and feature integration is performed based on the similarity of the image sequence. The multi-scale analysis method is used to analyze the changes of the solution at different scales. For example, statistical information such as the mean and variance of the RGB values are extracted within different time periods. Finally, a multi-dimensional temporal feature data set of the titration solution is obtained, which reflects the evolution of the solution's color, brightness, and edge changes over time.

[0083] Step S54: Predict the solution state for the temporal feature data of the titration solution through the solution end state prediction model to obtain the titration solution state prediction data; In this embodiment, the obtained temporal feature data of the titration solution is input into the pre-trained solution end state prediction model. This model can predict the solution state based on historical experimental data and dynamic features (such as the color change rate, etc.). Regression algorithms such as support vector regression (SVR) or decision tree regression (DTR) are used to predict whether the solution is close to the titration end point according to the solution feature data. The prediction results include the current state of the solution, such as being in the initial stage, in the intermediate stage, or close to the titration end point, etc., and corresponding probability values and state identifiers are given.

[0084] Step S55: Adjust the parameters of the solution titration parameter group according to the titration solution state prediction data to obtain the optimized parameter group of the solution titration for the titration device, and transmit it to the control end of the solution titration device to execute the device control task; In this embodiment, the solution titration parameter set is adjusted according to the predicted data of the titration solution state. The solution state prediction data is used to dynamically adjust the solution titration optimization parameter set of the titration device. For example, if the solution is approaching the end point, the dropping speed of the titrant can be slowed down to avoid over-titration. Conversely, if the titration progress of the solution is slow, the titration speed can be increased. When adjusting the parameters, the PID control algorithm (Proportional, Integral, Derivative controller) is used to optimize the adding speed of the titration solution to ensure the smoothness and accuracy of the titration process. The adjusted titration optimization parameter set (such as titration speed, flow control, etc.) is transmitted to the control terminal of the solution titration device in real time to ensure that the device executes the control task according to the optimized parameters.

[0085] Step S56: Repeat steps S51 to S55 until the titration solution reaches the end state.

[0086] In this embodiment, steps S51 to S55 are repeated until the titration solution reaches the end state. After each image is captured by the camera, data preprocessing, time series feature integration, state prediction, and parameter adjustment are performed to continuously monitor the titration process. This process is repeated until the solution state prediction model determines that the solution has reached the end state. During the specific operation, the real-time solution state information is fed back to the control terminal of the solution titration device to ensure the accuracy of the titration speed and end point control. When the end point state of the titration is confirmed, the titration device automatically stops titrating and completes the solution titration process. During this process, various control parameters can be adjusted in real time according to the changes in the solution to achieve an efficient and accurate titration experiment.

[0087] Optionally, step S55 is specifically: Step S551: Obtain the solution titration parameter set of the titration device; In this embodiment, the solution titration parameter set is obtained through the titration device. The titration parameter set includes various control parameters required for solution titration, such as the flow rate of the titrant and the adding speed of the titration solution. In actual operation, the flow control accuracy of the titration device is set to 0.1 mL / min to ensure that the adding speed of the titrant can be accurately adjusted. The parameter set can also be automatically adjusted according to preset conditions such as the type of the titration solution and the properties of the solution (such as concentration, acidity and alkalinity).

[0088] Step S552: Extract the critical time of the solution end state according to the predicted data of the titration solution state to obtain the critical time data of the solution end state; In this embodiment, the critical time at the end state of the solution is extracted based on the predicted data of the titration solution state. First, based on the obtained predicted data of the solution state, the time window when the titration solution is approaching the end point is extracted. For example, if the color change rate of the solution is close to a preset threshold (such as 0.05 units / min), it indicates that the solution is approaching the end point, and the critical time in the future will be predicted according to the time series data. At this time, based on the predicted data of the titration solution state, the remaining time required for the solution to reach the titration end point (the color change rate is close to a preset threshold (such as 0.05 units / min)) is calculated. This prediction process is optimized using the dynamic time warping algorithm (DTW) to provide a more accurate estimation of the critical time. The critical time data is recorded in the form of a timestamp and transmitted to the control system of the titration device.

[0089] Step S553: Quantify the influence of the titration parameters based on the titration parameter group of the titration device solution and the predicted data of the titration solution state to obtain the titration parameter influence degree data; In this embodiment, by quantifying the influence of the titration device parameters on the end state of the solution, the influence degree of different parameter configurations on the titration process is evaluated. For example, adjusting the flow rate of the titrant (such as 0.1 - 2.0 mL / min) will affect the arrival time of the titration end point. By establishing a regression model and combining historical experimental data, the influence degree of each parameter on the end state is calculated. According to the prediction results, the influence degree value of each parameter is quantified as a percentage, reflecting its contribution to the end state of the solution. For example, the influence degree of the titrant flow rate on the end time is 60%. These data are further used to optimize the control parameters during the titration process.

[0090] Step S554: Optimize the titration parameters according to the titration parameter influence degree data for the critical time data of the solution end state to obtain the optimized titration parameter group of the titration device solution and transmit it to the control end of the solution titration device to execute the device control task.

[0091] In this embodiment, according to the quantified titration parameter influence degree data and the extracted critical time data of the solution end state, the titration parameters of the titration device are adjusted through an optimization algorithm. Specifically, the optimization goal is to enable the solution end state to be reached in the shortest time while avoiding over-titration or lag. Taking the titrant flow rate as an example, if the flow rate is too large, the solution will reach the end point prematurely; conversely, if the flow rate is too small, the titration process will be too slow. By using the gradient descent method or the genetic algorithm and combining the influence degree data, each parameter value is adjusted to make the titration process reach the best balance. The optimized parameter group, such as the titrant flow rate being 1.0 unit / min, etc., will be transmitted to the control end of the titration device to ensure that the device accurately executes the task according to the new control parameters and completes the titration process.

[0092] Therefore, from any perspective, the embodiments should be regarded as exemplary and non-limiting. The scope of the present invention is defined by the appended claims rather than the above description. Accordingly, all changes that fall within the meaning and scope of the equivalent elements of the application documents are intended to be embraced within the present invention.

[0093] The above are only specific embodiments of the present invention, enabling those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be obvious to those skilled in the art. The general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to these embodiments shown herein, but rather to the broadest scope consistent with the principles and novel features invented herein.

Claims

1. A method for judging the titration end point based on machine vision, characterized in that, Including the following steps: Step S1: Obtain a set of solution images during the titration process through a high-resolution camera, and perform bilinear Laplacian illumination correction on the set of solution images during the titration process to obtain an initial set of titration solution images; Step S2: Perform panoramic bilateral filtering to remove edge noise on the initial set of titration solution images to obtain a set of denoised titration solution images, and perform adaptive hue enhancement on the set of denoised titration solution images to obtain a set of titration solution images to be analyzed; Step S3: Integrate the dynamic characteristics of the dynamic change pattern of the solution color based on the set of titration solution images to be analyzed to obtain a set of solution dynamic characteristics; Step S4: Obtain historical titration experiment data, and construct a solution end state prediction model based on the set of solution dynamic characteristics and the historical titration experiment data; Step S5: Obtain a set of real-time titration solution images through a high-resolution camera; perform solution state prediction on the set of real-time titration solution images through the solution end state prediction model, and adjust the titration speed according to the solution state prediction result until the titration solution reaches the end state.

2. The method for judging the titration end point based on machine vision according to claim 1, characterized in that Specifically, step S1 is as follows: Step S11: Obtain a set of solution images during the titration process through a high-resolution camera; Step S12: Calculate the image area brightness based on the set of solution images during the titration process to obtain local image area brightness data; Step S13: Calculate the area brightness difference of the local image area brightness data, and calculate the image brightness compensation value according to the area brightness difference result; Step S14: Remove the surface light spots of the solution from the set of solution images during the titration process to obtain a set of de-spotted images; Step S15: Perform illumination transformation compensation on the set of de-spotted images according to the image brightness compensation value to obtain an initial set of titration solution images.

3. The method for judging the titration end point based on machine vision according to claim 2, characterized in that, Specifically, step S14 is as follows: Step S141: Extract the high-brightness image area characteristics based on the set of solution images during the titration process to obtain high-brightness image area characteristic data; Step S142: Identify the high-brightness difference area based on the area brightness difference result for the high-brightness image area characteristic data to obtain a set of light spot area images; Step S143: Perform local image bilinear interpolation substitution on the set of light spot area images to obtain a set of light spot area substitution images; Step S144: Perform Laplacian pyramid fusion of the set of light spot area substitution images and the set of solution images during the titration process to obtain a set of de-spotted images.

4. The method for judging the titration end point based on machine vision according to claim 1, characterized in that Specifically, the panoramic bilateral filtering edge noise removal in step S2 is as follows: Perform edge detection on the initial set of titration solution images to obtain titration solution edge data, and select seed pixels according to the titration solution edge data to obtain seed pixels; Calculate the similarity of the seed pixels, and perform image background segmentation on the initial set of titration solution images according to the seed pixel similarity result to obtain a set of titration solution foreground images and a set of titration solution background images; Identify the background random noise based on the set of titration solution background images to obtain background random noise characteristic data; Perform Gaussian filtering of the background noise on the set of titration solution foreground images according to the background random noise characteristic data to obtain a set of foreground images with background noise removed; Based on the seed pixel similarity results, identify the solution-container edge regions in the foreground image set of the titration solution to obtain the solution-container edge region image set; Perform bilateral filtering on the solution-container edge region image set to obtain the denoised image set of the solution-container edge region; According to the denoised image set of the solution-container edge region, replace the corresponding image regions in the foreground image set with background noise removed to obtain a multi-layer denoised image set; Perform adaptive histogram equalization on the multi-layer denoised image set to obtain the denoised titration solution image set.

5. The method for judging the titration end point based on machine vision according to claim 1, characterized in that The adaptive hue enhancement of the solution image set in step S2 is specifically as follows: Perform local area contrast-limited equalization on the denoised titration solution image set to obtain the secondarily equalized titration solution image set; Convert the color space of the secondarily equalized titration solution image set to obtain the titration solution HSV image set; Separate the color channels of the titration solution HSV image set to obtain the hue channel image set and the saturation channel image set; Perform joint enhancement of hue and saturation based on the hue channel image set and the saturation channel image set to obtain the titration solution image set to be analyzed.

6. The method for judging the titration end point based on machine vision according to claim 1, wherein, Step S3 is specifically as follows: Step S31: Extract the time series of the titration solution image set to be analyzed to obtain the time series data of the solution images; Step S32: Calculate the time derivative of the hue and the time derivative of the saturation of the time series data of the solution images to obtain the time derivative of the hue channel of the solution images and the time derivative of the saturation channel of the solution images; Step S33: Calculate the color change rate of the solution based on the time derivative of the hue channel of the solution images and the time derivative of the saturation channel of the solution images to obtain the color change rate data of the solution; Step S34: Perform temporal statistics on the color distribution of the solution images in the time series data of the solution images to obtain the temporal data of the color distribution of the solution; Step S35: Perform dynamic classification of the solution color change patterns based on the color change rate data of the solution and the temporal data of the color distribution of the solution to obtain the solution dynamic feature set.

7. The method for judging the titration end point based on machine vision according to claim 6, characterized in that, Step S35 is specifically as follows: Normalize the color change rate data of the solution and the temporal data of the color distribution of the solution to obtain the normalized color change rate data of the solution and the normalized temporal data of the color distribution of the solution; Perform sliding window dynamic trend analysis on the normalized color change rate data of the solution to obtain the color change trend data, and perform color change stage pattern recognition based on the color change trend data to obtain the color change stage pattern data; Based on the time derivative of the hue channel of the solution images and the time derivative of the saturation channel of the solution images, identify the rate peaks in the color change stage pattern data to obtain the turning point marked color change stage pattern data; Describe the evolution trend of the color distribution of the solution images in the temporal data of the color distribution of the solution with a Gaussian distribution to obtain the color distribution pattern data of the solution; Based on the turning point marked color change stage pattern data and the color distribution pattern data of the solution, perform stage pattern association of the solution color change patterns to obtain the titration stage pattern data of the solution; Obtain the historical titration stage experimental data, and set the color change rate threshold for the titration stage according to the historical titration stage experimental data; Using a predefined grading standard, and dynamically grading the solution titration stage mode data based on the color change rate threshold in the titration stage to obtain color change mode grading data; Summarize the feature sets of the color change mode grading data, and perform multi-dimensional data fusion on the summary results to obtain the solution dynamic feature set.

8. The method for judging the titration end point based on machine vision according to claim 1, characterized in that Step S4 is specifically as follows: Step S41: Obtain historical titration experiment data, and perform data preprocessing on the historical titration experiment data to obtain the historical titration experiment data to be analyzed; Step S42: Integrate the solution titration end state based on the historical titration experiment data to be analyzed to obtain the solution titration end state data; Step S43: Perform feature association based on the solution dynamic feature set and the solution titration end state data to obtain the solution titration state feature association data set; Step S44: Construct an initial solution end state prediction model according to the solution titration state feature association data set; Step S45: Use the historical titration experiment data to be analyzed to train the initial solution end state prediction model to obtain the solution end state prediction model.

9. The method for judging the titration end point based on machine vision according to claim 1, wherein Step S5 is specifically as follows: Step S51: Obtain a real-time titration solution image set through a high-resolution camera; Step S52: Perform data preprocessing on the real-time titration solution image set to obtain the real-time titration solution image set to be analyzed; Step S53: Integrate the time series features of the titration solution according to the real-time titration solution image set to be analyzed to obtain the time series feature data of the titration solution; Step S54: Predict the solution state of the time series feature data of the titration solution through the solution end state prediction model to obtain the predicted data of the titration solution state; Step S55: Adjust the parameters of the solution titration parameter group according to the predicted data of the titration solution state to obtain the optimized parameter group for the solution titration of the titration device, and transmit it to the control end of the solution titration device to execute the device control task; Step S56: Repeat steps S51 to S55 until the titration solution reaches the end state.

10. The method for judging the titration end point based on machine vision according to claim 9, wherein Step S55 is specifically as follows: Step S551: Obtain the solution titration parameter group of the titration device; Step S552: Extract the critical time of the solution end state according to the predicted data of the titration solution state to obtain the critical time data of the solution end state; Step S553: Quantify the influence of the titration parameters based on the solution titration parameter group of the titration device and the predicted data of the titration solution state to obtain the influence degree data of the titration parameters; Step S554: Optimize the titration parameters for the critical time data of the solution end state according to the influence degree data of the titration parameters to obtain the optimized parameter group for the solution titration of the titration device, and transmit it to the control end of the solution titration device to execute the device control task.

Citation Information

Cited By

  • Color titration identification method, system and equipment based on combined prediction model

    CN121010653A

  • Color titration recognition method, system, and device based on combined prediction model

    CN121010653B