An embedded device-based epinephelus akaara ammonia nitrogen stress behavior recognition method
By building a multi-target tracking model for red-spotted grouper on an embedded device, the problems of high labor intensity, slow detection speed and high deployment cost in existing technologies are solved, and lightweight, accurate identification and all-weather detection of ammonia nitrogen stress behavior in red-spotted grouper are realized.
Patent Information
- Application Number
- CN202410225812.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-29
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2044-02-29
AI Technical Summary
Existing technologies for identifying ammonia stress behavior in red-spotted grouper suffer from high labor intensity, slow detection speed, and high deployment costs. Furthermore, high-precision ammonia nitrogen sensors are prone to corrosion in seawater and have a short lifespan, making large-scale deployment difficult.
A multi-target tracking model for red-spotted grouper that can run on embedded devices with limited computing power is constructed, including the target detection model YOLOv5_GA, the improved target tracking model LD_Ocsort, and the ammonia nitrogen stress behavior classification model. By analyzing the behavioral characteristics of red-spotted grouper through video frames, a lightweight and accurate ammonia nitrogen stress behavior recognition is achieved.
It enables 24/7 automated assessment of ammonia nitrogen stress behavior in red-spotted grouper farming sites, reducing labor and cost requirements and minimizing the risk of ammonia nitrogen stress.
Smart Images

