원시데이터 수집 시스템
선정목록으로

Segmentation of Activated Sludge Phase Contrast Microscopy Images Using U-Net Deep Learning Model

관련 필름·전자재료 · (13) 프리즘 필름

기본 정보

저자
  1. Lijie Zhao — College of Information Engineering, Shenyang University of Chemical Technology, No. 11 St., Tiexi Economic and Technological Development Dist., Shenyang City 001021, China
  2. Shi-Da Zou — College of Information Engineering, Shenyang University of Chemical Technology, No. 11 St., Tiexi Economic and Technological Development Dist., Shenyang City 001021, China
  3. Yuhong Zhang — College of Environment Engineering, Shenyang University of Chemical Technology, No. 11 St., Tiexi Economic and Technological Development Dist., Shenyang City 001021, China
  4. Ming‐Zhong Huang — College of Information Engineering, Shenyang University of Chemical Technology, No. 11 St., Tiexi Economic and Technological Development Dist., Shenyang City 001021, China
  5. Yue Zuo — College of Information Engineering, Shenyang University of Chemical Technology, No. 11 St., Tiexi Economic and Technological Development Dist., Shenyang City 001021, China
  6. Jia Wang — College of Information Engineering, Shenyang University of Chemical Technology, No. 11 St., Tiexi Economic and Technological Development Dist., Shenyang City 001021, China
  7. Xing-Kui Lu — College of Information Engineering, Shenyang University of Chemical Technology, No. 11 St., Tiexi Economic and Technological Development Dist., Shenyang City 001021, China
  8. Zhihao Wu — College of Information Engineering, Shenyang University of Chemical Technology, No. 11 St., Tiexi Economic and Technological Development Dist., Shenyang City 001021, China
  9. Xiangyu Liu — College of Environment Engineering, Shenyang University of Chemical Technology, No. 11 St., Tiexi Economic and Technological Development Dist., Shenyang City 001021, China
DOI
10.18494/sam.2019.2406
저널
Sensors and Materials
발행년도
2019
발행기관
MYU K.K.
피인용수
10
라이선스
cc-by
논문 유형
–
언어
–
원문 페이지
https://doi.org/10.18494/sam.2019.2406
토픽
Electron and X-Ray Spectroscopy Techniques
OpenAlex ID
W2954608653

평가 내용

관련도
관련
사업분야
필름·전자재료 · (13) 프리즘 필름
부 분야
–
R&D 측면
–
확신도
–
근거 용어
–
판단 근거
임베딩 유사도 기반 평가로 '필름·전자재료 > 프리즘 필름' 분야에 선정된 논문입니다.
R&D 활용 포인트
–
평가 입력
–

초록

For the activated sludge wastewater treatment process, the image segmentation of flocs and filaments has become a crucial component in the successful implementation of a sludge volume index (SVI) sensor and the early fault detection of filamentous bulking.The segmentation of a phase contrast microscopy (PCM) image is a challenging problem because of the weak greyscale distinction between flocs and filaments, as well as the artifacts of halos and shadows.In this work, we proposed an automatic floc and filament segmentation method for PCM images using a U-Net deep learning structure with data augmentation.A loss function combining the binary cross entropy (BCE) function and Dice coefficient is proposed to improve the segmentation accuracy and sensitivity with unbalanced foreground and background samples.The performance of the segmentation algorithm is evaluated by the accuracy, precision, recall, F-measure, and intersection-over-union (IoU) metrics.Lab-scale experiments on the activated sludge process have been carried out to verify the proposed image segmentation method.Our proposed U-Net models with the combined loss function give better results than the U-Net models with BCE, fully convolutional network-VGG16 (FCN-VGG16), and a traditional segmentation method.

본문 38,421자

