Fish Image Segmentation Algorithm ( FISA ) for Improving the Performance of Image Retrieval System

The image features (local, global) pay vital role in image retrieval system. The effectiveness of these image features depends on the application domain, i.e., in some domains the global features generate better results while in others the local features give good results. Different species of fishes have different color, texture, and shape features in their body parts (head, abdomen, and tail). Previously most of the work, in fish image domain has been done using global features. This work claims that fish image retrieval system using local features can generate better results as compared to global features. This is because of the fact that fish image has different features in its body parts. In this research, a fish image segmentation algorithm is proposed to extract fish object from its background and then separate fish object into three distinguished body parts, i.e. head, abdomen, and tail. The proposed algorithm was tested on a subset of “QUT_fish_data” data set containing 369 fishes of various sizes of 30 species. The experimental results showed an accuracy of 87.5% on fish image segmentation and demonstrated the effectiveness of local features over global features. Keywords—Fish body parts segmentation; local and global features; object extraction; image retrieval system; image features


I. INTRODUCTION
There is a close similarity between the man-made machine (computer) and human being, the former segments the background for focusing on only the region of interest while the later ignores the surrounding and concentrates the target area of image under observation.This natural preprocessing step for analyzing an image actually highlights the importance of image segmentation.It is a door step for all kinds of image analysis activities [1].Due to its importance, the image segmentation gained the attention of researchers in different situations.A well segmented image plays a vital role in image classification, recognition, detection, shape and texture features extraction, image retrieval, and computer vision.Fish image is an image which contains a lot of features in its different body parts, for example head, abdomen, tail etc.In order to extract these features, the body parts (head, abdomen, and tail) of fish image need to be segmented.This task is challenging due to variation in fish image shapes, and sizes.Although the proposed approach in [2] has extracted the fish object from the given image by excluding its background as shown in Fig. 1(f), but subdivision of the extracted image has not been made by that approach.The main focus of this research work is to extract the fish object from the images containing varying size fish images and subdivide it into its body parts for extracting local features.The extracted local features will improve the performance of image retrieval system.
The proposed algorithm works as follows.The algorithm converts the given RGB image into grayscale and then to binary image.The morphological operations are then performed on the binary image for separating fish object from background.Next the length of the fish object is computed and separated it into three parts using dynamic threshold.
The rest of the paper is organized as follows.Section 2 is about literature review; Section 3 describes the proposed algorithm, in Section 4 the results of proposed algorithm are evaluated, and finally Section 5 concludes with the results and a discussion of future work.

II. LITERATURE REVIEW
In this section, the existing fish image segmentation approaches are presented.Random fish size and position, feature inconsistency, environmental variations, low quality image, segmentation failures are the challenges faced and resolved by the researchers for automatic identification and classification of fishes into their families [3].For segmenting the fish, an improved K-mean clustering algorithm was introduced in [2].The algorithm applies the morphological operation on the fish image and then acceptable peaks of gray image histogram are selected to extract the maximum gray area of the fish image.Transition region based gray scale image segmentation approach has been introduced in [4].This approach successfully extracts the simple object from textured background and vice versa.In [5], the fish image is taken in a controlled environment with constant illumination and strong contrast between image background and fish object.Moreover, the segmented image is used for shape feature extraction using chain code method.This method extracts shape features like area, circumference, height and width for fish recognition, here the system only detect the fish if the trained image and test image are of equal size otherwise the variation in shape size of same species will not be detected by the system.Image color segmentation is crucially significant for color features extraction and image recognition [6].Here color channels are segmented from the color image and color www.ijacsa.thesai.orghistograms of segmented color channels are obtained for features extraction.In [7] eight different shape and color fish features like width ratio, length ratio, area ratio, width and length ratio, boundary ratio, average red color, average green color and average blue color have been extracted.Here as preprocessing step, the image is segmented with the help of sobel edge operator and some morphological operations.In [8], image segmentation is applied depending on color texture measurement; as a result color texture of pattern of interest in fish image has been segmented.Gray Level Co-occurrence Matrix (GLCM) method is then applied on the pattern of interest fish segment to extract the color texture features.The extracted features are used for image classification and retrieval system.Segmentation of human faces into hairs, eyes, mouth is a challenging task due to variation in face position, hairs color, eyes and mouth condition [9].In many situations, the object"s shapes play very significant role as compared to intensity and texture for segmentation and recognition of an object in an image [10].In [11], the survey on different color image segmentation techniques suggests that histogram thresholding method is simple, robust and universally adopted in many situations.In [12], the survey on image segmentation techniques concludes that hybrid solution of more than one technique is the best approach for solving image segmentation.
The approaches in [4]- [8] use global features for solving problems in various domains.Our proposed algorithm is about fish image segmentation for extracting the fish image local features.These local features will assist image retrieval system in retrieving the most similar fish images for a given fish image.Further, these features can also facilitate the image classification method for classifying fish images into their respective species.Our contributions are described as follows: i) extracting and segmenting the fish object into its threeprominent parts, ii) computing the local features of the extracted parts iii) improving the performance of image retrieval system using the computed local features.

