Content area
Despite the high nutritional value of fish, it is often under-consumed due to its characteristic odor and laborious cleaning process. This sensory barrier significantly diminishes the appeal of fish, particularly in regions or cultures where individual exhibit heightened sensitivity to fish odor. Fish processing systems have been developed to facilitate cutting and cleaning steps in aquatic supply centers and factories. In this study, to upgrade a fish processing system to an intelligent machine, four high-consumption fish classes were classified using Artificial Intelligence (AI), and the corresponding cutting point determination algorithms were developed using a multipurpose backlighted pure blue background for each class. As the classification algorithms developed, the best results were selected based on the least total MSE value. The best ANN structure was determined as 6–23–4 with 99.62%, 96.72%, and 95.06% with corresponding MSE values of 9.51 × 10–5, 2.03 × 10–2, and 2.54 × 10–2 in the train, validation, and test sets, respectively. This structure was recorded as the best one with the ‘Logsig’ function in both hidden and output layers with the LM learning algorithm. The total classification accuracy of the SVM classifier resulted in 99.69% and 98.75%, with the corresponding MSE values of 1.23 × 10–2 and 1.25 × 10–2 in train and test data sets, respectively. As soon as the fish were classified, their unique cutting point determination algorithms were applied for fish processing. Finally, the head and belly cutting points accuracy of Silver Carp, Carp, and Trout fish were resulted in 98.36% and 99.49%, 97.85% and 98.07%, and 96.61% and 97.90%, respectively.
Introduction
Fish processing is a time-consuming and tedious task that can be facilitated by automated systems. In almost all systems, the automated machines are specialized for one fish species. Therefore, designing a system to detect, classify, and process different fish species with varying dimensions presents a significant challenge1. To reach such a system, the machine must be intelligent for fish classification. Therefore, Machine Vision (MV) and Artificial Intelligence (AI) were used for fish detection and classification.
Machine vision is a non-destructive and reliable tool for quality assessment, sorting, and object identification. Lines et al. proposed a method to estimate the mass of swimming fish using image analysis2. They captured video frames from swimming fish in both controlled and real conditions. In another study, Kohler et al. applied machine vision for fish cod fillet sorting3. Later, Atienza-Vanacloig et al. applied a vision-based model for tuna fish individual discrimination growing inside the cages4. Li et al. applied novel automatic detection method for abnormal behavior of single fish using image fusion5. In other study conducted by Zhou et al. an unsupervised adversarial domain adaptation based on interpolation image for fish detection in aquaculture6.
Besides, different studies are conducted on fish, including fish movement7; segmenting blood defects in Atlantic cod fillets8; implementing fish counter using machine vision9; developing a fish bending model using machine vision for tuna sizing10; fish species identification with an automated system using visual features11; intelligent fish processing and cutting with efficient and safe production12; and intelligent fish spoilage analysis with smartphone images13. In another study, Du et al. studied on feature fusion strategy for accurate recognition of fish feeding behavior14. In a recent study, Yin et al. utilized an automated recognition method to identify fish body surface diseases in recirculating aquaculture systems15. The researchers employed an underwater image acquisition platform to collect a comprehensive dataset of spotted knifejaw diseases, such as skin ulceration and tail rot disease. To improve the quality of the images, they applied the Automatic Color Enhancement (ACE) algorithm, which enhanced the clarity and resolution of the underwater images. This approach allowed for rapid and non-destructive identification of fish surface disease. In another study, Yu et al. used an efficient multi-fish hypoxic behavior recognition and tracking method in real time fish monitoring16.
Artificial intelligence (AI) is widely applied to classify different groups of agricultural and aquatic products. One dominant and popular classification method is artificial neural networks (ANN). This method is applied for apple sorting using textural features17; Discriminating tea plant varieties based on Vis/NIR spectral characteristics18; automatic identification and removal of invasive fish19; semi-automatic maize kernel counting20; on-line sorting of a chicken portion based on an intelligent system21. In another study, Yu et al. applied an intelligent measurement scheme for basic characters of fish in smart aquaculture22. They used the open fish dataset, and proposed an accurate measurement scheme of fish characteristics by combining expansion technology and an improved Mask R-CNN network. Later, Qian et al. applied AI for Segmenting and calculating splash area during fish feeding23.
ANN is also used in aquaculture as a nondestructive tool in shrimp disease occurrence24; counting and sizing Northern Bluefin Tuna using a dual-camera system25; assessing the effect of intermittent feeding on the rainbow trout pre-slaughter fasting response26. In a recent study, Taheri-Garavand et al. applied ANN to real-time modeling of fish Common Carp fish freshness during ice storage27. They selected 22 features as input to classify four classes of fish in different freshness stages. In another study, Ranjan et al. conducted a study on the impact of image data quality on a convolutional neural network used for detecting fish in recirculating aquaculture systems28. The researchers collected data from imaging sensors in both ambient and supplemental light conditions. The data was then sorted into a set of 100 images, partially and fully annotated, and augmented before being trained using a one-stage YOLOv5 model. The results showed significant improvements in mean accuracy (mAP) and F1 score when the image dataset was expanded to 700 images and trained for 80 epochs. The study also found that the selection of sensors had a significant effect on model accuracy, while light conditions did not have a considerable impact.
The other supervised learning model is Support Vector Machines (SVM). This tool is applied in different aquaculture studies to classify the fish species and detect the defected samples. In a recent study, Mohammadi Lalabadi et al. applied SVM for fish freshness categorization based on eyes and gills color features29. They applied analysis of variance for feature selection and introduced the final features (R, G, and B channels) of both SVM and ANN for fish freshness categorization. In another study, Cheng and Sun applied SVM to integrate classifiers analysis and hyperspectral imaging to discriminate fresh from cold-stored and frozen-thawed fish fillets rapidly30. In the other study conducted by Rohani et al., the final classification value resulted in 99.45% for the test set31. Azarmdel et al. applied SVM for mulberry fruit classification using machine vision. Their results presented a proper classification with the accuracy of 99.78% and 99.12% for training and test sets, respectively32. Later, Zhou et al. leveraged the feature distribution calibration and data augmentation for few-shot classification in fish counting. They extracted seven features from the adherent fish, followed by a linear fit of the features to the number of adherent fish. By introducing the data to nine classifiers, support vector classifier (SVC) with radial basis function (RBF) resulted the best classification with 96.2% accuracy6.
In recent years, artificial intelligence (AI) and deep learning techniques have significantly advanced fish species recognition and classification. For example, Deka et al. proposed “Automated Freshwater Fish Species Classification Using Deep CNN”, applying fine-tuned AlexNet and ResNet-50 architectures for classifying 20 indigenous freshwater fish species, where ResNet-50 achieved 100% accuracy on both a custom dataset and the Fish-Pak benchmark33. Similarly, Gong et al. introduced “A Novel Fish Species Classification Method in Multi Water”, employing a Vision Transformer-based (Fish-TViT) approach to effectively handle image variations across freshwater and marine species, achieving competitive accuracy in cross-environment scenarios34. In another work, Ahmed et al. presented “An Advanced Bangladeshi Local Fish Classification System”, demonstrating that conventional machine learning models such as SVM and ANN can still produce robust classification results when integrated with handcrafted features and efficient preprocessing emphasizing that deep CNNs are not the only viable approach for fish identification.
Moreover, Babu and Shukla developed a “Hybrid Transformer–CNN Model for Precise Fish Segmentation, Localization, and Species Classification in Aquaculture”, combining transformer-based attention with convolutional features to achieve high precision in multi-task fish segmentation and classification35. Furthermore, Hamzaoui et al. proposed “FishDETECT: Improved Deep Learning Model for Underwater Species Recognition”, enhancing YOLOv5 through transfer learning and domain-specific fine-tuning, achieving a mean average precision (mAP50) of 0.995 with superior precision and recall in complex underwater imagery36.
Collectively, these studies show that AI-based fish classification has evolved toward increasingly complex architectures, often combining transformer attention mechanisms, CNN feature extractors, and optimization algorithms to boost performance under diverse imaging conditions. However, several recent works, including those by Ahmed et al., highlight that Artificial Neural Networks (ANN) and Support Vector Machines (SVM) still remain powerful alternatives when applied to structured feature sets or moderate datasets, offering simplicity, interpretability, and lower computational demand. This demonstrates that while deep convolutional and transformer-based methods dominate current research, ANN and SVM models continue to provide competitive results, especially when coupled with image-processing-based feature extraction and integrated decision systems. Therefore, the proposed AI-based 2D image processing framework, which combines ANN and SVM classifiers for fish species classification and automated cutting point determination, aligns with current research trends while maintaining efficiency and industrial practicality.
In this study, the main objective is to feed the fish into the machine by the customers as they buy their selected fish in the fish-supplying centers. The other prominent feature of the proposed machine is fish classification ability which enables the machine to process different fish species in an integrated system.
Most existing automatic fish processing machines are designed to handle a single fish species or fish of uniform size and morphology, primarily because their mechanical systems and geometric configurations are optimized for specific body shapes and structural features. Machines such as filleting, gutting, or scaling devices typically use fixed or semi-adjustable blades and guiding systems that align with the anatomy of a particular species, such as salmon, cod, or tilapia. When different species or sizes are introduced, these mechanisms struggle to maintain precision, efficiency, or yield. Recent research emphasizes that although automation and vision-based systems have improved, adaptability remains a major challenge. For instance, Einarsdóttir et al. highlighted that industrial automation in the fish sector still relies on fixed mechanical calibration for uniform product types37. Similarly, Climent-Perez et al. and Castro-Gutiérrez et al. demonstrated that computer vision and machine learning can enhance classification and size estimation, but current systems are yet to fully accommodate large variations in fish morphology38,39. The same limitations are reflected in studies on machine vision cutting systems, which show that adjustment of cutting parameters is necessary for each fish type to achieve accuracy and minimize waste39. Overall, while automation technologies are advancing, the geometry and design of most processing machines continue to restrict their application to single-species operations or narrowly defined fish size categories.
In this device, artificial intelligence methods have been developed based on machine vision precise dimension extraction and cutting point determination as soon as the fish are classified. In addition, this device has the ability to perform different stages of fish processing steps including beheading, cutting, and belly gutting for different fish dimensions. The system is designed for ease of use: the customer places the fish from the tail side, and the machine automatically classifies and begins the cleaning and filleting process. This streamlined workflow enhances convenience and efficiency, allowing consumers to obtain fillets with minimal effort. While we do not provide economic analysis or quantification of production impact, this design has the potential to improve accessibility and user experience in fish processing.
To sum up, machine vision and artificial intelligence methods, including support vector machine and artificial neural networks, are proposed as fast and reliable methods to be applied in an online intelligent fish processing system. The fish images are segmented and introduced into ANN and SVM classifiers to categorize fish species. Subsequently, in the second segmentation step, the extracted positions of the fins will be exclusively used as the cutting point of each species. So the machine will be upgraded to an intelligent fish processing robot capable of detecting and processing different fish species with different dimensions.
Material and methods
This study applies robust fish classification and segmentation algorithms in an intelligent online fish processing system. The details of the method and the used materials are presented in the following.
Image processing
Fish samples
In this study, four common fish species were applied, including Silver Carp fish (Hypophthalmichthys molitrix), Carp fish (Cyprinus carpio), Tigertooth Croaker fish (Otolithes ruber), and Trout fish (Oncorhynchus mykiss) which all of mentioned fishes were attained from Tabriz Fish Breeding and Supply Center, an aquatic supply center in Tabriz, Iran. Also, the images were captured at the mentioned center. To ensure temporal independence and minimize potential data leakage, we collected a maximum of 10–20 fish images per day. In some cases, fewer samples were available due to limited supply at the fish center. The fish were typically intended for sale over the following 3–4 days (or longer), so images collected on different days represented distinct batches with varying storage times and handling conditions. Over the two-year collection period, the center received fish from multiple breeding centers across the city and neighboring provinces, providing additional diversity in appearance. This approach naturally introduced variation across days, capturing differences in regional origin, seasonal factors, storage times, and handling. While this sampling strategy ensured that the training, validation, and test sets were both temporally and distributionally independent, we recognize that environmental factors in other geographic regions could still affect fish appearance and system performance. Therefore, we recommend that future studies include samples from additional locations to validate and adapt the system for broader applicability.
Based on the available number of fish samples in the image capturing period and harvesting season, a total of 405 fish samples, including 110 Silver carp, 83 Carp fish, 112 Tigertooth croaker, and 100 Trout fish were captured40,41. In Sect. “Sample selection strategy”, the minimum required number of samples for classification problems is discussed. This requirement is closely tied to the dimension of input features and the chosen classification strategy, which may vary depending on the specific problem. The sample images of each applied species are presented in Fig. 1.
Fig. 1 [Images not available. See PDF.]
Four fish species applied in this study.
To assess baseline model performance, we retained the natural class distribution of our dataset without applying balancing techniques. This approach allowed us to evaluate how classical algorithms perform under real data conditions. Future studies could incorporate methods such as SMOTE, class weighting, or adaptive resampling to address class imbalance and improve model robustness.
Imaging system, and image processing software
To capture the fish images, a Basler (daA1280-54uc, USB3, 1280 × 960, 1.2 MP) video camera was applied. with 54 fps (frames per second) to ensure explicit imaging while the fish passes in front of the camera along the machine in the real processing conditions. To cover the total fish length considering the distance between the camera and the fish, a wide view lens (Evetar Lens M118B029520W F2.0, f 2.95 mm, 1/1.8″, MOD 150 mm, S-Mount) was applied. In order to get the snapshots, the camera was linked to the Matlab 2014a software, and one frame was saved for the corresponding sample.
The camera position with the applied LED lights and background illumination system is presented in Fig. 2a. The imaging case is fabricated with stainless steel equipped with three blur Plexiglas plates as the background and foreground. Two of these Plexiglas shields were used to provide a uniform light diffusion.
Fig. 2 [Images not available. See PDF.]
The image processing setup: (a) front and back view of the imaging case with detailed parts designed in CATIA software; (b) designed and fabricated camera case; and (c) inside the imaging case with the lights OFF and ON.
The camera resolution was set to 1024 × 768 and an ROI was cropped for further image processing steps. The imaging case (length 0.70 m × width 0.65 m × height 0.55 m) was illuminated using three 0.6 m LED strips mounted on the ceiling (total 1.8 m) and two 0.6 m LED strips mounted on the inner wall on the same side of the camera to illuminate the fish sample (total 1.2 m). The LED strips operate at 12 V with a total current of 3 A for all LEDs, consuming approximately 36 W of power. The illuminance (lux) inside the chamber was estimated using the standard relation of Luminous flux (lm) to Illuminated area (m2). Assuming a typical luminous efficacy of 100 lm/W for the LED strips, the total luminous flux is approximately 3600 lm. Considering the chamber floor area of 0.70 m × 0.65 m = 0.455 m2, the estimated illuminance is approximately 7900 lx. The camera was mounted on the chamber wall, 45 cm from the object plane, and the lighting was kept constant for all image acquisitions to ensure reproducibility.
In order to protect the industrial microchip video camera, a polyethylene frame was designed with CATIA V5 software42 (Fig. 2b). The fabricated imaging case with the LED lights is presented in Fig. 2c. Finally, the captured images were processed with a Hewlett-Packard S4530 laptop computer (Intel(R) i5-2410M [email protected] GHz, 8 GB RAM) with the developed algorithm in MATLAB 2014a software43.
Camera calibration
To cover the total length of the fish in the broader view inside the imaging case, the video camera was equipped with a fisheye lens. To justify the images, a checkerboard plate with the odd number of squares (21 × 21 mm) was used. In order to get the precise results all of the processes were performed on the calibrated images.
Pure blue background
The segmentation process is more feasible when the contrast between the target and the background is distinct enough to be performed with automatic methods like44. Otherwise, complex segmentation algorithms must be developed for proper segmentation. So, among both mentioned methods, it is preferred to define a distinct background for feasible segmentation.
As shown in Fig. 1 Tigertooth croaker and silver carp are brighter than the trout and carp fish. Therefore, a dark and light background will be an appropriate option for segmenting the lighter and darker fish samples. On the other hand, the color intensities in each fish sample diverge from lighter pixels to darker ones. So, even selecting the light color backgrounds for dark fish samples will result in incomplete fish segmentation.
Figure 3a shows the black background and the color channels of RGB color space with the intensity values. This type of background is proper in a lighter fish sample. In order to avoid any glitter of the opposite light on the Plexiglas, the plate was inclined at the angle of 72° (Fig. 2). In this condition, the pixels with the pure blue color are converted into ‘252’ in channel B representing the white area, while it converts to pure black in channel R with the value of ‘0’ (Fig. 3c). The color intensity difference of fish-body/fish-fins and also fish-fins/fish-fins of trout fish were the highest and the least values in channel B among all tried color channels, respectively45.
Fig. 3 [Images not available. See PDF.]
Background selection: comparing background color and type on fish segmentation. The blue Plexiglas illuminated background presented the best fish segmentation by resulting almost zero intensity value in R channel of RGB color space. a) black background, b) blue background, and c) blue illuminated background.
Image providing procedure
The image of the trout processing machine is presented in Fig. 446. To reach this goal, it is necessary to detect the type of the fish as it feeds into the machine. In the next step, all the samples were processed in a loop, and the information was saved.
Fig. 4 [Images not available. See PDF.]
Fish processing machine: (a) the image acquisition system, (b) electrical panel, and (c) the manufactured fish processing system in the synchronization stage.
Fish segmentation
The fish segmentation process is shown in Fig. 5. Since the color of the fish species is almost lighter in the chest and belly area46, channel B was acceptable for initial fish segmentation. So, we selected channel R for successful segmentation. The initial image was cut into 320 × 320 pixels to cover the longest fish dimension. To remove any non-zero pixel, a comparative criterion was considered which guaranteed full segmentation.
Fig. 5 [Images not available. See PDF.]
Fish segmentation process: (a) Initial image cropped in required dimension, (b) R channel of RGB color space, (c) segmenting fish (d) considering a bounding box for each fish, and (e) applying a mask to have a color fish image in a black background to extract the required information and features.
In Fig. 6 one sample of each species is presented. In this figure, the R channel of RGB color space is also selected since this channel was chosen as the most relevant segmentation channel. The Carp fish is darker with the least intensity values among the fish species. On the other hand, the Tigertooth croaker is the lightest fish with the highest pixel intensity values.
Fig. 6 [Images not available. See PDF.]
Four fish varieties and 2D pixcel intensity map histograms in channel R of RGB color space. The 2D intensity values are different for each fish species.
Feature extraction and feature selection
To select the most relevant features, we considered 18 color features of six color spaces, including RGB, HSV, (L*a*b*), CMY, YIQ, YCbCr, and nine geometrical features, including Area, Perimeter, Eccentricity, Extent, Orientation, Equivalent Diameter, Max axis/Min axis, Area/Perimeter, and Roundness with six textural features including Standard deviation, Entropy, Contrast, Homogeneity, Correlation, and Energy. A total of 33 features were introduced to Weka feature selection software. To select the data, we considered two different feature section methods, including CFS and Relief_F. The defined features using both methods are presented in Table 1.
Table 1. Total and selected features using CFS and relief_F feature selection methods. Four and six features were selected using CFS and Relief_F feature selection methods out of 33 extracted features of the images.
Geometric features | Color features (Mean) | Texture features | Color features (Mean) | Geometric features | Texture features | |
|---|---|---|---|---|---|---|
Total features extracted from the images | Features selected by CFS feature selection method (CFS subset) | |||||
Area | R-(RGB) | Homogeneity | H-(HSV)1 | Perimeter2 | Correlation4 | |
Perimeter | G-(RGB) | Correlation | Area/Perimeter3 | |||
Orientation | B-(RGB) | Energy | ||||
Max axis/min axis | Gray | Standard deviation | ||||
Area/perimeter | C-(CMY) | Entropy | ||||
Roundness | M-(CMY) | Contrast | ||||
Y-(CMY) | ||||||
L*-(La*b*) | ||||||
a*-(La*b*) | ||||||
b*-(La*b*) | ||||||
Y-(YIQ) | ||||||
I-(YIQ) | Features selected by Relief-F feature selection method (Relief-F subset) | |||||
Q-(YIQ) | ||||||
Cb-(YCbCr) | H-(HSV)4 | Area/Perimeter1 | ||||
Cr-(YCbCr) | Perimeter2 | Standard deviation5 | ||||
H-(HSV) | Equivalent Dia3 | |||||
S-(HSV) | Max Dia/min Dia6 | |||||
V-(HSV) | ||||||
*The numbers on the selected features represents the order of the features by relevant method.
Fish classification
We applied artificial intelligence (AI) for fish classification. ANN and SVM were adopted for the input and output data. The results of both methods are presented and discussed in following.
Sample selection strategy
The number of input sample must meet the minimum number of data based on the classification strategy47. Three of the most commonly used strategies are based on the number of the network weights48, 49–50, the number of the input features51, 52–53, and the number of the output classes40,41. In the first rule-of-thumb strategy the minimum sample size needs to be a factor of 10 times the number of weights in the network. The second strategy considers the number of the selected features or characteristics. In this rule-of-thumb the minimum sample size for each class needs to be at least 10 to 100 times the number of the input features. In the third strategy, the sample size needs to be at least 50 to 1000 times the number of prediction classes. In Table 2 the minimum and maximum numbers of the required samples are exclusively presented and compared based on our study.
Table 2. Different strategies for selecting the minimum number of the samples in fish classification.
Sample selection straategy | Input data coefficient | Calcultion basis | Min and Max requierd samples | Min rquiered samples | Applied number of the samples |
|---|---|---|---|---|---|
1st | 10 times of the network weight No | 2 ≤ hidden layer node ≤ 25 Bias = 1 CFS input weight = 4 | (4 + 2 + 1) × 10 = 70 (4 + 3 + 1) × 10 = 80 (4 + 25 + 1) × 10 = 300 | 300 | |
2 ≤ hidden layer node ≤ 25 Bias = 1 Relief-F input weight = 6 | (6 + 2 + 1) × 10 = 90 (6 + 3 + 1) × 10 = 100 (6 + 25 + 1) × 10 = 320 | 320 | |||
2nd | 10 to 100 times of the input feature No | CFS input number = 4 | Min→ 4 × 10 = 40 Max→4 × 100 = 400 | 40 | Silver carp = 110 Carp = 83 Tigertooth = 112 Trout = 100 |
Relief-F input number = 6 | Min→ 6 × 10 = 60 Max→6 × 100 = 600 | 60 | |||
3rd | 50 to 1000 times of the prediction class No | Prediction class = 4 | Min→ 4 × 50 = 200 Max→4 × 1000 = 4000 | 200 |
Selecting these strategies is related to the possibility of sample preparation and data restriction. In this research, the second strategy is selected. Since two feature selection methods of CFS (four selected features) and Relief-F (six selected features) are applied (Table 1), the minimum number of 40 and 60 samples are necessary for classification using CFS and Relief-F methods, respectively. So, data mining and dimension reduction is so important to select the most relevant strategy or classification. In this research, 110 Silver carp, 83 Carp fish, 112 Tigertooth croaker, and 100 Trout fish samples were provided for classification.
Applying artificial neural networks (ANN)
A Multilayer Perceptron Neural Network is a Network of the feed-forward type. It uses the Backpropagation technique for learning with three layers of input, hidden, and output layers54. It has been proved that a single hidden layer is sufficient to approximate any continuous function55. We applied a three-layer perceptron in this paper. In order to classify the fish species, it is essential to apply an intelligent classification method to decrease the error and increase the final accuracy.
Based on the type of the problem (classification or prediction), the hyperbolic tangent sigmoid (Tansig) / logarithm sigmoid (Logsig) or purlin functions are applied in the output layer. In order to justify the reliability, five iterations were tried in each structure. The input data is normalized with zero mean to decrease the final error. In the next step, conventional (Tansig) and (Logsig) transfer functions were used56 to activate the weighted outputs. The following are the relationship between the tangent and logarithm sigmoid activation functions (Eq. (1) and Eq. (2)).
1
2
Applying support vector machine (SVM)
Support vector machines was initially introduced to solve the binary problems57. In SVM classification, the simplest form is the linear binary classifiers that assign a given test sample a class from one of the two possible labels58. Later, adjustments such as one-against-all and one-against-others were added to the binary classifier57. As the proposed method deals with four types of fish species, we applied a multi-class SVM for classification. Therefore, we used the one versus the rest approach. This classification method is the well-known LIBSVM59. To assign the data into the train and test sets, and also to validate them, K-fold cross-validation techniques with K = 5 was applied in this study.
A kernel function is used to map the original input space to a higher dimensional space, where the features are linearly separable60. To simplify the calculations, kernel functions are used to separate nonlinear data linearly, so an optimal boundary can be drawn, which is not necessarily a straight line32.
The linear, polynomial (poly order = 2,3), and Radial Basis Function (RBF) kernels were commonly used. To train different SVM classifiers, we considered the ‘C’ parameter ranging from {1–100} with an interval of one, and the ‘σ’ parameter ranged from {0.25–2.5} with an interval of 0.25. So, 100 ‘C’ parameters and ten ‘σ’ intervals were tried using the RBF kernel. Each of the conditions was trained four times32. Therefore, 4000 intervals were trained for the RBF kernel for each data set. Considering two sets of data, a total of 8000 intervals were tried. Using polynomial functions with three poly orders considering two data sets with four replications and 100 ‘C’ parameter, a total of 2400 replication was trained. So a total of 10,400 iterations were performed on SVM. To specify polynomials of a different order ‘d’ one can use the following functions for convolution of the dot-product61. In this Eq. (3), ‘x’, and ‘y’ are vectors in the input space, respectively.
3
A radial basis function produces a piecewise linear solution62. In Eq. (4), the radial basis function is presented61. In the following equation, ‘σ’ is the adjustable free parameter. The term is the Euclidean distance between ‘x’ and ‘y’.
4
Presenting the results and comparing criteria
As the image processing data is extracted and the most relevant features are selected, the final data will be introduced to the classification algorithm written in MATLAB software. Based on the output function (Tansig/Logsig) the data is normalized in [-1–1] and [0–1] respectively. The normalization functions are presented in the following equations (Eq. (5) and Eq. (6)):
5
6
To compare the performance of the ANN and SVM, the Mean Square Error (MSE) was calculated according to the Eq. (7)63.
7
In Eq. (7), ‘n’ is the number of the data ‘oi’ stands for the observed values, and ‘pi’ is the predicted values.
We applied sensitivity, specificity, and accuracy to present the classification results of ANN and SVM. The related terms are presented in Eq. (8), Eq. (9), and Eq. (10), respectively64,65.
8
9
10
In the mentioned equations, TP (True Positives) and TN (True Negatives) are the number of the samples that are correctly classified as group ‘A’ and other groups, respectively. FN (False Negatives) and FP (False Positive) are ‘A’ samples misclassified as other groups, and the samples of other groups are classified as ‘A’, respectively.
Cutting point determination
We considered machine vision as a robust method for fish classification and extracting cutting points. In one case, we proposed a regression relation for fish cutting determination, while in three species the cutting points were extracted using machine vision. In the flowcharts of Fig. 7, and Fig. 8 the detailed fish segmentation, feature extraction, feature selection, fish classification, and applying related cutting points are presented.
Fig. 7 [Images not available. See PDF.]
Flowchart presenting segmentation, feature extraction, and classification processes.
Fig. 8 [Images not available. See PDF.]
Fish classification and assigning exclusive cutting point determination procedure.
As mentioned above, the fish species are classified to assign related head and belly cutting lengths. These lengths are the fish cleaning machine’s input data to process four different fish species. One way is to find the fish cutting points based on the fish’s weight or length. In the following section, the fish-cutting determination points using the image processing technique is presented.
Silver carp fish
To extract the belly cutting point in Silver carp, the process is to find the proper intensity value in which the head and belly cutting points are segmented. Unlike trout fish, the pectoral fin is connected to the gill arc. So, gill arc was considered as the cutting point in Silver carp. The comparison of the pixel intensity changes along the index line for Silver carp fish and Trout fish is presented in Fig. 9.
Fig. 9 [Images not available. See PDF.]
Silver carp fish intensity profile along the index line The distince pixel intensity value changes in gill arc of Silver carp fish compared with the trout fish.
To segment the gill arc, the top half of the fish width was omitted. As the fish dimensions are different, the area was omitted based on each samples. The head and belly cutting point determination process is presented in Fig. 10. The starting point of the gill is the exact head cutting point.
Fig. 10 [Images not available. See PDF.]
Silver carp fish head and belly cutting point determination process.
As presented in Fig. 10b, the intensity values of the pixels in the head region is different from the rest of the body. Therefore, not only the gill arc but also some parts of the head will be segmented with the gill. To facilitate the head cutting determination process, a dynamic Region of Interest (ROI) was also considered to omit unnecessary parts of the head together with ensuring the area including the fish gill in all samples. The ROI was a rectangle considered from 0.1—0.3 of the fish length in the bottom-left side of the image.
Carp fish
The method to find the belly cutting point is the same as the trout fish, except that the process criterion values are different. The head and belly cutting points are presented in Fig. 11. For with distinct and separate pectoral fins, the priority is to segment the fin from the body. In Silver carp fish the visible gill arc is considered as the head cutting area.
Fig. 11 [Images not available. See PDF.]
Carp fish head and belly cutting point determination process.
Tigertooth croaker
In most of the fish processing machines only one type of the fish is processed. So, it is not possible to process different fish species in one machine. In the current study, not only different fish species are classified in this machine, but also fish of different dimensions are processed. As the fins in Tigertooth croaker are not so distinct areas in this fish type, the fish dimension and subsequently related cutting points were considered as the base data for system functioning.
Trout fish
Since in the trout fish the gill arc is so thin, so it is not possible to determine head cutting point from the arc. To find the head cutting point in trout fish the most significant region is to segment the pectoral fin near the head. The jointing point of the fin with the gill is the exact point to cut the head. In order to segment the fins, if a crest of the fish near the belly with the ratio of the fish width is cropped, it can result in an area in which the fins are considered. To reach such a region, the edge of the binary image was extracted (Fig. 12).
Fig. 12 [Images not available. See PDF.]
Head and belly cutting point segmentation trout fish.
Cutting point accuracy
In order to evaluate the cutting point extraction accuracy a line based method was developed. The method is presented in Fig. 13. In this method the tail side was considered as “0”. By moving to left side of the image the exact cutting points were pinned in both belly cutting and the head cutting points. These points were compared with the initial points of the segmented anal fin in anal cutting area and pelvic fin and gill arc in head cutting area. To precisely compare and interpret the results the sensitivity, specificity, and accuracy were calculated.
Fig. 13 [Images not available. See PDF.]
Accuracy assessment method together with head and belly cutting points and cutting length.
System performance
The system can process at least five fish per minute (approximately 12 s per fish) and accommodate three fish simultaneously, each at a different stage within the machine. Using image processing and artificial neural networks, the system detects fish type, identifies species, and segments appropriate cutting points, enabling multi-type fish processing. The computational requirements are modest, handled by a PLC, ensuring real-time operation.
Results and discussion
Background verification results
As the pure background was provided, we verified values to secure a multipurpose background. The intensity divergences of channel R in both background and fish samples are presented in Fig. 14. As shown in this figure, channels B and G face some changes along the index line (Fig. 14b). Considering the intensity changes, channel R shows a constant intensity value range in all tested samples which is almost ‘0’. Therefore, channel R guaranteed a successful fish-background segmentation.
Fig. 14 [Images not available. See PDF.]
The color intensity changes along the index line: (a) index line showing the intensity changes of RGB channel, (b and c) intensity changes in background and fish body convergence upper than center line.
Accuracy of fin position detection
Table 3 presents the accuracy of fish fin cutting point extraction based on fin segmentation. In addition to accuracy, the table also includes sensitivity and specificity.
Table 3. Results of fin segmentation accuracy in three of fish types. The other type is to show that some varieties can be classified, and the normal length ratio can be applied for cutting point extraction.
Fish type | Fin type | Sensitivity % | Specificity % | Accuracy % ± SD |
|---|---|---|---|---|
Silver carp | Anal | 94.31 | 99.96 | 98.36 ± 1.69 |
Gill arc | 99.41 | 99.65 | 99.49 ± 1.03 | |
Carp | Anal | 92.20 | 99.82 | 97.85 ± 2.92 |
Pelvic | 98.56 | 95.44 | 98.07 ± 2.93 | |
Tigertooth croaker | A type that can be processed based on the dimension ratio, subsequently after classification | |||
Trout | Anal | 95.86 | 97.12 | 96.61 ± 2.89 |
Pelvic | 99.6 | 89.5 | 97.9 ± 1.32 | |
The maximum average accuracy is related to the gill arc of silver carp. This is directly influenced by higher color intensity difference in the gill arc area. The minimum average accuracy for fin detection resulted in the anal fin of the trout fish at 96.61%. The image processing method allows for a minimum average accuracy of 96.61% by accurately detecting the cutting point and aligning it with the real cutting point. Using the accurate method not only decreases fillet loss compared to manual processing, but also outperforms automated machines that rely on length ratio-based methods. Samples of fin extraction is presented in Fig. 15.
Fig. 15 [Images not available. See PDF.]
Anal fin for belly cutting point extraction and pelvic fin and gill arc for head cutting point determination. The total length will be calculated from the belly cutting point to the head cutting point.
ANN results
The trend of MSE values in all tried structures is presented in the following section. We will also present the minimum MSE values in each structure since the minimum total error will lead to selecting the target structure. All the necessary detailed information in ANN structure selection is presented in the following section.
The ANN results related to the CFS and Relief_F feature selection methods are presented in Fig. 16. Four and six first best features among 33 features were selected using the mentioned methods, respectively. This figure shows six diagrams related to two feature selection methods with three training algorithms including Gradient Descend (GD), Levenberg Marquardt (LM), and Resilient Backpropagation (RP). In all diagrams, the MSE values are reduced by increasing the number of nodes in the ANN structure. Diagram B presents the least MSE error value using the LM training algorithm with ‘Logsig’ function in both output and hidden layers. The features were introduced to the ANN program written in MATLAB 2014a. Each of the structures was ran 40 times to certify structure performance.
Fig. 16 [Images not available. See PDF.]
The trend of the MSE by increasing the number of the hidden nodes for each training algorithm. We considered 24 nodes [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24–25], and the average of 40 replications is presented for each node.
Considering all the six diagrams and multiplying them by four different ANN structures with 40 replications in all 24 nodes of hidden layer, a total of 23,040 iterations were tried. It worth to mention that, the structures with logarithm sigmoid function in the output layers resulted in lowest MSE values in all the cases in Fig. 16. The detailed results of MSE values and classification rates are presented in Table 4 for all tried conditions.
Table 4. The results of MSE values and classification rates of all tried structures using two different data sets. The best result is observed in LM-LOG-LOG structure.
Training data set | ANN structure | Mean square error (MSE) | Average classification rate (%) | |||||
|---|---|---|---|---|---|---|---|---|
Train | Validation | Test | Total | Train | Validation | Test | ||
Relief_F | GDX-LOG-LOG | 0.0288 | 0.0439 | 0.0445 | 0.0342 | 93.65 | 89.67 | 89.35 |
GDX-LOG-TAN | 0.0500 | 0.0636 | 0.0639 | 0.0549 | 92.00 | 88.69 | 88.61 | |
GDX-TAN-LOG | 0.0233 | 0.0383 | 0.0399 | 0.0289 | 94.68 | 90.37 | 90.86 | |
GDX-TAN-TAN | 0.0358 | 0.0565 | 0.0537 | 0.0425 | 94.78 | 90.66 | 91.42 | |
LM-LOG-LOG | 0.0019 | 0.0408 | 0.0460 | 0.0166* | 99.28 | 91.93 | 90.68 | |
LM-LOG-TAN | 0.0084 | 0.0683 | 0.0809 | 0.0319 | 98.52 | 90.49 | 88.40 | |
LM-TAN-LOG | 0.0032 | 0.0395 | 0.0430 | 0.0166* | 98.77 | 91.72 | 90.96 | |
LM-TAN-TAN | 0.0056 | 0.0764 | 0.0839 | 0.0319 | 98.89 | 89.02 | 87.96 | |
RP-LOG-LOG | 0.0156 | 0.0435 | 0.0432 | 0.0253 | 95.35 | 89.84 | 89.97 | |
RP-LOG-TAN | 0.0198 | 0.0452 | 0.0516 | 0.0300 | 97.72 | 92.95 | 91.91 | |
RP-TAN-LOG | 0.0149 | 0.0475 | 0.0522 | 0.0273 | 95.56 | 89.34 | 88.46 | |
RP-TAN-TAN | 0.0187 | 0.0443 | 0.0461 | 0.0280 | 97.83 | 92.50 | 91.91 | |
CFS | GDX-LOG-LOG | 0.0452 | 0.0545 | 0.0552 | 0.0486 | 89.55 | 87.13 | 86.51 |
GDX-LOG-TAN | 0.0578 | 0.0712 | 0.0711 | 0.0625 | 87.93 | 85.12 | 84.38 | |
GDX-TAN-LOG | 0.0380 | 0.0486 | 0.0510 | 0.0422 | 91.18 | 88.48 | 87.44 | |
GDX-TAN-TAN | 0.0463 | 0.0629 | 0.0615 | 0.0518 | 91.00 | 87.34 | 87.99 | |
LM-LOG-LOG | 0.0063 | 0.0577 | 0.0580 | 0.0244 | 97.98 | 88.24 | 88.02 | |
LM-LOG-TAN | 0.0182 | 0.0633 | 0.0713 | 0.0356 | 96.08 | 88.24 | 87.62 | |
LM-TAN-LOG | 0.0053 | 0.0580 | 0.0569 | 0.0235 | 98.31 | 88.44 | 88.58 | |
LM-TAN-TAN | 0.0120 | 0.0811 | 0.0794 | 0.0358 | 97.57 | 86.97 | 87.87 | |
RP-LOG-LOG | 0.0220 | 0.0495 | 0.0479 | 0.0313 | 94.43 | 88.44 | 88.61 | |
RP-LOG-TAN | 0.0267 | 0.0478 | 0.0489 | 0.0343 | 95.64 | 91.52 | 91.51 | |
RP-TAN-LOG | 0.0228 | 0.0527 | 0.0516 | 0.0330 | 94.25 | 87.66 | 87.99 | |
RP-TAN-TAN | 0.0253 | 0.0487 | 0.0442 | 0.0326 | 95.67 | 91.23 | 92.35 | |
*The precise total MSE values for LM-LOG-LOG and LM-TAN-LOG structures are 0.01658 and 0.01662, respectively.
To illustrate the details of Fig. 16b we presented Fig. 17. As shown in this figure, the total MSE value decreases by increasing the number of the nodes in the hidden layer. Among all 24 nodes, node 23, with the least MSE value, was selected as the best node for final structure. Considering the defined ANN structure (6–23–4), it is time to select the best function among all 40 tried replications which the weights and the bias will be considered for the system function. As shown in Fig. 18, the minimum MSE error resulted in the 31st replication with the value of 0.009.
Fig. 17 [Images not available. See PDF.]
The best ANN structure with the least MSE value among all 24 different training algorithms occcured in (6–23–4) structure. Levenberg Marquardt training algorithm with logarithm sigmoid function in both hidden and output layers (LM_LOG_LOG) with 23 node in hidden layer, six inputs and four outputs resulted in the least error.
Fig. 18 [Images not available. See PDF.]
The total mean square errors in 40 replications of node 23. The least error occurred in the 31st replication with the value of 0.009.
The total classification results are presented in Table 5. As shown in this table, the sensitivity of the train data set for Tigertooth is 98.65%. The sensitivity values for the other three species are 100%. The specificity value for the trout fish is 99.51%, while this value is 100% for the other three species. The total accuracy value in the train data set is 99.62%, with 9.51 × 10–5 MSE value.
Table 5. Results of ANN classification with the corresponding MSE values and classification rate in train, validation, and test data sets. This is the Specified classification rate among 40 replications of the (6–23–4) structure with the LM_LOG_LOG training algorithm using the Relief_F data set.
Train | Validation | Test | |||||||
|---|---|---|---|---|---|---|---|---|---|
Class | SEN % | SPE % | ACC % | SEN % | SPE % | ACC % | SEN % | SPE % | ACC % |
Silver carp | 100 | 100 | 99.62 | 100 | 97.62 | 96.72 | 100 | 98.33 | 95.06 |
Carp | 100 | 100 | 91.67 | 100 | 100 | 98.46 | |||
Tigertooth | 98.65 | 100 | 91.67 | 100 | 90.00 | 98.04 | |||
Trout | 100 | 99.51 | 100 | 97.56 | 95.00 | 98.31 | |||
MSE | 9.51 × 10–5 | 2.03 × 10–2 | 2.54 × 10–2 | ||||||
SEN, SPE, and ACC are the abbreviations for sensitivity, specificity, and accuracy, respectively.
In the validation data set, the sensitivity value for both Carp and Tigertooth fish is 91.67%, while this value is 100% for the other two fish species. The specificity values of the Silver carp and Trout fish are 97.62% and 97.56%, respectively. The accuracy value for the validation data set is 96.72%, with the MSE value of 2.03 × 10–2.
Finally, in the test data set, the sensitivity value for the Tigertooth and carp fish are 90% and 95%, respectively. The sensitivity values for both Silver carp and Carp fish are 100%. The specificity values for Silver carp and Carp fish are 98.33% and 98.46%, respectively. This value for Tigertooth and Trout fish resulted in 98.04% and 98.30%, respectively. The total accuracy of test data set resulted in 95.06% with 2.54 × 10–2 MSE value. The detailed classification results are presented in Table 6.
Table 6. Confusion matrix of ANN classification in LM-LOG-LOG training algorithm with relief-F data set. A total of 405 fish samples is introduced to ANN. A minimum number of 60 samples of each type can be selected (Sect. 3.2.1).
Class | Train | Validation | Test | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
SC | CA | TI | TR | SC | CA | TI | TR | SC | CA | TI | TR | |
SC | 72 | 0 | 0 | 0 | 18 | 0 | 1 | 0 | 18 | 0 | 1 | 0 |
CA | 0 | 58 | 0 | 0 | 0 | 11 | 0 | 0 | 0 | 13 | 1 | 0 |
TI | 0 | 0 | 73 | 0 | 0 | 0 | 11 | 0 | 0 | 0 | 27 | 1 |
TR | 0 | 0 | 1 | 59 | 0 | 1 | 0 | 19 | 0 | 0 | 1 | 19 |
263 | 61 | 81 | ||||||||||
Point: The abbreviation of SC, CA, TI, and TR stand for Silver carp, Carp, Tigertooth, and Trout respectively.
Rathi et al. applied image processing and Convolutional Neural Networks for the automated classification of fish species66.
They recorded the classification accuracy of 96.29% using combined ANN and image processing. Azarmdel et al.32 reported the final results for mulberry classification with the accuracy of 100%, 98.9%, and 98.3% with calculated MSE values of 4.9 × 10–9, 3.0 × 10–3, and 3.1 × 10–3 for train, validation, and test sets, respectively. Since there was more distinction between the color values of the mulberry classes, the error values were less than those in the current study. Navotas et al.67 applied image processing and Neural Networks for fish freshness classification based on the fish eye features. They reported classification accuracies of the test data set as 100%, 93.33%, and 90% for Tilapia, Round Scad, and Milkfish, respectively. The reported values are similar to those of the current studies using artificial neural networks.
SVM results
In order to compare and select the most proper function in SVM, the best structure with the least MSE value was selected as the target function. The results of SVM values are presented in Table 7. We applied Relief_F and CFS subsets, with six and four selected features, respectively. To train the SVM, we considered RBF and Polynomial kernel functions. Eight different sigma values were assigned for the Gaussian RBF kernel function. Three orders were considered for polynomial kernel function: linear, quadratic, and cubic. Therefore, a total of 26 states were considered in SVM training for each data set. The least total MSE value resulted in the RBF kernel function with the sigma value of 2.25. Considering the range of tried ‘C’ values [1–100] with four replications in each ‘C’ value, the best classification structure was observed in the ‘C’ value of 59. The Results of SVM output in all tried kernel functions are presented in Table 7.
Table 7. Results of SVM output in all tried kernel functions. In order to compare and select the most proper function, the average MSE values of train and test sets are considered as the comparative criterion. The least MSE value was selected as the target function.
Training data set | Applied kernel functions | Mean squared error (MSE) | Classification | ||||
|---|---|---|---|---|---|---|---|
Train | Test | Total | Train | Test | |||
Relief_F subset | Polyorder | ||||||
Polynomial | 1 | 0.3454 | 0.5559 | 0.3875 | 89.34 | 83.38 | |
2 | 0.0011 | 0.2622 | 0.0533 | 99.97 | 92.29 | ||
3 | 0.0000 | 0.7077 | 0.1415 | 99.97 | 92.29 | ||
Sigma | |||||||
RBF | 0.25 | 0.0000 | 0.8246 | 0.1649 | 100 | 58.75 | |
0.5 | 0.0000 | 0.2995 | 0.0599 | 100 | 85.01 | ||
0.75 | 0.0000 | 0.5245 | 0.1049 | 100 | 83.76 | ||
1 | 0.0009 | 0.5616 | 0.1131 | 99.98 | 86.30 | ||
1.25 | 0.0034 | 0.2136 | 0.0454 | 99.94 | 93.79 | ||
1.5 | 0.0054 | 0.3580 | 0.0760 | 99.89 | 88.79 | ||
1.75 | 0.0126 | 0.2038 | 0.0508 | 99.72 | 93.6 | ||
2 | 0.0091 | 0.3581 | 0.0789 | 99.74 | 88.96 | ||
2.25 | 0.0292 | 0.0165 | 0.0267* | 99.34 | 98.59 | ||
2.5 | 0.0339 | 0.4269 | 0.1125 | 99.22 | 87.75 | ||
CFS subset | Polynomial | Polyorder | |||||
1 | 0.5074 | 0.2625 | 0.4584 | 83.10 | 87.50 | ||
2 | 0.0540 | 0.3114 | 0.1055 | 97.23 | 89.23 | ||
3 | 0.0127 | 0.4723 | 0.1046 | 99.19 | 85.06 | ||
Sigma | |||||||
RBF | 0.25 | 0.0001 | 0.3628 | 0.0726 | 99.99 | 85.01 | |
0.5 | 0.0036 | 0.1712 | 0.0371 | 99.84 | 93.83 | ||
0.75 | 0.0146 | 0.4050 | 0.0927 | 99.35 | 84.05 | ||
1 | 0.0342 | 0.4033 | 0.1080 | 98.75 | 83.74 | ||
1.25 | 0.0305 | 0.4764 | 0.1197 | 98.37 | 86.25 | ||
1.5 | 0.0881 | 0.2639 | 0.1232 | 96.99 | 91.04 | ||
1.75 | 0.1012 | 0.3808 | 0.1571 | 96.88 | 85.15 | ||
2 | 0.0683 | 0.4448 | 0.1436 | 96.86 | 85.44 | ||
2.25 | 0.1312 | 0.1371 | 0.1324 | 95.54 | 93.29 | ||
2.5 | 0.1536 | 0.2769 | 0.1783 | 94.96 | 92.80 | ||
Point: The least MSE value is marked with * in the table.
The results of the classification accuracy are presented in Table 8. As shown in this table, the sensitivity of the train data set for Silver carp is 98.88%. The sensitivity values for the other three fish types are 100%. On the other hand, the specificity value for Tigertooth is 99.58%, while this value is 100% for the other three fish types. The total classification accuracy for the train data set resulted in 99.69%, with the MSE value of 1.23 × 10–2.
Table 8. The results of the best kernel function among all tried kernels.
Fish class | Train | Test | ||||
|---|---|---|---|---|---|---|
SEN % | SPE% | ACC% | SEN % | SPE% | ACC% | |
Silver carp | 98.88 | 100 | 99.69 | 100 | 100 | 98.75 |
Carp | 100 | 100 | 100 | 98.46 | ||
Tigertooth | 100 | 99.58 | 95.65 | 100 | ||
Trout | 100 | 100 | 100 | 100 | ||
MSE | 1.23 × 10–2 | 1.25 × 10–2 | ||||
SEN, SPE, and ACC are the abbreviations for Sensitivity, Specificity, and accuracy, respectively.
The detailed classification results of each fish species is presented in the confusion matrix of Table 9. The table presents 96.65% of sensitivity value for Tigertooth fish in test data set. This values is 100% for the other three fish species. The specificity value for Carp fish resulted in 98.46%, while no fish sample fell into the other three groups, which resulted in 100% of specificity in silver Carp, Tigertooth, and Trout fish. The final accuracy resulted in 98.75%, with the MSE value of 1.25 × 10–2.
Table 9. Confusion matrix of ANN classification in LM-LOG-LOG training algorithm with Relief-F data set. A total of 405 fish samples is introduced to ANN. A minimum number of 60 samples of each type can be selected (Sect. 3.2.1).
Class | Train | Test | ||||||
|---|---|---|---|---|---|---|---|---|
SC | CA | TI | TR | SC | CA | TI | TR | |
SC | 88 | 0 | 0 | 0 | 22 | 0 | 0 | 0 |
CA | 0 | 67 | 0 | 0 | 0 | 15 | 1 | 0 |
TI | 1 | 0 | 89 | 0 | 0 | 0 | 22 | 0 |
TR | 0 | 0 | 0 | 80 | 0 | 0 | 0 | 20 |
325 | 80 | |||||||
Point: The abbreviation of SC, CA, TI, and TR stand for Silver carp, Carp, Tigertooth, and Trout respectively.
Hu et al. (2012) classified six fish species using LIBSVM algorithm. The total classification accuracy values for each of the species were 98.88%, 87.77%, 95.55%, 98.88, % 97.77%, and 96.66% with overall classification accuracy of 95.95%68. Azarmdel et al. reported the classification error of 9 × 10–3 and 9 × 10–3 for train and test sets, respectively. In their research, the corresponding accuracies were 99.78% and 99.12% for train and test sets, respectively, using SVM classification32. Rohani et al. applied SVM to detect live and dead rainbow trout fish egg. They reported the mean accuracy values of 100%, and 99.57% for train and test data sets, respectively31. By comparing the results of the current study with other cases, the accuracy values are similar to the other studies especially in fish classification.
Recent advancements in automated fish processing have leveraged machine learning and vision technologies to improve cutting precision and efficiency. For instance, “Line Laser Scanning Combined with Machine Learning for Fish Head Cutting Position Identification” by Zhang et al. demonstrated accurate head cutting point detection using 3D surface data and LSTM models, achieving a high R2 of 0.948. However, this approach focuses solely on single-point head detection and depends on specialized 3D laser scanning hardware and complex preprocessing69. Similarly, “Machine Vision Based Fish Cutting Point Prediction for Target Weight” by Jang and Se achieved a mean error rate of about 3% in predicting cutting points based on 3D fish models and target weight, but it also relies on computationally intensive 3D reconstruction and processing, limiting its industrial scalability. Furthermore, the study “Study on Visual Localization and Evaluation of Automatic Freshwater Fish Cutting System Based on Deep Learning Framework” by Peng et al. utilized deep learning-based segmentation networks such as ICNet, achieving a segmentation accuracy of 99.01%, MIoU of 82.50%, and image processing time of 15.25 ms for automatic head and tail cutting. Despite their accuracy, these systems primarily target single or limited cutting points and lack integrated classification or species adaptability. In contrast, the proposed AI-based 2D image processing system integrates species classification and multi-point cutting determination (head and belly) within a single automated framework. This enables species-specific, precise, and high-speed fish processing without the need for 3D reconstruction or specialized equipment, thereby enhancing accuracy, efficiency, flexibility, and industrial applicability compared to the aforementioned 3D or segmentation-based methods70.
Based on the presented results, the fish species were classified in the acceptable range. Finally, as the fish species are classified, the fin segmentation (cutting point determination), and functioning algorithms will be applied to process fish of different sizes and species in the intelligent integrated fish cleaning machine. Figure 19 shows the machine from different angles, illustrating how customers can feed fish into the system, where the corresponding cutting algorithms are applied after fish classification. The current system has been trained to recognize a specific set of fish species. In cases where an untrained or unknown species is encountered, a rejection mechanism could be implemented to prevent automatic processing. This approach would help ensure operational safety and prevent errors, while maintaining the integrity and reliability of the system. Future work may include uncertainty quantification and adaptive learning techniques to expand the range of species the system can handle safely. This study focuses on automation, machine vision, and classification. Food safety regulations, maintenance, and cost analysis were not addressed and are noted as limitations and areas for future work.
Fig. 19 [Images not available. See PDF.]
Intelligent fish procesing machine.
Conclusion
Fish processing systems facilitate fish cleaning steps. Different fish species are cleaned in specific ways. In order to upgrade a machine to process different fish species, we applied a multipurpose backlight illuminated pure blue background to guarantee fish segmentation in all species. Among the separated color channels, the blue background changes to pure black to guarantee fish segmentation. Artificial Intelligence was applied to upgrade the trout fish processing machine into an intelligent system capable of detecting, classifying and processing different fish species. All the features were extracted as soon as the frames were captured and saved. The best features of the two feature selection methods were chosen for system training. Also, the ANN and SVM were applied to investigate the best classification algorithm. The final results presented acceptable classification using both algorithms. Considering the least classification MSE, SVM presented the best classification accuracy. Finally, as the fish are classified the related cutting point determination algorithm will be applied based on fish species. Since this research focuses on four common fish species, the cutting point determination process in backlighted pure blue background can be applied for other fish species in case the new species are trained by artificial intelligence.
Acknowledgements
The authors would like to acknowledge the Tabriz Fish Breeding and Supply Center, Iran, for their kind cooperation in this research.
Author contributions
H.A. and S.S. M. designed the machine, measured the data, and also wrote a draft version of the manuscript; A.J. and A.R.F. helped in the data analysis and proposed the idea; A.R.M. improved the idea and edited the draft version of the manuscript.
Funding
No funding was received for conducting this study.
Data availability
The data and codes from this study are available upon reasonable request from the corresponding author, Dr. Seyed Saeid Mohtasebi.
Declarations
Competing interests
The authors declare no competing interests.
Ethical approval
Ethics approval was not required for this research.
List of symbols
σAdjustable free parameter
x and yVectors in the input space
Euclidean distance between x and y
nNumber of the data
oiObserved values
piPredicted values
Abbreviations
AIArtificial intelligence
SVMSupport vector machine
SVCSupport vector classifier
ACEAutomatic color enhancement
TNTrue negatives
FPFalse positive
GDGradient descend
RPResilient backpropagation
ANNArtificial neural networks
MSEMean square error
RBFRadial basis function
TPTrue positives
FNFalse negatives
ROIRegion of interest
LMLevenberg marquardt
MVMachine vision
Publisher’s note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
1. Qu, H; Wang, GG; Li, Y; Qi, X; Zhang, M. ConvFishNet: An efficient backbone for fish classification from composited underwater images. Inf. Sci. Ny.; 2024; 679, 121078. [DOI: https://dx.doi.org/10.1016/j.ins.2024.121078]
2. Lines, JA et al. An automatic image-based system for estimating the mass of free-swimming fish. Comput. Electron. Agric.; 2001; 31, pp. 151-168. [DOI: https://dx.doi.org/10.1016/S0168-1699(00)00181-2]
3. Kohler, A; Skaga, A; Hjelme, G; Skarpeid, HJ. Sorting salted cod fillets by computer vision: A pilot study. Comput. Electron. Agric.; 2002; 36, pp. 3-16. [DOI: https://dx.doi.org/10.1016/S0168-1699(02)00068-6]
4. Atienza-Vanacloig, V; Andreu-García, G; López-García, F; Valiente-González, JM; Puig-Pons, V. Vision-based discrimination of tuna individuals in grow-out cages through a fish bending model. Comput. Electron. Agric.; 2016; 130, pp. 142-150. [DOI: https://dx.doi.org/10.1016/j.compag.2016.10.009]
5. Li, X; Hao, Y; Zhang, P; Akhter, M; Li, D. A novel automatic detection method for abnormal behavior of single fish using image fusion. Comput. Electron. Agric.; 2022; 203, 107435. [DOI: https://dx.doi.org/10.1016/j.compag.2022.107435]
6. Zhou, J et al. Leveraging the feature distribution calibration and data augmentation for few-shot classification in fish counting. Comput. Electron. Agric.; 2023; 212, 108151. [DOI: https://dx.doi.org/10.1016/j.compag.2023.108151]
7. Saberioon, MM; Cisar, P. Automated multiple fish tracking in three-dimension using a structured light sensor. Comput. Electron. Agric.; 2016; 121, pp. 215-221. [DOI: https://dx.doi.org/10.1016/j.compag.2015.12.014]
8. Misimi, E; Øye, ER; Sture, Ø; Mathiassen, JR. Robust classification approach for segmentation of blood defects in cod fillets based on deep convolutional neural networks and support vector machines and calculation of gripper vectors for robotic processing. Comput. Electron. Agric.; 2017; 139, pp. 138-152. [DOI: https://dx.doi.org/10.1016/j.compag.2017.05.021]
9. Hernández-Ontiveros, JM et al. Development and implementation of a fish counter by using an embedded system. Comput. Electron. Agric.; 2018; 145, pp. 53-62. [DOI: https://dx.doi.org/10.1016/j.compag.2017.12.023]
10. Muñoz-Benavent, P et al. Enhanced fish bending model for automatic tuna sizing using computer vision. Comput. Electron. Agric.; 2018; 150, pp. 52-61. [DOI: https://dx.doi.org/10.1016/j.compag.2018.04.005]
11. Rauf, HT et al. Visual features based automated identification of fish species using deep convolutional neural networks. Comput. Electron. Agric.; 2019; 167, 105075. [DOI: https://dx.doi.org/10.1016/j.compag.2019.105075]
12. Fu, J; He, Y; Cheng, F. Intelligent cutting in fish processing: Efficient, high-quality, and safe production of fish products. Food Bioprocess. Technol.; 2023; 2023,
13. Yumnam, M; Gopalakrishnan, K; Dhua, S; Srivastava, Y; Mishra, P. A comprehensive review on smartphone-based sensor for fish spoilage analysis: Applications and limitations. Food Bioprocess Technol.; 2024; 17, pp. 4575-4597. [DOI: https://dx.doi.org/10.1007/s11947-024-03391-3]
14. Du, Z et al. Feature fusion strategy and improved GhostNet for accurate recognition of fish feeding behavior. Comput. Electron. Agric.; 2023; 214, 108310. [DOI: https://dx.doi.org/10.1016/j.compag.2023.108310]
15. Yin, Y et al. CBFW-YOLOv8: Automated recognition method for fish body surface diseases in recirculating aquaculture systems. Comput. Electron. Agric.; 2025; 236, 110612. [DOI: https://dx.doi.org/10.1016/j.compag.2025.110612]
16. Yu, J et al. SDYOLO-Tracker: An efficient multi-fish hypoxic behavior recognition and tracking method. Comput. Electron. Agric.; 2025; 232, 110079. [DOI: https://dx.doi.org/10.1016/j.compag.2025.110079]
17. Kavdir, I; Guyer, DE. Comparison of artificial neural networks and statistical classifiers in apple sorting using textural features. Biosyst. Eng.; 2004; 89, pp. 331-344. [DOI: https://dx.doi.org/10.1016/j.biosystemseng.2004.08.008]
18. Li, X; He, Y. Discriminating varieties of tea plant based on Vis/NIR spectral characteristics and using artificial neural networks. Biosyst. Eng.; 2008; 99, pp. 313-321. [DOI: https://dx.doi.org/10.1016/j.biosystemseng.2007.11.007]
19. Zhang, D; Lee, DJ; Zhang, M; Tippetts, BJ; Lillywhite, KD. Object recognition algorithm for the automatic identification and removal of invasive fish. Biosyst. Eng.; 2016; 145, pp. 65-75. [DOI: https://dx.doi.org/10.1016/j.biosystemseng.2016.02.013]
20. Grift, TE; Zhao, W; Momin, MA; Zhang, Y; Bohn, MO. Semi-automated, machine vision based maize kernel counting on the ear. Biosyst. Eng.; 2017; 164, pp. 171-180. [DOI: https://dx.doi.org/10.1016/j.biosystemseng.2017.10.010]
21. Teimouri, N et al. On-line separation and sorting of chicken portions using a robust vision-based intelligent modelling approach. Biosyst. Eng.; 2018; 167, pp. 8-20. [DOI: https://dx.doi.org/10.1016/j.biosystemseng.2017.12.009]
22. Yu, C et al. An intelligent measurement scheme for basic characters of fish in smart aquaculture. Comput. Electron. Agric.; 2023; 204, 107506. [DOI: https://dx.doi.org/10.1016/j.compag.2022.107506]
23. Qian, Y; Liu, J; Liu, L; Wang, X; Zheng, J. Recreational fisheries encountering flagship species: Current conditions. Trend Forecast. Recommendations. Fishes; 2025; 10, 337.
24. Leung, P; Tran, LT. Predicting shrimp disease occurrence: Artificial neural networks vs. logistic regression. Aquaculture; 2000; 187, pp. 35-49. [DOI: https://dx.doi.org/10.1016/S0044-8486(00)00300-8]
25. Costa, C; Scardi, M; Vitalini, V; Cataudella, S. A dual camera system for counting and sizing Northern Bluefin Tuna (Thunnus thynnus; Linnaeus, 1758) stock, during transfer to aquaculture cages, with a semi automatic Artificial Neural Network tool. Aquaculture; 2009; 291, pp. 161-167. [DOI: https://dx.doi.org/10.1016/j.aquaculture.2009.02.013]
26. Bermejo-Poza, R et al. The effect of intermittent feeding on the pre-slaughter fasting response in rainbow trout. Aquaculture; 2015; 443, pp. 24-30. [DOI: https://dx.doi.org/10.1016/j.aquaculture.2015.03.007]
27. Taheri-Garavand, A; Fatahi, S; Banan, A; Makino, Y. Real-time nondestructive monitoring of Common Carp Fish freshness using robust vision-based intelligent modeling approaches. Comput. Electron. Agric.; 2019; 159, pp. 16-27. [DOI: https://dx.doi.org/10.1016/j.compag.2019.02.023]
28. Ranjan, R; Sharrer, K; Tsukuda, S; Good, C. Effects of image data quality on a convolutional neural network trained in-tank fish detection model for recirculating aquaculture systems. Comput. Electron. Agric.; 2023; 205, 107644. [DOI: https://dx.doi.org/10.1016/j.compag.2023.107644]
29. Mohammadi Lalabadi, H; Sadeghi, M; Mireei, SA. Fish freshness categorization from eyes and gills color features using multi-class artificial neural network and support vector machines. Aquac. Eng.; 2020; 90, 102076. [DOI: https://dx.doi.org/10.1016/j.aquaeng.2020.102076]
30. Cheng, JH; Sun, DW. Data fusion and hyperspectral imaging in tandem with least squares-support vector machine for prediction of sensory quality index scores of fish fillet. LWT Food Sci. Technol.; 2015; 63, pp. 892-898.1:CAS:528:DC%2BC2MXntlWnsr4%3D [DOI: https://dx.doi.org/10.1016/j.lwt.2015.04.039]
31. Rohani, A; Taki, M; Bahrami, G. Application of artificial intelligence for separation of live and dead rainbow trout fish eggs. Artif. Intell. Agric.; 2019; 1, pp. 27-34.
32. Azarmdel, H; Jahanbakhshi, A; Mohtasebi, SS; Muñoz, AR. Evaluation of image processing technique as an expert system in mulberry fruit grading based on ripeness level using artificial neural networks (ANNs) and support vector machine (SVM). Postharvest Biol. Technol.; 2020; 166, 111201. [DOI: https://dx.doi.org/10.1016/j.postharvbio.2020.111201]
33. Deka, J et al. Automated freshwater fish species classification using deep CNN. JIEIB; 2023; 104, pp. 603-621.2023JIEIB.104.603D
34. Gong, B; Dai, K; Shao, J; Jing, L; Chen, Y. Fish-TViT: A novel fish species classification method in multi water areas based on transfer learning and vision transformer. Heliyon; 2023; 9, e17117. [DOI: https://dx.doi.org/10.1016/j.heliyon.2023.e16761]
35. Kumar, P; Shukla, PK. Hybrid transformer-CNN model for precise Fish segmentation, localization, and species classification in aquaculture. J. Integr. Sci. Technol.; 2025; 13, pp. 1134-1134. [DOI: https://dx.doi.org/10.62110/sciencein.jist.2025.v13.1134]
36. Hamzaoui, M; Ould-Elhassen Aoueileyine, M; Romdhani, L; Bouallegue, R. An improved deep learning model for underwater species recognition in aquaculture. Fishes; 2023; 8, 514. [DOI: https://dx.doi.org/10.3390/fishes8100514]
37. Einarsdóttir, H; Guðmundsson, B; Ómarsson, V. Automation in the fish industry. Anim. Front.; 2022; 12, pp. 32-39. [PubMed: https://www.ncbi.nlm.nih.gov/pubmed/35505840][PubMedCentral: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC9056042][DOI: https://dx.doi.org/10.1093/af/vfac020]
38. Jareño, J; Bárcena-González, G; Castro-Gutiérrez, J; Cabrera-Castro, R; Galindo, PL. Enhancing fish auction with deep learning and computer vision: Automated caliber and species classification. Fishes; 2024; 9, 133. [DOI: https://dx.doi.org/10.3390/fishes9040133]
39. Jang, Y; Seo, YS. Machine vision based fish cutting point prediction for target weight. Comput. Mater. Contin.; 2023; 75, pp. 2247-2263.
40. Cho, J., Lee, K., Shin, E., Choy, G. & Do, S. How much data is needed to train a medical image deep learning system to achieve necessary high accuracy? (2015).
41. Ciresan, DC; Meier, U; Schmidhuber, J. Transfer learning for Latin and Chinese characters with deep neural networks. Proc. Int. Jt. Conf. Neural Networks; 2012; [DOI: https://dx.doi.org/10.1109/IJCNN.2012.6252544]
42. CAD (Computer Aided Design) with CATIA V5| Dassault Systèmes. https://www.3ds.com/products/catia/catia-v5.
43. MATLAB & Simulink Jobs | Natick, Massachusetts - MATLAB & Simulink. https://www.mathworks.com/company/jobs/resources/locations/us-natick.html.
44. Otsu, N. Threshold selection method from gray-level histograms. IEEE Trans. Syst. Man. Cybern; 1979; SMC-9, pp. 62-66.1979ITSMC..9..62O [DOI: https://dx.doi.org/10.1109/TSMC.1979.4310076]
45. Azarmdel, H; Mohtasebi, SS; Jafari, A; Rosado Muñoz, A. Developing an orientation and cutting point determination algorithm for a trout fish processing system using machine vision. Comput. Electron Agric.; 2019; 162, pp. 613-629. [DOI: https://dx.doi.org/10.1016/j.compag.2019.05.005]
46. Azarmdel, H. Design, fabrication and evaluation of an online intelligent machine for trout beheading and gutting. https://hdl.handle.net/10550/78995 (2021).
47. Alwosheel, A; van Cranenburgh, S; Chorus, CG. Is your dataset big enough? Sample size requirements when using artificial neural networks for discrete choice analysis. J. Choice Model.; 2018; 28, pp. 167-182. [DOI: https://dx.doi.org/10.1016/j.jocm.2018.07.002]
48. Abu-Mostafa, YS; YaserAbu-Mostafa, SYS. Hints. Neural Comput.; 1995; 671, pp. 639-671. [DOI: https://dx.doi.org/10.1162/neco.1995.7.4.639]
49. Baum, EB; Haussler, D. What size net gives valid generalization?. Neural Comput.; 1989; 1, pp. 151-160. [DOI: https://dx.doi.org/10.1162/neco.1989.1.1.151]
50. Haykin, S; Thomson, DJ; Reed, JH. Spectrum sensing for cognitive radio. Proc. IEEE; 2009; 97, pp. 849-877.2009IEEEP.97.849H [DOI: https://dx.doi.org/10.1109/JPROC.2009.2015711]
51. Jain, AK; Chandrasekaran, B. 39 Dimensionality and sample size considerations in pattern recognition practice. Handb. Stat.; 1982; 2, pp. 835-855. [DOI: https://dx.doi.org/10.1016/S0169-7161(82)02042-2]
52. Kavzoglu, T; Mather, PM. The use of backpropagating artificial neural networks in land cover classification. Int. J. Remote Sens.; 2003; 24, pp. 4907-4938. [DOI: https://dx.doi.org/10.1080/0143116031000114851]
53. Raudys, Š; Jain, AK. Small sample size problems in designing artificial neural networks. Mach. Intell. Pattern Recognit.; 1991; 11, pp. 33-50.
54. Desai, M; Shah, M. An anatomization on breast cancer detection and diagnosis employing multi-layer perceptron neural network (MLP) and convolutional neural network (CNN). Clin. eHealth; 2021; 4, pp. 1-11. [DOI: https://dx.doi.org/10.1016/j.ceh.2020.11.002]
55. Cybenko, G. Approximation by superpositions of a sigmoidal function. Math. Control. Signals Syst.; 1989; 2, pp. 303-314.1015670 [DOI: https://dx.doi.org/10.1007/BF02551274]
56. Martí, P et al. Artificial neural networks vs. gene expression programming for estimating outlet dissolved oxygen in micro-irrigation sand filters fed with effluents. Comput. Electron. Agric.; 2013; 99, pp. 176-185.2013ecmc.book...M [DOI: https://dx.doi.org/10.1016/j.compag.2013.08.016]
57. Knerr, S; Personnaz, L; Dreyfus, G. Single-layer learning revisited: A stepwise procedure for building and training a neural network. Neurocomputing; 1990; [DOI: https://dx.doi.org/10.1007/978-3-642-76153-9_5]
58. Mountrakis, G; Im, J; Ogole, C. Support vector machines in remote sensing: A review. ISPRS J. Photogramm. Remote Sens.; 2011; 66, pp. 247-259.2011JPRS..66.247M [DOI: https://dx.doi.org/10.1016/j.isprsjprs.2010.11.001]
59. Chang, C. C. & Lin, C. J. LIBSVM. ACM Trans. Intell. Syst. Technol.2, (2011).
60. Muhammad, G. Date fruits classification using texture descriptors and shape-size features. Eng. Appl. Artif. Intell.; 2015; 37, pp. 361-367. [DOI: https://dx.doi.org/10.1016/j.engappai.2014.10.001]
61. Cortes, C; Vapnik, V. Support-vector networks. Mach. Learn.; 1995; 1995,
62. Hooshmand Moghaddam, V; Hamidzadeh, J. New hermite orthogonal polynomial kernel and combined kernels in support vector machine classifier. Pattern Recognit.; 2016; 60, pp. 921-935.2016PatRe.60.921H [DOI: https://dx.doi.org/10.1016/j.patcog.2016.07.004]
63. Emamgholizadeh, S; Parsaeian, M; Baradaran, M. Seed yield prediction of sesame using artificial neural network. Eur. J. Agron.; 2015; 68, pp. 89-96. [DOI: https://dx.doi.org/10.1016/j.eja.2015.04.010]
64. Teimouri, N; Omid, M; Mollazade, K; Rajabipour, A. A novel artificial neural networks assisted segmentation algorithm for discriminating almond nut and shell from background and shadow. Comput. Electron. Agric.; 2014; 105, pp. 34-43. [DOI: https://dx.doi.org/10.1016/j.compag.2014.04.008]
65. Mjahad, A; Rosado-Muñoz, A; Bataller-Mompeán, M; Francés-Víllora, JV; Guerrero-Martínez, JF. Ventricular fibrillation and tachycardia detection from surface ECG using time-frequency representation images as input dataset for machine learning. Comput. Methods Programs Biomed.; 2017; 141, pp. 119-127.1:STN:280:DC%2BC1czhtVGlsw%3D%3D [PubMed: https://www.ncbi.nlm.nih.gov/pubmed/28241963][DOI: https://dx.doi.org/10.1016/j.cmpb.2017.02.010]
66. Rathi, M., Malik, A., Varshney, D., Sharma, R. & Mendiratta, S. Sentiment analysis of tweets using machine learning approach. in 2018 11th Int. Conf. Contemp. Comput. IC3 2018 (2018) https://doi.org/10.1109/IC3.2018.8530517.
67. Navotas, IC et al. Fish identification and freshness classification through image processing using artificial neural network. ARPN J. Eng. Appl. Sci.; 2018; 13, pp. 4912-4922.
68. Hu, J et al. Fish species classification by color, texture and multi-class support vector machine using computer vision. Comput. Electron. Agric.; 2012; 88, pp. 133-140. [DOI: https://dx.doi.org/10.1016/j.compag.2012.07.008]
69. Zhang, X et al. Line laser scanning combined with machine learning for fish head cutting position identification. Foods; 2023; 12, 4518. [PubMed: https://www.ncbi.nlm.nih.gov/pubmed/38137322][PubMedCentral: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC10742530][DOI: https://dx.doi.org/10.3390/foods12244518]
70. Peng, X; Chen, Y; Fu, D; Jiang, Y. Study on visual localization and evaluation of automatic freshwater fish cutting system based on deep learning framework. Int. J. Food Prop.; 2024; 27, pp. 516-531. [DOI: https://dx.doi.org/10.1080/10942912.2024.2330503]
© The Author(s) 2025. This work is published under http://creativecommons.org/licenses/by-nc-nd/4.0/ (the "License"). Notwithstanding the ProQuest Terms and Conditions, you may use this content in accordance with the terms of the License.