A method for testing water quality transparency and its testing device
The dynamic graphics are scanned and read through the image acquisition unit and the neural network prediction model is used to solve the problem of subjective impact and light source differences in existing water quality transparency tests, achieving high-precision and automated online measurement of water quality transparency.
Patent Information
- Application Number
- CN202110403657.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-15
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2041-04-15
AI Technical Summary
The existing water quality transparency testing methods have problems such as large subjective influence, large light source differences, and strong limitations in the prediction of single optical parameters, making it difficult to achieve high-precision automated online measurement.
The dynamic graphics are scanned and read through the image acquisition unit, identify and record the critical value of X size, and use the neural network prediction model to calculate transparency, and combine the absorption and scattering characteristics of multiple light wavelengths to achieve automated online measurement throughout the entire process.
Effectively eliminate the influence of random and human factors, realize direct, robust and reliable prediction of water quality transparency, high degree of automation of the device, and adapt to a variety of optical conditions.
Smart Images

Figure CN112858229B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of water quality testing, and particularly relates to a method and a device for testing water transparency. Background Art
[0002] The water transparency index is one of the four parameters for monitoring and evaluating the water quality of black and odorous waters. At present, the test of the transparency parameter still adopts manual visual inspection and interpretation. One of the judgment methods is the Secchi disk method, which is an in-situ test method for transparency. By immersing the Secchi disk into the water to be tested and gradually increasing the depth until the black and white grid of the disk cannot be clearly distinguished by the naked eye, the depth at which the Secchi disk sinks into the water at this time is used as the judgment result of the water transparency; the second judgment method is the lead letter method. In this method, the water sample to be tested is continuously injected into a transparency meter with an inner diameter of 2.5 cm and a height of 33 cm. At the same time, the symbol printed in standard lead letters at the bottom is observed from the mouth of the transparency meter cylinder, and the height of the water sample when the bottom symbol cannot be distinguished by the naked eye is used as the judgment result of the transparency.
[0003] The existing research and technical improvements on the existing test methods for the transparency index mainly include the following measures: One is to introduce a buoy and an electric rubber wheel device, cooperate with a camera module, place the improved measuring device in the water body, control the rubber wheel to release the Secchi disk to sink into the water through a program, observe the clarity of the Secchi disk grid and record the sinking depth, so as to eliminate the influence of the distance between the detector and the water surface and the inclination angle of the line of sight; One is to apply an image recognition algorithm and set a contrast threshold for the black and white grid image of the Secchi disk. When the graphic contrast is reduced to a preset threshold value during the sinking process of the Secchi disk, record its depth to achieve the goal of automatically judging whether the Secchi disk is clearly visible and eliminating the subjective influence of the difference in the naked eye observation of the detector; One is to improve the lead letter method, use an artificial light source instead of natural light, control the water valve to continuously inject water through an electromagnetic controller, and control the camera to record the contrast of the scale disk and the height of the water sample in real time, so as to eliminate the influence of the light source in the lead letter method; One is to measure indirect parameters such as the absorbance of the water sample and establish the relationship between the indirect parameters and the transparency through an algorithm to realize the prediction of the transparency.
[0004] There are some deficiencies in the existing research results and technical implementations. First, the Secchi disk has a simple structure, and the selection of the contrast threshold of its black and white grid image has a strong subjective influence; second, there is a certain difference between the spectrum of the introduced artificial light source and the solar spectrum under natural conditions. Using the test results under the condition of direct use of the artificial light source as the evaluation index has a difference in experimental conditions from the on-site test results; third, transparency is the result of the combined action of multiple physical phenomena such as the absorption and scattering of light by water samples. Using a single indirect index such as absorbance and transmittance to predict the transparency parameter has certain limitations.
[0005] For the above reasons, it is necessary to further improve the existing test methods. At present, information graphical coding, as an effective way of information verification, has been widely recognized and used. The relevant concepts, applications and related limitations are described in the national standards "Barcode Terminology GB / T 12905" and "Quick Response Matrix Code GB / T 12848". It is worth noting that in the barcode terminology, the narrowest constituent unit and the smallest information-bearing unit of the characters in the two-dimensional barcode are called modules, and the nominal size of the unit module is called the X dimension. At the same time, the artificial neural network plays a prominent role and has remarkable application effects in aspects such as experimental data analysis, law learning and result prediction, and is one of the effective ways for data regression analysis and prediction. Summary of the Invention
[0006] In view of the above problems existing in the prior art, the present invention provides a method and device for automatically measuring the transparency of water samples online throughout the whole process. The method and device can scan, read, identify and verify graphic information through an image acquisition unit through water, accurately identify and record the X dimension critical value of a dynamic graphic, and calculate through a neural network prediction model after obtaining the X dimension critical value of the dynamic graphic, so as to evaluate the influence of the water sample on the clarity and integrity of the dynamic graphic.
[0007] In order to achieve the above object, the invention adopts the following technical measures:
[0008] A method for testing water transparency includes the following steps:
[0009] Step 1: Establish a training set, use training waters with different transparencies as training units, and measure the transparency reference values of each training unit by the lead type method or the Secchi disk method.
[0010] Step 2: Perform feature processing on the training units. The feature processing refers to using an image acquisition unit to continuously obtain the dynamic graphic provided by the display unit in the water area, and record the color, brightness, and X dimension critical value of the dynamic graphic when a clear image is obtained.
[0011] Step 3: Use the transparency reference value as the target output, and use the X dimension critical value of the training sample as the input variable to train the neural network prediction model.
[0012] Step 4: Use the water area to be measured as the unit to be measured, perform feature processing on the unit to be measured, and input the obtained X dimension critical value into the neural network prediction model for calculation and detection to obtain the transparency value of the water area to be measured.
[0013] Preferably, the dynamic graphic uses a white background, and six measurement conditions are formed by combining RGB three-color graphics with two brightness levels of 150 cd / m2 and 300 cd / m2 respectively. During feature processing, under each measurement condition, the X dimension of the graphic gradually increases according to a preset value until the image acquisition unit accurately identifies the information content of the dynamic graphic.
[0014] Preferably, the dynamic graphic is one or more of QR Code, visible light graphic, 2-dimensional bar code, PDF417, QR Code, Code 49, Code 16K, Code One, Datamatrix, Maxicode, Vericode, Softstrip, Code1, Philips Dot Code.
[0015] Preferably, the number of input layer nodes of the neural network prediction model is 6, the number of hidden layers is 2, and the number of neurons in each hidden layer is 4, and the number of output layer nodes is 1.
[0016] Preferably, step 3 includes the following sub-steps:
[0017] Set the random initial value of the neuron connection weight and input the X dimension critical value of the training set;
[0018] Calculate the predicted output through the connection weights of the current neurons, and obtain the difference between the predicted output and the target output;
[0019] Calculate the weight correction amount through the backpropagation algorithm and update the current weight;
[0020] Iterate in this way until the relative error between the predicted output and the target output is lower than the preset error limit, and end the training of the neural network prediction model.
[0021] Preferably, the neural network prediction model is calculated and detected in the following manner:
[0022] Denote W M,i,N,j as the connection weight from the i-th node of the M-th layer to the j-th node of the N-th layer, and H N,j as the predicted output of the j-th of the N-th layer, then where LenM is the number of neurons in the M-th layer, and f is the Tanh activation function of the hidden neuron, The error between the predicted output of the training set obtained by processing the X dimension critical value of the input training set and the calculation result of the target output. Based on the above error, use the backpropagation algorithm to calculate the partial derivative of the error with respect to the weights of the neural network prediction model, and obtain the weight correction amount ΔW M,i,N,jAnd the weights are corrected, and this cycle is repeated to train the neural network model with each data in the training set until the relative error between the predicted output and the target output is lower than the preset error limit, and the optimal neuron connection weights are obtained.
[0023] A water quality transparency testing device uses the water quality transparency testing method described above for testing.
[0024] Preferably, it includes an image acquisition unit, a display unit, and a controller. Among them, the display unit is used to provide a dynamic graphic; the image acquisition unit is used to scan and read the dynamic graphic through the water area; the controller is used to construct and run a neural network prediction model, and the neural network prediction model obtains the X-size critical value of the unit to be measured and calculates the detection to obtain the transparency value of the water area to be measured.
[0025] Preferably, it further includes a transparent water sample tank for inputting water samples to form a water area. A water level gauge is installed in the transparent water sample tank. The display unit and the image acquisition unit are respectively installed on the two opposite side walls of the transparent water sample tank. The transparent water sample tank is connected with an inlet channel and an outlet channel, and water pumps are provided in both the inlet channel and the outlet channel.
[0026] Preferably, cleaners are installed on the inner sides of the two side walls of the transparent water sample tank where the display unit and the image acquisition unit are installed. The transparent water sample tank is also connected with a clean water input channel.
[0027] The beneficial effects of the invention are as follows:
[0028] Compared with the prior art, the present invention proposes a method and device for realizing the full-process automatic online measurement of water sample transparency by scanning, reading, identifying and verifying graphic information through the water area by the image acquisition unit, accurately identifying and recording the X-size critical value of the dynamic graphic, and calculating through the neural network prediction model after obtaining the X-size critical value of the dynamic graphic. The X-size critical value of the dynamic graphic can fully reflect the combined effects of factors such as light absorption and scattering of the water sample, and maximally retains the essential characteristics of the Secchi disk and the lead letter method. In addition, the dynamic graphic can carry information data, and the dynamic graphic recognition process can effectively eliminate the influence of random factors and human factors, making the prediction of water quality transparency direct, stable and reliable.
[0029] In the method proposed in this application, the display unit can display the graphic in a variety of light-emitting colors, and the absorption and scattering characteristics of light with different wavelengths passing through the water sample are fully reflected. Taking the set of test results as the input of the neural network prediction model, the neural network prediction model has a high degree of freedom in connection weights and a high degree of fitting to the actual action mechanism, and the prediction results are reliable.
[0030] In addition, the transparency test device realizes the extraction, release, and automatic cleaning of the water sample box for transparent water samples through the controller. The test process is automatically carried out according to the preset process, without manual intervention and dependence on external equipment, and can realize real-time online testing. Description of the Drawings
[0031] Figure 1 It is a flowchart of a method for testing water quality transparency according to the present invention;
[0032] Figure 2 It is a schematic diagram of a neural network prediction model of a method for testing water quality transparency according to the present invention;
[0033] Figure 3 It is a structural diagram of a device for testing water quality transparency according to the present invention;
[0034] Figure 4 It is a front view of a device for testing water quality transparency according to the present invention;
[0035] Figure 5 It is a left view of a device for testing water quality transparency according to the present invention;
[0036] Figure 6 It is a top view of a device for testing water quality transparency according to the present invention;
[0037] Figure 7 It is a test flow chart of a device for testing water quality transparency according to the present invention. Detailed Embodiments
[0038] Next, the technical solutions of the present invention will be clearly and completely described in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0039] The present invention provides a method for testing water quality transparency. It is found in the test of water quality transparency that the turbidity of water quality is the direct factor affecting the water transparency. For water bodies with not very obvious differences in turbidity, the existing test methods cannot accurately judge the transparency differences, which is a difficult problem encountered in current water quality detection. The present invention takes measures to overcome this. The method for testing water quality transparency of the present invention includes two major stages, one is the neural network prediction model training stage, and the other is the water quality transparency test stage. As Figure 1 - Figure 2 shown, it includes the following steps:
[0040] Step 1: Establish a training set, use training waters with different transparencies as training units, and obtain the transparency reference values of each training unit by measuring with the lead type method or the Secchi disk method;
[0041] In this step, in order to ensure the accuracy of the transparency reference value, it is preferable to use multiple training waters with a transparency difference of not less than 5 cm as training units. The number of training units is not less than 10, preferably 15 - 30.
[0042] Step 2: Perform feature processing on the training units. The feature processing refers to using the image acquisition unit 1 to continuously obtain the dynamic graphics provided by the display unit 2 in the water area, and record the color, brightness, and X - dimension threshold value of the dynamic graphics when a clear image is obtained.
[0043] Specifically, in this step, the distance between the image acquisition unit 1 and the display unit 2 is 0.5 m - 2 m, preferably 0.8 m - 1.2 m. And the image acquisition unit 1 and the display unit 2 can be set in the water area or set in an interval water area. The dynamic graphics provided by the display unit 2 use a white background, and six measurement conditions are formed by combining RGB three - color graphics with two brightness levels of 150 cd / m2 and 300 cd / m2 respectively. During feature processing, under each measurement condition, the X - dimension of the graphics gradually increases according to a preset value until the image acquisition unit 1 accurately identifies the information content of the dynamic graphics. The X - dimension of the dynamic graphics is a directly controllable variable in the graphics generation program. When changing the X - dimension, the number of modules of the graphics is synchronously changed so that the length and width of the graphics remain unchanged. The dynamic graphics can be one or more of QR Code, visible light graphics, 2 - dimensional bar code, PDF417, QRCode, Code 49, Code 16K, Code One, Datamatrix, Maxicode, Vericode, Softstrip, Code1, Philips Dot Code. In this application, QR Code is preferred. The dynamic graphics can have a maximum of 177×177 minimum information - carrying units and can store up to 4296 characters, meeting the requirements of information identification.
[0044] Step 3: Use the transparency reference value as the target output and the X - dimension threshold value of the training samples as the input variable to train the neural network prediction model.
[0045] In this step, the following sub - steps are included:
[0046] Set the random initial value of the neuron connection weights and input the X - dimension threshold value of the training set.
[0047] Calculate the predicted output through the current connection weights of each neuron, and obtain the difference between the predicted output and the target output.
[0048] Calculate the weight correction amount through the backpropagation algorithm and update the current weights.
[0049] Iterate in this way until the relative error between the predicted output and the target output is lower than the preset error limit, and then end the training of the neural network prediction model.
[0050] More specifically, an artificial neural network prediction model is constructed with the set of X - dimension critical values of the dynamic graph as the independent variable and the transparency value as the dependent variable. The number of input - layer nodes of the neural network prediction model is 6, the number of hidden layers is 2, and the number of neurons in each hidden layer is 4. The number of output - layer nodes is 1. The neural network prediction model is calculated and detected in the following way: Denote W M,i,N,j as the connection weight from the i - th node in the M - th layer to the j - th node in the N - th layer, and H N,j as the predicted output of the j - th node in the N - th layer. Then where LenM is the number of neurons in the M - th layer, and f is the Tanh activation function of the hidden neurons. Calculate the error between the predicted output of the training set obtained by processing the X - dimension critical values of the input training set and the calculation result of the target output. Based on the above - mentioned error, use the back - propagation algorithm to calculate the partial derivative of the error with respect to the weights of the neural network prediction model, and obtain the weight correction amount ΔW M,i,N,j And correct the weights. Cycle in this way to train the neural network model with each data in the training set until the relative error between the predicted output and the target output is lower than the preset error limit, obtain the optimal neuron connection weights, and the neuron connection weights obtained by model training will be used in the water - quality transparency test phase.
[0051] Step 4: Take the water area to be measured as the unit to be measured, perform feature processing on the unit to be measured, input the obtained X - dimension critical value into the neural network prediction model for calculation and detection, so as to obtain the transparency value of the water area to be measured.
[0052] In addition, referring to Figure 4 - Figure 6 , the present invention also provides a water - quality transparency test device, which uses the above - mentioned water - quality transparency test method for testing. The water - quality transparency test device includes an image acquisition unit 1, a display unit 2, and a controller 3. Among them, the display unit 2 is used to provide a dynamic graph; the image acquisition unit 1 is used to scan and read the dynamic graph through the water area; the controller 3 is used to construct and run a neural network prediction model, and the neural network prediction model obtains the X - dimension critical value of the unit to be measured and calculates and detects it to obtain the transparency value of the water area to be measured.
[0053] The image acquisition unit 1 includes but is not limited to an underwater camera, an industrial scanning camera, a barcode scanner, a mobile phone, and a tablet computer; the display unit 2 includes but is not limited to a liquid - crystal display screen, a mobile phone, a tablet computer, an LED diode array, and an OLED diode array.
[0054] In this embodiment, the water quality transparency testing device further includes a transparent water sample tank 4 for inputting water samples to form a water area. A water level gauge 5 is installed in the transparent water sample tank 4. The display unit 2 and the image acquisition unit 1 are respectively installed on the outer sides of the two opposite side walls of the transparent water sample tank 4. The display unit 2 and the image acquisition unit 1 face each other for operation. The transparent water sample tank 4 is connected to a water inlet channel 6 and a water outlet channel 7. Water pumps are provided in both the water inlet channel 6 and the water outlet channel 7. The water pumps, the display unit 2, the image acquisition unit 1, and the water level gauge 5 are all connected to the controller 3. The water sample to be tested enters the transparent water sample tank 4 through the water inlet channel 6 and forms a test water area in the transparent water sample tank 4. The display unit 2 provides a dynamic graph for the image acquisition unit 1 through the test water area. The image acquisition unit 1 records the color, brightness, and X-size critical value of the dynamic graph when a clear image is obtained and inputs them into the neural network prediction model to obtain the transparency value of the water sample (water area). After the test is completed, the water sample in the transparent water sample tank 4 is discharged from the water outlet channel 7 out of the transparent water sample tank 4.
[0055] To ensure the accuracy of the device test, the transparent water sample tank 4 needs to be cleaned before each test. Cleaners 8 are installed on the inner sides of the two side walls of the transparent water sample tank 4 where the display unit 2 and the image acquisition unit 1 are installed. The cleaners 8 are used to clean the inner wall of the transparent water sample tank 4 between the display unit 2 and the image acquisition unit 1. The transparent water sample tank 4 is also connected to a cleaning water input channel 9. A water pump is also provided in the cleaning water input channel 9. The opening and closing of the water pump are controlled by the controller 3. When cleaning the transparent water sample tank 4, the cleaning water is input into the transparent water sample tank 4 from the cleaning input channel 9.
[0056] The cleaner 8 includes a scraper 81. The scraper 81 is hinged to a rocker 82. The rocker 82 is connected to a driving motor 83. The driving motor 83 is used to drive the rocker 82 to rotate, and the rocker 82 drives the scraper 81 to scrape across the inner wall of the transparent water sample tank 4.
[0057] Reference Figure 7 In this embodiment, the water quality transparency testing device performs the test according to the following steps:
[0058] S1: Clean the transparent water sample tank 4: Start the controller 3. The cleaning water input channel 9 injects cleaning water into the transparent water sample tank 4, and the cleaner 8 starts.
[0059] S2: Close the cleaning water input channel 9, start the water outlet channel 7 to drain the cleaning water, close the water outlet channel 7 and start the water inlet channel 6 to inject the water sample to be tested into the transparent water sample tank 4.
[0060] S3: When the water sample to be tested reaches the preset height of the water level detector 5, close the water inlet channel 6, and the controller 3 controls the display unit 2 to generate a dynamic graph;
[0061] S4: The controller 3 controls the image acquisition unit 1 to scan the dynamic graph and identify the information carried by the dynamic graph;
[0062] S5: Determine whether the image acquisition unit 1 accurately identifies the dynamic graph information. If so, the display unit 2 changes the color and brightness of the dynamic graph sequentially according to the preset test conditions. If not, the X dimension of the graph under the corresponding test conditions is gradually increased according to the preset value, and the number of modules of the graph is gradually decreased according to the preset value, and steps S3 - S4 are repeated;
[0063] S6: If the dynamic graph traversal is completed according to the preset test conditions, input the X dimension critical value obtained under the test conditions into the neural network prediction model for calculation and detection to obtain the transparency value of the water area to be tested. If the dynamic graph traversal is not completed according to the preset test conditions, update the color and brightness settings of the graph, and return to step 3 until the dynamic graph traversal is completed according to the preset test conditions.
[0064] In summary, in the method proposed in this application, the display unit can display the graph in multiple luminous colors, and the absorption and scattering characteristics of light with different wavelengths passing through the water sample are fully reflected. Taking the set of test results as the input of the neural network prediction model, the neural network prediction model has a high degree of freedom in connection weights and a high degree of fitting to the actual action mechanism, and the prediction results are reliable; in addition, the transparency test device realizes water sample extraction, release, and automatic cleaning of the transparent water sample box through the controller, and the test process is automatically carried out according to the preset process, without human intervention and dependence on external equipment, and can realize real-time online testing.
[0065] The above content is a further detailed description of the invention in combination with specific preferred embodiments, and it cannot be determined that the specific implementation of the invention is only limited to these descriptions. For those of ordinary skill in the technical field to which the invention belongs, without departing from the inventive concept, several simple deductions or substitutions can still be made, and all should be regarded as belonging to the protection scope of the invention.
Claims
1. A method for testing water quality transparency, characterized in that, It includes the following steps: Step 1: Establish a training set. Use training waters with different transparencies as training units, and measure the transparency reference values of each training unit through the lead type method or the Secchi disk method; Step 2: Perform feature processing on the training units. The feature processing refers to using an image acquisition unit to obtain in real time the dynamic graphics provided by a display unit in the water area, and recording the color, brightness, and X-size critical value of the dynamic graphics when a clear image is obtained; Step 3: Use the transparency reference value as the target output, and use the X-size critical value of the training samples as the input variable to train a neural network prediction model; Step 4: Use the water area to be measured as the unit to be measured. Perform feature processing on the unit to be measured, and input the obtained X-size critical value into the neural network prediction model for calculation and detection to obtain the transparency value of the water area to be measured; Among them, the dynamic graphic uses a white background, and RGB three-color graphics are respectively paired with 150 cd / m 2 , 300 cd / m 2 to form six measurement conditions. During feature processing, under each measurement condition, the X dimension of the graphic gradually increases according to a preset value until the image acquisition unit accurately identifies the information content of the dynamic graphic. The X dimension of the dynamic graphic is a directly controllable variable in the graphic generation program. When changing the X dimension, the number of graphic modules is synchronously changed so that the length and width of the graphic remain unchanged; The said Step 3 includes the following sub-steps: a) Set the random initial value of the neuron connection weights and input the X-size critical value of the training set; b) Calculate the predicted output through the current connection weights of each neuron, and obtain the difference between the predicted output and the target output; c) Calculate the weight correction amount through the backpropagation algorithm and update the current weights; d) Iterate in this way until the relative error between the predicted output and the target output is lower than the preset error limit, and end the training of the neural network prediction model.
2. The water quality transparency test method according to claim 1, characterized in that, The said dynamic graphics adopt one or more of QRCode, visible light graphics, 2-dimensional bar code, PDF417, QR Code, Code 49, Code 16K, CodeOne, Datamatrix, Maxicode, Vericode, Softstrip, Code1, and Philips Dot Code.
3. A water quality transparency test method according to claim 1, characterized in that, The number of input layer nodes of the said neural network prediction model is 6, the number of hidden layers is 2, and the number of neurons in each hidden layer is 4, and the number of output layer nodes is 1.
4. A water quality transparency testing device, characterized in that, Test using the water quality transparency test method as described in any one of claims 1-3; the water quality transparency test device includes an image acquisition unit, a display unit, and a controller. Among them, the display unit is used to provide dynamic graphics; the image acquisition unit is used to scan and read the dynamic graphics through the water area; the controller is used to construct and run a neural network prediction model, and the neural network prediction model obtains the X-size critical value of the unit to be measured and calculates and detects to obtain the transparency value of the water area to be measured.
5. A water quality transparency testing device according to claim 4, characterized in that, It also includes a transparent water sample tank for inputting water samples to form a water area. A water level gauge is installed in the transparent water sample tank. The display unit and the image acquisition unit are respectively installed on the two opposite side walls of the transparent water sample tank. The transparent water sample tank is connected with a water inlet channel and a water outlet channel, and water pumps are installed on both the water inlet channel and the water outlet channel.
6. The water quality transparency testing device according to claim 5, characterized in that, Cleaners are installed on the inner sides of the two side walls of the transparent water sample tank where the display unit and the image acquisition unit are installed. The transparent water sample tank is also connected with a clean water input channel.
Citation Information
Patent Citations
Method for quick predicting total bacterial count of potable water network based on BP (Back Propagation) neural network
CN101775434A
Transparency detection device
CN106092976A
Water quality detection method and water sample image recognition device thereof
CN109187534A
Water transparency testing device
CN215768240U