III. FISH IMAGE SEGMENTATION ALGORITHM (FISA)
This section describes the proposed fish image segmentation algorithm.The algorithm is performed in two steps.
Step 1: the morphological operations are applied on the equivalent grayscale image of the original image for removing the background.Step 2: The body parts of the fish object are separated by computing the locations of their respective parts.

A. Morphological Operations
As a preprocessing step certain morphological operations are performed on the fish image to get the binary image.
 The system reads an RGB fish image for segmentation as shown in Fig. 1(a).
 RGB fish image is then converted into grayscale image, Fig. 1(b).
 Canny edge operator is applied for finding the edges of grayscale image as shown in Fig. 1(c).
 The result of dilation operation performed on the resultant image of step iii is shown in Fig. 1(d).
 The output of filled operation applied on the Fig. Where, BImage, GImage, and SImage denote Binary Image, Grayscale Image, and Segmented Image respectively.www.ijacsa.thesai.org

1) Main Module:
The main module actually integrates the output of sub-modules and generates the results.
Main Procedure works as follows.Line 1 computes the length and width of grayscale image.Line 2 calls the submodule FISH_HEAD_START by passing it the binary image.The value returned back from the sub-module is the xcoordinate of fish length start as shown in Fig. 2(a), which is stored in variable FishLengthStart.Line 3 calls the submodule FISH_TAIL_END by passing it the binary image.The value returned back from thesub-module is the x-coordinate of fish length end as shown in Fig. 2(a), which is stored in variable FishLengthEnd.Line 4 computes the fish length from the results of line 2 and line 3. Line 5 computes the length of head part of fish image, which is 1/4 of fish length plus the length of image before the start of fish length.Line 6 computes the length of abdomen part of fish, which 2/4 of the fish length.Line 7 computes the length of tail part of fish image, which is 1/4 of fish length plus the length of image beyond the tail end of image.Line 8 calls the sub-module SEGMENTATION by passing it the grayscale image, first location of x-coordinate and HeadLength as computed at line 5.This sub-module returns the results as a segment image as shown in Fig. 2(b).Line 9 calls the sub-module SEGMENTATION by passing it the grayscale image, HeadLength which is x-coordinate value of the start of abdomen and end of abdomen which is equal to HeadLength plus AbdomenLength .This sub-module returns the results as a segment image as shown in Fig. 2(c).Line 10 calls the submodule SEGMENTATION by passing it the grayscale image, location of x-coordinate from where the tail starts and value of M, which the end location of fish image.This sub-module returns the results as a segment image as shown in Fig. 2(d).
2) Finding X-Location of Fish Head Start: This submodule receives the black and white image and returns back the value of X-location, from where the actual length of fish image starts.Pseudocode of this sub-module is shown as follows: FISH_HEAD_START ( BImage ) 1 forj 1 to BImage.lengthFISH_HEAD_START module works as follow.Line 1 is an outer loop which controls the length of binary image from first value of length to last value.Line 2 is an inner loop which controls the width of binary image.Line 3 checks the first white pixel in each vertical column of binary image from front side.If there is no white pixel in vertical column of binary image till the end of first cycle of inner loop then the outer loop increments the j value and in this way second, third and so on columns value generate until the line 3 becomes true by finding the white pixel location.Line 4 then returns back the j value of white pixel, which is considered as the fish length start in main module.
3) Finding X-Location of Fish Tail End: This sub-module receives the black and white image and returns back the value of X-location, from where the actual length of fish image ends.Pseudocode of this sub-module is shown as follows: FISH_TAIL_END ( BImage ) 1 for j BImage.lengthdownto 1 2 for i 1 to BImage.width 3 if BImage(i , j)>0 4 return j FISH_TAIL_END module works as follow.Line 1 is an outer loop which controls the length of binary image from last value of length to the first value.Line 2 is an inner loop which controls the width of binary image.Line 3 checks the first white pixel in each vertical column of binary image from back side.If there is no white pixel in vertical column of binary image then the outer loop decrements the j value and in this way second last, third last and so on columns value generate until the line 3 becomes true by finding the white pixel location.Line 4 then returns back the j value of white pixel, which is considered as the fish length end in main module.

