Abstract

The proposed work describes an approach for segmentation of activated sludge flocs from the microscopic images for monitoring wastewater treatment. The morphological features of flocs (microbial aggregates) and filaments are related to the state of an activated sludge wastewater treatment plant and must be monitored for proper functioning. Hence, image processing and analysis could be a time-saving monitoring tool. To address this challenge, we propose a novel framework involving a multiphase edge detection algorithm based on information theory. The proposed framework is evaluated and scrutinized critically considering the artifacts found in the photographs tested. To evaluate the segmentations, gold approximation of estimated truth images is created. In addition, the performance was subjectively evaluated for its potential for segmenting activated sludge images. Experimental results show that the proposed framework exhibits the good results and demonstrates its effectiveness.

1. Introduction

In wastewater treatment plants, the activated sludge (AS) technique is extensively applied to handle both industrial and domestic effluent. Physico-chemical techniques, which are time-consuming, arduous, and have associated environmental concerns, are used to monitor the process’s performance [1]. The use of image processing and analysis to monitor AS in a wastewater treatment plant is a safe, time-effective, and semiautomated solution [2].

The AS process’s efficiency is determined by the capacity of flocs to settle and the existence of bacteria named filamentous in the wastewater treatment plant’s secondary clarifier. Microbial aggregates made up of live and dead bacteria, as well as their metabolic products, are known as flocs [3]. In this publication, bacteria of filamentous are too referred as filaments. It uses a phase-contrast microscopy (PCM) picture of AS to show the visual representation of the flocs and filaments. The ability of a floc to settle is determined by its morphological structure. The backbone of the floc structure is made up of filaments [4].

A floc’s compactness and, as a result, its ability to settle improve when filaments are present at a certain concentration [5, 6]. Consequently, the flocs do not settle adequately, impacting the AS wastewater treatment plant’s effluent quality. Image processing and analysis can be used to monitor and parametrize the morphology and quantification of the flocs and filaments. The overall length of filament, for example, is a critical metric that is determined through image processing [7]. It is utilized to model the sludge size index, which is one of the most critical AS process characteristics to track.

In the last few decades, image processing has seen a substantial increase in its application and utilization. Image processing uses a variety of techniques and algorithms to edit images, such as image filtering, image segmentation algorithms, and image classification algorithms [8]. Using such techniques, you can extract a lot of relevant information from an image. Image processing has a wide range of uses, including medical, entertainment, and remote sensing [9]. The use of image processing in the field of activated sludge wastewater treatment was investigated in this research [1012].

Microscopy is required to detect the minute particles generated by bacteria during activated sludge wastewater treatment [13]. One sort of microscopy is phase-contrast microscopy, which converts phase changes in light passing through a transparent object into brightness changes in the image. The human eye is incapable of detecting phase alterations in light under normal conditions. Bright-field microscopy, on the other hand, converts phase changes into brightness variations that can be seen by the naked eye [14].

By processing a microscopic image of a wastewater sample produced using phase-contrast microscopy, image processing can be used to segment and quantify filaments and flocs [15]. The performance of the image processing method, on the other hand, will be greatly determined by the algorithm employed to process the image. In this paper [3], image segmentation algorithms were researched and tested for their performance on filament segmentation and quantification, and one technique was used to segment and quantify flocs. The Bradley Thresholding, Sobel Edge Detection, and Laplacian Edge Detection Algorithms were utilized to segment filaments in this research [16], whereas the Otsu Thresholding technique was employed to segment and quantify flocs.

To address this challenge, we present a novel framework based on information theory that includes a multiphase edge detection technique. The suggested framework is rigorously assessed and inspected in light of the artefacts discovered in the images examined. Gold approximation of estimated truth pictures is constructed to test the segmentations. Additionally, the performance was judged subjectively for its ability to partition activated sludge photos. The results of the experiments reveal that the suggested framework produces good outcomes and is effective.

The goal of this study was to see how well each method performed at segmenting filaments. Aside from that, the project will look at employing image processing to quantify the flocs [17, 18]. This study was also conducted to better understand the impact of adjusting various parameters in image segmentation algorithms on the algorithms’ performance [19].

In [20], they studied bright-field and phase-contrast microscopy pictures and utilized three techniques to segment and measure the flocs. Image segmentation using the Bradley local thresholding technique is the first way, texture segmentation using range filtering and Otsu’s thresholding is the second method, and segmentation using the Gaussian Mixture Method is the third method. In [21], they begin by explaining the background of image segmentation, as well as the methodologies and metrics used in image segmentation. Second, they go into the history of metalearning and provide a more detailed description of the term. The similarities and differences between metalearning and other related approaches are thoroughly compared. In [22], they proposed turning the challenge of detecting concave points into one of determining the relative location of a point and a linear equation. The relative location of a pixel point and a linear equation can be used to determine the pixel coordinates of concave points. The algorithm is simple to implement and runs quickly. Finally, they achieve a high accuracy rate of segmentation for the adhesion of two objects.

2. Proposed Methodology

In this section, we present description of the proposed framework that will be used for segmentation of activated sludge flocs and filaments in microscopic images for monitoring wastewater treatment. As illustrated in Figure 1, the gradient image in the phase-contrast image comprises two types of edges: one amidst the halos and the background and the other amidst the halos and the foreground. The latter has a higher gradient value. As a result, we conclude that halo can be corrected by applying a gradient threshold. Thus, entropy thresholding was applied in the edge-based approach. Shannon finds the threshold automatically at first and then repeatedly tunes it to 1.4 for the last thresholding. The correction worker was necessary due to halos at the flocs’ edges and filaments being an artifact. Such parameters are used to fine-tune picture segmentation to deal with application-specific aberrations like halos. If we look closely at the halos, we can see that they have two edges. The foreground is one thing, while the flocs or filaments, which are considerably sharper, are another. As a result, the adjustment factor appears to be a natural technique to raise the gradient’s threshold to shrink the observed border toward filament or the flocs.