본문 펼치기
_Sensors and Materials_, Vol. 31, No. 6 (2019) 2013–2028 2013 MYU Tokyo S & M 1912 ## Segmentation of Activated Sludge Phase Contrast Microscopy Images Using U-Net Deep Learning Model Li-Jie Zhao, <sup>1</sup> Shi-Da Zou, <sup>1</sup> Yu-Hong Zhang, <sup>2*</sup> Ming-Zhong Huang, <sup>1</sup> Yue Zuo, <sup>1</sup> Jia Wang, <sup>1</sup> Xing-Kui Lu, <sup>1</sup> Zhi-Hao Wu, <sup>1</sup> and Xiang-Yu Liu <sup>2</sup> 1College of Information Engineering, Shenyang University of Chemical Technology, No. 11 St., Tiexi Economic and Technological Development Dist., Shenyang City 001021, China 2College of Environment Engineering, Shenyang University of Chemical Technology, No. 11 St., Tiexi Economic and Technological Development Dist., Shenyang City 001021, China (Received April 17, 2019; accepted May 29, 2019) _Keywords:_ wastewater treatment, activated sludge, phase contrast microscopy, image segmentation, U-Net model For the activated sludge wastewater treatment process, the image segmentation of flocs and filaments has become a crucial component in the successful implementation of a sludge volume index (SVI) sensor and the early fault detection of filamentous bulking. The segmentation of a phase contrast microscopy (PCM) image is a challenging problem because of the weak greyscale distinction between flocs and filaments, as well as the artifacts of halos and shadows. In this work, we proposed an automatic floc and filament segmentation method for PCM images using a U-Net deep learning structure with data augmentation. A loss function combining the binary cross entropy (BCE) function and Dice coefficient is proposed to improve the segmentation accuracy and sensitivity with unbalanced foreground and background samples. The performance of the segmentation algorithm is evaluated by the accuracy, precision, recall, F-measure, and intersection-over-union (IoU) metrics. Lab-scale experiments on the activated sludge process have been carried out to verify the proposed image segmentation method. Our proposed U-Net models with the combined loss function give better results than the U-Net models with BCE, fully convolutional network-VGG16 (FCN-VGG16), and a traditional segmentation method. 1. Introduction The activated sludge process is a general and typical biological wastewater treatment process. Biodegradation occurs in aeration tanks where microorganisms form activated sludge flocs. The settling ability of activated sludge, which directly determines the quality of the wastewater effluent, is critical for the operation of wastewater treatment plants, Therefore, the key to the operation of a sewage treatment plant is to have sufficient activated sludge with good settling ability. <u>*Corresponding author: e-mail: zhangyhhit@163.com</u> https://doi.org/10.18494/SAM.2019.2406 ISSN 0914-4935 © MYU K.K. https://myukk.org/ 2014 _Sensors and Materials_, Vol. 31, No. 6 (2019) Conventionally, the settling ability of the activated sludge treatment plants is monitored by measuring physicochemical parameters such as the sludge volume index (SVI). However, regular measurements are costly, tedious, and time-consuming, and have associated environmental hazards. <sup>(1)</sup> The morphological characteristics and internal structure of flocs and filaments are closely related to the settling ability of activated sludge. The morphological change of the activated sludge is used for the early detection and identification of abnormal operation conditions, such as sludge bulking and pin flocs. Activated sludge microscopic examination is required for process control and stable plant operation. <sup>(2)</sup> However, the accuracy and reliability of manual image analysis largely depend on the operator’s prior knowledge. With the development of microscopy and digital image processing technology, a large number of digital images of activated sludge can be collected and stored, and quantitatively analyzed. <sup>(3–6)</sup> By extracting the morphological information of flocs and filaments from microscopic images, physical and chemical parameters such as SVI can be effectively measured, and the abnormal operation of a sewage treatment plant can be detected early. <sup>(7)</sup> Since the collected samples do not require special preparation and filamentous bacteria can be observed at a relatively low magnification, phase contrast microscopy (PCM) is commonly used to observe activated sludge. Over the last two decades, the processing and analyses of PCM images of activated sludge have received considerable attention and widely applied to the measurement of SVI and the early detection and fault diagnosis of sludge bulking in wastewater treatment plants. <sup>(8,9)</sup> Grijspeerdt and Verstraete investigated the relevance of the morphology of activated sludge flocs and the settling ability of the sludge, and performed image analysis to estimate the settling ability of activated sludge. <sup>(4)</sup> Khan _et al._ reported a robust segmentation of PCM images of filamentous bacteria, the identification of image analysis parameters for the morphology of the bacteria, and the measurement of SVI. <sup>(1)</sup> The processing and analyses of microscopy images have proven to be a potential alternative monitoring tool in the early warning and prediction of the settling ability. <sup>(10)</sup> Image segmentation is a key step in image analysis and the basis for further understanding the microbial structure. The accuracy of image analysis depends on the quality of the segmentation of microbial aggregates and filaments in microscopy images of activated sludge. Several traditional image segmentation algorithms, including edge detection, clustering, texture-based segmentation, watershed algorithm, and some combinations of algorithms, have been reported for activated sludge images. Khan _et al._ applied nine different approaches to segment PCM images of activated sludge (AS) samples and assessed their effectiveness in a comparative experiment. <sup>(11)</sup> The experiments have shown that these traditional algorithms have the risks of oversegmentation, undersegmentation, and failure, and are not always applicable to all PCM images. Nisar _et al._ found that flocs are oversegmented using the Otsu thresholding algorithm. Furthermore, they investigated three image segmentation algorithms for PCM images. <sup>(12)</sup> Khan _et al._ proposed a robust segmentation procedure for flocs and filamentous bacteria, and investigated regression models for SVI on the basis of the extracted morphological characteristic parameters of filaments and flocs. <sup>(13)</sup> Jenné _et al._ developed an automatic image analysis system for monitoring the floc and filament features of activated sludge. <sup>(14)</sup> However, these methods usually require some parameters be manually set to achieve automatic segmentation. _Sensors and Materials_, Vol. 31, No. 6 (2019) 2015 Currently, traditional image segmentation methods are based on the assumption of sharp grey contrasts between flocs and filaments. In a microbial image of activated sludge captured by PCM, greyscale distinction is not clear owing to the illumination or sensor nonuniformity of PCM. The water stain on the slide causes artifacts of halos and the shade-off of PCM images and many white spots inside microbial aggregates. It is difficult to achieve high performance for the traditional segmentation method based on thresholds or edge detection in a complex view of PCM images. Compared with a traditional image segmentation algorithm, image segmentation algorithms based on deep learning have made significant progress, which can solve many problems that cannot be solved by traditional image segmentation methods. <sup>(15)</sup> Shelhamer _et al._ adopted contemporary classification convolutional networks into fully convolutional networks (FCNs) and transfer their learned representations to the segmentation task. <sup>(16)</sup> The U-Net deep learning network is a potential tool that can be used to further improve the loss of detailed image information caused by the multiple down-sampling operations of the image in the network. <sup>(17)</sup> The U-Net model network structure is easily trained and is suitable for a small sample. In our work, an automated segmentation method for a PCM image is proposed to extract flocs and filaments using the U-Net deep learning structure with data augmentation. In order to deal with sample imbalance, we propose a loss function combining the binary cross entropy (BCE) function and Dice coefficient to improve the segmentation accuracy and sensitivity with unbalanced foreground and background samples. The rest of the paper is structured as follows. In Sect. 2, we describe our experiment and image acquisition system, as well as an image segmentation algorithm based on the U-Net deep learning model. In Sect. 3, we evaluate our proposed image segmentation method and discuss our main results. We conclude the paper with some final comments and directions for future work in Sect. 4. 2. Materials and Methods 2.1 Lab-scale activated sludge system A lab-scale activated sludge system is designed to simulate the biological wastewater treatment process, as shown in Fig. 1. The activated sludge is sampled from a petrochemical wastewater treatment plant, and microorganisms are cultured in the laboratory. The activated sludge was fed with synthetic wastewater with a chemical oxygen demand (COD) of 300 mg/L. The wastewater was prepared using a glucose solution, a phosphoric acid mixed solution, and a sulfuric acid mixed solution. The wastewater is mixed with bacterial flocs in the aeration tank where pollutants are biodegraded. The reactor is a fully mixed aeration tank where air is injected in the mixed liquor to maintain a sufficient amount of dissolved oxygen in the aeration tank. The experiment lasted for two months. In addition to the PCM of activated sludge, we measured several physical and chemical indicators such as sludge volume (SV), pH, temperature, COD, suspended solids (SS), mixed liquor suspended solids (MLSS), and SVI. 2016 _Sensors and Materials_, Vol. 31, No. 6 (2019) Fig. 1. (Color online) Lab-scale activated sludge system. 2.2 Image acquisition system All the activated sludge samples were collected from the aeration tank in the activated sludge experimental system. The microbial image acquisition system includes an inverted optical microscope (Nikon Eclipse TS100), an industrial digital camera (ToupTek ToupCam ucoms03100kpa), and a set of image acquisition software (ToupView). In this experiment, we used a phase contrast microscope equipped with a color CCD camera to capture the images of the activated sludge, as shown in Fig. 2. The output signal of the CCD is digitized, and each digital image has a size of 1024 × 768 pixels. The microscope has 10×, 20×, and 40× phase contrast objectives and a 10× eyepiece. We chose typical images with a resolution of 0.314 µm/pixel at 10× objective magnification. 2.3 Image segmentation algorithm 2.3.1 Segmentation problem description PCM images of activated sludge were acquired. When light passes through a sample with a different density (refractive index) in a phase contrast microscope, slight variations in light phase appear and are amplified to show visible changes in light amplitude. This allows the shape and internal morphology of the microorganisms to be displayed without exogenous fixing or staining, thus facilitating the observation and analysis of microbial components by the experimenter. However, the phase contrast microscope is too sensitive to the phase variation and has some imperfections in the imaging process, which causes some artifacts in the presented image such as halos, light spots, and shade off [see Fig. 3(a)]. The obtained PCM images have a low contrast among filamentous bacteria, flocs, and the background. Most of the acquired images show a unimodal phenomenon in the grey histogram [see Fig. 3(b)]. Therefore, some traditional segmentation methods based on greyscale thresholding will fail or _Sensors and Materials_, Vol. 31, No. 6 (2019) 2017 (a) (b) Fig. 2. (Color online) Image acquisition system. (a) Optical microscope with digital camera. (b) Image acquisition software. (a) (b) Fig. 3. (Color online) Phenomena in PCM. (a) Halos, light spots, and shade off in the image. (b) Greyscale distribution of the image presenting a single peak. not be sufficiently good for segmenting filamentous bacteria and flocs from the background. Fuzzy boundaries of filamentous bacteria or flocs may cause unsatisfactory results with some traditional segmentation methods. At present, some researchers have attempted to solve the 2018 _Sensors and Materials_, Vol. 31, No. 6 (2019) segmentation problems of PCM images. <sup>(18,19)</sup> However, these methods usually require that some parameters be manually set to achieve the automatic segmentation of image processing. 2.3.2 Image segmentation method An automatic segmentation method of PCM images was proposed to extract flocs and filaments using the U-Net model, as shown in Fig. 4. The proposed method consists of image acquisition, U-Net model training, and the online testing of the image segmentation of flocs and filamentous bacteria. The image acquisition system aims to capture an activated sludge image through PCM from activated sludge experiments. Datasets including input images and labels of flocs and filaments are divided into training, validation, and testing data. To improve the robustness of the networks, data augmentation is performed by elastically deforming the training samples using random cutting, rotation, and flipping methods. To reduce the training time, the parameters of the floc image segmentation model are initially determined using filament segmentation model parameters. The networks were trained with the Adam stochastic gradient descent optimization method with a new loss function. The loss function is defined by the sum of the weighted binary cross-entropy function and Dice coefficient, which guarantees the smoothness of the gradient descent and improves the segmentation accuracy and sensitivity with unbalanced foreground and background class pixels. In the online testing, the new input result was fed to the trained U-Net models to predict objectively the probability that each pixel belongs to filaments and flocs. Then, the segmentation result is obtained by the fusion of filament and floc probabilities. Fig. 4. (Color online) Flow diagram of image segmentation of flocs and filaments. _Sensors and Materials_, Vol. 31, No. 6 (2019) 2019 2.3.3 U-Net model for image segmentation The architecture of the U-Net model for the PCM image segmentation of activated sludge is illustrated in Fig. 5. The U-Net architecture consists of a contracting path (left side) for feature encoding and an expanding decoding path (right side) for full-resolution segmentation. In the encoding path, input images of size (384, 512, 1) are gradually encoded into smaller feature maps after being processed by four down-sampling modules. Each module includes two 3 × 3 padded convolution layers and a 2 × 2 max pooling layer. In the decoding path, four up-sampling modules are used to gradually restore abstract feature maps to a full-resolution image. Each up-sampling module includes two 3 × 3 padded convolution layers and a 2 × 2 upconvolution layer with stride 2. He-normal is used to initialize each convolution layer. <sup>(20)</sup> A rectified linear unit (ReLU) is used as the activation function. Skip connections are established between the down-sampling and up-sampling modules to capture both the local and contextual information, which ensures that the details of the target image can be gradually restored. <sup>(21)</sup> The last layer includes a 1 × 1 convolution and a sigmoid activation function. The sigmoid function is defined as Fig. 5. (Color online) U-Net architecture for segmentation of flocs or filaments. 2020 _Sensors and Materials_, Vol. 31, No. 6 (2019) <u>1</u> ( _x_ ) = <u>1</u> _S_ ( _x_ ) = 1 + _e_ <sup><u>−</u></sup> _<u>x</u>_ , (1) = 1 + _e_ <sup><u>−</u></sup> + where _x_ is an input pixel value and _S_ ( _x_ ) is a probability map indicating that the pixel is a floc or filament object. An appropriate loss function in a complex scenario is critical to guaranteeing the performance of the deep learning model. The BCE function is commonly used as a loss function for binary classifiers, i.e., _N_ ( _X_ ) = −∑ _mi_ log _S_ ( _xi_ ) + (1 - _mi_ )log(1 - _S_ ( _xi_ )) _i_ = 1 = −∑ _mi_ log _S_ ( _xi_ ) + (1 - _mi_ )log(1 - _S_ ( _xi_ )), (2) _i_ = 1 _Loss_ ( _X_ ) = −∑ _mi_ log _S_ ( _xi_ ) + (1 - _mi_ )log(1 - _S_ ( _xi_ _i_ = 1 where _X =_ { _x_ 1, _x_ 2, ..., _xN_ } is an input image, _N = W × H_ is the total number of pixels, the segmentation mask _M_ = { _m_ 1, _m_ 2, ..., _mN_ }, and each _mi_ ∈ {0,1}. However, the BCE function does not take into account the imbalance between the foreground and background pixels, resulting in classification results that are biased towards the class with more pixels. There is an imbalance in our segmentation task, where flocs or filaments occupy only a smaller portion in the microscopy image. To publish the misclassified pixels, we define a new loss function by combining a weighted binary cross-entropy function and the Dice coefficient, _N_ ### [β⋅ mi log S ( xi ) + (1 − β ) ⋅ (1 − mi )log(1 − S ( xi )) ] β⋅ _mi_ log _S_ ( _xi_ ) + (1 - β ) # ∑[β⋅ mi log S ( xi ) + (1 − β ) ⋅ (1 − mi )log(1 − S ( xi )) ] _i_ = 1 (3) ### [β⋅ mi log S ( xi ) + (1 − β ) ⋅ (1 − mi )log(1 − S ( xi )) 1 _Loss_ = −∑[β⋅ _mi_ log _S_ ( _xi_ ) + (1 - β ) ⋅ (1 - _mi_ )log(1 - _S_ ( _xi_ _i_ = 1 = −∑[β⋅ _mi_ log _S_ ( _xi_ ) + (1 - β ) ⋅ (1 - _mi_ )log(1 _i_ = 1 ### log ( Dice ( T, P ) ), ### ( Dice ( T, P ) ) _Dice_ ( _T_, _P_ where _β_ is the weight ratio of the foreground to the total number of pixels to balance the class frequencies, _T_ is the real manual segmentation map and each _mi_ ∈ _T_, _P_ is the predicted segmentation map and each _S_ ( _xi_ ) ∈ _P_, and the Dice coefficient is defined as _N_ ## 2 ∑ m Si ( xi ) ( _T_, _P_ ) = <u>2 T</u> <u>∩</u> <u>P</u> = _<u>i</u>_ <u>=</u> <u>1</u> <u>T + P</u> _<u>N</u>_ _<u>N</u>_ ## ∑ mi + ∑ S ( xi ) ## 2 ∑ m Si ( xi _Dice_ ( _T_, _P_ ) = <u>2 T</u> <u>∩</u> <u>P</u> = _<u>i</u>_ <u>=</u> <u>1</u> _<u>N</u>_ _<u>N</u>_ ## 2 ∑ m Si ( xi _<u>i</u>_ <u>=</u> <u>1</u> _<u>N</u>_ _<u>N</u>_ ## ∑ <u>=</u> <u>1</u> = <u>∩</u> ## ∑ mi + ∑ ## mi + ∑ S ( xi . (4) + ## ∑ mi + ∑ S ( xi _i_ = 1 _i_ = 1 1 _i_ = 1 = 1 _i_ = The loss function can improve the test performance of the U-Net model under the class imbalanced condition using the weighted binary cross-entropy function and Dice coefficient. The activated sludge image is segmented by _F_ ( _X_ ) = argmax _Pi_ ( _X_ ) , (5) _i_ ∈ {0,1,2} where _X_ is a test image, _P_ 1( _X_ ) is the output probability map of the U-Net model for _Sensors and Materials_, Vol. 31, No. 6 (2019) 2021 segmentation flocs, _P_ 2( _X_ ) is the output of the U-Net model for segmentation filaments, and _P_ 0( _X_ ) = 1 − _P_ 1( _X_ ) − _P_ 2( _X_ ) is the probability map of the background in this image. The segmentation result is the fusion of the outputs of dual U-Net models. 2.3.4 Performance assessment As defined, earlier metrics are calculated for testing the images suggested here and in similar places to evaluate the proposed image segmentation method. The formulas used are _<u>TP</u>_ <u>+</u> _<u>TN</u>_ _Accuracy_ =, (6) _TP_ + _TN_ + _FP_ + _FN_ _<u>TP</u>_ _Precision_ =, (7) _TP_ + _FP_ _<u>TP</u>_ _Recall_ =, (8) _TP_ + _FN_ <u>2</u> <u>×</u> _<u>Precision</u>_ <u>×</u> _<u>Recall</u>_ _F_ - _measure_ =, (9) _Precision_ + _Recall_ _<u>TP</u>_ _IoU_ =, (10) _TP_ + _FP_ + _FN_ where true positive (TP) is the number of pixels whereby the positive class is correctly identified by the U-Net, false positive (FP) is the number of pixels whereby the positive class is incorrectly detected, true negative (TN) is the number of pixels whereby the negative class is correctly categorized, and false negative (FN) is the number of pixels whereby the negative class is incorrectly categorized. In the semantic segmentation task, the above indicators have different physical meanings. <sup>(22)</sup> F-measure is the harmonic mean of precision and recall, which has the same calculation formula as the previously mentioned Dice coefficient. Intersection-over-union (IoU) is the intersection and union ratio of the two sets of ground truth and predicted segmentation. The higher the IoU, the closer the predicted segmentation is to the ground truth. 3. Results and Discussion 3.1 Dataset For validating the presented method, several representative images are collected in the labscale activated sludge process. The collected digital image has a size of 1024 × 768 × 3 pixels. PCM images are labeled as floc mask and filament mask, as shown in Fig. 6. 2022 _Sensors and Materials_, Vol. 31, No. 6 (2019) (a) (b) (c) (d) Fig. 6. (Color online) Original image and annotation: (a) original image, (b) ground truth, (c) filament mask, and (d) floc mask. Figure 6(a) shows the original microbial image and Fig. 6(b) shows the ground truth of the flocs and filamentous bacteria manually labelled with the LabelMe Software Tool. <sup>(23)</sup> The flocs are in red, and the filamentous bacteria are in green. The flocs and filaments are greyed out and scaled to 512 × 384 greyscale image in Figs. 6(c) and 6(d), respectively. A total of 69 typical images and their mask labels are selected to form the sample dataset. The dataset is randomly divided into 52 for training, 7 for validation, and 10 for testing. Testing datasets are used to evaluate the accuracy of the activated sludge image segmentation based on the improved U-Net deep learning network. 3.2 Environment configurations In this work, we used Keras based on TensorFlow as the deep learning framework. Keras is a high-level neural network with a focus on enabling fast experimentation. All the tests were conducted in a 2.30 GHz 6-core Intel <sup>®</sup> Xeon <sup>®</sup> CPU E5 with 13 GB of RAM and NVIDIA Tesla K80 GPU with 12 GB memory with an Ubuntu 18.04 operating system. All program codes run in a python environment. _Sensors and Materials_, Vol. 31, No. 6 (2019) 2023 3.3 Training of U-Net model The U-Net models of the floc and filamentous image segmentations were trained in sequence. The U-Net model of the floc segmentation was first trained, whose parameters were used as the initial values of the filamentous bacterial U-Net model. During model training, both the maxima of epochs and steps per epoch are set to 200. For each epoch, 52 training images and labels were augmented with 400 training data by randomly cutting, rotating, and flipping. This image augmentation included a random combination of rotation_range (0.2), width_shift_ range (0.05), height_shift_range (0.05), shear_range (0.05), zoom_range (0.05), and horizontal_ flip using the _ImageDataGenerator_ function implemented in Keras. We set the training batch size to 2, the validation batch size to 10, and the number of validation steps to 5. To reduce the risk of overfitting, we use a storing optimal model parameter strategy. Specifically, the weight parameters of the model are saved in HDF5 format by determining whether the validation loss is the new smallest value at the end of each training epoch. Figure 7 shows the U-Net model training of the floc and filament image segmentations. In Figs. 7(a) and 7(b), the left diagram shows the combined loss function and the average IoU score value of the training data. The right diagram is the combined loss function and the average IoU score value of the validation data. As shown in Fig. 7, the convergence rate of the filamentous bacterial U-Net model is higher than that of the floc U-Net model. (a) (b) Fig. 7. (Color online) U-Net model training of floc and filament image segmentations. (a) Training of the U-Net model for microbial floc segmentation. (b) Training of the U-Net model for filamentous bacterial segmentation. 2024 _Sensors and Materials_, Vol. 31, No. 6 (2019) 3.4 Experimental results and analysis We evaluate the U-Net models with the combined loss function and compare it with U-Nets with BCE, FCN-VGG16, and a traditional segmentation method. The segmentation results of the testing image are shown in Fig. 8. In Fig. 8, (a) is the original image, (b) is the ground truth obtained by manual labelling, and (c), (d), (e), and (f) are the segmentation results of U-Nets with BCE, U-Nets with the combined loss, the model FCN-VGG16, and the traditional segmentation method, respectively. The fully (a) (b) (c) (d) (e) (f) Fig. 8. (Color online) Results of PCM image segmentation using the test dataset: (a) original image, (b) ground truth, (c) U-Net (BCE), (d) U-Net (combined), (e) FCN-VGG16, and (f) traditional method. _Sensors and Materials_, Vol. 31, No. 6 (2019) 2025 Table 1 <u>Segmentation performance characteristics of four methods for filamentous bacteria and focs.l</u> <u>Model</u> <u>Objective</u> <u>Accuracy</u> <u>Precision</u> <u>Recall</u> <u>F-measure</u> <u>IoU</u> U-Nets with BCE U-Nets with the combined loss FCN-VGG16 Traditional method <u>Background</u> <u>0.9758</u> <u>0.9919</u> <u>0.9805</u> <u>0.9861</u> <u>0.9617</u> Floc 0.9759 0.7915 0.9218 0.8451 0.8661 Filamentous 0.9888 0.7435 0.6643 0.67508 0.5255 <u>Mean</u> <u>0.9824</u> <u>0.7675</u> <u>0.7930</u> <u>0.7604</u> <u>0.6958</u> <u>Background</u> <u>0.9777</u> <u>0.9880</u> <u>0.9864</u> <u>0.9872</u> <u>0.9733</u> Floc 0.9812 0.8703 0.8951 0.8780 0.8163 Filamentous 0.9912 0.7592 0.8016 0.7725 0.6772 <u>Mean</u> <u>0.9862</u> <u>0.8147</u> <u>0.8484</u> <u>0.8252</u> <u>0.7467</u> <u>Background</u> <u>0.9666</u> <u>0.9811</u> <u>0.9809</u> <u>0.9809</u> <u>0.9626</u> Floc 0.9756 0.8385 0.8606 0.8459 0.7369 Filamentous 0.9848 0.7015 0.5841 0.5918 0.4380 <u>Mean</u> <u>0.9802</u> <u>0.7700</u> <u>0.7223</u> <u>0.7189</u> <u>0.5875</u> <u>Background</u> <u>0.9122</u> <u>0.9562</u> <u>0.9440</u> <u>0.9496</u> <u>0.8947</u> Floc 0.9117 0.5172 0.5645 0.5144 0.4132 Filamentous 0.9725 0.3990 0.4082 0.3814 0.2810 <u>Mean</u> <u>0.9421</u> <u>0.4581</u> <u>0.4864</u> <u>0.4479</u> <u>0.3471</u> convolutional neural model FCN-VGG16 uses VGG16 as the backbone of the model and uses parameters pretrained on the imagenet dataset. For the traditional image segment of filaments and flocs, we have applied the combination of Gaussian filtering, Otsu thresholding algorithm, Hole filling, and morphological operations. The DSeg segmentation program <sup>(24)</sup> is used for segmenting filaments, and the PHASECONG MATLAB Code <sup>(25)</sup> for removing halos. Note that our improved U-Net models can correctly segment the objects on 10 test images with halos, light spots, and shade off. Our trained models are also not affected by the red ruler on the image. Table 1 gives the segmentation performance characteristics of four methods. The mean in Table 1 is the average of the corresponding indicator of segmentation for flocs and filamentous bacteria, except for the background for 10 test images. From Table 1, it is easy to observe that our proposed U-Net models with the combined loss function have obvious advantages in terms of model accuracy, precision, recall, F-measure, and IoU. The improved loss function helps improve the PCM image segmentation performance. The filamentous bacteria in our captured images have fewer pixels, which causes the positive and negative class imbalance of the training samples. Our improved loss function combines the BCE and Dice coefficient, which ensures the smoothness of gradient descent and enhances the image segmentation performance. 4. Conclusions In general, the key to measuring the SVI and early detection of filamentous bulking based on digital image analysis lies in the image segmentation performance of flocs and filaments for the activated sludge wastewater treatment process. We proposed an automatic floc and filament extraction method for PCM images using the U-Net deep learning model with data augmentation. A loss function combining the BCE function and Dice coefficient is proposed to improve the segmentation accuracy and sensitivity with unbalanced foreground and background 2026 _Sensors and Materials_, Vol. 31, No. 6 (2019) class pixels. Our method achieved a mean IoU of 74.67%, a mean F-measure of 0.82, and a mean precision of 81.47 % for two types of objects (i.e., floc and filament) on the test set. The visualization also shows the performance of our model. It is worth noting that the PCM image from the AS process may be contaminated with phase shifts and light scattering interferences. Thus, ensemble image segmentation techniques combining images at a different magnification should be considered to enhance the image segmentation performance. In addition, because manual labelling is time-consuming, semisupervised image segmentation algorithms should be explored in the future. Acknowledgments This work was supported in part by the National Key R&D Program of China under Grant 2018YFB1700200, in part by the Liaoning Natural Science Foundation under Grant 201602599 and Scientific Research Projects from the Department of Education of Liaoning Province under Grant LQ2017006. References 1 M. B. Khan, H. Nisar, C. A. Ng, P. K. Lo, and V. V. Yap: Environ. Technol. 39 [(2018) 24. https://www.](https://www.tandfonline.com/doi/full/10.1080/09593330.2017.1293166) [tandfonline.com/doi/full/10.1080/09593330.2017.1293166](https://www.tandfonline.com/doi/full/10.1080/09593330.2017.1293166) 2 D. H. Eikelboom: Process Control of Activated Sludge Plants by Microscopic Investigation (IWA Publishing, London, 2000). 3 J. J. Ganczarczyk: Water Sci. Technol. 30 [(1994) 87. https://doi.org/10.2166/wst.1994.0388](https://doi.org/10.2166/wst.1994.0388) 4 K. Grijspeerdt and W. Verstraete: Water Res. 31 [(1997) 1126. https://doi.org/10.1016/S0043-1354(96)00350-8](https://doi.org/10.1016/S0043-1354%0x2896%0x2900350-8) 5 C. Cenens, R. Jenne, and J. F. Van Impe: Water Sci. Technol. 45 [(2002) 85. https://doi.org/10.2166/](https://doi.org/10.2166/wst.2002.0558) [wst.2002.0558](https://doi.org/10.2166/wst.2002.0558) 6 M. Da Motta, M. N. Pons, N. Roche, and H. Vivier: Biochem. Eng. J. 9 [(2001) 165. https://doi.org/10.1016/](https://doi.org/10.1016/S1369-703X%0x2801%0x2900138-3) [S1369-703X(01)00138-3](https://doi.org/10.1016/S1369-703X%0x2801%0x2900138-3) 7 H. Boztoprak, Y. Ozbay, D. Guclu, and M. Kucukhemek: Desalin. Water Treat. 57 [(2016) 17195. https://doi.org](http://dx.doi.org/10.1080/19443994.2015.1085909) [/10.1080/19443994.2015.1085909](http://dx.doi.org/10.1080/19443994.2015.1085909) 8 J. C. Costa, D. P. Mesquita, A. L. Amaral, M. M. Alves, and E. C. Ferreira: Environ. Sci. Pollut. Res. 20 (2013) [5887. https://doi.org/10.1007/s11356-013-1824-5](https://doi.org/10.1007/s11356-013-1824-5) 9 D. P. Mesquita, A. L. Amaral, and E. C. Ferreira: Anal. Chim. Acta 802 [(2013) 14. https://doi.org/10.1016/](https://doi.org/) j.aca.2013.09.016 10 D. H. Li and J. Ganczarczyk: Environ. Sci. Technol. 23 [(1989) 1385. https://doi.org/10.1021/es00069a009](https://doi.org/10.1021/es00069a009) 11 M. B. Khan, H. Nisar, C. A. Ng, K. H. Yeap, and K. C. Lai: Microsc. Microanal. 23 [(2017) 1130. https://doi.](http://dx.doi.org/10.1017/s1431927617012673) [org/10.1017/s1431927617012673](http://dx.doi.org/10.1017/s1431927617012673) 12 H. Nisar, H. Y. Hang, S. C. Siang, and M. B. Khan: Proc. 2016 IEEE Conf. Systems, Process and Control (IEEE, [2016) 102. https://doi.org/10.1109/SPC.2016.7920712](https://doi.org/10.1109/SPC.2016.7920712) 13 M. B. Khan, H. Nisar, and C. A. Ng: IEEE Access 6 [(2018) 1778 https://doi.org/10.1109/ACCESS.2017.2780249](https://doi.org/10.1109/ACCESS.2017.2780249) 14 R. Jenné, E. N. Banadda, I. Smets, J. Deurinck, and J. Van Impe: Microsc. Microanal. 13 [(2007) 36. https://doi.](https://doi.org/10.1017/s1431927607070092) [org/10.1017/s1431927607070092](https://doi.org/10.1017/s1431927607070092) 15 A. Garcia-Garcia, S. Orts-Escolano, S. Oprea, V. Villena-Martinez, P. Martinez-Gonzalez, and J. Garcia Rodriguez: Appl. Soft. Comput. 70 [(2018) 41. https://doi.org/10.1016/j.asoc.2018.05.018](http://dx.doi.org/10.1016/j.asoc.2018.05.018) 16 E. Shelhamer, J. Long, and T. Darrell: IEEE Trans. Pattern Anal. Mach. Intell. 39 [(2017) 640. https://doi.](http://dx.doi.org/10.1109/tpami.2016.2572683) [org/10.1109/tpami.2016.2572683](http://dx.doi.org/10.1109/tpami.2016.2572683) 17 O. Ronneberger, P. Fischer, and T. Brox: Proc. Medical Image Computing and Computer-Assisted Intervention, [Pt Iii (MICCAI, 2015) 234. https://doi.org/10.1007/978-3-319-24574-4_28](https://doi.org/10.1007/978-3-319-24574-4_28) 18 Z. Z. Yin, T. Kanade, and M. Chen: Med. Image Anal. 16 [(2012) 1047. https://doi.org/10.1016/j.media.2011.12.006](https://doi.org/10.1016/j.media.2011.12.006) 19 N. Jaccard, L. D. Griffin, A. Keser, R. J. Macown, A. Super, F. S. Veraitch, and N. Szita: Biotechnol. Bioeng. 111 [(2014) 504. https://doi.org/10.1002/bit.25115](https://doi.org/10.1002/bit.25115) _Sensors and Materials_, Vol. 31, No. 6 (2019) 2027 [20 K. He, X. Zhang, S. Ren, and J. Sun: Proc. 2015 IEEE Int. Conf. Computer Vision (IEEE, 2015) 1026. https://](https://doi.org/10.1109/iccv.2015.123) [doi.org/10.1109/iccv.2015.123](https://doi.org/10.1109/iccv.2015.123) 21 M. Drozdzal, E. Vorontsov, G. Chartrand, S. Kadoury, and C. Pal: Proc. Deep Learning and Data Labeling for [Medical Applications (DLMIA & LABELS, 2016) 179. https://doi.org/10.1007/978-3-319-46976-8_19](https://doi.org/10.1007/978-3-319-46976-8_19) [22 C. Goutte and E. Gaussier: 27th Eur. Conf. Information Retrieval Research (ECIR, 2005) 345. https://doi.](https://doi.org/10.1007/978-3-540-31865-1_25) [org/10.1007/978-3-540-31865-1_25](https://doi.org/10.1007/978-3-540-31865-1_25) 23 [https://github.com/wkentaro/labelme](https://github.com/wkentaro/labelme) [24 H. Zhang, N. Söderholm, L. Sandblad, K. Wiklund, and M. Andersson: Microsc. Microanal. (2019) 1. https://](https://doi.org/10.1017/S1431927619000308) [doi.org/10.1017/S1431927619000308](https://doi.org/10.1017/S1431927619000308) 25 [https://www.cs.rochester.edu/~brown/Videre/001/articles/Kovesi/](https://www.cs.rochester.edu/~brown/Videre/001/articles/Kovesi/) About the Authors Li-Jie Zhao received her B.S. and M.S. degrees from the College of Information Engineering at Shenyang University of Chemical Technology, China, in 1996 and 1999, respectively, and her Ph.D. degree from the Research Center of Automation at Northeastern University, China, in 2006. From 2004 to 2014, she was an associate professor at Shenyang University of Chemical Technology, China. Since 2014, she has been a professor at Shenyang University of Chemical Technology. Her research interests are in intelligent information processing, wastewater treatment, and process modelling. (zhaolijie@syuct.edu.cn) Shi-Da Zou received his B.S. degree in Economics from Northeastern University, China, in 2014. He is currently pursuing his M.S. degree in the College of Information Engineering at Shenyang University of Chemical Technology, China. His research interests are in deep learning and image processing. (a19715@163.com) Yu-Hong Zhang (corresponding author) received her B.S. degree in environmental sciences from Liaoning University, China, in 2001, her M.S. degree in marine biology from Harbin Institute of Technology, China, in 2005, and Ph.D. degree marine biology from the Chinese Academy of Sciences, China, in 2008. From 2009 to 2011, she was a postdoctoral student at Dalian University of Technology and Liaoning Institute of Environmental Sciences, China. From 2011 to 2014, she was a senior engineer at Liaoning North Environmental Protection Limited Company, China. Since 2014, she has been an associate professor at Shenyang University of Chemical Technology. Her research interests are in wastewater treatment, solid waste treatment, and microbiology. (zhangyhhit@163.com) 2028 _Sensors and Materials_, Vol. 31, No. 6 (2019) Ming-Zhong Huang received his B.S. and M.S. degrees in control theory and control engineering from Shenyang University of Chemical Technology, China, in 1998 and 2005, respectively. Since 2013, he has been an associate professor at Shenyang University of Chemical Technology. His research interests are in intelligent information processing, complex system control and optimization techniques, and computer-aided process engineering. (syhmz75111@syuct.edu.cn) Yue Zuo received her B.S. degree in automation from Shenyang University of Science and Technology, China in 2018. She is studying for her M.S. degree in control engineering at Shenyang University of Chemical Technology, China. Her research interests are in deep learning and image processing. Jia Wang received her B.S. degree in Internet of Things engineering from Shenyang University of Chemical Technology China in 2018. She is studying for her M.S. degree in signal and information processing at Shenyang University of Chemical Technology, China. Her research interests are in signal and information system and image processing. Xing-Kui Lu received his B.S. degree in electronic information engineering from Shenyang University of Chemical Technology, China, in 2017. He is studying for his M.S. degree in control engineering at Shenyang University of Chemical Technology, China. His research interests are in image processing and deep learning. Zhi-Hao Wu received his bachelor’s degree in engineering from the Henan Polytechnic University of Wanfang Insitute in 2017. He is studying for a master’s degree at Shenyang University of Chemical Technology. His research interests include deep learning and image processing, as well as intelligent information processing. Xiang-Yu Liu is currently pursuing her B.S. degree in environmental science and engineering at Shenyang University of Chemical Technology, China. She will be a master's degree student in September 2019. Her research interest is environmental microbiology.