4) Segmentation Module:
In this module head, abdomen and tail segments of the fish grayscale image are extracted as shown in Fig. 2 (b), (c) and (d).Grayscale image, X-locations of segment begin and segment end are passed to the algorithm one by one and it returns back segmented image of head, abdomen and then tail part of the given fish image, respectively.www.ijacsa.thesai.orgSEGMENTATION (GImage, SBegin, SEnd) 1 Total = Pixels = sj= 0 2 for j SBegin to SEnd Where, SBegin, and SEnd denote the Beginning and Ending value of segment on X-axis respectively, Pixels show the number of pixels in the relevant segment, sj denotes the j th value of a segment on X-axis.SEGMENTATION module works as follow.This algorithm takes the image, x-location of beginning of a segment and x-location of ending of a segment.Line 1 initializes the value of Total, Pixels and Sj variables at 0. Line 2 is an outer loop, whose initial value is the start of a segment and final value is end of segment.Line 3 increments the S j variable.Line 4 is an inner loop, whose initial value is 1 and final value is the width of grayscale image.Line 5-9 is if block, which executes for every white pixel value of binary image.Line 6 stores the grayscale value of gray image from the corresponding white pixel location of the binary image.Line 7 increments the Pixels variable value.Line 8 populates an array of grayscale values of the segment, which could be used for feature extraction; Standard deviation as feature value from this array data has extracted, while it can be used for other features as well.Similarly line 9 computes the total of grayscale value for calculating mean value of every segment if required.Line 10 returns back the segmented image in the form of head, abdomen, and tail one at a time.

IV. EXPERIMENTAL RESULTS
This section describes the tool and data set used for evaluating the results of the proposed algorithm.The global and local features of fish image extracted by proposed algorithm are also discussed.

A. Tool Used
Matlab R2011b was used for performing the different operations on the input image.The proposed segmentation algorithm was also implemented in this tool.

B. Data Set
In [13] Zong Yuan Ge, the author of "QUT_fish_data" dataset collected 3960 images of 468 different fish species.In the dataset, fishes were captured in "controlled", "out-ofwater", and "in-natural-situation".In [13] the second URL is a zip file of same data set with name "QUT_fish_data.zip" of size 1.31 GB.In present research almost all fish species were taken from this dataset for testing and evaluating the performance of proposed algorithm.Some fish images were also taken from google search for testing the proposed algorithm.

C. Performance of FISA
Table I shows the segmentation result of 30 out of 468 fish species, where first part of the fish name shows the major species while the second shows sub-species.Total 369 out of 3960 fish images were taken from selected data set containing large, medium and small length image sizes.Fish images having length400 to 500 pixel were considered as small, those having length 500 to600 pixels were medium size, while the images" length above 600 were considered as large size images.The proposed algorithm correctly segmented 323 out of 369 fishes, while the rest of 46 out 369 were segmented incorrectly.The percentage results of correctly and incorrectly segmented fish images are 87.5 % and 12.5 % respectively.The reasons behind incorrectly segmented fish images are as follows: 1) The data set contains the images of different fish species in three different environments i.e., in "controlled", "out of the water", and "in natural situation".Therefore, the images in natural situation, particularly having complex background were not segmented properly.
2) The images collected in the data set with multiple fish were also not segmented correctly, because proposed algorithm works on single fish in the image.
3) The algorithm shows correct segmentation on the fish taken in controlled environment and on the fish, which were taken with plain background in natural situation.

