Abstract:The stress behavior representation based on research on ammonia nitrogen stress behavior is the premise and basis for realizing the recognition of ammonia nitrogen stress of Epinephelus akaara. However, most of the existing methods rely on high-performance hardware, which is not conducive to the embedded deployment and application of behavior representation methods in aquaculture. Taking symptoms such as reduced activity and imbalanced body of Epinephelus akaara under stress environment into account, a behavior representation method was proposed to represent the ammonia nitrogen stress behavior of Epinephelus akaara based on lightweight detection and tracking algorithm. In the detection algorithm, GhostV2 convolution was firstly used to lighten the feature extraction network of YOLO v5s. Then asymptotic feature pyramid network was integrated into the neck of YOLO v5s to support direct interactive fusion of different dimensional features. The results of ablation and comparison experiments showed that the accuracy and recall rate achieved 94.3% and 89.5% and mAP@ 0.5 of the lightweight model was 96.2% , which was 1.6 percentage points higher than that of the original model while the model volume was about 60% of that of the original model. In the tracking algorithm, a lightweight ReID network was embeded into Ocsort and the appearance similarity matrix was introduced into the matching cost matrix in target association period. Comparison experiments showed that MOTA and IDF1 of improved tracking algorithm achieved 94.7% and 69.3% , which were 3.2 percentage points and 6.7 percentage points higher than that of the original Ocsort with YOLO v5s. Combined with the research on ammonia nitrogen stress behavior, average velocity and number of imbalanced Epinephelus akaara were selected to characterize the ammonia nitrogen stress behavior of Epinephelus akaara. The accuracy of identifying the behavior of Epinephelus akaara based on the characterization proposed method was 92.2% , which can accurately classify whether the Epinephelus akaara was under ammonia nitrogen stress environment. The lightweight characterization method can be deployed on Jetson Orin Nano embedded system, with an average speed of 6 f / s, providing technical support for efficient and real-time identification of ammonia nitrogen stress in aquaculture.