Method and system for measuring volume of liquid and meniscus in transparent container

By acquiring images of the meniscus from multiple angles and using a machine learning model to stitch and correct feature parameters, the problem of insufficient accuracy in the meniscus region during liquid volume measurement was solved, and high-precision liquid volume measurement was achieved.

CN121185384APending Publication Date: 2025-12-23CENT SOUTH UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511121060.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-12
Publication Date
2025-12-23

AI Technical Summary

Technical Problem

Existing vision-based liquid volume measurement methods suffer from insufficient accuracy and poor adaptability when dealing with meniscus regions, especially in the measurement of small volumes of liquid, where the error can reach 5% to 10%.

Method used

Images of the meniscus of a transparent container from multiple circumferential perspectives are collected, and a set of feature parameters of the meniscus is extracted to form a sequence of spliced ​​feature parameters. This sequence is then input into a pre-defined meniscus volume prediction model. The volume is predicted using machine learning models such as linear regression and random forest regression, and the predicted volume is corrected using the meniscus volume values.

Benefits of technology

It improves the accuracy of liquid meniscus volume prediction, reduces data redundancy, ensures image quality consistency and repeatability, enhances the system's automation and integration, and improves the accuracy of liquid volume measurement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121185384A_ABST
    Figure CN121185384A_ABST
Patent Text Reader

Abstract

The invention discloses a method and system for measuring the volume of liquid and meniscus in a transparent container, and the method comprises the steps: collecting meniscus images of a plurality of different circumferential visual angles of a to-be-measured transparent container, and extracting a corresponding meniscus feature parameter group from each meniscus image; splicing the liquid level characteristic parameter group of each meniscus image to form a spliced characteristic parameter sequence; and inputting the splicing characteristic parameter sequence into a preset meniscus volume prediction model to obtain the volume value of the liquid in the transparent container to be measured. According to the invention, prediction is carried out by extracting the meniscus characteristic parameter groups of different visual angles, so that the accuracy of liquid meniscus volume prediction can be greatly improved; and then a high-precision liquid meniscus volume value is adopted to correct an estimated volume value of the liquid in the to-be-detected transparent container, wherein the estimated volume value is output by the preset volume prediction model based on image detection, so that the precision of liquid volume prediction can be greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of non-contact measurement of liquid volume, in particular to a method and system for measuring the meniscus volume of liquid in a transparent container. BACKGROUND

[0002] In the field of chemical analysis, biopharmaceuticals and laboratory automation, non-contact measurement of liquid volume in a transparent container has important scientific value and industrial application prospects. Compared with traditional weighing method and contact sensor (such as capacitive or ultrasonic probe), optical measurement method based on machine vision has become the preferred solution for micro-liquid automated detection due to its non-invasive characteristics, system integration convenience and high throughput advantage.

[0003] Current mainstream visual measurement systems mostly use liquid level height as the core measurement basis. This method performs well when the liquid surface is stable and the container geometry is regular. However, this kind of technology generally has a neglected systematic defect: the meniscus region at the top of the container formed by the liquid surface tension and the solid-liquid interface wetting effect is not included in the volume calculation system. As an important representation of the gas-liquid-solid three-phase boundary, the three-dimensional morphology of meniscus is influenced by multiple factors such as liquid physical and chemical properties (such as viscosity, surface tension coefficient), container material (such as contact angle, surface energy) and environmental parameters (such as temperature, vibration), etc. It presents complex dynamic curved surface characteristics. At the level of optical imaging, this area often causes gray gradient, local shadow or optical distortion due to light refraction, edge diffraction and liquid surface curvature effect, making it difficult for traditional threshold-based image segmentation algorithms to accurately reconstruct its real space form. What's more critical is that most existing measurement systems directly exclude the meniscus region from the effective volume calculation, which introduces significant systematic negative bias. Theoretical analysis and experimental data show that in small volume (<1mL) liquid measurement, this error can account for 5%~10%. Although some research has tried to compensate by theoretical formula estimation, the modeling accuracy and adaptability are still insufficient due to the variable shape of meniscus. SUMMARY

[0004] The present application provides a method and system for measuring the meniscus volume of liquid in a transparent container, to solve the problem of insufficient precision and poor adaptability in handling the meniscus region of existing visual-based liquid volume measurement methods.

[0005] To solve the above technical problems, the technical solution provided by the present application is: A method for measuring the meniscus volume of liquid in a transparent container, comprising the following steps: Collecting multiple different circumferential view angle meniscus images of the transparent container to be measured, and extracting a corresponding meniscus feature parameter group from each meniscus image; splicing the meniscus feature parameter group of each meniscus image to form a spliced feature parameter sequence; inputting the spliced feature parameter sequence into a pre-set meniscus volume prediction model to obtain a meniscus volume value of the liquid in the transparent container to be measured.

