E DIBLE F ISH I DENTIFICATION B ASED ON M ACHINE L EARNING

- Automated fish identification system has a beneficial role in various fields. Fish species can usually be identified based on visual observation and human experiences. False appreciation can cause food poisoning. The proposed system aims to efficiently and effectively identify edible fish from poisonous ones based on three machine learning (ML) techniques. A total of 300 fish images are used, collected from 20 species with differences in shapes, sizes, and colors. Hybrid features were extracted and then fed to three types of ML techniques: k-nearest neighbor (K-NN), support vector machine (SVM), and neural networks (NN). The 300 fish images are divided into two: 70% for training and 30% for testing. The accuracy rates for the presented system were 91.1%, 92.2%, and 94.4% for KNN, SVM, and NNs, respectively. The proposed system is evaluated using four terms: precision, sensitivity, F1-score, and accuracy. Results show that the proposed approach achieved higher accuracy compared with other recent pertinent studies.


INTRODUCTION
Various types of fish found in seas and rivers occasionally have the same shapes and sizes, resulting in difficulty distinguishing them from one another.Given that consumers are looking for fresh or high-quality fish, the huge challenge facing fishers is the laborious method of manually confirming the fish species with high valuable, fresh, edible, dangerous, invasive, or poisonous.Another challenge is underwater environment, where the task of identifying fish species is challenged by the complexity of the background, water turbidity, and light dispersal in deep water [1].Distinguishing one fish species from another based on external semblance is still difficult because of the considerable similarity.Current research remains incapable of identifying which fish are dangerous or not.Accordingly, a reliable and authentic identification of fish is crucial to avert fish mislabeling in markets [2].The best possible techniques for fish authentication are to identify fish species using morphometric and morphological characteristics [3].Detecting edible, poisonous, or dangerous fish is a complicated and critical task, and the use of wrong information caused by lack of experience may lead to death in many cases; hence, particular knowledge of taxonomy framework and fish biological proprieties are required [4].The correct identification of fish species (i.e., edible, poisonous fish) helps in economic development and the preservation of human life.Accordingly, technology that can automatically detect poisonous fish must evolve to reduce waste of time and provide considerably accurate results.Machine learning (ML) plays an essential role in classification problems.In ML, computer programs can be updated automatically throughout experience.ML algorithms require large amounts of data and highly consume resources [5].Pretrained data help to minimize data inadequacy consistent with a particular task.This technology is utilized by scientists to scrutinize large data and to automate complex tasks.ML techniques show better performance than traditional forecasting.Furthermore, ML techniques were used for defect identification in various fields [6].ML techniques are classified into four classes: supervised, unsupervised, semi-supervised, and reinforcement.Supervised algorithms utilize labeled data.Learning data are used when identified specific goals should be achieved from a specific input [7].Unsupervised algorithms utilize unlabeled data.Semi-supervised algorithms can be supervised and unsupervised because they can utilize unlabeled and labeled data sets [8].Reinforcement algorithms enable machine and software agent to evaluate the optimal solution in a particular problem and are considered among the best tools for training artificial intelligent models [9].The current study used three ML techniques, namely, k-nearest neighbors (K-NN), support vector machine (SVM), and neural networks (NNs), for reliable fish identification system by utilizing images from a significant database [10].Fish images are preprocessed, and hybrid features (i.e., second and high order statistical features) are extracted from fish images.Thereafter, the fish classification algorithm is created using the three ML methods (i.e., K-NN, SVM, and NNs), and fish categories (i.e., edible, poisonous) can be identified thereafter.
The remainder of this paper is organized as follows.Section 2 reviews the related studies.Section 3 presents the methods and materials used in this research.Section 4 provides the experimental results.Lastly, Section 5 presents the conclusions and future research.

