Identification of Freshness of Marine Fish Based on Image of Hue Saturation Value and Morphology

Euthynus is one of the fish that is widely consumed for the enjoyment of the people of Indonesia or abroad, because of its very soft quality, easy to obtain, and contains a lot of essential protein amino acids that are good for the body. This research aims to identify the freshness of the fish purchased based on the eyes and fish gills. The initial process of identifying the freshness of fish uses several methods. Image input process through image object taking using a cell phone camera. The image object is used to determine the value of the RGB image object. RGB color extraction clarifies the value obtained from the image object before proceeding to the next process. Image resize is the process of cutting the image on the desired object part. Image conversion using the HSV method was used to determine the freshness of fish in the gills. The Local Binary Pattern method is used to determine the freshness of the fisheye. The next step is to refine the RGB image into Morphology. The KNN (K-Nearest Neighbor Method) method is used to group objects based on learning data closest to the object. The journal analysis results on the comparison of methods, after 45 trials for each method, found that the Hue Saturation Value method obtained the highest success by 90% and for the texture value obtained 85% success. Keywords— Hue Saturation Value (HSV), Morfologi Local Binary Pattern (LBP), K-Nearest Neighbor (K-NN).


I. INTRODUCTION
The fishery sector in Indonesia especially in North Sulawesi is a field that uses a lot of technological sophistication. However, some parts still utilize human assessment to determine the quality of fresh fish. In general, fish traded in a dead state are also often alive. The decrease in fish quality can be seen from the discoloration of fish skin, eyes, gills, and fish meat texture. These changes are caused by enzymes, chemicals, and bacteria's activity so that the fish is not worth trading, let alone consumed by humans [1].
Fish contains many nutrients that are very beneficial for the body, but the fish is sold in a ruined state is also alive. Observing the freshness of selaroides leptolepis fish is done by introducing discoloration in digital imagery using the leastsquares method. This research aims to build a management application system of images that can detect the level of selar fish freshness.
The data used are ten samples of the fish's image. They were taken every 1 hour for 15 hours, and then obtained 150 image data to processed and analyzed by a method form and displayed in the specified place, and the histogram RGB grayscale. The last process is a calculation with the least square method. In the last operation, we do an image matching test with imagery stored as training data. The conclusions result whether the image (very fresh, fresh, quite fresh, not fresh, or very not fresh), the percentage of desegregation of selar fish, and the length of time the fish die. This study used around the gill object you want to crop. This section is intended to make it easier to distinguish Foreground and Background from gill imagery. The fourth step is the Object Detection process, where this section aims to determine where the values of the upper, lower, and right-left borders for later cropping: step five cropping and Fuzzy Logic. Cropping is the process of cropping an image only on the desired image object. The Fuzzy Logic process is intended to export color characteristics for the operation of image recognition with existing samples for later determining the quality of freshness of fish. And the last or sixth step is a process with the NN (Nearest Neighbor) Method to classify objects based on learning data that is closest to the object [4].
Furthermore, research determines the freshness of fish seen from the gills. Freshness fish is an image processing technology used to determine the quality of freshness of fish seen from fish gills by using an image or image of fish gills. By changing the image or gill image to HSV color model (Hue, Saturation, Value). The second step is done Morphological process consisting of Opening and Closing. The third step is Segmentation Color and Remove Small-Object to get the binner value and remove the smallest object around the gill object you want to crop. This section is intended to make it easier to distinguish Foreground and Background from gill imagery. The fourth step is the Object Detection process, where this section aims to determine where the values of the upper, lower, and right-left borders for later cropping process: step five cropping and Fuzzy Logic. Cropping is the process of cropping an image only on the desired image object. The Fuzzy Logic process is intended to export color characteristics for the operation of image recognition with existing samples for later determining the quality of freshness of fish. And the last or sixth step is to proceed with the NN (Nearest Neighbor) Method is used to classify objects based on learning data closest to the object [5]. Identify Formalized Raw Fish Using HSV Value and Artificial Neural Network Learning Vector Quantization (LVQ) From Raw Fish Imagery. The research was conducted using HSV Imagery (Hue-Saturation-Value) and in the results obtained, the success rate for fish imagery of 42 fish imagery can recognize very well up to 50% [5].
Determine the quality of fish meat through the eyes of fish. The study uses image processing with image acquisition stages, preprocessing using contrast stretching, cropping, and scaling. At the extraction feature stage using HSV and Grayscale. Classification process using Fuzzy Logic algorithm. This study using 50 fish samples consisting of three types of fish. The classification process's result with the accuracy of the overall system in bloated fish is 93%, milkfish is 89%, and cob fish is 88%. The result of a classification of the freshness of fish meat using fish eye image based on fuzzy logic method has good results [6].
One of the superior and popular fruits is Apples. They have many varieties that can be distinguished by the color and shape. The Hue Saturation Value (HSV) and Local Binary Pattern (LBP) features were used in this study as the extraction of color and shape features in the fruit, which would later be used as a feature of the color shape of the apples to be studied. The K-Nearest Neighbor (K-NN) is one of the methods of artificial intelligence used in this study to classify the values obtained from the extraction of HSV and LBP features. The study uses 800 images, consisting of 600 trained images and 200 test images. The results of evaluation obtained from the K-Nearest Neighbor method overall show that the average precision value can be 94%, 100% for recall, and 94% for accuracy [7].
KNN method makes it easier to detect the texture of fish that is still fresh or not for consumption, and the detection results are faster. To produce efficacy using the KNN method. Researchers will develop a research method to identify sea fish's freshness based on hue-saturation value and morphology image using an application system based on previous research. This application is used to minimize the choice of sea fish that is still good for consumption and facilitate the community in the use of the application. The implementation of KNN for image processing is used to classify the size of chicken eggs with an accuracy value of 88.8% [8] and for fruit type recognition based on the Lab Colour Feature and the Co-Occurrence Texture with an accuracy value of 92% [9].
Research on Signature Image Identification using Local Binary Pattern on android-based smartphones. The system uses the Local Binary Pattern (LBP) method as its feature extraction and Manhattan Distance as its introduction. The LBP operator is a texture descriptor that uses a grayish value comparison of the neighboring pixels. The collection of training data is carried out by doing 10 times the data collection of 50 participants with the number of training data as many as 500 samples. The test was conducted 5 times per participant with an average test result of 80.8% and the highest test of 94% [10].
Food research on Food Image Classification system Using HSV Color Moment and Local Binary Pattern with Naïve Bayes Classifier. From the results of the study, the extraction of features from each image was then carried out classification using Naïve Bayes Classifier. Based on test results if only using the HSV method produces an accuracy value of 65%. Also, the results of tests conducted using the HSV method resulted in 65% accuracy and the LBP method resulted in 60% accuracy [11].
Image color segmentation with Hue saturation Value color detection to detect objects. Based on the test results from the analysis, it was concluded that user control in terms of color sample determination and color tolerance played an important role in the segmentation process. The object detection process will process the color segments generated by the segmentation process so that it can be known how many objects are detected, the area, and the center point of each object [12].
Furthermore, research on Detection of Freshness of Milkfish Based on Digital Image Processing. milkfish freshness detection system based on digital imagery, used fish head image, especially the eye area. The image of the milkfish's eye is extracted in the RGB color space by taking the red color. The color red according to the human eye is the value of channel R is higher than channel G or B. White color visible to the human eye also has a high value of channel R but appears as white because it has a high channel value of G and B as well. So that the red color value used is the difference between the color R and the color G and B in the input image. The result of the addition of milkfish imagery forms a vector of features that will later be included in the SVM. This research trial uses the imagery of android device camera acquisition results. The image resolution used is 4000 x 3000. SVM kernel used is RBF kernel with a parameter value of gamma 0.1, error 0.1, and degree of 1. The test results showed an accuracy of 98.2% [13].
Implementation of digital image processing for the detection of fish freshness using android devices, In the research of milkfish freshness detection system based on digital imagery, used fish head image, especially the eye area. The image of the milkfish's eye is extracted in the RGB color space by taking the red color. The color red according to the human eye is a higher value of channel R than channel G or B. White color visible to the human eye also has a high value of channel R but appears as white because it has a high value of channel G and B as well. So that the red color value used is the difference between the color R and the color G and B in the input image. Before entering the feature extraction, the background image of milkfish is given green color using the masking technique. The purpose of masking is to facilitate the process of extracting features. The extraction of milkfish imagery forms a feature vector that will be included in the Support Vector Machine (SVM). This research trial uses the imagery of android device camera acquisition results. The image resolution used is 4000 x 3000. SVM kernel used is RBF kernel with a parameter value of gamma 0.1, error 0.1, and degree of 1. The test results showed an accuracy of 98.2% [14].
Then the milkfish freshness detection system uses imagery, the research aims to find the best solution in checking the freshness of milkfish in small and medium enterprises. The technique of checking the freshness of milkfish so far is still determined using microbiological and chemical analysis. This technique is considered less appropriate because, in addition to requiring a lot of human energy that is vulnerable to making mistakes and physical fatigue, it also requires a large cost and a long time, thereby affecting the production of milkfish. This research proposed an image processing method with the technique of finding the difference of values R, G, B in the reference image (trained) with input image (test) for the next value of the difference is calculated by the equation Euclidian (Length) and compared with the threshold value (T). The reference data used is 5 fresh milkfish, so that the reference image is generated at the position of R = 160, G = 35, B = 35, and threshold = 55. From testing of 10 fresh milkfish resulted in a detection value of 100%, and testing of 10 fresh milkfish resulted in a detection value of 80%. And has been tested the results of fishermen's observations and freshness detection tool banding fish against 30 samples of fresh fish, then produced a fresh fish detection value of 100% to the observation of fishermen [15].

