A fish swimming behavior early warning method, system and device based on deep learning

By using a deep learning-based early warning method for fish swimming behavior, abnormal behaviors can be detected and identified in real time, solving the problem of the inability to detect fish swimming behavior in a timely manner in factory farming, and improving farming efficiency and economic benefits.

CN117576616BActive Publication Date: 2026-11-27CHINA AGRI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410021274.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-08
Publication Date
2026-11-27
Estimated Expiration
2044-01-08

AI Technical Summary

Technical Problem

Existing technologies cannot detect and analyze fish swimming behavior in real time, nor can they identify abnormal behavior and provide timely warnings, resulting in an inability to respond promptly to emergencies in factory farming.

Method used

Using a deep learning-based approach, through target detection, pose estimation, and behavior recognition modules, fish swimming behavior is detected in real time, abnormal behavior is identified, and warnings are issued.

Benefits of technology

It enables real-time detection of fish swimming behavior and timely early warning of abnormal behavior, improving aquaculture efficiency and economic benefits, and protecting aquatic ecosystems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117576616B_ABST
    Figure CN117576616B_ABST
Patent Text Reader

Abstract

The application discloses a fish swimming behavior early warning method, system and device based on deep learning, and relates to the technical field of computer vision. Fish swimming behavior video data streams are acquired and video data sets are constructed; a target detection model is used to obtain a target detection frame; a posture estimation model is used to obtain fish skeleton information, i.e. joint position and skeleton line length; the joint position and skeleton line length are compared with reference joint position and skeleton line length corresponding to fish swimming behavior to obtain fish swimming behavior; if there is abnormal swimming behavior in the comparison result, the number of abnormal swimming behavior is recorded, and if the number of abnormal swimming behavior is equal to or greater than a set abnormal swimming behavior threshold M, fish swimming behavior abnormal early warning is issued; if there is no abnormal swimming behavior in the comparison result, no processing is performed. The application realizes identification of fish swimming behavior, discrimination of abnormal behavior and timely early warning, and improves fish breeding efficiency and economic benefits.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer vision technology, and in particular to a method, system and device for early warning of fish swimming behavior based on deep learning. Background Technology

[0002] Fish are important aquatic organisms with significant economic and research value. Swimming, as one of the most basic behaviors of fish, plays a crucial role in their reproduction, predation, and survival. Furthermore, parameters such as swimming speed, direction, depth, and posture not only indicate the health status of fish but also reflect water quality parameters. However, due to insufficient manpower in factory-style aquaculture environments, it is often impossible to monitor and analyze fish swimming behavior in real time, identify abnormal behaviors, and provide timely warnings, thus hindering the response to emergencies. Summary of the Invention

[0003] The purpose of this invention is to provide a method, system, and device for early warning of fish swimming behavior based on deep learning, so as to realize real-time detection and analysis of fish swimming behavior, identify abnormal behavior and provide timely warnings, thereby improving fish farming efficiency and economic benefits.

[0004] To achieve the above objectives, the embodiments of the present invention provide the following solutions.

[0005] A deep learning-based early warning method for fish swimming behavior includes...

[0006] Acquire video data of fish swimming behavior; divide the video data into N video data segments according to a preset duration; construct a video dataset based on the N video data segments;

[0007] The target detection model is used to detect and track fish in any video data in the video dataset, and the target detection box of any fish target in each frame of any video data is obtained.

[0008] A pose estimation model is used to estimate the pose of the fish target in any of the target detection boxes to obtain the fish skeleton information; the fish skeleton information includes: joint point positions and skeleton line lengths.

[0009] The behavior recognition module is used to compare the joint point positions and skeleton line lengths with the joint point and skeleton line length feature information of each swimming behavior to obtain the fish swimming behavior results.

[0010] Determine whether there is any abnormal swimming behavior in the fish swimming behavior results; if there is abnormal swimming behavior in the fish swimming behavior results, record the number of abnormal swimming behaviors, and if it is equal to or greater than the set abnormal swimming behavior threshold M, issue an abnormal fish swimming behavior warning signal; if there is no abnormal swimming behavior in the fish swimming behavior results, no action is taken.

[0011] Optionally, the step of using a target detection model to detect and track any video data in the video dataset to obtain a target detection box for any fish target in any video data specifically includes:

[0012] Detect and track any fish target present in each frame of any video data in the video dataset.

