A method for segmenting flocs and filamentous bacteria in activated sludge phase contrast microscopy images

Through a multi-step method in unsupervised mode, combined with technologies such as Otsu threshold method, multi-scale Retinex and constrained fuzzy clustering, the problem of segmenting flocs and filamentous bacteria in activated sludge microscopic images is solved, and fast and accurate segmentation is achieved. and morphological feature extraction, reducing costs.

CN115082379BActive Publication Date: 2025-01-21SHENYANG INSTITUTE OF CHEMICAL TECHNOLOGY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210596702.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-30
Publication Date
2025-01-21
Estimated Expiration
2042-05-30

AI Technical Summary

Technical Problem

The prior art is difficult to accurately segment flocs and filamentous bacteria in activated sludge microscopy images, especially when the light source intensity changes and the distribution of flocs and filamentous bacteria are uneven, resulting in low segmentation accuracy and high cost.

Method used

A multi-step approach in unsupervised mode was used for segmentation, including image acquisition, floc segmentation and filamentous bacteria segmentation. Specific steps include: image acquisition, floc segmentation using Otsu threshold method and edge detection, filamentous bacteria segmentation using multi-scale Retinex, top hat and bottom hat filtering and constrained fuzzy clustering and other technologies.

Benefits of technology

It achieves rapid and accurate segmentation of flocs and filamentous bacteria in activated sludge microscopic images without the need for calibration samples, reducing labor costs and improving segmentation accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115082379B_ABST
    Figure CN115082379B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for segmenting flocs and filamentous bacteria in phase contrast microscopic images of activated sludge, belonging to an intelligent detection method for sewage treatment. The present invention solves the problem that it is difficult to distinguish flocs, filamentous bacteria and background under the influence of phase contrast microscopic halo and shading effect, and extracts corresponding features. The specific implementation method includes: image acquisition, floc segmentation, filamentous bacteria segmentation and feature extraction. Image acquisition: using a phase contrast microscope and image acquisition software to obtain a phase contrast microscopic image of activated sludge; floc segmentation: using grayscale transformation, image inversion and opening operation to pre-process the image, and using the Otsu method to segment the flocs; filamentous bacteria segmentation: using multi-scale Retinex, top hat and bottom hat filtering to enhance flocs, edge detection to pre-process the sludge image, using a constrained fuzzy clustering method to segment the filamentous bacteria, and using the gyration radius feature to remove fragments; feature extraction: from the segmented floc and filamentous bacteria images, extracting the morphological feature parameters of flocs and filamentous bacteria respectively.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to an intelligent detection method for sewage treatment, and in particular to a method for segmenting flocs and filamentous bacteria in an activated sludge phase-contrast microscopic image. Background Art

[0002] The activated sludge microscopic image is composed of flocs and filamentous bacteria. The correct segmentation is the key to extracting the morphological parameters of activated sludge. However, due to the complex characteristics of flocs with different densities attached to the filamentous bacteria skeleton, such as heterogeneity and diverse structures, it is difficult to distinguish flocs, filamentous bacteria and background under the influence of phase contrast microscopic halo and shading effect. In addition, the changes in light source intensity, the uneven distribution of flocs and filamentous bacteria, and the small target of filamentous bacteria when collecting different batches of sludge samples also increase the difficulty of segmentation.

[0003] Activated sludge microscopic image segmentation mainly includes segmentation based on digital image technology and segmentation based on deep learning. Among them, digital image methods include threshold-based segmentation methods, edge-based segmentation methods, and region-based segmentation methods. These methods all use a single method to process the target, which is prone to under-segmentation, over-segmentation, and unsegmentation. Deep learning methods include Deeplab-based segmentation methods, U-Net-based segmentation methods, and PSPNet-based segmentation methods. The segmentation methods are developing rapidly and have produced a variety of model variants. However, after collecting data, a large amount of manpower is required to label samples, which is time-consuming and costly, and is not suitable for actual projects. Summary of the invention