II. RELATED STUDIES
This section presents a concise review of some related studies.
In [1], an approach was proposed for classifying fish based on convolutional neural network (CNN) and incremental learning strategy.A total of 15 fish species, 20 videos, and 22,000 sample images were used.The images have different sizes ranging from 20 × 20 to 200 × 200 pixels.Each video was labeled.Their data sets were based on blurry and noisy environments, poor lighting conditions, and plain/complex backgrounds.Their system trained ResNet50 on two fish species: hard and easy fish species.First, the system learn about hard fish species.Second, easy species were added thereafter by using incremental learning.Knowledge distillation loss was added to modify loss function, and used to learn a new fish species.The system achieved an accuracy of 85.26%.
In [11], an approach was proposed to classify fish into dangerous and non-dangerous fish: non-dangerous fish were classified into ornamental and edible fish, while dangerous fish were classified into poisonous or predatory fish.A combination of 39 anchor point features, 2 statistical features, and 24 features of GLCM were extracted from fish images.To classify the fish images, they used simulated the annealing and genetic algorithms with back propagation, and the accuracy rate was 82.25% and 90%, respectively.
In [12], the YOLO deep learning algorithm, which has the advantage of faster image detection, was used for fish identification.Their approach have several steps: building the YOLO algorithm, collecting and labeling fish images, training, and testing.Their approach can identify 24 fish species; the highest detection accuracy was in Holacanthus tricolor at 90.70%, while the lowest was in Forcipiger flavissimus at 68.28%.The total accuracy of their model was 82.82%.Another approach [13] used the YOLO detection method to classify six fish species from underwater video.The input fish image with size of 488 × 488 was divided into seven grids, with each grid representing a bounding box that provides a prediction score for the class.A total of 220 fish images were used as data set (120 for training and 100 for testing), and the accuracy of this approach was 92%.
In [14], fish species recognition for underwater images was proposed.In particular, 28,328 RGB fish images from 130 species of sizes 300 × 300 and 512 × 512 were used.As fish attribute extractors, the model used MobileNetv3-large and VGG16 backbone networks.Given that the data set was imbalanced, a class-aware loss function was used to solve this problem.The model's data set contained three categories: training data, which contain 70 samples, and validation and testing data, which contain 30 samples.The accuracy of their system was 79.7%.
In [15], a novel method for fish species detection and classification was presented.Fish images were obtained using boat cameras, and 3777 fish samples divided into 8 species were used.Data augmentation techniques were used to solve the problem of image shortage in some species.Hence, the total number of fish images was 16000.The VGG-16 network pretrained on the ImageNet data set was used as classifier.A total of 2000 patches were extracted for each species from the training data set.CNN was used for image detection and classification, and the model achieved detection and classification accuracies of 90% and 92%, respectively.
In [16], a system to monitor marine life was proposed.This system comprised three tasks.Fist, underwater moving fish were detected.Second, the detected fish were tracked to avoid errors in counting.Lastly, species of the detected fish were classified.The first task was performed using the GMM technique based on the background subtraction process.For the second task, the Kalman filter was used, which predicts the trajectory's location in each frame and determines the possibility of each detection being assigned to each trajectory.The Kalman filter could avoid errors in counting the tracked fish.The pyramid-histogram-of-visual-words features were extracted, and a classifier was built thereafter.SVM was used for classification (third task).The number of images used was 22,444.The accuracy rate of their system was 91.7%, but the accuracy of the low-quality video was 40.1%.
In [17], a hybrid local binary pattern was introduced to classify fish in Bangladesh.A new data set (i.e., BDIndigenousFish2019) was created, containing images of eight different fish species.Thereafter, hybrid features descriptors, such as LBP, NABP, LGP, CENTRIST, LAID and DTCTH, were used to extract significant features from the fish image.Meanwhile, different kernels of SVM were used for classification, and the experimental results showed accuracy of 90%.