[0013] The CA-YOLOv8s algorithm is used to obtain the matrix target detection box location information of multiple fish targets, while filtering out non-fish targets.

[0014] The non-fish targets include at least: aerators or feeders.

[0015] Optionally, the pose estimation model is used to estimate the pose of the fish target in any of the target detection boxes to obtain the fish skeleton information; the fish skeleton information includes: joint point positions and skeleton line lengths, specifically including.

[0016] A skeleton localization algorithm was used to extract the fish skeleton information in the target detection box.

[0017] The P-ViTPose-B algorithm was used to locate the joint points in the fish skeleton information; the joint point locations include: the fish mouth, left pectoral fin, right pectoral fin, dorsal fin, anal fin, caudal peduncle, left caudal fin, right caudal fin, and middle caudal fin.

[0018] The P-Pose-NMS algorithm is used to eliminate redundant poses at the joint positions to obtain the corrected joint positions.

[0019] Optionally, a behavior recognition module is used to compare the joint point positions and skeleton line lengths with the joint point and skeleton line length feature information of each swimming behavior to obtain the fish swimming behavior results, specifically including...

[0020] Connecting specific joints in the joint locations yields skeletal connection lines; the skeletal connection lines include: fish mouth - left pectoral fin, fish mouth - right pectoral fin, fish mouth - dorsal fin, dorsal fin - anal fin, anal fin - caudal peduncle, caudal peduncle - caudal fin middle, caudal fin left - caudal fin middle, and caudal fin right - caudal fin middle.

[0021] The length of the skeleton line is obtained from the skeleton connecting line.

[0022] The skeleton line length is compared with the skeleton line length threshold corresponding to different fish swimming behaviors to obtain a skeleton line length comparison result; the joint point position is compared with the joint point position corresponding to different fish swimming behaviors to obtain a joint point position comparison result; the fish swimming behavior result is obtained based on the skeleton line length comparison result and the joint point position comparison result; the fish swimming behavior result includes: hovering behavior, flipping behavior, turning behavior, or tail flicking behavior.

[0023] Optionally, the abnormal swimming behavior includes: hovering behavior, and / or, flipping behavior.

[0024] To achieve the above objectives, the embodiments of the present invention also provide the following solutions.

[0025] A deep learning-based early warning system for fish swimming behavior includes...

[0026] The video acquisition module is used to acquire video data of fish swimming behavior; and to divide the video data into N video data according to a preset duration; and to construct a video dataset based on the N video data.

[0027] The target detection module, connected to the video acquisition module, is used to detect and track fish in any video data in the video dataset using a target detection model, and obtain the target detection box of any fish target in each frame of any video data.

[0028] The attitude estimation model is connected to the target detection module and is used for...

[0029] The pose of the fish target in any of the target detection boxes is estimated to obtain the fish skeleton information; the fish skeleton information includes: joint position and skeleton line length.

[0030] The behavior recognition module, connected to the posture estimation model, is used to compare the joint positions and skeleton lengths with the joint and skeleton length feature information of each swimming behavior to obtain the fish swimming behavior results.

[0031] The behavior warning module, connected to the behavior recognition module, is used to determine whether there is abnormal swimming behavior in the fish swimming behavior results; if there is abnormal swimming behavior in the fish swimming behavior results, the number of abnormal swimming behaviors is recorded, and if it is equal to or greater than the set abnormal swimming behavior threshold M, an abnormal swimming behavior warning signal is issued; if there is no abnormal swimming behavior in the fish swimming behavior results, no action is taken.

[0032] An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the deep learning-based fish swimming behavior early warning method.

[0033] A non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed, implements the deep learning-based fish swimming behavior early warning method.

[0034] In this embodiment of the invention, video data of fish swimming behavior is acquired and a video dataset is constructed. A target detection and tracking model is used to obtain the target detection box for any fish target in each frame of any video data. A pose estimation model is used to obtain the joint point position and skeleton length of any fish target. The joint point position and skeleton length are compared with the fish swimming behavior to obtain the fish swimming behavior recognition result. The frequency of abnormal swimming behaviors at fixed times is counted to determine whether a preset threshold is reached. Once the frequency equals or exceeds the preset threshold, an intelligent alarm system is activated to initiate an emergency plan, thus achieving automated intelligent monitoring of fish swimming behavior in factory farming. Therefore, analyzing fish swimming behavior and developing intelligent early warning methods, systems, and devices for similar swimming behaviors not only helps predict and adjust the water quality environment and protect aquatic ecosystems, but also facilitates the understanding and management of fish growth and development, improving farming efficiency and economic benefits.

