Liquid refractive index measurement method based on light spot Gaussian morphological analysis and gradient boosting decision tree

By combining Gaussian spot morphology analysis with gradient boosting decision trees, the problems of high cost, large size, and difficulty in continuous liquid measurement of existing optical sensors in environmental monitoring are solved, realizing low-cost and high-precision liquid refractive index and concentration measurement.

CN121298718APending Publication Date: 2026-01-09FUDAN UNIVERSITY
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511518424.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-23
Publication Date
2026-01-09

AI Technical Summary

Technical Problem

Existing optical sensors are costly, bulky, and difficult to use for continuous liquid measurement and real-time data transmission in environmental monitoring.

Method used

A liquid refractive index measurement method based on Gaussian spot morphology analysis and gradient boosting decision tree is adopted. The method consists of a laser light source, a microfluidic lens and a CCD in the optical sensor structure, combined with data signal processing, to achieve real-time measurement of liquid refractive index.

Benefits of technology

It achieves low-cost, high-precision liquid refractive index measurement, can reflect liquid refractive index and concentration information in real time, and has good robustness and continuous measurement capability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121298718A_ABST
    Figure CN121298718A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of optical sensors, and particularly relates to a liquid refractive index measurement method based on light spot Gaussian morphological analysis and a gradient boosting decision tree. The optical sensor is composed of a laser light source, a microflow lens and a ccd. Performing fitting calculation on a picture on the ccd to obtain a light spot parameter so as to reflect the refractive index of the liquid; and the Ccd is connected with a computer through a usb interface to realize real-time sensing. The method specifically comprises the following steps: enhancing a sliding window signal of a video stream, extracting data intensity information, fitting a Gaussian model, dynamically estimating initial parameters, fitting a two-dimensional Gaussian model under a constraint condition, calculating and outputting a sensing characteristic quantity, and predicting the refractive index or concentration of liquid by utilizing a gradient boosting decision tree. According to the method, time average frame processing, threshold segmentation and fast Gaussian fitting are carried out on the Gaussian beam of the liquid, real-time fitting is carried out on six characteristic quantities of the Gaussian beam, and a gradient boosting decision tree algorithm is adopted, so that related information such as the refractive index and the concentration of the liquid can be reflected in real time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of optical sensor technology, and specifically relates to a detection method for optical sensors. Background Technology

[0002] Currently, mainstream optical sensors can be divided into resonant sensors and refractive sensors. Resonant sensors can be further divided into optical microcavities, photonic crystals, and surface plasmon resonance devices. While these sensors can achieve extremely high detection sensitivity, they rely on precise micro / nano fabrication processes and specific material selection. They also require wavelength-stable, monochromatic lasers, high-sensitivity photodetectors, and data acquisition and signal processing units, resulting in high costs and large sizes. Meanwhile, refractive index sensors, such as Abbe meters, struggle to achieve continuous liquid measurement and real-time data transmission.

[0003] To address the issues of cost, size, robustness, and continuous measurement faced by traditional optical sensors in environmental monitoring applications, this invention proposes a liquid refractive index measurement method based on Gaussian spot morphology analysis and gradient boosting decision tree. Summary of the Invention

[0004] The purpose of this invention is to overcome the limitations of existing optical sensors and provide a low-cost, high-precision method for measuring the refractive index of liquids by using a minimalist optical structure and data signal processing approach.

[0005] The liquid refractive index measurement method provided by this invention is based on Gaussian spot morphology analysis and gradient boosting decision tree technology, which involves an optical sensor whose structure consists of a laser source, a microfluidic lens, and a CCD. The spot parameters are obtained by fitting the image on the CCD to reflect the liquid refractive index. The CCD can be connected to a computer via a USB interface to achieve real-time sensing.

[0006] The sensing principle is as follows: When a Gaussian beam passes through a microlens, if the liquid has a low refractive index, the beam is deflected less, the focal point is farther from the microlens and closer to the CCD sensor, resulting in a smaller light spot on the CCD; if the liquid has a high refractive index, the beam is deflected more, the focal point is closer to the microlens and farther from the CCD sensor, resulting in a larger light spot on the CCD. Figure 2 As shown.