Figure CN118072393B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method for recognizing ammonia stress behavior in grouper, specifically a method for recognizing ammonia stress behavior in red-spotted grouper based on an embedded device. Background Technology
[0002] Currently, there are two main methods for identifying ammonia stress behavior in red-spotted grouper. One is manual inspection, where aquaculture workers visually assess fish behavior or manually collect water samples from the aquaculture environment, then analyze ammonia concentration using specialized equipment. This method requires extensive experience from aquaculture workers and demands high real-time monitoring. The other method is to build an aquaculture water quality sensing system based on ammonia sensors. This system uses sensors to construct an Internet of Things (IoT) network to monitor changes in ammonia concentration in the aquaculture water and sets thresholds. When the ammonia concentration exceeds the threshold, an alarm is triggered. While this method offers high accuracy and requires less manpower, its application is limited by the extremely high risk of sensor corrosion and damage in seawater, as well as the high cost of using high-precision ammonia sensors on a large scale. Currently, most high-precision ammonia sensors are imported and have short lifespans in seawater. Therefore, the overall implementation cost of ammonia sensor-based characterization methods is high, making large-scale promotion difficult. Summary of the Invention
[0003] To address the problems existing in the background art, this invention provides a method for recognizing ammonia nitrogen stress behavior in red-spotted grouper based on embedded devices. The method constructs a multi-target tracking model for red-spotted grouper that can be directly run on embedded devices with limited computing power.
[0004] The technical solution adopted in this invention is:
[0005] The present invention provides a method for identifying ammonia nitrogen stress behavior in red-spotted grouper based on embedded devices, comprising:
[0006] 1) Collect videos of the behavior of red-spotted grouper during the breeding process and extract several video frames. After annotating each video frame, divide it into training set and validation set according to a preset ratio.
[0007] 2) Construct the target detection model YOLOv5_GA, the improved target tracking model LD_Ocsort, and the ammonia nitrogen stress behavior classification model. Input the training set and validation set into the target detection model YOLOv5_GA for training and optimization. Input the detection results output by the target detection model YOLOv5_GA during the training and optimization process into the improved target tracking model LD_Ocsort for training and optimization. Input the total number of body imbalances of red-spotted grouper output by the target detection model YOLOv5_GA during the training and optimization process and the displacement features of red-spotted grouper output by the improved target tracking model LD_Ocsort during the training and optimization process into the ammonia nitrogen stress behavior classification model for training and optimization. Stop training when the total loss of each model converges. Finally, obtain the trained target detection model YOLOv5_GA, the improved target tracking model LD_Ocsort, and the ammonia nitrogen stress behavior classification model.
[0008] 3) The trained target detection model YOLOv5_GA, the improved target tracking model LD_Ocsort, and the ammonia nitrogen stress behavior classification model are deployed on embedded devices in the red-spotted grouper farming site to achieve lightweight, accurate, and all-weather automatic assessment of the ammonia nitrogen stress behavior of red-spotted grouper. Video frames from the red-spotted grouper farming process are collected in real time by the embedded device and input into the trained target detection model YOLOv5_GA for processing. After processing, the detection results and the total number of body imbalances of the red-spotted grouper are output. The detection results are then input into the trained improved target tracking model LD_Ocsort for processing, which outputs the displacement features of the red-spotted grouper. The total number of body imbalances and displacement features are used together as a representation of the ammonia nitrogen stress behavior of the red-spotted grouper and input into the trained ammonia nitrogen stress behavior classification model for processing. After processing, the ammonia nitrogen stress behavior recognition results of the red-spotted grouper are output, thus realizing the recognition of ammonia nitrogen stress behavior in red-spotted grouper.
[0009] In step 1), the behavioral videos of the red-spotted grouper during the aquaculture process include behavioral videos under normal water quality conditions and under ammonia nitrogen stress conditions. After extracting several video frames from the behavioral videos, for each video frame, the position of each red-spotted grouper on the video frame is marked with a rectangle. The behavioral category of each red-spotted grouper in the video frame under normal water quality conditions is marked as non-imbalanced, and the behavioral category of each red-spotted grouper in the video frame under ammonia nitrogen stress conditions is marked as imbalanced.
[0010] In step 2), the target detection model YOLOv5_GA comprises an improved backbone network Ghostbackone, an improved progressive feature pyramid network AFPNeck (Asymptotic Feature Pyramid Network), and a detection head, connected in sequence. The improved backbone network Ghostbackone comprises a convolutional module CBS, four feature extraction Ghost modules, and a fast spatial pyramid pooling module SPPF (Spatial Pyramid Pooling-Fast), connected in sequence. The improved progressive feature pyramid network AFPNeck comprises three feature extraction GhostV2 operators, two adaptive spatial feature fusion ASFF_2 (Adaptively Spatial Feature Fusion_2) modules, two feature extraction G3GhostV2 modules, and three adaptive spatial feature fusion ASFF_3 (Adaptively Spatial Feature Fusion_3) modules. The outputs of the FeatureFusion_3 module, the second feature extraction Ghost module group, the third feature extraction Ghost module group, and the fast spatial pyramid pooling module SPPF are respectively input into three feature extraction GhostV2 operators. The output of the first feature extraction GhostV2 operator is input into two adaptive spatial feature fusion ASFF_2 modules, the output of the second feature extraction GhostV2 operator is input into two adaptive spatial feature fusion ASFF_2 modules, and the outputs of the two adaptive spatial feature fusion ASFF_2 modules are input into two feature extraction GhostV2 modules. In the ostV2 module, the output of the first feature extraction G3GhostV2 module is input into three adaptive spatial feature fusion ASFF_3 modules, the output of the second feature extraction G3GhostV2 module is input into three adaptive spatial feature fusion ASFF_3 modules, and the output of the third feature extraction GhostV2 operator is input into three adaptive spatial feature fusion ASFF_3 modules. The detection head part includes three convolutional layers. The outputs of the three adaptive spatial feature fusion ASFF_3 modules are input into the three convolutional layers for processing and then superimposed as the output of the object detection model YOLOv5_GA.
[0011] The convolutional module CBS (Conv2dBNSiLU) consists of a convolutional layer Conv2d, a batch normalization layer BN (Batch Normalization), and an activation function SiLU (Sigmoid Linear Unit) connected in sequence.
[0012] The object detection model YOLOv5_GA introduces the GhostV2 operator based on the YOLOv5 model and proposes a new C3Ghost feature extraction module to reduce the parameters and computational cost in the detection model. A progressive feature fusion method is constructed to achieve multi-scale fusion and enhance the feature fusion effect.
[0013] The feature extraction Ghost module group includes the feature extraction GhostV2 operator and the feature extraction G3GhostV2 module connected in sequence.
[0014] The feature extraction G3GhostV2 module includes three convolutional modules (CBS), a backbone network GhostV2backone, and a fusion function Concat. The inputs of the G3GhostV2 module are fed into the first and second convolutional modules (CBS), respectively. The output of the first convolutional module (CBS) is then fed into the backbone network GhostV2backone for further processing. The outputs of the two convolutional modules (CBS) and the backbone network GhostV2backone are fed into the fusion function Concat. The output of the fusion function Concat is then fed into the third convolutional module (CBS) for further processing, and its output is used as the output of the G3GhostV2 module.
[0015] In step 2), the improved target tracking model LD_Ocsort is specifically constructed by adding a FishReID (Fish Re-ID) network before the OCM (Observation-Centric Momentum) matching of the original target tracking model LD_Ocsort to extract appearance features from the input detection boxes, thereby constructing the improved target tracking model LD_Ocsort. The FishReID network includes a first 3×3 convolutional layer Con2d, a first backbone network Ghostbackone1, a second backbone network Ghostbackone2, three attention backbone groups, a second 1×1 convolutional layer Con2d, an 8×8 average pooling layer AvgPool, and a third 1×1 convolutional layer Con2d. The attention backbone groups include an attention mechanism CBAM (Convolutional Block Attention Module), a first backbone network Ghostbackone1, and a second backbone network Ghostbackone2, connected in sequence.
[0016] In step 2), the ammonia nitrogen stress behavior classification model is specifically a support vector machine (SVM) classification model.
[0017] Based on ammonia nitrogen stress experiments, features that can clearly characterize the ammonia nitrogen stress behavior of red-spotted grouper were proposed. Combining the proposed target detection model YOLOv5_GA and the improved target tracking model LD_Ocsort, displacement and body imbalance of red-spotted grouper were extracted as features of the number of red-spotted grouper. The above two features were used to construct an SVM classification model.
[0018] This invention first constructs and trains a lightweight red-spotted grouper target detection model, YOLOv5_GA, to detect the position of red-spotted grouper in video frames and identify those with body imbalance. Secondly, it constructs and trains a lightweight red-spotted grouper target tracking model, LD_Ocsort, to track the trajectory of red-spotted grouper in video frames. Then, it combines the YOLOv5_GA detection model and the LD_Ocsort tracking model to extract the displacement features and the total number of body imbalances of the red-spotted grouper to characterize its behavior. Next, it constructs an SVM-based classification model for red-spotted grouper ammonia stress behavior, and finally deploys the ammonia stress behavior recognition method on an embedded device.
[0019] The beneficial effects of this invention are:
[0020] Compared to traditional identification methods, which suffer from high labor intensity, slow detection speed, and high deployment costs, this invention creatively proposes a lightweight ammonia stress behavior identification method based on target detection extraction and trajectory by directly characterizing the ammonia stress behavior of red-spotted grouper. This method can be easily deployed on embedded devices and installed in the factory farming site of red-spotted grouper. It can meet the requirements of all-weather detection of ammonia stress behavior in red-spotted grouper without much labor or cost, thereby reducing the risk of ammonia stress in red-spotted grouper during the farming process. Attached Figure Description
[0021] Figure 1 This is an overall flowchart of the present invention;
[0022] Figure 2 This is a schematic diagram of the target detection model YOLOv5_GA constructed in this invention;
[0023] Figure 3 This is a schematic diagram of the FishReID appearance feature extraction network constructed in this invention;
[0024] Figure 4 This is a schematic diagram of the target tracking model LD_OCSORT constructed in this invention;
[0025] Figure 5 The image shows the recognition effect of the ammonia nitrogen stress behavior identification method proposed in this invention on the ammonia nitrogen stress behavior of red-spotted grouper.
[0026] Figure 6This is a schematic diagram illustrating the image acquisition and processing method of the present invention deployed at a red-spotted grouper farming site;
[0027] Figure 7 This is a schematic diagram illustrating the detection and tracking results of red-spotted grouper using the method of the present invention; wherein, Figure 7 Image (a) shows the test results of red-spotted grouper under normal water quality conditions. Figure 7 (b) shows the detection results of red-spotted grouper under ammonia nitrogen stress. Figure 7 (c) shows the tracking results of the red-spotted grouper under normal water quality conditions. Figure 7 (d) represents the tracking results of red-spotted grouper under ammonia nitrogen stress. Detailed Implementation
[0028] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0029] like Figure 1 As shown, the method for identifying ammonia nitrogen stress behavior in red-spotted grouper based on embedded devices according to the present invention includes:
[0030] 1) Collect videos of the behavior of red-spotted grouper during the breeding process and extract several video frames. After annotating each video frame, divide it into training set and validation set according to a preset ratio. In specific implementation, the training set, validation set and test set are divided into training set and validation set according to a ratio of 6:2:2.
[0031] In step 1), the behavioral videos of the red-spotted grouper during the aquaculture process include behavioral videos under normal water quality conditions and under ammonia nitrogen stress conditions. After extracting several video frames from the behavioral videos, for each video frame, the position of each red-spotted grouper on the video frame is marked with a rectangle. The behavior category of each red-spotted grouper in the video frame under normal water quality conditions is marked as non-imbalanced, and the behavior category of each red-spotted grouper in the video frame under ammonia nitrogen stress conditions is marked as imbalanced.
[0032] 2) Construct the target detection model YOLOv5_GA, the improved target tracking model LD_Ocsort, and the ammonia nitrogen stress behavior classification model. Input the training set and validation set into the target detection model YOLOv5_GA for training and optimization. Input the detection results output by the target detection model YOLOv5_GA during the training and optimization process into the improved target tracking model LD_Ocsort for training and optimization. Input the total number of body imbalances of red-spotted grouper output by the target detection model YOLOv5_GA during the training and optimization process and the displacement features of red-spotted grouper output by the improved target tracking model LD_Ocsort during the training and optimization process into the ammonia nitrogen stress behavior classification model for training and optimization. Stop training when the total loss of each model converges. Finally, obtain the trained target detection model YOLOv5_GA, the improved target tracking model LD_Ocsort, and the ammonia nitrogen stress behavior classification model.
[0033] like Figure 2As shown, in step 2), the target detection model YOLOv5_GA includes an improved backbone network Ghostbackone, an improved progressive feature pyramid network AFPNeck, and a detection head, connected in sequence. The improved backbone network Ghostbackone includes a convolutional module CBS, four feature extraction Ghost module groups, and a fast spatial pyramid pooling module SPPF, connected in sequence. The improved progressive feature pyramid network AFPNeck includes three feature extraction GhostV2 operators, two adaptive spatial feature fusion ASFF_2 modules, two feature extraction G3GhostV2 modules, and three adaptive spatial feature fusion ASFF_3 modules. The outputs of the second and third feature extraction Ghost module groups and the fast spatial pyramid pooling module SPPF are respectively input into the three feature extraction GhostV2 operators, and the output of the first feature extraction GhostV2 operator is respectively input into the three feature extraction GhostV2 operators. The outputs of the second feature extraction GhostV2 operator are fed into two adaptive spatial feature fusion ASFF_2 modules. The outputs of the two adaptive spatial feature fusion ASFF_2 modules are fed into two feature extraction G3GhostV2 modules. The outputs of the first feature extraction G3GhostV2 module are fed into three adaptive spatial feature fusion ASFF_3 modules. The outputs of the second feature extraction G3GhostV2 module are fed into three adaptive spatial feature fusion ASFF_3 modules. The output of the third feature extraction GhostV2 operator is fed into three adaptive spatial feature fusion ASFF_3 modules. The detection head consists of three convolutional layers. The outputs of the three adaptive spatial feature fusion ASFF_3 modules are fed into the three convolutional layers, processed, and superimposed before being output as the output of the object detection model YOLOv5_GA.
[0034] The convolutional module CBS consists of a convolutional layer Conv2d, a batch normalization layer BN, and an activation function SiLU connected in sequence.
[0035] The object detection model YOLOv5_GA introduces the GhostV2 operator based on the YOLOv5 model and proposes a new C3Ghost feature extraction module to reduce the parameters and computational cost in the detection model. A progressive feature fusion method is constructed to achieve multi-scale fusion and enhance the feature fusion effect.
[0036] In practice, the improved YOLOv5_GA was trained by dividing 8000 images into training, validation, and test sets in a 6:2:2 ratio. The momentum during training was set to 0.937, the initial learning rate to 0.01, the batch size to 16, and the input image size to 640×640. The stochastic gradient descent (SGD) optimizer was used for training, and training was stopped when the total loss of the model converged.
[0037] The feature extraction Ghost module group consists of the GhostV2 feature extraction operator and the G3GhostV2 feature extraction module connected in sequence. The G3GhostV2 feature extraction module includes three convolutional modules (CBS), a backbone network GhostV2backone, and a fusion function Concat. The inputs of the G3GhostV2 module are fed into the first and second convolutional modules (CBS), respectively. The output of the first convolutional module (CBS) is then fed into the backbone network GhostV2backone for further processing. The outputs of the two convolutional modules (CBS) and the backbone network GhostV2backone are jointly fed into the fusion function Concat. The output of the fusion function Concat is then fed into the third convolutional module (CBS) for further processing, and its output becomes the output of the G3GhostV2 module.
[0038] In step 2), the improved target tracking model LD_Ocsort is specifically constructed by adding a FishReID network before the OCM matching of the original target tracking model LD_Ocsort to extract appearance features from the input detection boxes, thereby constructing the improved target tracking model LD_Ocsort.
[0039] like Figure 3 As shown, the FishReID network for re-identification includes a first 3×3 convolutional layer Con2d, a first backbone network Ghostbackone1, a second backbone network Ghostbackone2, three attention backbone groups, a second 1×1 convolutional layer Con2d, an 8×8 average pooling layer AvgPool, and a third 1×1 convolutional layer Con2d connected in sequence; the attention backbone group includes the attention mechanism CBAM, the first backbone network Ghostbackone1, and the second backbone network Ghostbackone2 connected in sequence.
[0040] In step 2), the ammonia nitrogen stress behavior classification model is specifically a support vector machine (SVM) classification model. Based on the ammonia nitrogen stress experiment, features that can clearly characterize the ammonia nitrogen stress behavior of red-spotted grouper are proposed. Combining the proposed target detection model YOLOv5_GA and the improved target tracking model LD_Ocsort, the displacement and body imbalance of red-spotted grouper and the number of red-spotted grouper are extracted. The above two features are used to construct the SVM classification model.
[0041] 3) The trained target detection model YOLOv5_GA, the improved target tracking model LD_Ocsort, and the ammonia nitrogen stress behavior classification model are deployed on embedded devices in the red-spotted grouper farming site to achieve lightweight, accurate, and all-weather automatic assessment of the ammonia nitrogen stress behavior of red-spotted grouper. Video frames from the red-spotted grouper farming process are collected in real time by the embedded device and input into the trained target detection model YOLOv5_GA for processing. After processing, the detection results and the total number of body imbalances of the red-spotted grouper are output. The detection results are then input into the trained improved target tracking model LD_Ocsort for processing, which outputs the displacement features of the red-spotted grouper. The total number of body imbalances and displacement features are used together as a representation of the ammonia nitrogen stress behavior of the red-spotted grouper and input into the trained ammonia nitrogen stress behavior classification model for processing. After processing, the ammonia nitrogen stress behavior recognition results of the red-spotted grouper are output, thus realizing the recognition of ammonia nitrogen stress behavior in red-spotted grouper.
[0042] like Figure 4 As shown, the LD_Ocsort tracking process is as follows: First, the FishReID network of the target detection model detects the target bounding boxes in the current frame. At the same time, the target trajectory bounding boxes that have undergone three consecutive trajectory trackings and have been transformed from the provisional state to the deterministic state are predicted using a Kalman filter. Second, OCM associates the target prediction bounding boxes from the previous frame with the detection bounding boxes in the current frame, incorporating the momentum feature information, appearance similarity information, and cross-union ratio information of the prediction and detection bounding boxes into the matching cost matrix. Then, the Hungarian algorithm is used to assign IDs and track the targets. Finally, the unmatched prediction bounding boxes and unmatched detection bounding boxes are input into OCR. After obtaining the appearance similarity cost matrix of the unmatched prediction bounding boxes and unmatched detection bounding boxes, OCR uses the Hungarian algorithm to perform matching.
[0043] like Figure 5 The figure shows the recognition effect of the ammonia nitrogen stress behavior identification method proposed in this invention on the ammonia nitrogen stress behavior of red-spotted grouper. First, the field-collected video was divided into training and validation sets in a 7:3 ratio. Second, the two features extracted by the stress behavior characterization method—displacement and the number of body imbalances in red-spotted grouper—were input into the SVM classification model for training. The final classification results of the training set are shown in the figure. The accuracy rate on the validation set is 92.2%, which can accurately detect whether the red-spotted grouper population is under ammonia nitrogen stress.
[0044] like Figure 6As shown, this invention provides an embedded device image acquisition and processing method. The method for recognizing ammonia nitrogen stress behavior in red-spotted grouper is deployed on the embedded device Orin nano. A camera is installed at a fixed position via a truss directly above the high-level aquaculture pond where red-spotted grouper are raised. The camera faces downward toward the high-level aquaculture pond to capture a video of the red-spotted grouper being raised. The embedded device processes the video of the red-spotted grouper captured by the camera and then outputs the ammonia nitrogen stress behavior recognition result.
[0045] like Figure 7 of (a), Figure 7 (b) Figure 7 (c) and Figure 7 Figure (d) shows the schematic diagram of the detection and tracking results of the red-spotted grouper under normal water quality and ammonia nitrogen stress conditions using the method of the present invention. The comparison results between the present invention and other models are shown in Tables 1 and 2 below:
[0046] Table 1. Comparison Results of Different Detection Models
[0047]
[0048] Table 2. Comparison Results of Different Tracking Models
[0049]
[0050] As shown in the table above, the method of the present invention can achieve relatively lightweight and accurate detection of ammonia nitrogen stress behavior in red-spotted grouper.
Claims
1. A method for identifying ammonia nitrogen stress behavior in red-spotted grouper based on embedded devices, characterized in that, include: 1) Collect videos of the behavior of red-spotted grouper during the breeding process and extract several video frames. After annotating each video frame, divide it into training set and validation set according to a preset ratio. 2) Construct the target detection model YOLOv5_GA, the improved target tracking model LD_Ocsort, and the ammonia nitrogen stress behavior classification model. Input the training set and validation set into the target detection model YOLOv5_GA for training and optimization. Input the detection results output by the target detection model YOLOv5_GA during the training and optimization process into the improved target tracking model LD_Ocsort for training and optimization. Input the total number of body imbalances of the red-spotted grouper output by the target detection model YOLOv5_GA during the training and optimization process and the displacement features of the red-spotted grouper output by the improved target tracking model LD_Ocsort during the training and optimization process into the ammonia nitrogen stress behavior classification model for training and optimization. Stop training when the total loss of each model converges. Finally, obtain the trained target detection model YOLOv5_GA, the improved target tracking model LD_Ocsort, and the ammonia nitrogen stress behavior classification model. 3) The trained target detection model YOLOv5_GA, the improved target tracking model LD_Ocsort, and the ammonia nitrogen stress behavior classification model are deployed on an embedded device at the red-spotted grouper farming site. Video frames of the red-spotted grouper farming process are collected in real time by the embedded device and input into the trained target detection model YOLOv5_GA in the embedded device for processing. After processing, the detection results of the red-spotted grouper and the total number of body imbalances are output. The detection results of the red-spotted grouper are input into the trained improved target tracking model LD_Ocsort for processing. After processing, the displacement features of the red-spotted grouper are output. The total number of body imbalances and displacement features of the red-spotted grouper are used together as the ammonia nitrogen stress behavior representation of the red-spotted grouper and input into the trained ammonia nitrogen stress behavior classification model for processing. After processing, the ammonia nitrogen stress behavior recognition result of the red-spotted grouper is output, realizing the recognition of ammonia nitrogen stress behavior of red-spotted grouper. In step 2), the target detection model YOLOv5_GA includes an improved backbone network Ghostbackone, an improved progressive feature pyramid network AFPNeck, and a detection head, connected in sequence. The improved backbone network Ghostbackone includes a convolutional module CBS, four feature extraction Ghost module groups, and a fast spatial pyramid pooling module SPPF, connected in sequence. The improved progressive feature pyramid network AFPNeck includes three feature extraction GhostV2 operators, two adaptive spatial feature fusion ASFF_2 modules, two feature extraction G3GhostV2 modules, and three adaptive spatial feature fusion ASFF_3 modules. The outputs of the second and third feature extraction Ghost module groups and the fast spatial pyramid pooling module SPPF are respectively input into the three feature extraction GhostV2 operators, and the output of the first feature extraction GhostV2 operator is respectively input into the three feature extraction GhostV2 operators. The outputs of the second feature extraction GhostV2 operator are fed into two adaptive spatial feature fusion ASFF_2 modules. The outputs of the two adaptive spatial feature fusion ASFF_2 modules are then fed into two feature extraction G3GhostV2 modules. The outputs of the first feature extraction G3GhostV2 module are fed into three adaptive spatial feature fusion ASFF_3 modules. The outputs of the second feature extraction G3GhostV2 module are fed into three adaptive spatial feature fusion ASFF_3 modules. The output of the third feature extraction GhostV2 operator is fed into three adaptive spatial feature fusion ASFF_3 modules. The detection head consists of three convolutional layers. The outputs of the three adaptive spatial feature fusion ASFF_3 modules are fed into these three convolutional layers, processed, and then superimposed as the output of the object detection model YOLOv5_GA. In step 2), the improved target tracking model LD_Ocsort is specifically constructed by adding a FishReID re-identification network before the OCM matching of the original target tracking model Octosort to extract appearance features from the input detection boxes. The FishReID re-identification network consists of a first convolutional layer Con2d, a first backbone network Ghostbackone1, a second backbone network Ghostbackone2, three attention backbone groups, a second convolutional layer Con2d, an average pooling layer AvgPool, and a third convolutional layer Con2d, connected in sequence. The attention backbone groups consist of an attention mechanism CBAM, a first backbone network Ghostbackone1, and a second backbone network Ghostbackone2, connected in sequence.
2. The method for identifying ammonia nitrogen stress behavior in red-spotted grouper based on embedded devices according to claim 1, characterized in that: In step 1), the behavioral videos of the red-spotted grouper during the aquaculture process include behavioral videos under normal water quality conditions and under ammonia nitrogen stress conditions. After extracting several video frames from the behavioral videos, for each video frame, the position of each red-spotted grouper on the video frame is marked with a rectangle. The behavioral category of each red-spotted grouper in the video frame under normal water quality conditions is marked as non-imbalanced, and the behavioral category of each red-spotted grouper in the video frame under ammonia nitrogen stress conditions is marked as imbalanced.
3. The method for identifying ammonia nitrogen stress behavior in red-spotted grouper based on embedded devices according to claim 1, characterized in that: The feature extraction Ghost module group includes the feature extraction GhostV2 operator and the feature extraction G3GhostV2 module connected in sequence.
4. The method for identifying ammonia nitrogen stress behavior in red-spotted grouper based on embedded devices according to claim 1, characterized in that: The feature extraction G3GhostV2 module includes three convolutional modules (CBS), a backbone network GhostV2backone, and a fusion function Concat. The inputs of the G3GhostV2 module are fed into the first and second convolutional modules (CBS), respectively. The output of the first convolutional module (CBS) is then fed into the backbone network GhostV2backone for further processing. The outputs of the second convolutional module (CBS) and the backbone network GhostV2backone are fed into the fusion function Concat. The output of the fusion function Concat is then fed into the third convolutional module (CBS) for further processing, and its output is used as the output of the G3GhostV2 module.
5. The method for identifying ammonia nitrogen stress behavior in red-spotted grouper based on embedded devices according to claim 1, characterized in that: In step 2), the ammonia nitrogen stress behavior classification model is specifically a support vector machine (SVM) classification model.