[0035] The target detection method of CA-YOLOv8s proposed in this invention uses a coordinated attention mechanism to capture not only cross-channel information, but also orientation perception and position-sensitive information, which helps to more accurately locate and identify fish targets in images, thus achieving precise detection of fish targets.

[0036] The pose estimation method P-ViTPose-B proposed in this embodiment of the invention, P_Pose-NMS, eliminates redundant pose estimation, which is beneficial to improving the accuracy of fish pose estimation.

[0037] The key points and the mapping relationship between the key point connections and swimming behavior proposed in this embodiment of the invention are used to detect fish swimming behavior. Attached Figure Description

[0038] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the 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.

[0039] Figure 1This is a flowchart illustrating the deep learning-based early warning method for fish swimming behavior provided in an embodiment of the present invention.

[0040] Figure 2 The flowchart is for a fish swimming behavior detection model provided in an embodiment of the present invention.

[0041] Figure 3 This is a schematic diagram of the fish skeleton provided in an embodiment of the present invention.

[0042] Figure 4 This is a schematic diagram of the structure of an intelligent early warning system for fish swimming behavior provided in an embodiment of the present invention.

[0043] Figure 5 This is a schematic diagram of the intelligent early warning device for fish swimming behavior provided in an embodiment of the present invention.

[0044] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention.

[0045] Symbol explanation:

[0046] Video acquisition module-1, target detection module-2, pose estimation model-3, behavior recognition module-4, behavior warning module-5, processor-810, communication interface-820, memory-830, communication bus-840. Detailed Implementation

[0047] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. 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 are within the scope of protection of the present invention.

[0048] The purpose of this invention is to provide a method, system, and device for early warning of fish swimming behavior based on deep learning, so as to solve the problems of existing methods that cannot detect and analyze fish swimming behavior in real time, identify abnormal behavior and provide timely warnings, and require a large amount of human resources.

[0049] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0050] Figure 1 An exemplary flowchart of the aforementioned deep learning-based fish swimming behavior early warning method is shown. The steps are described in detail below.

[0051] Step S1: Acquire video data of fish swimming behavior; and divide the video data into N video data according to a preset duration; construct a video dataset based on the N video data.

[0052] In one example, step S1 can be performed by video acquisition module 1. See also... Figure 2 and Figure 5 The system acquires video data of fish swimming behavior through video acquisition module 1; the video acquisition module 1 includes at least: a camera, a network cable, and a storage device. The video data of fish swimming behavior includes daytime video data and nighttime video data.

[0053] The surveillance video was retrieved from the factory-style breeding base, and 200 video data points were cut out according to a preset 10-second time interval.

[0054] In another example, the construction of a fish swimming behavior video dataset involves first setting up a video acquisition module 1 at the aquaculture base to collect fish video datasets; then, extracting video frames from the collected video data to obtain fish images; finally, manually labeling the fish in the images to form a fish swimming behavior dataset.

[0055] Step S11: Set up video acquisition module 1 at the aquaculture base to collect fish video datasets.

[0056] First, a video acquisition module 1 was set up at the aquaculture base to acquire video data of the fish. The video acquisition module 1 includes the following equipment: one camera (Hikvision 3T86FWDV2-I3S, 8 megapixels, 4mm focal length), one camera bracket, one camera memory card, and one computer. The camera was fixed above the aquaculture pond using the bracket, approximately 1.5 meters above the water surface. The camera memory card was connected to the computer via a network cable to import the acquired fish video data into the computer for storage.

[0057] Step S12: Cut the collected video data into video frames.

[0058] In this embodiment of the invention, 200 10-second video clips are extracted from the collected fish school video data.

[0059] Step S13: Manually label the fish in the images to create a fish swimming behavior dataset.

[0060] Fish poses were annotated using DeepLabCut software, and swimming behaviors were annotated using makesense.ai. A fish swimming behavior dataset was created by dividing the training, validation, and test sets in a 7:1.5:1.5 ratio. Swimming behaviors included hovering, tail flicking, flipping, and turning.

