Multi-channel quantitative detection device and detection method for fluorine ions in water
By constructing regression and fitting equations in the fluoride ion detection device in water, using logistic regression model combined with the illumination intensity value of the colorimetric tube, the accuracy and efficiency of determining the fluoride ion concentration in water in the prior art is solved, and low-cost Quick detection effect.
Patent Information
- Application Number
- CN202411134623.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-19
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2044-08-19
AI Technical Summary
The existing technology lacks low-cost and fast and accurate methods for determining fluorine ion concentrations in water. Conventional methods such as ion chromatography, ion selection electrode method and spectrophotometry are expensive in instruments, long detection time, low accuracy or large workload. question.
A multi-channel quantitative detection device is designed, including a closed box, a backlight plate and a shooting device. By constructing regression equations and fitting equations, the logistic regression model is used to combine the light intensity value of the colorimetric tube to achieve the fluorine ion concentration in water. Quick detection.
It realizes low-cost, fast and high-accuracy fluorine ion concentration detection in water, simplifies the detection process, reduces learning costs and equipment costs, and can detect multiple samples at the same time, improving detection efficiency.
Smart Images

Figure CN119086461A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a water quality detection device and a detection method thereof, in particular to a multi-channel quantitative detection device and a detection method for fluoride ions in water Background Art
[0002] At present, the conventional methods for determining fluoride ions in water are ion chromatography, ion selective electrode method, single wavelength spectrophotometry, and dual wavelength spectrophotometry in GB / T 5750.5. Among them, ion chromatography requires expensive instruments; the ion selective electrode method requires a long time for equilibrium during actual detection, which is not suitable for the detection of a large number of samples; the accuracy and precision of the single wavelength spectrophotometry are relatively poor; the dual wavelength spectrophotometry has high accuracy, but it needs to measure the absorbance at two different wavelengths, which is a lot of work. In general, the existing national standard determination methods do not have a low-cost method that can quickly and accurately determine the concentration of fluoride ions. Summary of the invention
[0003] Purpose of the invention: The purpose of the present invention is to provide a low-cost multi-channel quantitative detection device and detection method for fluoride ions in water that can quickly and accurately determine the concentration of fluoride ions.
[0004] Technical solution: The multi-channel quantitative detection device for fluoride ions in water described in the present invention includes a closed box, a backlight panel is provided on one side of the box, a shooting device is provided on the opposite side, and a test tube rack for placing multiple colorimetric tubes side by side is provided between the backlight panel and the shooting device.
[0005] Preferably, the colorimetric tubes placed on the test tube rack are spaced evenly apart.
[0006] The quantitative detection method of the present invention comprises the following steps:
[0007] S1. photograph the backlight panel behind the test tube rack under different luminous intensities of the backlight panel, decompose all the photos according to the three color channels of RGB, and establish a regression equation for calculating the corrected light intensity value according to the measured light intensity value under each color channel;
[0008] S2. When the backlight panel sets the luminous intensity, place the colorimetric tube containing the solution on a test tube rack and take a photo. Decompose the photo according to the three color channels of RGB, and establish a first fitting equation for calculating the predicted light intensity value according to the position in each color channel.
[0009] S3, replacing the predicted light intensity value obtained in step S2 with the measured light intensity value of the position in step S1 to calculate the corrected light intensity value of each position in the photo;
[0010] S4, obtaining the calibrated light intensity values of all positions of each colorimetric tube at multiple luminous intensities according to steps S2 and S3 using multiple colorimetric tubes filled with solutions of different known fluoride ion concentrations, and using the values as input values to train the logistic regression model;
[0011] S5, placing a plurality of colorimetric tubes containing different water samples to be tested and different known fluoride ion concentrations in batches on a test tube rack and photographing them, obtaining a calibrated light intensity value according to steps S2 and S3, substituting the value into a logistic regression model and taking the output result as the weight value of the fluoride ion concentration in step S4 for weighted averaging to obtain a predicted fluoride ion concentration value;
[0012] S6. Construct a second fitting equation based on the known fluoride ion concentration value of the solution in step S5 and its predicted fluoride ion concentration value, and obtain the fluoride ion concentration of the water sample to be tested based on the predicted fluoride ion concentration value of the water sample and the second fitting equation.
[0013] By first constructing a regression equation in step S1, and calculating the corrected light intensity value based on the measured light intensity value of the backlight panel, the influence of the deviation between the actual light intensity and the theoretical light intensity at different light intensities caused by the quality problem of each light-emitting point of the backlight panel itself can be reduced, and the influence of the distortion caused by the different Euclidean distances between each point of the backlight panel and the camera lens on the result can also be reduced;
[0014] Then, the first fitting equation is constructed through step S2, and the predicted light intensity value at each colorimetric tube is calculated according to the position of the position. The fitting can reduce the adverse effects of distortion and other problems caused by different Euclidean distances from different positions of the colorimetric tube to the camera lens on the results. The predicted light intensity value at the edge of the colorimetric tube can also be calculated through the first fitting equation, so as to avoid the sharp decrease of the measured light intensity value due to the increase of the glass thickness at the edge of the colorimetric tube, which cannot be used as effective data for training the logistic regression model. In addition, the first fitting equation can also calculate the predicted light intensity value outside the colorimetric tube to increase the amount of data used for training the logistic regression model and improve the accuracy of the final logistic regression. Substituting the predicted light intensity value calculated in step S2 into the regression equation of step S1 can further reduce the influence of the backlight on the detection result.
[0015] In step S5, the solutions containing known fluoride ion concentrations and the water samples to be tested are placed in batches on a test tube rack and photographed. While ensuring that multiple water samples to be tested can be tested at a time, the solutions with known fluoride ion concentrations are used as reference corrections for the same testing environment, which can avoid changes in the testing environment from step S4 during actual testing and affect the experimental results. The second fitting equation constructed in step S6 can be used to calculate the known fluoride ion concentration value from the predicted fluoride ion concentration value, and for the water samples to be tested, this known fluoride ion concentration value is the corrected fluoride ion concentration value. The second fitting equation can further reduce the influence of various possible factors on the test results, thereby improving the accuracy of the final test.
[0016] The entire technical solution trains a logistic regression model through steps S1-S4, and the trained logistic regression model can be directly used for subsequent detection. The detection only requires placing a colorimetric tube containing a sample to be tested and a solution with a known fluoride ion concentration in a device and taking a photo. Subsequently, the corrected light intensity value is obtained through steps S2 and S3 and input into the logistic regression model. The process of constructing a second fitting equation based on the output result can be completed with the assistance of a computer, and the accurate fluoride ion concentration to be tested can be obtained without a large number of manual calculations. The actual detection process is simple, fast, and highly accurate.
[0017] Preferably, the regression equation in step S1 is:
[0018]
[0019] Among them, Y (x,y,c) is the corrected light intensity value of the backlight panel when the color channel is c at the photo position (x, y), ranging from 0 to 255; I (x,y,c) is the measured light intensity value of the backlight panel when the color channel is c at the photo position (x, y), and α, β, and γ are all parameters to be fitted.
[0020] Preferably, the distance from the axis of the colorimetric tube to its edge is p, and half of the distance between the opposite sides of adjacent colorimetric tubes on the test tube rack is q. Step S2 cuts out the area within the distance S from both sides of each colorimetric tube to its axis for separate processing, where S=p+q.
[0021] By cutting out each colorimetric tube from the area within the specified distance from the axis for separate processing, the influence between adjacent colorimetric tubes can be avoided when constructing the fitting equation later; and the above distance can ensure that the area cut out by each colorimetric tube is equal.
[0022] Preferably, the distance from the edge of each colorimetric tube image intercepted in step S2 to the axis of the colorimetric tube is the sum of p and q of the colorimetric tube at the center of the original photo.
[0023] Because the different Euclidean distances from each colorimetric tube to the camera lens will cause distortion, the sum of p and q of each colorimetric tube, that is, the S value, will be different. Unifying the S values of all colorimetric tubes to the S value of the colorimetric tube at the center of the original photo can reduce the impact of this distortion on the final detection result.
[0024] Preferably, the fitting equation in step S2 is:
[0025]
[0026] Among them, T (n,h,l,c) is the predicted light intensity value of the nth colorimetric tube at a height of h, a distance of l from the axis of the colorimetric tube, and a color channel of c, μ and is the parameter to be fitted; l satisfies the condition l<3 / 4p;
[0027] The predicted light intensity value T in the range of 0≤l≤S is calculated by formula (2) (n,h,l,c) .
[0028] Preferably, the fitting equation in step S6 is:
[0029] F=kM+ξ
[0030] Wherein, F is the predicted fluoride ion concentration value, M is the known fluoride ion concentration value, and k and ξ are the parameters to be fitted.
[0031] Preferably, in step S4, the difference between adjacent fluoride ion concentrations in solutions with different known fluoride ion concentrations is within a set range.
[0032] When the difference between adjacent fluoride ion concentrations is within the set range, it can be considered that the fluoride ion concentration changes linearly, so the fluoride ion concentration value can be predicted by weighted average calculation based on the probability value output by logistic regression.
[0033] The quantitative detection method of the present invention comprises the following steps:
[0034] S1. photographing the backlight panel at different luminous intensities, and decomposing all the photos according to the three color channels of RGB, and establishing a regression equation for calculating the corrected light intensity value according to the measured light intensity value under each color channel;
[0035] S2, substituting the measured light intensity values at all positions measured by multiple colorimetric tubes containing solutions with different known fluoride ion concentrations at multiple different luminous intensities into the regression equation of step S1 to obtain a corrected light intensity value, and using it as an input value to train a logistic regression model;
[0036] S3, placing a plurality of colorimetric tubes containing different water samples to be tested and solutions with different known fluoride ion concentrations in batches on a test tube rack for photographing, substituting the measured light intensity value into the regression equation of step S1 to obtain a corrected light intensity value, substituting the value into the logistic regression model and taking the output result as the weight value of the fluoride ion concentration in step S2 for weighted averaging to obtain a predicted fluoride ion concentration value;
[0037] S4. Construct a second fitting equation based on the known fluoride ion concentration value of the solution in step S3 and its predicted fluoride ion concentration value, and obtain the fluoride ion concentration of the water sample to be tested based on the predicted fluoride ion concentration value of the water sample and the second fitting equation.
[0038] Based on the above technical solution, the regression equation constructed in step S1 reduces the error of the measured light intensity value caused by the quality of the backlight plate itself and the different distances from each point to the camera lens. The corrected light intensity value obtained by the regression equation is input into the logistic regression model for training, thereby improving the recognition accuracy of the logistic regression model. In actual detection, the solution with known fluoride ion concentration and the water sample to be tested are tested in batches, and the second fitting equation is constructed to reduce the impact of changes in the detection environment on the results. The regression equation is combined with the second fitting equation to improve the accuracy of the detection results. After the logistic regression model is trained, the subsequent detection only needs to put the water sample to be tested into the detection device and take a picture to obtain the fluoride ion concentration value. The regression equation and the second fitting equation can also be constructed with the assistance of a computer program without the need for manual calculation and construction. The entire detection method is simple, fast and highly accurate.
[0039] Beneficial effects: Compared with the prior art, the present invention has the following significant effects: 1. By first constructing a regression equation of the backlight panel, the influence of the backlight panel on the result can be reduced. By constructing the first fitting equation, not only a more accurate light intensity value can be obtained, but also the amount of data used for training the logistic regression model can be expanded, thereby improving the accuracy of the logistic regression model; constructing the second fitting equation can further improve the fluoride ion concentration detection result; the above processes are combined to ensure the accuracy of the detection, and the actual detection process only needs to be done by taking pictures, and the remaining calculation process can be completed by computer assistance, which is simple, fast and accurate; 2. The user has a low learning cost, does not require high-end instruments and complex synthesis methods, and the equipment cost is extremely low; 3. Multiple colorimetric tubes can be placed on the test tube rack for taking pictures, and the regression equation and the first fitting equation reduce the influence of different positions on the detection results, so that multiple samples can be detected at the same time, greatly improving efficiency; 4. Compared with the spectrophotometric method, it does not need to be poured into a colorimetric dish, and the colorimetric tube is directly measured, which is almost unaffected by the change of light intensity within the appropriate light intensity range. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 It is a structural schematic diagram of the device;
[0041] Figure 2 It is a schematic diagram of placing multiple colorimetric tubes on a test tube rack;
[0042] Figure 3 It is a curve diagram showing the relationship between the distance from the measuring point of the colorimetric tube to the axis and the measured light intensity value;
[0043] Figure 4 is a graph of the first fitting equation. DETAILED DESCRIPTION
[0044] As shown in the figure, the multi-channel quantitative detection device for fluoride ions in water described in the present invention includes a closed box 1, a backlight panel 2 is provided on one side of the box 1, a shooting device 3 is provided on the opposite side, and a test tube rack 4 is provided between the backlight panel 2 and the shooting device 3; the box 1 is provided with an openable and closable cover for conveniently taking out the colorimetric tube 5.
[0045] The backlight panel 2 can adjust the brightness, and the shooting device 3 uses a camera with fixed parameters such as resolution, exposure, contrast, and color temperature; the test tube rack 4 has multiple holes for placing multiple test tubes at the same time, so that multiple water samples to be tested can be measured at the same time, and the spacing between adjacent holes of the test tube rack is equal; when adjusting the brightness of the backlight panel 2, a more precise adjustment can be made in conjunction with the illuminance meter. When in use, the illuminance meter probe is close to the surface of the backlight panel, but is not within the field of view of the camera shooting the test tube rack, and the device is removed after use.
[0046] Before describing in detail the quantitative detection method of the present invention, it is first explained that the pretreatment of all water samples in this method is carried out in accordance with the pretreatment method of water samples by dual-wavelength coefficient multiplication fluorine reagent spectrophotometry in GB / T 5750.5-2023; after pretreatment, multiple water samples to be tested are loaded into a colorimetric tube, and alizarin complex ketone (fluorine reagent), buffer solution, lanthanum nitrate, and acetone solution are added in sequence to mix and obtain a color developing solution. The above process is the same as the prior art.
[0047] The quantitative detection method of the present invention specifically comprises the following steps:
[0048] S1, backlight panel data preprocessing, specifically including the following steps:
[0049] S1.1. Adjust the luminous intensity of the backlight panel to more than 5 levels within the appropriate luminous intensity range for detecting fluoride ions, and take photos of the backlight panel at different luminous intensities (at this time, no colorimetric tube is inserted into the test tube rack), intercept the backlight panel area behind the test tube rack in the above photos, decompose the color of the area according to the three RGB color channels, and obtain the RGB value of each coordinate on the picture.
[0050] S1.2, for each point in the image obtained in step S1.1, a regression equation is established in the R, G and B channels to obtain relevant parameters. The regression equation is preferably a quadratic equation, specifically:
[0051]
[0052] Among them, Y (x,y,c) is the corrected light intensity value of the backlight panel when the color channel is c at the position (x, y) on the image, and the value range is 0 to 255; I (x,y,c) is the measured light intensity value of the backlight panel when the color channel is c at the photo position (x, y), and α, β, and γ are all parameters to be fitted.
[0053] Formula (1) is equivalent to taking photos of each point on the backlight panel at different luminous intensities, measuring the actual luminous intensity value of each point, and then fitting it with the theoretical luminous intensity value under the luminous intensity to obtain a regression equation to more accurately reflect the actual luminous intensity value of the backlight panel under a certain measured luminous intensity value, that is, the corrected luminous intensity value, thereby reducing the influence of the backlight panel itself and the distance between each point and the camera lens on the actual luminous intensity value of the backlight panel, thereby reducing the influence on the detection result.
[0054] S2. When the backlight panel sets the luminous intensity, a colorimetric tube containing the solution is placed on a test tube rack to take a photo, and the photo is decomposed according to the three color channels of RGB, and a first fitting equation for calculating the predicted light intensity value according to the position is established under each color channel; specifically, the following sub-steps are included:
[0055] S2.1. Select a fixed luminous intensity within the appropriate luminous intensity range for detecting fluoride ion concentration. It is best to select the strongest luminous intensity within the luminous intensity range. Place the colorimetric tubes containing the solution on a test tube rack and take photos. Then separate each colorimetric tube and the surrounding set area and process them separately.
[0056] The area is set as the area within the distance S from the axis of the colorimetric tube on both sides, S = p + q, where p is the distance from the axis of the colorimetric tube to its edge, and q is half of the distance between the relative edges of two adjacent colorimetric tubes. This area actually also includes the colorimetric tube itself; and because the Euclidean distance from each colorimetric tube to the camera lens in the photo is different, it will cause certain distortion, resulting in deviations in the S value of each colorimetric tube. In order to avoid this deviation from affecting the subsequent logistic regression model training, the S values of all colorimetric tubes are the same as the S value of the colorimetric tube at the center of the photo.
[0057] S2.2. Construct the first fitting equation. In practice, it is most appropriate to construct the first fitting intensity equation using the measured light intensity values of each color channel within the range of the axis at a distance of 3 / 4p from the axis of the colorimetric tube. The first fitting equation is:
[0058]
[0059] Among them, T (n,h,l,c)is the predicted light intensity value of the nth colorimetric tube at a height of h, a distance of l from the axis of the colorimetric tube, and a color channel of c, μ and is the parameter to be fitted; l satisfies the condition l<3 / 4p; then the predicted light intensity value T in the range of 0≤l≤S is calculated by formula (2) (n,h,l,c) .
[0060] When formula (2) is constructed, it is assumed that when l satisfies the condition l<3 / 4p, T (n,h,l,c) is equal to the measured light intensity value, so the relationship equation between the predicted light intensity value and the colorimetric tube position can be constructed; when l satisfies the condition l<3 / 4p, T calculated by formula (2) (n,h,l,c) It is not necessarily equal to the measured light intensity value, because the measured light intensity value may deviate from the theoretical value due to distortion and other reasons. Through fitting, the influence of different Euclidean distances from different positions of the colorimetric tube to the camera lens on the measurement of light intensity value can be reduced.
[0061] Formula (2) can also be used to calculate the predicted light intensity value when 3 / 4p≤l≤S. At 3 / 4p≤l≤p, because the solution is getting closer and closer to the edge of the colorimetric tube, the thickness of the solution in the front and rear directions is getting thinner, while the thickness of the glass is getting thicker, resulting in a sharp decrease in the measured light intensity value. This has an obvious gap with the measured light intensity value outside the colorimetric tube wall. This situation occurs only because the relative thickness of the glass increases too obviously and is not the actual light intensity value that the solution should have in this area. Therefore, replacing it with the predicted light intensity value calculated by formula (2) is more in line with the actual situation and can make the training results more accurate when used for subsequent logistic regression model training. In the p≤l≤S segment, the predicted light intensity value calculated by formula (2) replaces the actual measured light intensity value of the backlight panel, which can expand the number of total light intensity values of the solution, that is, increase the amount of data used for training the logistic regression model, and further improve its accuracy. Similarly, the predicted light intensity values calculated in these two segments are used to input the trained logistic regression model because there is a richer amount of data, which can also improve the recognition accuracy.
[0062] It should be noted that although formula (2) is constructed at a specific luminescence intensity, it is applicable to all luminescence intensities within the detection luminosity range with appropriate fluoride ion concentration.
[0063] Step S2.1 separates each colorimetric tube and the surrounding set area for separate processing, which can avoid the overlap of the extended areas of adjacent colorimetric tubes when using formula (2) to expand the predicted light intensity value, resulting in different predicted light intensity values at the same position, affecting the training of the logistic regression model.
[0064] S3, replacing the predicted light intensity value obtained in step S2 with the measured light intensity value of the position in step S1 to calculate the corrected light intensity value of each position in the photo;
[0065] Specifically, h and l in formula (2) are converted to x and y in formula (1) respectively according to the position of each colorimetric tube. This is the conventional coordinate conversion operation. The first coordinate system is constructed with the photos taken by the camera, in which the horizontal and vertical coordinates are x and y respectively. The second coordinate system is constructed with each segmented colorimetric tube image, in which the horizontal and vertical coordinates are h and l respectively. Because the colorimetric tube has a clear position in the first coordinate system, the coordinate conversion can be performed accordingly.
[0066] After the coordinates are replaced, let I (x,y,c) =T (n,x,y,c) , and then calculate the corrected light intensity value according to formula (1) as the final measured light intensity value at each position of each colorimetric tube.
[0067] S4, obtaining the calibrated light intensity values at all positions of each colorimetric tube according to steps S2 and S3 using multiple colorimetric tubes filled with solutions of different known fluoride ion concentrations, and using the values as input values to train a logistic regression model; specifically comprising the following sub-steps:
[0068] S4.1. Prepare multiple solutions with different fluoride ion concentrations as the first standard series solutions, and place each solution with a fluoride ion concentration into an independent colorimetric tube. Note that the difference between adjacent fluoride ion concentration values of the first standard series solutions cannot be too large, but should be relatively dense, so that it can be considered that the fluoride ion concentrations between adjacent fluoride ion concentration values change linearly.
[0069] S4.2. Place colorimetric tubes containing different fluoride ion concentrations into the device and take photos under multiple different luminescence intensities. The specific number of colorimetric tubes placed shall be based on the number of test tubes that can be placed in the test tube rack. Taking photos under different luminescence intensities can obtain more samples for training the logistic regression model, which can increase the versatility of the logistic regression model and make the use of the logistic regression model not limited to a specific luminescence intensity.
[0070] S4.3. The corrected light intensity values at multiple positions of each colorimetric tube calculated according to steps S2 and S3 are input into the machine learning logistic regression model for training, wherein the ratio of the training set to the test set is 7:3; the coefficient of determination R 2 As a criterion, when R 2 When it is greater than 0.998, the training of the logistic regression model is completed.
[0071] S5, placing a plurality of colorimetric tubes containing different water samples to be tested and different solutions with known fluoride ion concentrations in batches on a test tube rack, obtaining a calibrated light intensity value according to steps S2 and S3, substituting the value into a logistic regression model and taking the output result as the weight value of the fluoride ion concentration in step S4 for weighted averaging to obtain a predicted fluoride ion concentration value;
[0072] The specific steps include:
[0073] S5.1. First, place a plurality of colorimetric tubes containing solutions with different known fluoride ion concentrations on a test tube rack and take photos. Then, take out these colorimetric tubes and place a plurality of colorimetric tubes containing water samples to be tested and take photos. These solutions with known fluoride ion concentrations are used as the second standard series solutions.
[0074] S5.2, taking the two photos to obtain the measured light intensity values, and obtaining the calibrated light intensity values at each position of each colorimetric tube according to steps S2 and S3;
[0075] S5.3. Substitute the corrected light intensity value obtained in step S5.2 into the trained logistic regression model; the logistic regression model outputs the probability value of the solution in each colorimetric tube relative to all fluoride ion concentrations in the first standard series of solutions, and uses these probability values as the weight values of each fluoride ion concentration. All fluoride ion concentrations are weighted averaged to obtain the predicted fluoride ion concentration value of the colorimetric tube solution; because the difference between adjacent fluoride ion concentrations of the first standard series of solutions is small, it can be considered that the fluoride ion concentration changes linearly, and thus the weighted average value can be used as the predicted fluoride ion concentration value.
[0076] The second standard series solution is set in step S5 to avoid the detection environment changing during the actual detection compared with the detection of the first standard series solution, which may affect the detection result; for example, the time and place of the actual detection and the detection of the first standard series solution are different, and the detection environment may be different.
[0077] S6, constructing a second fitting equation according to the known fluoride ion concentration value of the solution in step S5 and its predicted fluoride ion concentration value, and obtaining the fluoride ion concentration of the water sample to be tested according to the predicted fluoride ion concentration value of the water sample and the second fitting equation; specifically comprising the following sub-steps:
[0078] S6.1. Construct a second fitting equation based on the known fluoride ion concentration value of the solution in step S5 and its predicted fluoride ion concentration value:
[0079] F=kM+ξ (3)
[0080] Wherein, F is the predicted fluoride ion concentration value, M is the known fluoride ion concentration value, and k and ξ are the parameters to be fitted.
[0081] S6.2. Substituting the predicted fluoride ion concentration value of the water sample to be tested obtained in step S5 into formula (3) can obtain the "known fluoride ion concentration value" of the water sample to be tested, which is actually the corrected fluoride ion concentration value as the final test result.
[0082] If the detection environment does change during the actual detection and has an impact on the detection result, this impact can be reduced by using formula (3), further improving the accuracy of the final detection result.
[0083] It should be noted that except for step S1 which requires shooting at multiple different light intensities of the backlight panel, the shooting involved in the remaining steps is all performed at a certain fixed light intensity.
[0084] The steps S2 and S3 may not be used. The accuracy of detection can be improved by only using the regression equation constructed in step S1. The specific steps of the quantitative detection method without using steps S2 and S3 in the above method are as follows:
[0085] S1. photographing the backlight panel at different luminous intensities, and decomposing all the photos according to the three color channels of RGB, and establishing a regression equation for calculating the corrected light intensity value according to the measured light intensity value under each color channel;
[0086] S2, substituting the measured light intensity values at all positions of a plurality of colorimetric tubes filled with solutions of different known fluoride ion concentrations into the regression equation of step S1 to obtain a corrected light intensity value, and using it as an input value to train a logistic regression model;
[0087] S3, placing a plurality of colorimetric tubes containing different water samples to be tested and solutions with different known fluoride ion concentrations in batches on a test tube rack for photographing, substituting the measured light intensity value into the regression equation of step S1 to obtain a corrected light intensity value, substituting the value into the logistic regression model and taking the output result as the weight value of the fluoride ion concentration in step S2 for weighted averaging to obtain a predicted fluoride ion concentration value;
[0088] S4. Construct a second fitting equation based on the known fluoride ion concentration value of the solution in step S3 and its predicted fluoride ion concentration value, and obtain the fluoride ion concentration of the water sample to be tested based on the predicted fluoride ion concentration value of the water sample and the second fitting equation.
[0089] The regression equation and the second fitting equation are the same as those in the above method.
[0090] The following is a specific test case for further explanation:
[0091] 1. Reagents
[0092] All reagents involved in the test were processed using the reagent processing method in GB / T 5750.5-2023 Dual-wavelength coefficient magnification fluorine reagent spectrophotometry.
[0093] 2. Test equipment
[0094] A closed cavity is provided, and a soft light plate is laid on the inner wall to reduce direct reflection of light; a colorimetric tube holder is placed inside the cavity, and a number of colorimetric tubes with scales are placed on the colorimetric tube holder; a white light LED light source is arranged on the back of the cavity, and a camera is arranged on the opposite side; the illuminometer is used to select the appropriate illumination range and is taken out of the device after use; the camera is connected to a data workstation, which is a laptop computer; the software and algorithm development platform is VS Code, and the programming languages are Python and C.
[0095] Phase 1: Training of regression model
[0096] Use sodium fluoride standard solution to prepare 10 mL of standard series solution 1 containing fluoride ion concentrations of 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4 and 1.5, respectively. The above fluoride ion concentration units are all mg / L. Place the standard series solution 1 in a 25 mL colorimetric tube, and add alizarin complexone (fluoride reagent), buffer solution, lanthanum nitrate and acetone solution in sequence, mix well and develop color.
[0097] The colorimetric tubes containing the standard series solution 1 were placed in batches on the colorimetric tube holder of the device, and 20 photos were taken at each of five brightness levels selected within a suitable brightness range by a camera under white LED parallel light.
[0098] Substitute the above photo into the image processing algorithm to obtain the correction intensity of each color channel of each pixel, complete the image processing, and then perform feature extraction. The image processing algorithm is the processing method of steps S1-S3.
[0099] The extracted features are substituted into the logistic regression model for training and testing. The ratio of the training set to the test set is 7:3. The goal is to find the maximum determination coefficient R 2 , for accurate quantification, the maximum determination coefficient R 2 Should not be less than 0.998. Train to obtain the machine learning logistic regression algorithm.
[0100] To illustrate the importance of image processing, this example shows the determination coefficient R of the logistic regression model with and without image processing methods. 2 The impact of is shown in Table 1.
[0101] Table 1 The impact of using / not using image processing method algorithms
[0102]
[0103] As shown in Table 1, using only formula (1) or formula (2) for image processing cannot achieve satisfactory results, but when the complete image processing method is used, the training and test determination coefficients greater than 0.998 can be obtained.
[0104] The logistic regression model obtained in this stage can be used later. Subsequent tests do not need to be trained again, and the logistic regression model can be directly called.
[0105] Phase 2: Testing Phase
[0106] Use sodium fluoride standard solution to prepare 10mL of standard series solution 2 containing fluoride ion concentrations of 0.0, 0.1, 0.25, 0.50, 0.75, 1.00 and 1.15mg / L, respectively, and place it in a 25mL colorimetric tube, and add alizarin complexone (fluoride reagent), buffer, lanthanum nitrate, and acetone solution in sequence to mix and color. Collect tap water parallel samples and divide them into 6 parts, 2 of which are placed in different colorimetric tubes, and the other 4 parts are used as spiked solutions, 2 of which are spiked with 0.25mg / L fluoride ions, and the remaining 2 are spiked with 0.70mg / L fluoride ions for detection.
[0107] First, place the standard series solution 2 in the device and take photos. According to step S5, the predicted values of the fluoride ion concentrations of the standard series solution 2 are 0.019, 0.0994, 0.2346, 0.4773, 0.7222, 0.9177 and 1.0612 mg / L, respectively. Thus, the second fitting equation is obtained: F = 0.91368M + 0.01501. The determination coefficient R 2 >0.998, meeting the requirements for further analysis; then the sample to be tested and its spiked sample were placed in the device, photographed, and substituted into the second fitting equation to calculate the corrected fluoride ion concentration values of 0.1769, 0.1534, 0.4299, 0.4119, 0.8449 and 0.8464 mg / L respectively; the first two are the fluoride ion concentration values of the water sample to be tested, the middle two are the fluoride ion concentration values of the spiked solution with 0.25 mg / L fluoride ion, and the last two are the fluoride ion concentration values of the spiked solution with 0.70 mg / L fluoride ion; the recoveries of the four spiked solutions were 106%, 98.7%, 97.1% and 97.3% respectively. The above samples were tested by ion chromatography, and the results were consistent.
Claims
1. A multi-channel quantitative detection device for fluoride ions in water, characterized in that: The invention comprises a sealed box (1), wherein a backlight panel (2) is provided on one side of the box (1), a shooting device (3) is provided on the opposite side, and a test tube rack (4) for placing a plurality of colorimetric tubes (5) side by side is provided between the backlight panel (2) and the shooting device (3).
2. A multi-channel quantitative detection device for fluoride ions in water according to claim 1, characterized in that: The colorimetric tubes (5) placed on the test tube rack (4) are spaced at equal intervals.
3. A method for quantitatively detecting fluoride ions in water using the detection device according to claim 1, characterized in that: The following steps are involved: S1, photographing the backlight panel (2) at different light intensities, and decomposing all the photos according to the three color channels of RGB, and establishing a regression equation for calculating the corrected light intensity value according to the measured light intensity value under each color channel; S2. Under the set luminous intensity, a colorimetric tube (5) containing a solution is placed on a test tube rack (4) and photographed, and the photograph is decomposed according to three color channels of RGB, and a first fitting equation for calculating and predicting the light intensity value according to the position is established under each color channel; S3, replacing the predicted light intensity value obtained in step S2 with the measured light intensity value of the position in step S1 to calculate the corrected light intensity value of each position in the photo; S4, using a plurality of colorimetric tubes (5) filled with solutions of different known fluoride ion concentrations to obtain calibrated light intensity values at all positions of each colorimetric tube (5) at multiple luminous intensities according to steps S2 and S3, and using the values as input values to train a logistic regression model; S5, placing a plurality of colorimetric tubes (5) containing different water samples to be tested and solutions with different known fluoride ion concentrations in batches on a test tube rack (4) and photographing them, obtaining a calibrated light intensity value according to steps S2 and S3, substituting the value into a logistic regression model and taking the output result as the weight value of the fluoride ion concentration in step S4 for weighted averaging to obtain a predicted fluoride ion concentration value; S6. Construct a second fitting equation based on the known fluoride ion concentration value of the solution in step S5 and its predicted fluoride ion concentration value, and obtain the fluoride ion concentration of the water sample to be tested based on the predicted fluoride ion concentration value of the water sample and the second fitting equation.
4. The quantitative detection method according to claim 3, characterized in that: The regression equation in step S1 is: Among them, Y (x,y,c) is the corrected light intensity value of the backlight panel (2) when the color channel is c at the photo position (x, y), and the value range is 0 to 255; I (x,y,c) is the measured light intensity value of the backlight panel (2) when the color channel is c at the position (x, y) in the photo, and α, β and γ are all parameters to be fitted.
5. The quantitative detection method according to claim 3, characterized in that: Half of the width of the colorimetric tube (5) itself is p, and half of the distance between the opposite sides of adjacent colorimetric tubes (5) on the test tube rack (4) is q. Step S2 cuts out the area within a distance S from both sides of each colorimetric tube (5) to its axis in the photo for separate processing, where S=p+q.
6. The quantitative detection method according to claim 5, characterized in that: The distance from the edge of each colorimetric tube image intercepted in step S2 to the axis of the colorimetric tube (5) is the sum of p and q of the colorimetric tube (5) at the center of the original photo.
7. The quantitative detection method according to claim 6, characterized in that: The first fitting equation in step S2 is: Among them, T (n,h,l,c) is the predicted light intensity value of the nth colorimetric tube (5) at a height of h, a distance of l from the axis of the colorimetric tube (5), and a color channel c, μ and is the parameter to be fitted; l satisfies the condition l<3 / 4p; The predicted light intensity value T in the range of 0≤l≤S is calculated by formula (2) (n,h,l,c) .
8. The quantitative detection method according to claim 3, characterized in that: The second fitting equation in step S6 is: F=kM+ξ Wherein, F is the predicted fluoride ion concentration value, M is the known fluoride ion concentration value, and k and ξ are the parameters to be fitted.
9. The quantitative detection method according to claim 3, characterized in that: In step S4, the difference between adjacent fluoride ion concentrations in solutions with different known fluoride ion concentrations is within a set range.
10. A method for quantitatively detecting fluoride ions in water using the detection device according to claim 1, characterized in that: The following steps are involved: S1, photographing the backlight panel (2) at different light intensities, and decomposing all the photos according to the three color channels of RGB, and establishing a regression equation for calculating the corrected light intensity value according to the measured light intensity value under each color channel; S2, substituting the measured light intensity values at all positions of a plurality of colorimetric tubes (5) filled with solutions of different known fluoride ion concentrations into the regression equation of step S1 to obtain a corrected light intensity value, and using it as an input value to train a logistic regression model; S3, placing a plurality of colorimetric tubes (5) containing different water samples to be tested and solutions with different known fluoride ion concentrations in batches on a test tube rack (4) and photographing them, substituting the measured light intensity value into the regression equation of step S1 to obtain a corrected light intensity value, substituting the value into a logistic regression model and taking the output result as the weight value of the fluoride ion concentration in step S2 for weighted averaging to obtain a predicted fluoride ion concentration value; S4. Construct a second fitting equation based on the known fluoride ion concentration value of the solution in step S3 and its predicted fluoride ion concentration value, and obtain the fluoride ion concentration of the water sample to be tested based on the predicted fluoride ion concentration value of the water sample and the second fitting equation.
Citation Information
Patent Citations
Liquid concentration detection method
CN110542679A
Water quality fluoride detection method based on digital image colorimetric analysis
CN113945556A
Method for measuring substance concentration of colored solution by using RAW image
CN114047187A
Perfluorinated compound non-targeted quantification method based on ultra-high performance liquid chromatography and high-resolution mass spectrometry
CN114414689A
Method for rapidly detecting organophosphorus pesticide content in natural environment water body
CN114486780A
