Counting Bacterial Colony and Reducing Noise on Low-Quality Image Using Modified Perona-Malik Diffusion Filter with Sobel Mask Fractional Order

— In the field of microbiology, the counting of bacterial colonies is fundamental and mandatory. This is done to estimate the number of bacterial cells in every 1 milliliter or gram of sample. The counting takes a long time and is tedious, so it requires an accurate and fast counting method. The image quality used is very low and contains noise. Therefore, a preprocessing method is needed to reduce the noise. The Perona-Malik filter method is known to be able to remove noise well. However, it is difficult to determine the appropriate gradient threshold parameter ( 𝒌 ) for each different image. To find the appropriate value of 𝒌 , the original Sobel Mask method and Sobel Mask Fractional-Order are used to estimate the value of 𝒌 . The experimental results show the results of noise reduction using PMD with a value of 𝒌 from the original Sobel Mask and Sobel Mask Fractional-Order. The results of the accuracy of determining the value of k with the Sobel Mask Fractional-Order (α=1.0) show higher results based on the F-Measure values for samples 1, 2, and 3 respectively 97%, 98%, and 90%.


INTRODUCTION
Microbiology is a science with a wide scope of study. Microbiology studies bacteria, viruses, fungi, and etc. Some of the problems faced by humans can be solved using microbiology [1]. For example, the bacterial colonies counting in medicine can be used to estimate the level of infection experienced by a patient [2]. The studies about counting bacterial colony had been done before where counting bacterial colony consumes times and a tedious task [2], [3], [4], [5]. Bacterial colony counting is carried out by creating a growth chart to estimate the number of cells. In Escherichia Coli bacteria, under ideal conditions, the number of cells can reach a million cells from one parent cell in 7 hours [6]. This causes that the counting of bacterial colonies takes a long time and is tedious.
Based on these problems, it is necessary to build a method for counting bacterial colonies automatically, accurately, and precisely. Therefore, image processing can be used to count bacterial colonies. In this study, the image used is an image that was taken from a cellphone camera. The quality of the image is low and contains noise so that noise reduction is required without losing image feature [7]. The noise reduction used is a Perona-Malik Diffusion (PMD) filter that has been combined with a fractional-order Sobel Mask. The Fractional-order Sobel Mask on the PMD filter is used to find the correct gradient threshold ( ) parameter value for each different image. The value obtained from the determination of the threshold gradient using a Fractional-order Sobel mask is better than the original Sobel mask. This is because the Sobel mask uses the first derivative while the Fractional-order Sobel mask uses fractional derivatives.
Except for reducing noise, a Top-Hat Transformation method is needed which can correct the illumination effect caused by non-uniform lighting [8] and can extract features from an image which is lighter than the background [9]. Based on this, images with poor contrast can be overcome by using the Top-Hat Transformation method. Other methods [10] used in counting bacterial colonies are Otsu's method to carry out binarization and several methods in image morphology [11] [12] for the extraction and bacterial colonies counting. Based on this, the paper aims to propose automatic counting bacterial colony at a lower cost and more accurate and propose new method to

II. PROPOSED METHOD
Counting bacterial colonies use several combined methods. In general, the steps of the proposed method are petri dish extraction, preprocessing, bacterial colonies extraction, and counting bacterial colonies.

A. Input Image
Taking pictures of bacterial colonies using a mobile phone with a 13-megapixel camera resolution. Apart from cell phones, the tool used in image sampling is a mini studio shown in Fig.  1. An example of an image used is a JPG extension, with a resolution of 300 dpi. The number of samples obtained is 3 pieces. This is because the inoculation process is difficult. This difficulty is due to the possibility of contamination between bacteria in the laboratory [13]. The sample used in this study is a bacterial colony of acetic acid. The sample is shown in Fig. 2. The bacterial colonies were inoculated on colored and non-transparent growth media. In addition, the bacterial colony produces a clear zone. The extraction, preprocessing, and other processes shown in this article use sample in Fig. 2b.

B. Petri Dish Extraction
Petri dish extraction is carried out to separate the original background from the Petri dishes. This will make it easier in the process of preprocessing and extraction of bacterial colonies later. The steps in this process are converting the image sample into a grayscale image shown in Fig. 3a. Fig. 3a convert into a binary image that shown in Fig. 3b. After Binarization, in Fig.  3b, there are unwanted objects. Based on this, we are applying Erosion operators. The result is shown in Fig. 4a, where there is a hole that is caused by Erosion operators. To solve this problem, we are applying Region Filling operator, where the result is shown in Fig. 4b. Fig. 4b called mask is used to extract the Petri dish object. The result in Fig. 4c shows only Petri dish object without background from Mini Studio.

