# Fish Detection and Classification for Automatic Sorting System with an Optimized YOLO Algorithm
### With YOLOv4 Using Conventional and Landmarking Labeling Techniques  
At this stage, extracted pictures were used as training image data, and we used YOLOv4 as the algorithm. The first experiment was carried out using conventional labeling techniques. With this model, the accuracy output was better. In video test 1, an accuracy score of 97.18% was obtained, and in video test 2, it was 91.23%, so the average final accuracy of this model could reach 94.21%.  
Although the final accuracy is only slightly better than with YOLOv4-Tiny, the total number of false (double) detections is much lower. From 4 to only 1 in video test 1, and from 17 to only 7 in video test 2. This means YOLOv4 has a higher classification accuracy capability than the lite version (YOLOv4-Tiny). However, another problem arose: the detection failure occurred nine times, all of which were in the Sawai class.  
Figure 6: The work flowchart.  
\begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline \multicolumn{1}{c}{\multirow{2}{*}{**Approches**}} & \multicolumn{6}{c}{**Video Test 1 and 2**} \\ \cline{2-10}  & **Correct Detection (TP)** & **Wrong/Double Detection (FP)** & **Not Detect (FN)** & **Total Detection** & **Precision (\%)** & **Sensitivity (\%)** & **F-Score (\%)** \\ \hline VOLOVA With Static Pics & 13 & 0 & 229 & 242 & 100.00 & 5.37 & 10.20 \\ VOLOVA-Tiny & 221 & 21 & 0 & 242 & 91.32 & 100.0 & 95.46 \\ VOLOVA+ & 225 & 8 & 9 & 242 & 96.57 & 96.15 & 96.36 \\ VOLOVA + LM & 227 & 17 & 1 & 245 & 93.03 & 99.56 & 96.19 \\ Proposed Method & 239 & 4 & 1 & 244 & 98.35 & 99.58 & 98.86 \\ \hline \hline \end{tabular}
\end{table}
Table 6: Experimental results (other performance parameters).  
\begin{table}
\begin{tabular}{c c c c c c c c c c c c} \hline \hline \multicolumn{1}{c}{\multirow{2}{*}{**Approches**}} & \multicolumn{6}{c}{**Video Test-1**} & \multicolumn{6}{c}{**Video Test-2**} & \multicolumn{6}{c}{**Average**} \\ \cline{2-10}  & **Correct Detection** & **False (Double/Wrong)** & **Not Detection** & **Total Detection** & **Accuracy (\%)** & **Correct Detection** & **False (Double/Wrong)** & **Not Detection** & **Total Detection** & **Accuracy (\%)** & **Final (\%)** \\ \hline VOLOVA with Static Pics & 2 & 0 & 69 & 71 & 2.82 & 11 & 0 & 160 & 171 & 6.43 & 4.62 \\ YOLOOVA+Tiny & 67 & 4 & 0 & 71 & 94.37 & 154 & 17 & 0 & 171 & 90.06 & 92.21 \\ YOLOOVA & 69 & 1 & 1 & 71 & 97.18 & 156 & 7 & 8 & 171 & 91.23 & 94.21 \\ YOLOOVA + LM & 68 & 6 & 0 & 74 & 91.89 & 159 & 11 & 1 & 171 & 92.98 & 92.44 \\ Proposed method & 72 & 0 & 1 & 73 & 98.63 & 167 & 4 & 0 & 171 & 97.66 & 98.15 \\ \hline \hline \end{tabular}
\end{table}
Table 5: Experimental results (accuracy).  
In the labeling process for the next scheme, YOLOv4 will be combined with the landmarking technique. With this approach, the results obtained were 91.89% accuracy for video test 1 and 92.98% accuracy for video test 2, so the average final accuracy was 92.44%. This model did many double detections, especially for the Nuanchan and Tapian, which have the same appearance of scales but different shapes. Many double detections were also carried out for the Jeen Ban-Jeen To classes. In addition, the model also detected scattered fish outside the conveyor incorrectly. The three scattered Yeesok fish were detected as Nin.  
Figure 8: Experimental results (accuracy).  
Figure 7: Test results of YOLOv4 with static pitures: (**a**) accuracy; (**b**) other parameters.