II. RESEARCH METHODOLOGY
The discussion of this paper uses research methods in Figure 1. After taking the image, the first process of research flow of image input and gills on cob fish has done imagery with RGB process on the image object to be processed. The Resizing an image on the part of the object that will be done research object after it is done the extraction process of image color with RGB color, after doing the RGB color extraction process than from the image object is calculated the average value of R-value, G, B. after knowing the RGB value of the image object. The process continued using hue saturation method Value (HSV), after doing the HSV process then proceeds to the Morphological method to refine the results of the image process, after everything is done experiments then the results of the experiment using the KNN method will know the results of the image object that is examined.

A. Parameter Freshness of Fish
Based on its freshness, fish can be classified into four quality classes. Namely, fish whose freshness level is excellent (prime), fish whose freshness is good (advanced), fish whose freshness is backward (medium), and fish that are no longer fresh (rotten). As soon as the fish dies, changes will lead to decay caused by bacterial activity-chemical changes caused by enzymes and airborne fish's oxidation process [1].
B. Image Processing 1) Input Image: This study using sample data of 50 fish, each photographed on the eyes and gills. Digital image of fish obtained by RGB color model (Red, Green, Blue), PNG (Portable Network Graphics) extension input and displayed in the form of matrix m x n, according to the size of the image fisheye.
2) Cropping Image: After the fisheye's digital image with the color model of RGB with the extension JPG (Joint Photographic Expert Group), we managed to input. We did cropping imagery on the edge of the fisheye and stored it with png-extension image format (Portable Network Graphics), then obtained cropping image results.
3) Resize Citra: The matrix reading process will produce a digital image matrix with pixel values between 0 -255 and different image sizes in the RGB color dimensions, making it easier for the next process. It is necessary to resize the process to equalize all digital imagery sizes with the command 'imresize'.