[0007] The specific relationship between the spot distribution q(z5) and the liquid refractive index n3 is calculated using the ABCD matrix theory (see: H. Kogelnik, "Imaging of optical modes—Resonators with internal lenses", Bell System Technical Journal, 1965, Vol. 44, pp. 455-494). Figure 3 As shown), it can be written as:

[0008]

[0009] Where n1 is the air refractive index, n2 and n3 are the refractive indices of the microbubble wall and the liquid inside the microbubble, respectively, d is the distance from the single-mode fiber to the microbubble wall, r and R represent the inner and outer diameters of the microbubble, respectively, and l represents the distance from the microbubble to the CCD. Therefore, the ABCD matrix of the overall structure can be written as:

[0010] M = M 45 ·M4·M 34 ·M3·M 23 ·M2·M 12 ·M1·M 01 (2)

[0011] The ABCD matrix is ​​the overall matrix.

[0012] When a Gaussian beam propagates from surface 0 to surface 5, it can be calculated using the formula:

[0013]

[0014] Where q(z) is a complex beam parameter with Gaussian parameters, describing the beam characteristics at any point on the z-axis along the beam propagation direction. z0-z5 represent surfaces 1-5, respectively;

[0015]

[0016] R(z) is the wavefront curvature radius, λ is the center wavelength, ω(z) is the spot radius, and n is the effective refractive index. By solving formula (1-4), the Gaussian spot parameters on the CCD can be calculated. Therefore, we can obtain the liquid refractive index information by calculating and analyzing the spot, and then calculate the liquid concentration.

[0017] The specific steps of the liquid refractive index measurement method are as follows:

[0018] (1) Video stream preprocessing and sliding window signal enhancement: For the input sensor video data stream, a sliding window is used to average consecutive video frames; the average value of multiple consecutive frames is taken to effectively suppress random noise in single-frame images and obtain time-averaged frames with high signal-to-noise ratio; providing a more stable data source with a higher signal-to-noise ratio for subsequent fitting. Specifically:

[0019] The system constructs a first-in, first-out (FIFO) frame queue in memory, with a queue length N that is a preset hyperparameter. As video frames are read in sequentially, this queue always maintains the N most recent frames in time. When the queue is full, the system performs pixel-by-pixel intensity averaging on all N frames in the queue. This operation generates a "temporally averaged frame," whose signal-to-noise ratio is significantly improved compared to any single frame. Subsequently, this time window slides forward one frame along the video stream (i.e., new frames are enqueued, old frames are dequeued), and the averaging process is repeated. All subsequent analysis steps are based on this high-quality "temporally averaged frame."

[0020] (2) Data Intensity Information Extraction: After obtaining a high signal-to-noise ratio time-averaged frame, the target region containing the sensor signal is automatically located. Specifically, the average frame is binarized using a preset pixel intensity threshold to generate a binary mask. In this mask, pixels with intensity higher than the threshold are identified as signal regions, while those lower than the threshold are considered background. The threshold is set to a value slightly larger than the grayscale value of a black background to filter background information.

[0021] Next, based on this mask, all pixels belonging to the signal region are extracted from the average frame. Specifically, a two-dimensional coordinate grid with the same size as the image is constructed, and the mask is used to filter out the x-coordinates, y-coordinates, and corresponding intensity values ​​(z) of all pixels within the signal region. These three sets of data constitute all the input data required for subsequent Gaussian model fitting. This step achieves unmanned, adaptive segmentation of the signal region.

[0022] (3) Gaussian model fitting: Specifically, Gaussian fitting is performed based on the pixel coordinates corresponding to the intensity information. The expression is as follows:

[0023]

[0024] Where x0 and y0 represent the center positions of the light spot, σ x , σ y The concentration of the light spot, i.e., the size of the light spot, is represented by ρ, which represents the correlation coefficient between x and y, used to represent the tilt of the light spot, and A represents the peak light intensity.

[0025] (4) Dynamic estimation of initial parameters;

[0026] To achieve fully automated fitting and avoid manually setting complex initial parameters, this invention proposes a dynamic estimation method for initial parameters. Before performing nonlinear least squares fitting, six initial parameters of the two-dimensional Gaussian model are automatically estimated: A, x0, y0, σ. x ,σ γ ,ρ:

[0027] Initial amplitude (A): The maximum intensity value of all pixels in the signal area is taken directly.

[0028] Initial center position (x0, y0): The centroid position of the light spot is estimated by calculating the intensity-weighted average coordinates of the pixels within the signal region.

[0029] Initial standard deviation (σ) x ,σ γ The size of the light spot is estimated by calculating the standard deviation of the coordinates of all pixels in the signal area in the x and y directions.

[0030] Initial correlation coefficient (ρ): Usually initialized to 0, indicating that the initial assumption is that the light spot is a regular ellipse with an inclination angle of 0.

[0031] For the second frame, the initial values ​​are fitted, and the fitting results from the previous frame are called to reduce computation time.

[0032] (5) Fitting the two-dimensional Gaussian model under constraints: Based on the estimated initial parameters, a nonlinear least squares method is used to fit the two-dimensional Gaussian function model to the data points in the signal region. To ensure that the fitting results conform to the actual physical meaning, boundary constraints are also applied to the model parameters. Specific constraints include: amplitude A must be positive; standard deviation σ x and σ γ It must be positive and greater than a very small threshold (such as 1e-6) to avoid model degradation; the correlation coefficient ρ must be in the interval (-1, 1).

[0033] Meanwhile, to improve the stability of numerical calculations, several protective measures were incorporated into the implementation of the Gaussian function. These measures include adding a small amount to the denominator to prevent division by zero, pruning the range of the correlation coefficient ρ, and limiting the range of input parameters for the exponential function. These measures ensure that the algorithm will not crash due to numerical overflow or undefined computation, even when dealing with extreme or critical data.

[0034] (6) Calculation and output of sensing features; after successful fitting, a set of optimal model parameters (A, x0, y0, σ) is obtained. x The parameters (σ, γ, ρ) precisely describe the physical shape of the signal spot. Subsequently, one or more characteristic quantities that can quantitatively characterize changes in the sensing signal are calculated based on these parameters. Preferably, the "half-height area parameter" S is calculated, and its formula is:

[0035]

[0036] Through σ x ,σ γ The half-height area (S) is used to calculate an indicator reflecting the refractive index. This area is directly related to the energy dispersion range of the signal spot and is a more stable and physically meaningful sensing indicator than simply peak intensity or pixel summation. The half-height area S can be used to reflect the refractive index or concentration information of a liquid.

[0037] And at the same time, we obtain six independent parameters of the Gaussian function: A, x0, y0, σ x ,σ γ ρ, as a multidimensional feature vector, is used for further data analysis;

[0038] In addition to the half-height area, the center coordinates (x0, y0), amplitude (A), and standard deviation (σ) are also obtained. x ,σ γ ), correlation coefficient ρ and other parameters.

[0039] (7) Predict the refractive index or concentration of liquid using gradient boosting decision tree; specifically, input the above multidimensional feature vectors into a pre-trained gradient boosting decision tree (GBDT) regression model.

[0040] The training process of the model is as follows: Step 1: After the above steps (1)-(6), the model is trained by calculating and outputting six parameters (A, x0, y0, σ) on a large number of samples with known refractive index or concentration. x ,σ γ Step 2: Input six parameters (A, x0, y0, σ) into the Gradient Boosting Decision Tree (GBDT) regression model. x ,σ γ The system trains on the correspondence between the six parameters (ρ) and the concentration to learn and capture the complex nonlinear relationship between the liquid refractive index or concentration.

[0041] Finally, by inputting the characteristic vector (A,x0,y0,σ) x ,σ γ ,ρ) to output a high-precision, high-stability refractive index or concentration prediction value.

[0042] This invention employs time-averaged frame processing, threshold segmentation, fast Gaussian fitting, and real-time fitting of six feature quantities of the Gaussian beam passing through the liquid, along with a subsequent gradient boosting decision tree algorithm, to reflect information such as the refractive index and concentration of the liquid in real time. Attached Figure Description

[0043] Figure 1 This is a flowchart illustrating the method of the present invention.

[0044] Figure 2 This is a schematic diagram of the sensing principle.

