Automatic Determination of Seeds for Random Walker by Seeded Watershed Transform for Tuna Image Segmentation

Tuna fish image classification is an important part to sort out the type and quality of the tuna based upon the shape. The image of tuna should have good segmentation results before entering the classification stage. It has uneven lighting and complex texture resulting in inappropriate segmentation. This research proposed method of automatic determination seeded random walker in the watershed region for tuna image segmentation. Random walker is a noise-resistant segmentation method that requires two types of seeds defined by the user, the seed pixels for background and seed pixels for the object. We evaluated the proposed method on 30 images of tuna using relative foreground area error (RAE), misclassification error (ME), and modified Hausdroff distances (MHD) evaluation methods with values of 4.38%, 1.34% and 1.11%, respectively. This suggests that the seeded random walker method is more effective than exiting methods for tuna image segmentation.


Introduction
The process of sorting the tuna is done manually and requires the help of experts, while the number of fish to be sorted is very much. This is will be a consequence of the length of the sorting and the impact on the freshness of the tuna to be processed. To maintain freshness of tuna fish needed tuna classification process quickly and automatically, so the quality of tuna fish production increase [1].
The classification is done after the form object from the image of tuna has been processed. The fish object is derived from a segmentation process that separates the object against the background. Good segmentation will result in an object's shape similar to the original. Random walker is one of the image segmentation methods that are resistant to noise. In general, the random walker is used for image segmentation interactively by user scribble. The user scribble is used manually specify about seeds in which pixels indicate the background and seeds in which pixels indicate the object area. The user's manual determination has the possibility of misleading between the object and the background.
In addition, the use of user scribble on the large fish images will take a long time to process. Massive repetition of the large data is ineffective and impractical in the field. Automatic seeding is required in the segmentation of tuna images.
There are several studies on the determination of the automatic seed for the segmentation process as Fadllullah's proposed method [2]. This method uses gradient barrier watershed based on hierarchal cluster analysis and regional credibility merging (HAC-RCM) for optimization of adaptive threshold determination with the aim of reducing oversegmentation by watershed region. This method combines objects based on two merging criteria. However, in the normalization stage of the image, this method is not optimal in reducing the rough texture of the background area so that the segmentation results are inaccurate. Another method is proposed by Saputra, [3,4]. This method uses the automation of seeded region growing throughout the watershed region. The image of the tuna is transformed within the HSI color space, and only the hue color space is processed to the watershed transform. The determination of the region is obtained based on the highest density region. The threshold parameter is obtained by the difference between the averages of the region's intensity to the average of the region's neighboring intensity. Determination of seed parameters in seeded region growing does not concern to image enhancement and noise removal features so that there is a chance that the selected seed is noise. Seeds located on the noise can produce false segmentation.
Random walker has many advantages including weak boundary detection, noise robustness, and fast computation [5] and has many related and important methods based on it [6][7] [8]. In this method, the user should give labels to a small number of pixels about the background and object. Then start a random walker at each unlabeled pixel and calculate the probabilities. These probabilities will determine the probability of each unlabeled pixel belonging to a label. By assigning each pixel to a label with the greatest probability, the interactive image segmentation result can be obtained. This method has shown to perform well on different types of images but is strongly influenced by the placement of the labels within the image. Because of that, we used a random walker for noise removal and weak boundary detection that it can increase the accuracy of tuna image segmentation.
Furthermore, the random walker is a noise-resistant segmentation method that requires two types of seeds defined by the user, the seed pixels for background and seed pixels for the object. In the reality about sorting of tuna fish, there is inefficient for labeling each tuna image by user scribbles while the number of fish to be sorted is very much. We need the determination of the seeds to be automatic so that segmentation with a random walker can be fast and does not require user scribbling. This research proposed method of automatic determination seeded random walker in the watershed region for tuna image segmentation. Seeds on the label for the object and background pixels that generated by watershed can be a substantial resource for a random walker to segmenting image of tuna.
Data in this research is obtained from PT. Aneka Tuna Indonesia with total 30 jpg images. The dimension of each image is 2889 × 1625 pixels with yellow bucket's background.
Groundtruth is obtained by manually process using Adobe Photo-shop's software. Groundtruth consist of two com-ponents that are white as an object and black as the background.

Methods
The proposed method is an automatic determination of seed for random walker using region watershed transform for tuna image segmentation. The Figure 1 shown about step by step in our proposed method. The first step, an input image of tuna is transformed into HSI color space and removing noise on hue color space. Then hue image is processed through a watershed transform to generate seeds. The seeds are the pixel position that represents part of an object and part of the background. Seeds that generated by watershed than become an input labels of object and background pixel for a random walker to segmenting image of tuna.

HSI and Noise Removal
There are three processes at this stage, image optimization, HSI transformation of RGB color space, and noise removal. Image optimization is to improve image quality. In this process, we perform the image resizing into 10% of the original image, contrast enhancement, image sharpening, and Gaussian filtering. The RGB image as an optimization result is transformed into an HSI (Hue, Saturation, Intensity) color space and only the hue color spaces are used. The process can be formulated by: from the Equation (1), H is hue value, and θ formulated by the equation: then noise removing process on the image at hue color space with the following equation: Noise removal is used for removing pixels in which indicated as noise. It's can improve hue color space shape and increase the segmentation result.
The Figure 2 shown that image of a1, b1, and c1 are original images of tuna. Image of a2, b2, and c2 are images on hue color space without noise removal. Image of a3, b3, and c3 are images on hue color space with noise removal.