섹션 본문 40문단 · 22,017자

(제목 없음)

1For the activated sludge wastewater treatment process, the image segmentation of flocs and filaments has become a crucial component in the successful implementation of a sludge volume index (SVI) sensor and the early fault detection of filamentous bulking.The segmentation of a phase contrast microscopy (PCM) image is a challenging problem because of the weak greyscale distinction between flocs and filaments, as well as the artifacts of halos and shadows.In this work, we proposed an automatic floc and filament segmentation method for PCM images using a U-Net deep learning structure with data augmentation.A loss function combining the binary cross entropy (BCE) function and Dice coefficient is proposed to improve the segmentation accuracy and sensitivity with unbalanced foreground and background samples.The performance of the segmentation algorithm is evaluated by the accuracy, precision, recall, F-measure, and intersection-over-union (IoU) metrics.Lab-scale experiments on the activated sludge process have been carried out to verify the proposed image segmentation method.Our proposed U-Net models with the combined loss function give better results than the U-Net models with BCE, fully convolutional network-VGG16 (FCN-VGG16), and a traditional segmentation method.

Introduction

2The activated sludge process is a general and typical biological wastewater treatment process.Biodegradation occurs in aeration tanks where microorganisms form activated sludge flocs.The settling ability of activated sludge, which directly determines the quality of the wastewater effluent, is critical for the operation of wastewater treatment plants, Therefore, the key to the operation of a sewage treatment plant is to have sufficient activated sludge with good settling ability.

