A black and odorous water body identification method and system based on artificial intelligence
Through pixel-level analysis and neural network optimization based on artificial intelligence, the image stability and accuracy problems in black and odorous water recognition are solved, and the precise identification of black and odorous water bodies and pollution level assessment are achieved, supporting more effective water quality management and governance.
Patent Information
- Application Number
- CN202510217681.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-26
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2045-02-26
AI Technical Summary
When identifying black and odorous water bodies, it is difficult to deal with the black and odorous phenomenon caused by the decomposition of organic matter, and the stability and accuracy of the image under different light and angle conditions are insufficient, resulting in inaccurate monitoring results and affecting the pollution control effect.
Using an artificial intelligence-based method, through pixel-level analysis and neural network optimization, we identify the black and odor characteristics in water body images, generate spectral characteristic data, adjust the weight of the neural network layer, perform image rotation and scaling, optimize the diversity of training samples, perform forward and backward propagation, and perform image classification and pollution level assessment.
It significantly improves the accuracy and environmental adaptability of black and odorous water bodies, can output accurate pollution level assessment results, and provides data support for water quality management and pollution control.
Smart Images

Figure CN119723355B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of water body identification, and in particular to a method and system for identifying black and odorous water bodies based on artificial intelligence. Background Art
[0002] The field of water body identification technology involves the use of sensors, image analysis, remote sensing technology and data processing methods to identify and monitor various characteristics of water bodies. It includes not only the detection of surface coverage, size and boundaries of water bodies, but also the assessment of water quality parameters such as color, turbidity and chemical composition. With the development of artificial intelligence and machine learning technologies, water body identification technology has been able to achieve more accurate and automated water status monitoring and analysis, and has important applications in environmental monitoring, resource management, disaster response and urban planning.
[0003] The black and odorous water identification method is used to specifically identify and assess the pollution status of urban water bodies, particularly water bodies that have turned black and emitted a foul odor due to the decomposition of organic matter. Its primary purpose is to provide environmental protection departments with accurate data on polluted water bodies, supporting the development and implementation of water quality management and pollution control measures. By identifying black and odorous water bodies, relevant departments can respond promptly and implement measures to improve water quality, restore water health, and enhance the quality of life for urban residents.
[0004] Although existing technologies utilize sensors and remote sensing technology for water monitoring, they are limited in the in-depth analysis of water quality parameters, especially in identifying subtle chemical and biological changes. Existing methods often cannot provide sufficient data to support accurate pollution identification when dealing with black and smelly phenomena caused by the decomposition of organic matter. They mainly focus on physical properties rather than the complex chemical and biological composition of water bodies. In addition, current technologies are not adaptable enough when faced with image diversity, and the stability and accuracy of images obtained under different lighting and angle conditions are low, which may lead to inaccurate or misjudgment of monitoring results in practical applications. This limitation is particularly evident in the rapidly changing urban water environment, resulting in insufficient data when formulating response measures, affecting the effectiveness of pollution control and the improvement of residents' quality of life. Summary of the Invention
[0005] The purpose of the present invention is to solve the shortcomings of the prior art and to propose a method and system for identifying black and odorous water bodies based on artificial intelligence.
[0006] In order to achieve the above object, the present invention adopts the following technical solutions:
[0007] A method for identifying black and odorous water bodies based on artificial intelligence comprises the following steps:
[0008] S1: Collect water body images, perform pixel-level analysis on them, calculate the spectral response of each pixel, analyze the color distribution, and screen image areas that match black and odorous characteristics by comparing spectral characteristics with color standards to generate spectral characteristic data;
[0009] S2: According to the spectral characteristic data, the weights of the neural network layer are adjusted, the image is rotated and scaled, the diversity of the training samples is optimized, and the features of each transformed water body image are extracted to obtain an enhanced feature set;
[0010] S3: Execute neural network forward propagation and backward propagation through the enhanced feature set, optimize neural network weights and bias parameters, optimize feature recognition capabilities, distinguish water body images with different pollution levels, and generate optimized recognition records;
[0011] S4: performing image classification based on the optimized recognition record, identifying and labeling the black and odorous water area in the image, analyzing the texture and color differences in the black and odorous water area, and outputting the labeling classification results;
[0012] S5: Based on the labeled classification results, the pollution level is assessed. According to the preset pollution level standard, the water body images are sorted and classified. By comparing the image features of the difference classification, the pollution level corresponding to each image is output, and the black and odorous water body identification pollution judgment result is generated.
[0013] Optionally, the spectral characteristic data includes spectral response distribution results, color standard matching degree and image area screening index; the enhanced feature set includes image rotation characteristics, image scaling characteristics and feature diversity index; the optimized recognition record includes feature recognition accuracy, pollution degree discrimination index and network weight configuration; the annotation classification results include area annotation details, texture recognition data and color analysis results; the black and odorous water body identification pollution judgment results include pollution level classification, image feature comparison index and pollution assessment data.
[0014] Optionally, water body images are collected, pixel-level analysis is performed on the water body images, the spectral response of each pixel is calculated, the color distribution is analyzed, and image areas matching the black and odor characteristics are screened by comparing the spectral characteristics with color standards. The specific steps for generating spectral characteristic data are as follows:
[0015] S101: Collect water body images, capture the natural state of the water body, adjust the aperture and exposure settings to optimize image clarity and color saturation, and obtain a high-resolution water body image set;
[0016] S102: Based on the high-resolution water body image set, adjust the color threshold and contrast, record the color code of each pixel, classify and store the data, and generate pixel color data;
[0017] S103: Based on the pixel color data, perform color matching, compare with known spectral standards, screen pixel areas that match the characteristics of black and odorous water bodies, and comprehensively generate spectral characteristic data.
[0018] Optionally, according to the spectral characteristic data, the weights of the neural network layer are adjusted, the image is rotated and scaled, the diversity of training samples is optimized, and the features of each transformed water body image are extracted to obtain the enhanced feature set. The specific steps are:
[0019] S201: Adjust the neural network layer parameters, optimize the weights and bias values according to the spectral characteristic data, verify the adjustment effect, and obtain the optimized network parameters;
[0020] S202: Based on the optimized network parameters, rotating and scaling the water body image, setting the rotation angle range and scaling ratio, maximizing the image sample viewing angle and size diversity, and generating a transformed image set;
[0021] S203: Based on the transformed image set, key water body features of each transformed image are marked, image feature data are extracted and recorded, and the image feature data are merged to obtain an enhanced feature set.
[0022] Optionally, the enhanced feature set is used to perform neural network forward propagation and backward propagation, optimize neural network weights and bias parameters, optimize feature recognition capabilities, distinguish water body images with different pollution levels, and generate optimized recognition records in the following specific steps:
[0023] S301: Based on the enhanced feature set, configure the initial forward propagation of the neural network, set the input layer parameters, transfer feature data layer by layer, monitor the activation output of each layer, and obtain the forward propagation result;
[0024] S302: Using the forward propagation result, starting the backward propagation process, adjusting the weights and bias parameters of the neural network by adjusting the learning rate and error feedback, and generating adjusted network parameters;
[0025] S303: Based on the adjusted network parameters, perform cyclic iterative training to optimize the feature recognition performance of the neural network, perform cyclic testing and verification, and generate optimized recognition records.
[0026] Optionally, the specific steps of performing image classification based on the optimized recognition record, identifying and labeling the black and odorous water area in the image, analyzing the texture and color differences in the black and odorous water area, and outputting the labeled classification results are as follows:
[0027] S401: Based on the optimized recognition record, image classification parameters are set, including color threshold and texture recognition sensitivity, and black and odorous water areas in the image are annotated to obtain a preliminary annotated image set;
[0028] S402: Using the preliminary annotated image set, adjusting color and texture filter parameters, calculating the texture difference value of each annotated black and odorous water area, refining the feature classification of each black and odorous water area, and generating refined annotated data;
[0029] S403: Based on the refined labeled data, the classification information of each black and odorous water body area is integrated and output to generate a labeled classification result.
[0030] Optionally, the texture difference value of each marked black and odorous water area is calculated according to the formula:
[0031]
[0032] Calculate, where Indicates the texture difference value of each marked black and odorous water area, Representative The texture value of the pixel, Represents the texture average of all pixels in the selected area. and Represent the color mean of water area and non-water area respectively. represents the surface area of the water body, The bounding perimeter representing the water area.
[0033] Optionally, based on the labeled classification results, a pollution level assessment is performed, water body images are sorted and classified according to a preset pollution level standard, and the pollution level corresponding to each image is output by comparing the image features of the difference classification. The specific steps for generating the black and odorous water body identification pollution determination result are as follows:
[0034] S501: Based on the labeled classification results, set the identification standard for each pollution level, calculate the confidence level of each pollution level, and obtain preliminary pollution level data;
[0035] S502: Using the preliminary pollution level data, compare the images of each level to determine the degree of water pollution and generate a refined pollution level classification;
[0036] S503: Based on the refined pollution level classification, the pollution type is recorded, a comprehensive assessment of the severity of water pollution is conducted, and a black and odorous water body identification pollution determination result is generated.
[0037] Optionally, the confidence level of each pollution level is calculated according to the formula:
[0038]
[0039] Calculate, where Indicates the confidence level for each pollution level, represents the number of decision trees in the random forest, represents the output pollution level of a single decision tree, Represents the average pollution level output by all decision trees.
[0040] The black and odorous water body identification system based on artificial intelligence includes:
[0041] The image acquisition module collects water body images, captures the natural state of the water body, records the color code of each pixel by adjusting the color threshold and contrast, compares it with the known spectral standard, selects the pixel area that matches the characteristics of black and odorous water bodies, and comprehensively generates spectral characteristic data;
[0042] The image processing module adjusts the parameters of the neural network layer, optimizes the weights and bias values according to the spectral characteristic data, rotates and scales the water body image to maximize the viewing angle and size diversity of the image samples, and generates a transformed image set;
[0043] The data annotation module annotates key water features of each transformed image based on the transformed image set, configures the initial forward propagation of the neural network, monitors the activation output of each layer, and obtains the forward propagation result;
[0044] The network training module uses the forward propagation results to start the backward propagation process, adjust the weights and bias parameters of the neural network, perform cyclic iterative training, perform cyclic testing and verification, and generate optimized recognition records;
[0045] The classification and discrimination module sets image classification parameters based on the optimized recognition record, marks the black and odorous water body areas in the image, calculates the texture difference value of each marked black and odorous water body area, integrates and outputs the classification information of each black and odorous water body area, and generates a marked classification result;
[0046] Based on the labeled classification results, the assessment and decision-making module sets the identification criteria for each pollution level, calculates the confidence level of each pollution level, determines the degree of water pollution, conducts a comprehensive assessment of the severity of water pollution, and generates black and odorous water body identification and pollution judgment results.
[0047] Compared with the prior art, the advantages and positive effects of the present invention are:
[0048] In this invention, by conducting in-depth analysis of the spectral response and color distribution of each pixel, it is possible to identify pollution characteristics in water bodies at the microscopic level, optimize neural network weight adjustment and image processing, effectively process images of various scales and angles, enhance the model's generalization ability and environmental adaptability, and through meticulous forward and backward propagation optimization, significantly improve the network's performance in distinguishing water images with different degrees of pollution, and be able to output accurate pollution level assessment results, providing data support for the formulation of more targeted water quality management and pollution control measures. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0050] Figure 1 Schematic diagram of the steps of the present invention;
[0051] Figure 2 is a flow chart of the steps of S1 of the present invention;
[0052] Figure 3 This is a flow chart of the steps of S2 of the present invention;
[0053] Figure 4 This is a flow chart of the steps of S3 of the present invention;
[0054] Figure 5 This is a flow chart of the steps of S4 of the present invention;
[0055] Figure 6 This is a flow chart of the steps of S5 of the present invention;
[0056] Figure 7 It is a system module diagram of the present invention. DETAILED DESCRIPTION
[0057] The technical solution of the present invention is described below in conjunction with the accompanying drawings.
[0058] In the embodiments of the present invention, words such as "exemplarily" and "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as an "exemplary" in the present invention should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of the word "exemplary" is intended to present concepts in a concrete manner. Furthermore, in the embodiments of the present invention, "and / or" can mean both or either of the two.
[0059] In the embodiments of the present invention, the terms "image" and "picture" may sometimes be used interchangeably. It should be noted that, when the distinction is not emphasized, the meanings they convey are the same. The terms "of," "corresponding," and "corresponding" may sometimes be used interchangeably. It should be noted that, when the distinction is not emphasized, the meanings they convey are the same.
[0060] In the embodiments of the present invention, sometimes a subscript such as W1 may be written as a non-subscript such as W1. When the difference is not emphasized, the meanings to be expressed are the same.
[0061] In order to make the technical problems, technical solutions and advantages to be solved by the present invention clearer, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.
[0062] See also Figure 1 The embodiment of the present invention provides a method for identifying black and odorous water bodies based on artificial intelligence, comprising the following steps:
[0063] S1: Collect water body images, perform pixel-level analysis on them, calculate the spectral response of each pixel, analyze the color distribution, and screen image areas that match black and odorous characteristics by comparing spectral characteristics with color standards to generate spectral characteristic data;
[0064] S2: Based on the spectral characteristic data, the weights of the neural network layer are adjusted, the image is rotated and scaled, the diversity of training samples is optimized, and the features of each transformed water image are extracted to obtain an enhanced feature set;
[0065] S3: By enhancing the feature set, performing neural network forward propagation and backward propagation, optimizing the neural network weights and bias parameters, optimizing feature recognition capabilities, distinguishing water body images with different pollution levels, and generating optimized recognition records;
[0066] S4: Based on the optimized recognition records, perform image classification, identify and annotate the black and odorous water areas in the image, analyze the texture and color differences within the black and odorous water areas, and output the annotated classification results;
[0067] S5: Based on the labeled classification results, the pollution level is assessed. According to the preset pollution level standards, the water body images are sorted and classified. By comparing the image features of the difference classification, the pollution level corresponding to each image is output to generate the pollution judgment result of black and odorous water body identification.
[0068] Spectral characteristic data include spectral response distribution results, color standard matching degree and image area screening indicators; enhanced feature sets include image rotation characteristics, image scaling characteristics and feature diversity indicators; optimized recognition records include feature recognition accuracy, pollution degree discrimination index and network weight configuration; annotation classification results include area annotation details, texture recognition data and color analysis results; black and odorous water body identification and pollution judgment results include pollution level classification, image feature comparison indicators and pollution assessment data.
[0069] See also Figure 2 , the specific steps of S1 are:
[0070] S101: Collect water body images, capture the natural state of the water body, adjust the aperture and exposure settings to optimize image clarity and color saturation, and obtain a high-resolution water body image set;
[0071] In the initial steps of collecting water imagery, the camera equipment is first configured to adapt to the lighting conditions and dynamic range of natural water bodies to ensure that the images can reflect the true state of the water body. Specific operations include selecting the appropriate aperture size to control the amount of light entering, and adjusting the exposure time to adapt to the gloss and reflection of the water surface. In addition, the ISO sensitivity needs to be adjusted for different weather and lighting conditions to ensure that the color saturation and detail clarity of the image are optimized. Through fine-tuning, the collected water images will have high resolution and excellent color performance, providing a high-quality data foundation for subsequent analysis and processing, and can more accurately reflect the natural condition of the water body.
[0072] S102: Based on the high-resolution water body image set, by adjusting the color threshold and contrast, recording the color code of each pixel, classifying and storing the data, and generating pixel color data;
[0073] When processing a set of high-resolution water body images, the color thresholds in the image are first precisely adjusted. The purpose of the adjustment is to highlight the color characteristics of different components in the water body so as to better distinguish the water body status. For example, setting the green and blue thresholds higher can help identify algae and clean water surfaces. The contrast adjustment is to make the color levels of the image more obvious, so as to facilitate subsequent pixel-level processing. The color coding record of each pixel is completed through image analysis, including the precise measurement and recording of RGB values. This process involves not only the capture of color data, but also the effective classification and storage of data so that it can be quickly called and compared in the subsequent analysis stage, providing data support for identifying and analyzing potential pollution problems in water bodies.
[0074] S103: Perform color matching based on the pixel color data, compare with known spectral standards, select pixel areas that match the characteristics of black and odorous water bodies, and comprehensively generate spectral characteristic data;
[0075] Based on the pixel color data, color matching is performed according to the formula , calculate the difference with the spectral standard. Where, Represents the degree of color matching. represents the color channel weight, Represents the actual pixel color value, represents the spectral standard color value, Represents the number of color channels. For a typical set of data, assuming , , weight , the calculation process is:
[0076] The results showed that the color matching degree was 120 and the color difference was significant, indicating that this area may have the characteristics of black and odorous water bodies. Further screening of these areas can effectively identify polluted water bodies.
[0077] See also Figure 3 , the specific steps of S2 are:
[0078] S201: Adjust the neural network layer parameters, optimize the weights and bias values according to the spectral characteristic data, verify the adjustment effect, and obtain the optimized network parameters;
[0079] According to the spectral characteristic data, the weights and bias values of the neural network are optimized, and the formula , calculate the optimized network parameters. Where, represents the original weight, represents the learning rate, represents the loss function, Represents the gradient of the weight. Determine the initial weight of the neural network , learning rate , the gradient of the loss function with respect to the weights , then the updated weight is calculated as:
[0080]
[0081] The results show that the weight is updated from 0.5 to 0.502 through the gradient descent method, which shows that the process of fine-tuning the network parameters can be effectively optimized according to the characteristics of the spectral data, thereby improving the network performance.
[0082] S202: Based on the optimized network parameters, the water body image is rotated and scaled, the rotation angle range and scaling ratio are set, the image sample viewing angle and size diversity are maximized, and a transformed image set is generated;
[0083] Based on the optimized network parameters, the water body images are rotated and scaled to increase the perspective and size diversity of the image samples. The rotation angle and scaling ratio are flexibly adjusted according to actual needs to ensure the diversity of the image while maintaining the integrity of the features. The image is automatically adjusted according to the preset angle range and scale parameters to ensure that each transformed image set contains sufficient perspective and size changes, which directly affects the effect and accuracy of subsequent feature extraction. The generated transformed image set is used for further feature analysis and model training to improve the model's adaptability to different perspectives and sizes.
[0084] S203: Based on the transformed image set, label the key water body features of each transformed image, extract and record the image feature data, and merge them to obtain an enhanced feature set;
[0085] Based on the transformed image set, key water body features in each image are annotated, including manual or automatic identification and marking of specific water body features in the image, such as polluted areas, aquatic plant distribution, etc. The annotated data will be used to extract image features and then generate an enhanced feature set. Feature extraction involves calculating the texture, color distribution and shape descriptors of the image. The extraction of each feature depends on precise algorithms and models. Through enhanced feature data, the state of the water body can be more comprehensively described, providing a rich data foundation, thereby improving the recognition accuracy and robustness of the model.
[0086] See also Figure 4 , the specific steps of S3 are:
[0087] S301: Based on the enhanced feature set, configure the initial forward propagation of the neural network, set the input layer parameters, pass the feature data layer by layer, monitor the activation output of each layer, and obtain the forward propagation results;
[0088] The process of parameter configuration and data transmission involves accurately setting the number of nodes and activation function type of each layer to ensure that each layer can effectively receive and process the incoming feature data. The setting of the input layer parameters is adjusted according to the dimension and type of the feature data to adapt to the initial needs of the network. Monitoring the output of each layer helps observe the flow of data in the network and the activation effect of the activation function, so as to make timely adjustments to the network structure to ensure that the results of the forward propagation can accurately reflect the characteristics of the input data and provide a basis for the subsequent learning process.
[0089] S302: Using the forward propagation result, start the backward propagation process, adjust the weight and bias parameters of the neural network by adjusting the learning rate and error feedback, and generate adjusted network parameters;
[0090] Use the forward propagation result to start the backward propagation process, according to the formula , calculate the adjusted weight parameters. Where, represents the update amount of the weight, represents the learning rate, Represents the gradient of the loss function with respect to the weights. Consider a simple neural network with initial weights , learning rate , the gradient of the loss function , the calculation of weight update is:
[0091]
[0092] New weights:
[0093]
[0094] The results show that through backpropagation, the weight is updated from 0.6 to 0.595, demonstrating the specific steps and effects of the weight adjustment process and optimizing the network's ability to process features.
[0095] S303: Based on the adjusted network parameters, perform cyclic iterative training to optimize the feature recognition performance of the neural network, perform cyclic testing and verification, and generate optimized recognition records;
[0096] In each iterative training, parameters are adjusted based on the results of the previous training to gradually reduce prediction errors. The cyclic testing and verification process involves repeatedly using training and validation sets to test the model's performance on new data, ensuring that parameter adjustments for each iteration are based on comprehensive data analysis. The iterative process helps the model gradually achieve higher accuracy and generalization capabilities after multiple rounds of training. The generated optimization recognition records record in detail the parameter settings and performance of each iteration, providing a detailed reference for further model optimization and application.
[0097] See also Figure 5 , the specific steps of S4 are:
[0098] S401: Based on the optimized recognition records, image classification parameters are set, including color threshold and texture recognition sensitivity, and black and odorous water areas in the image are annotated to obtain a preliminary annotated image set;
[0099] Analyze and optimize the data in the recognition records to determine the most appropriate color threshold and texture sensitivity settings to most accurately mark the black and odorous water areas in the image. The adjustment of the color threshold is based on the statistical analysis of the color distribution in the image to distinguish the color range of normal water bodies and polluted water bodies. The texture recognition sensitivity is adjusted according to the texture characteristics of the water surface to ensure that the texture changes of different water surfaces can be effectively identified. The precise setting of these parameters is the key to achieving effective classification. The resulting preliminary annotated image set provides the basis for further analysis and processing.
[0100] S402: Using the preliminary annotated image set, adjusting color and texture filter parameters, calculating the texture difference value of each annotated black and odorous water area, refining the feature classification of each black and odorous water area, and generating refined annotated data;
[0101] The texture difference value of each marked black and odorous water area is calculated according to the formula:
[0102]
[0103] Calculate, where Indicates the texture difference value of each marked black and odorous water area, Representative The texture value of the pixel, Represents the texture average of all pixels in the selected area, used to describe the degree of texture balance in the area. and Represents the color mean of the water area and the non-water area, respectively, and is used to measure the color difference between the two. represents the surface area of the water body, The bounding perimeter representing the water area.
[0104] Represents the first The texture value of the pixel, .
[0105] Is the average texture value of all pixels in the selected area. If there are 10 pixels in the area and the total texture value is 200, then .
[0106] and They are the color mean of the water area and the non-water area obtained through color analysis, and the actual measurement. , .
[0107] and represent the surface area and perimeter of the water body, respectively, which are determined by Geographic Information System (GIS). square meters, rice.
[0108] Calculate the variance of texture differences:
[0109]
[0110]
[0111] Calculate the color difference:
[0112]
[0113] Calculate the shape index:
[0114]
[0115] Substitute all values into the formula to calculate :
[0116]
[0117] The results show that under the given texture and color data, the calculated texture difference value is 0.0403. The low value reflects the high uniformity of texture and color features within the region. This result is crucial for judging and classifying the texture and color characteristics of black and odorous water areas, and can be used for further data analysis and decision support.
[0118] S403: Based on the refined labeled data, the classification information of each black and odorous water body area is integrated and output to generate a labeled classification result;
[0119] Integrating the classification information of each black and odorous water area includes analyzing the refined labeled data, comparing the texture and color characteristics of each area, classifying areas with similar characteristics, and generating labeled classification results. This is the final stage in the black and odorous water body detection process. By integrating the detailed information of each labeled area, detailed classification results can be generated. The results will help subsequent water body management and research, provide scientific basis and data support, and are the basis for implementing water quality monitoring and improvement plans.
[0120] See also Figure 6 , the specific steps of S5 are:
[0121] S501: Based on the labeled classification results, set the identification criteria for each pollution level, calculate the confidence level of each pollution level, and obtain preliminary pollution level data;
[0122] The confidence level for each pollution level is calculated according to the formula:
[0123]
[0124] Calculate, where Indicates the confidence level for each pollution level, Represents the number of decision trees in the random forest, a parameter used to enhance the robustness of the model, represents the output pollution level of a single decision tree, Represents the average of the pollution levels output by all decision trees and is used to determine the central tendency of the ensemble model.
[0125] Set the parameter N, which represents the number of decision trees in the random forest; Represents the output pollution level of each decision tree, which is obtained by training and testing each decision tree based on the actual monitored pollution data; set The average pollution level output by all decision trees is calculated by to get the average.
[0126] The pollution levels output by five decision trees are collected as 3, 5, 4, 4 and 6. First, calculate the average , to determine :
[0127]
[0128] Calculate each and The sum of the absolute differences of :
[0129]
[0130]
[0131] Apply the formula to calculate confidence :
[0132]
[0133] The results show that the calculated pollution level has a confidence level of 0.42, indicating that the average pollution level of 4.4 is highly consistent and reliable across all decision tree outputs. Numerical results are crucial for assessing the extent of environmental pollution in specific regions, providing confidence in water pollution level assessments and further guiding environmental regulation.
[0134] S502: Using the preliminary pollution level data, compare the images of each level to determine the degree of water pollution and generate a refined pollution level classification;
[0135] Using the preliminary pollution level data, the images of each level are compared and the formula , determine the degree of water pollution. Represents the degree of pollution, Represents the pollution index of each level of image, Represents the weight of the corresponding pollution level. Consider three pollution levels, where the pollution index and the corresponding level weights , then the pollution degree is calculated as:
[0136]
[0137] The results show that the pollution level is 0.875, indicating that the water pollution is serious and measures need to be taken to control it. This value helps to more accurately classify water pollution and carry out detailed management and intervention at each level.
[0138] S503: Based on the refined pollution level classification, the pollution type is recorded, and a comprehensive assessment of the severity of water pollution is conducted to generate a black and odorous water body identification pollution determination result;
[0139] Based on refined pollution level classification, pollution data at all levels are integrated. By comparing and analyzing the characteristics of each pollution type, such as chemical composition and the presence of harmful organisms, a detailed assessment is conducted, and the specific information and distribution of each pollution type are recorded. The recording and evaluation of data are intended to better understand the pollution sources and pollution processes. The generated black and odorous water body identification pollution determination results will provide the necessary scientific basis for decision-making and guide future water quality improvement and pollution prevention and control strategies.
[0140] See also Figure 7 , the black and odorous water body identification system based on artificial intelligence includes:
[0141] The image acquisition module collects water body images, captures the natural state of the water body, records the color code of each pixel by adjusting the color threshold and contrast, compares it with the known spectral standard, selects the pixel area that matches the characteristics of black and odorous water bodies, and comprehensively generates spectral characteristic data;
[0142] The image processing module adjusts the neural network layer parameters, optimizes the weights and bias values based on the spectral characteristic data, rotates and scales the water image to maximize the perspective and size diversity of the image samples, and generates a transformed image set;
[0143] The data annotation module annotates the key water features of each transformed image based on the transformed image set, configures the initial forward propagation of the neural network, monitors the activation output of each layer, and obtains the forward propagation results;
[0144] The network training module uses the forward propagation results to start the backward propagation process, adjust the weights and bias parameters of the neural network, perform cyclic iterative training, perform cyclic testing and verification, and generate optimized recognition records;
[0145] The classification and discrimination module sets image classification parameters based on optimized recognition records, annotates black and odorous water areas in the image, calculates the texture difference value of each annotated black and odorous water area, integrates and outputs the classification information of each black and odorous water area, and generates annotated classification results;
[0146] Based on the labeled classification results, the assessment and decision-making module sets the identification criteria for each pollution level, calculates the confidence level of each pollution level, determines the degree of water pollution, conducts a comprehensive assessment of the severity of water pollution, and generates black and odorous water body identification and pollution judgment results.
[0147] The above are merely preferred embodiments of the present invention and do not limit the present invention in any other form. Any technician familiar with the profession may use the technical content disclosed above to change or modify it into an equivalent embodiment with equivalent changes and apply it to other fields. However, any simple modification, equivalent change and modification made to the above embodiment based on the technical essence of the present invention without departing from the content of the technical solution of the present invention shall still fall within the scope of protection of the technical solution of the present invention.
Claims
1. A black and odorous water body identification method based on artificial intelligence, characterized in that: The following steps are involved: Collect water body images, perform pixel-level analysis on them, calculate the spectral response of each pixel, analyze the color distribution, and screen image areas that match black and odorous characteristics by comparing spectral characteristics with color standards to generate spectral characteristic data. This includes: Collect water body images to capture the natural state of the water body, adjust the aperture and exposure settings to optimize image clarity and color saturation, and obtain a high-resolution water body image set; based on the high-resolution water body image set, record the color code of each pixel by adjusting the color threshold and contrast, classify and store the data, and generate pixel color data; based on the pixel color data, perform color matching and compare with known spectral standards to screen pixel areas that match the characteristics of black and odorous water bodies according to the formula: ; Calculate the difference from the spectral standard and generate spectral characteristic data, where Represents the degree of color matching. represents the color channel weight, Represents the actual pixel color value, represents the spectral standard color value, Indicates the number of color channels; According to the spectral characteristic data, the weights of the neural network layer are adjusted, the image is rotated and scaled, the diversity of the training samples is optimized, and the features of each transformed water body image are extracted to obtain an enhanced feature set; By using the enhanced feature set, forward propagation and backward propagation of the neural network are performed to optimize the weight and bias parameters of the neural network, optimize the feature recognition capability, distinguish water body images with different pollution levels, and generate optimized recognition records; Perform image classification based on the optimized recognition records, identify and annotate black and odorous water areas in the image, analyze texture and color differences within the black and odorous water areas, and output annotated classification results; specifically, including: Based on the optimized recognition record, image classification parameters are set, including a color threshold and texture recognition sensitivity, and black and odorous water areas in the image are annotated to obtain a preliminary annotated image set; using the preliminary annotated image set, color and texture filter parameters are adjusted, texture difference values of each annotated black and odorous water area are calculated, and feature classification of each black and odorous water area is refined to generate refined annotated data; based on the refined annotated data, classification information of each black and odorous water area is integrated and output to generate annotated classification results; Among them, the texture difference value of each marked black and odorous water area is calculated according to the formula: ; Calculate, where Indicates the texture difference value of each marked black and odorous water area, Representative The texture value of the pixel, Represents the texture average of all pixels in the selected area. and Represent the color mean of water area and non-water area respectively. represents the surface area of the water body, The perimeter of the boundary representing the water area; Based on the labeled classification results, the pollution level is assessed, and the water body images are sorted and classified according to the preset pollution level standards. By comparing the image features of the difference classification, the pollution level corresponding to each image is output, and the pollution judgment result of the black and odorous water body identification is generated.
2. The black and odorous water body identification method based on artificial intelligence according to claim 1 is characterized in that: The spectral characteristic data includes spectral response distribution results, color standard matching degree and image area screening indicators; the enhanced feature set includes image rotation characteristics, image scaling characteristics and feature diversity indicators; the optimized recognition record includes feature recognition accuracy, pollution degree discrimination index and network weight configuration; the annotation classification results include area annotation details, texture recognition data and color analysis results; the black and odorous water body identification and pollution judgment results include pollution level classification, image feature comparison indicators and pollution assessment data.
3. The black and odorous water body identification method based on artificial intelligence according to claim 1 is characterized in that: According to the spectral characteristic data, the weights of the neural network layer are adjusted, the image is rotated and scaled, the diversity of the training samples is optimized, and the features of each transformed water body image are extracted to obtain the enhanced feature set. The specific steps are as follows: Adjust the neural network layer parameters, optimize the weights and bias values according to the spectral characteristic data, and verify the adjustment effect according to the formula: ; Calculate and output optimized network parameters ,in, represents the original weight, represents the learning rate, represents the loss function, represents the gradient of the weight; Based on the optimized network parameters, rotating and scaling the water body image, setting the rotation angle range and scaling ratio, maximizing the image sample viewing angle and size diversity, and generating a transformed image set; Based on the transformed image set, key water body features of each transformed image are marked, image feature data are extracted and recorded, and the data are merged to obtain an enhanced feature set.
4. The black and odorous water body identification method based on artificial intelligence according to claim 1 is characterized in that: The specific steps of executing neural network forward propagation and backward propagation through the enhanced feature set, optimizing neural network weights and bias parameters, optimizing feature recognition capabilities, distinguishing water body images with different pollution levels, and generating optimized recognition records are as follows: Based on the enhanced feature set, configure the initial forward propagation of the neural network, set the input layer parameters, pass the feature data layer by layer, monitor the activation output of each layer, and obtain the forward propagation results; Using the forward propagation result, starting the backward propagation process, adjusting the weights and bias parameters of the neural network by adjusting the learning rate and error feedback, and generating adjusted network parameters; Based on the adjusted network parameters, cyclic iterative training is performed to optimize the feature recognition performance of the neural network, and cyclic testing and verification are performed to generate optimized recognition records.
5. The black and odorous water body identification method based on artificial intelligence according to claim 1 is characterized in that: Based on the labeled classification results, the pollution level is assessed. According to the preset pollution level standard, the water body images are sorted and classified. By comparing the image features of the difference classification, the pollution level corresponding to each image is output. The specific steps for generating the black and odorous water body identification pollution judgment result are as follows: Based on the labeled classification results, the identification criteria for each pollution level are set, the confidence level of each pollution level is calculated, and preliminary pollution level data is obtained; Using the preliminary pollution level data, the images of each level are compared according to the formula: ; Calculate the degree of water pollution and generate a refined pollution level classification, where: Represents the degree of pollution, Represents the pollution index of each level of image; Based on the refined pollution level classification, the pollution type is recorded, a comprehensive assessment of the severity of water pollution is conducted, and a pollution determination result for black and odorous water identification is generated.
6. The black and odorous water body identification method based on artificial intelligence according to claim 5 is characterized in that: The confidence level for each pollution level is given by the formula: ; Calculate, where Indicates the confidence level for each pollution level, represents the number of decision trees in the random forest, represents the output pollution level of a single decision tree, Represents the average pollution level output by all decision trees.
7. A black and odorous water body identification system based on artificial intelligence, characterized in that: The method for identifying black and odorous water bodies based on artificial intelligence according to any one of claims 1 to 6, wherein the system comprises: The image acquisition module collects water body images, captures the natural state of the water body, records the color code of each pixel by adjusting the color threshold and contrast, compares it with the known spectral standard, selects the pixel area that matches the characteristics of black and odorous water bodies, and comprehensively generates spectral characteristic data; The image processing module adjusts the parameters of the neural network layer, optimizes the weights and bias values according to the spectral characteristic data, rotates and scales the water body image to maximize the viewing angle and size diversity of the image samples, and generates a transformed image set; The data annotation module annotates key water features of each transformed image based on the transformed image set, configures the initial forward propagation of the neural network, monitors the activation output of each layer, and obtains the forward propagation result; The network training module uses the forward propagation results to start the backward propagation process, adjust the weights and bias parameters of the neural network, perform cyclic iterative training, perform cyclic testing and verification, and generate optimized recognition records; The classification and discrimination module sets image classification parameters based on the optimized recognition record, marks the black and odorous water body areas in the image, calculates the texture difference value of each marked black and odorous water body area, integrates and outputs the classification information of each black and odorous water body area, and generates a marked classification result; Based on the labeled classification results, the assessment and decision-making module sets the identification criteria for each pollution level, calculates the confidence level of each pollution level, determines the degree of water pollution, conducts a comprehensive assessment of the severity of water pollution, and generates black and odorous water body identification and pollution judgment results.
Citation Information
Patent Citations
Spectral index model-based black and odorous water body identification method and system
CN107167431A
Deep learning-based black and odorous water body remote sensing monitoring and grading method
CN116012726A