III. RESEARCH MATERIALS AND METHODS
This research, which aims to identify edible/poisonous fish, comprises three phases; data collection, features extraction, and identification phases.Three ML techniques were used to identify fish categories (i.e., edible/ poisonous).The general architecture presenting the methods used in this research is shown in Fig. (1).

A . Data Collection
A total of 300 real-world fish images from 20 species were obtained in this research.The images were from major databases [10].Moreover, the images were selected on the bases of differences in size, color, controlled/uncontrolled illumination, out of the water/in the water, and plain/complex background.The data set utilized in this research has two categories.

1) Edible Fish
A total of 10 species of edible fish were utilized in this research: 15 images for each species, for a total of 150 fish images selected.The two types of edible fish collected were freshwater and saltwater fish.

2) Poisonous Fish
A total of 10 species of poison fish were utilized in this research: 15 images for each species, for a total of 150 fish images selected.The two types of poisonous fish were poisonous and venomous fish.
Poisonous fish contains toxins that cause poisoning if a person eats it.By contrast, venomous fish produces a vigorous mishmash of toxins that cause poisoning through sting, bite, or stab.Several pre-processing steps were performed on the fish images.First, the RGB image was converted into a grayscale image.Second, background and noise were removed from an input image using the filter in [18].Third, the fish images were cropped and resized to 256 × 256 to remove errors.Thereafter, all images are ready for the next stage.

B. Features Extraction
In this phase, a combination of second and high order statistical features were extracted (12).Significant and relevant features were extracted from the fish image (5).These features are second and ( 7) and high order statistical features.

1) Second Order Statistical Features
One of the specialized methods that used to obtain significant object details.The properties of any region can be determined by the distribution of the gray levels.The features of a region can also be described by using space relations of the gray level distribution of the input image.Different second order statistical features can be obtained based on the peculiarity of pixels to depict the image.In this research (5), features of the second order statistics features are obtained: energy, homogeneity, correlation, contrast and entropy.These features are clarified in Eqs.(1) to (5) [19]: Energy=Σi,jI(i,j)2, (1) Contrast = Σi,j (i,j)2 I(i,j), Entropy = -Σi,j I(i,j)log I(i,j), (5) where: i,j: number of rows and columns, respectively, in the gray matrix; I(i,j): pixel intensity value probability; , : means; and , : standard deviations for rows and columns, respectively.

2) High Order Statistical Features
Gray level (GL) run length matrix is a high order statistical features technique that applies to a run length matrix.It is a method that can extract higher order statistical texture proprieties.Moreover, this technique is a number of straight pixels in a particular direction having an identical intensity value.It can extract image information from its GL matrix.GLRLM can keep the parameters stable, and simply changing the rotation and scale will obtain a perfectly new texture [20].The main idea of GLRLM is computing the number of straight pixels having an identical GL in a particular direction.Thereafter, a matrix is created.The number of run length matrices can be calculated for one image.However, just one matrix can be calculated in each direction.Lastly, features are extracted from this matrix, as shown in Eqs. ( 6) to ( 12) [21]: L= LGR= where: SR: Short-Run-Emphasis; LR: Long-Run-Emphasis; GL: Gray-Level-Non-uniformity; RPER: Run-Percentage; RL: Run-Length-Non-uniformity; LGR: Low-Gray-Level-Run-Emphasis; HGR: High-Gray-Level-Run-Emphasis; P(i,j): run length matrix; i: number of runs having pixels with gray level intensity; j: length of run on a particular direction; and r: aggregate number of runs.