D. Comparison of Global and Local Features
Fig. 3 shows the six images of different fish species.These sample images depict the working of our proposed algorithm that how it segments the images and finds the global and local www.ijacsa.thesai.orgfeatures.Image numbers are given for matching the feature results given on large scale in Table II.The proposed algorithm segmented the images of Table II in similar way as shown in Fig. 3 but due to resolution constraints, a single figure cannot accommodate all images results, so that maximum results have shown in Table II.
For testing the results of the proposed segmentation algorithm and extracting the local features, standard deviation was selected as statistical feature.For the purpose, one fish from each species of selected 30 species of Table I has been taken, the same are shown in Fig. 4 in RGB form.The proposed algorithm converts the fish images shown in Fig. 4 into their grayscales, the standard deviation of these grayscale fish images and their head, abdomen and tail segments are calculated as shown in Table II.
Out of 369 fish images shown in Table I, 29 sample images were taken from selected data set to show the results of the proposed segmentation algorithm.Global and local features of different fish species were compared.Table II contains the names of fish species as given in the selected dataset.
In Table II, the effectiveness of proposed segmentation algorithm can be observed.Global (i.e., Whole Fish) features of image No (6, 8, and 14), (9, 12, and 16), (11 and 13), (20, 23, and 29), (3 and 27) and (10 and 26) are almost equal while the fish images belong to different species.On the other hand, if the local features of the head, abdomen and tail segments of those fish images are compared with the local features of segments of their corresponding fish images then major difference can be seen.These local features assist the image retrieval system for retrieving the correct fish images.The image retrieval system would retrieve wrong images for the global features.
During the study of fish structure, it has been realized that there is a lack of symmetry in the fish shapes.Therefore, it becomes difficult to decide about the end of fish face and start of fish body.Same is the case with fish tail.In this research, ratio based segmentation techniques in the form of FISA have been proposed by observing the majority of fish sizes and shapes.The results with this approach are convincing and shown in Fig. 3 and also in Table II.Some of the fishes from google search like swordfish, sawfish, ray fish, and skate fish were also tested as shown in Fig. 5.Although the algorithm worked well on those species, but heads of sword fish and sawfish were longer than the body of the fish.Thus the results were not satisfactory.Similarly in case of ray fish and skate fish the tail of fish was longer than the fish body and thus the expected results were not achieved.It was also observed that www.ijacsa.thesai.orgsome sharks keeps short tail, so during segmentation, some portion of their bodies become the part of tail.Moreover, it was also noted that algorithm does not care about the orientation of fish image.It segments either the image is oriented from left to right or vice versa as shown in Fig. 5 Image (5).In summary, the proposed algorithm cannot segment the fish images with irregular or non-symmetric shapes into their body parts, correctly.

V. CONCLUSION
In light of experimental results of the proposed algorithm, it is concluded that local features are better than global features in image segmentation and can play significant role in image retrieval system.Although segmentation is an essential and important step of image analysis activity, but no single technique can meet this basic requirement, instead the techniques vary due to variations in the images and their application domains.Exact segmentation of fishes into its subparts is a challenging task due to non-symmetrical fish body parts as some fishes have long face and small tail while others have short face and long tail.This non-symmetrical shape geometry of fishes also affects the performance of the proposed algorithm.
Furthermore, during this study, it is also observed that amalgamation and transparency of some fish body parts also cause segmentation incorrectly.Orientation detection for fish image, whether its face is up or down, left or on the right side, is another challenging task which needs attention of researchers.www.ijacsa.thesai.org

 5 ,
1(d) is shown in Fig. 1(e).Negation operation on image of Fig. 1(e) is applied and as a result image in Fig. 1(f) is obtained.B.Segmenting the Body Parts of Fish ObjectThe FISA takes output of morphological operations shown in Fig.1(e) along with original RGB image.The modules of the FISA are explained as follows: No of Pixels are added from Head End to the Left side of BImage 6 AbdomenLength = ROUND(FishLength / 2) 7 TailLength = ROUND(FishLength / 4) + (M -FishLengthEnd) //In Step 7, No of Pixels are added from Tail End to the Right side of

Fig. 1 .
Fig. 1. Results of Morphological Operations a) Actual RGB image, b) Grayscale image c) Canny edge operator on gray image, d) After dilation e) Filled image f) Segmented object.

Fig. 3 .
Fig. 3. Segmented fish image along with standard deviation as global and local features are given as titles of the images.

Fig. 4 .
Fig. 4. Twenty nine fish images of different species were taken for feature extraction.

TABLE I .
PERFORMANCE OF ALGORITHM ON LARGE, MEDIUM AND SMALL SIZE FISH IMAGES

TABLE II .
RESULT OF STANDARD DEVIATION AS A LOCAL AND GLOBAL FEATURE OF GRAYSCALE FISH IMAGES