Sludge state abnormity identification and detection method for sewage treatment
Through the improved mixed model of YOLOv11 model and K-means clustering algorithm, automated detection of sludge settlement state is realized, solving the problem of large manual detection errors and inability to record and analyze, and improving the stability of the sewage treatment system and the effluent quality.
Patent Information
- Application Number
- CN202510240567.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-03
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2045-03-03
AI Technical Summary
In the prior art, the detection of sludge settlement status depends on manual experience and lacks intelligent detection methods, resulting in large errors, inability to record and analyze, and the failure to detect abnormal sludge status in a timely manner, affecting the stability of the sewage treatment system and the effluent quality.
The improved YOLOv11 model combined with the K-means clustering algorithm is used to construct a hybrid model, and the image data of the sludge settlement process is obtained through high-definition image acquisition equipment, and the sludge state is detected in real time, including the clarity of the supernatant, the compactness of the floc, the floating and color of the sludge, and is deployed on the edge computing device for abnormal identification.
It has achieved comprehensive automated detection of sludge status, significantly improving detection efficiency and accuracy, able to timely identify abnormal situations, optimize sewage treatment processes, and improve management efficiency.
Smart Images

Figure CN120339675A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a biochemical sewage treatment method, and particularly to a method for identifying and detecting abnormal sludge states in sewage treatment. Background Art
[0002] In the daily operation of sewage treatment plants, the biochemical tank, as the core treatment unit, undertakes the important tasks of removing organic matter and stabilizing water quality. The sludge sedimentation state and performance are directly related to the operation efficiency and stability of sewage treatment plants. The sludge sedimentation ratio is an important indicator for evaluating sludge sedimentation performance. Traditional sludge sedimentation ratio detection requires manual sampling, which involves a large amount of repetitive labor for testers and is time-consuming and laborious. To improve the detection efficiency, the current intelligent detection of sludge sedimentation performance mainly focuses on computer vision technology. Patent CN202311543442.6 proposes a method for calculating the sludge sedimentation ratio by detecting the pixel height occupied by the sludge using the projection method, effectively solving the cumbersome and time-consuming problems of manual detection of the sludge sedimentation ratio and improving the detection efficiency and accuracy. Patent CN202410610155.0 proposes a method for obtaining the sedimentation ratio of sludge and determining whether the color of the sludge to be tested meets the standard using image recognition technology.
[0003] The prior art mainly focuses on the calculation of the sludge sedimentation ratio and ignores the detection of the sludge sedimentation state. By observing the sedimentation process of the sludge in the biochemical tank in a graduated cylinder, the testers simulate the real state and process of the sludge sedimentation and flocculation in the secondary sedimentation tank. Through observation, differential information such as the supernatant, sludge flocs, sludge color, and sludge floating is captured, so as to further understand and predict the state and change trend of the sludge in the biochemical tank, and timely assist in the process adjustment decision-making, which is of great significance for detecting the sludge sedimentation ratio and the sedimentation state detection. For example: Monitoring the supernatant helps to promptly detect abnormal conditions in the treatment process, including over-aeration, sludge aging, denitrification, etc., thus prompting the operator to quickly take measures for adjustment; Monitoring the compactness of the sludge flocs can reflect the growth and metabolic activity state of the microorganisms in the sludge and its sewage treatment efficiency; Monitoring the color of the sludge often reflects its biological activity and health status. Healthy activated sludge usually appears brown, while blackening or lightening may indicate problems such as anaerobic conditions or nutrient deficiencies; The problem of sludge floating is crucial, which is directly related to the normal operation of the secondary sedimentation tank and the effluent quality. If a large amount of sludge floats, it will not only interfere with the normal sedimentation process, but also may cause the treated water to contain too many suspended solids, affecting the compliance of the final discharged water quality and posing an environmental protection risk. By detecting the sludge state and identifying abnormalities to assist in the analysis of the sludge sedimentation ratio and diagnosing process problems, the sewage treatment plant can timely adjust the process parameters, optimize the operating conditions, and ensure the stability of the sewage treatment system and the compliance of the effluent quality. At present, these process observations rely solely on subjective judgment based on manual experience, with large errors, no clear and unified recording method, unable to conduct comparative analysis and traceability, and the technical experience cannot be effectively accumulated and inherited, and there is a lack of intelligent detection means even more. Summary of the Invention
[0004] The purpose of the present invention is to provide a method for detecting and identifying abnormal sludge states in sewage treatment. This method can accurately detect the sludge sedimentation ratio in a complex background, comprehensively detect and identify the normal and abnormal conditions in sludge states such as the clarity of the supernatant, sludge color, sludge compactness, and sludge floating, meets the actual needs of sludge sedimentation ratio detection in sewage treatment plants, realizes the manual replacement of sludge sedimentation detection, can assist in completing process operation decision-making, and achieves cost reduction and efficiency improvement.
[0005] The technical solution provided by the present invention is as follows:
[0006] A method for detecting and identifying abnormal sludge states in sewage treatment, the method comprising the following steps:
[0007] S01. Data acquisition: Obtain image data of the sludge mixture. The image data of the sludge mixture is sourced from the sludge mixture at the end of the aeration tank in sewage treatment. Place the mixture in a 1000 ml graduated cylinder, and capture the image data during the sludge sedimentation process through a high-definition image acquisition device, and perform data annotation manually.
[0008] S02. Image preprocessing: Perform image preprocessing on the collected images. The image preprocessing methods include denoising, Mosaic data augmentation, Copy-Paste augmentation, and scaling and translation;
[0009] S03. Model construction: Adopt a new hybrid model to detect the sludge state and identify abnormalities, and obtain the state information during the sludge sedimentation process. The state information includes the clarity of the supernatant, the compactness of flocs, sludge floating, sludge sedimentation ratio, and the color of sludge flocs during the sludge sedimentation process;
[0010] Among them, the hybrid model first uses the improved YOLOv11 model to detect the clarity of the supernatant, the compactness of flocs, and the sludge floating information of the sludge, and obtains the ROI sedimentation area. Then, the identified sludge floc color and the calculation of the sludge sedimentation ratio are respectively carried out on the extracted ROI sedimentation area. For the identification of the floc color, the K-means clustering algorithm is used to identify the color of the sludge flocs, and the Euclidean distance of the dominant color is calculated to judge the color of the sludge flocs; the sludge sedimentation ratio is calculated by obtaining the area of the sedimentation area and the conversion coefficient;
[0011] S04. Edge deployment and model output: Deploy the trained and optimized hybrid model to the edge computing device, and real-time output the results of sludge state detection and abnormality identification, and make a judgment on whether an abnormal situation occurs;
[0012] Among them, the sludge state categories include clear supernatant, relatively clear supernatant, relatively turbid supernatant, turbid supernatant, loose flocs, relatively compact flocs, compact flocs and sludge floating, and 5 sludge color categories, namely black, light brown, brown, dark brown, and light red. Among them, sludge floating, turbid supernatant, loose flocs, black sludge, and light red sludge are set as abnormal situations of the sludge; at the same time, the sludge sedimentation ratio trend curve and the sedimentation rate curve are output.
[0013] The described method for detecting and identifying sludge state abnormalities in sewage treatment, the training steps of the improved YOLOv11 in the hybrid model specifically include:
[0014] Using the collected sedimentation pictures and the labeled data manually annotated, through the data preprocessing module, data augmentation is carried out to increase the diversity of the data set and highlight the sludge details; then, through the feature extraction module, the fine-grained features of the image are obtained through the network structure. After passing through the prediction and classification module, the error calculation and weight update are carried out through the loss calculation module and the backpropagation and optimization module to obtain better model parameters for training; finally, after reaching the number of iterations, the system performs post-processing and model evaluation to output the final results;
[0015] Among them, the improved YOLOv11 model has made targeted model improvements, including:
[0016] In the PAFPN spatial pyramid structure, the V7DownSampling convolution module is used to replace the ordinary downsampling module. The V7DownSampling module is the downsampling module in YOLOv7, which is used to improve the multi-scale feature extraction ability and the retention effect of feature information; in the backbone and neck of the PAFPN network architecture, the C3k2_Faster module is used to replace the original C3k2 module; the C3k2_Faster module improves the inference speed and detection accuracy of the model by introducing the backbone module in FasterNet;
[0017] In the PAFPN network architecture, a new type of lightweight scale fusion module is used to replace one C3k2 module and one Conv module. The lightweight scale fusion module realizes efficient feature fusion and model lightweight by fusing the lightweight LightConv convolution and two ShuffleNet modules;
[0018] The MPDIoU loss function is used to replace the CIoU loss function to optimize the bounding box regression performance and improve the detection accuracy of the model.
[0019] The sludge state abnormal recognition and detection method for sewage treatment, the K-means clustering method for recognizing the sludge color, includes the following steps:
[0020] Step 1: Convert the input image into a one-dimensional pixel array; the input image is the detected ROI sedimentation area;
[0021] Step 2: Perform the K-means clustering algorithm on the pixel array, and each cluster represents a potential color group;
[0022] Step 3: Determine the color with the highest occurrence frequency as the dominant color according to the number of pixels in each cluster;
[0023] Step 4: Compare the dominant color with the predefined sludge color range, and determine the closest color label by calculating the Euclidean distance between the dominant color and the center point of each sludge color range, so as to realize the classification of the sludge color in the image;
[0024] The sludge sedimentation ratio SV(t), which represents the sludge sedimentation ratio at the current moment t, is determined by the area S of the ROI sedimentation area of the measuring cylinder and the sedimentation ratio conversion coefficient α:
[0025] SV(t) = S * α * 100%
[0026] Among them, the conversion coefficient α is related to the positions of the camera and the graduated cylinder and is obtained through experimental calibration.
[0027] The described method for identifying and detecting abnormal sludge states in sewage treatment, the detection device of this method includes high-definition image acquisition, display, data processing, and automatic pumping devices; the high-definition image acquisition unit includes a light source device and a high-definition industrial camera, where the high-definition industrial camera is zoomable and has a resolution of 1600*1200 pixels or more, and is connected to the data processing edge device.
[0028] The described method for identifying and detecting abnormal sludge states in sewage treatment, the hybrid model algorithm is deployed in the data processing edge device, where the data processing edge device requires a floating-point operation performance of 8 GFLOPS or more.
[0029] The present invention has the following beneficial effects:
[0030] 1. For the first time, a hybrid model is used to detect the sludge sedimentation ratio, and the monitoring of the supernatant state, sludge floc structure, sludge color change, and sludge floating phenomenon is newly added. Combining multi-dimensional sludge state indicators to comprehensively evaluate the sludge performance, more comprehensively understand its sedimentation process and the system operation status, from partially replacing manual detection to achieving full automation detection, significantly improving the efficiency. By accumulating these multi-dimensional data and using machine learning to assist technicians in identifying abnormalities, potential problems are pre-warned, providing a decision-making basis for process adjustment, thereby optimizing the sewage treatment process and improving management efficiency.
[0031] 2. Classify the monitoring objectives of the sludge sedimentation process state into 13 sub-categories and the sludge sedimentation ratio, clearly and intuitively describe the state of sludge sedimentation, and the machine can directly identify abnormal situations. Such as turbid supernatant, loose flocs, sludge floating, black sludge, and light red sludge are abnormal situations. Process personnel refer to one or more combinations of abnormal situations in the report for process pre-judgment and diagnosis.
[0032] 3. A new hybrid model constructed according to the classification characteristics of the detection data only needs to train the deep vision model, utilize the detection results of the vision network model, and obtain higher-dimensional detection results through the unsupervised detection network. Optimize the model structure, reduce the data processing volume, and greatly improve the operation speed and detection accuracy.
[0033] 4. A more lightweight deep vision model is proposed, with a 50% reduction in the number of model parameters, and the detection accuracy map is increased by 3.1%. The operation speed is also far better than any version of the YOLO series, and it is more suitable for deploying the algorithm on edge devices in the present invention. Description of the Drawings
[0034] To more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are merely exemplary. For those of ordinary skill in the art, without creative efforts, other implementation drawings can be obtained based on the provided drawings.
[0035] The structures, proportions, sizes, etc. illustrated in this specification are only used to cooperate with the content disclosed in the specification for those familiar with this technology to understand and read, and are not used to limit the limiting conditions for the implementation of the present invention. Therefore, they do not have technical substantial significance. Any modification of the structure, change of the proportional relationship, or adjustment of the size, without affecting the effects that the present invention can produce and the purposes that can be achieved, should still fall within the scope covered by the technical content disclosed in the present invention.
[0036] Figure 1 It is the flowchart of the method described in the embodiments of the present invention;
[0037] Figure 2 It is the flowchart of the training stage of the YOLOv11 model described in the embodiments of the present invention;
[0038] Figure 3 It is the flowchart of the network model inference stage of the hybrid model described in the embodiments of the present invention;
[0039] Figure 4 It is the structure diagram of the detection device described in the embodiments of the present invention;
[0040] Figure 5 It is the scatter plot comparing the detection speed accuracy and model size of different methods in the embodiments of the present invention.
[0041] In the figure: 1 - Image acquisition device; 2 - Display device; 3 - Data processing edge device; 4 - Lighting device (1); 5 - Data processing circuit control device; 6 - Lighting device (2); 7 - Flow sensing device; 8 - Pumping device; 9 - Sludge mixture placement area; 10 - 1000ml - Settling container; 11 - Device box. Specific embodiments
[0042] The following details the present invention in combination with embodiments. To make the purpose, technical solutions, and advantages of the present invention clearer and more definite, the present invention is further described in detail below, but the present invention is not limited to these embodiments.
[0043] The present invention detects the sludge sedimentation ratio, floc compactness, supernatant clarity, sludge color, and sludge floating state during the sedimentation process of the sludge mixture through deep learning technology, and provides detailed sedimentation information to researchers, realizing the detection of sludge state and abnormal conditions during the sedimentation process of the sludge mixture; in addition, the deep learning technology adopted is a new hybrid model that is more suitable for sludge state detection to complete the detection of many indicators during the sludge sedimentation process; the hybrid model first uses the improved YOLOv11 model to detect the supernatant clarity of the sludge, the compactness of the flocs, and the sludge floating information, and obtains the ROI sedimentation area, and respectively performs the recognition of the sludge floc color and the calculation of the sludge sedimentation ratio on the extracted ROI sedimentation area. For the recognition of the floc color, the K-means clustering algorithm is used to recognize the color of the sludge flocs, and the Euclidean distance of the dominant color is calculated to judge the floc color of the sludge; the sludge sedimentation ratio is calculated by obtaining the area of the sedimentation area and the conversion coefficient. Through this model, the detection of sludge state and abnormal conditions can be completed faster and more accurately, and on the premise of ensuring the detection accuracy, the model parameters are reduced and the detection speed is improved.
[0044] In the first aspect of the present invention, a system method for sludge state detection and abnormal recognition is provided, including the following steps:
[0045] S01. Data acquisition: Obtain sludge mixture image data, which comes from the sludge mixture at the end of the sewage treatment aeration tank. Place the mixture in a 1000 ml graduated cylinder, and capture the image data during the sludge sedimentation process through a high-definition image acquisition device, and perform data annotation manually.
[0046] S02. Image preprocessing: Perform image preprocessing on the captured images. The image preprocessing methods include denoising, Mosaic data augmentation, Copy-Paste augmentation, and scaling and translation.
[0047] S03. Model construction: Adopt a new hybrid model to perform state detection and abnormal recognition on the sludge state, and obtain the state information during the sludge sedimentation process, where the state information includes the supernatant clarity, floc compactness, sludge floating, sludge sedimentation ratio, and sludge floc color during the sludge sedimentation process.
[0048] Among them, the hybrid model first uses the improved YOLOv11 model to detect the clarity of the supernatant of the sludge, the compactness of the flocs, and the information of sludge floating, and obtains the ROI settlement area. The extracted ROI settlement area is respectively used for the recognition of the color of the sludge flocs and the calculation of the sludge sedimentation ratio. For the recognition of the floc color, the K-means clustering algorithm is used to recognize the color of the sludge flocs, and the Euclidean distance of the dominant color is calculated to judge the floc color of the sludge; by obtaining the area of the settlement area and the conversion coefficient, the sludge sedimentation ratio is calculated.
[0049] S04. Edge Deployment and Model Output: Deploy the trained and optimized hybrid model to the edge computing device, and output the results of sludge state detection and anomaly recognition in real time, and judge whether there is an abnormal situation;
[0050] The output is the sludge state and the results of anomaly recognition. The sludge state categories include clear supernatant, relatively clear supernatant, relatively turbid supernatant, turbid supernatant, loose flocs, relatively compact flocs, compact flocs and sludge floating, as well as 5 sludge color categories, namely black, light brown, brown, dark brown and light red. Among them, sludge floating, turbid supernatant, loose flocs, blackened sludge and light red sludge are set as abnormal situations of the sludge; at the same time, the sludge sedimentation ratio trend curve and the sedimentation rate curve are output.
[0051] In the second aspect of the present invention, a method for detecting the color of sludge flocs and the sludge sedimentation ratio SV(t) by using the ROI settlement area output by the vision detection model is provided.
[0052] The sludge floc color detection uses the K-means clustering method to identify the sludge color, including the following steps:
[0053] Step 1: Convert the input image into a one-dimensional pixel array; the input image is the detected ROI settlement area;
[0054] Step 2: Perform the K-means clustering algorithm on the pixel array, and each cluster represents a potential color group;
[0055] Step 3: Determine the color with the highest frequency of occurrence as the dominant color according to the number of pixels in each cluster;
[0056] Step 4: Compare the dominant color with the predefined sludge color range, and determine the closest color label by calculating the Euclidean distance between the dominant color and the center point of each sludge color range, so as to realize the classification of the sludge color in the image;
[0057] The sludge sedimentation ratio SV(t) is calculated, which represents the sludge sedimentation ratio at the current moment t, and is determined by the area S of the ROI settlement area of the graduated cylinder and the sedimentation ratio conversion coefficient α:
[0058] SV(t) = S * α * 100%
[0059] Wherein, the conversion coefficient α is related to the positions of the camera and the graduated cylinder, and is obtained through experimental calibration.
[0060] In the third aspect of the present invention, a new hybrid model is provided. The inference process of the hybrid model includes successively connecting a data preprocessing module, a feature extraction module, a prediction and classification module, a post-processing module, an output detection result module, a color recognition module, and a sedimentation ratio calculation module;
[0061] The data processing module performs operations such as size adjustment, normalization, and sharpening of the sludge mixture sedimentation pictures to be detected, so as to improve the detailed information of sludge characteristics; the feature extraction module is used for the pictures after the preprocessing module to obtain the fine-grained features of its sedimentation floc part and sedimentation supernatant part; the prediction and classification module is used to predict the bounding box and category through the feature map; the post-processing module is used to filter out the prediction results with low scores and select the prediction results with high scores; the output result module outputs the results after the post-processing module, including the target category and the target area; the color recognition module obtains the ROI sedimentation area to be detected through a one-step object detection network, calculates the Euclidean distance between the entire ROI area and the common colors of the sludge mixture to obtain the dominant color of the area, and outputs the sludge color with the highest probability; the sedimentation ratio calculation module calculates the sedimentation volume of the sludge by obtaining the sedimentation area through the ROI sedimentation area.
[0062] A further improvement of the sludge state detection and anomaly recognition system of the present invention lies in:
[0063] The training steps of the improved YOLOv11 in a new hybrid model of the present invention specifically include:
[0064] Using the collected sedimentation pictures and the labeled data manually marked, through the data preprocessing module, data augmentation is performed to increase the diversity of the data set and highlight the sludge details; then through the feature extraction module, the fine-grained features of the image are obtained through the network structure, and then through the prediction and classification module, the error calculation and weight update are performed through the loss calculation module and the backpropagation and optimization module to obtain better model parameters for training. Finally, after reaching the number of iterations, the system performs post-processing and model evaluation to output the final result.
[0065] A further improvement of the sludge state detection and anomaly recognition system of the present invention lies in,
[0066] The improved YOLOv11 model includes: the feature extraction module, which adopts the PAFPN spatial pyramid structure of YOLOv11. The PAFPN spatial pyramid structure uses the V7DownSampling convolution module to replace the ordinary downsampling module. The backbone and neck of the PAFPN network architecture are replaced with the C3k2_Faster module for the original scale fusion module C3k2. The PAFPN network architecture uses a new type of LSS lightweight scale fusion module to replace one of the C3K2 and one Conv module, and replaces the Ciou loss function with the MPDIoU loss function.
[0067] A further improvement of the sludge state detection and anomaly recognition system of the present invention lies in
[0068] During the training process, the feature extraction module uses the PAFPN spatial pyramid structure of the YOLO series as the main body. The network includes three parts, namely the backbone network part, the neck network part, and the head network part. Compared with the traditional PFN network architecture, this network framework adds a bottom-up fusion architecture and simplifies the model structure and reduces the parameters, further obtaining the global semantic information of the sedimentation state, and realizing a more comprehensive capture of state features of different scales and different fine-grainedness, thereby improving the model performance.
[0069] A further improvement of the sludge state detection and anomaly recognition system of the present invention lies in
[0070] For the downsampling modules of the backbone module and the neck module of the PAFPN network architecture, except for the first two downsampling convolution modules of the backbone, the rest all adopt a new type and more lightweight V7DownSampling convolution module. This module uses a more modern convolution structure, and uses max pooling and a 3*3 convolution operation with a stride of 2 as the downsampling method. During the operation process, 1*1 convolution operations and 3*3 convolution operations with a stride of 2 are respectively used for data adjustment and channel number adjustment, and these two parts are spliced together as the output of the downsampling.
[0071] A further improvement of the sludge state detection and anomaly recognition system of the present invention lies in
[0072] For the scale fusion of the backbone module and the neck module of the PAFPN network architecture, the C3k2_Faster module is used to replace the original scale fusion module. The improvement lies in using the Bottleneck of Faster to replace the Bottleneck of the original C3k2 module, and fusing it into the current C3k2_Faster module, which enhances the fine-grained representation of the sedimentation state and greatly reduces the number of parameters in the model framework.
[0073] A further improvement of the sludge state detection and anomaly recognition system of the present invention lies in that
[0074] To make the training model more lightweight, the present invention also proposes a new type of scale fusion module. By fusing a more lightweight LightConv convolution and ShuffleNet module, a new LSS module is obtained. The module includes a ShuffleNet module with a stride of 2 and a ShuffleNet module with a stride of 1, enabling the image information to obtain more fine-grained information and multi-scale feature information, and greatly reducing the number of parameters of the model.
[0075] A further improvement of the sludge state detection and anomaly recognition system of the present invention lies in that
[0076] The loss calculation module uses MPDIoU to replace the loss function. MPDIoU is a loss function for bounding box regression, aiming to solve the problem that the existing loss function cannot be effectively optimized when the predicted bounding box and the ground truth bounding box have the same aspect ratio but completely different width and height values. This loss function can be better used for the detection of sedimentation cylinders in a more complex environment.
[0077] In the fourth aspect of the present invention, a device for detecting the sludge sedimentation state is provided. The sedimentation device includes: 1 - an image acquisition device; 2 - a display device; 3 - a data processing edge device; 4 - a lighting device (1); 5 - a data processing circuit control device; 6 - a lighting device (2); 7 - a flow sensing device; 8 - a pumping device; 9 - a sewage placement area; 10 - a 1000 ml sedimentation container; 11 - a device box.
[0078] In the embodiment, the device box adopts a left hinge-type opening design and is internally divided into a rectangular structure with upper and lower layers. A sedimentation container is provided in the middle and slightly to the right at the bottom of the device box. The image acquisition device is installed on the left side wall, at the same horizontal line as the 1000 mL sedimentation container and facing it. The lighting device is located above the lower layer; another lighting device is located on the left side of the lower layer and placed obliquely. The display device is embedded in the outer side wall of the device box. The data processing edge device, the control device, and the data processing circuit control device are located on the left side of the upper layer and are connected to the lighting device, the image acquisition device, the display device, and the pumping device through USB and HDMI interfaces. The pumping device and the flow sensor are arranged on the right side of the upper layer. The water outlet of the pumping device is connected to the water inlet of the flow sensor through a hose, and the water outlet of the flow sensor is fixed directly above the 1000 mL sedimentation container.
[0079] Furthermore, the high-definition image acquisition unit includes a light source device and a high-definition industrial camera, wherein the high-definition industrial camera is variable-focus and has a resolution of 1600*1200 pixels or more, and is connected to the data processing edge device.
[0080] Further, the display device is an 8-inch touch high-definition display.
[0081] Further, the data processing edge device is an edge development board, which connects to the video data obtained by the image acquisition device and runs the depth vision model for real-time calculation. The data processing edge device can establish communication with the cloud server to achieve cloud storage of data and display the detection information on the display device in real time. The floating-point operation performance of the data processing edge device needs to reach more than 8 GFLOPS.
[0082] Further, the lighting device is an industrial-level shadowless lamp with adjustable brightness.
[0083] Further, the data processing circuit control device is a MUC microcontroller single-chip computer, which is connected to the flow sensor to obtain the sensor data in real time, execute the judgment program of the circuit part, and transfer the data to the data processing edge device at the same time.
[0084] Further, the pumping device is a small water pump, and the water inlet of the water pump extends into the sludge mixture placement area through a hose.
[0085] Further, the outer wall of the device box is made of aluminum alloy, and the inside uses a white opaque material.
[0086] The following is illustrated with the embodiments shown in the accompanying drawings:
[0087] The present invention provides a method and device for sludge state detection and anomaly recognition. For the detection of many indicators during the sludge sedimentation process, a method of a new hybrid model is proposed to complete the detection of many key indicators. The following structure Figures 1 to 5 has described the specific implementation manners of the present invention in detail.
[0088] Embodiment 1:
[0089] Figure 1 shows the method flow of the system. The method flow is sequentially a data acquisition module, an image preprocessing module, a model construction module, and an edge deployment and model output module. The steps are as follows:
[0090] S01. Data acquisition: Obtain sludge mixture image data. The sludge mixture image data is from the sludge mixture at the end of the sewage treatment aeration tank. The mixture is placed in a 1000 ml graduated cylinder, and the image data during the sludge sedimentation process is captured by a high-definition image acquisition device, and the data is manually labeled.
[0091] S02. Image preprocessing: Perform image preprocessing on the acquired image. The image preprocessing method includes denoising, Mosaic data augmentation, Copy-Paste augmentation, and scaling and translation;
[0092] S03. Model construction: Use a new type of hybrid model to detect the sludge state and identify abnormalities, and obtain the state information during the sludge sedimentation process. The state information includes the clarity of the supernatant, the compactness of the flocs, sludge floating, the sludge sedimentation ratio, and the color of the sludge flocs during the sludge sedimentation process;
[0093] Among them, the hybrid model first uses the improved YOLOv11 model to detect the clarity of the supernatant, the compactness of the flocs, and the sludge floating information of the sludge, and obtains the ROI sedimentation area. The extracted ROI sedimentation area is respectively used for the identification of the color of the sludge flocs and the calculation of the sludge sedimentation ratio. For the identification of the floc color, the K-means clustering algorithm is used to identify the color of the sludge flocs, and the Euclidean distance of the dominant color is calculated to judge the floc color of the sludge; the sludge sedimentation ratio is calculated by obtaining the area of the sedimentation area and the conversion coefficient;
[0094] S04. Edge deployment and model output: Deploy the trained and optimized hybrid model to the edge computing device, and real-time output the results of sludge state detection and abnormality identification, and judge whether an abnormal situation occurs;
[0095] The output is the sludge state and the abnormality identification result. The sludge state categories include clear supernatant, relatively clear supernatant, relatively turbid supernatant, turbid supernatant, loose flocs, relatively compact flocs, compact flocs, and sludge floating, as well as 5 sludge color categories, namely black, light brown, brown, dark brown, and light red. Among them, sludge floating, turbid supernatant, loose flocs, black sludge, and light red sludge are set as abnormal situations of the sludge; at the same time, the sludge sedimentation ratio trend curve and the sedimentation rate curve are output.
[0096] Exemplarily, in the model construction described in Embodiment 1, a method for detecting the color of sludge flocs and the sludge sedimentation ratio SV(t) by using the ROI sedimentation area output by the visual detection model is provided.
[0097] The sludge floc color detection uses the K-means clustering method to identify the sludge color, including the following steps:
[0098] Step 1: Convert the input image into a one-dimensional pixel array; the input image is the detected ROI sedimentation area;
[0099] Step 2: Perform the K-means clustering algorithm on the pixel array, and each cluster represents a potential color group;
[0100] Step 3: Determine the color with the highest occurrence frequency as the dominant color according to the number of pixels in each cluster;
[0101] Step 4: Compare the dominant color with the predefined sludge color range, and determine the closest color label by calculating the Euclidean distance between the dominant color and the center point of each sludge color range, so as to realize the classification of the sludge color in the image;
[0102] The sludge settling ratio SV(t) is calculated, which represents the sludge settling ratio at the current moment t, and is determined by the area S of the settling area of the measuring cylinder ROI and the settling ratio conversion coefficient α:
[0103] SV(t)=S*α*100%
[0104] Among them, the conversion coefficient α is related to the positions of the camera and the measuring cylinder, and is obtained through experimental calibration.
[0105] Example 2:
[0106] Figure 2 The training phase process of the YOLOv11 model for sludge state and anomaly recognition provided by the embodiment of the present invention. Using the collected settling pictures and the labeled tag data manually, through the data preprocessing module, data augmentation is performed to increase the diversity of the data set and highlight the sludge details; then the feature extraction module is performed, and the fine-grained features of the image are obtained through the network structure. After that, through the prediction and classification module, the error calculation and weight update are performed through the loss calculation module and the backpropagation and optimization module to obtain better model parameters for training. Finally, after reaching the number of iterations, the system performs post-processing and model evaluation to output the final result.
[0107] In a specific exemplary solution, the feature extraction module in the training process uses the PAFPN spatial pyramid structure of YOLOv11 as the main body. The network includes three parts, namely the backbone network part, the neck network part, and the head network part. This network framework adds a bottom-up fusion architecture compared with the traditional PFN network architecture, further obtains the global semantic information of the settling state, and realizes a more comprehensive capture of state features of different scales and different fine-grained levels, thereby improving the model performance.
[0108] Exemplarily, for the backbone module of the PAFPN network architecture and the downsampling module of the neck module, except for the first two downsampling convolutional modules of the backbone, a new and more lightweight V7DownSampling convolutional module is adopted. This module uses a more modern convolutional structure and uses max pooling and a 3*3 convolutional operation with a stride of 2 as the downsampling method. During the operation, a 1*1 convolutional operation and a 3*3 convolutional operation with a stride of 2 are respectively used for data adjustment and channel number adjustment, and the two parts are concatenated together as the output of the downsampling.
[0109] Exemplarily, for the scale fusion of the backbone module and the neck module of the PAFPN network architecture, the C3k2_Faster module is used to replace the original scale fusion module. The improvement lies in using the Bottleneck of Faster to replace the Bottleneck of the original C3k2 module, and fusing them into the current C3k2_Faster module, which enhances the fine-grained representation of the sedimentation state and greatly reduces the number of parameters in the model framework.
[0110] Exemplarily, to make the training model more lightweight, the present invention also proposes a new type of scale fusion module. By fusing a more lightweight LightConv convolution and a ShuffleNet module, a new LSS module is obtained. The module includes a ShuffleNet module with a stride of 2 and a ShuffleNet module with a stride of 1, enabling the image information to obtain more fine-grained information and multi-scale feature information, and greatly reducing the number of parameters in the model.
[0111] Exemplarily, the loss calculation module uses MPDIoU to replace the loss function. MPDIoU is a loss function for bounding box regression, aiming to solve the problem that the existing loss function cannot be effectively optimized when the predicted bounding box and the ground truth bounding box have the same aspect ratio but completely different width and height values. This loss function can be better used for the detection of sedimentation containers in a more complex environment.
[0112] Example 3:
[0113] Figure 3 Shows the network model inference phase process of the hybrid model. The inference process of the hybrid model includes successively connecting a data preprocessing module, a feature extraction module, a prediction and classification module, a post-processing module, an output detection result module, a color recognition module, and a sedimentation ratio calculation module;
[0114] The data processing module performs operations such as resizing, normalizing, and sharpening the sludge sedimentation pictures to be detected, so as to improve the detailed information of sludge characteristics; the feature extraction module is used for the pictures after the execution of the preprocessing module to obtain the fine-grained features of its sedimentation floc part and sedimentation supernatant part; the prediction and classification module is used to predict the bounding boxes and categories through the feature maps; the post-processing module is used to filter out the prediction results with low scores and select the prediction results with high scores; the output result module outputs the results after the execution of the post-processing module, including the target category and target area; the color recognition module obtains the ROI sedimentation area to be detected through a one-step object detection network, calculates the Euclidean distance between the entire ROI area and the common colors of sludge, so as to obtain the dominant color of the area and output the sludge color with the highest probability; the sedimentation ratio calculation module calculates the sedimentation volume of sludge by obtaining the sedimentation area through the ROI sedimentation area.
[0115] The detection targets of the hybrid model include different states of the sludge mixture at the end of the sewage treatment aeration tank, where the sludge state categories include clear supernatant, relatively clear supernatant, relatively turbid supernatant, turbid supernatant, loose flocs, relatively compact flocs, compact flocs, and sludge floating, as well as 5 sludge color categories, namely black, light brown, brown, dark brown, and light red. Among them, sludge floating, turbid supernatant, loose flocs, blackened sludge, and light red sludge are set as abnormal situations of sludge; at the same time, the sludge sedimentation ratio trend curve and sedimentation rate curve are output.
[0116] In a specific exemplary solution, after the sludge has sedimented for 30 minutes, the division of normal and abnormal sludge categories is shown in Table 1:
[0117] Table 1 Division of normal and abnormal sludge categories
[0118]
[0119]
[0120] Example 4:
[0121] Figure 4 Specifically shows the structure diagram of a specific sludge state detection device. It can realize the function of automatic pumping, and can also accurately read the sludge sedimentation value through the deployment of a deep network model at the edge to draw the sludge sedimentation ratio sedimentation curve, and detect the turbidity of the supernatant, sludge compactness, sludge color, and abnormal state of sludge floating. At the same time, it combines the large language model to deeply analyze the detected data, excavate more potential information, and upload the detected information data to the cloud to generate a sedimentation report for researchers to reference.
[0122] In a specific exemplary solution, the device adopts a left-hinged opening design, with a rectangular structure divided into upper and lower layers inside. The interior uses a white opaque material to ensure the best conditions for light control and visual inspection.
[0123] In a specific exemplary solution, a transparent cylindrical sedimentation container 10 in the shape of a 1000 mL graduated cylinder is provided on the right side of the middle of the bottom of the device box. It has an open upper end and a flat bottom design for accurate measurement. The image acquisition device 1 (USB high-definition camera) is installed on the left side wall, at the same horizontal line as the sedimentation container 10 and facing the container directly to ensure clear capture of the sedimentation process. The lighting device 6 is located above the lower layer and uses a shadowless lamp with adjustable brightness to provide uniform illumination; another lighting device 5 is located on the left side of the lower layer, illuminating obliquely from the side to enhance the visibility of details. The display device 2 (8-inch touch high-definition display) is embedded in the outer side wall of the device box for convenient user operation and data viewing. The data processing and control devices 3 and 5 are located on the left side of the upper layer and are connected to the image acquisition device, lighting device, display device, and pumping device through USB and HDMI interfaces. An edge AI computing card and a MUC microcontroller are selected to achieve overall control. The pumping device 8 and the flow sensor 7 are arranged on the right side of the upper layer. The water outlet of the pumping device is connected to the water inlet of the flow sensor 7 through a hose, and the water outlet of the sensor 7 is fixed directly above the sedimentation container 10 to ensure stable injection of sludge water and achieve automated water inlet operation, improving the accuracy and repeatability of the experiment. Specifically:
[0124] Exemplarily, the high-definition image acquisition device includes a light source device and a high-definition industrial camera. The high-definition industrial camera is zoomable and has a resolution of 1600*1200 pixels or more, and is connected to the data processing edge device.
[0125] Exemplarily, the data processing edge device 3 uses a Jetson Nano BO1 development board, which has the characteristics of miniaturization, low power consumption, and high computing power. It can receive video data obtained by the image acquisition device in real time and run the hybrid model for real-time detection. According to the recognition result, the data processing edge device 3 establishes communication with the cloud server to achieve cloud storage of data and simultaneously displays the detection information on the embedded display 2 in real time.
[0126] Exemplarily, the data processing circuit control device 5 uses an Arduino single-chip microcomputer, which is connected to the flow sensor 7 and the pumping device 8, obtains the data of the flow sensor 7 in real time, executes the judgment program of the circuit part, and simultaneously transmits the data to the data processing edge device 3.
[0127] Exemplarily, the lighting device 6 uses an industrial-grade special shadowless lamp to avoid errors in detection caused by external factors such as light and shadow.
[0128] For exemplary explanation, the pumping device 8 is selected as a medium-sized water pump, and the water inlet of the water pump extends into the middle of the liquid in the sludge water placement area through a hose.
[0129] Example 5:
[0130] Figure 5 It shows the scatter comparison diagram of different models of the improved YOLOv11 model on the sludge state dataset collected this time. The method of the embodiment of the present invention exceeds the current relatively popular object detection network model in terms of detection accuracy, and significantly reduces the model size.
[0131] For exemplary explanation, the hybrid model described in the present invention first uses the improved YOLOv11 model to detect the clarity of the supernatant of the sludge, the compactness of the flocs, and the sludge floating information, and obtains the ROI settlement area. The extracted ROI settlement area is respectively used for the identification of the sludge floc color and the calculation of the sludge settlement ratio. For the identification of the floc color, the K-means clustering algorithm is used to identify the color of the sludge flocs, and the Euclidean distance of the dominant color is calculated to judge the floc color of the sludge; for the calculation of the sludge settlement ratio, the area of the settlement area and the conversion coefficient are obtained, and the sludge settlement ratio is calculated;
[0132] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them. Although the present invention has been described in detail with reference to the above embodiments, those of ordinary skill in the art should understand that: the specific implementation manners of the present invention can still be modified or equivalently replaced, and any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered by the protection scope of the claims of the present invention.
Claims
1. A method for identifying and detecting abnormal sludge states in sewage treatment, characterized in that, The method includes the following steps: S01. Data acquisition: Obtain image data of the sludge mixture. The image data of the sludge mixture is from the sludge mixture at the end of the sewage treatment aeration tank. Place the mixture in a 1000 ml graduated cylinder, and use a high-definition image acquisition device to capture the image data during the sludge sedimentation process, and manually annotate the data; S02. Image preprocessing: Perform image preprocessing on the acquired images. The image preprocessing methods include denoising, Mosaic data augmentation, Copy-Paste augmentation, and scaling and translation; S03. Model construction: Adopt a new type of hybrid model to detect the sludge state and identify abnormalities, and obtain the state information during the sludge sedimentation process. The state information includes the clarity of the supernatant, the compactness of flocs, sludge floating, sludge sedimentation ratio, and the color of sludge flocs during the sludge sedimentation process; Among them, the hybrid model first uses the improved YOLOv11 model to detect the clarity of the supernatant, the compactness of flocs, and the sludge floating information of the sludge, and obtain the ROI sedimentation area. Then, the sludge floc color recognition and sludge sedimentation ratio calculation are respectively carried out on the extracted ROI sedimentation area. For the recognition of the floc color, the K-means clustering algorithm is used to recognize the sludge floc color, and the Euclidean distance of the dominant color is calculated to judge the sludge floc color; the sludge sedimentation ratio is calculated by obtaining the area of the sedimentation area and the conversion coefficient; S04. Edge deployment and model output: Deploy the trained and optimized hybrid model to the edge computing device, and output the results of sludge state detection and abnormality recognition in real time, and judge whether there is an abnormal situation; Among them, the sludge state categories include clear supernatant, relatively clear supernatant, relatively turbid supernatant, turbid supernatant, loose flocs, relatively compact flocs, compact flocs and sludge floating, and 5 sludge color categories, namely black, light brown, brown, dark brown, and light red. Among them, sludge floating, turbid supernatant, loose flocs, black sludge, and light red sludge are set as abnormal situations of the sludge; at the same time, the sludge sedimentation ratio trend curve and the sedimentation rate curve are output.
2. The sludge state abnormal recognition and detection method for sewage treatment according to claim 1, characterized in that The training steps of the improved YOLOv11 in the hybrid model specifically include: Using the collected sedimentation pictures and the labeled data manually annotated, through the data preprocessing module, perform data augmentation to increase the diversity of the dataset and highlight the sludge details; then perform the feature extraction module, obtain the fine-grained features of the image through the network structure, and after passing through the prediction and classification module, perform error calculation and weight update through the loss calculation module and the backpropagation and optimization module to obtain better model parameters for training; finally, after reaching the number of iterations, the system performs post-processing and model evaluation to output the final result; Among them, the improved YOLOv11 model has made targeted model improvements, including: In the PAFPN spatial pyramid structure, the V7 DownSampling convolution module is used to replace the ordinary downsampling module. The V7 DownSampling module is the downsampling module in YOLOv7, which is used to improve the multi-scale feature extraction ability and the retention effect of feature information. In the backbone and neck of the PAFPN network architecture, the C3k2_Faster module is used to replace the original C3k2 module. The C3k2_Faster module improves the inference speed and detection accuracy of the model by introducing the backbone module in FasterNet. In the PAFPN network architecture, a new lightweight scale fusion module is used to replace one C3k2 module and one Conv module. The lightweight scale fusion module realizes efficient feature fusion and model lightweight by fusing the lightweight LightConv convolution and two ShuffleNet modules. The MPDIoU loss function is used to replace the CIoU loss function to optimize the bounding box regression performance and improve the detection accuracy of the model.
3. A method for identifying and detecting abnormal sludge state in sewage treatment according to claim 1, characterized in that, The described K-means clustering method for identifying sludge color includes the following steps: Step 1: Convert the input image into a one-dimensional pixel array; the input image is the detected ROI sedimentation area. Step 2: Perform the K-means clustering algorithm on the pixel array, and each cluster represents a potential color group. Step 3: Determine the color with the highest occurrence frequency as the dominant color according to the number of pixels in each cluster. Step 4: Compare the dominant color with the predefined sludge color range, and determine the closest color label by calculating the Euclidean distance between the dominant color and the center point of each sludge color range, so as to realize the classification of the sludge color in the image. The sludge sedimentation ratio SV(t), which represents the sludge sedimentation ratio at the current time t, is determined by the area S of the ROI sedimentation area of the graduated cylinder and the sedimentation ratio conversion coefficient α: SV(t) = S * α * 100% Among them, the conversion coefficient α is related to the positions of the camera and the graduated cylinder and is obtained through experimental calibration.
4. A method for identifying and detecting abnormal sludge state in sewage treatment according to claim 1, characterized in that, The detection device of this method includes high-definition image acquisition, display, data processing, and automatic pumping devices. The high-definition image acquisition unit includes a light source device and a high-definition industrial camera. The high-definition industrial camera is zoomable and has a resolution of more than 1600 * 1200 pixels, and is connected to the data processing edge device.
5. A method for identifying and detecting abnormal sludge state in sewage treatment according to claim 1, characterized in that, The described hybrid model algorithm is deployed in the data processing edge device. Among them, the data processing edge device needs to have a floating-point operation performance of more than 8 GFLOPS.
Citation Information
Patent Citations
Sewage treatment sludge settleability detection device and method thereof
CN117571711A
Activated sludge performance detection method and system
CN118549307A
Lightweight YOLO pet identification method based on GhostNet
CN115049966A
Sewage water quality identification and application method based on deep learning
CN118196513A
Activated sludge microscopic image segmentation model construction method
CN118334654A
Cited By
Oxidation ditch sludge state monitoring method and system
CN121505372A