[0006] Preferably, the meniscus feature parameter group includes multiple feature parameters, including but not limited to: information entropy, gray mean value, gray total sum and meniscus area; and / or The spliced image of the multiple different circumferential view angle meniscus images can cover the circumferential meniscus panorama of the transparent container to be measured.

[0007] Preferably, the extraction of the corresponding meniscus feature parameter from each meniscus image includes the following steps: The Canny edge detection operator is used to process the meniscus image, and then the Sobel convolution kernel is used to calculate the gradient amplitude of the processed meniscus image in the horizontal and vertical directions, and combined with non-maximum suppression and double threshold hysteresis processing, a continuous edge binary image with single-pixel width is generated; The vertical projection analysis method is used to scan the binary edge image column by column, and the coordinate positions of the first and last effective edge points in each column of the binary edge image are accurately located as the upper boundary and lower boundary of the corresponding meniscus, respectively; Based on the upper boundary and lower boundary of the meniscus, the meniscus image is segmented to obtain the meniscus feature map, and the corresponding meniscus feature parameter group is extracted based on the meniscus feature map.

[0008] Preferably, the meniscus feature parameter group of each meniscus image is spliced to form a spliced feature parameter sequence, specifically: Randomly combine the meniscus feature parameter groups of all meniscus images, and splice the meniscus feature parameter groups in the order of random combination to form a spliced feature parameter sequence; and / or The prediction model includes one or a combination of several of the linear regression prediction model, the support vector regression prediction model, the random forest regression prediction model and the neural network prediction model.

[0009] Preferably, the training label of the meniscus volume prediction model is a measured meniscus volume, and the acquisition of the measured meniscus volume includes the following steps: Obtaining a first image of the liquid in the transparent container to be measured, inputting the first image into a pre-set volume prediction model to obtain an estimated volume value of the liquid in the transparent container to be measured; An actual measured value of the liquid in the transparent container is obtained, and a difference between the actual measured value of the liquid in the transparent container and the estimated volume value of the liquid in the transparent container is taken as the actual measured meniscus volume.

[0010] A method for measuring the volume of liquid in a transparent container, comprising the following steps: A first image of the liquid in the transparent container to be measured is obtained, and the first image is input into a preset volume prediction model to obtain an estimated volume value of the liquid in the transparent container to be measured. The meniscus volume of the liquid in the transparent container to be measured is measured by using the above meniscus volume measurement method. The estimated volume value of the liquid in the transparent container to be measured is corrected by using the meniscus volume value to obtain a final volume value of the liquid in the transparent container to be measured.

[0011] A system for measuring the volume of liquid in a transparent container, comprising: An acquisition component for acquiring meniscus images of the liquid in the transparent container to be measured at different circumferential viewing angles; A data processing component for extracting a corresponding meniscus feature parameter group from each meniscus image, splicing the meniscus feature parameter group of each meniscus image to form a spliced feature parameter sequence, and inputting the spliced feature parameter sequence into a preset meniscus volume prediction model to obtain a meniscus volume value of the liquid in the transparent container to be measured.

[0012] Preferably, the acquisition component comprises: A rotating unit, an image acquisition unit, and a placement unit, wherein the placement unit is used for placing the transparent container to be measured. The image acquisition unit is arranged on the rotating unit, and the rotating unit rotates around the placement unit to drive the image acquisition unit to move to acquire meniscus images of the transparent container to be measured at different circumferential viewing angles.

[0013] Preferably, the rotating component comprises: A rotating base, a mounting portion fixed on the rotating base and rotating with the rotating base, a receiving cavity arranged in the middle of the mounting portion, the receiving cavity being used for fixing the placement platform, and an image acquisition unit mounted on the mounting portion, wherein a shooting viewing angle of the image acquisition unit is directed to the receiving cavity.

[0014] Preferably, the system further comprises a light supplement component arranged on the mounting portion and used for providing uniform backlight illumination for the transparent container to be measured. Preferably, the data processing component is further configured to acquire a first image of the liquid in the transparent container to be measured, input the first image into a preset volume prediction model to obtain an estimated volume value of the liquid in the transparent container to be measured, and correct the estimated volume value of the liquid in the transparent container to be measured by using the meniscus volume value to obtain a final volume value of the liquid in the transparent container to be measured. and / or The training label of the meniscus volume prediction model is a measured meniscus volume, which is a difference between a measured value of the liquid in the transparent container to be measured and the estimated volume value of the liquid in the transparent container to be measured.