[0045] Figure 3 This is a schematic diagram of the experimental setup.

[0046] Figure 4 This is an example of a light spot pattern for measuring concentration according to the present invention.

[0047] Figure 5 This invention utilizes half-height area parameters to measure the concentration of salt solutions.

[0048] Figure 6 This invention utilizes individual parameters to measure sucrose solutions.

[0049] Figure 7 The original method used half-height area parameters to characterize liquid concentration. Detailed Implementation

[0050] The present invention will be further described below with reference to the embodiments and accompanying drawings.

[0051] In this embodiment, a Gaussian beam in a single-mode fiber passes through a hollow microlens that allows the liquid to be tested to pass through, and is imaged on a CCD. See the image below. Figure 2 For specific hardware details, please refer to CN220795008U. The specific steps for the imaging algorithm on a CCD are as follows:

[0052] 1. Video Stream Preprocessing and Sliding Window Signal Enhancement: In this embodiment of the invention, the input sensor video data stream is first read through the data interface. To overcome the interference of inherent random noise (such as photon noise, detector dark current, etc.) in single-frame images on signal analysis, a signal enhancement mechanism based on a sliding time window is proposed. The system constructs a first-in-first-out frame queue in memory, and its queue length N is a preset hyperparameter, for example, N=30.

[0053] As video frames are read in sequentially, the queue always maintains the N most recent frames in time. When the queue is full, the system performs pixel-by-pixel intensity averaging on all N frames in the queue. This operation generates a "temporally averaged frame," whose signal-to-noise ratio is significantly improved compared to any single frame. Subsequently, this time window slides forward one frame along the video stream (i.e., new frames are enqueued, and old frames are dequeued), and the averaging process is repeated. All subsequent analysis steps are based on this high-quality "temporally averaged frame."

[0054] 2. Data Intensity Information Extraction: After obtaining a high signal-to-noise ratio time-averaged frame, it is necessary to automatically locate the target region containing the sensor signal. In this embodiment, a preset pixel intensity threshold is applied to binarize the average frame to generate a binary mask. In this mask, pixels with intensity higher than the threshold are identified as signal regions, while those with intensity lower than the threshold are considered background.

[0055] Next, based on this mask, all pixels belonging to the signal region are extracted from the average frame. Specifically, a two-dimensional coordinate grid with the same size as the image is constructed, and the mask is used to filter out the x-coordinates, y-coordinates, and corresponding intensity values ​​(z) of all pixels within the signal region. These three sets of data constitute all the input data required for subsequent Gaussian model fitting. This step achieves unmanned, adaptive segmentation of the signal region.

[0056] 3. Rapid Fitting: To achieve fully automated fitting and avoid manually setting complex initial parameters, this invention proposes a dynamic estimation method for initial parameters. Before performing nonlinear least squares fitting, the six initial parameters of the two-dimensional Gaussian model are automatically estimated: A, x0, y0, σ. x ,σ γ ,ρ:

[0057] Initial amplitude (A): The maximum intensity value of all pixels in the signal area is taken directly.

[0058] Initial center position (x0, y0): The centroid position of the light spot is estimated by calculating the intensity-weighted average coordinates of the pixels within the signal region.

[0059] Initial standard deviation (σ) x ,σ γ The size of the light spot is estimated by calculating the standard deviation of the coordinates of all pixels in the signal area in the x and y directions.

[0060] Initial correlation coefficient (ρ): Usually initialized to 0, indicating that the initial assumption is that the light spot is a regular ellipse with an inclination angle of 0.

[0061] For the second frame, the initial values ​​are fitted, and the fitting results from the previous frame are called to reduce computation time.

[0062] 4. Fitting a Two-Dimensional Gaussian Model under Constraints: Based on the estimated initial parameters, a nonlinear least squares method is used to fit a two-dimensional Gaussian function model to the data points in the signal region. To ensure that the fitting results conform to the actual physical meaning, boundary constraints are also imposed on the model parameters. Specific constraints include: amplitude A must be positive; standard deviation σ... x and σ γ It must be positive and greater than a very small threshold (such as 1e-6) to avoid model degradation; the correlation coefficient ρ must be in the interval (-1, 1).