C. ML Techniques 1) K-NN
K-NN is one of the supervised ML algorithms widely used in solving classification problems.Supervised learning means that the input and output are given to the system.Some of the input data are labeled, and when a new sample is entered to the system, the output will present.K-NN uses a data set containing data points, and data points of a sample is given to K-NN as a classification problem.The K-NN algorithm finds the closest class to the input sample based on the distance between the new input sample and all labeled data sets.K-NN accuracy depends on predicting the correct K-NN [22], and finding the correct K-NN relies on how skillfully the large labeled data set has been trimmed.Meanwhile, finding the closest class is achieved using Euclidean distance, as shown in Eq. ( 13).K-NN is flexible, easy to implement, and appropriate for multi-modal.Although K-NN is considered the best classification method, noisy data and irrelevant characteristics will cause retrogression of accuracy [23].Dis= √(2 − 1) 2 + (2 − 1) 2  (13) 2) SVM SVM is one of the linear classifiers widely utilized for recognition, classification, detection, and regression.In particular, SVM can separate two groups of data with as broad a margin as tolerable.This situation leads to perfect results on unseen data, thereby enabling SVM to learn from massive data [24]. .(14) This research uses SVM to separate data into two categories of fish: edible and poisonous fish.

3) NNs
The third ML technique is NN, the mathematical model of which uses learning algorithms inspired by the human brain to solve complex problems.Difficult tasks and problems for humans are significantly easy to solve using NNs.In general, NNs are composite of many nodes with multiconnections.A perceptron is an NN unit performing specific computations to reveal features in the input data.It takes a set of features and their targets as inputs, and it attempts to find how classes can be separated [26].NNs consist of input, hidden, and output layers.Layers in NN comprise any number of neurons.However, the number of neurons in the output often matches the number of categories being surmised.Neuron connections in NN are weighted.Each neuron in NN have an activation function that transforms a neuron's input into a coveted output [27].In NNs, learning is constraining of weights generating the closest outputs to the desired results.Learning is attained by optimizing the entire errors with regard to weights.The simplified structure of NNs provides leverage in ML.A supervised learning algorithm can learn based on wellrepresented input data to guess results for unforeseen data.When choosing a learning algorithm, several aspects must be considered: small memory requirements, speed and stability, and time saving [28].Activation function An (I, W) of NN is the summation of input Im multiplied with weight Wmn, as shown in Eq. ( 15).The sigmoid activation function of NN with the output function Om (I, W) is given in Eq. ( 16).

D. Performance Evaluation
Performance evaluation is the process of measuring model quality.Various evaluation methods should be used to evaluate our model.Evaluation metrics can be used to assess the quality of the ML model.Several types of evaluation metrics are available to evaluate the ML model.These metrics provide accurate information of model performance and help in determining the best model when several models are used.The most important evaluation metric is the confusion matrix.Confusion matrix is based on the number of true and false predictions in each class.The performance of the three ML techniques can be evaluated in terms of precision, sensitivity, F1-score, and accuracy using Eqs.(17) to (20), respectively [29]: The other method to evaluate a model or algorithm is the receiver operating characteristic (ROC) curve.The ROC curve explains the ratio between the true positive rate against the false positive at different classification thresholds.ROC can be plotted using two axes (i.e., x-, y-axes), which refer to the false and true positive rates, respectively.Fig. (4) shows an ROC example [30].

RESULTS
This study was implemented using a CPU with Intel (R) Core (TM) i5-2430M processor CPU at 2.40 GHz, with 4 GB RAM, x64-based processor, MATLAB R2020a, and Windows 10.A total of 300colored fish images (i.e., edible and poisonous) were used.Colored fish images were collected from a significant database [10].

A. Training
This study used a 300-input fish image data set and 3 ML techniques (i.e., K-NN, SVM, and NNs).For all techniques, 210 and 90 samples were used for training and testing, respectively.For NNs, 12, 8, and 2 neurons were used for the input, hidden, and output layers, respectively.
Fish-Inputs and Fish-Targets matrices represent the input and target layers, respectively, for NN, and the Fish-Inputs matrix represents the relevant features extracted from the fish images.A total of 300-input fish images data set is obtained: 150 images each for edible and poisonous fish.The size of the input features was 12, which exemplifies the combination of features extracted from each sample, and the size of output was 2, which represents edible or poisonous fish.Binary exemplification was likewise uses [1 0]; [0 1].