Watershed Transform
There are two steps at this stage such as determination of seeds for foreground (object) and background [6,7]. The first step is a determination of seed for foreground on the image using following equation: ), ), where ( ) value on matrix will compare with ( ) value on matrix , if ( ) greater than ( ), then calculate gradient value ( ) at one-pixel point with all the pixel points on the image. ( ) calculates based on different value ( ) with ( ) and divided by the distance between pixels. Number of pixel steps at matrix ( , ) calculated based on ( ) with ( , ). The highest ( ) value will be processed by determining temporary gradient value and otherwise, it will be ignored.
Temporary gradient value ( , ) count considered highest ( ) that is multiplied with ( , ) on each pixel. The optimal topographic value ( , ) is taking minimum value ( , ).
( , ) will be processed for determination optimum total number of region that used as seed of object. Determination optimum number of region considered value of peak point in histogram from hue image '. Then, smoothing process on his- (11) Next step calculates the total number of pixel frequency on peak point divided by a total number of peak point .
Value of becomes the optimum region to be taken for the seed of object and then the determinate region will be selected. Afterward, we calculated the size of each region and sorting it descending. Regions selected will be taken the value of its centroid into seeds of foreground (SF).
The second step is determination seeds of background. Value of seeds obtained by calculates the distance of the pixel from H' with Euclidean Distance and watershed transform. The result of its calculation will be taken in pixels with gray value equals to zero and selected as seed for background (SB). Determination of seed considered by dividing line between background area and object area to avoid background markers to be too close to the edges of the object.
In Figure 3, images of a1, b1, and c1 are the result of watershed transform for the foreground that the centroid on each region will be used as seeds label for an object on random walker process.
While, the image on a2, b2, and c2 are result from watershed transform for the background that value on each pixel (red marker) will be used as seeds label for the background. The image of a3, b3, and c3 are merger image from watershed for foreground and background.
The input seeds for a random walker to segmenting image of tuna can get by define SB as seeds for background label and SF as seeds for object label.

Random Walker
Dirichlet is used to obtain the probability values of random walks [5,8,9]. The Dirichlet integral [ ] using following equation: where as a field and as region from the image. Harmonic function is a function that fulfill Laplace's formula 2 = 0. We mean a Component combination matrix of Laplacian where elemen each point and Can be an equation as and are incident node 0, else.

, (14)
We determine the size of the matrix an × matrix of edge-point incidence where elements for vertex and edge respectively can be an equation as Matrix serve as a composite operator of gradient and matrix ⊤ like composite differences. An isotropic composite Laplacian is obtained from = ⊤ . determination of × constitutive matrix become the diagonal matrix with weights of every edge and every the diagonal. A constitutive matrix should be determined like describe a matrix, in this experience that it describes a parameter weight the inner product from vector space of equation determines each edge point. In this experience, the composite Generalizations of Laplacian to the composite Laplace-Beltrami operator via = ⊤ . The composite formula from formula Integral Dirichlet can be an equation as when we divided the point become two sets, describing the prelabeled point seed and describing the unseeded point, then ∪ = and ∩ = ∅. We can be an equation(16) as: where and the probability is appropriate for the seeded and unseeded pixels. For every unseeded pixel, where the probability of random walker , started at will achieve each the ℎ seeded pixel, ∈ , and the total number of seed obtained from system. For every seed pixel distinguish [ ] with merge to and finding critical points as a result Equation(20) describes that the system from the linear formula with | | is not defined. The solution is obtained by combination from problem of Dirichlet for the label then can be found by equ- . The probabilities at any point will become to unity, i.e.
where systems of sparse linear − 1 must be solved, where the number of seed described as .

Results and Analysis
We do an experiment by comparing between the proposed method and exiting method, seeded region growing in the watershed region (Fadllullah et al., 2015). The experiment does in specification OS windows 10, 8 GB RAM, and Intel processor core i3. Figure 4 shows segmentation process on tuna image where the image of a1, b1, and c1 are input images. Image of a2, b2, and c2 are images output images from the existing method Watershed Region Growing. Image of a3, b3, and c3 are the image result from proposed method. Image of a4, b4, and c4 are groundtruth images created manually using Adobe Photoshop software. Figure 4 shows that our proposed method results better than Watershed Region Growing that has noise around the object. Evaluation of segmentation result using seeded Random Walker is calculated by ME (Misclassification Error), RAE (Relative Area Foreground Error), and MHD (Modified Hausdorff Distance) with the following equation: where 0 and 0 is background and foreground of the groundtruth image. and is background and foreground of image segmentation result.
where 0 is the area from the input image, is an area of segmentation result. where 0 and is pixel area on the input image and a pixel area on image segmentation result.
Based on Table 1, this research concluded that proposed method has accuracy and runtime more effective than the existing method. Random walker method can robust to noise and reduce the time consuming in the segmentation of tuna. Preprocessing on the first stage can produce a better performance of segmentation using contrast enhancement, image sharpening, and Gaussian filtering. In our experiment, a parameter of in Dirichlet problem formula determinate manually. We need to optimize the value to getting the optimum of segmentation result by a seeded random walker.

Conclusion
Segmentation of tuna image can use seeded random walker method with its parameters determined. Determination of seed automatically on the random walker is obtained in region watershed by establishing total optimum region will be used. Performance of tuna segmentation using seeded random walker is evaluated by Misclassification error (ME), Relative area foreground error (RAE), and Modified Hausdorff Distance (MHD) with average value sequentially 1,407, 4,075, and 0,100. The average value of time execution for each image is 0,957 second. Average value of evaluation method is lower than segmentation using seeded region growing. It shows that the proposed method has better performance and effectiveness than the existing method. TABEL