[0061] Step S2: Use an object detection model to detect and track fish in any video data in the video dataset, and obtain the object detection box of any fish target in each frame of any video data, specifically including.

[0062] Step S21: Use the CA-YOLOv8s algorithm to obtain the matrix target detection box position information of multiple fish targets, while filtering out non-fish targets.

[0063] The non-fish targets include at least: aerators or feeders.

[0064] In one example, step S2 can be performed by target detection module 2. This achieves fish target detection and tracking, whereby fish target detection detects and tracks multiple fish present in each frame of the video data. The CA-YOLOv8s algorithm is used to obtain the matrix target detection box position information of the fish in the video frame, ignoring non-fish targets. These non-fish targets include: aerators, feeders, etc.

[0065] A target detection model was built based on the CA-YOLOv8s network structure to identify and track fish targets in videos.

[0066] CA-YOLOv8s is an end-to-end object detection method that transforms the object detection problem into a regression problem. It directly identifies targets and their locations by processing images through a single convolutional neural network. Coordinate attention (CA) is an efficient attention mechanism that can locate and identify information of interest in an image, aiding in fish target detection. The CA-YOLOv8s object detection model can accurately locate target fish in an image by recognizing their location information, improving object detection accuracy and laying the foundation for subsequent pose estimation.

[0067] In another example, CA can capture not only cross-channel information but also orientation-aware and position-sensitive information, helping the YOLOv8s model to more accurately locate and identify target fish of interest. The CA attention mechanism is mainly divided into two stages: embedding coordinate information and generating coordinate attention.

[0068] Coordinate information embedding avoids the loss of positional information by decomposing global pooling. Specifically, given an input X, each channel is encoded along the horizontal and vertical coordinates using a pooling kernel of (H,1) or (1,W), respectively. The outputs of the height h and width w of the c-th channel are given by formulas (1) and (2), respectively.

[0069] (1)

[0070] (2)

[0071] in, This represents the output of channel c at height h. This represents the output of the c-th channel at width w, x c Let represent the c-th channel of the input image x, and let i and j represent the variables that take values ​​in width and height, respectively.

[0072] Coordinate attention generation first concatenates the results of the coordinate information embedding and then performs a convolutional transformation to obtain... Then, it is decomposed into two independent tensors along the spatial direction and subjected to convolution transformation to obtain... and Finally, it is extended into attention weights. The attention weights are output as formula (3).

[0073] (3)

[0074] in, Input X. It outputs the attention coordinate Y.

[0075] In another example, YOLOv8 is a single-stage object detection algorithm that improves detection speed and performance. The YOLOv8 network employs an end-to-end architecture, primarily consisting of five basic network structures with increasing depth and width: YOLOv8n, YOLOv8s, YOLOv8m, YOLOv8l, and YOLOv8x. The YOLOv8s network model mainly comprises an input section, a backbone, a neck, and a head.

[0076] Step S3: Use a pose estimation model to estimate the pose of the fish target in any of the target detection boxes to obtain the fish skeleton information; the fish skeleton information includes: joint position and skeleton line length, specifically including.

[0077] Step S31: Use the skeleton localization algorithm to extract the fish skeleton information in the target detection box.

[0078] Step S32: Use the P-ViTPose-B algorithm to locate the joint points in the fish skeleton information; the joint point locations include: fish mouth, left pectoral fin, right pectoral fin, dorsal fin, anal fin, caudal peduncle, left caudal fin, right caudal fin and middle caudal fin.

[0079] Step S33: Use the P-Pose-NMS algorithm to eliminate redundant poses at the joint positions to obtain the corrected joint positions.

[0080] The key points include: the fish mouth, left pectoral fin, right pectoral fin, dorsal fin, anal fin, caudal peduncle, left caudal fin, right caudal fin, and middle caudal fin. The specific joint points include: the fish mouth, left pectoral fin, right pectoral fin, dorsal fin, anal fin, caudal peduncle, left caudal fin, right caudal fin, and middle caudal fin.

[0081] In one example, step S3 can be performed by attitude estimation model 3. The attitude estimation model extracts the fish skeleton information from the target by using the P-ViTPose-B attitude estimation algorithm to locate the fish skeleton position information containing nine joints. These nine joints include: mouth, left pectoral fin, right pectoral fin, dorsal fin, anal fin, caudal peduncle, left caudal fin, right caudal fin, and middle caudal fin. The fish skeleton is shown below. Figure 3 As shown.

