Fish behavior identification method and device, electronic equipment and storage medium

By acquiring multiple frames of image data and using correlation cost to match fish detection boxes and trajectories, the problems of low accuracy in fish behavior detection and easy trajectory interruption are solved, achieving high-precision behavior recognition and stable trajectory tracking for slender targets such as zebrafish.

CN121884099APending Publication Date: 2026-04-17GUANGXI SURUI BIOTECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGXI SURUI BIOTECHNOLOGY CO LTD
Filing Date
2026-01-09
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing technologies for fish behavior detection suffer from low detection accuracy and easy interruption of multi-target individual trajectory tracking. In particular, the detection rate of small-sized, slender zebrafish is insufficient, and they are easily interfered with by factors such as reflection and ripples, making it difficult to accurately identify complex behavioral events.

Method used

By acquiring multi-frame image data of the aquaculture area, a pre-trained target detection model is used to determine fish detection boxes. Based on the association cost, the detection boxes are matched with the motion trajectory to extract individual and group behavioral features. Multi-scale target detection model and trajectory prediction model are used to improve detection accuracy and trajectory stability.

Benefits of technology

It improves the accuracy of fish target detection, enhances the stability of long-term trajectories of multiple fish, and achieves accurate identification of trajectory-level fish behavior, making it suitable for behavioral research.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121884099A_ABST
    Figure CN121884099A_ABST
Patent Text Reader

Abstract

The invention discloses a fish behavior recognition method and device, electronic equipment and a storage medium. The method comprises the following steps: acquiring at least two frames of image data of a culture area at the current moment, and determining a detection frame of target fishes in the image data; determining an association cost between the detection frame and a different existing fish movement track, and adding the detection frame to the fish movement track based on the association cost; and determining individual behavior characteristics and group behavior characteristics of the target fishes according to the fish movement tracks. According to the technical scheme of the embodiment of the invention, the detection frame of the target fish in the image data is determined, so that the fish target detection precision can be improved; according to the method, the association cost of the detection frame and different existing fish movement tracks is determined, and the detection frame is added to the fish movement tracks based on the association cost, so that the stability of a plurality of fish long-term tracks can be remarkably enhanced, and track-level fish behavior identification oriented to behavior research is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of behavior detection and computer vision technology, and in particular to a method, apparatus, electronic device and storage medium for fish behavior recognition. Background Technology

[0002] With the widespread application of zebrafish in research fields such as toxicology, pharmacodynamics, neuroscience and environmental science, researchers often need to record and analyze the behavioral changes of zebrafish under different drug exposures, water quality conditions, light conditions and stress stimuli in the daily management of fish houses and various behavioral experiments.

[0003] However, existing technical solutions have significant limitations: methods relying on manual observation or simple video statistics are labor-intensive and highly subjective; behavior analysis based on general target detection and multi-target tracking frameworks has insufficient detection rate for small, slender zebrafish targets and is easily affected by factors such as reflection and ripples; behavior recognition methods based on single-frame or short-segment classification struggle to accurately identify behavioral events that strongly depend on trajectory evolution, such as freezing, rapid swimming, startling, escape, swarming, and dispersal. Therefore, improving the accuracy of fish target detection, enhancing the stability of long-term trajectories of multiple fish, and achieving trajectory-level fish behavior recognition for behavior research have become key technical problems urgently needing to be solved in this field. Summary of the Invention

[0004] This invention provides a method, device, electronic device, and storage medium for fish behavior recognition, in order to solve the problems of low accuracy in fish behavior detection and easy interruption in multi-target individual trajectory tracking.

[0005] According to one aspect of the present invention, a method for fish behavior recognition is provided, the method comprising:

[0006] Acquire at least two frames of image data of the aquaculture area at the current moment, and determine the detection box of the target fish within the image data;

[0007] Determine the association cost between the detection box and different existing fish movement trajectories, and add the detection box to the fish movement trajectory based on the association cost;

[0008] The individual and group behavioral characteristics of the target fish are determined based on the movement trajectories of each fish.

[0009] According to another aspect of the present invention, a fish behavior recognition device is provided, the device comprising:

[0010] The fish detection module is used to acquire at least two frames of image data of the aquaculture area at the current moment and determine the detection box of the target fish within the image data;

[0011] The trajectory generation module is used to determine the association cost between the detection box and different existing fish movement trajectories, and add the detection box to the fish movement trajectory based on the association cost;

[0012] The behavior analysis module is used to determine the individual and group behavior characteristics of the target fish based on the movement trajectories of each fish.

[0013] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0014] At least one processor; and

[0015] A memory communicatively connected to the at least one processor; wherein,

[0016] The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the fish behavior recognition method according to any embodiment of the present invention.

[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute the fish behavior recognition method according to any embodiment of the present invention.

[0018] The technical solution of this invention can improve the accuracy of fish target detection by determining the detection box of the target fish in the image data; by determining the association cost between the detection box and different existing fish movement trajectories, and adding the detection box to the fish movement trajectory based on the association cost, the stability of long-term trajectories of multiple fish can be significantly enhanced, achieving the beneficial effect of realizing trajectory-level fish behavior recognition for behavior research.

[0019] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 This is a flowchart of a fish behavior recognition method provided in Embodiment 1 of the present invention;

[0022] Figure 2 This is a flowchart of a fish behavior recognition method provided in Embodiment 2 of the present invention;

[0023] Figure 3 This is a flowchart of a fish behavior recognition method provided in Embodiment 3 of the present invention;

[0024] Figure 4 This is a schematic diagram of a fish behavior recognition device according to Embodiment 4 of the present invention;

[0025] Figure 5 This is a schematic diagram of the structure of an electronic device that implements the fish behavior recognition method of Embodiment 5 of the present invention. Detailed Implementation

[0026] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0027] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0028] Example 1