[0015] The present application has the following advantages: 1. The present application acquires meniscus images of the transparent container to be measured at multiple different circumferential angles, extracts corresponding meniscus feature parameter groups from each meniscus image, splices the meniscus feature parameter groups of each meniscus image to form a spliced feature parameter sequence, and inputs the spliced feature parameter sequence into a preset meniscus volume prediction model to obtain a meniscus volume value of the liquid in the transparent container to be measured. The present application can greatly improve the accuracy of liquid meniscus volume prediction by extracting meniscus feature parameter groups at different angles for prediction, and can greatly improve the accuracy of liquid volume prediction by using a high-precision liquid meniscus volume value to correct the estimated volume value of the liquid in the transparent container to be measured output by the preset volume prediction model based on image detection.

[0016] 2. In the preferred solution, the present application constructs a multi-dimensional image feature extraction and screening mechanism, introduces Pearson correlation coefficient, Spearman rank correlation coefficient and feature stability index to quantitatively evaluate the feature effectiveness, and determines the optimal meniscus feature parameter group, i.e., information entropy, gray mean value, gray total sum and meniscus area, which can accurately measure the liquid volume value in the transparent container to be measured on the basis of reducing data redundancy.

[0017] 3. In the preferred solution, the present application designs an imaging structure of "fixed container, rotating camera and light source", which avoids the liquid surface disturbance problem caused by the traditional rotating container method, realizes the static freezing of the meniscus during the imaging process, and ensures the consistency and repeatability of the image quality.

[0018] 4. In the preferred solution, the present application has a compact overall structure of the measurement system, adopts a modular design concept, and cooperatively operates the rotating platform, image acquisition, light source control and data processing units, has good automation and integration, and is easy to deploy in actual systems such as laboratory automation and intelligent liquid distribution.

[0019] 5. In the preferred embodiment, the training label of the meniscus volume prediction model in the application is the difference between the measured value of the liquid in the transparent container to be measured and the estimated volume value output by the preset volume prediction model. The meniscus volume predicted by the meniscus volume prediction model trained with the training label is used to correct the liquid volume of the preset volume prediction model, and the correction accuracy is higher.

[0020] In addition to the purposes, features and advantages described above, the present application has other purposes, features and advantages. The present application will be further described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF DRAWINGS

[0021] The accompanying drawings, which form a part of this application, are intended to provide further understanding of the application, and the illustrative embodiments of the application and their description serve to explain the application. The accompanying drawings do not constitute an undue limitation on the scope of the application. In the drawings: Figure 1 is a structural diagram of a transparent container liquid volume measurement system according to an embodiment of the present application; Figure 2 is a flowchart of a method for measuring the meniscus volume of a liquid in a transparent container according to an embodiment of the present application; Figure 3 is a comparison scatter plot of the predicted values of the test set samples of different models under three characteristic inputs and the true meniscus volume according to an embodiment of the present application; Figure 4 is a comparison curve of the predicted volume and the true volume of the random forest meniscus compensation model according to an embodiment of the present application and an absolute error analysis diagram thereof. DETAILED DESCRIPTION

[0022] The embodiments of the present application will be described in detail below with reference to the accompanying drawings, but the present application can be implemented in various different ways as limited and covered by the claims.

[0023] Embodiment one: The present application discloses a transparent container liquid volume measurement system, comprising: The acquisition component is configured to acquire a plurality of meniscus images of the transparent container to be measured at different circumferential angles. The data processing component is configured to extract a corresponding set of meniscus feature parameters from each meniscus image, splice the set of meniscus feature parameters of each meniscus image to form a spliced feature parameter sequence, and input the spliced feature parameter sequence into a preset meniscus volume prediction model to obtain a liquid volume value in the transparent container to be measured.

[0024] The data processing component is further configured to acquire a first image of the liquid in the transparent container to be measured, input the first image into a preset volume prediction model to obtain an estimated volume value of the liquid in the transparent container to be measured, and correct the estimated volume value of the liquid in the transparent container to be measured by using the meniscus volume value to obtain a final volume value of the liquid in the transparent container to be measured. In a preferred embodiment, the training label of the meniscus volume prediction model is a measured meniscus volume, and the measured meniscus volume is a difference between a measured value of the liquid in the transparent container to be measured and the estimated volume value of the liquid in the transparent container to be measured.

[0025] In a preferred embodiment, the volume prediction model is a machine learning model, and methods such as linear regression, support vector regression (SVR), random forest regression, neural network, etc. can be used to predict the volume of the liquid.