3Conventionally, the settling ability of the activated sludge treatment plants is monitored by measuring physicochemical parameters such as the sludge volume index (SVI).However, regular measurements are costly, tedious, and time-consuming, and have associated environmental hazards. (1)The morphological characteristics and internal structure of flocs and filaments are closely related to the settling ability of activated sludge.The morphological change of the activated sludge is used for the early detection and identification of abnormal operation conditions, such as sludge bulking and pin flocs.Activated sludge microscopic examination is required for process control and stable plant operation. (2)However, the accuracy and reliability of manual image analysis largely depend on the operator's prior knowledge.

4(5)(6) By extracting the morphological information of flocs and filaments from microscopic images, physical and chemical parameters such as SVI can be effectively measured, and the abnormal operation of a sewage treatment plant can be detected early. (7)ince the collected samples do not require special preparation and filamentous bacteria can be observed at a relatively low magnification, phase contrast microscopy (PCM) is commonly used to observe activated sludge.Over the last two decades, the processing and analyses of PCM images of activated sludge have received considerable attention and widely applied to the measurement of SVI and the early detection and fault diagnosis of sludge bulking in wastewater treatment plants. (8,9)Grijspeerdt and Verstraete investigated the relevance of the morphology of activated sludge flocs and the settling ability of the sludge, and performed image analysis to estimate the settling ability of activated sludge. (4)Khan et al. reported a robust segmentation of PCM images of filamentous bacteria, the identification of image analysis parameters for the morphology of the bacteria, and the measurement of SVI. (1)The processing and analyses of microscopy images have proven to be a potential alternative monitoring tool in the early warning and prediction of the settling ability. (10)mage segmentation is a key step in image analysis and the basis for further understanding the microbial structure.The accuracy of image analysis depends on the quality of the segmentation of microbial aggregates and filaments in microscopy images of activated sludge.Several traditional image segmentation algorithms, including edge detection, clustering, texture-based segmentation, watershed algorithm, and some combinations of algorithms, have been reported for activated sludge images.Khan et al. applied nine different approaches to segment PCM images of activated sludge (AS) samples and assessed their effectiveness in a comparative experiment. (11)The experiments have shown that these traditional algorithms have the risks of oversegmentation, undersegmentation, and failure, and are not always applicable to all PCM images.Nisar et al. found that flocs are oversegmented using the Otsu thresholding algorithm.Furthermore, they investigated three image segmentation algorithms for PCM images. (12)Khan et al. proposed a robust segmentation procedure for flocs and filamentous bacteria, and investigated regression models for SVI on the basis of the extracted morphological characteristic parameters of filaments and flocs. (13)Jenné et al. developed an automatic image analysis system for monitoring the floc and filament features of activated sludge. (14)owever, these methods usually require some parameters be manually set to achieve automatic segmentation.

