Water quality analysis method and device based on photoelectric detection
By combining photoelectric detection and neural networks, a water quality classification model is constructed, which solves the problems of high cost and low efficiency in existing water quality testing and achieves efficient and accurate water quality analysis.
Patent Information
- Application Number
- CN202610000423.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-04
- Publication Date
- 2026-02-03
AI Technical Summary
Existing water quality testing methods require significant manpower and equipment costs, and the testing process is complex and inefficient.
A water quality classification model is constructed by combining photoelectric detection technology with neural networks. Water quality characteristics are obtained through photoelectric detection, and the trained model is used to analyze the water quality level.
It reduces the cost of water quality testing, improves testing efficiency, and enhances the accuracy and generalizability of testing.
Smart Images

Figure CN121453671A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of water quality testing, and in particular to a water quality analysis method and apparatus based on photoelectric detection. Background Technology
[0002] Water quality testing is a key component of water environment quality research. It provides a scientific basis for the rational development and utilization of water resources and the comprehensive prevention and control of water pollution, enabling the formulation of scientific plans and the implementation of effective remediation measures, which is of great significance for the protection of water resources. Water quality testing typically involves measuring multiple parameters, such as COD, BOD, ammonia nitrogen, total phosphorus, total nitrogen, temperature, pH, conductivity, dissolved oxygen, and turbidity. The final water quality grade is determined through the analysis of these parameters. However, this testing method requires parameter extraction and analysis for each test, making the process complex, costly in terms of manpower and equipment, and inefficient. Summary of the Invention
[0003] The purpose of this invention is to overcome the shortcomings of the prior art and provide a water quality analysis method and device based on photoelectric detection, which can effectively reduce the cost of water quality detection and improve the efficiency of water quality detection.
[0004] The objective of this invention is achieved through the following technical solution: a water quality analysis method based on photoelectric detection, comprising the following steps:
[0005] Step S1. Using photoelectric detection, samples are taken from several water sources for testing. Based on the test results, detection characteristics are constructed, and the water quality level of each water source is determined by manual testing.
[0006] Step S2. Based on the detection characteristics and corresponding water quality level of each water source, construct water quality analysis samples for the water source to form a water quality analysis sample set;
[0007] Step S3. Construct a water quality classification model using a neural network, and train the water quality classification model using a set of water quality analysis samples to obtain a trained water quality classification model.
[0008] Step S4. Using photoelectric detection, the water source to be tested is sampled and tested. Based on the test results, the test features are constructed and fed into the trained water quality classification model. The water quality classification model outputs the water quality level as the water quality analysis result.
[0009] A water quality analysis device based on photoelectric detection, comprising:
[0010] A transparent testing container is used to hold sampled liquid from a water source, facilitating photoelectric detection.
[0011] A parallel light source, located above the transparent inspection container, is used to emit a parallel beam of light onto the transparent inspection container;
[0012] A photoelectric detection array, located below the transparent detection container, is used for photoelectric detection.
[0013] In the model training phase, the computer equipment receives the output results of the photoelectric detection array to construct detection features when the transparent detection container is empty or filled with sampled liquids from different water sources. It also records the water quality calibrated by manual detection for each water source, constructs water quality analysis samples for each water source, forms a water quality analysis sample set, and trains a water quality classification model based on a neural network. In the water source detection phase, when the transparent detection container is filled with sampled liquids from the water source to be tested, it receives the output results of the photoelectric detection array to construct detection features and outputs them into the water quality classification model to obtain the water quality classification result.
[0014] The beneficial effects of this invention are as follows: This invention only requires manual detection during the model training stage to calibrate the water quality level of each water source, and then associate the water quality level with the features of photoelectric detection to form training samples for training the neural network to obtain a water quality level classification model; in actual detection applications, it is only necessary to sample the water source, detect its optical features, convert them through a photoelectric detection array, construct detection features from the obtained detection results, and then feed them into the trained model to complete the water quality level analysis, thereby reducing the cost of water quality level analysis and improving analysis efficiency. Attached Figure Description
[0015] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation
[0016] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings, but the scope of protection of the present invention is not limited to the following description.
[0017] like Figure 1 As shown, a water quality analysis method based on photoelectric detection includes the following steps:
[0018] Step S1. Using photoelectric detection, samples are taken from several water sources for testing. Based on the test results, detection characteristics are constructed, and the water quality level of each water source is determined by manual testing.
[0019] Step S1 includes:
[0020] S101. When the transparent detection container is empty, a vertically downward parallel beam is emitted from above the transparent detection container using a parallel light source facing directly at the transparent detection container; below the transparent detection container, a photoelectric detection array is used for detection, and the obtained detection result is recorded as a matrix. ;
[0021] Suppose a photodetector array contains M rows and N columns of photodetectors, then the output of the photodetector in the m-th row and n-th column is used as a matrix. The element in the m-th row and n-th column of the array, where m = 1, 2, ..., M; n = 1, 2, ..., N;
[0022] S102. After sampling any water source, the sampled liquid is placed into a transparent testing container;
[0023] Above the transparent inspection container, a parallel light source facing the transparent inspection container emits a parallel beam of light toward the transparent inspection container;
[0024] Detection is performed using a photoelectric detection array beneath the transparent container:
[0025] The detection results of the photodetector are denoted as a matrix. The output of the photodetector in the m-th row and n-th column is used as a matrix. The elements in the m-th row and n-th column are m=1,2,…,M; n=1,2,…,N;
[0026] S103. Calculate the change in the detection signal caused by the sampled liquid, and use it as a detection characteristic, denoted as... ;
[0027] S104. For different water sources, repeat steps S102~S103 to obtain the detection characteristics of each water source, denoted as... ,in, Let q represent the detection characteristics of the q-th water source, where q = 1, 2, ..., Q;
[0028] S105. For different water sources, the water quality level of each water source shall be determined by manual testing.
[0029] In the embodiments of this application, the different water sources need to cover common water quality environments and water quality levels, so that the model can analyze most water source conditions and the whole analysis method has stronger generalization.
[0030] In the embodiments of this application, manual detection refers to detecting a variety of parameters, such as conventional characteristic parameters in water, including COD, BOD, ammonia nitrogen, total phosphorus, total nitrogen, temperature, pH value, conductivity, dissolved oxygen and turbidity, and completing the final water quality grade assessment through manual analysis of various parameters.
[0031] By subtracting the detection results when there is no liquid in the transparent detection container during each construction of detection features, the influence of the container itself is filtered out, thus improving detection accuracy.
[0032] The horizontal cross-section of the transparent detection container is larger than the coverage area of the parallel light beam; the detection area of the photoelectric detection array is larger than the horizontal cross-sectional area of the container being tested.
[0033] This application employs a detection array composed of multiple detectors, enabling it to reflect changes in detection results caused by liquids at different locations. It more accurately reflects the differences in detection results after the light beam passes through sampled liquids from different water sources, making the detection results more reflective of the characteristics of the sampled liquids and providing conditions for accurate water quality grade analysis. Since the detection area is larger than the cross-sectional area of the container, it can detect the changes in the light beam caused by scattering and refraction, better reflecting the characteristics of the sampled liquids, thereby helping to further improve the accuracy of water quality grade analysis.
[0034] The range and intensity of the beam emitted by the parallel light source remain unchanged.
[0035] Step S2. Based on the detection characteristics and corresponding water quality level of each water source, construct water quality analysis samples for the water source to form a water quality analysis sample set;
[0036] The detection characteristics of each water source are used as the sample characteristics of water quality analysis, and the water quality level corresponding to the water source is used as the sample label. The sample characteristics and sample labels of water quality analysis constitute the water quality analysis sample. The water quality analysis samples of all water sources are added to a set to form a water quality analysis sample set.
[0037] Step S3. Construct a water quality classification model using a neural network, and train the water quality classification model using a set of water quality analysis samples to obtain a trained water quality classification model.
[0038] The neural network is a feedforward neural network, a convolutional neural network, or a recurrent neural network.
[0039] In step S3, the sample features of each sample in the water quality analysis sample set are used as the model input and the sample label is used as the expected output of the model to train the classifier model. When all samples are trained, the trained water quality level classification model is obtained.
[0040] Step S4. Using photoelectric detection, the water source to be tested is sampled and tested. Based on the test results, the test features are constructed and fed into the trained water quality classification model. The water quality classification model outputs the water quality level as the water quality analysis result.
[0041] Step S4 includes:
[0042] S401. After sampling the water source to be tested, the sampled liquid is placed into a transparent testing container;
[0043] Above the transparent inspection container, a parallel light source facing the transparent inspection container emits a parallel beam of light toward the transparent inspection container;
[0044] Detection is performed using a photoelectric detection array beneath the transparent container:
[0045] The detection results of the photodetector are denoted as a matrix. The output of the photodetector in the m-th row and n-th column is used as a matrix. The elements in the m-th row and n-th column are m=1,2,…,M; n=1,2,…,N;
[0046] S402. Calculate the change in the detection signal caused by the sampled liquid, and use it as a detection characteristic, denoted as... ;
[0047] S403. Detect features The data is fed into a pre-trained water quality classification model, which outputs the water quality level as the water quality analysis result.
[0048] A water quality analysis device based on photoelectric detection, comprising:
[0049] A transparent testing container is used to hold sampled liquid from a water source, facilitating photoelectric detection.
[0050] A parallel light source, located above the transparent inspection container, is used to emit a parallel beam of light onto the transparent inspection container;
[0051] A photoelectric detection array, located below the transparent detection container, is used for photoelectric detection.
[0052] In the model training phase, the computer equipment receives the output results of the photoelectric detection array to construct detection features when the transparent detection container is empty or filled with sampled liquids from different water sources. It also records the water quality calibrated by manual detection for each water source, constructs water quality analysis samples for each water source, forms a water quality analysis sample set, and trains a water quality classification model based on a neural network. In the water source detection phase, when the transparent detection container is filled with sampled liquids from the water source to be tested, it receives the output results of the photoelectric detection array to construct detection features and outputs them into the water quality classification model to obtain the water quality classification result.
[0053] The foregoing description illustrates and describes a preferred embodiment of the present invention. However, as previously stated, it should be understood that the present invention is not limited to the forms disclosed herein and should not be construed as excluding other embodiments. It can be used in various other combinations, modifications, and environments, and can be altered within the scope of the inventive concept described herein through the foregoing teachings or techniques or knowledge in related fields. Any modifications and variations made by those skilled in the art that do not depart from the spirit and scope of the present invention should be within the protection scope of the appended claims.
Claims
1. A water quality analysis method based on photoelectric detection, characterized in that: Includes the following steps: Step S1. Using photoelectric detection, samples are taken from several water sources for testing. Based on the test results, detection characteristics are constructed, and the water quality level of each water source is determined by manual testing. Step S2. Based on the detection characteristics and corresponding water quality level of each water source, construct water quality analysis samples for the water source to form a water quality analysis sample set; Step S3. Construct a water quality classification model using a neural network, and train the water quality classification model using a set of water quality analysis samples to obtain a trained water quality classification model. Step S4. Using photoelectric detection, the water source to be tested is sampled and tested. Based on the test results, the test features are constructed and fed into the trained water quality classification model. The water quality classification model outputs the water quality level as the water quality analysis result.
2. The water quality analysis method based on photoelectric detection according to claim 1, characterized in that: Step S1 includes: S101. When the transparent detection container is empty, a vertically downward parallel beam is emitted from above the transparent detection container using a parallel light source facing directly at the transparent detection container; below the transparent detection container, a photoelectric detection array is used for detection, and the obtained detection result is recorded as a matrix. ; Suppose a photodetector array contains M rows and N columns of photodetectors, then the output of the photodetector in the m-th row and n-th column is used as a matrix. The element in the m-th row and n-th column of the array, where m = 1, 2, ..., M; n = 1, 2, ..., N; S102. After sampling any water source, the sampled liquid is placed into a transparent testing container; Above the transparent inspection container, a parallel light source facing the transparent inspection container emits a parallel beam of light toward the transparent inspection container; Detection is performed using a photoelectric detection array beneath the transparent container: The detection results of the photodetector are denoted as a matrix. The output of the photodetector in the m-th row and n-th column is used as a matrix. The elements in the m-th row and n-th column are m=1,2,…,M; n=1,2,…,N; S103. Calculate the change in the detection signal caused by the sampled liquid, and use it as a detection characteristic, denoted as... ; S104. For different water sources, repeat steps S102~S103 to obtain the detection characteristics of each water source, denoted as... ,in, Let q represent the detection characteristics of the q-th water source, where q = 1, 2, ..., Q; S105. For different water sources, the water quality level of each water source shall be determined by manual testing.
3. The water quality analysis method based on photoelectric detection according to claim 2, characterized in that: The horizontal cross-section of the transparent detection container is larger than the coverage area of the parallel light beam; the detection area of the photoelectric detection array is larger than the horizontal cross-sectional area of the container being tested. The range and intensity of the beam emitted by the parallel light source remain unchanged.
4. The water quality analysis method based on photoelectric detection according to claim 1, characterized in that: Step S2 includes: using the detection characteristics of each water source as sample characteristics for water quality analysis, using the water quality level corresponding to the water source as a sample label, the sample characteristics and sample labels of water quality analysis constitute a water quality analysis sample, and adding the water quality analysis samples of all water sources into a set to form a water quality analysis sample set.
5. The water quality analysis method based on photoelectric detection according to claim 1, characterized in that: The neural network is a feedforward neural network, a convolutional neural network, or a recurrent neural network.
6. The water quality analysis method based on photoelectric detection according to claim 1, characterized in that: In step S3, the sample features of each sample in the water quality analysis sample set are used as the model input and the sample label is used as the expected output of the model to train the classifier model. When all samples are trained, the trained water quality level classification model is obtained.
7. The water quality analysis method based on photoelectric detection according to claim 2, characterized in that: Step S4 includes: S401. After sampling the water source to be tested, the sampled liquid is placed into a transparent testing container; Above the transparent inspection container, a parallel light source facing the transparent inspection container emits a parallel beam of light toward the transparent inspection container; Detection is performed using a photoelectric detection array beneath the transparent container: The detection results of the photodetector are denoted as a matrix. The output of the photodetector in the m-th row and n-th column is used as a matrix. The elements in the m-th row and n-th column are m=1,2,…,M; n=1,2,…,N; S402. Calculate the change in the detection signal caused by the sampled liquid, and use it as a detection characteristic, denoted as... ; S403. Detect features The data is fed into a pre-trained water quality classification model, which outputs the water quality level as the water quality analysis result.
8. A water quality analysis device based on photoelectric detection, employing the method described in any one of claims 1 to 7, characterized in that: include: A transparent testing container is used to hold sampled liquid from a water source, facilitating photoelectric detection. A parallel light source, located above the transparent inspection container, is used to emit a parallel beam of light onto the transparent inspection container; A photoelectric detection array, located below the transparent detection container, is used for photoelectric detection. In the model training phase, the computer equipment receives the output results of the photoelectric detection array to construct detection features when the transparent detection container is empty or filled with sampled liquids from different water sources. It also records the water quality calibrated by manual detection for each water source, constructs water quality analysis samples for each water source, forms a water quality analysis sample set, and trains a water quality classification model based on a neural network. In the water source detection phase, when the transparent detection container is filled with sampled liquids from the water source to be tested, it receives the output results of the photoelectric detection array to construct detection features and outputs them into the water quality classification model to obtain the water quality classification result.
Citation Information
Patent Citations
Distributed water quality detection system based on ultraviolet spectrum method and water quality evaluation method
CN113155767A
Full-spectrum water quality multi-parameter analysis detector
CN120831331A
Wafer defect detection method for solid state disk
CN121186203A