[0004] The present invention discloses a method for segmenting flocs and filamentous bacteria in phase contrast microscopic images of activated sludge, proposes to use different methods for segmentation according to the characteristics of flocs and filamentous bacteria, without the need for calibrating samples, and is used to solve the under-segmentation, over-segmentation and non-segmentation situations that are prone to occur in digital image processing, while ensuring the accuracy of the model, to achieve accurate and rapid segmentation of the target, and to extract the morphological characteristics of flocs and filamentous bacteria, meeting the needs of offline deployment and application in actual engineering. Its microscopic image segmentation and quantitative information extraction technology has potential value in the prediction of sludge bulking and individual concentration measurement biosensors of flocs and filamentous bacteria.

[0005] In order to achieve the above object, the present invention adopts the following technical solution:

[0006] A method for segmenting flocs and filamentous bacteria in activated sludge phase contrast microscopic images, characterized in that it comprises the following steps:

[0007] S1, image acquisition: activated sludge samples were collected at the outlet of the aeration tank of the sewage treatment plant, and phase contrast microscopic images of the activated sludge were captured using an optical microscope, an industrial digital camera, and an image acquisition system;

[0008] S2, floc segmentation: the Otsu threshold method is used to perform threshold detection on the image after linear transformation, image inversion and opening operation to obtain the approximate shape of the floc, and the final floc is determined by the edge detection result;

[0009] S3, filamentous bacteria segmentation: After the image is enhanced by multi-scale Retinex (MSR), the activated sludge filamentous bacteria segmentation is achieved through top-hat and bottom-hat filtering, edge detection, constrained fuzzy clustering, and gyration radius feature method;

[0010] S4, feature extraction: from the segmented floc and filamentous fungus images, the morphological feature parameters such as size and shape of floc and filamentous fungus are extracted respectively.

[0011] Further optionally, step S1 includes the following steps:

[0012] S11, activated sludge sample obtained from the outlet of the aeration tank of the sewage treatment plant; S12, using an optical microscope, an industrial digital camera and an image acquisition system, the sludge sample on the slide was scanned in a zigzag path from the upper left to the lower right. RGB color images to create an activated sludge microscopic image dataset.

[0013] Further optionally, step S2 includes the following steps:

[0014] S21, preprocessing the image by grayscale transformation, image inversion and opening operation;

[0015] S22, selecting the Otsu threshold method to perform threshold detection on the pre-processed image to obtain a rough result of the flocs;

[0016] S23, removing broken edges of the segmented flocs through morphological closing operations, and filling holes appropriately, and then determining the final floc edge using the edge detection result.

[0017] Further optionally, step S3 includes the following steps:

[0018] S31, image preprocessing, including multi-scale Retinex, filtering and edge detection;

[0019] S32, segmenting the preprocessed image using constrained fuzzy clustering;

[0020] S33, performing post-processing operations on the segmented image, using a reduced radius of gyration to remove debris, and determining aged flocs, etc., so as to more accurately segment the filamentous fungi.

[0021] Further optionally, the formula for reducing the radius of gyration is as follows:

[0022]

[0023] in , and is a second-order matrix, defined as follows:

[0024]

[0025] , is a first-order matrix, i.e. the coordinates of the image centroid: .

[0026] Further optionally, step S4 includes extracting morphological features of sludge flocs and filamentous bacteria. Features are extracted for each target of flocs and filamentous bacteria in the image in turn, and the following are the morphological feature parameters extracted for each target:

[0027]

[0028]

[0029] Beneficial effects of the present invention:

[0030] 1. Use unsupervised mode to segment flocs and filamentous bacteria in activated sludge microscopic images, without the need for sample calibration, saving manpower;

[0031] 2. Combine multi-scale Retinex frequency domain processing, top-hat and bottom-hat filtering, and morphological operation space domain processing to suppress the inherent artifacts of phase contrast microscopy images, eliminate background effects, and enhance flocs and filamentous bacteria targets;