5Currently, traditional image segmentation methods are based on the assumption of sharp grey contrasts between flocs and filaments.In a microbial image of activated sludge captured by PCM, greyscale distinction is not clear owing to the illumination or sensor nonuniformity of PCM.The water stain on the slide causes artifacts of halos and the shade-off of PCM images and many white spots inside microbial aggregates.It is difficult to achieve high performance for the traditional segmentation method based on thresholds or edge detection in a complex view of PCM images.

6Compared with a traditional image segmentation algorithm, image segmentation algorithms based on deep learning have made significant progress, which can solve many problems that cannot be solved by traditional image segmentation methods. (15)Shelhamer et al. adopted contemporary classification convolutional networks into fully convolutional networks (FCNs) and transfer their learned representations to the segmentation task. (16)The U-Net deep learning network is a potential tool that can be used to further improve the loss of detailed image information caused by the multiple down-sampling operations of the image in the network. (17)he U-Net model network structure is easily trained and is suitable for a small sample.

7In our work, an automated segmentation method for a PCM image is proposed to extract flocs and filaments using the U-Net deep learning structure with data augmentation.In order to deal with sample imbalance, we propose a loss function combining the binary cross entropy (BCE) function and Dice coefficient to improve the segmentation accuracy and sensitivity with unbalanced foreground and background samples.