[0063] Meanwhile, to improve the stability of numerical calculations, several protective measures were incorporated into the implementation of the Gaussian function. These measures include adding a small amount to the denominator to prevent division by zero, pruning the range of the correlation coefficient ρ, and limiting the range of input parameters for the exponential function. These measures ensure that the algorithm will not crash due to numerical overflow or undefined computation, even when dealing with extreme or critical data.

[0064] 5. Calculation and output of sensing features: After successful fitting, a set of optimal model parameters (A, x0, y0, σ) is obtained. x ,σ γ The parameters ρ and ρ precisely describe the physical shape of the signal spot. Subsequently, one or more characteristic quantities that can quantitatively characterize changes in the sensing signal are calculated based on these parameters.

[0065] In this embodiment, the "half-height area parameter" S is preferably calculated, and its calculation formula is as follows: Through σ x ,σ γ The half-height area (FHM), an indicator reflecting refractive index, is calculated using ρ. This area is directly related to the energy dispersion range of the signal spot and is a more stable and physically meaningful sensing indicator than simply peak intensity or pixel summation. Figure 5 As shown. Figure 5 This invention utilizes half-height area parameters to measure salt solution concentration.

[0066] In addition to the half-height area, the output also includes the fitted center coordinates (x0, y0), amplitude (A), and standard deviation (σ). x ,σ γ ), correlation coefficient ρ and other parameters, such as Figure 6 As shown. Figure 6 This invention utilizes individual parameters for measuring sucrose solutions.

[0067] 6. Fault Tolerance and Data Continuity Guarantee: Considering that in practical applications, sensor signals may experience extremely poor data quality in certain time windows due to various reasons (such as momentary occlusion or weak signal), leading to Gaussian fitting failure, this invention designs a core fault tolerance and data completion mechanism to address this issue.

[0068] A variable is maintained in memory to store the model parameters that were successfully fitted in the previous time window. When the system encounters any anomalies during the fitting process of the current time window (such as algorithm non-convergence, invalid parameters, etc.), it does not simply set the data at that time point to null.

[0069] Instead, the system employs data imputation logic: using the valid parameters from the previous frame stored in the variable, it calculates various sensing metrics for the current time window. Simultaneously, a dedicated state bit (fitting state) is marked as 0 (indicating imputed data) in the output, distinguishing it from the normal fitting state of 1. This mechanism significantly enhances the method's robustness, ensuring that even with a brief deterioration in signal quality, a complete, continuous, and uninterrupted dynamic sensing curve is output.

[0070] 7. Construction of Structured Datasets

[0071] The model parameters (A, x0, y0, σ) can be collected from steps 1-6. x ,σ γ The relationship between concentration (A, ρ) and concentration can be constructed by measuring multiple sets of concentration solutions. x ,σ γ The database (ρ) corresponds to a relational database. The database is divided proportionally into training, validation, and test sets to prepare for subsequent training. This example uses 11 groups of DMSO solutions with concentrations ranging from 0-0.1% and a gradient of 0.01% as the dataset, and divides them into training, validation, and test sets at ratios of 0.7, 0.15, and 0.15.

[0072] 8. Feature Standardization

[0073] In sensing applications, multiple features (A, x0, y0, σ) extracted from preceding steps are used. x ,σ γ ,ρ) often have different dimensions and numerical ranges. To eliminate the adverse effects of this difference on model training (such as unstable gradient updates, model bias towards features with large numerical ranges), this invention includes an optional but recommended standard deviation scaling step.

[0074] This step involves processing all feature data (A, x0, y0, σ) from the training set. x ,σ γ The scaler transforms the data (ρ) to conform to a standard normal distribution with a mean of 0 and a variance of 1. Crucially, this scaler only fits the data from the training set, and then applies the learned transformation rules to both the training set and a separate validation set. This strictly adheres to the principle of preventing data leakage in machine learning. Furthermore, the trained scaler object is persistently stored so that the exact same preprocessing transformation can be applied when predicting new, unseen data in the future, ensuring consistency between the model's training and inference phases.