[0032] 3. Further improve the accuracy and robustness of tiny target filamentous fungi segmentation based on constrained fuzzy clustering and morphological features. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] The accompanying drawings are part of the present invention and are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention, but do not constitute an improper limitation of the present invention. Obviously, the drawings described below are only some embodiments. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the accompanying drawings:

[0034] Figure 1 It is a flow chart of the segmentation method based on activated sludge phase contrast microscopy images;

[0035] Figure 2 This is the flow chart of activated sludge phase contrast microscopy image acquisition;

[0036] Figure 3This is an example diagram of the segmentation results of the present invention on a sludge microscopic image test set;

[0037] Figure 4 Performance of the proposed method on a sludge microscopic image dataset. DETAILED DESCRIPTION

[0038] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Figure 1 The figure shows a flow chart of a method for segmenting flocs and filamentous bacteria in a phase contrast microscopic image of activated sludge according to the present invention. The present invention is a method for segmenting flocs and filamentous bacteria in a phase contrast microscopic image of activated sludge, comprising the following steps:

[0039] S1, image acquisition. S1 includes the following steps:

[0040] S11, the collection process of activated sludge phase contrast microscopy images is as follows Figure 2 As shown, sludge samples were taken from the outlet of the aeration tank of the sewage treatment plant. 500 mL of sludge sample was taken each time, and the interval between sample collection and image collection did not exceed 3 hours;

[0041] S12, using a calibrated pipette with a cross-section tip, take 10 μL of sample on a glass slide and cover it with a 24 mm × 24 mm square cover glass. Using an optical microscope (Nikon Eclipse TS100), an industrial digital camera (ToupTek ToupCamucoms03100kpa) and image acquisition software (ToupView), scan the sludge sample on the slide in a zigzag path from the upper left to the lower right. The sludge sample is photographed RGB color images were used to create a dataset of activated sludge microscopic images. The phase contrast magnification of the microscope was 100X to determine the size, shape, and structural parameters of flocs and filamentous bacteria. Since the phase contrast microscope is too sensitive to phase changes and there are some defects in the imaging process, some artifacts such as halos, spots, and shadows are generated in the presented images.

[0042] S2, floc segmentation. S2 includes the following steps:

[0043] S21, grayscale conversion is performed on the grayscale image to adjust the grayscale value of the image. The grayscale range of the original image is 0-255. After repeated experiments, the adjustment range is set to [0.3, 0.8]. The grayscale value less than 255×0.3 is set to 0, and the grayscale value greater than 255×0.8 is set to 255. The grayscale beyond this range remains unchanged. The grayscale converted image is then inverted and opened to obtain an image. Using the grayscale image to subtract the processed image can greatly suppress the halo and shadow phenomenon, while enhancing the floc contrast;

[0044] S22, selecting the Otsu threshold method to perform threshold detection on the pre-processed image to obtain a rough result of the flocs;

[0045] S23, due to the uneven grayscale distribution and brightness in the original grayscale image, the flocs segmented by the Otsu algorithm are not perfect. There are gaps inside the flocs, and breakpoints appear at the joints between the flocs. Therefore, the segmented flocs are removed from the broken edges through morphological closing operations, and the holes are appropriately filled. Then, the edge detection results are used to determine the final floc edge.

[0046] S3, filamentous fungus segmentation. S3 includes the following steps:

[0047] S31, first, the RGB image (red, green, blue) is subjected to multi-scale Retinex for image enhancement. After multi-scale Retinex enhancement, the texture structure influence caused by the brightness of the light source of different samples is overcome, and the contrast of the entire data set is improved. The grayscale image is subjected to top-hat and bottom-hat filtering, and the top-hat filtered image is added to the grayscale image to make the floc area brighter and larger. Then the bottom-hat filtered image is subtracted to make the filaments darker. The contours of the flocs and filamentous fungi in the entire image are clear, which is convenient for the next step of edge extraction. Sobel gradient edge detection is performed on the filtered image. Due to the interference of noise, the boundary features of the image after edge detection can rarely be fully described, and it will be interrupted in places with inconsistent brightness. The morphological closing operation is used to connect the entire boundary. The obtained binary image is then multiplied with the original grayscale image to remove the cluttered background;

