Dosing control method in water treatment process based on machine vision
By combining machine vision technology with neural networks, real-time analysis of effluent and floc images, combined with a variety of water inlet parameters, solves the problem of inaccurate dosage control and achieves precise control and cost reduction of the water treatment process.
Patent Information
- Application Number
- CN202410743912.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-11
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-06-11
AI Technical Summary
Existing water treatment technology has inaccurate dosage control, mainly due to its reliance on manual analysis and limited inlet water parameters, which cannot effectively reflect changes in the water treatment process, making it difficult to control effluent water quality.
Using a method based on machine vision, by acquiring the effluent image and the floc image in the flocculation tank, combined with the inlet water pH, inlet water temperature, inlet water turbidity and inlet water flow rate, the pre-built image brightness and turbidity mapping curve and neural Network, real-time adjustment of dosage, achieving precise control of the water treatment process.
It improves the accuracy of dosage control, reduces costs, avoids the need for on-site configuration of special turbidity detection equipment, and ensures the excellence of effluent water quality.
Smart Images

Figure CN118307109B_ABST
Abstract
Description
Background Art
[0002] Water treatment is the process of removing abnormal substances in water that are not necessary for production or life through physical, chemical, biological and other means. As an important link in the water treatment process, dosing plays a decisive role in the effect of water treatment.
[0003] At present, the dosage is controlled by manually analyzing the water intake, but this method has the problem of inaccurate dosage control.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0005] The purpose of the present disclosure is to provide a method for controlling dosing in a water treatment process based on machine vision, thereby overcoming the problem of inaccurate dosing control in current water treatment at least to a certain extent.
[0006] According to a first aspect of the present disclosure, a method for controlling dosing in a water treatment process based on machine vision is provided, comprising: acquiring an image of effluent water and determining the brightness of the image of effluent water; determining the turbidity of effluent water according to the brightness of the image of effluent water and using a pre-constructed mapping curve between image brightness and turbidity; acquiring inlet water pH, inlet water temperature, inlet water turbidity, inlet water flow rate and a flocculent image taken by an underwater camera in a flocculation tank; controlling the amount of dosing in the water treatment process according to the effluent water turbidity, inlet water pH, inlet water temperature, inlet water turbidity, inlet water flow rate and flocculent image; wherein the process of constructing a mapping curve between image brightness and turbidity comprises: acquiring images of a plurality of water samples, each water sample having a different turbidity; determining the brightness of the image of each water sample; detecting the turbidity of each water sample; and fitting a mapping curve between image brightness and turbidity according to the brightness and turbidity of the image of each water sample.
[0007] Optionally, controlling the dosage of drugs in the water treatment process according to the effluent turbidity, inlet water pH, inlet water temperature, inlet water turbidity, inlet water flow rate and floc image includes: extracting floc features of the floc image and generating a floc text containing the floc features; generating an effluent turbidity text using the effluent turbidity, and generating an inlet water parameter text using the inlet water pH, inlet water temperature, inlet water turbidity and inlet water flow rate; splicing the floc text, the effluent turbidity text and the inlet water parameter text to generate a target text; determining a target dosage level corresponding to the target text; and controlling the dosage of drugs in the water treatment process according to the target dosage level.
[0008] Optionally, extracting floc features of the floc image and generating floc text containing the floc features includes: extracting the floc features of the floc image using a trained first neural network and converting the floc features into floc text; wherein the floc features include the shape, size and number per unit area of the flocs.
[0009] Optionally, the dosing control method also includes: acquiring a sample set, the sample set including a plurality of sample pairs, each sample pair including a floc sample image and a floc sample text corresponding to the floc sample image; extracting features of the floc sample image using a first neural network; extracting features of the floc sample text corresponding to the floc sample image using a bidirectional transformer; calculating the similarity between the features of the floc sample image and the features of the floc sample text, and executing a stochastic gradient descent algorithm based on the result of the similarity to update the parameters of the first neural network and the parameters of the bidirectional transformer; and determining the first neural network after parameter update using the sample set as the trained first neural network.
[0010] Optionally, determining a target dosage level corresponding to a target text includes: inputting the target text into a trained second neural network to determine a target dosage level corresponding to the target text; wherein the second neural network includes an embedding layer, a feature extraction layer, and a fully connected layer; converting the target text into an initial feature matrix through the embedding layer; performing feature extraction on the initial feature matrix through the feature extraction layer to obtain an intermediate feature matrix; and mapping the intermediate feature matrix to the target dosage level through the fully connected layer.
[0011] Optionally, the target dosage level corresponds to a target dosage range; wherein, controlling the dosage in the water treatment process according to the target dosage level includes: determining the remaining dosage of the dosage station and the next dosage time; determining the time range when the dosage station is out of dosage according to the remaining dosage and the target dosage range; if the next dosage time is within the time range when the dosage station is out of dosage, then determining the target dosage corresponding to the time point of the next dosage time according to the time range when the dosage station is out of dosage, the next dosage time, and the target dosage range; and controlling the dosage equipment to add dosage according to the target dosage.
[0012] Optionally, obtaining a flocculation image taken by an underwater camera in the flocculation tank includes: sending a shooting instruction to the underwater camera in the flocculation tank at predetermined time intervals; obtaining a first candidate image set shot and fed back by the underwater camera in response to the shooting instruction; the shooting time interval between two consecutive images in the first candidate image set is greater than a time threshold; calculating the similarity between each candidate image in the first candidate image set, and eliminating one or more candidate images whose similarity is less than the similarity threshold from the first candidate image set to obtain a second candidate image set; determining the image quality of each candidate image in the second candidate image set; and selecting a candidate image with the best image quality from the second candidate image set as the flocculation image.
[0013] According to a second aspect of the present disclosure, a dosing control device in a water treatment process based on machine vision is provided, comprising: a brightness determination module, used to obtain an effluent image and determine the brightness of the effluent image; a turbidity determination module, used to determine the effluent turbidity according to the brightness of the effluent image and using a pre-constructed mapping curve between image brightness and turbidity; a data acquisition module, used to obtain influent pH, influent temperature, influent turbidity, influent flow rate and a floc image taken by an underwater camera in a flocculation tank; a dosing amount control module, used to control the dosing amount in the water treatment process according to the effluent turbidity, influent pH, influent temperature, influent turbidity, influent flow rate and floc image; wherein the turbidity determination module is also used to construct a mapping curve between image brightness and turbidity, and the process of constructing the mapping curve between image brightness and turbidity includes: obtaining images of multiple water samples, each water sample having a different turbidity; determining the brightness of the image of each water sample; detecting the turbidity of each water sample; and fitting a mapping curve between image brightness and turbidity according to the brightness and turbidity of the image of each water sample.
[0014] Optionally, the dosage control module is configured to perform: extracting floc features of the floc image and generating a floc text containing the floc features; generating an effluent turbidity text using the effluent turbidity, and generating an inlet parameter text using the inlet pH, inlet temperature, inlet turbidity, and inlet flow; splicing the floc text, the effluent turbidity text, and the inlet parameter text to generate a target text; determining a target dosage level corresponding to the target text; and controlling the dosage in the water treatment process according to the target dosage level.
[0015] Optionally, the dosage control module is configured to execute: extracting floc features of the floc image using a trained first neural network, and converting the floc features into floc text; wherein the floc features include the shape, size and quantity per unit area of the flocs.
[0016] Optionally, the dosage control module is further configured to execute: acquiring a sample set, the sample set comprising a plurality of sample pairs, each sample pair comprising a floc sample image and a floc sample text corresponding to the floc sample image; extracting features of the floc sample image using a first neural network; extracting features of the floc sample text corresponding to the floc sample image using a bidirectional transformer; calculating the similarity between the features of the floc sample image and the features of the floc sample text, and executing a stochastic gradient descent algorithm based on the result of the similarity to update the parameters of the first neural network and the parameters of the bidirectional transformer; and determining the first neural network after parameter update using the sample set as the trained first neural network.
[0017] Optionally, the dosage control module is configured to perform: inputting the target text into a trained second neural network to determine a target dosage level corresponding to the target text; wherein the second neural network includes an embedding layer, a feature extraction layer and a fully connected layer; converting the target text into an initial feature matrix through the embedding layer; performing feature extraction on the initial feature matrix through the feature extraction layer to obtain an intermediate feature matrix; and mapping the intermediate feature matrix to the target dosage level through the fully connected layer.
[0018] Optionally, the target dosage level corresponds to a target dosage range. In this case, the dosage control module is configured to perform: determining the remaining dosage of the dosage station and the next dosage time; determining the time range when the dosage station is out of dosage according to the remaining dosage and the target dosage range; if the next dosage time is within the time range when the dosage station is out of dosage, determining the target dosage corresponding to the time point of the next dosage time according to the time range when the dosage station is out of dosage, the next dosage time, and the target dosage range; and controlling the dosage device to add dosage according to the target dosage.
[0019] Optionally, the process of the data acquisition module acquiring the flocculation image taken by the underwater camera in the flocculation tank is configured to execute: sending a shooting instruction to the underwater camera in the flocculation tank at predetermined time intervals; acquiring a first candidate image set taken and fed back by the underwater camera in response to the shooting instruction; the shooting time interval between two consecutive images in the first candidate image set is greater than a time threshold; calculating the similarity between each candidate image in the first candidate image set, and eliminating one or more candidate images with a similarity less than a similarity threshold from the first candidate image set to obtain a second candidate image set; determining the image quality of each candidate image in the second candidate image set; and selecting a candidate image with the best image quality from the second candidate image set as the flocculation image.
[0020] According to a third aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, any of the above-mentioned methods for controlling dosing in a water treatment process based on machine vision is implemented.
[0021] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; the processor is configured to implement any of the above-mentioned dosing control methods in a water treatment process based on machine vision by executing the executable instructions.
[0022] In the technical solutions provided by some embodiments of the present disclosure, on the one hand, when controlling the dosage of the water system, the present disclosure not only takes into account the inlet water flow rate, but also takes into account the inlet water pH, inlet water temperature, inlet water turbidity, floc image in the flocculation tank and outlet water turbidity. In particular, the outlet water turbidity is added as a control factor. Compared with the solution that only considers the inlet water parameters and / or floc image, the addition of the outlet water turbidity factor of the present disclosure can play a role in correcting the control results, greatly improves the accuracy of dosage control in the water treatment process, and helps to obtain excellent water treatment results; on the other hand, the present disclosure uses image brightness analysis to determine the outlet water turbidity, which does not require on-site configuration of special turbidity detection equipment and can reduce costs.
[0023] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0025] Figure 1 The system architecture diagram of the drug addition control system according to the embodiment of the present disclosure is schematically shown.
[0026] Figure 2 A schematic diagram of a water treatment process according to an embodiment of the present disclosure is shown.
[0027] Figure 3 The flowchart of the method for controlling the dosing in the water treatment process based on machine vision according to the exemplary embodiment of the present disclosure is schematically shown.
[0028] Figure 4 The schematic diagram shows the architecture of the second neural network of the embodiment of the present disclosure.
[0029] Figure 5 A block diagram of a drug dosing control device in a water treatment process based on machine vision according to an exemplary embodiment of the present disclosure is schematically shown.
[0030] Figure 6 A block diagram of an electronic device according to an exemplary embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0031] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.
[0032] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0033] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the steps. For example, some steps may be decomposed, while some steps may be combined or partially combined, so the actual execution order may change according to the actual situation. In addition, all the terms "first" and "second" below are only for the purpose of distinction and should not be used as limitations of the present disclosure.
[0034] In some technologies, the dosing control in the water treatment process only considers the relationship between the dosing amount and the influent volume, such as dosing 15 grams of PAC (Poly Aluminum Chloride) per cubic meter of influent water. However, when the quality of the influent water changes, this dosing method will be inaccurate. In addition, in the current on-site environment, there are few solutions for detecting and analyzing the effluent conditions.
[0035] In order to solve the problem of inaccurate dosage control, in some technologies, dosage control in the water treatment process can be achieved by analyzing multiple water inlet parameters including water inlet flow rate and / or flocculent images of the flocculation tank.
[0036] However, it should be noted that the purpose of water treatment is to obtain industrial or domestic water with qualified water quality at the outlet. The data acquisition locations of the above-mentioned water inlet parameters and the data acquisition locations of the floc image are both in the upstream of the water treatment process, and the water treatment process also includes the mid- and downstream stages in addition to these data acquisition locations. These upstream detection data cannot directly correspond to the water quality effect of the outlet water. At present, most of the cases still rely on manual experience to estimate the outlet water situation based on these upstream parameters. Even if it is believed that the outlet water situation can be estimated through these data, however, this estimation method may still have inaccurate problems. In addition, especially in scenarios where there are changes or variables in the mid- and downstream stages of the water treatment process, this method of estimating the downstream outlet water quality through upstream parameters will have even more inaccurate problems.
[0037] That is to say, controlling the dosing in the water treatment process by using multiple water inlet parameters and / or floc images of the flocculation tank may result in insufficient control accuracy, thus affecting the quality of the effluent water.
[0038] In order to solve or at least alleviate the above problems and further improve the accuracy of dosing control, the embodiments of the present disclosure provide a dosing control scheme combining multiple water inlet parameters, floc image and effluent turbidity.
[0039] It should be noted that, in the case of parameter detection equipment installed upstream of water treatment, many water treatment scenarios currently rely on manual experience to judge the quality of effluent water, and no corresponding turbidity detection instrument is installed at the effluent end to save costs. This results in the solution of combining effluent turbidity with dosing control being unable to be implemented because the effluent turbidity cannot be known.
[0040] In order to solve this problem, the present disclosure also provides a solution for determining the turbidity of the outlet water based on the brightness of the outlet water image. Regarding the acquisition of the outlet water image, the surveillance camera equipped at the outlet water end can be used for collection, or a special outlet water camera can be equipped in the clean water tank of the water treatment process. Even if there is no surveillance camera on site and it needs to be configured separately, the cost of configuring the camera in the present disclosure solution is much lower than the cost of configuring a professional turbidity detector.
[0041] The following is a description of the dosing control scheme in the water treatment process based on machine vision according to an embodiment of the present disclosure.
[0042] Among them, machine vision is an important branch of artificial intelligence. Its purpose is to use machines to replace human eyes to identify objects in images, and to display the recognition results to users or execute subsequent algorithms based on the recognition results. The dosing control scheme in the water treatment process of the present embodiment is based on the algorithm of machine vision. Specifically, it involves identifying and analyzing floc images and effluent images, and applying the analysis results to the dosing control algorithm.
[0043] Figure 1 The system architecture diagram of the dosing control system according to the embodiment of the present disclosure is schematically shown. Figure 1 The dosing control system of the embodiment of the present disclosure may include a server 10, an inlet water pH (acidity and alkalinity) detection device 11, an inlet water temperature detection device 12, an inlet water turbidity detection device 13, an inlet water flow detection device 14, an underwater camera 15 in the flocculation tank, an outlet camera 16 and a dosing device 17.
[0044] The server 10 can be connected to the inlet pH detection device 11, the inlet temperature detection device 12, the inlet turbidity detection device 13, the inlet flow detection device 14, the underwater camera 15, the outlet camera 16 and the dosing device 17 in a wired or wireless manner to transmit data or instructions.
[0045] In implementing the dosing control scheme of the embodiment of the present disclosure, first, on the one hand, the server 10 can obtain the inlet water pH from the inlet water pH detection device 11, the inlet water temperature from the inlet water temperature detection device 12, the inlet water turbidity from the inlet water turbidity detection device 13, and the inlet water flow from the inlet water flow detection device 14. On the other hand, the server 10 can estimate the outlet water turbidity based on the outlet water image captured by the outlet water camera 16, specifically, the outlet water turbidity is estimated according to the brightness of the outlet water image and using the pre-constructed mapping curve between the image brightness and turbidity. It can be understood that the inlet water pH, inlet water temperature, inlet water turbidity, inlet water flow and outlet water turbidity mentioned in the embodiment of the present disclosure all contain specific numerical values, that is, the server 10 obtains the inlet water pH value, inlet water temperature value, inlet water turbidity value, inlet water flow value and outlet water turbidity value. For the inlet water parameters, the server 10 can also sort and splice these data to generate the inlet water parameter text. On the other hand, the server 10 may obtain a flocculent image from the underwater camera 15, extract flocculent features of the flocculent image, and generate a flocculent text including the flocculent features.
[0046] Next, the server 10 may splice the floc text, the effluent turbidity text and the inlet parameter text to generate a target text, and determine a target dosage level corresponding to the target text.
[0047] Then, the server 10 may send a dosing control instruction to the dosing device 17 according to the target dosing amount level, so as to control the amount of medicine added by the dosing device 17 .
[0048] In order to more clearly illustrate the configuration position of the above equipment and the water treatment process described in the present disclosure, the following is combined with Figure 2 Provide explanation.
[0049] refer to Figure 2The water treatment system targeted by the embodiment of the present disclosure may include a raw water tank 21, a flocculation tank 22, a sedimentation tank 23, a V-type filter tank 24 and a clean water tank 25. It can be understood that the raw water tank 21 corresponds to the influent, and the clean water tank 25 corresponds to the effluent.
[0050] The above-mentioned inlet water pH detection equipment 11, inlet water temperature detection equipment 12, inlet water turbidity detection equipment 13, and inlet water flow detection equipment 14 can be arranged between the raw water tank 21 and the flocculation tank 22 to detect various inlet water parameters. The underwater camera 15 can be arranged in the flocculation tank 22 to capture the flocculent image. The outlet water camera 16 can be arranged in the clean water tank 25 to capture the outlet water image. The dosing equipment 17 can be arranged between the raw water tank 21 and the flocculation tank 22. The present disclosure does not limit the specific location points and configuration methods of the inlet water pH detection equipment 11, the inlet water temperature detection equipment 12, the inlet water turbidity detection equipment 13, the inlet water flow detection equipment 14, the underwater camera 15, the outlet water camera 16, and the dosing equipment 17.
[0051] The following is a description of the dosing control method in the water treatment process according to the embodiment of the present disclosure.
[0052] Figure 3 The flowchart of the dosing control method in the water treatment process based on machine vision according to an exemplary embodiment of the present disclosure is schematically shown. Figure 3 , the dosing control method may include the following steps:
[0053] S30. Obtaining an outflowing water image and determining the brightness of the outflowing water image.
[0054] In an exemplary embodiment of the present disclosure, a water outlet image may be captured by a water outlet camera disposed in the clean water tank and the water outlet image may be sent to a server.
[0055] The server can determine the brightness of the water-outlet image. The disclosed embodiment does not limit the method for determining the brightness. Specifically, the brightness value corresponding to each pixel in the water-outlet image can be determined, and then the average value can be taken to represent the brightness of the entire water-outlet image. Alternatively, a number of pixels can be randomly selected in the water-outlet image, and then the brightness values of these pixels can be averaged to represent the brightness of the entire water-outlet image.
[0056] S32. Determine the turbidity of the outlet water according to the brightness of the outlet water image and using a pre-constructed mapping curve between image brightness and turbidity.
[0057] The process of pre-constructing the mapping curve between image brightness and turbidity in the embodiment of the present disclosure can be completed in a laboratory, that is, the mapping curve can be determined by experiment.
[0058] First, the server can obtain images of multiple water samples, which can be provided by the experimenter. The disclosed embodiment does not limit the number of water samples. It should be noted that the turbidity of each water sample is different. Specifically, when multiple water samples are provided, the experimenter can determine multiple water samples of different turbidity by naked eyes or rough detection instruments.
[0059] Next, on the one hand, the server can determine the brightness of the image of each water sample. Specifically, the average brightness of each pixel in the image can be used as the brightness of the entire image. On the other hand, the turbidity of the water sample can be accurately detected by using the turbidity detection in the laboratory. Thus, the corresponding relationship between the brightness and turbidity of each water sample can be obtained.
[0060] Then, the server can fit the mapping curve between the image brightness and the turbidity according to the brightness and turbidity of the image of each water sample. The present disclosure does not limit the specific fitting operation. It is understandable that the more water samples there are, the more accurate the fitting result is.
[0061] According to other embodiments of the present disclosure, the images of the water samples may also be images taken in actual water treatment scenarios. Compared with images obtained in a laboratory, images of actual scenarios may be better matched to the implementation scenarios of the solutions, thus helping to improve the accuracy of the mapping curves.
[0062] In the case where a mapping curve between image brightness and turbidity is pre-constructed, the server may determine the turbidity of the outlet water according to the mapping curve and the brightness of the outlet water image determined in step S30.
[0063] S34. Obtain the inlet pH, inlet temperature, inlet turbidity, inlet flow rate, and floc images taken by an underwater camera in the flocculation tank.
[0064] In an exemplary embodiment of the present disclosure, an underwater camera is configured in the flocculation tank, for example, the underwater camera is installed on the inner wall of the flocculation tank. The underwater camera can take a flocculation image of water in the flocculation tank and send the flocculation image to a server.
[0065] According to some embodiments of the present disclosure, the underwater camera can automatically take pictures of the flocculent body and send them to the server, such as taking pictures at a fixed time or in response to the shooting control operation of the operator.
[0066] According to other embodiments of the present disclosure, first, the server may send a shooting instruction to the underwater camera in the flocculation tank every predetermined time period, wherein the predetermined time period may be 12 hours, 24 hours, 48 hours, etc., and the present disclosure does not limit the specific value of the predetermined time period.
[0067] Next, the server can obtain the first candidate image set captured and fed back by the underwater camera in response to the shooting instruction. It should be noted that the shooting time interval between two consecutive images in the first candidate image set is greater than the time threshold, thereby avoiding the problem of excessive similarity between consecutive images with a short time interval causing waste of resources in network transmission and subsequent analysis and calculation. Among them, the time threshold can be obtained based on experiments, and the present disclosure does not limit its specific value. In addition, the present disclosure does not limit the number of candidate images contained in the first candidate image set.
[0068] Subsequently, the server can calculate the similarity between each candidate image in the first candidate image set, and remove one or more candidate images whose similarity is less than the similarity threshold from the first candidate image set to obtain a second candidate image set. Due to the drastic fluctuations of the external environment or the water body, it may happen that individual candidate images are too different from other images. These images with too large differences cannot correctly reflect the actual floc state of the flocculation tank. Therefore, before specific analysis, these abnormal candidate images need to be removed. In addition, the present disclosure does not limit the number of candidate images included in the second candidate image set.
[0069] Then, the server can determine the image quality of each candidate image in the second candidate image set. The image quality evaluation index adopted by the present disclosure includes one or more of clarity, contrast, signal-to-noise ratio, and color. The present disclosure does not limit the process of determining the image quality. In addition, it should be noted that the image quality can be reflected by a quality score.
[0070] Finally, the server may select the candidate image with the best image quality from the second candidate image set as the flocculent image. In other words, the candidate image with the highest quality score is selected from the second candidate image set as the flocculent image for further processing by the server.
[0071] In addition, the server can obtain the inlet water pH sent by the inlet water pH detection device, obtain the inlet water temperature sent by the inlet water temperature detection device, obtain the inlet water turbidity sent by the inlet water turbidity detection device, and obtain the inlet water flow sent by the inlet water flow detection device.
[0072] S36. Control the dosage of the water treatment process according to the effluent turbidity, influent pH, influent temperature, influent turbidity, influent flow rate and floc image.
[0073] For the acquired floc image, the server can extract floc features of the floc image and generate floc text containing the floc features. The floc features mentioned in the present disclosure include but are not limited to the shape, size and number per unit area of the flocs.
[0074] According to some embodiments of the present disclosure, the server can directly use feature extraction operators to extract floc features of floc images. Specifically, edge detection operators such as Sobel, Prewitt, Roberts, and Canny can be used to extract the edges of floc images, and the overall features of the floc images can be estimated to a certain extent from the edge information.
[0075] In addition, the floc features of the floc image can be extracted based on the histogram of oriented gradients (HOG).
[0076] According to some other embodiments of the present disclosure, the server may extract floc features of the floc image by using the trained first neural network, and convert the floc features into floc text.
[0077] The first neural network may be a convolutional neural network. The training process of the first neural network is described below.
[0078] First, the server may obtain a sample set, the sample set including a plurality of sample pairs, each sample pair including a floc sample image and a floc sample text corresponding to the floc sample image, wherein the floc sample text may be manually given.
[0079] Next, on the one hand, the server may use the first neural network to extract features of the floc sample image. On the other hand, the server may use a bidirectional transformer (BERT) to extract features of the floc sample text corresponding to the floc sample image.
[0080] Subsequently, the server may calculate the similarity between the features of the floc sample image and the features of the floc sample text, and execute a stochastic gradient descent algorithm based on the similarity result to update the parameters of the first neural network and the parameters of the bidirectional transformer.
[0081] By continuously using the sample set to update the parameters, the first neural network after the parameter update is determined as the above-mentioned trained first neural network.
[0082] It can be understood that in the example of obtaining the floc text by using a model processing method, the model may be a picture-generated text model.
[0083] In an exemplary embodiment of the present disclosure, the server may directly obtain the outlet water turbidity text based on the outlet water turbidity determined above.
[0084] In addition, for the parameters of the inlet water, the server can sort and splice the inlet water pH, inlet water temperature, inlet water turbidity, and inlet water flow in a predetermined order to generate the inlet water parameter text. Specifically, the server can sort and splice the inlet water pH, inlet water temperature, inlet water turbidity, and inlet water flow in a predetermined order to generate the inlet water parameter text mentioned in the embodiment of this disclosure. Among them, the above-mentioned detection equipment can also be called a detection meter, a detection instrument, a detection device, etc.
[0085] The above predetermined order can be any combination of the above parameters, and the present disclosure does not limit the specific order. However, once the order is configured, the order is fixed. It should be understood that the order is specified to facilitate subsequent processing so that the computer can quickly identify the meaning of the text.
[0086] After determining the floc text, effluent turbidity text and influent parameter text, they can be concatenated to generate the target text.
[0087] In an exemplary embodiment of the present disclosure, splicing refers to a process of connecting the beginning and the end of a text to generate one text from multiple texts.
[0088] After the server determines the floc text, the outlet turbidity text, and the inlet parameter text, the three can be spliced to generate the target text. The present disclosure does not limit the splicing order of the three, but for some embodiments of the present disclosure, as described above, similarly, once the order is configured, the order is fixed, which helps the computer to quickly recognize the meaning of the text later.
[0089] Next, the server may determine a target dosing level corresponding to the target text.
[0090] In an exemplary embodiment of the present disclosure, the dosage level can be expressed as, for example, level one, level two, level three, level four, level five, etc., corresponding to the dosage from high to low. In addition, the dosage level can also be expressed by numbers (such as 1, 2, 3, 4, 5, etc.) or letters (such as a, b, c, d, e, etc.), and whether the dosage is from high to low or from low to high can be pre-configured, and the present disclosure does not limit this.
[0091] The present disclosure refers to the dosage level corresponding to the target text as the target dosage level.
[0092] According to some embodiments of the present disclosure, the server may display the target text on an interface, and manually determine the dosage level corresponding to the target text. For example, the server may display the target text on a display screen, and the engineer may determine the dosage level based on experience after seeing the target text. The server responds to the engineer's confirmation operation to determine the target dosage level corresponding to the target text.
[0093] According to other embodiments of the present disclosure, the server may use a classification model to determine a target dosage level corresponding to the target text. Specifically, the server may input the target text into a trained second neural network, the output of the second neural network is the probability of each dosage level, and the dosage level with the highest probability is selected as the target dosage level. The embodiments of the present disclosure do not limit the training process of the second neural network.
[0094] refer to Figure 4 , the second neural network 40 may include an embedding layer 401, a feature extraction layer 402 and a fully connected layer 403.
[0095] First, the target text may be converted into an initial feature vector through the embedding layer 401. For example, the target text contains n words, each word can be represented as an m-dimensional vector, and the initial feature vector is an n×m initial feature vector.
[0096] Next, the initial feature matrix may be subjected to feature extraction by the feature extraction layer 402 to obtain an intermediate feature matrix. Specifically, the feature extraction layer 402 may include a plurality of convolution units, each of which may include a convolution layer and a pooling layer. Through continuous downsampling processing, important features of the target text are extracted, that is, an intermediate feature matrix is generated.
[0097] Subsequently, the intermediate feature matrix can be mapped to the target dosage level through the fully connected layer 403. The dropout function can be first processed to reduce overfitting, and then processed through the softmax activation function to obtain the probability of each dosage level, and the dosage level with the largest probability is selected as the target dosage level.
[0098] After determining the target dosage level, the server can control the dosage in the water treatment process according to the target dosage level.
[0099] According to some embodiments of the present disclosure, the dosage level corresponds to the device opening of the dosing device. The device opening refers to the opening of the dosing device. It can be understood that the larger the device opening configuration, the larger the dosing amount, and the smaller the device opening configuration, the smaller the dosing amount. In other words, each dosage level corresponds to a clear dosage value. In this case, the server can send a control instruction containing the target dosage level to the dosing device, and the dosing device responds to the control instruction to determine the dosage to be adjusted, and controls the device opening based on the dosage to achieve the adjustment of the dosage.
[0100] According to other embodiments of the present disclosure, the dosage level corresponds to the dosage range one by one, that is, each dosage level corresponds to a clear dosage range.
[0101] In this case, the server can determine the target dosage range corresponding to the target dosage level, select a target dosage from the target dosage range, and send a control instruction containing the target dosage to the dosing device so that the dosing device performs dosing control based on the target dosage.
[0102] Specifically, the server may randomly select an amount of medicine from the target amount of medicine range as the target amount of medicine; or select an intermediate value, a maximum value, or a minimum value in the target amount of medicine range as the target amount of medicine; or display the target amount of medicine range on an interface, and then respond to the engineer's selection operation to determine the target amount of medicine. The present disclosure does not limit this.
[0103] In addition, the present disclosure also provides a solution for automatically determining a target dosage in combination with the dosage of a dosing station, wherein the dosing station is used to store medicines.
[0104] First, the server can determine the remaining amount of medicine at the dosing station and the next time the medicine arrives. The remaining amount of medicine at the dosing station refers to the amount of medicine that can be added at the moment, and the next time the medicine arrives refers to the time from now when the next medicine will be delivered to the dosing station.
[0105] Next, the server can determine the time range when the dosing station is out of medicine based on the remaining amount of medicine in the dosing station and the target dosing amount range. It can be understood that the time when the dosing station is out of medicine refers to the time when the medicine in the dosing station is just finished. In view of the fact that the dosing is carried out according to the target dosing amount range, when the target dosing amount is a numerical range, the corresponding time when the dosing station is out of medicine is also a time range.
[0106] Subsequently, if the server determines that the next medication delivery time is within the time range when the medication station is out of medication, the server determines the target medication dosage corresponding to the time point of the next medication delivery time according to the time range when the medication station is out of medication, the next medication delivery time, and the target medication dosage range. Specifically, when the two ranges of time and dosage are known, the target medication dosage corresponding to the next medication delivery time can be determined by using the proportional relationship.
[0107] Then, the server can control the dosing equipment to add medicine according to the target dosage.
[0108] If there is a lot of remaining medicine at the dosing station and the next medicine will come quickly, resulting in the dosing station not running out of medicine, the server can determine the target dosing amount from the target dosing amount range according to one of the above selection strategies, and control the dosing equipment to add medicine according to the target dosing amount.
[0109] If the dosing station is out of medicine even if the dosing control is performed according to the minimum value within the target dosing amount range, the server can issue an alarm, and the engineer can manually enter the target dosing amount or advance the next time to deliver medicine. The alarm method includes but is not limited to SMS, email, audio, light, etc., and this disclosure does not limit this.
[0110] In addition, some embodiments of the present disclosure also provide a solution for predicting the trend of drug dosage based on the above-mentioned drug dosage control method.
[0111] Specifically, the server can obtain multiple target dosage levels determined within a period of time from the current time, perform regression processing on the multiple target dosage levels to predict the dosage trend in the next period of time, and feedback the trend to the drug purchasing personnel and water treatment process control personnel, so as to further analyze the causes of the trend and prepare in advance.
[0112] It should be noted that the drugs added in the exemplary drug addition control scheme of the present disclosure include but are not limited to PCA, PAM (Polyacrylamide, polyacrylamide), etc. The above drug addition control method can be applied to the mixture of one or more of these drugs to achieve drug dosage control.
[0113] It should be noted that although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0114] Furthermore, this exemplary embodiment also provides a device for controlling the dosing of chemicals in a water treatment process.
[0115] Figure 5 The block diagram of the dosing control device in the water treatment process based on machine vision according to an exemplary embodiment of the present disclosure is schematically shown. Figure 5 According to an exemplary embodiment of the present disclosure, a dosing control device 5 in a water treatment process based on machine vision may include a brightness determination module 51 , a turbidity determination module 53 , a data acquisition module 55 and a dosing amount control module 57 .
[0116] Specifically, the brightness determination module 51 can be used to obtain an effluent image and determine the brightness of the effluent image; the turbidity determination module 53 can be used to determine the effluent turbidity according to the brightness of the effluent image and using a pre-constructed mapping curve between image brightness and turbidity; the data acquisition module 55 can be used to obtain the influent pH, influent temperature, influent turbidity, influent flow rate and the floc image taken by the underwater camera in the flocculation tank; the dosage control module 57 can be used to control the dosage in the water treatment process according to the effluent turbidity, influent pH, influent temperature, influent turbidity, influent flow rate and floc image; wherein the turbidity determination module 53 can also be used to construct a mapping curve between image brightness and turbidity, and the process of constructing the mapping curve between image brightness and turbidity includes: obtaining images of multiple water samples, each water sample having a different turbidity; determining the brightness of the image of each water sample; detecting the turbidity of each water sample; and fitting a mapping curve between image brightness and turbidity according to the brightness and turbidity of the image of each water sample.
[0117] According to an exemplary embodiment of the present disclosure, the dosage control module 57 can be configured to perform: extracting floc features of a floc image and generating a floc text containing the floc features; generating an outlet turbidity text using the outlet turbidity, and generating an inlet parameter text using the inlet pH, inlet temperature, inlet turbidity, and inlet flow rate; splicing the floc text, the outlet turbidity text, and the inlet parameter text to generate a target text; determining a target dosage level corresponding to the target text; and controlling the dosage in the water treatment process according to the target dosage level.
[0118] According to an exemplary embodiment of the present disclosure, the dosage control module 57 may be configured to perform: extracting floc features of the floc image using a trained first neural network, and converting the floc features into floc text; wherein the floc features include the morphology, size and quantity per unit area of the flocs.
[0119] According to an exemplary embodiment of the present disclosure, the dosage control module 57 can also be configured to perform: obtaining a sample set, the sample set includes a plurality of sample pairs, each sample pair includes a floc sample image and a floc sample text corresponding to the floc sample image; extracting features of the floc sample image using a first neural network; extracting features of the floc sample text corresponding to the floc sample image using a bidirectional transformer; calculating the similarity between the features of the floc sample image and the features of the floc sample text, and executing a stochastic gradient descent algorithm based on the result of the similarity to update the parameters of the first neural network and the parameters of the bidirectional transformer; and determining the first neural network after the parameter update using the sample set as the trained first neural network.
[0120] According to an exemplary embodiment of the present disclosure, the dosage control module 57 can be configured to perform: inputting the target text into a trained second neural network to determine the target dosage level corresponding to the target text; wherein the second neural network includes an embedding layer, a feature extraction layer and a fully connected layer; converting the target text into an initial feature matrix through the embedding layer; performing feature extraction on the initial feature matrix through the feature extraction layer to obtain an intermediate feature matrix; and mapping the intermediate feature matrix to the target dosage level through the fully connected layer.
[0121] According to an exemplary embodiment of the present disclosure, the target dosage level corresponds to the target dosage range. In this case, the dosage control module 57 can be configured to perform: determining the remaining dosage of the dosage station and the next drug delivery time; determining the time range of no drug at the dosage station according to the remaining dosage and the target dosage range; if the next drug delivery time is within the time range of no drug at the dosage station, determining the target dosage corresponding to the time point of the next drug delivery time according to the time range of no drug at the dosage station, the next drug delivery time, and the target dosage range; and controlling the dosage device to add drugs according to the target dosage.
[0122] According to an exemplary embodiment of the present disclosure, the process of the data acquisition module 55 acquiring the flocculation image taken by the underwater camera in the flocculation tank can be configured to execute: sending a shooting instruction to the underwater camera in the flocculation tank at predetermined time intervals; acquiring a first candidate image set shot and fed back by the underwater camera in response to the shooting instruction; the shooting time interval between two consecutive images in the first candidate image set is greater than a time threshold; calculating the similarity between each candidate image in the first candidate image set, and eliminating one or more candidate images whose similarity is less than the similarity threshold from the first candidate image set to obtain a second candidate image set; determining the image quality of each candidate image in the second candidate image set; and selecting the candidate image with the best image quality from the second candidate image set as the flocculation image.
[0123] Since the functional modules of the dosing control device in the water treatment process based on machine vision in the embodiment of the present disclosure are the same as those in the above method embodiment, they will not be described in detail here.
[0124] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary implementations of the present disclosure described in the above "Exemplary Method" section of the present specification.
[0125] The program product for implementing the above method according to the embodiment of the present disclosure can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto, and in this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0126] The program product may adopt any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical disk, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0127] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0128] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0129] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).
[0130] In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
[0131] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as "circuits", "modules" or "systems".
[0132] Refer to the following Figure 6 The electronic device 600 according to this embodiment of the present disclosure is described below. The server described above may be configured in the form of the electronic device 600. Figure 6 The electronic device 600 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0133] like Figure 6 As shown, the electronic device 600 is in the form of a general computing device. The components of the electronic device 600 may include but are not limited to: the at least one processing unit 610, the at least one storage unit 620, a bus 630 connecting different system components (including the storage unit 620 and the processing unit 610), and a display unit 640.
[0134] The storage unit stores a program code, which can be executed by the processing unit 610, so that the processing unit 610 performs the steps according to various exemplary embodiments of the present disclosure described in the above "Exemplary Method" section of this specification. For example, the processing unit 610 can perform various steps of the dosing control method in the water treatment process of the embodiment of the present disclosure.
[0135] The storage unit 620 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 6201 and / or a cache memory unit 6202 , and may further include a read-only memory unit (ROM) 6203 .
[0136] The storage unit 620 may also include a program / utility 6204 having a set (at least one) of program modules 6205, such program modules 6205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0137] Bus 630 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0138] The electronic device 600 may also communicate with one or more external devices 700 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable a user to interact with the electronic device 600, and / or any device that enables the electronic device 600 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 650. Furthermore, the electronic device 600 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 660. Figure 6 As shown, the network adapter 660 communicates with other modules of the electronic device 600 via the bus 630. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0139] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0140] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0141] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0142] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing what is disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and embodiments are to be considered merely as exemplary, and the true scope and spirit of the present disclosure are indicated by the claims.
[0143] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A dosing control method in a water treatment process based on machine vision, characterized in that: include: Acquire an outflowing water image, and determine the brightness of the outflowing water image; Determining the turbidity of the effluent water according to the brightness of the effluent water image and using a pre-constructed mapping curve between image brightness and turbidity; Obtain influent pH, influent temperature, influent turbidity, influent flow rate, and floc images taken by underwater cameras in the flocculation tank; Extracting floc features of the floc image using the trained first neural network, and converting the floc features into floc text; wherein the floc features include the shape, size and number per unit area of the flocs; Generate an outlet water turbidity text using the outlet water turbidity, and generate an inlet water parameter text using the inlet water pH, the inlet water temperature, the inlet water turbidity, and the inlet water flow rate; splicing the floc text, the effluent turbidity text and the influent parameter text to generate a target text; Inputting the target text into a trained second neural network to determine a target dosage level corresponding to the target text; wherein the second neural network includes an embedding layer, a feature extraction layer, and a fully connected layer; converting the target text into an initial feature matrix through the embedding layer; extracting features from the initial feature matrix through the feature extraction layer to obtain an intermediate feature matrix; and mapping the intermediate feature matrix to the target dosage level through the fully connected layer; Controlling the dosage of the drug in the water treatment process according to the target dosage level; The process of constructing a mapping curve between image brightness and turbidity includes: Acquiring images of a plurality of water samples, each of the water samples having a different turbidity; determining the brightness of the image of each of the water samples; detecting the turbidity of each of the water samples; Fitting a mapping curve between image brightness and turbidity according to the brightness and turbidity of the image of each of the water samples; The dosing control method also includes: Acquire a sample set, the sample set comprising a plurality of sample pairs, each of the sample pairs comprising a floc sample image and a floc sample text corresponding to the floc sample image; extracting features of the floc sample image using the first neural network; Extracting features of floc sample text corresponding to the floc sample image using a bidirectional transformer; Calculating the similarity between the features of the floc sample image and the features of the floc sample text, and executing a stochastic gradient descent algorithm based on the similarity result to update the parameters of the first neural network and the parameters of the bidirectional transformer; Determine the first neural network after parameter update using the sample set as the trained first neural network; The dosing control method also includes: Obtain multiple target dosage levels determined within a period of time from the current time, perform regression processing on the multiple target dosage levels to predict the dosage trend within a period of time thereafter, and feed back the trend to the drug purchasing personnel and the water treatment process control personnel.
2. The dosing control method according to claim 1, characterized in that: The target dosage level corresponds to a target dosage range; wherein controlling the dosage in the water treatment process according to the target dosage level includes: Determine the remaining amount of medicine at the dosing station and the next time the medicine will arrive; Determine the time range when the dosing station is out of medicine according to the remaining medicine amount and the target dosing amount range; If the next medication delivery time is within the time range when the medication station is out of medication, then the target medication dosage corresponding to the time point of the next medication delivery time is determined according to the time range when the medication station is out of medication, the next medication delivery time, and the target medication dosage range; The dosing device is controlled to add the drug according to the target dosage.
3. The dosing control method according to claim 1, characterized in that: The floc images captured by the underwater camera in the flocculation tank include: Sending shooting instructions to the underwater camera in the flocculation tank at predetermined time intervals; Acquire a first candidate image set captured and fed back by the underwater camera in response to the shooting instruction; the shooting time interval between two consecutively captured images in the first candidate image set is greater than a time threshold; Calculating the similarity between the candidate images in the first candidate image set, and removing one or more candidate images whose similarity is less than a similarity threshold from the first candidate image set to obtain a second candidate image set; determining an image quality of each candidate image in the second candidate image set; A candidate image with the best image quality is selected from the second candidate image set as the flocculation image.
4. A dosing control device in a water treatment process based on machine vision, characterized in that: include: A brightness determination module, used to obtain an out-of-water image and determine the brightness of the out-of-water image; a turbidity determination module, configured to determine the turbidity of the outlet water according to the brightness of the outlet water image and using a pre-constructed mapping curve between image brightness and turbidity; A data acquisition module is used to obtain the influent pH, influent temperature, influent turbidity, influent flow rate, and floc images taken by an underwater camera in the flocculation tank; A dosage control module is used to extract floc features of the floc image using a trained first neural network, and convert the floc features into floc text; wherein the floc features include the shape, size and number per unit area of the flocs; generate an effluent turbidity text using the effluent turbidity, and generate an inlet parameter text using the inlet pH, the inlet temperature, the inlet turbidity and the inlet flow rate; splice the floc text, the effluent turbidity text and the inlet parameter text to generate a target text; input the target text into a trained second neural network to determine a target dosage level corresponding to the target text; wherein the second neural network includes an embedding layer, a feature extraction layer and a fully connected layer; convert the target text into an initial feature matrix through the embedding layer; extract features from the initial feature matrix through the feature extraction layer to obtain an intermediate feature matrix; map the intermediate feature matrix to the target dosage level through the fully connected layer; and control the dosage in the water treatment process according to the target dosage level; The turbidity determination module is further used to construct a mapping curve between image brightness and turbidity, and the process of constructing the mapping curve between image brightness and turbidity includes: acquiring images of multiple water samples, each of which has a different turbidity; determining the brightness of the image of each of the water samples; detecting the turbidity of each of the water samples; fitting a mapping curve between image brightness and turbidity according to the brightness and turbidity of the image of each of the water samples; The dosage control module is further used to obtain a sample set, the sample set includes a plurality of sample pairs, each of the sample pairs includes a floc sample image and a floc sample text corresponding to the floc sample image; extract features of the floc sample image using the first neural network; extract features of the floc sample text corresponding to the floc sample image using a bidirectional transformer; calculate the similarity between the features of the floc sample image and the features of the floc sample text, and execute a stochastic gradient descent algorithm based on the result of the similarity to update the parameters of the first neural network and the parameters of the bidirectional transformer; determine the first neural network after the parameter update using the sample set as the trained first neural network; The dosing control device is also used to obtain multiple target dosing levels determined within a period of time from the current time, perform regression processing on the multiple target dosing levels to predict the trend of the dosing within a period of time thereafter, and feed back the trend to the drug purchasing personnel and the water treatment process control personnel.
5. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for controlling dosing in a water treatment process based on machine vision according to any one of claims 1 to 3 is implemented.
6. An electronic device, characterized in that: include: processor; as well as, A memory, configured to store executable instructions of the processor; The processor is configured to implement the method for controlling dosing in a water treatment process based on machine vision according to any one of claims 1 to 3 by executing the executable instructions.