[0075] To improve training efficiency, after standardizing the data features, the standardized feature data and target values ​​are converted into DMatrix, a high-performance internal data structure unique to Gradient Boosting Decision Tree (GBDT) frameworks (such as XGBoost). This binary format optimizes memory usage and computation speed, especially when processing large-scale datasets.

[0076] Furthermore, the system constructed in this invention is highly configurable. All key hyperparameters of the model, such as the learning rate, maximum tree depth, and column sampling rate, are externalized and configured through a command-line parameter interface. This allows researchers to easily perform grid search or Bayesian optimization of multiple sets of hyperparameters to find the optimal model configuration without modifying the source code.

[0077] Figure 7 The left image shows the original method of using the half-height area parameter to characterize liquid concentration. Figure 7 The right image shows the concentration prediction using the gradient boosting decision tree algorithm. Compared to traditional methods, the gradient boosting decision tree has higher accuracy in measuring liquids with lower concentrations.

Claims

1. A method for measuring the refractive index of liquids based on Gaussian morphology analysis of light spots and gradient boosting decision trees, characterized in that, The specific steps are as follows: (1) Sliding window signal enhancement of video stream: For the input sensor video data stream, a sliding window is used to average consecutive video frames; the average value of multiple consecutive frames is taken to effectively suppress random noise in single frame images and obtain time-averaged frames with high signal-to-noise ratio. (2) Data intensity information extraction; After obtaining a time-averaged frame with a high signal-to-noise ratio, the target region containing the sensor signal is automatically located. Specifically, the average frame is binarized using a preset pixel intensity threshold to generate a binary mask. In this mask, pixels with intensity higher than the threshold are identified as signal regions, while those with intensity lower than the threshold are considered background. Based on this mask, all pixels belonging to the signal region are extracted from the average frame. Specifically, a two-dimensional coordinate grid with the same size as the image is constructed, and the mask is used to filter out the x-coordinate, y-coordinate, and corresponding intensity value z of all pixels within the signal region. These three sets of data constitute all the input data required for subsequent Gaussian model fitting. (3) Gaussian model fitting; Specifically, Gaussian fitting is performed based on the pixel coordinates corresponding to the intensity information, and the expression is: Where x0 and y0 represent the center positions of the light spot, σ x , σ y The concentration of the light spot, i.e., the size of the light spot, is represented by ρ, which represents the correlation coefficient between x and y, used to represent the tilt of the light spot, and A represents the peak light intensity. (4) Dynamic estimation of initial parameters; The six initial parameters of the two-dimensional Gaussian model are automatically estimated using a dynamic estimation method for initial parameters: A, x0, y0, σ. x ,σγ,ρ: Initial amplitude (A): directly take the maximum intensity value of all pixels in the signal area; Initial center position (x0, y0): The centroid position of the light spot is estimated by calculating the intensity-weighted average coordinates of the pixels within the signal region; Initial standard deviation (σ) x ,σ γ The size of the light spot is estimated by calculating the standard deviation of the coordinates of all pixels in the signal region in the x and y directions. Initial correlation coefficient (ρ): Initialized to 0, indicating that the initial assumption is that the light spot is a regular ellipse with an inclination angle of 0; For the second frame, the initial values ​​are fitted, and the fitting results from the previous frame are called to reduce computation time. (5) Fitting of a two-dimensional Gaussian model under constraints; Based on the estimated initial parameters, a two-dimensional Gaussian function model is fitted to the data points in the signal region using the nonlinear least squares method. To ensure that the fitting results conform to the actual physical meaning, boundary constraints are applied to the model parameters, including: amplitude A is positive; standard deviation σ... x and σ γ The correlation coefficient ρ is positive and greater than a very small threshold to avoid model degradation; the correlation coefficient ρ is in the interval (-1, 1). (6) Calculation and output of sensing characteristic quantities; After successful fitting, a set of optimal model parameters (A, x0, y0, σ) is obtained. x ,σ γ The parameters ρ precisely describe the physical shape of the signal spot; subsequently, one or more characteristic quantities that can quantitatively characterize changes in the sensing signal are calculated based on these parameters; including the calculation of the "half-height area parameter" S, whose calculation formula is: The area S is directly related to the energy dispersion range of the signal spot, and S can be used to reflect information about the refractive index or concentration of the liquid. And at the same time, we obtain six independent parameters of the Gaussian function: A, x0, y0, σ x ,σ γ ρ, as a multidimensional feature vector, is used for further data analysis; (7) Use gradient boosting decision trees to predict liquid refractive index or concentration; Specifically, the aforementioned multidimensional feature vectors are input into a pre-trained gradient boosting decision tree regression model; The training process of the model is as follows: Step 1: After the above steps (1)-(6), the model is trained by calculating and outputting six parameters (A, x0, y0, σ) on a large number of samples with known refractive index or concentration. x ,σ γ The second step is to input six parameters (A, x0, y0, σ) into the gradient boosting decision tree regression model. x ,σ γ The system trains the correspondence between the six parameters (ρ) and the concentration to learn and capture the complex nonlinear relationship between the liquid refractive index or concentration. Finally, by inputting the characteristic vector (A,x0,y0,σ) x ,σ γ ,ρ), outputs a high-precision, high-stability predicted value of refractive index or concentration.