8The rest of the paper is structured as follows.In Sect.2, we describe our experiment and image acquisition system, as well as an image segmentation algorithm based on the U-Net deep learning model.In Sect.3, we evaluate our proposed image segmentation method and discuss our main results.We conclude the paper with some final comments and directions for future work in Sect. 4.

Lab-scale activated sludge system

9A lab-scale activated sludge system is designed to simulate the biological wastewater treatment process, as shown in Fig. 1.The activated sludge is sampled from a petrochemical wastewater treatment plant, and microorganisms are cultured in the laboratory.The activated sludge was fed with synthetic wastewater with a chemical oxygen demand (COD) of 300 mg/L.The wastewater was prepared using a glucose solution, a phosphoric acid mixed solution, and a sulfuric acid mixed solution.The wastewater is mixed with bacterial flocs in the aeration tank where pollutants are biodegraded.The reactor is a fully mixed aeration tank where air is injected in the mixed liquor to maintain a sufficient amount of dissolved oxygen in the aeration tank.The experiment lasted for two months.In addition to the PCM of activated sludge, we measured several physical and chemical indicators such as sludge volume (SV), pH, temperature, COD, suspended solids (SS), mixed liquor suspended solids (MLSS), and SVI.

Image acquisition system

10All the activated sludge samples were collected from the aeration tank in the activated sludge experimental system.The microbial image acquisition system includes an inverted optical microscope (Nikon Eclipse TS100), an industrial digital camera (ToupTek ToupCam ucoms03100kpa), and a set of image acquisition software (ToupView).In this experiment, we used a phase contrast microscope equipped with a color CCD camera to capture the images of the activated sludge, as shown in Fig. 2. The output signal of the CCD is digitized, and each digital image has a size of 1024 × 768 pixels.The microscope has 10×, 20×, and 40× phase contrast objectives and a 10× eyepiece.We chose typical images with a resolution of 0.314 µm/pixel at 10× objective magnification.