[0026] In a preferred embodiment, to realize automatic acquisition, the acquisition component includes a rotating unit, an image acquisition unit, and a placing unit; the placing unit is configured to place the transparent container to be measured; The image acquisition unit is fixed on the rotating unit; the rotating unit rotates around the placing unit to drive the image acquisition unit to move to acquire the meniscus images of the transparent container to be measured at different circumferential angles.

[0027] In a preferred embodiment, the rotating component avoids the liquid surface disturbance problem caused by the traditional rotating container method, and includes: A rotating base, a mounting portion fixed on the rotating base and rotating with the rotating base, a receiving cavity is arranged in the middle of the mounting portion, the receiving cavity is configured to fix the placing platform, and an image acquisition unit is mounted on the mounting portion, and a shooting angle of the image acquisition unit is directed to the receiving cavity.

[0028] In a preferred embodiment, to avoid the interference of the light on shooting, a light supplement component is further included, and the light supplement component is arranged on the mounting portion and configured to provide uniform backlight illumination for the transparent container to be measured.

[0029] As a preferred embodiment in the present application, as shown in Figure 1As shown, the rotating unit is a hollow rotating table 3, the central accommodating cavity of which is a through-hole structure, capable of realizing 360° continuous or step-by-step rotation. The image acquisition unit 4 and the light supplement assembly 1 are both fixed on the outer edge region of the hollow rotating table 3; the light supplement assembly 1 is used for providing uniform backlight illumination; the light source is an LED area light source, the optical axis direction of which is opposite to the imaging optical axis of the image acquisition device 4. The image acquisition unit 4 is fixed on the hollow rotating table 3 and rotates synchronously with it, and is used for capturing the meniscus images of the transparent container from multiple angles. The hollow rotating table 3 is capable of realizing 360° continuous or step-by-step rotation, and is used for driving the image acquisition device 4 and the light source 1 to rotate around the container; it is driven by a servo motor and is equipped with a high-resolution angle encoder to realize high-precision angle positioning and controllable accurate rotation, so as to ensure that the image acquisition is strictly matched with the rotation angle. The placing unit (2) is arranged directly above the through hole of the hollow rotating table (3), and is used for fixing the transparent container, which does not participate in rotation.

[0030] The image acquisition unit of the embodiment is a standard visible light industrial camera (with a resolution of 1280x1080), and the lens is a 35mm fixed-focus lens. It is arranged opposite to the LED backlight light source module to form a penetrating backlight imaging structure. The camera has a shutter synchronization function, and can realize no trailing, multi-angle and timed image acquisition during rotation.

[0031] The data processing assembly 5 includes: an embedded controller module, which is used for receiving the control instructions issued by the man-machine interaction unit 6, and coordinating the motion control and synchronous triggering of the hollow rotating table 3 and the image acquisition unit 4; an image management and caching module, which is used for receiving the image data transmitted by the image acquisition unit 4, and performing numbering, classification, caching and format conversion; and an image processing interface module, which provides standardized image input for the back-end meniscus segmentation and volume estimation, and supports docking with an algorithm platform.

[0032] In a preferred scheme, the system further includes a man-machine interaction unit 6, including a touch display screen or a computing terminal, which is used for setting system parameters such as rotation angle, shooting frequency, image saving path, and providing a state monitoring interface.

[0033] By using the measuring device of the embodiment, the embodiment provides a meniscus volume measurement method of a liquid in a transparent container, as shown in the following steps: Figure 2 Step 1: The system sets the rotation angle range to 360°, the shooting interval angle to 10°, and the meniscus images of each reagent bottle at 36 different angles are acquired. During each acquisition process, the system is uniformly scheduled by the embedded controller to ensure that the rotation angle positioning and the camera triggering are strictly synchronized. In the embodiment, small-sized transparent reagent bottles with a range of 3ml are measured.

[0034] ​Step 2, meniscus region segmentation, for each image, an image segmentation algorithm is applied, an edge detection based accurate segmentation algorithm is adopted, first, the meniscus region is processed by using a Canny edge detection operator. The operator eliminates noise interference by Gaussian filtering preprocessing, then calculates the gradient amplitude of the image in the horizontal and vertical directions by using a Sobel convolution kernel, and generates a continuous edge binary image with a single-pixel width by combining non-maximum suppression and double-threshold hysteresis processing. After the edge detection is completed, the system scans the binary edge image column by column by using a vertical projection analysis method to accurately locate the coordinate positions of the first and last effective edge points in each column, and the two key points correspond to the upper boundary and lower boundary of the meniscus respectively. Based on the spatial distribution characteristics of these boundary points, a segmentation mask is constructed. The mask algorithm retains the original image pixel data between the upper and lower boundaries, while setting the non-target region to zero, realizing the accurate extraction of the meniscus region.