[0029] Figure 1 This is a flowchart illustrating a fish behavior recognition method according to Embodiment 1 of the present invention. This embodiment is applicable to situations involving fish behavior recognition. The method can be executed by a fish behavior recognition device, which can be implemented in hardware and / or software and can be configured in an electronic device. Figure 1 As shown, the method includes:

[0030] S110. Obtain at least two frames of image data of the aquaculture area at the current moment, and determine the detection box of the target fish in the image data.

[0031] The breeding area can be understood as the physical space containing the target fish's habitat, and can include aquariums, home fish tanks, breeding ponds, experimental fish ponds, etc. At least two frames of image data can be understood as at least two digital images captured by an image acquisition device within a certain time period. The target fish can be understood as the individual or group of fish to be identified, and can include zebrafish, killifish, and wrasse, etc. The detection box can be understood as the bounding box that identifies the location of the target fish in the digital image captured by the image acquisition device, and the bounding box can include rectangular boxes, circular boxes, and other arbitrary shapes.

[0032] Specifically, image acquisition devices are deployed in the aquaculture area to acquire at least two frames of image data at a preset sampling frequency. The deployment location can be adjusted based on the size of the aquaculture area, the species of the target fish, and the surrounding environment. The sampling frequency can be determined based on the size and swimming speed of the target fish. Deployment locations may include directly above the aquaculture area, at the bottom of the aquaculture area, or on the side wall of the aquaculture area. The image acquisition devices may include cameras, digital cameras, industrial cameras, etc. After obtaining at least two frames of image data, a pre-trained target detection model is used to identify and locate all individual target fish in each frame, thereby determining the detection bounding boxes for the target fish within the image data. The target detection model may include YOLOv5, YOLOv8, Faster R-CNN, etc.

[0033] S120. Determine the association cost between the detection box and different existing fish movement trajectories, and add the detection box to the fish movement trajectory based on the association cost.

[0034] Here, fish movement trajectory can be understood as the movement trajectory generated by the target fish living freely in the breeding area. Association cost can be understood as an evaluation index used to quantify the degree of matching between the current detection box and other existing fish movement trajectories. Association cost can be calculated based on factors such as the similarity of appearance features, spatial distance, and biological behavior between the target fish and other existing fish.

[0035] Specifically, the association cost between the detection box of the target fish and different existing fish movement trajectories is calculated, and the detection box and fish movement trajectory are optimally matched based on the association cost to obtain the fish movement trajectory that matches each detection box. The detection box is then added to the corresponding matching fish movement trajectory.

[0036] S130. Determine the individual and group behavioral characteristics of the target fish based on the movement trajectories of each fish.

[0037] Individual behavioral characteristics can be understood as a set of parameters used to describe and quantify the movement of a single target fish. These characteristics may include instantaneous velocity, average velocity, velocity variance, instantaneous acceleration, rate of change of acceleration, turning angle, rate of change of direction, trajectory curvature, and number of turns. Group behavioral characteristics can be understood as a set of parameters used to describe and quantify the interrelationships among multiple target fish individuals. These characteristics may include the distribution of inter-individual spacing, local group density, overall group density, centroid distance between individuals and the group, and the trend of change in the centroid distance between individuals and the group.

[0038] Specifically, for each fish movement trajectory obtained, individual fish behavioral characteristics are determined, including instantaneous speed, average speed, speed variance, instantaneous acceleration, rate of change of acceleration, turning angle, rate of change of direction, trajectory curvature, and number of turns. Group fish behavioral characteristics are also determined, including distribution of inter-individual distance, local group density, overall group density, distance between the centroid of an individual and the group, and the trend of change of the distance between the centroid of an individual and the group.

[0039] The technical solution of this invention acquires at least two frames of image data of the aquaculture area at the current moment, determines the detection box of the target fish within the image data, then determines the association cost between the detection box and different existing fish movement trajectories, and adds the detection box to the fish movement trajectory based on the association cost. Finally, it determines the individual and group behavioral characteristics of the target fish based on each fish movement trajectory. This technical solution improves the accuracy of fish target detection by determining the detection box of the target fish within the image data; and significantly enhances the stability of long-term trajectories of multiple fish by determining the association cost between the detection box and different existing fish movement trajectories and adding the detection box to the fish movement trajectory based on the association cost, thus achieving trajectory-level fish behavior recognition for behavioral research.

[0040] Example 2

[0041] Figure 2 This is a flowchart of a fish behavior recognition method provided in Embodiment 2 of the present invention. This embodiment further refines the above embodiments:

[0042] like Figure 2 As shown, the method includes:

[0043] S210. Collect image data of the breeding area at the current moment according to the preset frame rate, and arrange the image data of each frame in order of collection time into an image frame sequence.

[0044] The preset frame rate can be understood as the image acquisition frequency pre-set according to the specific fish behavior recognition requirements. The image acquisition frame rate can be dynamically adjusted according to the activity level of the target fish and the required accuracy of behavior recognition. The higher the activity level of the target fish, the higher the image acquisition frame rate; the higher the required accuracy of the target fish behavior recognition, the higher the image acquisition frame rate. The image frame sequence can be understood as a series of image data units arranged in chronological order, with each frame of image data carrying corresponding timestamp information.