Segmentation problem description

11PCM images of activated sludge were acquired.When light passes through a sample with a different density (refractive index) in a phase contrast microscope, slight variations in light phase appear and are amplified to show visible changes in light amplitude.This allows the shape and internal morphology of the microorganisms to be displayed without exogenous fixing or staining, thus facilitating the observation and analysis of microbial components by the experimenter.However, the phase contrast microscope is too sensitive to the phase variation and has some imperfections in the imaging process, which causes some artifacts in the presented image such as halos, light spots, and shade off [see Fig. 3(a)].The obtained PCM images have a low contrast among filamentous bacteria, flocs, and the background.Most of the acquired images show a unimodal phenomenon in the grey histogram [see Fig. 3(b)].Therefore, some traditional segmentation methods based on greyscale thresholding will fail or not be sufficiently good for segmenting filamentous bacteria and flocs from the background.Fuzzy boundaries of filamentous bacteria or flocs may cause unsatisfactory results with some traditional segmentation methods.At present, some researchers have attempted to solve the segmentation problems of PCM images. (18,19)However, these methods usually require that some parameters be manually set to achieve the automatic segmentation of image processing.

Image segmentation method

12An automatic segmentation method of PCM images was proposed to extract flocs and filaments using the U-Net model, as shown in Fig.In the online testing, the new input result was fed to the trained U-Net models to predict objectively the probability that each pixel belongs to filaments and flocs.Then, the segmentation result is obtained by the fusion of filament and floc probabilities.

U-Net model for image segmentation

13The architecture of the U-Net model for the PCM image segmentation of activated sludge is illustrated in Fig. 5.The U-Net architecture consists of a contracting path (left side) for feature encoding and an expanding decoding path (right side) for full-resolution segmentation.

14In the encoding path, input images of size (384, 512, 1) are gradually encoded into smaller feature maps after being processed by four down-sampling modules.Each module includes two 3 × 3 padded convolution layers and a 2 × 2 max pooling layer.In the decoding path, four up-sampling modules are used to gradually restore abstract feature maps to a full-resolution image.Each up-sampling module includes two 3 × 3 padded convolution layers and a 2 × 2 upconvolution layer with stride 2. He-normal is used to initialize each convolution layer. (20)A rectified linear unit (ReLU) is used as the activation function.Skip connections are established between the down-sampling and up-sampling modules to capture both the local and contextual information, which ensures that the details of the target image can be gradually restored. (21)he last layer includes a 1 × 1 convolution and a sigmoid activation function.The sigmoid function is defined as

15where x is an input pixel value and S(x) is a probability map indicating that the pixel is a floc or filament object.An appropriate loss function in a complex scenario is critical to guaranteeing the performance of the deep learning model.The BCE function is commonly used as a loss function for binary classifiers, i.e., 1 ( ) log ( ) ( 1) log(1 ( ))

16where X = {x 1 , x 2 , ..., x N } is an input image, N = W × H is the total number of pixels, the segmentation mask M = {m 1 , m 2 , ..., m N }, and each {0,1} i m ∈ .However, the BCE function does not take into account the imbalance between the foreground and background pixels, resulting in classification results that are biased towards the class with more pixels.There is an imbalance in our segmentation task, where flocs or filaments occupy only a smaller portion in the microscopy image.To publish the misclassified pixels, we define a new loss function by combining a weighted binary cross-entropy function and the Dice coefficient, [ ] ( )

17Dice T P

18where β is the weight ratio of the foreground to the total number of pixels to balance the class frequencies, T is the real manual segmentation map and each i m T ∈ , P is the predicted segmentation map and each ( ) i S x P ∈ , and the Dice coefficient is defined as

19The loss function can improve the test performance of the U-Net model under the class imbalanced condition using the weighted binary cross-entropy function and Dice coefficient.The activated sludge image is segmented by

20where X is a test image, P 1 (X ) is the output probability map of the U-Net model for segmentation flocs, P 2 (X) is the output of the U-Net model for segmentation filaments, and P 0 (X) = 1 − P 1 (X) − P 2 (X) is the probability map of the background in this image.The segmentation result is the fusion of the outputs of dual U-Net models.

Performance assessment

21As defined, earlier metrics are calculated for testing the images suggested here and in similar places to evaluate the proposed image segmentation method.The formulas used are TP TN Accuracy TP TN FP FN

22where true positive (TP) is the number of pixels whereby the positive class is correctly identified by the U-Net, false positive (FP) is the number of pixels whereby the positive class is incorrectly detected, true negative (TN) is the number of pixels whereby the negative class is correctly categorized, and false negative (FN) is the number of pixels whereby the negative class is incorrectly categorized.

23In the semantic segmentation task, the above indicators have different physical meanings. (22)-measure is the harmonic mean of precision and recall, which has the same calculation formula as the previously mentioned Dice coefficient.Intersection-over-union (IoU) is the intersection and union ratio of the two sets of ground truth and predicted segmentation.The higher the IoU, the closer the predicted segmentation is to the ground truth.

Dataset

24For validating the presented method, several representative images are collected in the labscale activated sludge process.The collected digital image has a size of 1024 × 768 × 3 pixels.PCM images are labeled as floc mask and filament mask, as shown in Fig. 6.

Environment configurations

25In this work, we used Keras based on TensorFlow as the deep learning framework.Keras is a high-level neural network with a focus on enabling fast experimentation.All the tests were conducted in a 2.30 GHz 6-core Intel ® Xeon ® CPU E5 with 13 GB of RAM and NVIDIA Tesla K80 GPU with 12 GB memory with an Ubuntu 18.04 operating system.All program codes run in a python environment.

Experimental results and analysis

26We evaluate the U-Net models with the combined loss function and compare it with U-Nets with BCE, FCN-VGG16, and a traditional segmentation method.The segmentation results of the testing image are shown in Fig. 8.

27In convolutional neural model FCN-VGG16 uses VGG16 as the backbone of the model and uses parameters pretrained on the imagenet dataset.For the traditional image segment of filaments and flocs, we have applied the combination of Gaussian filtering, Otsu thresholding algorithm, Hole filling, and morphological operations.The DSeg segmentation program (24) is used for segmenting filaments, and the PHASECONG MATLAB Code (25) for removing halos.Note that our improved U-Net models can correctly segment the objects on 10 test images with halos, light spots, and shade off.Our trained models are also not affected by the red ruler on the image.Table 1 gives the segmentation performance characteristics of four methods.The mean in Table 1 is the average of the corresponding indicator of segmentation for flocs and filamentous bacteria, except for the background for 10 test images.From Table 1, it is easy to observe that our proposed U-Net models with the combined loss function have obvious advantages in terms of model accuracy, precision, recall, F-measure, and IoU.The improved loss function helps improve the PCM image segmentation performance.The filamentous bacteria in our captured images have fewer pixels, which causes the positive and negative class imbalance of the training samples.Our improved loss function combines the BCE and Dice coefficient, which ensures the smoothness of gradient descent and enhances the image segmentation performance.

Conclusions