[0082] Based on the target detection bounding box, the P-ViTPose-B method is used to achieve pose estimation. First, ViTPose is used to extract key points, and then the P_Pose-NMS method is used to eliminate redundant pose estimations and complete key point correction.

[0083] ViTPose uses ordinary and non-hierarchical Vision Transformers as its backbone to extract features from fish targets and employs a lightweight decoder for pose estimation. Parametric Pose Non-Maximum Suppression (P_Pose-NMS) uses a pose distance metric to compare the similarity between poses to resolve redundant pose detection. P-ViTPose-B performs pose estimation on fish targets detected by CA-YOLOv8s, removing redundant poses to achieve accurate fish pose estimation.

[0084] ViTPose is a simple and efficient vision transformer for pose estimation. Based on the encoder in its network structure, it is divided into ViTPose-B, ViTPose-H, ViTPose-S, and ViTPose-L. ViTPose-B first uses a patch embedding layer to divide the image into 16 tokens, then inputs these tokens into 12 transformer layers (a sequence model based on an attention mechanism), and finally inputs the 16 tokens into a lightweight decoder to locate key points. The transformer layers all incorporate multi-head attention (MHSA) and feedforward neural networks (FFN).

[0085] (4)

[0086] Where i represents the output of the i-th transformer layer, and LN is layer normalization. This represents the output features of the i-th transformer layer and the feature information after layer normalization and multi-head attention mechanism.

[0087] Since redundant detections are inevitable in detectors, they lead to redundant pose estimations. Therefore, parameterized pose nonmaximum suppression (P_Pose-NMS) is needed to eliminate redundant detections. P_Pose-NMS defines a pose encouragement estimation metric and elimination criteria thresholds to eliminate poses that are too close or too similar to each other.

[0088] Step S4: The behavior recognition module is used to compare the joint position and skeleton line length with the joint and skeleton line length feature information of each swimming behavior to obtain the fish swimming behavior results, specifically including...

[0089] Step S41: Connect specific joints in the joint positions to obtain skeleton connection lines; the skeleton connection lines include: fish mouth - left pectoral fin, fish mouth - right pectoral fin, fish mouth - dorsal fin, dorsal fin - anal fin, anal fin - caudal peduncle, caudal peduncle - caudal fin middle, caudal fin left - caudal fin middle and caudal fin right - caudal fin middle.

[0090] Step S42: Obtain the length of the skeleton line based on the skeleton connection line.

[0091] Step S43: Compare the skeleton line length with the skeleton line length threshold corresponding to different fish swimming behaviors to obtain a skeleton line length comparison result; compare the joint point position with the joint point position corresponding to different fish swimming behaviors to obtain a joint point position comparison result; obtain the fish swimming behavior result based on the skeleton line length comparison result and the joint point position comparison result; the fish swimming behavior result includes: hovering behavior, flipping behavior, turning behavior, or tail flicking behavior.

[0092] In one example, step S4 can be performed by behavior recognition module 4. Behavior recognition module 4 analyzes parameters such as the position of each joint of the skeleton and the length of the skeleton lines to identify fish swimming behavior. The length values ​​refer to the connecting skeleton joints. The swimming behavior includes: hovering behavior, flipping behavior, turning behavior, and tail-whipping behavior, etc.

[0093] In another example, step S41 sets the fish body joints and skeleton connection lines.

[0094] Key points: fish mouth (a), fish eye (b), pectoral fin (c), dorsal fin (d), anal fin (e), caudal peduncle (f), left caudal fin (m), middle caudal fin (n), right caudal fin (k).

[0095] Step S42 connection lines: ab, ac, an; bc, bd; cd, cf; de; em; fk; nm, nk.

[0096] Four types of swimming behaviors were included (all swimming behaviors were compared using a total of 5 frames, from the first two frames to the last two frames).

[0097] Hovering behavior: The fish's body is fully extended, and there is almost no movement or change in these 5 frames.

[0098] Tail flicking behavior: The fish's tail is in a curled, folded, or bent state.

[0099] Flipping behavior: The fish body flips at a certain angle, with the belly facing up.

[0100] Turning behavior: There is a noticeable angled bend between the fish's head and body.

[0101] Define behavioral standards, with other behaviors taking hovering behavior as a reference. All behavior detection is based on the distance measurement between hovering behavior keypoints and connecting lines.

