Dosage Control System for Sewage Purification Treatment Based on Machine Learning and Image Recognition
Through machine learning and image recognition technology, the dosage of drugs in sewage treatment is automatically controlled, which solves the problem of drug waste and achieves flexible control and efficient use of drug dosage.
Patent Information
- Application Number
- CN202311325979.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-13
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2043-10-13
AI Technical Summary
The dosage control of medicines is not flexible enough in the existing sewage treatment process, resulting in waste of medicines.
The sewage purification and treatment dose control system based on machine learning and image recognition is adopted. By obtaining the target underwater image and water quality information in the sewage tank, the characteristic values are extracted, and the frequency of the dosage pump is automatically controlled by using the prediction model to achieve accurate control of the dose.
It realizes flexible control of drug dosage, reduces drug waste, and improves sewage treatment efficiency.
Smart Images

Figure CN119080087B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of automatic control, and particularly to a chemical dosage control system for sewage purification treatment based on machine learning and image recognition. Background Art
[0002] Sewage treatment is the process of purifying sewage to meet the water quality requirements for discharging into a certain water body or for reuse. Sewage treatment is widely applied in various fields such as construction, agriculture, transportation, energy, petrochemical, environmental protection, urban landscape, medical care, and catering, and is also increasingly entering the daily lives of ordinary people.
[0003] In the prior art, during the sewage treatment process, the chemical dosage is mainly controlled according to human experience, and then the chemical agent is added according to the chemical dosage. This method is not flexible enough. Especially in some large sewage treatment plants, the control of the chemical dosage is mainly achieved by adjusting the flow rate regularly to control the chemical dosage, which will cause waste of the chemical agent. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide a chemical dosage control system for sewage purification treatment based on machine learning and image recognition to solve the problems that the chemical dosage control in the prior art is not flexible enough and is prone to cause waste of the chemical agent.
[0005] To achieve the above purpose, the present invention adopts the following technical solutions:
[0006] The chemical dosage control system for sewage purification treatment based on machine learning and image recognition of the present invention includes:
[0007] A first acquisition module for acquiring a target underwater image in the sewage tank and water quality information in the sewage tank;
[0008] A first feature extraction module for extracting the feature values of the target underwater image;
[0009] A first quantification module for inputting the water quality information and the feature values into a pre-established prediction model to obtain the predicted frequency of the chemical dosing pump, wherein the frequency of the chemical dosing pump is proportional to the chemical dosage per unit time;
[0010] A first control module for controlling the chemical dosing pump to perform a chemical addition action based on the predicted frequency.
[0011] In an embodiment of the present application, acquiring a target underwater image in the sewage tank includes:
[0012] Acquiring multiple underwater images P of the sewage tank taken continuously i ;
[0013] Calculate the clarity D(P i ) of each underwater image P i );
[0014] Determine the highest clarity value D i (P max ) of the multiple underwater images P i , and use the underwater image corresponding to the highest clarity value D max (P i ) as the target underwater image.
[0015] In an embodiment of the present application, calculating the clarity D(P i ) of each underwater image P i includes:
[0016] Convert each underwater image P i into a grayscale image G i ;
[0017] Based on the segmentation grid, divide each grayscale image G i into multiple regions;
[0018] Randomly select a target region from the multiple regions, and calculate the variance of the pixel grayscale values of the target region in each grayscale image G i ;
[0019] Use the variance of the pixel grayscale values as the clarity D(P i ) of the corresponding grayscale image G i , where the larger the variance of the pixel grayscale values , the higher the clarity.
[0020] In an embodiment of the present application, extracting the eigenvalue of the target underwater image includes:
[0021] Perform centering processing on the target underwater image to obtain a first intermediate image;
[0022] Convert the first intermediate image into a grayscale image G t ;
[0023] Perform median filtering processing on the grayscale image G t to obtain a second intermediate image;
[0024] Adjust the brightness of the second intermediate image to obtain a third intermediate image, so that the suspended particle contours in the third intermediate image are clearer;
[0025] Determine the distribution uniformity of the suspended particles in the third intermediate image, and when the distribution uniformity of the suspended particles in the third intermediate image is greater than a preset first threshold, extract the size and number of the suspended particles in the third intermediate image;
[0026] Construct the eigenvalue of the target underwater image based on the size and number of the suspended particles.
[0027] In an embodiment of the present application, determining the distribution uniformity of the suspended particles in the third intermediate image includes:
[0028] Extract the contour features in the third intermediate image;
[0029] When any one of the contour features meets the target conditions, use the contour feature as the contour of the suspended particle. The target conditions include: (1) the contour feature forms a closed figure; (2) the pixel values of the pixel points within the closed figure are within a preset pixel value range;
[0030] Divide the third intermediate image into multiple regions, and determine the number C of suspended particles in each region n and the average size S of the suspended particles n , where the number of suspended particles is the number of contours of the suspended particles, and the size of the suspended particles is the number of pixel points within the contour of the suspended particle;
[0031] Based on the number C of suspended particles in each region n and the average size S of the suspended particles n Calculate the distribution uniformity U of the suspended particles in the third intermediate image. The mathematical expression of the distribution uniformity U is:
[0032]
[0033] In the formula, α is the first weight factor, β is the second weight factor, C is the average value of the number of suspended particles in multiple regions, and S is the average value of the average size of the suspended particles in multiple regions.
[0034] In an embodiment of the present application, determining the number C of suspended particles in each region n and the average size S of the suspended particles n , includes:
[0035] Judge whether the contour of each suspended particle is only located in one region. If so, increase the number of suspended particles in the corresponding region by one, and associate the contour of the suspended particle with the corresponding region; if not, increase the number of the proportion of the contour of the suspended particle in the corresponding multiple regions, and associate the contour of the suspended particle with the corresponding multiple regions;
[0036] Accumulate the number of suspended particles in each area to obtain the number C of suspended particles in each area n ; Calculate the average value of the number of pixel points in the contour of the suspended particles associated with each area to obtain the average size S of the suspended particles n .
[0037] In an embodiment of the present application, constructing the eigenvalue of the target underwater image based on the size and number of suspended particles includes:
[0038] Calculate the average value A and standard deviation σ of the size of the suspended particles in the third intermediate image;
[0039] Construct the distribution range [(A - σ), (A + σ)] of the size of the suspended particles in the third intermediate image based on the average value A and the standard deviation σ;
[0040] Construct the eigenvalue of the target underwater image based on the distribution range [(A - σ), (A + σ)] of the size of the suspended particles and the number of suspended particles.
[0041] In an embodiment of the present application, the following method is also included to establish a prediction model:
[0042] Obtain water quality sample information and a sample image containing suspended particles, where the sample image is an underwater image collected in the previous control cycle;
[0043] Perform manual annotation on the water quality sample information and the sample image to obtain a data label, where the data label is the frequency information of the chemical dosing pump;
[0044] Extract the eigenvalue of the sample image, and construct a training dataset based on the eigenvalue of the sample image, the water quality sample information, and the data label;
[0045] Train an artificial neural network based on the training dataset to obtain a prediction model.
[0046] In an embodiment of the present application, it further includes:
[0047] A second acquisition module for acquiring an underwater feedback image of the purified sewage tank;
[0048] A second feature extraction module for extracting the eigenvalue of the underwater feedback image;
[0049] A first comparison module for comparing the eigenvalue of the underwater feedback image with a preset feature reference value;
[0050] An adjustment module, configured to adjust the operating frequency of the chemical dosing pump when the difference between the eigenvalue of the underwater feedback image and a preset feature reference value exceeds a preset second threshold, so that the difference between the eigenvalue of the underwater feedback image and the preset feature reference value does not exceed the preset second threshold.
[0051] In an embodiment of the present application, it further includes:
[0052] A third acquisition module, configured to acquire the actual operating frequency of the chemical dosing pump;
[0053] A second comparison module, configured to compare the actual operating frequency with the predicted frequency;
[0054] A feedback and adjustment module, configured to, when the difference between the actual operating frequency and the predicted frequency is greater than a preset third threshold, feedback the predicted frequency and the actual operating frequency to the front-end module, and send the predicted frequency to the controller through a pre-set process control data interface, so as to adjust the actual operating frequency of the chemical dosing pump to the predicted frequency.
[0055] The beneficial effects of the present invention are as follows: The chemical dosing control system for sewage purification treatment based on machine learning and image recognition of the present invention acquires the target underwater image in the sewage tank and the water quality information in the sewage tank through the first acquisition module; the first feature extraction module extracts the eigenvalue of the target underwater image; the first quantification module inputs the water quality information and the eigenvalue into a pre-established prediction model to obtain the predicted frequency of the chemical dosing pump, where the frequency of the chemical dosing pump is proportional to the chemical dosing amount per unit time; the first control module controls the chemical dosing pump to perform a chemical dosing action based on the predicted frequency. This application establishes a prediction model to obtain the relationship between the chemical dosing amount and the underwater eigenvalue and water quality information, so as to determine the predicted frequency of the chemical dosing pump through the extracted underwater image eigenvalue and water quality information, thereby automatically controlling the chemical dosing amount. Description of the Drawings
[0056] The present invention will be further described below with reference to the drawings and embodiments:
[0057] Figure 1 It is a structural diagram of a chemical dosing control system for sewage purification treatment based on machine learning and image recognition in an embodiment of the present invention;
[0058] Figure 2 It is a flowchart of a chemical dosing control method for sewage purification treatment based on machine learning and image recognition in an embodiment of the present invention. Detailed Embodiments
[0059] The following describes the implementation modes of the present invention through specific examples. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific implementation modes. All details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, without conflict, the following embodiments and the features in the embodiments can be combined with each other.
[0060] It should be noted that the diagrams provided in the following embodiments only illustrate the basic concept of the present invention in a schematic manner. Therefore, only the layers related to the present invention are shown in the diagrams, rather than being drawn according to the number, shape, and size of the layers in actual implementation. The type, quantity, and ratio of each layer in actual implementation can be arbitrarily changed, and the layer layout type may also be more complex.
[0061] In the following description, a large number of details are explored to provide a more thorough explanation of the embodiments of the present invention. However, it is obvious to those skilled in the art that the embodiments of the present invention can be implemented without these specific details.
[0062] Figure 1 It is a structural diagram of a sewage purification treatment chemical dosage control system based on machine learning and image recognition shown in an embodiment of the present application, as Figure 1 shown: including:
[0063] A first acquisition module, configured to acquire a target underwater image in the sewage tank and water quality information in the sewage tank. Among them, multiple underwater images are acquired by a camera preset in the sewage tank, and the camera transmits the underwater images to a computer host in the computer room through a data cable for storage; the computer host screens the multiple underwater images to obtain the target underwater image with the highest clarity. The water quality information includes pH value, water temperature, turbidity, total nitrogen, total phosphorus, influent flow rate, and effluent flow rate.
[0064] Specifically, the target underwater image is acquired through the following process:
[0065] Acquire multiple underwater images P of the continuously photographed sewage tank i ;
[0066] Calculate the clarity D(P i ) of each underwater image P i ;
[0067] Determine the highest clarity value D i (P max ) of the multiple underwater images P i , and use the highest clarity value D max (P i)The corresponding underwater image is used as the target underwater image.
[0068] In an embodiment of the present application, the clarity D(P i ) of each underwater image P i ) is calculated, including:
[0069] Convert each underwater image P i into a grayscale image G i ;
[0070] Based on the segmentation grid, each grayscale image G i is segmented into multiple regions;
[0071] Randomly select a target region from the multiple regions, and calculate the variance of the pixel gray values of the target region in each grayscale image G i ;
[0072] Take the variance of the pixel gray values as the clarity D(P i ) of the corresponding grayscale image G i ), where the larger the variance of the pixel gray values , the higher the clarity.
[0073] The present application utilizes the continuous shooting function of the camera to take multiple images each time, and then calculates the clarity after converting each image into a grayscale image.
[0074] The present application determines the clarity by calculating the variance of the pixel gray values. Generally, the larger the variance of the gray values, the clearer the overall image. In order to improve the calculation speed, the present application divides the image into 9 regions of 3*3 and calculates the variance of the gray values in the middle region, thereby simplifying the calculation process.
[0075] The first feature extraction module is used to extract the feature values of the target underwater image. The feature values in the present application include the number of suspended particles and the size of the suspended particles. Among them, the size of the suspended particles is represented by the average size and the standard deviation. The average size reflects the overall size of the suspended particles, and the standard deviation reflects the size uniformity of the suspended particles.
[0076] Specifically, extracting the feature values of the target underwater image includes:
[0077] Perform centering processing on the target underwater image to obtain a first intermediate image;
[0078] Convert the first intermediate image into a grayscale image G t ;
[0079] Perform processing on the grayscale image G tPerform median filtering to obtain a second intermediate image;
[0080] Adjust the brightness of the second intermediate image to obtain a third intermediate image, so that the suspended particle contours in the third intermediate image are clearer;
[0081] Determine the distribution uniformity of the suspended particles in the third intermediate image, and when the distribution uniformity of the suspended particles in the third intermediate image is greater than a preset first threshold, extract the suspended particle size and the number of suspended particles in the third intermediate image;
[0082] Construct the eigenvalue of the target underwater image based on the suspended particle size and the number of suspended particles.
[0083] Through a series of image preprocessings in this application, subsequent feature extraction is made more accurate and fast. The preprocessing methods include centering processing, grayscale conversion, median filtering, and brightness adjustment.
[0084] To exclude the influence of water flow on the morphology of suspended particles, this application also calculates the distribution uniformity of the suspended particles in the preprocessed image, and after ensuring that the suspended particles are evenly distributed in the image, then performs feature extraction to ensure that the extracted eigenvalues can accurately reflect the reaction situation between sewage and water purification agents.
[0085] In an embodiment of this application, determining the distribution uniformity of the suspended particles in the third intermediate image includes:
[0086] Extract the contour features in the third intermediate image;
[0087] When any one of the contour features meets the target conditions, use the contour feature as the contour of the suspended particle. The target conditions include: (1) The contour feature forms a closed figure; (2) The pixel values of the pixel points within the closed figure are within a preset pixel value range;
[0088] Divide the third intermediate image into multiple regions, and determine the number of suspended particles C in each region n and the average size S of the suspended particles n , where the number of suspended particles is the number of contours of the suspended particles, and the size of the suspended particle is the number of pixel points within the contour of the suspended particle;
[0089] Based on the number of suspended particles C in each region n and the average size S of the suspended particles n Calculate the distribution uniformity U of the suspended particles in the third intermediate image. The mathematical expression of the distribution uniformity U is:
[0090]
[0091] Wherein, α is the first weight factor, β is the second weight factor, C is the average value of the number of suspended particles in multiple regions, and S is the average value of the average size of the suspended particles in multiple regions.
[0092] In this application, target conditions are set to screen out suspended particles. Then, by dividing the image into multiple regions, calculating the number of suspended particles and the average size of the suspended particles in each region, and finally calculating the variance, the distribution uniformity U of the overall suspended particles can be obtained.
[0093] Specifically, determine the number C of suspended particles in each region n and the average size S of the suspended particles n , including:
[0094] Judge whether the contour of each suspended particle is only located in one region. If so, add 1 to the number of suspended particles in the corresponding region, and associate the contour of the suspended particle with the corresponding region; if not, increase the number of the proportion of the contour of the suspended particle in the corresponding multiple regions, and associate the contour of the suspended particle with the corresponding multiple regions;
[0095] Accumulate the number of suspended particles in each region to obtain the number C of suspended particles in each region n ; calculate the average value of the number of pixel points in the contour of the suspended particles associated with each region to obtain the average size Sn of the suspended particles.
[0096] In this application, when determining the number of suspended particles in each region, it is based on the actual distribution of the suspended particles. For example, if the suspended particle A is distributed in both region 1 and region 2, where the proportion of region 1 is 0.4 and the proportion of region 2 is 0.6, then when counting, the number of region 1 is accumulated by 0.4, and the number of region 2 is accumulated by 0.6. The average size of the suspended particles is determined based on the area of the complete contour of the suspended particles. For example, if the area of the suspended particle A is S, then when calculating the average area of the suspended particles in region 1, the corresponding area of the suspended particle A is S, and when calculating the average area of the suspended particles in region 2, the corresponding area of the suspended particle A is also S.
[0097] If the distribution uniformity of the suspended particles in the image meets the preset requirements, then the feature values of the target underwater image can be further extracted. Specifically, the feature values of the target underwater image are constructed based on the size and number of the suspended particles, including:
[0098] Calculate the average value A and the standard deviation σ of the size of the suspended particles in the third intermediate image;
[0099] Construct the distribution range of the suspended particle size in the third intermediate image [(A - σ), (A + σ)] based on the average value A and the standard deviation σ;
[0100] Construct the eigenvalue of the target underwater image based on the distribution range of the suspended particle size [(A - σ), (A + σ)] and the number of suspended particles.
[0101] The more fully the particles in the sewage react with the medicament, the larger, fewer and more uniform the suspended particles are. Among them, the average value A and the standard deviation σ of the suspended particle size are used to characterize the size and uniformity of the suspended particles. Combining the number of suspended particles, an eigenvalue that can reflect the reaction degree of the sewage and the medicament can be constructed.
[0102] The first quantification module is used to input the water quality information and the eigenvalue into a pre-established prediction model to obtain the predicted frequency of the dosing pump, where the frequency of the dosing pump is proportional to the dosing amount per unit time;
[0103] The first control module is used to control the dosing pump to perform a dosing action based on the predicted frequency.
[0104] In an embodiment of the present application, the following method is further included to establish a prediction model:
[0105] Obtain water quality sample information and a sample image containing suspended particles, where the sample image is an underwater image collected in the previous control cycle;
[0106] Perform manual annotation on the water quality sample information and the sample image to obtain a data label, where the data label is the frequency information of the dosing pump;
[0107] Extract the eigenvalue of the sample image, and construct a training data set based on the eigenvalue of the sample image, the water quality sample information and the data label;
[0108] Train an artificial neural network based on the training data set to obtain a prediction model.
[0109] The present application uses an artificial neural network to train a prediction model, so as to obtain the corresponding relationship between water quality information, eigenvalue and dosing amount.
[0110] In an embodiment of the present application, the following is further included:
[0111] The second acquisition module is used to acquire an underwater feedback image of the purified sewage tank;
[0112] The second feature extraction module is used to extract the eigenvalue of the underwater feedback image;
[0113] A first comparison module for comparing the eigenvalue of the underwater feedback image with a preset eigenvalue reference value;
[0114] An adjustment module for adjusting the operating frequency of the chemical dosing pump when the difference between the eigenvalue of the underwater feedback image and the preset eigenvalue reference value exceeds a preset second threshold, so that the difference between the eigenvalue of the underwater feedback image and the preset eigenvalue reference value does not exceed the preset second threshold.
[0115] The present application can also perform feedback based on the above process to adjust the chemical dosage in real time to ensure that the sewage can fully react with the chemical agent.
[0116] In an embodiment of the present application, it further includes:
[0117] A third acquisition module for acquiring the actual operating frequency of the chemical dosing pump;
[0118] A second comparison module for comparing the actual operating frequency with the predicted frequency;
[0119] A feedback and adjustment module for, when the difference between the actual operating frequency and the predicted frequency is greater than a preset third threshold, feeding back the predicted frequency and the actual operating frequency to the front-end module, and sending the predicted frequency to the controller through a preset process control data interface to adjust the actual operating frequency of the chemical dosing pump to the predicted frequency.
[0120] The present application also uses a backup channel. When the difference between the actual operating frequency of the chemical dosing pump and the control frequency is large, it indicates that there may be a problem with the channel. At this time, the control frequency is sent to the controller through the preset process control data interface to correct the actual operating frequency of the chemical dosing pump.
[0121] The chemical dosage control system for sewage purification treatment based on machine learning and image recognition of the present invention acquires a target underwater image in the sewage tank and water quality information in the sewage tank through a first acquisition module; a first feature extraction module extracts the eigenvalue of the target underwater image; a first quantification module inputs the water quality information and the eigenvalue into a pre-established prediction model to obtain the predicted frequency of the chemical dosing pump, wherein the frequency of the chemical dosing pump is proportional to the chemical dosage per unit time; a first control module controls the chemical dosing pump to perform a chemical dosing action based on the predicted frequency. The present application establishes a prediction model to obtain the relationship between the chemical dosage and the underwater eigenvalue and water quality information, so as to determine the predicted frequency of the chemical dosing pump through the extracted eigenvalue of the underwater image and water quality information, thereby automatically controlling the chemical dosage.
[0122] As Figure 2 shown, the present application also provides a chemical dosage control method for sewage purification treatment based on machine learning and image recognition, including:
[0123] S1. Obtain the target underwater image in the sewage tank and the water quality information in the sewage tank;
[0124] S2. Extract the eigenvalue of the target underwater image;
[0125] S3. Input the water quality information and the eigenvalue into a pre-established prediction model to obtain the predicted frequency of the chemical dosing pump, where the frequency of the chemical dosing pump is proportional to the chemical dosage per unit time;
[0126] S4. Control the chemical dosing pump to perform the chemical dosing action based on the predicted frequency.
[0127] The method for controlling the chemical dosage in sewage purification treatment based on machine learning and image recognition of the present invention obtains the target underwater image in the sewage tank and the water quality information in the sewage tank through the first acquisition module; the first feature extraction module extracts the eigenvalue of the target underwater image; the first quantification module inputs the water quality information and the eigenvalue into a pre-established prediction model to obtain the predicted frequency of the chemical dosing pump, where the frequency of the chemical dosing pump is proportional to the chemical dosage per unit time; the first control module controls the chemical dosing pump to perform the chemical dosing action based on the predicted frequency. This application establishes a prediction model to obtain the relationship between the chemical dosage and the underwater eigenvalue and water quality information, so as to determine the predicted frequency of the chemical dosing pump through the extracted eigenvalue of the underwater image and water quality information, thereby automatically controlling the chemical dosage.
[0128] This embodiment also provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, it implements any one of the methods in this embodiment, where the method is the execution logic of this system.
[0129] This embodiment also provides an electronic terminal, including: a processor and a memory;
[0130] The memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory so that the terminal executes any one of the methods in this embodiment.
[0131] For the computer-readable storage medium in this embodiment, those of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by hardware related to the computer program. The aforementioned computer program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps including the above method embodiments; and the aforementioned storage medium includes: various media such as ROM, RAM, magnetic disk, or optical disc that can store program codes.
[0132] The electronic terminal provided in this embodiment includes a processor, a memory, a transceiver, and a communication interface. The memory and the communication interface are connected to the processor and the transceiver and complete communication therebetween. The memory is used to store computer programs, the communication interface is used for communication, and the processor and the transceiver are used to run the computer programs to enable the electronic terminal to execute each step of the above method.
[0133] In this embodiment, the memory may include a random access memory (RAM), and may also include a non-volatile memory, such as at least one disk memory.
[0134] The above-mentioned processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0135] In the above embodiments, although the present invention has been described in combination with specific embodiments of the present invention, many substitutions, modifications, and variations of these embodiments will be obvious to those of ordinary skill in the art according to the previous description. The embodiments of the present invention are intended to cover all such substitutions, modifications, and variations that fall within the broad scope of the appended claims.
[0136] The above embodiments are only illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Any person familiar with this technology can modify or change the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or changes made by those of ordinary skill in the art in the technical field without departing from the spirit and technical idea disclosed by the present invention should still be covered by the claims of the present invention.
Claims
1. A chemical dosage control system for sewage purification treatment based on machine learning and image recognition, characterized in that Including: A first acquisition module, configured to acquire a target underwater image in the sewage tank and water quality information in the sewage tank; A first feature extraction module, configured to extract feature values of the target underwater image; Extracting the characteristic value of the target underwater image includes: performing centralization processing on the target underwater image to obtain a first intermediate image; converting the first intermediate image into a grayscale image ; For the grayscale image Perform median filtering to obtain a second intermediate image; adjust the brightness of the second intermediate image to obtain a third intermediate image so that the outline of the suspended particles in the third intermediate image is clearer; determine the uniformity of the distribution of the suspended particles in the third intermediate image, and when the uniformity of the distribution of the suspended particles in the third intermediate image is greater than a preset first threshold, extract the size and number of the suspended particles in the third intermediate image; construct a feature value of the target underwater image based on the size and number of the suspended particles; determine the uniformity of the distribution of the suspended particles in the third intermediate image, including: extracting contour features in the third intermediate image; when any contour feature meets the target condition, use the contour feature as the contour of the suspended particle, the target condition including: (1) the contour feature forms a closed figure; (2) the pixel value of the pixel point in the closed figure is within a preset pixel value range; divide the third intermediate image into multiple areas, and determine the number of suspended particles in each area. and the average size of suspended particles , wherein the number of suspended particles is the number of outlines of suspended particles, and the size of suspended particles is the number of pixels within the outline of suspended particles; based on the number of suspended particles in each area and the average size of suspended particles Calculate the distribution uniformity of the suspended particles in the third intermediate image , the distribution uniformity The mathematical expression is: In the formula, is the first weight factor, is the second weight factor, is the average number of suspended particles in multiple areas, is the average value of the average size of the suspended particles in multiple areas; constructing the characteristic value of the target underwater image based on the suspended particle size and the number of suspended particles, including: calculating the average value of the suspended particle size in the third intermediate image and standard deviation ; Based on the average and the standard deviation Constructing the distribution range of the suspended particle size in the third intermediate image ; Based on the distribution range of the suspended particle size and the number of suspended particles to construct a characteristic value of the target underwater image; A first quantification module, configured to input the water quality information and the feature values into a pre-established prediction model to obtain a predicted frequency of the chemical dosing pump, wherein the frequency of the chemical dosing pump is proportional to the chemical dosing amount per unit time; A first control module, configured to control the chemical dosing pump to perform a chemical dosing action based on the predicted frequency.
2. The medicine dosage control system for sewage purification treatment based on machine learning and image recognition according to claim 1, wherein, Acquiring a target underwater image in the sewage tank includes: Obtain multiple underwater images of the sewage pool taken continuously ; Calculate the clarity of each underwater image ; ; Determine the highest sharpness value of the multiple underwater images and use the underwater image corresponding to the highest sharpness value as the target underwater image. 3. The sewage purification treatment chemical dosage control system based on machine learning and image recognition according to claim 2, wherein Calculate the clarity of each underwater image including : Convert each underwater image to a grayscale image ; Based on the segmented grid, each grayscale image is segmented into multiple regions; Randomly select a target region from the multiple regions and calculate the variance of the pixel gray values of the target region in each grayscale image in the target region ; Take the variance of the pixel gray values as the sharpness of the corresponding grayscale image , where the larger the variance of the pixel gray values , the higher the sharpness. 4. The medicine dosage control system for sewage purification treatment based on machine learning and image recognition according to claim 1, wherein, Determine the number of suspended particles in each area and the average size of the suspended particles , including: Judging whether the contour of each suspended particle is only located in one area. If so, the number of suspended particles in the corresponding area is incremented by one, and the contour of the suspended particle is associated with the corresponding area; if not, the number of the proportion of the contour of the suspended particle is incremented in the corresponding multiple areas, and the contour of the suspended particle is associated with the corresponding multiple areas; Accumulate the number of suspended particles in each area to obtain the number of suspended particles in each area ; Calculate the average value of the number of pixel points in the contour of the suspended particles associated with each area to obtain the average size of the suspended particles .
5. The chemical dosage control system for sewage purification treatment based on machine learning and image recognition according to claim 1, wherein, The method for establishing a prediction model also includes: Acquiring water quality sample information and a sample image including suspended particles, wherein the sample image is an underwater image acquired in the previous control cycle; Performing manual annotation on the water quality sample information and the sample image to obtain a data label, wherein the data label is frequency information of the chemical dosing pump; Extracting feature values of the sample image, and constructing a training data set based on the feature values of the sample image, the water quality sample information, and the data label; Training an artificial neural network based on the training data set to obtain a prediction model.
6. The chemical dosage control system for sewage purification treatment based on machine learning and image recognition according to claim 1, wherein It also includes: A second acquisition module, configured to acquire an underwater feedback image of the purified sewage tank; A second feature extraction module, configured to extract feature values of the underwater feedback image; A first comparison module, configured to compare the feature values of the underwater feedback image with a preset feature reference value; An adjustment module, configured to adjust the operating frequency of the chemical dosing pump when the difference between the feature values of the underwater feedback image and the preset feature reference value exceeds a preset second threshold, so that the difference between the feature values of the underwater feedback image and the preset feature reference value does not exceed the preset second threshold.
7. The dosage control system for sewage purification treatment based on machine learning and image recognition according to claim 1, characterized in that, It also includes: A third acquisition module, configured to acquire the actual operating frequency of the chemical dosing pump; A second comparison module, configured to compare the actual operating frequency with the predicted frequency; A feedback and adjustment module, configured to, when the difference between the actual operating frequency and the predicted frequency is greater than a preset third threshold, feedback the predicted frequency and the actual operating frequency to the front-end module, and send the predicted frequency to the controller through a pre-set process control data interface to adjust the actual operating frequency of the chemical dosing pump to the predicted frequency.
Citation Information
Patent Citations
Sewage purification treatment agent dosage control system based on big data learning and image recognition
CN115367823A
Method and device for detecting premixing uniformity of cement-based material system, storage medium and terminal
CN116721056A
Cited By
Sewage purification treatment agent dosage control method and system based on image recognition
CN119091165A
Sewage purification treatment drug dosage control method and system based on image recognition
CN119091165B