28In general, the key to measuring the SVI and early detection of filamentous bulking based on digital image analysis lies in the image segmentation performance of flocs and filaments for the activated sludge wastewater treatment process.We proposed an automatic floc and filament extraction method for PCM images using the U-Net deep learning model with data augmentation.A loss function combining the BCE function and Dice coefficient is proposed to improve the segmentation accuracy and sensitivity with unbalanced foreground and background class pixels.Our method achieved a mean IoU of 74.67%, a mean F-measure of 0.82, and a mean precision of 81.47 % for two types of objects (i.e., floc and filament) on the test set.The visualization also shows the performance of our model.It is worth noting that the PCM image from the AS process may be contaminated with phase shifts and light scattering interferences.Thus, ensemble image segmentation techniques combining images at a different magnification should be considered to enhance the image segmentation performance.In addition, because manual labelling is time-consuming, semisupervised image segmentation algorithms should be explored in the future.

Fig. 1 .

29Fig. 1. (Color online) Lab-scale activated sludge system.

Fig. 2 .

30Fig. 2. (Color online) Image acquisition system.(a) Optical microscope with digital camera.(b) Image acquisition software.

Fig. 3 .

31Fig. 3. (Color online) Phenomena in PCM.(a) Halos, light spots, and shade off in the image.(b) Greyscale distribution of the image presenting a single peak.

4 .

32The proposed method consists of image acquisition, U-Net model training, and the online testing of the image segmentation of flocs and filamentous bacteria.The image acquisition system aims to capture an activated sludge image through PCM from activated sludge experiments.Datasets including input images and labels of flocs and filaments are divided into training, validation, and testing data.To improve the robustness of the networks, data augmentation is performed by elastically deforming the training samples using random cutting, rotation, and flipping methods.To reduce the training time, the parameters of the floc image segmentation model are initially determined using filament segmentation model parameters.The networks were trained with the Adam stochastic gradient descent optimization method with a new loss function.The loss function is defined by the sum of the weighted binary cross-entropy function and Dice coefficient, which guarantees the smoothness of the gradient descent and improves the segmentation accuracy and sensitivity with unbalanced foreground and background class pixels.

Fig. 4 .

33Fig. 4. (Color online) Flow diagram of image segmentation of flocs and filaments.

Fig. 5 .

34Fig. 5. (Color online) U-Net architecture for segmentation of flocs or filaments.

Figure 6 (

35Figure 6(a) shows the original microbial image and Fig. 6(b) shows the ground truth of the flocs and filamentous bacteria manually labelled with the LabelMe Software Tool. (23)The flocs are in red, and the filamentous bacteria are in green.The flocs and filaments are greyed out and scaled to 512 × 384 greyscale image in Figs.6(c) and 6(d), respectively.A total of 69 typical images and their mask labels are selected to form the sample dataset.The dataset is randomly divided into 52 for training, 7 for validation, and 10 for testing.Testing datasets are used to evaluate the accuracy of the activated sludge image segmentation based on the improved U-Net deep learning network.

Fig. 6 . 3 . 3

36Fig. 6. (Color online) Original image and annotation: (a) original image, (b) ground truth, (c) filament mask, and (d) floc mask.

Figure 7

37shows the U-Net model training of the floc and filament image segmentations.In Figs.7(a) and 7(b), the left diagram shows the combined loss function and the average IoU score value of the training data.The right diagram is the combined loss function and the average IoU score value of the validation data.As shown in Fig. 7, the convergence rate of the filamentous bacterial U-Net model is higher than that of the floc U-Net model.

Fig. 7 .

38Fig. 7. (Color online) U-Net model training of floc and filament image segmentations.(a) Training of the U-Net model for microbial floc segmentation.(b) Training of the U-Net model for filamentous bacterial segmentation.

Fig. 8 ,

39Fig. 8. (Color online) Results of PCM image segmentation using the test dataset: (a) original image, (b) ground truth, (c) U-Net (BCE), (d) U-Net (combined), (e) FCN-VGG16, and (f) traditional method.

Table 1

40Segmentation performance characteristics of four methods for filamentous bacteria and flocs.

참고문헌 23건

  1. A Probabilistic Interpretation of Precision, Recall and F-Score, with Implication for Evaluation Lecture notes in computer science · Springer Science+Business Media · 2005 10.1007/978-3-540-31865-1_25
  2. Delving Deep into Rectifiers: Surpassing Human-Level Performance on ImageNet Classification 2015 10.1109/iccv.2015.123
  3. U-Net: Convolutional Networks for Biomedical Image Segmentation Lecture notes in computer science · Springer Science+Business Media · 2015 10.1007/978-3-319-24574-4_28
  4. Fractal geometry of particle aggregates generated in water and wastewater treatment processes Environmental Science & Technology · American Chemical Society · 1989 10.1021/es00069a009
  5. Image analysis to estimate the settleability and concentration of activated sludge Water Research · Elsevier BV · 1997 10.1016/s0043-1354(96)00350-8
  6. Characterisation of activated sludge by automated image analysis Biochemical Engineering Journal · Elsevier BV · 2001 10.1016/s1369-703x(01)00138-3
  7. Quantitative image analysis for the characterization of microbial aggregates in biological wastewater treatment: a review Environmental Science and Pollution Research · Springer Science+Business Media · 2013 10.1007/s11356-013-1824-5
  8. Detection of Filamentous Bulking Problems: Developing an Image Analysis System for Sludge Composition Monitoring Microscopy and Microanalysis · Oxford University Press · 2007 10.1017/s1431927607070092
  9. Automated method for the rapid and precise estimation of adherent cell culture characteristics from phase contrast microscopy images Biotechnology and Bioengineering · Wiley · 2013 10.1002/bit.25115
  10. Understanding the phase contrast optics to restore artifact-free microscopy images for segmentation Medical Image Analysis · Elsevier BV · 2012 10.1016/j.media.2011.12.006
  11. Activated sludge characterization through microscopy: A review on quantitative image analysis and chemometric techniques Analytica Chimica Acta · Elsevier BV · 2013 10.1016/j.aca.2013.09.016
  12. Prediction of sludge volume index bulking using image analysis and neural network at a full-scale activated sludge plant Desalination and Water Treatment · Taylor & Francis · 2015 10.1080/19443994.2015.1085909
  13. Microbial aggregates in wastewater treatment Water Science & Technology · Pergamon Press · 1994 10.2166/wst.1994.0388
  14. Fully Convolutional Networks for Semantic Segmentation IEEE Transactions on Pattern Analysis and Machine Intelligence · IEEE Computer Society · 2016 10.1109/tpami.2016.2572683
  15. The Importance of Skip Connections in Biomedical Image Segmentation Lecture notes in computer science · Springer Science+Business Media · 2016 10.1007/978-3-319-46976-8_19
  16. Generalized classification modeling of activated sludge process based on microscopic image analysis Environmental Technology · Taylor & Francis · 2017 10.1080/09593330.2017.1293166
  17. Image segmentation of microscopic wastewater images using phase contrast microscopy 2016 10.1109/spc.2016.7920712
  18. Segmentation Approach Towards Phase-Contrast Microscopic Images of Activated Sludge to Monitor the Wastewater Treatment Microscopy and Microanalysis · Oxford University Press · 2017 10.1017/s1431927617012673
  19. Image Processing and Analysis of Phase-Contrast Microscopic Images of Activated Sludge to Monitor the Wastewater Treatment Plants IEEE Access · Institute of Electrical and Electronics Engineers · 2017 10.1109/access.2017.2780249
  20. A survey on deep learning techniques for image and video semantic segmentation Applied Soft Computing · Elsevier BV · 2018 10.1016/j.asoc.2018.05.018
  21. Process Control of Activated Sludge Plants by Microscopic Investigation IWA Publishing eBooks · UWA Publishing · 2000
  22. DSeg: A Dynamic Image Segmentation Program to Extract Backbone Patterns for Filamentous Bacteria and Hyphae Structures Microscopy and Microanalysis · Oxford University Press · 2019 10.1017/s1431927619000308
  23. Evaluation of different shape parameters to distinguish between flocs and filaments in activated sludge images Water Science & Technology · Pergamon Press · 2002 10.2166/wst.2002.0558