4) Convert RGB to HSV:
The resized RGB matrix image is converted to a grayscale image matrix using the ''RGB2gray'' command so that the image is obtained with the grayscale image color model [1].

C. Digital Image
Mathematically the light intensity function in a twodimensional field is symbolized by ( , ), which in this case ( , ), is the coordinates on a two-dimensional field, and ( , ), is the intensity of light (brightness) at the point ( , ). Light is a form of energy, and it is not so that the intensity of light is worth 0 to infinity. To be processed with a digital computer, an image must be represented numerically with discrete values. Digital images whose size is N x M are commonly expressed with a matrix that is N rows and M columns based on equations (1). (1) The row index (1) and column index (2) Where, , = (1, 2), so that the matrix in Equation (1) is the same as the matrix in Equation (2)  where, (xL,yT) and (xR,yB) are the coordinates of the upperleft corner and lower-right corner of the crop image The image size becomes w2 = xR -xL dan H2 = yB -YT [3].

E. Digital Image Elements
The image contains some basic elements. The basic elements are manipulated in image processing; they are [16]: • Color is felt by the human visual system against the wavelengths of light reflected by objects. The wavelength is a property of color. The color received by the eyes is the result of a combination of light with different wavelengths. Color combinations that give the widest range of colors are red (R), green (G), and blue (B). • Brightness is also called light intensity. The brightness of a pixel (dot) in an image is not a rill intensity but is the average intensity of an area surrounding it.
• Contrast reveals the spread of light and dark in an image. Images with low contrast are characterized by most of the image's composition is light or mostly dark. On images with good contrast, dark and light compositions are evenly distributed. • Contour. Contour is a state caused by a change in intensity in neighboring pixels. Due to changes in intensity, the human eye can detect the edges of objects in the image. • The shape is the intrinsic property of a three-dimensional object, with the understanding that shape is the main intrinsic property for the human visual system. In general, the image formed by the eye is two-dimensional, while the object seen is generally tri mantra (threedimensional). Object shape information can be extracted from the image at the beginning of pre-management and image segmentation. • The texture is defined as the spatial distribution of grayish degrees within a set of neighboring pixels. So texture cannot be defined for a pixel. The human visual system receives image information as a whole. The observed image resolution is determined by the scale at which the texture is perceived. • Time and Movement. The response of a visual system applies not only to the space factor but also to the time factor. For example, if still images are displayed quickly, they will see a moving image. • Detection and Introduction in detecting and recognizing an image, it turns out that human visual systems work and involve human memory and thinking.
F. Hue Saturation Value Image (HSV) HSV images define a color space (or sometimes called a color system or color model) as a cardinal system specification and a subspace in that system. Each color is expressed with a single dot in it. The purpose of the formation of color space is to facilitate the specification of color in the form of a standard. The most recognized color space on computer devices is RGB, which corresponds to the human character in capturing colors in Figure 2. There are several ways to get grades H, S, V based on R, G, and B. Simple way, according to Acharya and Ray, based on equations (4)(5) [16].