[0102] Hovering behavior: In the first two and last two frames, a total of 5 frames, the positions of the joints show almost no displacement. The distances between the lines connecting the joints also show almost no deformation.

[0103] Step S43 Flipping behavior: When the distance between c and d changes significantly, and the displacement of joints c and / or d is significant.

[0104] Tail-flipping behavior: When the distance between e and n, or f and n, is shortened; when there are multiple overlapping joints or significant displacement changes between e and m, e and n, e and k, f and m, f and n, or f and k.

[0105] Turning behavior: The distances between head joints a and c, b and c, a and n, and b and n are all shortened.

[0106] Step S44 uses the relative lengths of the joints and connecting lines to set evaluation criteria and compares the artificially labeled fish behavior with the true values ​​to achieve swimming behavior detection.

[0107] The test set in the dataset construction is used as the intersection-over-union ratio (IoU) of the fish swimming behavior detection model and the actual labeled data (with a threshold greater than 0.5) to measure the recognition performance of the fish target detection model. Precision, recall, mean accuracy, and parameters are selected as model evaluation metrics to determine the recognition performance of the fish swimming behavior detection model. The specific formulas are shown below.

[0108] (15)

[0109] (16)

[0110] in, This represents the number of samples that are both actually positive and predicted to be positive. This represents the number of samples that were actually negative but were predicted to be positive. This represents the number of samples that were actually positive but predicted as negative. The formula for calculating the average accuracy is as follows:

[0111] (17)

[0112] (18)

[0113] Here, average accuracy refers to the average AP across all classes when IoU is set to 0.5, or the average mAP at different IoU thresholds. IoU ranges from 0.5 to 0.95, with a step size of 0.05. Average detection processing time includes network inference time and NMS processing time. Model size refers to the final size of the model after training.

[0114] Step S5: Determine whether there is any abnormal swimming behavior in the fish swimming behavior results; if there is abnormal swimming behavior in the fish swimming behavior results, record the number of abnormal swimming behaviors. If it is equal to or greater than the set abnormal swimming behavior threshold M, issue an abnormal fish swimming behavior warning signal; if there is no abnormal swimming behavior in the fish swimming behavior results, no action is taken.

[0115] The abnormal swimming behaviors include: hovering behavior, and / or, flipping behavior.

[0116] In one example, step S5 can be executed by the behavior warning module 5. It determines whether abnormal behavior exists and issues a warning. The abnormal behavior includes hovering and flipping behaviors. These two behaviors may be caused by weak fish or disease. If it is determined that these two behaviors occur repeatedly or in excessive numbers in the same pond, reaching a preset threshold, a warning is activated, and a stress response plan is initiated. The stress response plan includes: removing weak or dead fish and administering medication. The preset threshold is set according to the actual situation, considering multiple parameters such as pond size, number of fish in the pond, and fish species.

[0117] Different early warning standards can be set based on the specific conditions of the actual base and the different fish species. For example, hovering behavior can be set if the fish hover for more than half a day, or flipping behavior occurs 10 or more times in a video within one hour when there are more than 200 fish in the pond. In this case, the system platform will send the required statistical data and corresponding emergency response suggestions, such as removing weak or dead fish, or administering medication.

[0118] In summary, in this embodiment of the invention, a video data stream of fish swimming behavior is acquired and a video dataset is constructed; a target detection model is used to obtain the target detection box of any fish target in any video data; a pose estimation model is used to obtain the skeleton information of any fish target; the joint point position and skeleton line length are compared with the joint point position and skeleton line length of a specific fish swimming behavior to obtain the swimming behavior result; the frequency of abnormal behaviors in swimming behavior at fixed times is counted to determine whether a preset threshold is reached; once the frequency equals or exceeds the preset threshold, an intelligent alarm system is activated to initiate an emergency plan, thus realizing automated intelligent monitoring of fish swimming behavior in factory farming. Therefore, analyzing fish swimming behavior and developing intelligent early warning methods, systems, and devices for similar swimming behaviors not only helps to predict and adjust the water quality environment and protect aquatic ecosystems, but also helps to understand and manage fish growth and development, improving farming efficiency and economic benefits.

[0119] To achieve the above objectives, the embodiments of the present invention also provide the following solutions.

[0120] Please refer to the following: A deep learning-based early warning system for fish swimming behavior. Figure 4 ,include.

