# Automatic Classification of Morphologically Similar Fish Species Using Their Head Contours
## 3 Results
### Regarding Automation of the Whole Process  
A step that is required to be carried out if the ROI detection is performed without the support of the two points provided by the expert is to re-scale the original image to the FasterRCNN object detection input size, and then, once the ROI is found, it must be mapped onto the original image. This allows the extraction of the ROI from the original image. The following step is to obtain the contour, compute the features, and to introduce them in the ELM network to identify the class of the specimen. The diagram presented in Figure 13 can help to clarify the whole process, which can be described in four stages. The first stage is the ROI detection. This procedure can be supervised or it can be carried out automatically using a Faster-RCNN object detector. Once the ROI has been determined, the second stage consists of extracting the fish contour segment from this region. The result of stage two is the horizontal and vertical pixel coordinates that describe it in relation to the first contour point, which is taken to be the origin of the coordinate system. The third stage is the 'feature extraction', in which this sequence of contour points obtained from the previous stage is used as input. These points are standardized by applying a rotation, a re-scaling and a re-sampling by using third-order splines. The result is a single sequence (\(q_{k}\)) of 256 values. Then, in the same stage, DCT and DFT are taken on \(q_{k}\), and we select the first five DCT and DFT coefficients to form the vector of features. In the multi-class classification problem, a features vector containing only 10 real numbers produced the best accuracy results. The vector of features was used in the last stage to add to an already trained ELM of 34 hidden nodes. Finally, the ELM output is the species that the individual belongs to. Figure 14 shows the details of a feature extraction stage and of a classification stage corresponding to a model that solves the binary classification problem. It is an SLFN network of 10 hidden nodes trained with features based on the DFT. Figure 14a-c graphically show the steps required to obtain the sequence of 256 points in vector \(\mathbf{q}\) that represent the contour after the standardization, and Figure 14a shows the way to obtain the vector \(\mathbf{x}\) of features. Note than \(\mathbf{F}\) is the Fourier matrix and \(\mathbf{f}\), the DFT of \(\mathbf{q}\). In this case, the vector of features \(\mathbf{x}\) has five real elements obtained from the first three Fourier coefficients, as \(f_{0}\in\mathbb{R}\) Figure 14e shows the classification stage, which begins with a Z-score standardization, being the vectors \(\mathbf{m}\) and \(\mathbf{e}\), the means and standard deviations of \(\mathbf{x}\). The normalized features after the Z-score are the inputs of the SLFN network. \(\mathbf{W}\), \(\mathbf{b}\) and \(\mathbf{B}\) are the input weights, the bias, and the output weights of the trained SLFN net, respectively. Finally, the decision is taken on the values achieved in the output nodes. This simple architecture reached accuracy values up to 95.65% and, in 1000 LOO-CV experiments a mean accuracy of 89.36% (see the column _DFT_-3 of Table 1). Figure 12: Example of the detection results performed on the test images using the trained faster region-based convolutional network (Faster R-CNN) object detector. The obtained ROI is shown in yellow. Note that, in this case, the fish appears in the images following a standardization, and the problem is not overly complicated. In a random disposition of the objects of interest in the image, one would have to train the model with many more images, using a data augmentation strategy and likely a more complex feature extraction network. Additionally, the substitution of Faster-RCNN by Mask-R CNN [51; 52] could be explored to see if the contour segment of interest could even be detected automatically in the ROI directly.