[0035] Step 3, image feature extraction, multiple structural and statistical image features are extracted from each segmented meniscus image, and the following structural and statistical image features are selected in this embodiment: meniscus area, sum of image gray values, mean of gray values, maximum of gray values, minimum of gray values, meniscus image barycenter, meniscus perimeter, aspect ratio of meniscus, number of boundary points, contrast (gray co-occurrence matrix), entropy of image.

[0036] The structural and statistical image feature calculation formulas are as follows: Meniscus area (non-zero pixel region): ; wherein, represents the pixel value of the i-th row and j-th column of the image; Sum of gray values: ; Mean of gray values: ; Maximum of gray values: ; Minimum of gray values: ; Barycenter: ; Perimeter: ; wherein, H and W are the height and width of the image respectively; Edge map obtained by Sobel operator processing.

[0037] Aspect ratio: ; wherein, , , are the horizontal and vertical spans of the minimum circumscribed rectangle respectively, is the maximum coordinate value in the horizontal direction of the minimum circumscribed matrix, is the minimum coordinate value in the horizontal direction of the minimum circumscribed matrix, The maximum coordinate value in the vertical direction of the minimum circumscribed matrix, The minimum coordinate value in the vertical direction of the minimum circumscribed matrix.

[0038] The number of boundary points: using the boundary tracking algorithm to extract the continuous boundary point coordinate sequence, then the total length of the boundary is approximately: , wherein is the coordinate value in the horizontal direction of the k+1th boundary point, is the coordinate value in the vertical direction of the k+1th boundary point, is the coordinate value in the horizontal direction of the kth boundary point, is the coordinate value in the vertical direction of the kth boundary point. Contrast (gray level co-occurrence matrix): Quantize the gray scale image to construct the gray level co-occurrence matrix , wherein represents the co-occurrence frequency of gray levels i and j; T is the synthesis of the occurrence frequency.

[0039] Information entropy: , wherein is the probability of the gray pair; is a very small constant to prevent , and the value is .

[0040] Step 4, feature evaluation and screening: in order to ensure that the features used for modeling have strong correlation and stability, an image feature evaluation system is constructed, and the following is calculated respectively: Pearson correlation coefficient ; used to measure the linear relationship between the image features and the true volume, the closer the value is to ±1, the stronger the linear correlation; the calculation formula is as follows: ; , wherein represents the feature value of the i th sample, represents the corresponding true volume value, and represent the mean of the features and the volume respectively, and n is the total number of samples.

[0041] Spearman rank correlation coefficient , used to evaluate the monotonic relationship between the features and the volume, even if they are not linear, the trend correlation can be identified, the closer the value is to ±1, the stronger the monotonic correlation. The calculation formula is as follows:

[0042] , wherein and are respectively​ and the rank of and the corresponding average rank.

[0043] Feature stability index , defined as 1 minus the standard deviation, is used to evaluate the volatility of the feature between samples, and the value closer to 1 indicates that the feature stability is higher. The calculation formula is as follows:

[0044] where σ represents the standard deviation of the feature value, and n is the sample size.

[0045] The three indicators are weighted and scored to select image features with higher scores. The formula is as follows:

[0046] The selection criteria are set as ≥ 0.8 to ensure that the selected features have high correlation, strong monotonicity, and good stability. Through this evaluation system, the most predictive feature combination can be effectively selected as the liquid level feature parameter group.

[0047] In this embodiment, 4 key features with the highest discriminability are selected from 11 candidate features as the liquid level feature parameter group, and the scoring results are shown in Table 1. According to the evaluation results, information entropy, gray mean, gray total, and meniscus area show significant advantages.

[0048] Table 1. Scoring of 11 features

[0049] Step 5: Construct a multi-angle feature dataset. Since the meniscus is a typical three-dimensional structure, it is difficult to accurately express its complete volume information with a single image. Therefore, a multi-view fusion strategy is adopted: for the same meniscus sample, the image features collected from 20 different angles are combined as a whole input sample. At the same time, to improve the model generalization ability and data volume, a data reorganization strategy is used to randomly arrange and combine the image features of the same meniscus at different angles, construct multiple input data, and form an enhanced dataset.

[0050] In this embodiment, we have 760 samples of the same reagent bottle, each sample has 50 images of different angles, and we use random sampling to expand 760 samples to 7600 samples, each sample has 20 images of different angles.

[0051] Step 6: Constructing a meniscus volume prediction model, based on the screened multi-angle image features, a multivariate input meniscus volume regression model is constructed. The model can use various machine learning methods, such as linear regression, support vector regression (SVR), random forest regression, neural network, etc., to fit the relationship between image features and real meniscus volume.