2. The liquid refractive index measurement method according to claim 1, characterized in that, The sliding window signal enhancement of the video stream in step (1) specifically involves: constructing a first-in-first-out frame queue in the system memory, with a queue length N being a preset hyperparameter. As video frames are read in sequentially, the queue always maintains the N temporally nearest frame image data. When the queue is full, the system performs a pixel-by-pixel intensity averaging operation on all N frames in the queue. This operation generates a "temporally averaged frame," whose signal-to-noise ratio is significantly improved compared to any single frame image. Then, the time window slides forward one frame along the video stream and repeats the averaging process described above.

3. The liquid refractive index measurement method according to claim 1, characterized in that, In step (5), in order to improve the stability of numerical calculation, several protective measures are added to the implementation of the Gaussian function, including adding a small amount in the denominator to prevent division by zero, pruning the range of the correlation coefficient ρ, and limiting the range of the input parameters of the exponential function, so as to ensure that even when dealing with extreme or critical data, the algorithm will not crash due to numerical overflow or undefined calculation.

4. The liquid refractive index measurement method according to claim 1, characterized in that, This also includes fault tolerance and data continuity assurance, specifically: Considering that the sensor signal may have extremely poor data quality in certain time windows due to various reasons, thus causing Gaussian fitting to fail, a core fault-tolerance and data imputation mechanism is designed: A variable is maintained in memory to store the model parameters that were successfully fitted in the previous time window. When the system detects any anomalies during the fitting process of the current time window, the data imputation logic is activated: the valid parameters of the previous frame stored in the variable are used to calculate the various sensing indices of the current time window. At the same time, in the output results, there is a special state bit, namely the fitting state, which is marked as 0 to indicate data imputation, so as to distinguish it from the state 1 of normal fitting.

5. The liquid refractive index measurement method according to claim 1, characterized in that, This also includes the construction of a structured dataset, specifically, the model parameters (A, x0, y0, σ) can be collected through steps 1-6. x ,σ γ The relationship between concentration (A, ρ) and concentration can be constructed by measuring multiple sets of concentration solutions. x ,σ γ The corresponding relational database (ρ) is divided proportionally into training, validation, and test sets to prepare for subsequent training.

6. The liquid refractive index measurement method according to claim 1, characterized in that, It also includes 8-feature standardization processing, specifically, due to multiple features (A, x0, y0, σ) x ,σ γ To eliminate the potential adverse effects of these differences on model training, a feature standardization operation is designed, namely, using standard deviation scaling, to standardize all feature data (A, x0, y0, σ) in the training set. x ,σ γ The transformation is performed on the data (ρ) to make it conform to a standard normal distribution with a mean of 0 and a variance of 1. This operation only uses the data from the training set for fitting. The learned transformation rules are then applied to the training set itself and the independent validation set. The trained objects are persistently stored so that when predicting new and unseen data in the future, the exact same preprocessing transformation can be applied to ensure the consistency of the model during the training and inference phases.

Citation Information

Patent Citations

  • Microbubble lens sensing chip for liquid concentration detection and detection system

    CN220795008U