[0045] Specifically, image acquisition devices are deployed in the aquaculture area to collect image data of the area at the current moment according to a preset frame rate. The deployment location can be adjusted based on the size of the aquaculture area, the species of the target fish, and the surrounding environment. The preset frame rate can be determined based on the size of the target fish, its swimming speed, and other factors. Subsequently, each frame of image data is timestamped and sorted according to the chronological order of its acquisition time to obtain an image frame sequence.

[0046] S220. Call the pre-trained multi-scale target detection model to identify the image frame sequence and obtain the detection box of the target fish.

[0047] The pre-trained multi-scale object detection model can be understood as a neural network model specifically designed for detecting fish targets. This model includes at least a backbone network, a multi-scale feature fusion structure, and an object detection module. The multi-scale feature fusion structure may include feature extraction layers, pooling layers, and upsampling layers containing 2×2 and 3×3 convolutional kernels. The object detection module may include multi-scale convolutional kernels, which can be 1×1, 2×2, or 3×3 kernels, with the size of the kernels matching the pixel size of the target fish. An image frame sequence can be understood as a series of image data units arranged chronologically, with each frame carrying a corresponding timestamp.

[0048] Specifically, the image frame sequence arranged in chronological order of acquisition time is input frame by frame into a pre-trained multi-scale target detection model. The multi-scale target detection model performs feature extraction, multi-scale feature fusion, and target detection on each frame of image data, and then outputs an image frame sequence that identifies the bounding box of the target fish location in the output layer of the multi-scale target detection model.

[0049] S230. Extract the trajectory features of the fish's movement trajectory and the fish features of the detection box.

[0050] Trajectory features can be understood as parameter information extracted from the continuous movement trajectory of an individual target fish that characterizes the movement characteristics of that individual fish or the characteristics of the group. This parameter information can include average velocity, acceleration, rate of change of direction of movement, position sequence, etc. Fish features can be understood as features extracted from the image region defined by the detection box that characterize the static and dynamic attributes of the target fish. Fish features can include appearance color features, morphological contour features, texture features, posture features, etc.

[0051] Specifically, fish movement trajectories are extracted and established from image frame sequences arranged in chronological order of acquisition time. The image frame sequences arranged in chronological order of acquisition time are processed by a multi-scale target detection model to obtain a target fish detection box sequence. The target fish detection box sequence is then processed by a pre-trained multi-scale feature extraction network to extract the trajectory features of the fish movement trajectory. Furthermore, temporal kinematic parameters are calculated based on the target fish detection box sequence to obtain the fish features corresponding to the target fish detection box.

[0052] S240. Determine the association cost between each detection box and each fish movement trajectory based on the trajectory features of each fish movement trajectory and the fish features of each detection box.

[0053] Trajectory features can be understood as temporal parameters extracted from the continuous movement trajectory of a target fish individual that characterize the movement features of that individual. These temporal parameters may include average velocity, acceleration, rate of change of movement direction, and position sequence. Association cost can be understood as an evaluation metric used to quantify the degree of matching between the current detection box and other existing fish movement trajectories. Association cost can include fish features and trajectory features, determining the quantitative cost of assigning the fish features to the aforementioned trajectory features of a fish movement trajectory. This association cost may include one or more of the following quantitative metrics: similarity in appearance features between the detection box and each detection box within the fish movement trajectory, spatial distance, and biological behavioral similarity.

[0054] Specifically, temporal parameters that characterize the movement characteristics of the target fish individual are extracted from the continuous movement trajectory of the target fish individual as trajectory features of the fish movement trajectory. Features that characterize the static and dynamic attributes of the target fish are extracted from the image region defined by the detection box as fish features of the detection box. The association cost between each detection box and each fish movement trajectory is determined based on the trajectory features of each fish movement trajectory and the fish features of each detection box. The association cost may include one or more of the following quantitative indicators: similarity of appearance features between the detection box and each detection box within the fish movement trajectory, spatial distance, biological behavior similarity, etc.

[0055] For example, the trajectory features of each fish's motion trajectory and the fish features of each detection box in the image frame sequence are obtained according to a multi-scale feature extraction model. The distance between the trajectory features of each fish's motion trajectory and the fish features of each detection box in the feature space is calculated as the appearance similarity association cost, where the distance can include cosine distance, Euclidean distance, etc. The current motion state of the target fish is calculated based on the trajectory features of each fish's motion trajectory, and the expected position of the target fish in this image frame is predicted. The expected position of the target fish in this image frame and the actual position of the detection box are calculated to obtain the spatial location distance cost. The appearance similarity association cost and the spatial location distance cost are weighted and fused to form the association cost. The association costs between all detection boxes and all fish motion trajectories in the image frame sequence constitute an association cost matrix.

[0056] S250. Based on the association cost of each group, perform optimal matching between the detection box and the fish movement trajectory to obtain the matching fish movement trajectory corresponding to each detection box.

[0057] The association cost can be understood as an evaluation metric used to quantify the degree of matching between the current detection box and other existing fish movement trajectories. The association cost can be calculated based on factors such as the similarity of appearance features, spatial distance, and biological behavior between the target fish and other existing fish. Optimal matching can be understood as, from a global perspective, finding the fish movement trajectory with the minimum overall association cost among all existing fish movement trajectories that corresponds one-to-one with all detection boxes. Matched fish movement trajectories can be understood as existing fish movement trajectories belonging to the same target fish individual as the current detection box, selected through optimal matching.