[0121] The video acquisition module 1 is used to acquire video data of fish swimming behavior; and to divide the video data into N video data according to a preset duration; and to construct a video dataset based on the N video data.

[0122] The target detection module 2 is connected to the video acquisition module 1. The target detection module 2 is used to detect and track fish in any video data in the video dataset using a target detection model, and obtain the target detection box of any fish target in each frame of any video data.

[0123] The attitude estimation model 3 is connected to the target detection module 2. The attitude estimation model 3 is used to estimate the attitude of the fish target in any target detection box to obtain the fish skeleton information. The fish skeleton information includes: joint position and skeleton line length.

[0124] The behavior recognition module 4 is connected to the posture estimation model 3. The behavior detection module 4 is used to compare the joint position and skeleton line length with the joint and skeleton line length feature information of each swimming behavior to obtain the fish swimming behavior results.

[0125] The behavior warning module 5 is connected to the behavior recognition module 4. The behavior warning module 5 is used to determine whether there is abnormal swimming behavior in the fish swimming behavior results. If there is abnormal swimming behavior in the fish swimming behavior results, the number of abnormal swimming behaviors is recorded. If it is equal to or greater than the set abnormal swimming behavior threshold M, an abnormal swimming behavior warning signal is issued. If there is no abnormal swimming behavior in the fish swimming behavior results, no action is taken.

[0126] Furthermore, the present invention also provides an electronic device, which may include: a processor, a communication interface, a memory, and a communication bus. The processor, communication interface, and memory communicate with each other via the communication bus. The processor can call a computer program stored in the memory to execute the deep learning-based fish swimming behavior early warning method.

[0127] Furthermore, when the computer program in the aforementioned memory is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory, random access memory, magnetic disks, or optical disks.

[0128] Furthermore, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed, implements the deep learning-based fish swimming behavior early warning method described above.

[0129] Figure 6A schematic diagram of the physical structure of an electronic device is provided. This electronic device may include a processor 810, a communication interface 820, a memory 830, and a communication bus 840. The processor 810, communication interface 820, and memory 830 communicate with each other via the communication bus 840. The processor 810 can call logical instructions in the memory 830 to execute a deep learning-based fish swimming behavior early warning method. This method includes: constructing a fish swimming behavior dataset, which includes fish videos and corresponding ground truth labels; establishing an initial fish swimming behavior recognition model, which is implemented based on CA-YOLOv8s and P-ViTPose-B methods; obtaining the error between the predicted fish swimming behavior and the ground truth labels based on a loss function; updating and optimizing the parameters of the initial fish swimming behavior recognition model through multiple iterations to obtain a fish swimming behavior recognition model; and recognizing the swimming behavior of target fish within a target area based on the fish swimming behavior recognition model.

[0130] Furthermore, the logical instructions in the aforementioned memory 830 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0131] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements the deep learning-based fish swimming behavior early warning method provided by the above methods. The method includes: constructing a fish swimming behavior dataset, the fish swimming behavior dataset including fish videos and corresponding ground truth labels; establishing an initial fish swimming behavior detection model, the initial fish body color recognition model being trained based on CA-YOLOv8s and P-ViTPose-B, the training set including fish images extracted from the fish swimming behavior dataset and corresponding ground truth labels, the fish videos and ground truth labels in the training set being used as input during training, and the initial fish swimming behavior recognition model outputting a fish swimming behavior prediction result; obtaining the error between the fish swimming behavior prediction result and the ground truth labels according to a loss function, updating and optimizing the parameters of the initial fish swimming behavior model through multiple iterations to obtain a fish swimming behavior model; and recognizing the swimming behavior of target fish within a target area based on the fish swimming behavior recognition model.

[0132] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0133] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0134] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the systems disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple; relevant parts can be referred to the method section.

[0135] This document uses specific examples to illustrate the principles and implementation methods of the embodiments of the present invention. The descriptions of the embodiments above are only for the purpose of helping to understand the methods and core ideas of the embodiments of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the embodiments of the present invention. In summary, the content of this specification should not be construed as a limitation on the embodiments of the present invention.

Claims

