## 3 Materials and Methods  
This study focuses on developing an intelligent identification system for detecting sexual characteristics in armed fish, which can assist hatcheries in quickly identifying the gender of fish and improving the efficiency of sorting operations. After fish are harvested from the breeding ponds, they directly enter the identification process. However, during this process, various impurities in the water, such as bubbles, excrement, and gravel, often interfere, resulting in images that are not as clean or orderly as factory-produced standard specimens. Additionally, the identification process is affected by varying lighting conditions from morning to evening, leading to significant environmental parameter fluctuations. The unique reproductive characteristics of each fish further complicate the identification process, requiring extensive training data and precise parameter adjustments. To address these challenges, this study first selected an appropriate AI model and designed an identification workflow. Parameters were then adjusted according to the characteristics of both the AI model and the identification environment. Ultimately, this led to the development of an excellent smart aquaculture solution: an AI-based intelligent fingering separation and identification model. The primary objective of this study is to verify the feasibility of the AI gender identification system in a specific aquaculture environment; thus, the error analysis mainly focused on overall error rates and accuracy. Detailed statistical data on low-confidence or misclassification cases were not extensively analyzed, as the emphasis at this stage was on the preliminary validation of the system's overall performance. However, we observed a decline in recognition performance under certain environmental conditions (such as insufficient lighting or the presence of impurities in the water). Future research will further investigate the specific types and causes of these recognition errors and adopt more detailed error analysis methods to optimize system performance. This will include classification analysis of low-confidence cases and designing model improvement strategies. Before finalizing the AI model, this study tested three mainstream models on the market: SSD, MobileNet, and YOLO. The test results are as follows:  
* SSD: During training, the SSD model failed to converge, with the loss not decreasing, meaning that the AI could not effectively learn. * MobileNet: The model successfully completed training and could correctly frame the genital area. However, in the test set, 80% of male fish were incorrectly identified as female, indicating that the model's identification accuracy was low. * YOLO: The model successfully completed training and could correctly frame the genital area. In the test set, the identification accuracy for both male and female fish exceeded 80%. As a result, this study selected YOLO as the training model. The identification method is illustrated in Figure 1 below and is explained as follows:  
Data Preparation and Augmentation
* Data Collection and Augmentation: A large number of annotated images of farmed fish were collected, ensuring coverage of different angles, lighting conditions, and backgrounds. Data augmentation techniques were applied, such as rotation, scaling, and brightness adjustment. Model Selection and Training
* Pre-trained YOLO Model Selection: A YOLO model pre-trained on a large-scale dataset was chosen to perform better in transfer learning. Figure 1: Research methodology framework. * Model Architecture Modification: The output layer of the model was modified to accommodate new categories (male and female fish). If necessary, the network's depth or width was adjusted. * Implementation of Transfer Learning Strategy: The first few layers of the pre-trained model were frozen, only fine-tuning the last few layers and the newly added output layer. Gradually, more layers were unfrozen for detailed fine-tuning.