[0058] Specifically, the Hungarian algorithm or other optimal matching methods are used to perform optimal matching between the fish movement trajectory and the detected target in the current detection box. The matching is based on the trajectory features of each fish movement trajectory and the fish features of each detection box, which determine the association cost between each detection box and each fish movement trajectory. The fish movement trajectory with the minimum association cost corresponding to each detection box is found, and thus the matched fish movement trajectory corresponding to each detection box is obtained.

[0059] S260. Add the detection boxes to the corresponding matching fish movement trajectories.

[0060] Among them, matching fish movement trajectories can be understood as selecting existing fish movement trajectories that belong to the same target fish individual as the current detection box through optimal matching.

[0061] Specifically, after each detection box matches the optimal fish movement trajectory, the detection box is added to the existing fish movement trajectories of the corresponding individual fish belonging to the same target fish, that is, matching the fish movement trajectory.

[0062] S270. Determine the individual and group behavioral characteristics of the target fish based on the movement trajectories of each fish.

[0063] Individual behavioral characteristics can be understood as a set of parameters used to describe and quantify the movement of a single target fish. These characteristics may include instantaneous velocity, average velocity, velocity variance, instantaneous acceleration, rate of change of acceleration, turning angle, rate of change of direction, trajectory curvature, and number of turns. Group behavioral characteristics can be understood as a set of parameters used to describe and quantify the interrelationships among multiple target fish individuals. These characteristics may include the distribution of inter-individual spacing, local group density, overall group density, centroid distance between individuals and the group, and the trend of change in the centroid distance between individuals and the group.

[0064] Specifically, for each fish movement trajectory obtained, individual fish behavioral characteristics are determined, including instantaneous speed, average speed, speed variance, instantaneous acceleration, rate of change of acceleration, turning angle, rate of change of direction, trajectory curvature, and number of turns. Group fish behavioral characteristics are also determined, including distribution of inter-individual distance, local group density, overall group density, distance between the centroid of an individual and the group, and the trend of change of the distance between the centroid of an individual and the group.

[0065] The technical solution of this invention involves collecting image data of the aquaculture area at the current moment according to a preset frame rate, arranging each frame of image data into an image frame sequence according to the acquisition time, and then calling a pre-trained multi-scale target detection model to identify the image frame sequence to obtain the detection box of the target fish. The trajectory features of the fish's movement trajectory and the fish features of the detection box are then extracted. Based on the trajectory features of each fish's movement trajectory and the fish features of each detection box, the association cost between each detection box and each fish's movement trajectory is determined. Then, based on each set of association costs, the detection box and the fish's movement trajectory are optimally matched to obtain the matched fish movement trajectory corresponding to each detection box. The detection boxes are then added to the corresponding matched fish movement trajectories. Finally, based on each fish's movement trajectory, the individual behavioral characteristics and group behavioral characteristics of the target fish are determined. The above technical solution improves the accuracy of fish target detection by calling a pre-trained multi-scale target detection model to identify image frame sequences and obtain detection boxes for target fish. Then, it extracts the trajectory features of fish movement trajectories and the fish features of detection boxes. By determining the association cost between each detection box and each fish movement trajectory based on the trajectory features of each fish movement trajectory and the fish features of each detection box, the optimal match between the detection box and the fish movement trajectory can be obtained, thereby improving the accuracy of fish movement trajectory generation, enhancing the stability of long-term trajectories of multiple fish, and realizing trajectory-level fish behavior recognition for behavioral research.

[0066] Furthermore, based on the above embodiments of the invention, the individual and group behavioral characteristics of the target fish are determined according to the movement trajectories of each fish, including:

[0067] Extract at least one of the following parameters from the movement trajectory of each fish as individual behavioral characteristics: instantaneous velocity, average velocity, velocity variance, instantaneous acceleration, rate of change of acceleration, turning angle, rate of change of direction, trajectory curvature, and number of turns.

[0068] Based on the movement trajectory statistics of each fish species, at least one of the following factors is used as the characteristic of group behavior: distribution of inter-individual distance, local group density, overall group density, centroid distance between individuals and groups, and the changing trend of centroid distance between individuals and groups.

[0069] Instantaneous velocity, average velocity, and velocity variance are used to quantify the intensity of the target fish's movement. Instantaneous acceleration and rate of change of acceleration are used to quantify the rapidity or intensity of the target fish's movement. Turning angle, rate of change of direction, and trajectory curvature are used to describe the complexity of the target fish's movement path and directional preference. The number of turnarounds reflects the target fish's wandering or exploratory behavior in a specific area. The distribution of inter-individual spacing is used to quantify the closeness of the spatial relationships between individuals in the target fish group. Local group density and overall group density are used to measure the aggregation state of the target fish group at different spatial scales. The changing trends of the centroid distance between an individual and the group and the centroid distance between an individual and the group are used to reflect the consistency, following tendency, or tendency to break away from the target fish group relative to the target fish group.

[0070] Specifically, for each fish movement trajectory obtained, individual fish behavioral characteristics are determined, including instantaneous speed, average speed, speed variance, instantaneous acceleration, rate of change of acceleration, turning angle, rate of change of direction, trajectory curvature, and number of turns. Group fish behavioral characteristics are also determined, including distribution of inter-individual distance, local group density, overall group density, distance between the centroid of an individual and the group, and the trend of change of the distance between the centroid of an individual and the group.

[0071] Furthermore, based on the above embodiments, the invention also includes:

[0072] If no detection box is added to the fish's movement trajectory at the current moment, a predicted detection box is generated based on the fish's movement trajectory prediction, and the occlusion count of the fish's movement trajectory is obtained;