[0052] In this embodiment, the training label of the meniscus volume prediction model is the measured meniscus volume, and the measured meniscus volume is obtained by the following steps: Obtain the first image of the liquid in the transparent container to be measured, input the first image into the preset volume prediction model, and obtain the estimated volume value of the liquid in the transparent container to be measured; Obtain the measured value of the liquid in the transparent container to be measured, and the difference between the measured value of the liquid in the transparent container to be measured and the estimated volume value of the liquid in the transparent container to be measured is taken as the measured meniscus volume.

[0053] In this embodiment, linear regression model, random forest regression model, gradient boosting regression model, support vector machine regression model and neural network regression model are selected, and prediction models with single feature input, double feature input, three feature input and four feature input are trained respectively.

[0054] Wherein, the unified modeling data form is as follows:

[0055] Wherein, is the dimensional feature vector of the th sample (in this embodiment ), and is the corresponding real meniscus volume value. The feature matrix is constructed, and the target vector ; Linear regression prediction model: The least squares method is used to fit the linear relationship between the sample features and the volume value, and the regression model form is:

[0056] Wherein, is the regression coefficient, and we solve the optimal coefficient vector by the least squares method to minimize the residual sum of squares, that is:

[0057] In the implementation process, first, the feature matrix and the target vector Consistency check and preprocessing, including missing value imputation and standardization; then add a constant term to introduce the bias term; finally use the normal equation to solve the regression coefficient.

[0058] Random Forest Regression Prediction Model: Random Forest Regression Model is an ensemble learning method that builds multiple decision trees and takes the weighted average of their prediction results to improve model stability and prediction accuracy. The basic idea is to reduce variance and prevent overfitting through "Out-of-Bag" and "Feature Random Subset Selection".

[0059] Model training process as follows: Bootstrap Sampling with 200 times, each time sampling about 63.2% of the training data; Each time a regression tree is constructed using different samples, and each node of the tree finds the optimal split point among all features to minimize MSE; Set the termination condition as: the number of node samples is less than or equal to 5, or the MSE decrease is less than 10 -6 .

[0060] After all trees are constructed, the model gets the final output by averaging the prediction results of all trees: .

[0061] Where, is the number of decision trees, is the output of the i-th tree. In the prediction phase, the new sample will pass through each decision tree to get the predicted value, and the final output is the average of the predicted values of the 200 decision trees.

[0062] Gradient Boosting Regression Prediction Model: Gradient Boosting Regression Model Least Squares Boosting (LSBoost) iteratively optimizes the model's prediction ability by fitting residual errors. The model takes the residual error of the objective function as the new regression target, and in each iteration, a weak learner (regression tree) is constructed to modify the current model.

[0063] Model training process as follows: Initialize the prediction value , which is the sample mean; For the t-th iteration: 1, calculate the residual: ; 2, fit the residual Get the regression tree ; update the model: ; Where, is the learning rate (set to 0.01 in this study), and the total number of iterations is 1000.

[0064] Support Vector Regression (SVR) model: SVR is a kernel-based regression technique that can effectively handle high-dimensional, small-sample, and nonlinear problems. The core idea is to fit a regression function within an ε-insensitive tube in a high-dimensional feature space, ensuring that the prediction error of most training samples does not exceed the set value ε. The radial basis kernel function (RBF) is used to construct a nonlinear regression model, aiming to find the optimal hyperplane for the deviation while controlling the complexity of the model. The SVR objective function is: The penalty coefficient , is set through standardization to improve convergence efficiency, suitable for handling small-sample, high-dimensional feature regression problems.

[0065] Artificial Neural Network (ANN) regression model: This study designs a single-hidden-layer feedforward neural network (Feedforward Neural Network) with adaptive nonlinear modeling capability. The input layer has n nodes equal to the feature dimension, the hidden layer contains 10 neurons, and the activation function uses Sigmoid. The output layer has a single neuron with a linear activation function to output the predicted value. The loss function uses Mean Squared Error (MSE), and the training process uses the Levenberg-Marquardt optimization algorithm, which can efficiently approximate the second-order gradient information, with fast convergence speed, suitable for small-sample nonlinear regression, etc. The maximum iteration is 1000 or when the performance gradient is less than 10 -7 , the training stops.

[0066] Step 7: Model training and testing, divide the above constructed dataset into training set and test set according to the ratio of 8:2. Train the model and evaluate its prediction accuracy on the test set. The Mean Absolute Error (MAE), Mean Squared Error (MSE), Determination Coefficient (R 2 ), and Symmetric Mean Absolute Percentage Error (sMAPE) indicators can be used to evaluate the model performance, with the following calculation formulas:

[0067]

[0068]

[0069] .

[0070] where, ​yi represents the meniscus true volume of the i-th sample, y is the average value of all sample true volumes, yi represents the model-predicted meniscus volume, n represents the number of test samples. R^2>0.85 indicates that the model has strong interpretability.

[0071] In this embodiment, 7600 groups of samples are constructed, and 6080 groups are divided into a training set and 1520 groups into a test set.

[0072] After completing the model training, the reserved test data set (20% of the total sample amount) is used to verify the model performance. The test process uses the same feature engineering processing flow as the training phase, and the final evaluation index objectively reflects the actual application performance of the model. The performance evaluation index results of the linear regression model are shown in Table 2; the performance evaluation index results of the random forest regression model are shown in Table 3; the performance evaluation index results of the gradient boosting regression model are shown in Table 4; the performance evaluation index results of the support vector machine regression model are shown in Table 5; and the performance evaluation index results of the neural network regression model are shown in Table 6.

[0073] Table 2. Performance evaluation index results of the linear regression model

[0074] Table 3. Performance evaluation index results of the random forest regression model

[0075] Table 4. Performance evaluation index results of the gradient boosting regression model

[0076] Table 5. Performance evaluation index results of the support vector machine regression model

[0077] Table 6. Performance evaluation index results of the neural network regression model

[0078] Figure 3 The comparison relationship between the meniscus volume prediction results of the test set samples and the true values of the multiple regression models under three feature input conditions is shown. As can be seen from the figure, each model has good fitting ability, the prediction results are stable as a whole, and can effectively reflect the change trend of the meniscus volume. Among them, the random forest regression model performs best in multiple evaluation indexes (including MSE, R^2, MAE and sMAPE), and has higher comprehensive prediction accuracy and stability.

[0079] Based on the above analysis, the random forest regression model with three feature inputs is selected as the final model in this embodiment, which is applied to the prediction task of the total volume of the transparent reagent bottle.Figure 4 The performance of the model in reagent bottle volume measurement is shown: the left graph is the correspondence between the model predicted volume and the true volume, and the right graph is the trend analysis of the prediction error with the true volume. From the results, it can be seen that, in the case of considering meniscus compensation, the model prediction value is highly consistent with the true value, the prediction error is small as a whole, and the fluctuation range is significantly better than the non-compensation method, which verifies the effectiveness and advantage of the proposed method in micro-liquid measurement.

[0080] In addition, in the embodiment, a volume measurement method of liquid in a transparent container is also provided, characterized in that the method comprises the following steps: A first image of the liquid in the transparent container to be measured is acquired, and the first image is input into a preset volume prediction model to obtain a predicted volume value of the liquid in the transparent container to be measured; The meniscus volume value of the liquid in the transparent container to be measured is measured by using the meniscus volume measurement method; The predicted volume value of the liquid in the transparent container to be measured is corrected by using the meniscus volume value, to obtain a final volume value of the liquid in the transparent container to be measured.

[0081] In summary, the present application collects meniscus images of the transparent container to be measured at multiple different circumferential angles, and extracts a corresponding meniscus feature parameter group from each meniscus image; the liquid surface feature parameter group of each meniscus image is spliced to form a spliced feature parameter sequence; the spliced feature parameter sequence is input into a preset meniscus volume prediction model to obtain a meniscus volume value of the liquid in the transparent container to be measured. The present application can greatly improve the accuracy of liquid meniscus volume prediction by extracting meniscus feature parameter groups at different angles for prediction, and then using a high-precision liquid meniscus volume value to correct the predicted volume value of the liquid in the transparent container to be measured output by the preset volume prediction model based on image detection, which can greatly improve the accuracy of liquid volume prediction.

[0082] The above only describes the preferred embodiments of the present application and is not intended to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A method for measuring the meniscus volume of a liquid in a transparent container, characterized in that, Includes the following steps: Multiple images of the meniscus of the transparent container under test from different circumferential perspectives are acquired, and corresponding sets of meniscus feature parameters are extracted from each image. The liquid surface feature parameter sets of each image are spliced ​​together to form a spliced ​​feature parameter sequence. The spliced ​​feature parameter sequence is input into a preset meniscus volume prediction model to obtain the meniscus volume value of the liquid in the transparent container under test.

2. The method for measuring the meniscus volume of liquid in a transparent container according to claim 1, characterized in that, The set of feature parameters for the meniscus includes multiple feature parameters, including but not limited to: information entropy, mean gray value, sum of gray values, and area of ​​the meniscus region. and / or The stitched image of the meniscus from multiple different circumferential perspectives can cover the entire circumferential meniscus of the transparent container under test.