1. A deep learning-based early warning method for fish swimming behavior, characterized in that, include: Acquire video data of fish swimming behavior; The video data is then divided into N video data segments according to a preset duration. Construct a video dataset based on the N video data; The target detection model is used to detect and track fish in any video data in the video dataset, resulting in a target detection box for any fish target in each frame of any video data. Specifically, this includes: The CA-YOLOv8s algorithm is used to obtain the matrix target detection box location information of multiple fish targets, while filtering out non-fish targets. The non-fish targets include at least: aerators or feeders; The pose estimation model is used to estimate the pose of the fish target in any of the target detection boxes to obtain the fish skeleton information, specifically including: The skeleton localization algorithm is used to extract the fish skeleton information in the target detection box; The P-ViTPose-B algorithm is used to locate the joint points in the fish skeleton information; the joint point locations include: fish mouth, left pectoral fin, right pectoral fin, dorsal fin, anal fin, caudal peduncle, left caudal fin, right caudal fin and middle caudal fin; The P-Pose-NMS algorithm is used to eliminate redundant poses at the joint positions to obtain the corrected joint positions; the fish skeleton information includes: joint positions and skeleton line lengths. The behavior recognition module is used to compare the joint point positions and skeleton line lengths with the joint point and skeleton line length feature information of each swimming behavior to obtain the fish swimming behavior results. Determine whether there is any abnormal swimming behavior in the fish swimming behavior results; if there is abnormal swimming behavior in the fish swimming behavior results, record the number of abnormal swimming behaviors, and if it is equal to or greater than the set abnormal swimming behavior threshold M, issue an abnormal fish swimming behavior warning signal; if there is no abnormal swimming behavior in the fish swimming behavior results, no action is taken.

2. The deep learning-based early warning method for fish swimming behavior according to claim 1, characterized in that, A behavior recognition module is used to compare the joint point positions and skeleton line lengths with the joint point and skeleton line length feature information of each swimming behavior to obtain the fish swimming behavior results, specifically including: Connect specific joints in the joint locations to obtain skeletal connection lines; the skeletal connection lines include: fish mouth - left pectoral fin, fish mouth - right pectoral fin, fish mouth - dorsal fin, dorsal fin - anal fin, anal fin - caudal peduncle, caudal peduncle - middle caudal fin, left caudal fin - middle caudal fin and right caudal fin - middle caudal fin. The length of the skeleton line is obtained based on the skeleton connection line; The skeleton line length is compared with the skeleton line length threshold corresponding to different fish swimming behaviors to obtain a skeleton line length comparison result; the joint point position is compared with the joint point position corresponding to different fish swimming behaviors to obtain a joint point position comparison result; the fish swimming behavior result is obtained based on the skeleton line length comparison result and the joint point position comparison result; the fish swimming behavior result includes: hovering behavior, flipping behavior, turning behavior, or tail flicking behavior.

3. The deep learning-based early warning method for fish swimming behavior according to claim 1, characterized in that, The abnormal swimming behaviors include: hovering behavior, and / or, flipping behavior.

4. A deep learning-based fish swimming behavior early warning system, applied to the deep learning-based fish swimming behavior early warning method according to any one of claims 1-3, characterized in that, include: The video acquisition module is used to acquire video data of fish swimming behavior; The video data is then divided into N video data segments according to a preset duration. Construct a video dataset based on the N video data; The target detection module, connected to the video acquisition module, is used to detect and track fish in any video data in the video dataset using a target detection model, and obtain the target detection box of any fish target in each frame of any video data. The pose estimation model, connected to the target detection module, is used for: The pose of the fish target in any of the target detection boxes is estimated to obtain the fish skeleton information; The fish skeleton information includes: joint point locations and skeleton line lengths; The behavior recognition module, connected to the posture estimation model, is used to compare the joint position and skeleton line length with the joint and skeleton line length feature information of each swimming behavior to obtain the fish swimming behavior results. The behavior warning module, connected to the behavior recognition module, is used to determine whether there is abnormal swimming behavior in the fish swimming behavior results; if there is abnormal swimming behavior in the fish swimming behavior results, the number of abnormal swimming behaviors is recorded, and if it is equal to or greater than the set abnormal swimming behavior threshold M, an abnormal swimming behavior warning signal is issued; if there is no abnormal swimming behavior in the fish swimming behavior results, no action is taken.

5. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the deep learning-based fish swimming behavior early warning method as described in any one of claims 1-3.

6. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed, it implements the deep learning-based fish swimming behavior early warning method as described in any one of claims 1-3.