C. Preprocessing
There are 3 processes in this stage, that is the process of changing the background color, the process of correcting the illumination effect, and the process of reducing noise.

Background-Color Change
Changing the color of the background is done by homogenizing the color of the Petri dishes and the background. This is done in order that the gradient value is lower because the intensity of the difference in color between the object and the background is very small. Background changes are made by replacing a pixel with a value of 0 (black) with the average value of an object that is not 0 in the image (Fig. 4c). Suppose the image is × in size, then (1) used to replace the background is as follows: where ( , ) are the pixels in the image , is a Petri dish image without a black background ( ( , ) ≠ 0) and is the number of pixels in the Petri dish image. The result is shown in Fig. 5.

Correction of Illumination Effect
The result of the color change (Fig. 5) has a non-uniform contrast because the color of the bacterial colonies is more contrast than the background color. This is caused by the presence of a clear zone in the bacterial colonies. In this case, a top-hat transformation can be used to correct the illumination effect [8]. The result is shown in Fig. 6 and still contain noise. To show noise in the result, the image color changes using the colormap function as shown in Fig. 7.

Noise Reduction
Noise reduction is performed using the modified Perona-Malik Diffusion (PMD) Filter method to determine the value (gradient threshold parameter) automatically. The idea of this equation is to modify the heat equation by adding a diffusion coefficient where this equation depends on the magnitude of the image gradient [14], [15].
Noise reduction is the application of the diffusion process by spreading the intensity of a high-frequency pixel to neighboring pixels. Perona and Malik made an innovation by introducing the diffusion coefficient based on the scale-space approach (2) proposed by Koenderink on the solution of the following diffusion equation [16] as follows: Based on (2), the diffusion equation asummed as follows: where is the image in the -iteration, is the divergence operator, ( , ) is the image gradient in the -iteration, and ( , ) is a diffusion coefficient in the -iteration.
In the Perona-Malik equation, in areas with small gradient magnitudes (homogeneous areas), the diffusivity value is expected to perform stronger smoothing. In areas with large gradient magnitudes (inhomogeneity), a smaller diffusivity value is expected to slow down the diffusion process and protect fine image features [14]. The diffusion coefficient on the PMD Filer is defined as a function of the image gradient ∇ ( , ) so that the diffusion equation (3) becomes the nonlinear diffusion equation (4) which is known as the anisotropic diffusion model. The diffusion coefficient ( , ) is defined as follows: where is a diffusivity or flux function that plays a role in setting the diffusion rate, level of smoothness, blurring, sharpening, and preservation of image edges in the following equations introduced by Perona and Malik: where is a constant that controls the sensitivity of the edges of an image.
Different values cause different diffusion effects on an image. The smoothing effect is slight and image edges are maintained when the diffusion coefficient is smaller (‖∇ ‖ > ) and the smoothing effect is greater when the diffusion coefficient is larger (‖∇ ‖ < ) [17]. This causes it to be difficult to determine the suitable value for each image manually.
This lack can be overcome by using the Fractional-Order Sobel Mask method in determining the value of the threshold gradient ( ) parameter. Fractional-Order Sobel Mask in edge detection can consider more information from neighbor pixel than the original Sobel Mask [18]. Based on this, the value determined using the Fractional-Order Sobel Mask is more accurate than the value determined using the original Sobel Mask.
Searching the image gradient value using the original Sobel Mask pays attention to the neighbor pixels so that this method is efficient in detecting image edges. There are two masks that identify the edges of an image, namely masks from the vertical and horizontal directions. Suppose and is the mask of an image from the horizontal and vertical direction, the value of and from the original Sobel operator shown on Fig. 8.
The formula for finding the gradient in the horizontal and vertical direction is as follows: The calculation of the value magnitude gradient from the two mask directions uses the following formula [19]: In addition to formula above, an approximate approach to the magnitude gradient implemented in practice [20] is as follows: The fractional-order Sobel Mask is a modification of the original Sobel Mask, where the determination of the horizontal and vertical direction gradient values in (6) is modified using a derivative of the fractional-order. In discrete images, Δ and Δ are considered as the number of pixels between two-pixel points. Suppose Δ = Δ = 2, then the differential form of the gradient component can be written as follows: The Grunwald-Letnikov approach is used in its application to fractional-order derivatives [21]. Assume the size of an image is × , then the discrete form of ∇ can be written as follows: where ≥ 3 are integer constants, and . The differential form of (9) is obtained from the generalization of the orders from integers to fractional numbers.
Therefore, the components of the fractional-order gradient along the and directions are obtained using the (11) approximation. For the gradient direction using the approximation (Δ 1 ) , and the gradient direction using (Δ 2 ) , , as follows: Based on (13) and (14), the new and direction gradient components are obtained, as follows: In this study, the value used is 100. The value is obtained from the experimental results with the consideration that the maximum value of the image gradient components used is hundreds. In this case, if is hundreds, then in the diffusion process, the edges of the image object cannot be maintained. Using the Fractional-order Sobel Mask to determine the value of with different values, the Perona-Malik Diffusion (PMD) Filter will produce different results. The value used is 0.  Based on Table I, the value which is determined by value on Fractional-order Sobel Mask is tested on the diffusivity function. The diffusivity function results show that the Fractional-order Sobel Mask with = 1.0 is better than another values and Original Sobel Mask because it can retain the edges of the object better. Furthermore, the value of is determined using the same value for the sample used, then compared with the resulting value based on the value of = 1.0. the values used for comparison are 3 and 5. The results of the comparison are shown in the Fig. 10. Based on the results, the value that is not suitable for the image shows that the diffusion results are not good. The diffusion results cause the number of the image object edges to be lost. Therefore, the determination of the suitable value is very influential on the image used.
By using the value, the PMD Filter is used to reduce the noise that shown in the Figure 6. The noise has been reduced and looks smoother that shown in Fig. 11. To clarify the result of the PMD Filter in Fig. 11, the color of the image is changed that shown in Fig. 12. Fig. 12 shows the results of noise reduction at the value determined using Sobel Mask Original and Fractional-order Sobel Mask. Sobel Mask Original and Fractional-order Sobel Mask ( = 0.2 and = 0.6) result in blurry image. However, the image result at the value determined by = 1.0 produces an image without noise and not blurry. This is because the value is suitable for the image used.

