Biology 11 01727
Biology 11 01727
Biology 11 01727
Article
KRS-Net: A Classification Approach Based on Deep Learning
for Koi with High Similarity
Youliang Zheng 1 , Limiao Deng 2 , Qi Lin 3 , Wenkai Xu 1 , Feng Wang 4 and Juan Li 1, *
1 College of Mechanical and Electrical Engineering, Qingdao Agricultural University, Qingdao 266109, China
2 College of Science and Information Science, Qingdao Agricultural University, Qingdao 266109, China
3 Key Laboratory of Cultivation and High-Value Utilization of Marine Organisms in Fujian Province,
Xiamen 361013, China
4 College of Marine Science and Engineering, Qingdao Agricultural University, Qingdao 266109, China
* Correspondence: [email protected]
koi for biodiversity. The culture of ornamental fish has a long history. As a representative
ornamental fish, koi have become increasingly popular since the 1980s. Koi are known
as “living gemstones in water”, “geomantic fish”, and “lucky fish” due to their beautiful
physique, bright colors, and elegant swimming posture [2]. In the traditional biological
breeding process, various genes are selectively gathered to form a new variety through
cross-breeding, which can increase species diversity [3]. In the same way, the varieties of koi
have gradually evolved into Tancho, Hikariutsurimono, Utsurimono, Bekko, Kawarimono,
Taisho Sanshoku, Showa Sanshoku, Asagi, Kohaku, Hikarimoyomono, Koromo, Kinginrin,
and Ogon, for a total of thirteen varieties [4,5]. Koi may produce different varieties of
offspring through cross-breeding, and each female lays about 300,000 eggs, with an average
survival rate of more than 80%. Koi are generally sorted three months after hatching, which
is labor-intensive [6]. Additionally, the prices of different varieties of koi greatly vary, so
classifying koi is an indispensable step in koi breeding, screening, and grade sorting.
With the improvement in breeding technology and the expansion of breeding scales [7],
the market value of koi is increasing. As the price and ornamental value of different koi
varieties greatly vary, the screening and grade sorting of koi have become more and more
important [8]. However, regardless of variety screening or grade sorting, they both involve
classification problems [9,10]. Therefore, many scholars have attached great importance
to the research of classification problems for koi varieties. For example, Peng et al. [11]
performed the division of Kohaku, Taisho, and Showa varieties, and proposed a four-
stage classification method for koi. Song et al. [12] divided three varieties of koi from
the perspectives of color, pattern, and lineage. The classification of koi varieties is still
manually performed at present, which depends on those with skilled experienced with
koi. The traditional manual classification method for koi has disadvantages, such as high
subjectivity, low efficiency, and high work intensity. More importantly, classification errors
often occur due to the different skills of sorting workers and the subjectivity of classification.
Especially when there is high similarity between some varieties of koi, such as Taisho and
Showa, misclassification often occurs. To solve the difficulties caused by traditional manual
classification, it is necessary to research intelligent classification approaches for koi varieties.
With the development of computer technology, artificial intelligence, and improve-
ments in hardware performance, deep learning technology has rapidly developed [13–15].
Recognition technology based on deep learning has especially received attention and
been applied in agriculture [16,17], fisheries [18–20], medical treatment [21–23], and other
fields [24–27]. In the field of fisheries, the existing studies have mainly focused on deter-
mining the freshness of marine animals, intelligently recognizing marine organisms, and
classifying economic marine organisms. For example, Lu et al. [28] proposed a method
of automatically recognizing common tuna and saury based on deep learning, and the
final test accuracy of this method was 96.24%. Rauf et al. [29] proposed a fish species
recognition framework based on a convolutional neural network, and the classification ac-
curacy of cultured fish (e.g., grass carp, carp, and silver carp) was 92%. Knausgrd et al. [30]
proposed a temperate fish detection and classification method based on transfer learning.
The classification network was trained on a public dataset for fish (Fish4Knowledge), and
the species classification accuracy was 99.27%. From the above research, it is possible to
classify koi based on image processing and deep learning technology. The above studies
and their related references all discussed methods of classifying underwater animals with
high similarity among species.
To the best of our knowledge, there is currently no study on intelligent classification
methods for underwater animals with high similarity between varieties. Motivated by
the above discussion, we studied a classification approach for underwater animals with
high similarity among varieties. The main contributions of this study are as follows: (1) A
dataset was created for thirteen kinds of koi. To the best of our knowledge, no koi dataset
has yet been reported. (2) A classification problem with high similarity was proposed for
underwater animals, and a KRS-Net network was constructed to solve this classification
problem for koi with high similarity among varieties. (3) The proposed network could
similarity among varieties. The main contributions of this study are as follows: (1) A da-
taset was created for thirteen kinds of koi. To the best of our knowledge, no koi dataset
Biology 2022, 11, 1727 has yet been reported. (2) A classification problem with high similarity was proposed3 of for16
underwater animals, and a KRS-Net network was constructed to solve this classification
problem for koi with high similarity among varieties. (3) The proposed network could
extract deeper koi feature information, and could further improve the classification accu-
extract deeper koi feature information, and could further improve the classification accuracy
racy by fusing
by fusing the advantages
the advantages of support
of support vector
vector machine
machine (SVM) (SVM)
and aand a fully
fully connected
connected layer.
layer. The superiority of this proposed approach was verified through comparison
The superiority of this proposed approach was verified through comparison experiments exper-
iments with mainstream
with mainstream networks
networks (AlexNet
(AlexNet [31], VGG16
[31], VGG16 [32], [32], GoogLeNet
GoogLeNet [33],[33], ResNet101
ResNet101 [34],
[34], and DenseNet201
and DenseNet201 [35]). [35]).
2.2.Materials
Materialsand
andMethods
Methods
2.1.Image
2.1. ImageAcquisition
Acquisitionand
andData
DataAugmentation
Augmentation
Inthis
In thisstudy,
study, thirteen kinds
kinds of
ofkoi
koiwere
wereselected
selectedasasthe
theresearch
researchobjects, and
objects, and569 original
569 orig-
images of koi with a resolution of 2400 × 1600 were collected using a digital
inal images of koi with a resolution of 2400 × 1600 were collected using a digital cam- camera (EOS
200D, Canon, Tokyo, Japan). Figure 1 shows representative koi images
era(EOS 200D, Canon, Japan). Figure 1 shows representative koi images of the thirteen of the thirteen
varieties. For
varieties. Forthe
theconvenience
convenienceofofdrawing
drawingand
andcharting,
charting,thethe Hikariutsurimono,
Hikariutsurimono,Taisho
Taisho
Sanshoku, Showa
Sanshoku, Showa Sanshoku,
Sanshoku,and andHikarimoyomono
Hikarimoyomono koi varieties are abbreviated
koi varieties as Hikariu,
are abbreviated as
Taisho, Showa,
Hikariu, Taisho, and
Showa,Hikarim, respectively.
and Hikarim, The dataset
respectively. The in this study
dataset was
in this taken
study wasfrom the
taken
actual
from breeding
the data of koi,
actual breeding and
data of the
koi,method
and theused in this
method usedstudy willstudy
in this also be applied
will also betoap-
the
actual koi breeding and production.
plied to the actual koi breeding and production.
Figure
Figure 2.
2. Effect
Effectof
ofdata
data augmentation.
augmentation.
The
The dataset
dataset had
had1464
1464images
images after
afterimage
imageaugmentation,
augmentation, including
including 1027
1027 images
images in in the
the
training
training set,
set, 294
294 images
images in
in the
the verification
verification set,
set, and
and 143
143 images
images in
in the
the test
test set.
set. Because
Because the the
number of
number of images
images of
of Showa
Showa andand Kohaku
Kohaku was
was sufficient,
sufficient, we
we did
did not
not perform
perform additional
additional
data augmentation
data augmentation processing.
processing. TheThe detailed
detailednumber
numberofofimages
imagesfor
foreach
eachvariety
varietyis is
shown
shown in
Table 1.
in Table 1.
Table 1.
Table Numbers of
1. Numbers of images
images of
of thirteen
thirteen koi
koi varieties.
varieties.
Figure3.3. Schematic
Figure Schematicdiagram
diagramof
ofthe
theproposed
proposedKRS-Net.
KRS-Net.
Based on
Based onthetheAlexNet
AlexNetframework,
framework,the themain
mainstructural
structuralchanges
changeswere
wereas asfollows:
follows:
(1)Replace
(1) Replacethe the original
original local
local response
response normalization
normalization(LRN) (LRN)withwith batch
batch normalization
normalization
(BN).
(BN). Both
Both the
the LRN
LRN layer
layer and
and BN BN layer
layer can
can improve
improve the the network
network generalization
generalization ability
ability
and
and training
training speed,
speed, but
but the
the performance
performance of of the
the latter
latter isisusually
usuallysuperior
superior[37]. [37].Compared
Compared
with
with the
the LRN
LRN layer,
layer,the
theBN BNlayer
layer can
can adapt
adapt to to aalarger
largerlearning
learning rate
rate totofurther
further improve
improve
the
the network
network training
training speed.
speed. At At the
the same
same time,
time, itit improves
improves the the effect
effect of
of the
the regularization
regularization
strategy,
strategy,reduces
reducesthe thedependence
dependenceon onthe
thedropout
dropoutlayer,layer,andand improves
improves thethe anti-disturbance
anti-disturbance
ability.
ability.
(2)
(2) Add
Add eight
eight residual
residual blocks
blocks totothe
thenetwork
networkstructure.
structure. TheThe skip
skip connection
connection in in the
the
residual block can overcome the problem of gradient vanishing
residual block can overcome the problem of gradient vanishing caused by increasing caused by increasing depth
in the network.
depth Therefore,
in the network. multiple
Therefore, residual
multiple blocks blocks
residual were introduced to increase
were introduced the depth
to increase the
of the network and extract deeper koi feature information. In addition,
depth of the network and extract deeper koi feature information. In addition, the difficulty the difficulty of
extracting more subtle koi characteristics is
of extracting more subtle koi characteristics is reduced. reduced.
(3)
(3)Fuse
FuseSVMSVMwithwithfully
fullyconnected
connected (FC)
(FC)layer
layerto to
improve
improve accuracy. Inspired
accuracy. Inspiredby [38], we
by [38],
replaced the softmax layer with SVM to achieve higher generalization
we replaced the softmax layer with SVM to achieve higher generalization model perfor- model performance,
thus
mance,improving the accuracy
thus improving of koi of
the accuracy variety classification.
koi variety To improve
classification. To improve the the
accuracy
accuracy of
classification, the fused SVM with FC was added to the network
of classification, the fused SVM with FC was added to the network framework to realize framework to realize
classification
classification of the softmax
of the softmaxlayer.layer.TheThe fused
fused SVMSVM withwith
FC FC transforms
transforms the nonlinear
the nonlinear clas-
classification problem into a linear classification problem
sification problem into a linear classification problem in high dimensional spacein high dimensional space by
by im-
improving the spatial dimensions of the deep feature information
proving the spatial dimensions of the deep feature information extracted from the FC extracted from the FC
layer.
layer.Therefore,
Therefore,the thecomplex
complexprocessing
processing process
processof of feature
featureinformation
information is is simplified,
simplified, and
and
the classification accuracy for koi is further improved.
the classification accuracy for koi is further improved.
The information flow of KRS-Net is as follows: First, thirteen kinds of koi images
The information flow of KRS-Net is as follows: First, thirteen kinds of koi images
were input into the network after data balance. Second, the koi feature information images
were input into the network after data balance. Second, the koi feature information images
was extracted by convolution and pooling, and the extracted feature information was
was extracted by convolution and pooling, and the extracted feature information was
transmitted to the FC layer. The loss rate was reduced by a gradient descent algorithm,
transmitted to the FC layer. The loss rate was reduced by a gradient descent algorithm,
and the feature vectors of the FC layer were imported into SVM. Finally, the optimal
and the feature vectors of the FC layer were imported into SVM. Finally, the optimal clas-
classification hyperplane was obtained by a kernel function, and the parameters of the
Biology 2022, 11, 1727 6 of 16
network were updated. The process of using the kernel function algorithm to explore the
optimal classification hyperplane is as follows:
We assume that the sample space of the training set is T = {( xi , yi ), i = 1, 2, 3, · · · , l }
where xi ∈ Rn is the input sample set, yi ∈ Rn is the output sample set, and i is the ith
training samples. By adopting the appropriate kernel function K ( xi , x j ) = ϕ( xi )· ϕ( x j )
(i = 1, 2, · · · , n ; j = 1, 2, · · · , n ; i 6= j), sample x can be mapped into a high dimen-
sional space, where ϕ( x ) represents the dimensional transform function of x. The convex
optimization problem with constraints is constructed as:
n
1 n n
W (α)max = ∑α− 2 i∑ ∑ αi α j yi y j K ( xi , x j ) (1)
i =1 =1 j =1
n
s.t. ∑ αi yi = 0 (i = 1, 2, 3, · · · , n), 0 ≤ αi ≤ C (2)
i =1
where W (α)max is the optimized object function; C is the penalty parameter; α is the La-
T
grange multiplier, and its optimal solution is α∗ = (α1∗ , α2∗ , · · · , α∗n , which can be obtained
by Formulas (1) and (2). Furthermore, we construct the hyperplane for classification. The
optimal classification hyperplane is defined as follows:
w∗ · x + b∗ = 0 (3)
n
w∗ = ∑ αi∗ yi xi (4)
i =1
n
b∗ = y j − ∑ αi∗ yi K ( xi , x j ), s.t. 0 ≤ α∗j ≤ C (5)
i =1
where w∗ is the normal vector to the optimal hyperplane, and b∗ is the offset.
Then, the categories of koi varieties can be determined through the classification
decision function, which is defined as:
" #
n
f ( x ) = sign ∑ αi yi K xi , x j + b
∗ ∗
(6)
i =1
Table
Table2.
Table 2.Experimental
2. Experimentaltest
Experimental testresults
test resultsof
results ofKRS-Net.
of KRS-Net.
KRS-Net.
Hyperparameter
Hyperparameter
Hyperparameter Epoch
Epoch = 25 == 25
Epoch 25 Epoch
Epoch===50
Epoch 50
50 Epoch
Epoch
Epoch== 75
7575
= Epoch
Epoch == 100
Epoch 100
= 100
Batch
Batch Size
Size == 44
Batch Size = 4
93.71%
93.71%
93.71%
96.50%
96.50%
96.50%
97.20%
97.20%
97.20%
96.50%
96.50%
96.50%
Batch
Batch Size
BatchSize = =8= 88
Size 97.90%
97.90%
97.90% 97.20%
97.20%
97.20% 96.24%
96.24%
96.24% 95.80%
95.80%
95.80%
Batch
Batch Size
BatchSize
Size= =16
= 16
16 93.01%
93.01%
93.01% 93.01%
93.01%
93.01% 96.50%
96.50%
96.50% 95.10%
95.10%
95.10%
Batch
Batch Size
Batch Size= 32
Size == 32
32 92.31%
92.31%
92.31% 94.41%
94.41%
94.41% 94.41%
94.41%
94.41% 93.01%
93.01%
93.01%
Batch Size = 64 83.92% 90.91% 93.71% 91.61%
Batch
Batch Size
Size == 64
64 83.92%
83.92% 90.91%
90.91% 93.71%
93.71% 91.61%
91.61%
FromTable
From
From Table2,
Table 2,the
2, thebest
the bestclassification
best classificationtest
classification testaccuracy
test accuracyof
accuracy ofKRS-Net
of KRS-Netwas
KRS-Net was97.90%
was 97.90%when
97.90% whenthe
when the
the
batch
batch size
batch size was
size was set
was set
set toto 8 and
to 88 and the
and the epoch
the epoch was
epoch was set
was set to
set to 25.
to 25. When
25. When
When the the batch
the batch size
batch size was
size was 8 and
was 88 and the
and the
the
epochis
epoch
epoch is25,
is 25,Figure
25, Figure444shows
Figure showsthe
shows thetraining
the trainingand
training andverification
and verificationaccuracy
verification accuracycurves
accuracy curvesof
curves ofKRS-Net.
of KRS-Net.From
KRS-Net. From
From
Figure4,
Figure
Figure we can
4, we can see
seethat
thatthe
that theverification
the verificationcurve
verification curveisis
curve close
is toto
close
close thethe
to training
the curve,
training
training which
curve,
curve, indicates
which
which indi-
indi-
that the
cates
cates thatnetwork
that the had better
the network
network had performance.
had better
better The The
performance.
performance. loss curves
The loss
loss of KRS-Net
curves
curves of in the
of KRS-Net
KRS-Net in training
in the and
the training
training
verification
and
and processes
verification
verification processes
processesare shown
are in Figure
are shown
shown in 5. 5.
in Figure
Figure 5.
Figure4.
Figure
Figure 4. Accuracycurves.
4.Accuracy
Accuracy curves.
curves.
Featurevisualization
Figure7.7.Feature
Figure visualizationof
ofKRS-Net.
KRS-Net.
Figure 7. Feature visualization of KRS-Net.
In Figure 7, the single feature and fusion feature are visualized for the first convolution
layer (Conv1), first pooling layer (Pool1), and the FC layer of KRS-Net from the shallow to
the deep layer. The fused feature is a new combined feature created on the basis of multiple
single features, and the fused features reflect the correlation information among the single
Biology 2022, 11, x FOR PEER REVIEW 9 of 16
In Figure 7, the single feature and fusion feature are visualized for the first convolu-
Biology 2022, 11, 1727 tion layer (Conv1), first pooling layer (Pool1), and the FC layer of KRS-Net from the shal- 9 of 16
low to the deep layer. The fused feature is a new combined feature created on the basis of
multiple single features, and the fused features reflect the correlation information among
the single Eliminating
features. features. Eliminating the redundant
the redundant information information
caused by caused by the correlation
the correlation between singlebe-
tween single
features features
is helpful for isthehelpful for theclassification
subsequent subsequent decision
classification
making decision
of the making
network.ofFrom the
network.
Figure 7,From
we can Figure 7, we
see that canlow-level
some see that some
imagelow-level image feature
feature information wasinformation
extracted bywas the
convolution
extracted layer
by the and pooling
convolution layer
layer andatpooling
the frontlayerof the network,
at the front ofsuch as koi color;
the network, suchandas
some
koi high-level
color; and some image featureimage
high-level information
featurewas extractedwas
information by the FC layer
extracted byatthe
theFCend of the
layer at
network.
the end of the network.
Different activation
Different activation regions
regions are generated
generated at at each
eachlayer
layerdueduetotothe
thediffering
differingabilities
abilitiesto
extract
to image
extract image features
features at at
each network
each network layer when
layer when thethe
image
imageis input intointo
is input the convolutional
the convolu-
neuralneural
tional network. Furthermore,
network. the features
Furthermore, learned
the features by each
learned layerlayer
by each can be canintuitively seen
be intuitively
by comparing
seen by comparing the activation regions
the activation withwith
regions the original
the original image.
image.To study
To studythe the
intermediate
interme-
processing
diate process
processing of KRS-Net
process for afor
of KRS-Net single image,
a single the activation
image, regions
the activation are successively
regions are succes-
shown for the first convolution layer and eight residual blocks
sively shown for the first convolution layer and eight residual blocks by considering by considering a Showa a
example in Figure 8.
Showa example in Figure 8.
Figure
Figure8.8.Activation
Activationregions
regionsofofKRS-Net
KRS-Netininaasingle
singleimage.
image.
From
FromFigure
Figure 8,8, itit can
can be seen that the the shallow
shallownetwork
networkextracted
extractedthe thesimple
simplefeatures
featuresof
of images,
images, andthe
and theextracted
extractedfeatures
features became
became more
more complex
complex andand abstract
abstract with
with theincrease
the increasein
network
in network depth.
depth.
Grad-CAM[40]
Grad-CAM [40]can canvisualize
visualizeaaregion
regionofofinterest
interestofofananimage,
image,which
whichhelped
helpedtotoun-un-
derstandhow
derstand howthetheconvolutional
convolutionalneural neuralnetwork
networkmakesmakesdecisions
decisionson onthetheclassification
classificationof of
koi. Figure 9 gives the Grad-CAM visualization of the first convolution
koi. Figure 9 gives the Grad-CAM visualization of the first convolution layer and eight layer and eight
residualblocks
residual blocksininKRS-Net
KRS-Netfor forkoi.
koi. In In Figure
Figure 9, the
9, the redred region
region of Grad-CAM
of Grad-CAM provides
provides an
an important
important basisbasis
to maketo make classification
classification decisions
decisions oninput
on the the input
imageimage
for thefornetwork,
the network,
and
andblue
the the blue
regionregion
is the is second
the second part.
part. With With
thethe increase
increase in in network
network depth,the
depth, thered
redregion
region
graduallyfocuses
gradually focuseson onthe thespecial
specialcharacteristics
characteristicsofofthe theobject.
object.Taking
Takingthetheimage
imageofofTancho
Tancho
asan
as anexample
examplein inFigure
Figure9,9,we wecan
cansee seethat
thatthe
thered
redregion
regionof ofthe
theoutput
outputimage
imageof ofresidual
residual
block 4 is relatively scattered, but the red region slowly focuses
block 4 is relatively scattered, but the red region slowly focuses on the round spot on on the round spot onthe
the
head of Tancho with the deepening of the network, which is the most
head of Tancho with the deepening of the network, which is the most obvious feature that obvious feature that
distinguishes this variety from other varieties. As can be seen from Figure 9, the network
could effectively capture the characteristics of each koi variety, so that the classification task
was completed well.
Biology 2022, 11, x FOR PEER REVIEW 10 of 16
distinguishes this variety from other varieties. As can be seen from Figure 9, the network
Biology 2022, 11, 1727 10 of 16
could effectively capture the characteristics of each koi variety, so that the classification
task was completed well.
Figure 9.
Figure 9. Grad-CAM
Grad-CAM visualization
visualization of
of KRS-Net.
KRS-Net.
As
Thecanaccuracy,
be seen precision,
from Figure 10, and
recall, the highest
F1 were test accuracy
selected of AlexNet,
as performance VGG16, Goog-
evaluation indexes
to further
LeNet, analyzeDenseNet201,
ResNet101, the koi classification
and theperformance of the networks,
proposed KRS-Net whose
was 94.41%, definitions
94.41%, 93.71%,are
as follows
93.71%, [41]:and 97.90%, respectively. The results of the comparative analysis showed
96.50%,
that the test accuracy of KRS-Net was = TP +than
1.4% higher TN the highest test accuracy of the
Accuracy (7)
TP + TN + FP + FN of the proposed approach.
other five classification networks, which proves the superiority
Notably, the classification effect of the six networksTP gradually increased with the decrease
Precision = (8)
in batch size. For this phenomenon, a specific analysisTP + FP is provided in Section 4.
The accuracy, precision, recall, and F1 wereTP selected as performance evaluation in-
Recall =
dexes to further analyze the koi classification performance of the networks, whose defini-(9)
TP + FN
tions are as follows [41]:
2 × Pr × Re
F1 = (10)
Pr TP
+ Re+ TN
Accuracy = (7)
TP + TNtrue
where TP, TN, FP, and FN, respectively, represent + FP + FN true negative, false positive,
positive,
and false negative. Accuracy is an intuitive evaluation index, representing the proportion of
TP
classified=to the total number of koi samples. Precision
the number of koi samples correctlyPrecision (8)
represents the proportion of the number of realTP + FP samples to the number of positive
positive
Biology 2022, 11, 1727 12 of 16
samples predicted by the network. Recall represents the proportion of positive samples
predicted by the network to all positive samples. F1 is a comprehensive evaluation index
based on precision and recall. A larger F1 value indicates better network performance.
The comparative experimental results are shown in Table 3. The proposed KRS-Net
had a better effect when the batch size was eight, as shown in Table 2. So, the batch size
was set to 8 and the epoch was set to 25, 50, 75, or 100 in the experiment. The following
performance evaluation indexes of each network represent the average values of thirteen
koi varieties, but not the performance evaluation index of a single variety.
Evaluation
AlexNet VGG16 GoogLeNet ResNet101 DenseNet201 KRS-Net
Index (%)
Epoch = 25
Accuracy 98.17 98.82 98.82 98.71 99.25 99.68
Precision 90.51 92.37 92.72 92.98 95.46 97.90
Recall 87.55 91.96 91.89 91.19 94.83 97.76
F1 86.97 91.58 91.00 90.53 94.78 97.80
Epoch = 50
Accuracy 97.63 99.19 98.92 99.14 99.57 99.57
Precision 90.69 94.97 93.41 95.30 97.80 97.58
Recall 88.25 94.69 92.59 93.99 96.92 97.13
F1 87.10 94.29 91.79 93.47 96.87 97.12
Epoch = 75
Accuracy 98.60 98.87 98.39 98.92 98.92 99.35
Precision 91.98 95.05 94.24 94.54 94.68 96.49
Recall 90.49 93.91 93.43 92.52 92.52 95.84
F1 89.93 92.87 93.01 91.67 91.88 95.90
Epoch = 100
Accuracy 98.81 98.82 98.71 95.91 99.16 99.41
Precision 93.51 95.07 92.24 88.00 96.03 96.40
Recall 91.89 90.71 91.26 72.38 93.92 96.54
F1 91.57 91.36 90.82 74.06 93.23 96.17
It can be seen from Table 3 that when the batch size of KRS-Net was set to 8 and
the epoch was set to 25, the classification accuracy, precision, recall, and F1 were 99.68%,
97.90%, 97.76%, and 97.80%, respectively, which are all higher than those of the other five
classification networks. In addition, we can see that the four evaluation indices of the
network all decreased with the increase in epochs, as shown in Table 3, which may have
occurred because the network gradually generated overfitting with the increase in epoch
number in the subsequent training process.
Remark: there is a kind of fine-grained image classification method (subcategory
image classification method), which we used to divide coarse-grained categories into more
detailed subclasses according to the differences in some special parts among subclasses.
However, the difference between the subclasses of koi lies not only in some special parts,
but also in the shape and position of its body patterns as well as the ratio of red, white,
and black. Considering the above factors, we did not choose a similar algorithm such as a
fine-grained algorithm.
4. Discussion
4.1. Factors Influencing Test Accuracy
Although the test accuracy of the proposed KRS-Net reached 97.90%, there were still
some koi varieties that were misclassified. The reasons for the misclassification may include
the following several aspects: (1) Some images were not clear enough because koi swim
quickly. Additionally, the part of the image containing the typical characteristics may have
been incomplete due to the differences in shooting angle during the data acquisition, which
may have affected the training effect of the network. (2) The water ripples generated by the
Biology 2022, 11, 1727 13 of 16
swimming of koi may have affected the image definition, which resulted in the blurring
and distortion of images, as well as other problems [42]. (3) The cross-breeding of koi
reduces the differences between varieties, resulting in a situation where the offspring are
neither like the characteristics of their mother fish nor the various characteristics of their
father, which poses difficulties for classification.
5. Conclusions
Koi variety classification was studied to solve the problems caused by the high simi-
larity among some varieties. In this study, a dataset including thirteen kinds of koi was
established, and a koi variety classification network KRS-Net was proposed based on resid-
ual network and SVM. Compared with five other mainstream networks, the performance
superiority of the proposed KRS-Net was proven. this study provides a new solution for
the classification of koi varieties, which can be extended to breeding, aquaculture, grade
sorting, and other marine fields.
Author Contributions: Conceptualization, J.L.; methodology, J.L.; software, Y.Z.; validation, J.L. and
L.D.; formal analysis, F.W.; investigation, Y.Z. and Q.L.; resources, F.W.; data curation, F.W.; writing—
original draft preparation, Y.Z.; writing—review and editing, J.L.; visualization, W.X.; supervision,
J.L. and L.D.; project administration, J.L.; funding acquisition, J.L. All authors have read and agreed
to the published version of the manuscript.
Funding: This research work was financially supported by the project of the National Natural
Science Foundation of China (32073029), the key project of the Shandong Provincial Natural Science
Foundation (ZR2020KC027), the postgraduate education quality improvement project of Shandong
Province (SDYJG19134), the project of the China Scholarship Council (201908370048), and the Open
Program of Key Laboratory of Cultivation and High-value Utilization of Marine Organisms in Fujian
Province (2021fjscq08).
Institutional Review Board Statement: Not applicable.
Informed Consent Statement: Not applicable.
Data Availability Statement: With the consent of the authors, the data to this article can be found
online at: http://33596lk211.qicp.vip/dataweb/index.html, accessed on 21 May 2022.
Conflicts of Interest: The authors declare no conflict of interest.
References
1. Pinkey, S. Study of the fresh water fish diversity of Koshi river of Nepal. Int. J. Fauna Biol. Stud. 2016, 3, 78–81.
2. Nuwansi, K.; Verma, A.; Chandrakant, M.; Prabhath, G.; Peter, R. Optimization of stocking density of koi carp (Cyprinus carpio
var. koi) with gotukola (Centella asiatica) in an aquaponic system using phytoremediated aquaculture wastewater. Aquaculture
2021, 532, 735993. [CrossRef]
3. Wang, K.L.; Chen, S.N.; Huo, H.J.; Nie, P. Identification and expression analysis of sixteen Toll-like receptor genes, TLR1, TLR2a,
TLR2b, TLR3, TLR5M, TLR5S, TLR7-9, TLR13a-c, TLR14, TLR21-23 in mandarin fish Siniperca chuatsi. Dev. Comp. Immunol. 2021,
121, 104100. [CrossRef]
4. De Kock, S.; Gomelsky, B. Japanese Ornamental Koi Carp: Origin, Variation and Genetics; Biology and Ecology of Carp; Informa UK
Limited: Boca Raton, FL, USA, 2015; pp. 27–53.
5. Sun, X.; Chang, Y.; Ye, Y.; Ma, Z.; Liang, Y.; Li, T.; Jiang, N.; Xing, W.; Luo, L. The effect of dietary pigments on the coloration of
Japanese ornamental carp (koi, Cyprinus carpio L.). Aquaculture 2012, 342, 62–68. [CrossRef]
6. Bairwa, M.K.; Saharan, N.; Rawat, K.D.; Tiwari, V.K.; Prasad, K.P. Effect of LED light spectra on reproductive performance of Koi
carp (Cyprinus carpio). Indian J. Anim. Res. 2017, 51, 1012–1018. [CrossRef]
7. Xie, Z.; Wang, D.; Jiang, S.; Peng, C.; Wang, Q.; Huang, C.; Li, S.; Lin, H.; Zhang, Y. Chromosome-Level Genome Assembly
and Transcriptome Comparison Analysis of Cephalopholis sonnerati and Its Related Grouper Species. Biology 2022, 11, 1053.
[CrossRef]
8. Nica, A.; Mogodan, A.; Simionov, I.-A.; Petrea, S.-M.; Cristea, V. The influence of stocking density on growth performance of
juvenile Japanese ornamental carp (Koi, Cyprinus carpio L.). Sci. Pap. Ser. D Anim. Sci. 2020, 63, 483–488.
Biology 2022, 11, 1727 15 of 16
9. Kim, J.-I.; Baek, J.-W.; Kim, C.-B. Image Classification of Amazon Parrots by Deep Learning: A Potentially Useful Tool for Wildlife
Conservation. Biology 2022, 11, 1303. [CrossRef]
10. Tian, X.; Pang, X.; Wang, L.; Li, M.; Dong, C.; Ma, X.; Wang, L.; Song, D.; Feng, J.; Xu, P. Dynamic regulation of mRNA and miRNA
associated with the developmental stages of skin pigmentation in Japanese ornamental carp. Gene 2018, 666, 32–43. [CrossRef]
11. Peng, F.; Chen, K.; Zhong, W. Classification and appreciation of three species of koi. Sci. Fish Farming 2018, 8, 82–83.
12. Song, S.; Duan, P. Koi and its variety classification. Shandong Fish. 2009, 26, 53–54.
13. Garland, J.; Hu, M.; Kesha, K.; Glenn, C.; Duffy, M.; Morrow, P.; Stables, S.; Ondruschka, B.; Da Broi, U.; Tse, R. An overview of
artificial intelligence/deep learning. Pathology 2021, 53, S6. [CrossRef]
14. Talib, M.A.; Majzoub, S.; Nasir, Q.; Jamal, D. A systematic literature review on hardware implementation of artificial intelligence
algorithms. J. Supercomput. 2021, 77, 1897–1938. [CrossRef]
15. Liu, Y.; Yang, C.; Gao, Z.; Yao, Y. Ensemble deep kernel learning with application to quality prediction in industrial polymerization
processes. Chemom. Intell. Lab. Syst. 2018, 174, 15–21. [CrossRef]
16. Wang, T.; Zhao, Y.; Sun, Y.; Yang, R.; Han, Z.; Li, J. Recognition approach based on data-balanced faster R CNN for winter jujube
with different levels of maturity. Trans. Chin. Soc. Agric. Mach. 2020, 51, 457–463.
17. Xu, W.; Zhao, L.; Li, J.; Shang, S.; Ding, X.; Wang, T. Detection and classification of tea buds based on deep learning. Comput.
Electron. Agric. 2022, 192, 106547. [CrossRef]
18. Li, J.; Xu, C.; Jiang, L.; Xiao, Y.; Deng, L.; Han, Z. Detection and analysis of behavior trajectory for sea cucumbers based on deep
learning. IEEE Access 2019, 8, 18832–18840. [CrossRef]
19. Xu, W.; Zhu, Z.; Ge, F.; Han, Z.; Li, J. Analysis of behavior trajectory based on deep learning in ammonia environment for fish.
Sensors 2020, 20, 4425. [CrossRef] [PubMed]
20. Li, J.; Xu, W.; Deng, L.; Xiao, Y.; Han, Z.; Zheng, H. Deep Learning for Visual Recognition and Detection of Aquatic Animals: A
Review. Rev. Aquac. 2022, 1–25. [CrossRef]
21. Xu, Y.; Shen, H. Review of Research on Biomedical Image Processing Based on Pattern Recognition. J. Electron. Inf. Technol. 2020,
42, 201–213.
22. Sarica, A.; Vaccaro, M.G.; Quattrone, A.; Quattrone, A. A Novel Approach for Cognitive Clustering of Parkinsonisms through
Affinity Propagation. Algorithms 2021, 14, 49. [CrossRef]
23. Liu, W.; Wang, Z.; Zeng, N.; Alsaadi, F.E.; Liu, X. A PSO-based deep learning approach to classifying patients from emergency
departments. Int. J. Mach. Learn. Cybern. 2021, 12, 1939–1948. [CrossRef]
24. Han, Z.; Wan, J.; Deng, L.; Liu, K. Oil Adulteration identification by hyperspectral imaging using QHM and ICA. PLoS ONE 2016,
11, e0146547. [CrossRef] [PubMed]
25. Liu, W.; Wang, Z.; Liu, X.; Zeng, N.; Liu, Y.; Alsaadi, F.E. A survey of deep neural network architectures and their applications.
Neurocomputing 2017, 234, 11–26. [CrossRef]
26. Eerola, T.; Kraft, K.; Grönberg, O.; Lensu, L.; Suikkanen, S.; Seppälä, J.; Tamminen, T.; Kälviäinen, H.; Haario, H. Towards
operational phytoplankton recognition with automated high-throughput imaging and compact convolutional neural networks.
Ocean. Sci. Discuss. 2020, 62, 1–20.
27. Zhu, D.; Qi, R.; Hu, P.; Su, Q.; Qin, X.; Li, Z. YOLO-Rip: A modified lightweight network for Rip Currents detection. Front. Mar.
Sci. 2022, 9, 930478. [CrossRef]
28. Lu, Y.; Tung, C.; Kuo, Y. Identifying the species of harvested tuna and billfish using deep convolutional neural networks. ICES J.
Mar. Sci. 2020, 77, 1318–1329. [CrossRef]
29. Rauf, H.T.; Lali, M.I.U.; Zahoor, S.; Shah, S.Z.H.; Rehman, A.U.; Bukhari, S.A.C. Visual features based automated identification of
fish species using deep convolutional neural networks. Comput. Electron. Agric. 2019, 167, 105075. [CrossRef]
30. Knausgård, K.M.; Wiklund, A.; Sørdalen, T.K.; Halvorsen, K.T.; Kleiven, A.R.; Jiao, L.; Goodwin, M. Temperate fish detection and
classification: A deep learning based approach. Appl. Intell. 2022, 52, 6988–7001. [CrossRef]
31. Ju, Z.; Xue, Y. Fish species recognition using an improved AlexNet model. Optik 2020, 223, 165499. [CrossRef]
32. Hridayami, P.; Putra, I.K.G.D.; Wibawa, K.S. Fish species recognition using VGG16 deep convolutional neural network. J. Comput.
Sci. Eng. 2019, 13, 124–130. [CrossRef]
33. Huang, X.; Chen, W.; Yang, W. Improved Algorithm Based on the Deep Integration of Googlenet and Residual Neural Network; IOP
Publishing: Bristol, UK, 2021; p. 012069.
34. Xu, X.; Li, W.; Duan, Q. Transfer learning and SE-ResNet152 networks-based for small-scale unbalanced fish species identification.
Comput. Electron. Agric. 2021, 180, 105878. [CrossRef]
35. Zhang, K.; Guo, Y.; Wang, X.; Yuan, J.; Ding, Q. Multiple feature reweight densenet for image classification. IEEE Access 2019, 7,
9872–9880. [CrossRef]
36. Gao, S.; Dai, Y.; Li, Y.; Jiang, Y.; Liu, Y. Augmented flame image soft sensor for combustion oxygen content prediction. Meas. Sci.
Technol. 2022, 34, 015401. [CrossRef]
37. Liu, K.; Li, Y.; Yang, J.; Liu, Y.; Yao, Y. Generative principal component thermography for enhanced defect detection and analysis.
IEEE Trans. Instrum. Meas. 2020, 69, 8261–8269. [CrossRef]
38. Zhu, H.; Yang, L.; Fei, J.; Zhao, L.; Han, Z. Recognition of carrot appearance quality based on deep feature and support vector
machine. Comput. Electron. Agric. 2021, 186, 106185. [CrossRef]
Biology 2022, 11, 1727 16 of 16
39. Hemke, R.; Buckless, C.G.; Tsao, A.; Wang, B.; Torriani, M. Deep learning for automated segmentation of pelvic muscles, fat, and
bone from CT studies for body composition assessment. Skelet. Radiol. 2020, 49, 387–395. [CrossRef]
40. Selvaraju, R.R.; Cogswell, M.; Das, A.; Vedantam, R.; Parikh, D.; Batra, D. Grad-CAM: Visual Explanations from Deep Networks
via Gradient-based Localization. Int. J. Comput. Vis. 2020, 128, 336–359. [CrossRef]
41. Taheri-Garavand, A.; Ahmadi, H.; Omid, M.; Mohtasebi, S.S.; Carlomagno, G.M. An intelligent approach for cooling radiator
fault diagnosis based on infrared thermal image processing technique. Appl. Therm. Eng. 2015, 87, 434–443. [CrossRef]
42. Zhang, Z.; Tang, Y.-G.; Yang, K. A two-stage restoration of distorted underwater images using compressive sensing and image
registration. Adv. Manuf. 2021, 9, 273–285. [CrossRef]
43. Burçak, K.C.; Baykan, Ö.K.; Uğuz, H. A new deep convolutional neural network model for classifying breast cancer histopatho-
logical images and the hyperparameter optimisation of the proposed model. J. Supercomput. 2021, 77, 973–989. [CrossRef]
44. Goyal, P.; Dollár, P.; Girshick, R.; Noordhuis, P.; Wesolowski, L.; Kyrola, A.; Tulloch, A.; Jia, Y.; He, K. Accurate, large minibatch
sgd: Training imagenet in 1 hour. arXiv 2017, arXiv:1706.02677.