[0048] S32, using the constrained fuzzy clustering method to segment the image after removing the cluttered background, the number of constrained fuzzy clusters The three categories are whole, floc and filamentous fungi. After clustering, the pixels of each category are classified into corresponding labels, i.e., labels 1, 2 and 3. The label 3 of filamentous fungi is extracted, and the segmented image of filamentous fungi is obtained.

[0049] S33, post-processing the segmented image. The image segmented by S32 needs further defragmentation because some targets are misdetected. The first stage is to remove the area less than 300. The second stage is to use the reduced gyration radius to distinguish between fragments and filamentous bacteria. Objects with RG greater than 1 are filamentous bacteria, and the required filamentous bacteria image is obtained. The third stage is to remove aged flocs. Aged flocs are often encountered in the collected sludge images. Aged flocs are dark brown, similar to the color of filamentous bacteria. During cluster segmentation, it is easy to identify aged flocs as filamentous bacteria. This stage is to judge The floc image segmented from the floc model If the pixel , then this pixel is considered The pixel points of the flocs are subtracted from the part belonging to the flocs, that is, , and the final filamentous fungus was obtained.

[0050] S4, feature extraction. Among them, S4 includes extracting the morphological features of sludge flocs and filamentous bacteria. After steps (S2-S3), the flocs and filamentous bacteria in the sludge image are separated from the background, and the morphological feature parameters such as the size and shape of the flocs and filamentous bacteria are calculated respectively, including global features and local features. Global features include the number of flocs and filamentous bacteria and their total area, and local features include size measurements and shape descriptors. Among them, size measurements include area, length, width and circumference, and shape descriptors include roundness, shape coefficient, and reduced radius of gyration.

[0051]

[0052]

[0053] Among them, the Euler number can be used as a feature to identify objects. The Euler number is defined as the number of connected components minus the number of holes. This topological feature has the characteristics of stability, rotation and scale invariance; the shape factor ( ) is mainly used to compare the deviation between the target and the circle. The shape factor is used to determine whether the boundary is smooth. Its value range is 0 to 1, where the shape factor of the circle is 1. The roundness is expressed as R

[0054] The roundness is determined by the elongation of the target, and its value range is 0 to 1, where the roundness of the circle is 1; the radius of gyration, represented by RG, is also determined by the elongation of the target. The longer the floc, the larger the radius of gyration. ; Aspect ratio, which represents the symmetry of the shape of an object, is represented by AR. There may be many targets in each image, and the above parameters (except the total area) calculated for the images of multiple targets are averaged. 22 parameters are used to quantitatively characterize the morphological characteristics of flocs and 13 parameters are used to quantitatively characterize the morphological characteristics of filamentous fungi, that is, 35 morphological parameters are extracted from each sample. The purpose of this part of the study is to seek the correlation between image analysis information and SVI.

[0055] The present invention includes four steps: activated sludge microscopic image acquisition, floc segmentation, filamentous bacteria segmentation, and feature extraction. The embodiment specifically implements the segmentation of sludge microscopic images collected from a sewage plant. The results are as follows: Figure 3 shown. Figure 3In the figure, each row shows an experimental image process, in each column, the upper picture is the original collected sludge microscopic image, the middle picture is the label truth image annotated by labelme (where gray is flocs and white is filamentous bacteria), and the lower picture is the segmentation result image obtained by the processing of the present invention.

[0056] In this example, 333 sludge microscopic images were used as the segmentation dataset, and the segmentation targets were flocs and filamentous bacteria. The standard evaluation indicators for image segmentation (Accurary, Precision, Recall, Dice) were used for evaluation. Figure 4 The test results of the proposed method and other methods for segmentation from sludge microscopic images are given. The larger the value, the better the performance.