G. Morfologi Image
Morphological operation is an image processing technique based on the form of segment regions in imagery. Because it is focused on the object's shape, this operation is usually applied to binary images. Usually, that segment is based on an object of concern. Segmentation can be done by distinguishing between objects and backgrounds. Then, by utilizing a development operation that converts color imagery and grayscale into binary imagery. The binary value of the resulting image represents 2 circumstances: object and not object (background). Although it is more widely used in binary imagery, morphological operations are often used on grayscale images and colors. The morphological operations result can be utilized for decision-making with further analysis. These operations consist of Dalasi, Erosion, closing, and opening [16].
Dilation operations Are performed to increase the segment size of the object by adding layers around the object. There are 2 ways to perform this operation: converting all the background points adjacent to the border point into object points or more easily set each point whose neighbor is the object point to be the object point. The second way is to turn all the points around the border point into object points, or more easily set all the neighboring points of an object point into object points based on equations (6) [16]. (6) Erosion operations are the opposite of dilation operations. The size of the object is reduced by eroding the object surroundings in this operation. The way that can be done there is also 2. The first way is to turn all border points into set points, and the second way by setting all the points around the background point to the background point based on Equation (7) [16].
The opening operation is a combination of erosion and dilation operations performed sequentially, but the original image in the erosion first only then the results are dilation. This operation is used to disconnect parts of an object that are connected with only 1 or 2 dots, or eliminate small objects and generally remove the boundary of a large object without significantly changing the object area. The opening is an idempotent based on an equation (8) [16]. (8) Closing operations are a combination of dilation and erosion operations performed sequentially. The original image is dilated first. Then the result is erosion. This operation is used to close or eliminate small holes present in an object's segments, merge adjacent objects, and generally smoot large objects' boundaries. It is done without changing the object significantly, based on Equation (9) [16]. (9) The result of the opening process is smoothing the boundaries of the object, separating the objects' boundaries, separating the objects that previously went hand in hand, and disappearing the objects that are smaller than the size of the structuring. The closing process tends to smooth the object to the image but by connecting the fragments and eliminating the object's holes. Because the Morphological process used only the opening process to smooth the results of objects that have been processed by using several previous methods. Closing Operation is carried out by performing dilation surgery first and then followed by an erosion operation.

H. Local Binary Pattern (LBP)
Local Binary Patterns (LBP) is one of the algorithms used to extract image texture features that use statistics and structure. Timo Ojala first introduced the LBP method. The LBP operator uses a grayish value comparison of the neighboring pixels. Local Binary Patterns is a method of extracting texture features that are rotation invariant. Lbp value itself is based on the thresholding process then the value is multiplied by the binary weight. For example, sampling points P=8 and radius R=1, LBP value calculation is shown in Equation (10). ; ; (14) Transformation of RGB to HSV, V = max (r, g, b) based on equation (15). (15) Values for s and v in HSV are defined in Equation (16). (16)

J. Segmentation Process
Segmentation algorithm that is: • Check the value of each pixel that has been converted to HSV. • Deploy thresholding value span >254.
• Suppose the value is between the ranges between thresholds. In that case, the image is the foreground. Suppose the value generates the range with the object value. Why infer the resulting foreground because the threshold result is greater than the foreground result, so if the value is less than 254, then read with the value foreground. • Repeat step 1 against all pixels on the image.