There are multiple steps to this process. The image is first transformed into a grayscale image (MATLAB software). Second, using the proposed edge detection approach, the images are turned into gradient images. Third, the adjusted adjustment factor is used to binarize the gradient image. Fourth, the binary picture is overlaid on top of the grayscale images to sharpen the filament edges. Fifth, as previously said, the color gamut of the image with sharp edges and binary is obtained utilizing the default MATLAB technology’s threshold calculation. Finally, to fill minor discontinuities, we utilize the morphological operation of image closing.

Because an image can be understood as an information source with the probability law given by its picture histogram, the Entropy idea becomes increasingly significant in image processing. In image processing, threshold approaches based on entropy have obtained a lot of attention in the previous several years. They have been discovered to be one of the most effective image segmentation algorithms. As a result, we present a method for segmentation that uses a two-phase threshold. The possibility behavior of sources of information is used to define entropy. Given events occurring with a high probability being k the total number of states, .

Shannon entropy is defined as follows:

Using equation (1), we suggested a two-phase image thresholding strategy for edge detection that uses Shannon entropy for the global threshold of the input image and then for the local threshold. The Shannon entropy has a high quality when systems can be divided into two statistically independent subsystems X and Y (additively) .

Suppose f(a, b) is the pixels gray value at point (a, b). In digital images with size allow the histograms to be for with f denoting the image’s amplitude (brightness) at the actual coordinated point (a, b). The collection of all gray levels is referred to as for convenience. The gray level diagram of the images is typically used in global thresholding algorithms. The optimal is calculated by maximizing an appropriate standard function based on the gray-level distributed of the images and many different features. Assume that t represents a threshold values and been a paired of grayscale levels with . Perfectly, and are usually assumed to be 0 and 1, respectively. The consequence of applying a threshold on the function of an image at graying level t is a binaries function with the property if ; otherwise, .

A thresholding approach, in general, determines the value of t using a criterion function. The thresholding method is point dependant if is chosen only by the gray level of every pixel [9]. A picture for z gray levels has a probability distributed as . We may generate two probability distributions from this distribution, one for the item (class X) and then another into the background (class Y), as follows:where

For any distribution, the Shannon entropy can be calculated as follows:

Create a binary image initially in the proposed scheme by selecting a sufficient threshold value. The method entails processing each pixel of the original image and constructing a new image in such a way that the old image is no longer visible, such that if otherwise, that for every for , for . When , the value found by Shannon’s approach is the same as the threshold value in equation (2). To find the ideal threshold at , use the following expression as a criterion function:

The diagram of the multiphase edge detection algorithm of image with activated sludge is shown in Figure 2.

3. Experimental Results

This section presents the experimental results of the achieved experiments and comparisons with various PCM images. The goal is to deliver the required discussions regarding the findings of this research work. To assess the proposed approach, various samples of PCM images were chosen randomly from databases content of 130 AS samples with a total of 4,048 images to determine its true processing abilities. This dataset comprised of AS processing samples that were either abnormal or normal. In addition, Canny algorithm is used in the comparison process as edge-based segmentation approach. The proposed algorithm and comparison algorithm were implemented using MATLAB 2018a with a computer with 4 GB of memory and a 2.8 GHz Intel Core I5-5 processor. Subjective and objective metrics were used as an additional way to measure the quality of the attained results.

Table 1 shows the confusion matrix and terminology used in performance evaluation. True positive (TP) pixel is categorized as foreground in-ground reality images but erroneously detected as background at segmentation images. True negative (TN) pixel is classified as background in-ground reality images but erroneously detected as foreground in segmentation images. False negative (FN) pixel is classified as foreground in-ground reality images but erroneously detected as background in segmentation images. False positive (FP) is defined as which the pixel is shown in-ground reality images as background but erroneously detected.

FPR is the percentage of background pixels in the ground truth images that are incorrectly identified as foreground. FNR is the percentage of foreground pixels in the ground truth picture that are incorrectly identified as background. The rate of all correctly identified pixels is known as accuracy. From equations (5)–(7), the equations are as follows:

Table 2 compares the mean value of the segmentation assessment. The suggested approach is more accurate than the Canny technique, indicating that it is more sensitive to flocs. In comparison to the Canny technique, the proposed algorithm has a lower FNR and FPR. This indicates that the suggested technique is less likely to under- or oversegment flocs in photos, and it is more consistent than the Canny method when segmenting flocs from images.

Figure 3 shows some sample segmentations of flocs in microscopic images of activated sludge. Experimental results shown in Figures 49 indicate the effectiveness of our proposed method.

4. Conclusion

In this paper, we proposed a new multiconcept algorithm for segmentation of activated sludge flocs in microscopic images for monitoring wastewater treatment efficiently manner by utilizing a combination of well-known processing concepts; the AS samples’ flocs and filamentous bacteria show a complicated structure. The algorithms are evaluated for their ability to segment flocs. From the experimental results, the proposed algorithm performed well. In addition, it showed superiority over the Canny segmentation algorithm.

Data Availability

Data are available upon request.

Conflicts of Interest

The authors declare that they have no conflicts of interest.

Acknowledgments

The authors extend their appreciation to the Deputyship for Research & Innovation Ministry of Education in Saudi Arabia for funding this research work through the project number MoE-IF-20-01.