[0073] If the occlusion count does not exceed the threshold, the predicted detection box is added to the fish's motion trajectory, and the occlusion count is incremented automatically.

[0074] If the occlusion count exceeds the threshold, the generation of the fish's movement trajectory will be terminated.

[0075] In this context, the predicted detection box can be understood as the bounding box at the target fish's position in the current image frame, calculated by the system based on the target fish's historical movement trajectory and using the motion prediction model, when the target fish is not successfully detected by the pre-trained multi-scale target detection model in the current image frame due to occlusion, fast movement speed, motion blur, etc. The bounding box can include rectangles, circles, and other arbitrary shapes. The occlusion count represents the number of times the target fish is occluded or undetected when no matching detection box is obtained for its movement trajectory. The occlusion count can also be understood as the cumulative number of frames in a target fish's movement trajectory where the target fish is not successfully matched by an actual detection box. The threshold can be understood as a preset positive integer upper limit based on the actual application scenario, used to specify the number of times a target fish's movement trajectory is not successfully matched by an actual detection box.

[0076] The upper limit of a positive integer is set based on the actual application scenario, which is the number of times a target fish's movement trajectory is not successfully matched by the actual detection box.

[0077] Specifically, when a target fish is not successfully detected by the pre-trained multi-scale target detection model in the current image frame due to occlusion, high movement speed, motion blur, or other reasons, the system uses a motion prediction model to calculate the predicted detection box at the target fish's position in the current image frame based on the target fish's historical movement trajectory. The system also records the total number of occlusions along the target fish's movement trajectory. The prediction model can include recurrent neural networks, temporal neural networks, etc. Then, it determines whether the total number of occlusions along the target fish's movement trajectory exceeds a threshold. If the occlusion count does not exceed the threshold, the predicted detection box is added to the fish's movement trajectory, and the occlusion count is incremented by 1. If the occlusion count exceeds the threshold, the generation of the fish's movement trajectory is terminated.

[0078] Furthermore, based on the above embodiments, the invention also includes at least one of the following:

[0079] According to the preset state machine, the behavioral feature patterns corresponding to individual behavioral features and group behavioral features are determined, wherein the feature patterns include at least one of the following: freezing, rapid swimming, startling, escape, gathering, and dispersing;

[0080] Generate behavioral feature patterns corresponding to fish movement trajectories based on a temporal network model.

[0081] The preset state machine can be understood as a behavior discriminator that determines the corresponding typical fish behavior states or events based on individual and group behavioral characteristics. Behavioral characteristic patterns can be understood as typical fish behavior states or events identified by the preset state machine that have clear biological significance and statistical significance. Characteristic patterns include at least one of the following: freezing, rapid swimming, startled, escape, swarming, and dispersal. Freezing can be understood as a behavior state in which the target fish's movement speed remains below a very low threshold and its displacement is close to zero for a period of time. Rapid swimming and startled swimming can be understood as behavior states in which the target fish undergoes drastic changes in acceleration or movement direction within a short period of time. Escape can be understood as a behavior state in which the target fish moves at a sustained high speed in a specific direction. Swarming and dispersal can be understood as a collective behavior state in which the distance between individuals within a group of target fish is significantly less than or greater than the normal range, and the movement direction shows high or low consistency. Temporal neural network models can be understood as neural networks capable of analyzing and modeling relationships that change over time. The input data for temporal neural networks contains data with temporal relationships. The network architecture of a temporal neural network is an encoder-decoder architecture, which includes 3×3 convolutional layers, 4×4 convolutional layers, pooling layers, fully connected layers, and an attention mechanism. Temporal neural network models are used to map sequentially input fish movement trajectories to corresponding behavioral feature patterns. Through temporal data, temporal neural networks optimize network parameters using backpropagation of a loss function, either cyclically or iteratively. Temporal neural network models can include recurrent neural networks, long short-term memory networks, and temporal convolutional networks, among others.

[0082] Specifically, the preset state machine receives feature vectors containing individual fish behavior characteristics and group behavior characteristics, and determines the feature patterns corresponding to the individual fish behavior characteristics and group behavior characteristics based on the feature vectors; the temporal network model automatically learns the context information in the fish movement trajectory sequence and generates the behavior feature patterns corresponding to the fish movement trajectory, wherein the feature patterns include at least one of freezing, rapid swimming, startling, escaping, swarming and dispersing.

[0083] Example 3

[0084] Figure 3 This is a flowchart of a fish behavior recognition method provided in Embodiment 3 of the present invention.

[0085] For details, see Figure 3 The flowchart of a fish behavior recognition method described in this embodiment is shown below. The specific steps for implementing zebrafish behavior recognition based on the fish behavior recognition method described in this embodiment are as follows:

[0086] Step S1: Collect video footage of zebrafish and information on experimental conditions.

[0087] We acquired video frame sequences from zebrafish aquariums, and selected timestamp information synchronized with the videos, along with experimental condition labels, for subsequent behavioral analysis and data annotation. The video resolution ranged from 1280×720 to 1920×1080, with a frame rate of 15–30 FPS. Experimental condition labels included lighting conditions, drug treatment regimens, and stimulation time points.

[0088] Step S2: Perform small target detection on zebrafish based on a lightweight multi-scale model.

[0089] Each frame of image is input into a lightweight multi-scale object detection model, which outputs the zebrafish bounding box and confidence score.

[0090] The lightweight multi-scale target detection model includes a lightweight backbone network, a multi-scale feature fusion structure, and a small target detection enhancement module, specifically:

[0091] The lightweight backbone network employs depthwise separable convolutions and pointwise convolutions to construct a low-parameter backbone network, extracting multi-level feature maps. The multi-scale feature fusion structure utilizes feature pyramids or other multi-scale fusion methods to fuse high-resolution detail features with low-resolution, high-semantic features, generating multi-scale feature maps suitable for small target detection. The small target detection enhancement module is specifically designed to improve the recall and accuracy for slender targets like zebrafish by optimizing anchor box aspect ratios, scale settings, local feature enhancement convolution modules, and a lightweight attention mechanism. Specifically, the specialized design refers to setting multiple anchor boxes with aspect ratios of 2:1, 3:1, and 4:1, and corresponding height scales of 16–64 pixels for the slender shape of the zebrafish, embedding them into 3×3 depthwise separable convolution residual blocks in the high-resolution feature map branch to enhance local texture and edge information. A lightweight attention submodule, composed of channel attention and spatial attention, is used to highlight the zebrafish target region and suppress background noise such as water surface reflections and bubbles.

[0092] To adapt to edge device deployment, the aforementioned lightweight multi-scale target detection model will undergo further processing such as structural pruning, parameter quantization, knowledge distillation, batch normalization fusion, and operator fusion to reduce computational load and storage overhead, enabling real-time inference of video.

[0093] Step S3: Temporal tracking and trajectory identification maintenance based on multi-feature fusion.

[0094] At any given moment, the detection results obtained by small target detection of zebrafish based on the lightweight multi-scale model are associated with the trajectory set of the previous moment to construct a multi-feature association cost matrix. Each element of the association cost matrix represents the association cost between the trajectory and the detected target. The association cost matrix includes at least two or more of the following features: spatial location features, velocity features, motion direction features, and trajectory history features.

[0095] Among them, the spatial location feature is obtained by the intersection-union ratio of the trajectory prediction box and the current detection box at the previous moment and the Euclidean distance of the center point; the velocity feature is the average velocity vector estimated based on the displacement and time interval of the trajectory in the most recent image frames; the motion direction feature is estimated by the position change of the trajectory in the most recent image frames; the trajectory history feature is used to give higher matching priority to long-term stable trajectories, and the trajectory history feature can include trajectory length, stability, recent occlusion, etc.

[0096] The aforementioned features are combined according to preset weights or learnable weights to obtain a cost value. Then, the trajectory is matched one-to-one with the current detected target using the Hungarian algorithm, auction algorithm, or threshold-based greedy matching algorithm. For successfully matched trajectories, their position, velocity, direction, and other states are updated. For unmatched detection results, new trajectories are created and new identifiers are assigned. For trajectories that have not been matched for multiple consecutive frames, a lifetime determination is performed and the trajectories are terminated.

[0097] Step S4: Occlusion recovery and trajectory reconnection based on state prediction.

[0098] To improve trajectory continuity in situations such as short-term occlusion, fish partially swimming out of the field of view, or loss of detection due to reflective interference, this invention maintains a state vector for each trajectory and uses a linear state-space model, a Kalman filter model, or a lightweight temporal prediction model to represent the current position and velocity of the zebrafish.

[0099] When a trajectory fails to match any detected target in the current frame, the state model is used to predict the trajectory's expected position in one or more subsequent frames. This occlusion status is then marked on the trajectory, and the occlusion count is incremented. Within the occlusion tolerance period, detected targets that are close to the predicted position and consistent with the trajectory's history in spatial and motion features are preferentially assigned to the trajectory, enabling trajectory recovery and reconnection. If the occlusion count exceeds a preset threshold and no match is successfully found, the trajectory is terminated.

[0100] Step S5: Behavioral event recognition based on trajectory temporal features.

[0101] Based on obtaining multiple stable zebrafish trajectories, individual and group behavioral features are extracted from the trajectory time series, including but not limited to individual movement features and group relationship features.

[0102] Individual motion characteristics include instantaneous velocity, average velocity, velocity variance, instantaneous acceleration, rate of change of acceleration, turning angle, rate of change of direction, trajectory curvature, number of turns, etc.; group relationship characteristics include the distribution of distances between individuals, local and overall group density, distance between individuals and the center of mass of the group and its changing trend, etc.

[0103] Based on the above characteristics, a behavioral event recognition mechanism is constructed, including: using a finite state machine that combines rules and thresholds to formulate corresponding feature patterns for behaviors such as freezing, rapid swimming / startling, escape, and clustering / dispersal, or using a lightweight temporal model to classify trajectory feature sequences, wherein the lightweight temporal model may include one-dimensional convolutional networks, lightweight recurrent networks, etc.

[0104] The behavioral event recognition module outputs the event type, start time, end time, individual identifiers and / or group identifiers involved in each behavioral event, thus forming a complete behavioral event timeline.

[0105] Step S6: Optimize reasoning and scheduling for edge devices.

[0106] To adapt to embedded low-computing-power devices, this embodiment optimizes the unified inference scheduling of the detection, tracking, and behavior recognition modules, including:

[0107] Model-level optimization: Pruning, quantization, and distillation operations are performed on the detection model and optional time series models. The fusion methods in the inference stage include batch normalization fusion, operator fusion, etc.

[0108] Dynamic frame rate adjustment: The frequency of the detection module is dynamically adjusted according to the overall motion intensity within a short time window. The detection frame rate is reduced when the fish activity is low, and the frame rate is increased when violent behavior or key experimental time windows are detected. The overall motion intensity can include the average speed of the fish in the picture, changes in the area of ​​the activity area, etc.