3. The method for measuring the meniscus volume of liquid in a transparent container according to claim 1, characterized in that, The step of extracting the corresponding meniscus feature parameters from each meniscus image includes the following steps: The Canny edge detection operator is used to process the meniscus image, and the Sobel convolution kernel is used to calculate the gradient magnitude of the processed meniscus image in the horizontal and vertical directions. Combined with non-maximum suppression and double threshold hysteresis processing, a continuous edge binary map with a single pixel width is generated. The vertical projection analysis method is used to scan the binary edge map column by column to accurately locate the coordinates of the first and last valid edge points in each column of the binary edge map, which are used as the upper and lower boundaries of the corresponding meniscus, respectively. The meniscus image is segmented based on the upper and lower boundaries of the meniscus to obtain the meniscus feature map, and the corresponding meniscus feature parameter set is extracted based on the meniscus feature map.

4. The method for measuring the meniscus volume of liquid in a transparent container according to claim 1, characterized in that, The liquid surface feature parameter groups of each meniscus image are concatenated to form a concatenated feature parameter sequence, specifically: The liquid surface feature parameter groups of all the meniscus images are randomly combined and spliced ​​together in the order of random combination to form a spliced ​​feature parameter sequence. and / or The prediction model includes one or a combination of several of the following: linear regression prediction model, support vector regression prediction model, random forest regression prediction model, and neural network prediction model.

5. The method for measuring the meniscus volume of liquid in a transparent container according to claim 1, characterized in that, The training label for the meniscus volume prediction model is the measured meniscus volume. The acquisition of the measured meniscus volume includes the following steps: A first image of the liquid inside the transparent container to be tested is acquired, and the first image is input into a preset volume prediction model to obtain the estimated volume value of the liquid inside the transparent container to be tested. Obtain the measured value of the liquid inside the transparent container to be tested, and take the difference between the measured value of the liquid inside the transparent container to be tested and the estimated volume value of the liquid inside the transparent container to be tested as the measured meniscus volume.

6. A method for measuring the volume of liquid in a transparent container, characterized in that, Includes the following steps: A first image of the liquid inside the transparent container to be tested is acquired, and the first image is input into a preset volume prediction model to obtain the estimated volume value of the liquid inside the transparent container to be tested. The meniscus volume of the liquid in the transparent container to be tested is measured using the meniscus volume measurement method according to any one of claims 1-5. The estimated volume of the liquid in the transparent container to be tested is corrected by the meniscus volume value to obtain the final volume of the liquid in the transparent container to be tested.

7. A transparent container liquid volume measurement system, characterized in that, include: The acquisition component is used to acquire images of the curved surface of the transparent container under test from multiple different circumferential perspectives; The data processing component is used to extract the corresponding set of meniscus feature parameters from each meniscus image; to stitch together the liquid surface feature parameter sets of each meniscus image to form a stitched feature parameter sequence; and to input the stitched feature parameter sequence into a preset meniscus volume prediction model to obtain the meniscus volume value of the liquid in the transparent container to be tested.

8. The transparent container liquid volume measurement system according to claim 7, characterized in that, The acquisition component includes: The system includes a rotation unit, an image acquisition unit, and a placement unit; the placement unit is used to place the transparent container to be tested. The image acquisition unit is mounted on the rotating unit; the rotating unit rotates around the placement unit to drive the image acquisition unit to move, so as to acquire images of the meniscus of the transparent container under test from different circumferential perspectives.

9. The transparent container liquid volume measurement system according to claim 8, characterized in that, The rotating component includes: A rotating base, a mounting part fixed on the rotating base and rotating with the rotating base, a receiving cavity provided in the middle of the mounting part, the receiving cavity being used to fix the placement platform, an image acquisition unit mounted on the mounting part, the shooting angle of the image acquisition unit facing the receiving cavity.

10. The transparent container liquid volume measurement system according to claim 9, characterized in that, It also includes a supplementary lighting component, which is disposed on the mounting part and is used to provide uniform backlight illumination to the transparent container under test.

11. The transparent container liquid volume measurement system according to any one of claims 6-9, characterized in that, The data processing component is also used to acquire a first image of the liquid inside the transparent container to be tested, input the first image into a preset volume prediction model to obtain the estimated volume value of the liquid inside the transparent container to be tested, and correct the estimated volume value of the liquid inside the transparent container to be tested with the meniscus volume value to obtain the final volume value of the liquid inside the transparent container to be tested. and / or The training label for the meniscus volume prediction model is the measured meniscus volume, which is the difference between the measured value of the liquid in the transparent container and the estimated volume of the liquid in the transparent container.