B. Testing
A total of 90 fish samples (i.e., edible/poisonous) were used for testing in the three ML techniques, selected from a significant database [10].Prediction results of the number of correct and incorrect states are explained using a confusion matrix, while the performance of the presented work can be explained using the ROC curve.Fig. (5) shows the confusion matrix and ROC for the three ML techniques.As shown in Fig ( 5), the confusion matrix presents a comparison between the actual and predicted results of the edible/poisonous fish classes for the three ML methods.For the K-NN method, (a) shows the misclassification for 8 out of the 90 images.For the SVM method, (b) shows the misclassification for 7 out of the 90 images.For the NN method, (c) shows the misclassification for 5 out of the 90 images.For the K-NN method, the accuracy is 100% for six fish species, but misclassifications appeared in four species: barbus and Tenualosa ilisha (edible species) and Lagocephalus lunaris and Himantura uarnak (poisonous species).For the SVM method, the accuracy is 100% for seven fish species, but misclassifications appeared in three species: Dentex macrophthalmus and Tenualosa ilisha (edible species) and Himantura uarnak (poisonous species).For the NN method, the accuracy is 100% for eight fish species, but misclassifications appeared in two species: Tenualosa ilisha (edible species) and Lagocephalus lunaris (poisonous species).The evaluation scores of the presented work are provided in Tables 2.     The results of this research are compared with those of previous research.Table 3 presents the results.Fig. (8) shows a comparison between the presented and previous research.Despite the excellent results, there are some expected limitations in this study.The current research works on images from a data set not from underwater videos in natural environments.Moreover, the images were not captured from local rivers, seas, or local markets.

V. CONCLUSION
This study underscores the importance of having a system for automatically identifying edible and poisonous fish.This approach provides a framework that can accurately classify fish into edible and poisonous ones based on ML.A total of 300 fish images with different sizes, shapes, and colors were selected from 20 fish species.Hybrid features (second order statistical features, high order statistical features) were extracted and three ML techniques (K-NN, SVM, and NNs) were used to classify fish into edible/poisonous.The proposed approach is evaluated in terms of precision, sensitivity, F1-score, and accuracy.The results are promising for the three ML techniques.NNs showed the highest performance.The accuracies of the ML techniques are 91.1%,92.2%, and 94.4% for K-NN, SVM, and NNs, respectively.This approach is invaluable for taxonomists, data scientists, and those interested in livestock.Future research will focus on increasing the number of fish samples and improving the proposed system to identify additional fish types (e.g., invasive, omnivorous, and ferocious fish) by using additional fish attributes (e.g., fish appearance and behavioral attributes).
Fig. (2) shows the fish image data set.

Fig. 4
Fig.4 Receiver Operating Characteristic Curve (a) Confusion matrix of the K-NN techniq (b) ROC of the K-NN technique (c) Confusion matrix of the SVM technique (d) ROC of the SVM technique (d) Confusion matrix of the NN technique (d) ROC of the NN technique (e) Fig.5 Confusion Matrices and ROC Curves for the Three ML Techniques TPR explains the number of true positive results among all positive samples obtainable during testing.FPR explains the number of wrong positive results among all negative samples obtainable during testing.

Fig. ( 6 )
presents the evaluation of the presented work in terms of precision, sensitivity, F1-score, and accuracy for the three ML techniques.

Fig. 6
Fig. 6 Evaluation of the Presented WorkThe accuracy of the three ML techniques is shown in Fig.(7).

Fig. 7Accuracy
Fig.7Accuracy Rate of the Three ML Techniques

Fig. 8
Fig. 8 Comparison between the Presented and Previous Research.

TABLE II EVALUATION
SCORES OF THE ML TECHNIQUES

Table 2
shows that the NN method achieved the highest results in terms of precision, sensitivity, F1 score, and accuracy.