[0109] Region of Interest (ROI) Detection: The fish's activity area is determined by using historical trajectory information and motion detection results. At the same time, high-frequency detection is performed only on these ROIs, while the detection frequency of background areas is reduced or no detection is performed.

[0110] Module periodic invocation: The detection module is set to be invoked at high frequency, the time-series tracking module performs frame-by-frame updates and lightweight calculations, and the behavior event recognition module performs batch processing analysis of trajectory features according to a fixed time window.

[0111] Through the above multi-level optimization strategies, the entire algorithm can achieve long-term stable operation on edge devices.

[0112] Step S7: Output and system integration of results.

[0113] This method ultimately outputs long-term trajectory data for each zebrafish, a timeline of behavioral events for each zebrafish and the fish population, and behavioral statistical indicators. These results can be directly integrated with fish house management systems or zebrafish health prediction models. The long-term trajectory data includes the movement time, movement location, and movement speed of each zebrafish. The timeline of behavioral events for each zebrafish and the fish population can include the type of behavioral event, the start and end time of the behavioral event, and related identifiers. The behavioral statistical indicators include the number of behavioral events, average duration, activity level, and changes in grouping degree.

[0114] The technical solution of this invention uses zebrafish video footage and experimental condition information to analyze and label subsequent zebrafish behavior; by using a lightweight multi-scale model for small target detection in zebrafish, the recall and accuracy of detecting slender targets like zebrafish can be improved; through occlusion recovery and trajectory reconnection based on state prediction, trajectory interruptions and frequent generation of new labels caused by short-term occlusion or detection gaps can be significantly reduced; through behavioral event recognition based on trajectory temporal features, a complete behavioral event timeline can be formed; through reasoning and scheduling optimization for edge devices, the entire algorithm can achieve long-term stable operation on edge devices; and through result output and system integration, behavioral data support can be provided for toxicological experimental endpoint analysis, drug efficacy screening, chronic stress research, and daily health monitoring.

[0115] Example 4

[0116] Figure 4 This is a schematic diagram of a fish behavior recognition device provided in Embodiment 4 of the present invention. Figure 4 As shown, the device includes: a fish detection module 410, a trajectory generation module 420, and a behavior analysis module 430; wherein,

[0117] The fish detection module 410 is used to acquire at least two frames of image data of the aquaculture area at the current moment and determine the detection box of the target fish in the image data.

[0118] The trajectory generation module 420 is used to determine the association cost between the detection box and different existing fish movement trajectories, and add the detection box to the fish movement trajectory based on the association cost.

[0119] The behavior analysis module 430 is used to determine the individual and group behavior characteristics of the target fish based on the movement trajectories of each fish.

[0120] The technical solution of this invention involves acquiring at least two frames of image data of the aquaculture area at the current moment through a fish detection module, determining the detection box of the target fish within the image data, determining the association cost between the detection box and different existing fish movement trajectories through a trajectory generation module, and adding the detection box to the fish movement trajectory based on the association cost, and determining the individual and group behavioral characteristics of the target fish through a behavior analysis module. This technical solution improves the accuracy of fish target detection by acquiring at least two frames of image data of the aquaculture area at the current moment and determining the detection box of the target fish within the image data; and significantly enhances the stability of long-term trajectories of multiple fish by determining the association cost between the detection box and different existing fish movement trajectories and adding the detection box to the fish movement trajectory based on the association cost, thus achieving trajectory-level fish behavior recognition for behavioral research.

[0121] Optional, the fish detection module 410 is specifically used for:

[0122] Acquire at least two frames of image data of the aquaculture area at the current moment, and determine the detection box of the target fish within the image data.

[0123] Optionally, acquire at least two frames of image data of the aquaculture area at the current moment, and determine the detection box of the target fish within the image data, including:

[0124] Image data of the breeding area at the current moment is collected according to the preset frame rate, and the image data of each frame is arranged into an image frame sequence according to the collection time.

[0125] A pre-trained multi-scale object detection model is invoked to identify image frame sequences and obtain the detection boxes for the target fish.

[0126] The multi-scale target detection model includes at least a backbone network, a feature fusion structure, and a target detection module. The convolution kernel size of the target detection module matches the pixel size of the target fish.

[0127] Optionally, the trajectory generation module 420 is specifically used for:

[0128] Determine the association cost between the detection box and different existing fish movement trajectories, and add the detection box to the fish movement trajectory based on the association cost.

[0129] Optionally, the association cost between the detection box and different existing fish movement trajectories is determined, and the detection box is added to the fish movement trajectory based on the association cost, including:

[0130] Extract the trajectory features of the fish's movement trajectory, as well as the fish features of the detection box;

[0131] The association cost between each detection box and each fish movement trajectory is determined based on the trajectory features of each fish movement trajectory and the fish features of each detection box.

[0132] Based on the association cost of each group, the detection box and the fish movement trajectory are optimally matched to obtain the matching fish movement trajectory corresponding to each detection box;

[0133] Add the detection boxes to the corresponding matching fish movement trajectories.

[0134] Optional, behavior analysis module 430, specifically used for:

[0135] The individual and group behavioral characteristics of the target fish are determined based on the movement trajectories of each fish.

[0136] Optionally, the individual and group behavioral characteristics of the target fish can be determined based on the movement trajectories of each fish, including:

[0137] Extract at least one of the following parameters from the movement trajectory of each fish as individual behavioral characteristics: instantaneous velocity, average velocity, velocity variance, instantaneous acceleration, rate of change of acceleration, turning angle, rate of change of direction, trajectory curvature, and number of turns.

