## 3 Proposed Methodology  
For dragonfly species classification, we adapted face recognition algorithms. To evaluate their performance, we conducted comparative experiments using standard computer vision classification algorithms. Many computer vision classification algorithms employ the Softmax loss function [5, 6, 7, 8, 9, 10, 11]. This function transforms network-extracted features into class probability distributions through a fully connected layer, enabling effective category discrimination. The Softmax function is defined in Equation (1):  
\[\text{Softmax}(z_{i})=\frac{e^{z_{i}}}{\sum_{j=1}^{C}e^{z_{j}}} \tag{1}\]  
where \(z_{i}\) is the input for class \(i\), and \(C\) is the total number of classes. Although the face recognition algorithm model we adopted directly generates feature vectors of recognized objects without employing the Softmax loss function for category probability distribution output, it utilizes various loss functions during the training phase to enhance learning capability. These loss functions play a pivotal role in improving model performance for face recognition tasks. Representative examples include Softmax, Center Loss [27], CosFace [28], SphereFace [29], ArcFace [30], and X2-Softmax [31]. Among these, the ArcFace loss function has become a classic approach in this field, with its mathematical formulation in Equation (2):  
\[L=-\frac{1}{N}\sum_{i=1}^{N}\log\frac{e^{s\cdot\cos(\theta_{y_{i}}+m)}}{e^{s \cdot\cos(\theta_{y_{i}}+m)}+\sum_{j\
eq y_{i}}e^{s\cdot\cos(\theta_{j})}} \tag{2}\]  
where  
* \(N\) is the batch size;
* \(s\) is the scale factor (default = 30);
* \(\theta_{y_{i}}\) is the angle for the true class \(y_{i}\);
* \(m\) is the angular margin (default = 0.5 radians);
* \(\cos(\theta_{j})\) is the cosine similarity for class \(j\). Figure 2: Cropping of dragonfly images. The Softmax loss function was initially employed in early face recognition algorithms. To improve the discriminative capability of these systems, researchers have developed several enhanced loss functions derived from the original Softmax formulation [27; 29]. Among these improvements, ArcFace is a classical solution. This approach projects feature vectors onto a hyperspherical manifold, optimizing intra-class compactness and inter-class separation, which significantly enhances face recognition accuracy [30]. We adapted a face recognition algorithm for dragonfly species classification. The methodology differs between the training and inference phases compared to conventional face recognition, as illustrated in Figure 3, which presents our species classification workflow. For image classification, our model first employs an object detection algorithm to localize the dragonfly within the input image. The detected rectangular bounding box is then adjusted to form a square region, which is subsequently cropped and resized to 128 x 128 pixels. This processed image serves as input to the ResNet50 architecture, generating a 512-dimensional feature vector. During training data preparation, we utilize the YOLOv10 object detection algorithm for dragonfly localization. To optimize inference speed during deployment, modified face detection algorithms such as BlazeFace [32], RetinaFace [33], and SCRFD [34] can be adapted for dragonfly detection. In the training phase, the preprocessed dragonfly image is converted into a normalized 512-dimensional feature vector via ResNet50. This vector undergoes matrix multiplication with the normalized feature vectors of all candidate species to compute similarity scores. These scores are processed through the ArcFace loss function to generate predicted probabilities, which are compared with the ground truth labels to compute the loss value. The ResNet50 parameters are then optimized through backpropagation. During inference, the input image similarly undergoes feature extraction to produce a normalized 512-dimensional vector.