[0057] Figure 4 The performance of this method on the sludge microscopic image dataset is shown in Figure 2. Figure 4 It can be seen that the image segmentation indicators of flocs and filamentous bacteria of this method are higher than those of other methods.

[0058] The device embodiments described above are merely illustrative. Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software, and can be understood and implemented without creative work. Based on such an understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0059] The above is only a preferred embodiment of the present invention, and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment, it is not used to limit the present invention. Any technician familiar with this patent can make some changes or modify the technical contents suggested above into equivalent embodiments without departing from the scope of the technical solution of the present invention. However, any simple modification, equivalent change and modification made to the above embodiments according to the technical essence of the present invention without departing from the content of the technical solution of the present invention still fall within the scope of the solution of the present invention.

Claims

1. A method for segmenting flocs and filamentous bacteria in activated sludge phase contrast microscopic images, characterized in that: The method comprises the following steps: S1, image acquisition: activated sludge samples were collected at the outlet of the aeration tank of the sewage treatment plant, and phase contrast microscopic images of the activated sludge were captured using an optical microscope, an industrial digital camera, and an image acquisition system; S2, floc segmentation: the Otsu threshold method is used to perform threshold detection on the image after linear transformation, image inversion and opening operation to obtain the approximate shape of the floc, and the final floc is determined by the edge detection result; S3, filamentous bacteria segmentation: After the image is enhanced by multi-scale Retinex, the activated sludge filamentous bacteria segmentation is achieved through top-hat and bottom-hat filtering, edge detection, constrained fuzzy clustering, and gyration radius feature method; S4, feature extraction: extract the size and shape morphological feature parameters of flocs and filamentous fungi from the segmented floc and filamentous fungi images respectively; The step S3 comprises the following steps: S31, image preprocessing, including multi-scale Retinex, filtering and edge detection; S32, segmenting the preprocessed image using constrained fuzzy clustering; S33, performing post-processing operations on the segmented image, removing fragments by reducing the gyration radius, and determining aged flocs, so as to more accurately segment the filamentous fungi; The formula for reducing the radius of gyration is as follows: in M 2x and M 2y is a second-order matrix, defined as follows M 1x , M 1y is a first-order matrix, i.e. the coordinates of the image centroid: The step S4 includes the morphological characteristics of sludge flocs and filamentous bacteria, specifically the number of total closed surfaces, the total area of ​​closed areas, the average area of ​​closed areas, the length of the major axis of the second-order central moment ellipse, the length of the minor axis of the second-order central moment ellipse, the perimeter, the convex perimeter, the equivalent circle diameter, the Euler number, the area after filling, the shape factor, the roundness, the radius of rotation, the aspect ratio, the fractal dimension, the firmness, the eccentricity, the minimum Feret's diameter, the maximum Feret's diameter, the convex envelope area, the bounding box area, the compactness, and the total length of the filamentous bacteria.

2. The method for segmenting flocs and filamentous bacteria in activated sludge phase contrast microscopic images according to claim 1, characterized in that: The step S1 comprises the following steps: S11, activated sludge sample obtained from the outlet of the aeration tank of the sewage treatment plant; S12, using an optical microscope, an industrial digital camera and an image acquisition system, scans the sludge sample on the slide in a Z-shaped path from the upper left to the lower right. N × N RGB color images of the sludge sample are taken to create an activated sludge microscopic image dataset.

3. The method for segmenting flocs and filamentous bacteria in activated sludge phase contrast microscopic images according to claim 1, characterized in that: The step S2 comprises the following steps: S21, preprocessing the image by grayscale transformation, image inversion and opening operation; S22, selecting the Otsu threshold method to perform threshold detection on the pre-processed image to obtain a rough result of the flocs; S23, removing broken edges of the segmented flocs through morphological closing operations, and filling holes appropriately, and then determining the final floc edge using the edge detection result.

Citation Information

Patent Citations

  • SVI measurement method based on activated sludge phase difference microscopic image

    CN111192236A

  • Sludge bulking prediction method based on activated sludge phase difference microscopic image

    CN112767362A