D. Bacterial Colonies Extraction
Bacterial colonies are extracted by the Otsu method to convert the RGB image into the binary image [10] in Fig. 11. The binarization results still contain several objects that are not bacterial colonies. The object is the dish edge that was extracted as a result of the LED light reflection from the mini-studio. The object is divided into two, namely large objects and small objects. These objects are removed by utilizing the bwarefilt and bwareaopen functions of the Labeling Connected Components operator on MATLAB [22]. The final result of bacterial colony extraction shown in Fig. 13(d) is obtained by subtracting Fig. 13(a) from Fig. 13(b) and Fig. 13(c).

E. Bacterial Colonies Counting
Bacterial colonies counting uses the BWLabel function on MATLAB. The result of the image labeling of extracted bacterial colonies is shown in Fig. 14. The labeling shows the number of all objects in an image. The same one is done for each image sample. The counting results are shown in affect the counting results of image samples. Table II which contains the bacterial colonies counting manually and the bacterial counting using the proposed method of the determined value using either the Original Sobel Mask or the fractional-order Sobel Mask. The output image produced by the proposed method is a binary image. This image contains information on the number of extracted bacterial colonies. The results of the method used are different depending on the k value of the PMD Filter. The output image is shown in Figure   A.

Accuracy of Counting
The manually counting is carried out by a microbiologist. These countings are shown in Table II. The counting accuracy is required in this study to determine the results of the proposed method compared to manual counting. Bacterial colonies counting performed manually is used as the basis for counting the accuracy of the proposed method. The proposed method accuracy is calculated using an accuracy measure known as the F-measure [23], [24], [25]. F-measure is a combination of precision and recall. F-measure informs the total accuracy of precision and recall. Precision is the accuracy of the extracted object and recall is the completeness of the extracted object. Precision and recall are formulated as shown in (16).
is precission, is recall, is the actual number of bacterial colonies, is total extracted bacterial colonies, and is all extracted object (both bacterial colonies and non-bacterial colonies). , and are true positive, false positive, and false negative, respectively.
is the extracted object that is actually a bacterial colony, is the object that is not actually a bacterial colony, but is detected as a bacterial colony, and is the object that is actually a bacterial colony, but detected as a non-bacterial colony. In this study, is marked in red and is marked in yellow as shown in Fig. 15. In this study, bacterial colonies that are counted as 1 colony, but actually 2 colonies (separated) are categorized as objects. In addition, a bacterial colony is counted as 2 bacterial colonies, but actually, 1 bacterial colony (combined) is categorized as an object. For accuracy, the F-Measure formula is used. Based on (16), F-Measure that is denoted by is shown in (17).
The results of the counting accuracy (F-measure) of the samples with several values depending on the method used are shown in Table III. Table III shows the highest average accuracy obtained with the value of the fractional-order Sobel Mask ( = 1.0). In sample 1, the accuracy of the value of the fractional-order Sobel Mask ( = 1.0) is the same as the accuracy of the Original Sobel Mask. In sample 2, the accuracy is almost 100% and bacterial colonies that do not overlap can be extracted well on the fractional-order Sobel Mask ( = 1.0). The same thing happened in sample 3, there was a bacterial colony that could not be extracted with a value using Sobel Mask Original. However, it can be extracted well using fractional-order Sobel Mask ( = 1.0). In this study, we give an example analysis image with marking object as shown in Fig 16. The best results are obtained in sample 2, where all bacterial colonies in the sample can be extracted. This is because the sample only has a bacterial colony in the middle of the Petri dish and almost all bacterial colonies have a large enough clear zone. In sample 2 and sample 3, there are bacterial colonies that have small clear zones (yellow markings). This caused the bacterial colonies with small clear zones cannot be extracted well when applying the Top-Hat Transformation and PMD Filter. In addition, bacterial colonies with slightly larger clear zones (green mark) are not too well extracted when applying Top-Hat and PMD Filter transformations. At the binarization process, bacterial colonies with small clear zones will disappear and bacterial colonies with slightly larger clear zones become smaller than the actual size. In other cases in sample 3, there are several bacterial colonies that grow on the Petri dish's edges. The thing that makes it difficult to extract the bacterial colony is the reflection of the LED light. Therefore, there is a bacterial colony object that blends with the object on the Petri dish's edges. Based on this, the bacterial colonies disappear when the edges of the Petri dishes are removed.

