Water supply plant filter operation abnormal condition identification method and system based on machine vision and AI algorithm
By applying machine vision and AI algorithm identification methods in the filter tank of the water supply plant, combined with robot inspection, intelligent management of filter operation is realized, the defects of relying on manual experience in the existing technology are solved, and management efficiency and intelligence are improved.
Patent Information
- Application Number
- CN202411719895.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-03-18
AI Technical Summary
The existing technology is difficult to realize the intelligent management of the operation of filter tanks in water supply plants, and it depends on the experience of process technicians, which is time-consuming and labor-intensive and is not conducive to the transfer of knowledge.
Using the recognition method based on machine vision and AI algorithms, the abnormality of the filter operating state is marked and pre-processed by rotating the annotation box, a convolutional neural network object detection model is constructed, and abnormality of the filter operating state is identified, and real-time inspection and control are carried out through robots.
It has realized accurate and intelligent control in various stages such as filter operation and backflushing, improved the level of intelligent production management, reduced operating costs, and improved inspection efficiency and intelligent water plant level.
Smart Images

Figure CN119649368A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to machine vision and image processing technology, and specifically to a method and system for identifying abnormal operating conditions of a filter tank in a water supply plant based on machine vision and AI algorithms. Background Art
[0002] Conventional water treatment processes in urban water supply plants at home and abroad mainly include coagulation (including mixing and flocculation), sedimentation, filtration and disinfection. Filtration is an important part of the water treatment process, which physically intercepts suspended matter and various impurities in the water after flocculation and sedimentation. The backwashing intensity and time selection at each stage of the filter backwashing directly affect the recovery of the filter's filtration capacity and cost-effectiveness. Whether the filter is operating normally and whether the backwashing intensity and time selection at each stage of the filter backwashing are appropriate require water plant process technicians to go to the site to combine real-time operation data and observe the entire operation process of the filter to judge and set. This method is time-consuming and labor-intensive, and highly dependent on the experience of process technicians, which is not conducive to the transfer of knowledge. Summary of the invention
[0003] In order to solve the technical problems existing in the prior art, the present invention provides a method and system for identifying abnormal operating conditions of a water supply plant filter based on machine vision and AI algorithm, which improves the level of intelligent production management of the filter and realizes precise intelligent control of various stages such as filter operation and backwashing.
[0004] The method for identifying abnormal operating conditions of a filter tank in a water supply plant based on machine vision and AI algorithm in an embodiment of the present invention comprises the following steps:
[0005] The image data of abnormal filter operation status is annotated by using a rotating annotation frame, and the angle of the annotation boundary box is rotated according to the different abnormal conditions.
[0006] Preprocess and enhance the labeled image data to obtain a training data set;
[0007] Balance the samples of the training data set;
[0008] A target detection model is built based on a convolutional neural network to identify and predict abnormal conditions in the filter operation status, and output the predicted filter abnormality bounding box and its abnormality category probability;
[0009] Identify the abnormal area of the filter operation scene, fit the parameters of the manually labeled box based on the feature map extracted by the convolutional neural network through regression, predict the conditional probability of the spatial separation bounding box and the real bounding box, calculate the position coordinates and rotation angle of the abnormal area in the image, and obtain preliminary detection results;
[0010] The preliminary detection results are post-processed to remove redundant frames and obtain the final detection results.
[0011] The abnormal operation condition recognition system of the filter tank of a water supply plant based on machine vision and AI algorithm in the embodiment of the present invention is implemented by the above-mentioned recognition method, including:
[0012] Set up and dispatch robots, combine production inspection needs, connect robots to the production monitoring platform in the water supply plant, and receive the operating status information of each filter tank in time. According to the operating status of the filter tank, mobilize the robots to perform corresponding work content;
[0013] Call the target detection model to identify abnormal conditions in the filter operation status;
[0014] Detect and identify the liquid level in the filter tank.
[0015] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0016] Through the technical solution of the present invention, a water treatment filter suitable for engineering application in a water supply plant is formed, which provides timely and effective early warning and operation suggestions for the filter operation, replaces personnel inspection, comprehensively improves the intelligent production management level of the filter, fills the technical gap in this link of the water supply plant, and realizes precise intelligent control of various stages such as filter operation and backwashing in the water plant, effectively reduces self-use water and electricity consumption, reduces the operating cost of the water plant, improves the inspection efficiency, and improves the intelligence level of the water plant. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 is an architectural diagram of an inspection robot system in an embodiment of the present invention;
[0018] Figure 2 is a flow chart of an abnormal operating condition identification method in an embodiment of the present invention;
[0019] Figure 3 It is a convolutional structure framework diagram of the target detection model in an embodiment of the present invention. DETAILED DESCRIPTION
[0020] The present invention is further described in detail below in conjunction with embodiments and drawings, but the embodiments of the present invention are not limited thereto.
[0021] Example
[0022] This embodiment provides a water supply plant filter tank abnormal operation condition identification system based on machine vision and AI algorithm, sets and dispatches robots, and interconnects the robots with the production monitoring platform in the water supply plant through the dispatch management platform; receives the operation status information of each filter tank in real time, and divides the filter tank operation status into three types: backwashing, filtration, and stop; according to the filter tank operation status, mobilizes the robot to perform the corresponding work content, and replaces the personnel "standing by" in the backwashing state; establishes a characterization image database of each stage of filter tank backwashing through robot vision, combines AI image recognition model to identify and monitor the filter tank backwashing effect and filter tank abnormal status, and optimizes and adjusts the backwashing intensity and time of each stage through machine learning algorithm, improves the filter tank operation efficiency, reduces self-use water consumption and backwashing electricity consumption, and helps safe production and saves operating costs. Specifically including the following:
[0023] 1. Set up and dispatch robots. Combined with production inspection requirements, interconnect the robots with the production monitoring platform in the water supply plant to receive the operating status information of each filter tank in a timely manner and dispatch the robots uniformly.
[0024] This embodiment divides the filter operation status into three states: filtering, backwashing, and stopping. Each operation state of the filter corresponds to different functions. In the backwashing state, the robot replaces the personnel to "stand by" and identify the abnormal state of the filter. For example, when the filter is backwashed, the air washing, air-water mixed washing, water washing and other steps are identified to see whether there is uneven water and air distribution, sand leakage or sand running; the filter operation status changes are read in real time from the production monitoring platform, and the time of each backwashing step can be monitored when the robot is "standing by" to see whether it is consistent with the program, so as to improve work efficiency and help safe production.
[0025] like Figure 1 As shown in the figure, the inspection robot system includes an inspection robot, a management platform, a server and a supporting network system, of which two inspection robots are provided. The robot is connected to the production monitoring platform in the water supply plant through the dispatching management platform to obtain the operating status of each filter tank in real time, and the inspection robots are uniformly dispatched so that the inspection robots can alternate and complement each other to achieve 24-hour uninterrupted inspection. At the same time, corresponding dispatching tasks are performed according to the different operating status of the filter tank.
[0026] The scheduling tasks mainly include the following:
[0027] (1) Daily inspection task management
[0028] 1) Develop inspection routes and inspection points. Plan and optimize the robot’s inspection routes based on the layout of the on-site sand filter, obstacle locations, charging pile locations, etc., develop obstacle avoidance strategies, and reduce unnecessary turns and movement distances of the robot.
[0029] 2) Develop an inspection plan. According to the operation status of the sand filter and the inspection requirements, develop a reasonable inspection plan, set the inspection points (such as location, PTZ height, camera pitch angle, etc.), inspection frequency, inspection start time, etc.
[0030] 3) Assign tasks. Generate inspection tasks based on the inspection plan and robot operation status, assign robots to conduct inspections according to the preset inspection plan, and the robots autonomously plan the optimal route and perform inspection tasks.
[0031] 4) Inspection data collection: After the inspection robot arrives at the inspection point, it takes photos and samples of the sand filter tank operation status according to the set shooting requirements, and transmits the data to the background server.
[0032] (2) Scheduling task management
[0033] 1) Production monitoring data communication. Maintain real-time data communication with the production monitoring platform in the water supply plant to monitor changes in the operating status of each filter tank.
[0034] 2) Formulate scheduling task rules. Formulate the content of the scheduling task, as well as the triggering and ending conditions. For example, when the operating state of a filter tank switches from the filtering state to the backwashing state, assign the robot to the preset inspection point to "stand by" the whole process and monitor whether there are any abnormal conditions during the backwashing process until the filter tank switches back to the water filtering state.
[0035] 3) Trigger the scheduling task. According to the data received from the production monitoring platform, determine whether to trigger the scheduling task; when the scheduling task rules are met, trigger the scheduling task and assign the robot to perform the scheduling task according to the preset content.
[0036] 4) Collect scheduling task data. Before the task is completed, the robot will take pictures and record videos of the filter tank throughout the process, and transmit the collected image data to the background server.
[0037] 2. Call the target detection model to identify abnormal conditions in the filter operation status.
[0038] Maintain real-time data communication with the production monitoring platform of the water supply plant and update the filter tank operation status data in real time. After receiving the inspection data sent back by the robot, call the image recognition model (i.e., target detection model) to identify abnormalities such as abnormal liquid level, foreign matter on the pool surface, foreign matter on the pool wall, and sand leakage in the filter tank operation status image, and display the abnormal data list.
[0039] like Figure 2 As shown, the process of identifying whether the filter operation status is abnormal includes the following steps:
[0040] S21, using a rotating annotation frame to annotate the image data of the abnormal operation status of the filter tank, and during the annotation, the angle of the annotation boundary box is rotated according to each type of abnormal situation.
[0041] When the filter tank operation state is in an abnormal situation, the corresponding image data is mostly irregular in shape; and the shapes of the corresponding image data are quite different under different categories of abnormal situations. Using traditional rectangular annotation to annotate the image data of abnormal situations will make the abnormal annotation error large, which is not conducive to improving the accuracy of training. Therefore, this embodiment firstly rotates and annotates the image data through the rolabelimg tool, controls and adjusts the angle of the annotation boundary box during the rotation annotation, rotates the angle of the annotation boundary box according to each type of abnormal situation, and is as close to the abnormal situation as possible to reduce the annotation error; then manually annotates the abnormal conditions of the filter tank operation state to obtain the filter tank abnormal data set. Among them, manual annotation is to use the rolabelimg tool to draw an annotation boundary box on the image and annotate the abnormal situation type to obtain a number of annotation data and form an abnormal data set, each annotation data includes the coordinates, length, width, rotation angle, and abnormal situation type of the annotation boundary box. The abnormal conditions of the filter tank operation state include: foreign matter on the pool wall (i.e., stains on the pool wall), foreign matter on the pool surface, valve not tightly closed (water column under the V-shaped groove of the filter tank), sand running (sand in the filter tank drainage trough), etc.
[0042] Compared with the traditional rectangular bounding box, the rotated annotation box can represent more object shapes, especially the tilted and long abnormal shape of the filter wall stains. Most of the stains on the pool wall are long strips rotated about 60° relative to the lens. If a rectangular annotation without angle is used, a large number of redundant images will be selected, while the use of a rotated rectangle can accurately mark the stains.
[0043] During the labeling process, specific labeling rules are formulated according to different abnormal situations, so as to unify the characteristics of the target boxes under different types of abnormal situations, facilitate model training and improve prediction accuracy. For example, when the stains on the filter pool wall are flat and long, coupled with the change in the angle of the camera in shooting, the stains on the filter pool wall are mostly flat and long quadrilateral in the image; when predicting the image, it is sensitive to the angle of this type of abnormal situation, and the slight difference in angle will lead to a large change in the labeling accuracy; therefore, for this type of abnormal situation, it is necessary to increase the amount of labeled data and ensure that the labeling is as close to the abnormality itself as possible to reduce the angle error, so as to improve the accuracy of the model.
[0044] S22: pre-process the labeled image data.
[0045] Preprocess the input annotated image, such as uniformly adjusting and normalizing the image size and pixel value to speed up learning; pad the image so that the image width and height are consistent with the network input requirements; convert the image to RGB format and convert it into a standard color space.
[0046] S23, performing enhancement processing on the preprocessed image data to obtain a training data set.
[0047] In order to improve the robustness of the model to different postures and angles, various data enhancement techniques such as random rotation, brightness and contrast adjustment, cropping and scaling, random perturbation, random occlusion and noise addition were applied to expand the data set, improve the robustness of the model, and enhance the learning ability of the model.
[0048] Random rotation: Randomly generate a rotation angle and rotate the target box and the image accordingly, which helps to learn targets at different angles.
[0049] Cropping and scaling: Randomly crop and scale images to simulate the changes of targets at different positions and scales, and learn the characteristics of targets in different scenarios.
[0050] Random perturbation: Randomly perturb the target box. Pull down, translate, stretch, scale, etc. the target box to increase data diversity.
[0051] Random occlusion: Randomly occlude the image to increase data diversity and enhance the learning ability of the model.
[0052] Brightness and contrast adjustment: Enhance the image brightness and contrast to make the target more obvious, which helps the model detect the target better.
[0053] S24, performing equalization processing on the samples of the training data set.
[0054] In the present invention, most of the data are under normal operating conditions, and the filter tank rarely has abnormalities. In order to ensure the balance of positive and negative samples in the training data set and avoid the imbalance of sample categories, methods such as oversampling and undersampling are used to process unbalanced data.
[0055] Oversampling balances the dataset by increasing the replication of minority class samples so that the number of minority class samples is close to that of the majority class, which allows the model to pay more attention to minority class samples.
[0056] Undersampling balances the dataset by reducing the number of majority class samples so that the number of majority class samples is close to that of minority class samples, which can reduce the model's excessive attention to majority class samples.
[0057] According to the characteristics of the data structure, when designing the algorithm, the problem of sample imbalance in the end-to-end target detection algorithm is solved by the strategy of offsetting the weight factor, reducing the weight of samples with a large proportion, so that the model pays more attention to difficult samples. The specific method of balanced processing is expressed as follows:
[0058] f(t p )=-a t (1-t p ) γ log (t p ) (1)
[0059] in,
[0060]
[0061]
[0062] Where a∈[0,1] is used to coordinate the balance between positive and negative samples; γ is used to reduce the weight of simple samples so that the model pays more attention to the calculation of difficult samples, that is, the calculation of data samples with abnormal filter operation status; p∈[0,1] represents the probability of the model output predicting that a sample is a positive class.
[0063] S25. Build a target detection model based on a convolutional neural network to identify and predict abnormal conditions in the filter operation status, and output the predicted filter abnormality bounding box and its abnormality category probability.
[0064] This embodiment unifies target detection into a convolutional neural network, that is, the constructed target detection model is based on the convolutional neural network, and each bounding box is predicted using the features in the entire image, so that the convolutional neural network learns the complete image and all objects in the image, and uses the convolutional neural network as a feature extraction network to extract features from the input image, and outputs the prediction probability and coordinates using a fully connected layer. The yolov7 algorithm with model reparameterization is used to reduce the computational burden while maintaining a high detection accuracy; and regularization methods and loss function optimization are used to improve the generalization ability and robustness of the model.
[0065] The target detection model determines whether the bounding box is abnormal by calculating the intersection and union ratio of the predicted bounding box and the true bounding box. For the judgment of category probability, the target detection model calculates the similarity between the input image and the learned features based on the feature representation of different categories learned through a large amount of labeled data during the training phase, and outputs the probability value of each predicted box belonging to each category. The category with the highest probability is taken as the predicted category, and the probability value must be greater than the confidence threshold to be considered as a valid prediction, otherwise it is considered as background. After the target detection model infers the image, it outputs the identified abnormal filter bounding box and its abnormal category probability.
[0066] 1) Convolutional Neural Network
[0067] The convolutional layers of convolutional neural networks have the characteristics of shared weights and biases. The output node value of each convolutional layer is obtained by scanning the convolution operation value of the input layer nodes with the same N*M convolution kernel (or filter) of a certain size. Each layer of the network is generated by multiple convolution kernels and the same number of convolution layers are superimposed. For a single convolutional layer in the network, all nodes share the same set of convolution kernel parameters, which greatly reduces the number of parameters by orders of magnitude, allowing the network to construct deeper layers and obtain stronger learning capabilities.
[0068] 2) Use model reparameterization technology
[0069] The model reparameterization technology of network feature extraction and learning, referred to as RepVGG, is applied to the convolution structure design of the target detection model, such as Figure 3 As shown. The convolution structure of the original convolutional neural network contains a complex topological structure with multiple branches, while RepVGG simplifies the convolution structure of the target detection model into a single convolution branch, greatly reducing the complexity of the model. The detailed structure of the RepVGG model is as follows: RepVGG's 5 stages have [1,2,4,14,1] layers respectively; RepVGG-B's 5 stages have [1,4,6,16,1] layers respectively, and the width is several times that of [64,128,256,512]. Using this structure, the model runs four times faster on the GPU than 1x1 and 5x5 convolutions, and the model training speed is significantly improved; the structural design of the single-link model makes the model highly parallel, occupies less memory, and is more flexible than other composite convolution architectures; the RepVGG main body has only one convolution operator, occupies a small storage unit, and is easy to port on different platforms.
[0070] S26. Identify the abnormal area of the filter operation scene, fit the parameters of the manually labeled box based on the feature map extracted by the convolutional neural network through regression, predict the conditional probability of the spatial separation bounding box and the real bounding box, calculate the position coordinates and rotation angle of the abnormal area in the image, and obtain preliminary detection results.
[0071] In this regression process, the image features extracted by the convolutional neural network are used as input, and the parameters of the manually annotated boxes are used as labels; the target detection model generates a series of prior boxes as anchor boxes based on the target size in the training data set in advance, and multiple anchor boxes are randomly distributed in the image; then the target detection model uses the regression method to predict the offset of the anchor box with the highest intersection-over-union ratio with the true bounding box, and uses the anchor box with the highest intersection-over-union ratio as the predicted spatial separation bounding box after offset. Therefore, in the regression process, the target prediction model needs to calculate five parameters, namely the x and y coordinates of the abnormal area relative to the upper left corner of the image as the origin: t x, t y , the width and height of the abnormal area: t w ,t h , and the rotation angle of the abnormal area relative to the horizontal axis: t θ .
[0072] Use t p represents the predicted value, t t represents the target value (i.e., the true value), then the predicted abnormal target offset can be expressed as:
[0073]
[0074] in, Indicates the predicted value of the x coordinate, x p Indicates the horizontal coordinate of the center point of the predicted abnormal area, x a Indicates the horizontal coordinate of the center point of the anchor box, w a represents the width of the anchor box, Represents the predicted value of the y coordinate, y p Indicates the ordinate of the center point of the predicted abnormal area, y a Indicates the ordinate of the center point of the anchor box, h a represents the height of the anchor box, Represents the width prediction value, w p Indicates the predicted abnormal area width, h p represents the predicted height of the abnormal area, Represents the predicted value of the rotation angle relative to the horizontal axis, θ p represents the predicted abnormal area rotation angle, θ a represents the rotation angle of the anchor box; the function f(Δθ)=(Δθ+π)mod2π-π is used to process the difference of the rotation angle to ensure that the predicted rotation angle can be expressed within a reasonable range.
[0075] The true anomaly target offset is expressed as:
[0076]
[0077] in, Indicates the real x coordinate offset, x t Represents the horizontal coordinate of the center point of the real abnormal area, Indicates the real y coordinate offset, y t Indicates the ordinate of the center point of the real abnormal area, Indicates the actual width offset, w t represents the width of the true abnormal area, Indicates the actual height offset, h t Indicates the real abnormal area height, Represents the actual rotation angle offset, θ tIndicates the rotation angle of the real abnormal area.
[0078] Then L n The -norm loss function measures the deviation between the predicted value and the true value:
[0079] L reg =L n -norm(Δt x ,Δt y ,Δt w ,Δt h ,Δt θ ) (6)
[0080] Where Δt = t p -t t ;t p represents the predicted value, t t Indicates the true value; L reg represents the regression loss, L n represents the difference between the predicted abnormal target offset and the true abnormal target offset; Δt x represents the predicted deviation of the x-coordinate offset, Δt y Denotes the predicted deviation of the y-coordinate offset, Δt w represents the predicted deviation of the width offset, Δt h represents the predicted deviation of the height offset, Δt θ The prediction deviation representing the rotation angle offset.
[0081] S27, post-processing the preliminary detection results, removing redundant frames, and obtaining the final detection results.
[0082] Use non-maximum suppression (NMS) to remove redundant detected frames. First, sort all detection frames in descending order of confidence, then select the frame with the highest confidence as the reference frame, calculate the intersection-over-union ratio of the reference frame and other detection frames, and suppress the corresponding detection frame if the intersection-over-union ratio is greater than the preset threshold. Finally, retain the unsuppressed detection frame as the final detection result to improve the accuracy and efficiency of target detection.
[0083] S28. Optimize the parameters of the target detection model.
[0084] The target detection model used to identify abnormal filter operation status uses the BP algorithm to iteratively calculate the deviation between the predicted value and the true value during the training process to update the parameters of the target detection model. The BP algorithm uses the gradient descent strategy to update the weight vector and other parameters. Based on the training samples and the output of the convolutional neural network, the network mean square error E is calculated. k for:
[0085]
[0086] in, Represents the predicted value of the convolutional neural network output, y k Represents the true value of the training sample (i.e., target value).
[0087] Then the update formula for any parameter in the target detection model is:
[0088]
[0089] Where w represents the current parameter to be optimized (such as network weights), Δw represents the update amount of the parameter in the current iteration; η represents the learning rate, which is used to control the step size of parameter adjustment; It represents the gradient of the error with respect to the parameter w, reflecting the direction of error change.
[0090] In the process of parameter optimization, the convolutional neural network algorithm is introduced. By reducing the number of parameters through the superposition of convolutional layers, the network can gain stronger learning ability.
[0091] In addition, the pooling layer is introduced to significantly reduce the dimension of the data and remove redundant information. The pooling layer uses a pooling kernel of a certain size to replace the fully connected weight vector to obtain the output layer. Unlike convolution operations, pooling operations are usually simple averages (equivalent to convolution kernels with all weight values 1) or maximum and minimum values.
[0092] 3. Detect and identify the filter tank liquid level.
[0093] The liquid level of the V-type filter is very important in production, and the water level needs to be monitored in real time to ensure the safety of production. Different from the above-mentioned abnormal identification method of the filter operation status, this embodiment adopts a straight line detection algorithm for the identification of the water level line of the V-type filter to measure the water level height of the filter, which specifically includes the following steps:
[0094] S31, use the line detection algorithm to perform detection. In order to better capture color information, the original RGB color space is first converted to the HSV color space.
[0095] S32. Create a binary image based on the original image by setting a threshold value, and mark the range of the image that matches the pool wall color.
[0096] S33. To reduce noise and better define the boundary, the binary image is opened. The Canny edge detection algorithm is used to find the area with large changes in the binary image, thereby capturing the edge of the pool wall.
[0097] S34, using HoughLinesP algorithm to detect straight line segments in the image. Specifically including:
[0098] (1) Perform preprocessing such as grayscale conversion and edge detection on the input image.
[0099] (2) Hough transform is applied to map the straight line in the image space to the parameter space, and the extreme points in the parameter space are found through a voting mechanism. These extreme points correspond to the straight lines in the image space.
[0100] (3) Perform non-maximum suppression on the detected straight lines to remove false detections and overlapping straight lines.
[0101] (4) The detected straight line is expressed in polar coordinates, including the coordinates of the starting point and the end point of the straight line.
[0102] (5) Further process the detected straight lines according to application requirements, such as screening and classification.
[0103] Use the HoughLinesP algorithm to detect straight line segments in the image and find the boundary between the pool wall and the water surface. Select the upper edge of the pool wall and the water surface height line segment, and by setting a threshold, exclude those line segments with too large an inclination angle, thereby removing noise and irrelevant line segments.
[0104] The upper edge segment and the height of the water surface are selected from the remaining segments. Then, the pixel height difference between the water surface and the pool wall is obtained by calculating the upper edge segment of the pool wall, and the water level is calculated based on the pixel ratio.
[0105] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.
Claims
1. A method for identifying abnormal operating conditions of filter tanks in water supply plants based on machine vision and AI algorithms, characterized in that: The following steps are involved: The image data of abnormal filter operation status is annotated by using a rotating annotation frame, and the angle of the annotation boundary box is rotated according to the different abnormal conditions. Preprocess and enhance the labeled image data to obtain a training data set; Balance the samples of the training data set; A target detection model is built based on a convolutional neural network to identify and predict abnormal conditions in the filter operation status, and output the predicted filter abnormality bounding box and its abnormality category probability; Identify the abnormal area of the filter operation scene, fit the parameters of the manually labeled box based on the feature map extracted by the convolutional neural network through regression, predict the conditional probability of the spatial separation bounding box and the real bounding box, calculate the position coordinates and rotation angle of the abnormal area in the image, and obtain preliminary detection results; The preliminary detection results are post-processed to remove redundant frames and obtain the final detection results.
2. The method for identifying abnormal operating conditions of a filter tank in a water supply plant according to claim 1, characterized in that: The process of rotating the label is: First, the image data is rotated and labeled using the rolabelimg tool. When rotating the label, the angle of the label boundary box is adjusted. The angle of the label boundary box is rotated according to each type of abnormal situation, and it is as close to the abnormal situation as possible to reduce the labeling error. Then, the abnormal conditions of filter operation status are manually marked to obtain the filter abnormality data set; Among them, manual labeling is to use the rolabelimg tool to draw a labeling bounding box on the image and label the type of abnormal situation to obtain a number of labeling data, each of which includes the coordinates, length, width, rotation angle, and abnormal situation type of the labeling bounding box; Abnormal operation of the filter bed includes: foreign matter on the wall of the filter bed, foreign matter on the surface of the filter bed, water column under the V-shaped groove of the filter bed, and sand in the drainage groove of the filter bed.
3. The method for identifying abnormal operating conditions of a filter tank in a water supply plant according to claim 1, characterized in that: The enhancement processing includes random rotation, brightness and contrast adjustment, cropping and scaling, random perturbation, random occlusion and noise addition to expand the data set.
4. The method for identifying abnormal operating conditions of a filter tank in a water supply plant according to claim 1, characterized in that: The equalization process is expressed as: f(t p )=-a t (1-t p ) γ log(t p ) in, Among them, a∈[0,1] is used to coordinate the balance between positive and negative samples; γ is used to reduce the weight of simple samples; p∈[0,1] represents the probability of predicting a sample as a positive class output by the model.
5. The method for identifying abnormal operating conditions of a filter tank in a water supply plant according to claim 1, characterized in that: The constructed object detection model uses a convolutional neural network as a feature extraction network to extract features from the input image and uses a fully connected layer to output predicted probabilities and coordinates; The target detection model determines whether the bounding box is abnormal by calculating the intersection and union ratio of the predicted bounding box and the true bounding box. The target detection model calculates the similarity between the input image and the learned features based on the feature representation of different categories learned through a large amount of labeled data in the training phase. It outputs the probability value of each predicted box belonging to each category, takes the category with the highest probability as the predicted category, and the probability value is greater than the confidence threshold to be judged as a valid prediction, otherwise it is regarded as background.
6. The method for identifying abnormal operating conditions of a filter tank in a water supply plant according to claim 5, characterized in that: When building the target detection model, the model reparameterization technology of network feature extraction and learning is used to simplify the convolution structure of the target detection model into a single convolution branch.
7. The method for identifying abnormal operating conditions of filter tanks in water supply plants according to claim 5, characterized in that: When identifying abnormal areas in the filter operation scene, in the regression process, the image features extracted by the convolutional neural network are used as input, and the parameters of the manually annotated boxes are used as labels; the target detection model generates a series of prior boxes as anchor boxes according to the target size in the training data set in advance, and multiple anchor boxes are randomly distributed in the image; Then the object detection model uses a regression method to predict the offset of the anchor box with the highest IoU ratio with the true bounding box, and uses the anchor box with the highest IoU ratio as the predicted spatial separation bounding box after offset.
8. The method for identifying abnormal operating conditions of filter tanks in water supply plants according to claim 7, characterized in that: In the regression process, the target prediction model calculates the following five parameters: the x and y coordinates of the abnormal area relative to the upper left corner of the image as the origin. x ,t y , the width and height of the abnormal area t w ,t h , and the rotation angle t of the abnormal area relative to the horizontal axis θ ; The predicted abnormal target offset is expressed as: in, Indicates the predicted value of the x coordinate, x p Indicates the horizontal coordinate of the center point of the predicted abnormal area, x a Indicates the horizontal coordinate of the center point of the anchor box, w a represents the width of the anchor box, Represents the predicted value of the y coordinate, y p Indicates the ordinate of the center point of the predicted abnormal area, y a Indicates the ordinate of the center point of the anchor box, h a represents the height of the anchor box, Represents the width prediction value, w p Indicates the predicted abnormal area width, h p represents the predicted height of the abnormal area, Represents the predicted value of the rotation angle relative to the horizontal axis, θ p represents the predicted abnormal area rotation angle, θ a represents the rotation angle of the anchor frame; the function f(Δθ)=(Δθ+π)mod2π-π is used to process the difference of the rotation angle; The true anomaly target offset is expressed as: in, Indicates the real x coordinate offset, x t Represents the horizontal coordinate of the center point of the real abnormal area, Indicates the real y coordinate offset, y t Indicates the ordinate of the center point of the real abnormal area, Indicates the actual width offset, w t represents the width of the true abnormal area, Indicates the actual height offset, h t Indicates the real abnormal area height, Represents the actual rotation angle offset, θ t Indicates the rotation angle of the real abnormal area; By L n The -norm loss function measures the deviation between the predicted value and the true value: L reg =L n -norm(Δt x ,Δt y ,Δt w ,Δt h ,Δt θ ) Where Δt = t p -t t ;t p represents the predicted value, t t Indicates the true value; L reg represents the regression loss, L n represents the difference between the predicted abnormal target offset and the true abnormal target offset; Δt x represents the predicted deviation of the x-coordinate offset, Δt y represents the predicted deviation of the y-coordinate offset, Δt w represents the predicted deviation of the width offset, Δt h represents the predicted deviation of the height offset, Δt θ The prediction deviation representing the rotation angle offset.
9. The method for identifying abnormal operating conditions of a filter tank in a water supply plant according to claim 1, characterized in that: The method further comprises the steps of: optimizing parameters of the target detection model; In the training process of optimizing the parameters of the target detection model, the BP algorithm is used to iteratively calculate the deviation between the predicted value and the true value to update the parameters of the target detection model; The update formula for any parameter in the target detection model is: Where w represents the current parameter to be optimized (such as network weight), and Δw represents the update amount of the parameter in the current iteration; η represents the learning rate, which is used to control the step size of parameter adjustment; represents the gradient of the error with respect to the parameter w; E k is the network mean square error calculated based on the training examples and the output of the convolutional neural network.
10. A water supply plant filter tank abnormal operation condition identification system based on machine vision and AI algorithm, characterized in that: The method according to any one of claims 1 to 9 is used to implement the method, comprising: Set up and dispatch robots, combine production inspection needs, connect robots to the production monitoring platform in the water supply plant, and receive the operating status information of each filter tank in time. According to the operating status of the filter tank, mobilize the robots to perform corresponding work content; Call the target detection model to identify abnormal conditions in the filter operation status; Detect and identify the liquid level in the filter tank.