K. Character Extraction
For the color in the search by dominant color such as red or green can be done every pixel that the imaging system must be maintained into red or green. This can be done if the color space used is HSV. In the HSV system, the hue component expresses color as commonly understood by humans.
feature Extraction Based on Color, Shape, and Texture for Animal Image Retrieval. Under the supervision of SONY HARTONO WIJAYA. The differences in color, shape, and texture characteristics between each animal cause difficulties in animal image retrieval. Therefore, a specified technique is needed to obtain patterns from each animal s feature so that image retrieval might works properly. One of the techniques to obtain the pattern done by feature extraction. This research tries to develop an image extraction method in a Content-Based Image Retrieval approach by using three image visual features (color, shape, texture).
In this research, a Fuzzy Color Histogram (FCH) for color feature extraction is used through computing the membership function using the Cauchy function. In FCH, one color may belong to two bins histogram or more with different membership functions. Then, the shape feature is extracted using edge direction histogram, where each image is processed using Sobel edge detection, and then the direction is mapped into a defined bin histogram. For texture feature extraction, the process uses a co-occurrence matrix by computing the values of energy, moment, entropy, maximum probability, contrast, correlation, and homogeneity. Similarity value between image query and images in the database is computed based on its features, those are color, shape, texture, and its combination. Recall and precision value resulted in this research shows the largest average precision value is obtained from a searching process using index combination (color, shape, texture) of feature extraction. Keywords: feature extraction, Fuzzy Color Histogram, edge direction histogram, co-occurrence matrix iii [17].

L. Object Detection
The detection process of this object is shown to get the location of the value of the upper, bottom, right-left border on the object for later cropping.

M. K -Nearest Neighbor (K-NN)
KNN is one of the Instance-Based Learning group. NN is done by looking for groups of objects in the training data closest (similar) to objects in new data or data testing. This technique is very simple and easy to implement. Learning data can be projected into multiple-dimensional spaces. Each dimension represents a feature of the data [4]. The beginning of the program design process that will be made has been determined by using the KNN method to know the research object's classification results. The process does not eat a short time and produces an accurate object. Define between two distances of points in data training (x) and points in data testing (y). Euclidean formulas are used based on equations (17).  The freshness detection process results such as Figure 4 of the eye and gill processes of cob fish were successfully processed and obtained an image comparison that is most similar to that to be tested. Describe in the form of a type of freshness of fish displayed on the bottom right, while for the image of gills located on the bottom left is a picture of gills that have been trained. The experiment identified the freshness of sea fish by using 2 objects, namely eyes and gills, in the training data did 7 or up to 8 times to be able to get accurate test data with results that can be ascertained matched with expert results, if the results of the system declared fresh. Experts declared fresh. Then the system is declared correct and vice versa if the system states not fresh, experts declare not fresh, then the system is declared valid if the results are both inaccurate, then the results are declared invalid. The training data was conducted using 45 image objects and testing using 30 times but included in the report only 7 experiments between the eyes and gills of fish.
In the experiment, many obstacles can lead to inaccurate results. In the taking of image objects, the user may be less focused when taking objects. It will get inaccurate results. Test results of training data on the system of identification of freshness of sea fish, especially in cob fish test results as below.
Cob Fish Eye Test data in Table I, where the data only testing results in the table below states the image of the test data of each object is different not only by using 1 object with each experiment different each object, the results of the study if the system with experts declared fresh then the accuracy is declared valid but from the results of the system experiments and experts are not the same then the results of accuracy is declared invalid. Cob Fish Gill Test data in Table II is the same as the previous test data in the eye but this object is used for the gills of cob fish. IV. CONCLUSION Based on the experiment results, the authors found 20 invalid data from the 45 RGB experiment, 10 invalid data from 45 HSV color experiments, and 15 invalid data from 45 texture experiments using the Local Binary Pattern (LBP) method. Therefore, the result of the research obtained the least in the error rate is HSV Imagery. In the process of comparing methods after 45 experiments on each image object and using the same method, it was obtained that the Hue Saturation Value method achieved the highest success of 90%. For the texture, a value obtained 85% success. Identification of Freshness of Sea Fish based on HSV Imagery and Morphology has the highest accuracy using HSV color extract because the color extraction can detect from gradation of black to white color. Capture image objects more accurately and makes the desktop design even better to be used properly. Taking more methods needed to be processed because of the number of methods listed in the system, so the process is relatively slow.