[0138] The group behavior characteristics are determined by statistically analyzing the distribution of individual spacing, local group density, overall group density, distance between the centroid of an individual and the centroid of the group, and the trend of the distance between the centroid of an individual and the centroid of the group.

[0139] Furthermore, based on the above embodiments, a scheduling optimization module is also included, specifically used for at least one of the following:

[0140] Model optimization is performed on the fish detection module and / or trajectory generation module, wherein the model optimization includes at least one of pruning, quantization, distillation, batch normalization fusion, and operator fusion.

[0141] Adjust the call frequency of the fish detection module based on the movement intensity of the target fish;

[0142] Adjust the region of interest of the fish detection module based on individual and / or group behavioral characteristics;

[0143] If individual and / or group behavioral characteristics meet preset conditions, the frequency of calling the fish detection module will be reduced.

[0144] The fish behavior recognition device provided in the embodiments of the present invention can execute the fish behavior recognition method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the method execution.

[0145] Example 5

[0146] Figure 5A schematic diagram of an electronic device 10, which can be used to implement embodiments of the present invention, is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0147] like Figure 5 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0148] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0149] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as fish behavior recognition methods.

[0150] In some embodiments, the fish behavior recognition method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the fish behavior recognition method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the fish behavior recognition method by any other suitable means (e.g., by means of firmware).

[0151] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0152] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0153] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0154] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0155] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0156] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0157] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0158] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A fish behavior recognition method, characterized by, The method includes: Acquire at least two frames of image data of the aquaculture area at the current moment, and determine the detection box of the target fish within the image data; Determine the association cost between the detection box and different existing fish movement trajectories, and add the detection box to the fish movement trajectory based on the association cost; The individual and group behavioral characteristics of the target fish are determined based on the movement trajectories of each fish.

2. The method of claim 1, wherein, Also includes: If it is determined that the detection box has not been added to the fish's movement trajectory at the current moment, a predicted detection box is generated based on the fish's movement trajectory, and the occlusion count of the fish's movement trajectory is obtained; If the occlusion count does not exceed the threshold, the predicted detection box is added to the fish's movement trajectory, and the occlusion count is incremented. If the occlusion count exceeds the threshold, the generation of the fish movement trajectory is terminated.

3. The method of claim 1, wherein, The process of acquiring at least two frames of image data of the aquaculture area at the current moment and determining the detection box of the target fish within the image data includes: The image data of the breeding area at the current time is collected according to the preset frame rate, and the image data of each frame is arranged into an image frame sequence according to the collection time. The image frame sequence is identified by calling a pre-trained multi-scale target detection model to obtain the detection box of the target fish. The multi-scale target detection model includes at least a backbone network, a feature fusion structure, and a target detection module, wherein the convolution kernel size of the target detection module matches the pixel size of the target fish.

4. The method of claim 1, wherein, The step of determining the association cost between the detection box and different existing fish movement trajectories, and adding the detection box to the fish movement trajectory based on the association cost, includes: Extract the trajectory features of the fish's movement trajectory, as well as the fish features of the detection box; The association cost between each detection box and each fish movement trajectory is determined based on the trajectory features of each fish movement trajectory and the fish features of each detection box; Based on the association cost of each group, the detection box and the fish movement trajectory are optimally matched to obtain the matched fish movement trajectory corresponding to each detection box; The detection boxes are added to the corresponding matching fish movement trajectories.

5. The method of claim 1, wherein, The step of determining the individual and group behavioral characteristics of the target fish based on the movement trajectories of each fish includes: Extract at least one of the following parameters from the movement trajectory of each fish as the individual behavioral characteristics: instantaneous velocity, average velocity, velocity variance, instantaneous acceleration, rate of change of acceleration, turning angle, rate of change of direction, trajectory curvature, and number of turns. The group behavior characteristics are determined by at least one of the following: the distribution of individual spacing, local group density, overall group density, centroid distance between individuals and the group, and the changing trend of the centroid distance between individuals and the group.

6. The method of claim 1, wherein, It also includes at least one of the following: The behavior feature patterns corresponding to the individual behavior features and the group behavior features are determined according to a preset state machine; The behavioral feature patterns corresponding to the fish's movement trajectory are generated based on a temporal network model; The characteristic patterns include at least one of freezing, rapid swimming, startling, escaping, clustering, and dispersing.

7. A fish behavior recognition device, characterized by, The device includes: The fish detection module is used to acquire at least two frames of image data of the aquaculture area at the current moment and determine the detection box of the target fish within the image data; The trajectory generation module is used to determine the association cost between the detection box and different existing fish movement trajectories, and add the detection box to the fish movement trajectory based on the association cost; The behavior analysis module is used to determine the individual and group behavior characteristics of the target fish based on the movement trajectories of each fish.

8. The apparatus of claim 7, wherein, Also includes: A scheduling optimization module, wherein the scheduling optimization module is used for at least one of the following: Model optimization is performed on the fish detection module and / or the trajectory generation module, wherein the model optimization includes at least one of pruning, quantization, distillation, batch normalization fusion, and operator fusion; The frequency of calling the fish detection module is adjusted based on the movement intensity of the target fish. The region of interest of the fish detection module is adjusted based on the individual behavioral characteristics and / or the group behavioral characteristics; If the individual behavioral characteristics and / or the group behavioral characteristics meet the preset conditions, the frequency of calling the fish detection module will be reduced.

9. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the fish behavior recognition method according to any one of claims 1-6.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a processor to execute the fish behavior recognition method according to any one of claims 1-6.