B. Computation time
The bacterial colonies counting in this study uses MATLAB R2014B software on a PC with specifications: CPU Intel Core i5-5200U, 2.2GHz, and 4GB RAM. The computation time obtained by determining the k value using either the Original Sobel Mask or the fractional-order Sobel Mask is approximately 28-35 seconds for all samples. This is because the sample size used is small, which is approximately 1 Mb.
The computation time is shown in Table IV, V, and VI, with 3 trials for each sample. Based on these data, it cannot be concluded which method is superior in terms of time. It because the time obtained is not significantly different. However, the computation time of the proposed method is faster than manual counting. Manual counting with the same number of bacterial colonies as the used sample takes approximately 60-70 seconds for each sample.

IV. CONCLUSION
In this study, bacterial colony counts were performed on low-quality images. The image contains noise due to its low quality. Based on this, it is necessary to reduce noise using a modified PMD filter. This modification is carried out by determining the value of the threshold gradient parameter ( ), where determining this value is difficult because the appropriate value for each image is different. To determine the value of automatically, the value of k is determined using the Sobel Mask Original and Sobel Mask Fractional-Order methods. The final result of the value is approximated by using the root of the sum of the gradient values in the and directions, then divided by 100. Apart from having an impact on the diffusivity function of the PMD filter, the value has an impact on the accuracy of the counting bacterial colonies. This is because in the noise reduction process, there is a possibility of blurring so that bacterial colony objects will be considered as non-colonial bacterial objects. The best accuracy is obtained by using the value of k which is determined using the Sobel Mask Fractional-Order ( = 1.0). This accuracy value is determined using the Precision, Recall, and F-Measure values.
The final results of the accuracy of samples 1, 2 and 3 based on the F-Measure values are 97%, 98% and 90% respectively.
The computation time of the 2 methods used is not very different. The time obtained is in the range of 28--35 seconds. This time is twice as fast as manually counting bacterial colonies. Based on this, the proposed method can help researchers in the field of microbiology to more quickly and accurately carry out bacterial colony counts.