A method and system for analyzing behavior of freshwater shrimp based on target detection

By using a deep learning-trained shrimp target detection model combined with shrimp pond environmental parameters, the system achieves accurate identification of individual shrimp behavior and quantitative analysis of group behavior, generating structured reports. This solves the problems of lack of accuracy and standardization in existing shrimp behavior monitoring technologies, and improves the completeness and standardization of the analysis.

CN123052807APending Publication Date: 2026-11-06NANJING INSTITUTE OF FISHERY SCIENCES (NANJING AQUATIC TECHNOLOGY PROMOTION STATION NANJING AQUATIC ANIMAL DISEASE PREVENTION & CONTROL CENTER)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610856487.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-15
Publication Date
2026-11-06

AI Technical Summary

Technical Problem

Existing behavioral monitoring and analysis methods in the field of freshwater shrimp farming cannot accurately identify and locate each individual freshwater shrimp, cannot form the continuous movement trajectory of a single freshwater shrimp, cannot quantify the behavioral intensity and frequency indicators of freshwater shrimp groups in shrimp ponds, and lack unified quantitative standards and structured analysis reports.

Method used

A deep learning-based shrimp target detection model was used to acquire dynamic video sequences of shrimp in shrimp ponds through an image acquisition device. Frame segmentation and image preprocessing were performed to identify and track the cross-frame associations and trajectories of individual shrimp. Combined with shrimp pond aquaculture environmental parameters, kinematic features were extracted and a structured behavior analysis report was generated.

Benefits of technology

This approach enables the transformation of shrimp behavior analysis from fuzzy judgments at the group level to precise identification at the individual level. It quantifies the behavioral intensity and frequency indicators of shrimp groups, generates a unified structured analysis report, improves the complete process of behavior analysis, and enhances the standardization and systematic nature of the analysis results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123052807A_ABST
    Figure CN123052807A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of intelligent monitoring of aquaculture, in particular to a method and system for behavior analysis of freshwater shrimps based on target detection, comprising: continuously acquiring dynamic video sequences of freshwater shrimps in a shrimp pond by an image acquisition device and processing the video sequences frame by frame; identifying the position of each individual freshwater shrimp by using a trained target detection model for freshwater shrimps; correlating and tracking the trajectories of the freshwater shrimps in the continuous video frames; forming the continuous motion trajectory of a single freshwater shrimp; extracting the kinematic characteristics of the trajectory and combining real-time aquaculture environment parameters to identify the individual behavior pattern of the freshwater shrimp; statistically analyzing the behavior of all individuals; quantitatively obtaining the group behavior intensity and frequency indicators; and generating a structured analysis report in combination with the historical change trend of the environment parameters. The method can realize accurate positioning and tracking of individual freshwater shrimps and behavior recognition, complete quantitative analysis of group behavior, improve the accuracy, systematicness and automation level of behavior analysis of freshwater shrimps, and form standardized analysis results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent monitoring technology for aquaculture, and in particular to a method and system for analyzing the behavior of freshwater shrimp based on target detection. Background Technology

[0002] Current methods for monitoring and analyzing shrimp behavior in shrimp farming are relatively traditional, relying mainly on manual inspections or conventional video capture to obtain information about shrimp ponds. These methods only perform basic frame-by-frame processing on the collected video data, failing to utilize deep learning-based target detection models specifically designed for shrimp. Consequently, they cannot accurately identify and locate each individual shrimp within video frames, making it difficult to obtain stable and reliable shrimp location data. Existing technologies do not perform cross-frame correlation and trajectory tracking of individual shrimp based on the detection results of consecutive video frames. They cannot form continuous movement trajectories for single shrimp, nor can they extract kinematic features from these trajectories. Furthermore, they do not integrate kinematic features with real-time shrimp pond environmental parameters, lacking the ability to identify specific behavioral patterns of individual shrimp.

[0003] Existing shrimp behavior analysis solutions can only achieve a rough assessment at the population level, failing to statistically analyze the behavioral patterns of all individual shrimp. They cannot quantify the behavioral intensity and frequency indicators of shrimp populations in ponds, and the behavioral analysis results lack unified quantitative standards. These technologies do not incorporate historical trends in pond aquaculture environmental parameters for comprehensive analysis, and cannot automatically generate structured shrimp behavior analysis reports. A complete analytical process, from individual identification to population analysis and result output, is significantly lacking.

[0004] This invention addresses the problems in existing technologies, such as inaccurate individual shrimp positioning, inability to continuously track individual movement trajectories, inability to identify the behavior patterns of individual shrimp, inability to quantify and analyze group behavior, and lack of standardized analysis report output. It achieves fully automated analysis of shrimp from individual behavior identification to group behavior quantification. Summary of the Invention

[0005] The purpose of this invention is to overcome the shortcomings of existing technologies and to propose a method and system for analyzing shrimp behavior based on target detection.

[0006] To achieve the above objectives, the present invention adopts the following technical solution: a method for analyzing shrimp behavior based on target detection, comprising: The dynamic video sequence of freshwater shrimp in the shrimp pond is continuously acquired using an image acquisition device. The dynamic video sequence of shrimp is processed by frame segmentation to obtain multiple original video frames arranged in chronological order; The trained shrimp target detection model is used to process each original video frame to identify the position of each individual shrimp in each original video frame. The shrimp target detection model is trained by deep learning based on sample images with labeled shrimp position information. Based on the recognition results of the shrimp target detection model in continuous original video frames, cross-frame association and trajectory tracking are performed on each individual shrimp to form a continuous motion trajectory for each individual shrimp. The kinematic features of the continuous movement trajectory of each individual shrimp were extracted and combined with real-time collected shrimp pond aquaculture environmental parameters to identify the specific behavioral patterns exhibited by each individual shrimp. Statistical analysis was performed on the specific behavioral patterns of all identified individual shrimp to quantify the behavioral intensity and frequency indicators of the entire shrimp population in the pond. Based on the aforementioned behavioral intensity and frequency indicators, and combined with the historical trends of the shrimp pond aquaculture environmental parameters, a structured shrimp behavior analysis report is generated.

[0007] As a further aspect of the present invention, the dynamic video sequence of the shrimp is processed by frame segmentation to obtain multiple original video frames arranged in chronological order, including: Set a video frame sampling frequency, and sample the shrimp dynamic video sequence at equal time intervals according to the video frame sampling frequency to obtain an initial video frame set; Each initial video frame in the initial video frame set is subjected to image preprocessing, which includes at least image denoising, illumination equalization, and image size normalization. Each initial video frame that has completed image preprocessing is arranged in chronological order according to its timestamp, forming multiple original video frames arranged in chronological order.

[0008] As a further aspect of the present invention, the step of processing each original video frame using a trained shrimp target detection model to identify the position of each individual shrimp in each original video frame includes: The original target video frame is input into the feature extraction network of the trained shrimp target detection model to extract multi-level deep feature maps of the original target video frame. The multi-level deep feature map is input into the region generation network of the trained shrimp target detection model to generate multiple candidate regions containing individual shrimp on the multi-level deep feature map. Perform feature pooling on each candidate region to generate a fixed-dimensional feature vector for each candidate region; The fixed-dimensional feature vector of each candidate region is input into the classification and regression network of the trained shrimp target detection model; The classification and regression network is used to classify each candidate region, determine whether the candidate region contains individual shrimp, and perform coordinate regression on the bounding box position of the candidate region containing individual shrimp to obtain the bounding box position of each individual shrimp in the target original video frame.

[0009] As a further aspect of the present invention, the step of performing cross-frame association and trajectory tracking on each individual shrimp to form a continuous motion trajectory for each individual shrimp includes: In the initial raw video frame, the bounding box positions of all shrimp individuals identified by the shrimp target detection model are initialized into multiple independent shrimp target trajectories, and a unique identifier is assigned to each shrimp target trajectory. In the next original video frame, the bounding box positions of all individual shrimp identified by the shrimp target detection model are obtained and used as the target set for the current frame. The motion correlation degree between the predicted position of each shrimp target trajectory in the previous frame and the bounding box position of each shrimp individual in the target set detected in the current frame is calculated. The motion correlation degree is calculated based on the intersection-union ratio, center point distance and motion speed consistency between the bounding boxes. Based on the motion correlation degree, a data association algorithm is used to match the individual shrimp in the current frame detection target set with the shrimp target trajectory of the previous frame, and update the position information of the shrimp target trajectory of the successfully matched shrimp individual. For shrimp individuals in the current frame's target set that do not match any existing shrimp target trajectories, create new shrimp target trajectories; The process is repeated until all original video frames are processed, thereby forming a continuous motion trajectory for each individual shrimp. The continuous motion trajectory is composed of the bounding box position coordinate sequence of the individual shrimp in different original video frames.

[0010] As a further aspect of the present invention, the extraction of kinematic features from the continuous movement trajectory of each individual shrimp includes: For the continuous movement trajectory of each individual shrimp, obtain its bounding box position coordinate sequence; Based on the bounding box position coordinate sequence, calculate the displacement vector sequence of the individual shrimp between adjacent original video frames; Based on the displacement vector sequence, calculate the movement velocity sequence and movement acceleration sequence of the individual shrimp per unit time. The number of times the movement direction of the individual shrimp changes within a preset time window is counted, and the statistical variance of its movement direction angle sequence is calculated. Based on the bounding box position coordinate sequence of the individual shrimp, calculate the coverage area and perimeter of its activity area; The kinematic features include at least the statistical variance of the movement velocity sequence, movement acceleration sequence, movement direction angle sequence, and the coverage area and perimeter of the activity area.

[0011] As a further aspect of the present invention, the step of identifying specific behavioral patterns exhibited by each individual shrimp by combining real-time collected shrimp pond aquaculture environmental parameters includes: The shrimp pond aquaculture environment parameters collected in real time are obtained, and the shrimp pond aquaculture environment parameters include at least water temperature parameters, dissolved oxygen parameters, and light intensity parameters; Align and fuse the kinematic characteristics of the target shrimp individual with the shrimp pond aquaculture environment parameters in the time dimension to form a spatiotemporal behavioral feature vector of the target shrimp individual; The spatiotemporal behavioral feature vector of the target shrimp individual is input into a pre-trained behavioral pattern classification model; The spatiotemporal behavioral feature vector is analyzed by the pre-trained behavioral pattern classification model, and the category of the specific behavioral pattern exhibited by the target shrimp individual in the corresponding time period is output. The category of the specific behavioral pattern includes at least normal patrolling behavior, feeding behavior, fighting behavior, stress escape behavior, and stationary behavior.

[0012] As a further aspect of the present invention, the statistical analysis of the specific behavioral patterns of all identified individual shrimp to quantify the behavioral intensity and frequency indicators of the entire shrimp population in the pond includes: Within a preset statistical time period, all specific behavioral patterns identified in individual shrimp are summarized. For each specific behavioral pattern, the total number of shrimp individuals exhibiting the specific behavioral pattern within the statistical time period is counted, and the proportion of the shrimp individuals to the total number of shrimp individuals is calculated as an indicator of the frequency of occurrence of the specific behavioral pattern. For each specific behavioral pattern, extract the relevant kinematic features of all shrimp individuals exhibiting the specific behavioral pattern, and calculate the mean and distribution variance of the kinematic features as the behavioral intensity index of the specific behavioral pattern. The frequency and intensity of specific behavioral patterns across all categories are combined to form the overall behavioral intensity and frequency indices for the entire shrimp population in the pond.

[0013] As a further aspect of the present invention, based on the aforementioned behavior intensity index and behavior frequency index, and combined with the historical trend of the shrimp pond aquaculture environmental parameters, a structured shrimp behavior analysis report is generated, including: Establish a behavior-environment association database, which stores the behavior intensity index, the behavior frequency index, and shrimp pond aquaculture environmental parameters that are synchronized with the behavior intensity index and the behavior frequency index in time. Time-series analysis was performed on historical data in the behavior and environment association database to identify the association rules between changes in shrimp pond aquaculture environmental parameters and changes in behavior intensity or frequency indicators of various specific behavior patterns. Based on the behavioral intensity index, the behavioral frequency index, and the shrimp pond aquaculture environment parameters obtained within the current statistical time period, and combined with the association rules, the overall behavioral status and potential environmental influencing factors of the current freshwater shrimp population are inferred. According to the preset report template, the overall behavioral status of the current shrimp population, the behavioral intensity index, the behavioral frequency index, the shrimp pond aquaculture environmental parameters, and the potential environmental impact factors are organized to generate a structured shrimp behavior analysis report containing text descriptions and data charts.

[0014] As a further aspect of the present invention, the training method of the shrimp target detection model includes: A large number of underwater images of shrimp ponds containing freshwater shrimp were collected to form the original training image set; Each image in the original training image set is labeled, and the bounding box position and category label of each individual shrimp are marked in the image to form a labeled training sample set. A deep learning object detection model is constructed, which includes a feature extraction network, a region generation network, and a classification and regression network. The deep learning target detection model is trained using the labeled training sample set. The network parameters of the deep learning target detection model are adjusted by iteratively optimizing the loss function until the detection accuracy of the model on the validation set reaches a preset threshold, thus obtaining the trained shrimp target detection model.

[0015] As a further aspect of the present invention, the present invention also includes a shrimp behavior analysis system based on target detection, the system including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the processor executes the computer program, it implements the steps of the shrimp behavior analysis method based on target detection as described above.

[0016] Compared with the prior art, the advantages and positive effects of the present invention are as follows: By leveraging a shrimp target detection model trained with deep learning, precise localization of individual shrimp can be achieved within video frames. Based on the detection results of consecutive video frames, cross-frame correlation and trajectory tracking of individual shrimp can be realized, forming continuous movement trajectories. Corresponding kinematic features are extracted from these trajectories, and combined with real-time aquaculture environmental parameters in the shrimp pond. This allows for the direct determination of specific behavioral patterns in individual shrimp, refining the dimensions of behavioral analysis and transforming shrimp behavior analysis from fuzzy judgments at the group level to precise identification at the individual level. This ensures the targetedness and accuracy of shrimp behavior identification, achieving a direct correspondence between individual shrimp behavior and aquaculture environmental parameters, fully reflecting the correlation between individual shrimp behavior and the aquaculture environment, and enhancing the discriminative power and reliability of the behavioral analysis data.

[0017] A unified statistical analysis of the behavioral patterns of all individual freshwater shrimp in a shrimp pond can quantify the behavioral intensity and frequency indicators of the shrimp population. By integrating these two types of quantitative indicators with the historical trends of shrimp pond aquaculture environmental parameters, a structured freshwater shrimp behavior analysis report can be automatically generated. This standardizes the data output format of freshwater shrimp behavior analysis, forming a complete analysis process from individual behavior identification to group behavior quantification and analysis report output. It unifies the quantitative standards and output format of freshwater shrimp behavior analysis, eliminates the problems of scattered and unstandardized behavior analysis results, and intuitively reflects the correspondence between freshwater shrimp population behavior and changes in the aquaculture environment. This improves the overall process of freshwater shrimp aquaculture behavior analysis, enhances the standardization, systematicity, and completeness of behavior analysis results, and enables the behavior analysis data to form standardized output results. Attached Figure Description Figure 1 This is a flowchart of a shrimp behavior analysis method based on target detection according to the present invention; Figure 2 A flowchart illustrating the process of using a shrimp target detection model to identify the location of individual shrimp in each original video frame; Figure 3 A time-series curve of the movement speed of individual shrimp; Figure 4 A time series plot of shrimp behavior frequency; Figure 5 A heatmap showing the correlation between environmental parameters and behavioral indicators of freshwater shrimp. Detailed Implementation

[0018] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0019] In the description of this invention, it should be understood that the terms "length," "width," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientation or positional relationships, are based on the orientation or positional relationships shown in the accompanying drawings and are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, in the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0020] See Figure 1 This invention provides a method for analyzing the behavior of freshwater shrimp based on target detection, the overall implementation of which is as follows: Underwater dynamic video sequences containing shrimp activity are continuously acquired using fixed or mobile image acquisition devices deployed in shrimp ponds. The acquired shrimp dynamic video sequences are sent to a processing system for frame-by-frame processing, resulting in a series of raw video frames arranged chronologically. The processing system calls a pre-trained shrimp target detection model, trained using deep learning algorithms on a large number of sample images with labeled shrimp location information. This model processes each raw video frame, identifying and locating the position of each individual shrimp within the frame. Based on the model's identification results in consecutive video frames, the system uses cross-frame association and trajectory tracking algorithms to associate the positions of the same shrimp in different frames, forming a continuous motion trajectory for each individual shrimp. Kinematic features characterizing the movement state are extracted from each continuous motion trajectory and combined with real-time collected shrimp pond aquaculture environmental parameters. A behavior pattern recognition module then identifies the specific behavioral patterns exhibited by each individual shrimp. The system summarizes and statistically analyzes the behavioral patterns of all shrimp individuals identified within the current time period, quantifying and calculating behavioral intensity and frequency indicators reflecting the overall activity state of the shrimp population in the pond. Based on these behavioral quantitative indicators and combined with the historical trends of shrimp pond aquaculture environmental parameters, the system automatically generates a structured shrimp behavior analysis report.

[0021] In one embodiment of the present invention, the specific process of performing frame-by-frame processing on a dynamic video sequence of shrimp to obtain multiple original video frames arranged in chronological order is as follows: The system first sets a fixed video frame sampling frequency, and samples the input dynamic video sequence at equal time intervals according to this frequency, thereby obtaining an initial video frame set. Then, image preprocessing is performed on each initial video frame in the initial video frame set. This preprocessing operation includes at least image denoising to reduce noise introduced by image acquisition, illumination equalization to mitigate the influence of uneven underwater illumination, and image size normalization to adjust each frame to a uniform size required by the model. Each initial video frame that has completed image preprocessing is arranged in chronological order according to the timestamp information parsed from the original video sequence, thus constituting multiple original video frames arranged in chronological order required for subsequent processing.

[0022] In practice, the dynamic video sequence of shrimp is processed into frames to obtain multiple original video frames arranged in chronological order. This process involves setting the video frame sampling frequency and performing sampling at equal time intervals. For example, in a shrimp pond monitoring scenario, the video frame sampling frequency can be set to 25 frames per second. Based on this fixed frequency, the input dynamic video sequence of shrimp is sampled to obtain an initial set of video frames composed of discrete frames. The selection of the video frame sampling frequency is determined based on the balance between the shrimp's movement speed and subsequent processing requirements. In one example, using a video frame sampling frequency of 30 frames per second to sample a 10-minute dynamic video sequence of shrimp will generate 18,000 initial video frames. In another example, using a video frame sampling frequency of 15 frames per second to sample the same video sequence will generate 9,000 initial video frames. The two sets of initial video frames under different video frame sampling frequencies directly compare the number of frames, demonstrating the impact of sampling frequency on the amount of data. In the specific implementation, image preprocessing is performed on each initial video frame in the initial video frame set. Image preprocessing includes at least image denoising, illumination equalization, and image size normalization. Image denoising uses a Gaussian filtering algorithm with a convolution kernel size of 5×5 pixels and a standard deviation parameter of 1.0 to reduce random noise commonly found in underwater images. Illumination equalization uses a contrast-limited adaptive histogram equalization method with a tile grid size of 8×8 and a contrast limit threshold of 2.0 to improve the problem of local over-darkness or over-brightness caused by uneven underwater illumination distribution. Image size normalization adjusts the width and height of each initial video frame to 640 pixels and 480 pixels, respectively, and uses a bilinear interpolation algorithm to complete image scaling.

[0023] In some embodiments, image denoising can use median filtering instead of Gaussian filtering. The median filter window size is set to 3×3 pixels, which is suitable for image scenes with a lot of salt-and-pepper noise. Illumination equalization can also use the multi-scale Retinex algorithm, where the scale parameter is set to three different standard deviations to simultaneously enhance image details and global contrast. The target size in image size normalization can be dynamically set according to the input requirements of the subsequent shrimp target detection model, for example, adjusted to 512×512 pixels or 800×600 pixels. In some embodiments, the execution order of image preprocessing can be adjusted, for example, image size normalization can be performed first, followed by image denoising and illumination equalization. This change in order may affect processing efficiency, but the core steps remain unchanged. Image denoising, illumination equalization, and image size normalization must all be applied to each initial video frame.

[0024] Optionally, the video frame sampling frequency can be adaptively adjusted by analyzing the content of the shrimp dynamic video sequence. The system calculates the average absolute difference of pixel intensity between consecutive frames in the shrimp dynamic video sequence. When the average absolute difference exceeds a preset threshold, the video frame sampling frequency is automatically increased; when the average absolute difference is lower than the preset threshold, the video frame sampling frequency is automatically decreased. For example, if the threshold is set to 10 pixel intensity units, the average absolute difference may reach 20 during periods of intense shrimp activity, and the system increases the video frame sampling frequency from 25 frames per second to 30 frames per second. During periods when the shrimp is stationary, the average absolute difference may be only 5, and the system decreases the video frame sampling frequency from 25 frames per second to 10 frames per second. This dynamic adjustment makes the number of frames in the initial video frame set related to the scene activity level. It can be understood that adaptive video frame sampling frequency can optimize the use of storage and computing resources while ensuring the accuracy of behavior analysis. Optionally, illumination equalization in image preprocessing can be combined with underwater physical imaging models to perform more accurate illumination compensation using depth information or water quality parameter estimation. For example, in scenarios where the water attenuation coefficient is known, an algorithm based on dark channel priors can be used to restore the true colors of the image. Image size normalization can also be performed by maintaining the aspect ratio with a filling method to adjust the image to a fixed size while avoiding geometric distortion. It is understandable that different combinations of image preprocessing methods are suitable for different shrimp pond environments and imaging equipment.

[0025] In practice, each initial video frame that has completed image preprocessing is arranged according to its timestamp order to form multiple original video frames arranged in chronological order. The timestamps are obtained by parsing the file header or metadata of the shrimp dynamic video sequence. Each initial video frame corresponds to a precise time point. For example, for a shrimp dynamic video sequence with a sampling rate of 25 frames per second and a duration of 1 minute, after image denoising, illumination equalization, and image size normalization, 1500 processed images are obtained. These images are sorted according to the timestamp, starting from 0 milliseconds and increasing in 40-millisecond intervals, to finally form a continuous and time-accurate original video frame sequence for use by the subsequent shrimp target detection model.

[0026] In one embodiment of the present invention, in one implementation, a trained shrimp target detection model is used to process each original video frame to identify the position of each individual shrimp in each original video frame. This process involves the model's inference flow and training method. For inference, refer to... Figure 2 The original video frame of the target to be detected is input into the feature extraction network of a trained shrimp target detection model. This network extracts multi-level deep feature maps of the original video frame. The multi-level deep feature maps are then fed into the model's region generation network, which generates a series of candidate regions that may contain individual shrimp. Each candidate region undergoes feature pooling and is transformed into a fixed-dimensional feature vector. These fixed-dimensional feature vectors are then input into the model's classification and regression network. This network classifies each candidate region, determines whether it contains individual shrimp, and performs precise coordinate regression on the bounding box positions of the candidate regions determined to contain individual shrimp. Finally, it outputs the bounding box position of each individual shrimp in the original video frame. The training method of the shrimp target detection model includes the following steps: collecting a large number of underwater images of shrimp ponds covering different scenes and lighting conditions to form an original training image set; manually or semi-automatically annotating each image in the original training image set, accurately marking the bounding box position of each individual shrimp and the "shrimp" category label in the image, forming an annotated training sample set. A deep learning object detection model is constructed, whose network structure includes a feature extraction network, a region generation network, and a classification and regression network. This deep learning object detection model is trained using a labeled training sample set. The model's loss function is optimized through multiple iterations, and the network parameters are continuously adjusted until the model's detection accuracy on an independent validation image set reaches a preset threshold. The resulting model is the trained shrimp object detection model.

[0027] In practice, a trained shrimp target detection model is used to process each original video frame to identify the location of each individual shrimp. The reasoning process involves the collaborative work of a feature extraction network, a region generation network, and a classification and regression network. In one example scenario, an original video frame normalized to 640 pixels by 480 pixels is input to the feature extraction network of the trained shrimp target detection model. Based on a deep residual structure, the feature extraction network outputs a multi-level deep feature map containing low-level detail features and high-level semantic features. This multi-level deep feature map is then passed to the region generation network. Based on a pre-defined set of anchor points on the multi-level deep feature map, the region generation network generates thousands of candidate regions. For example, in one configuration, for a 640x480 input image, the region generation network generates approximately 6000 candidate regions with varying sizes and aspect ratios. Candidate regions cover all possible locations in the image where individual shrimp may be present. Each candidate region undergoes a region interest pooling operation, transforming it into a fixed-dimensional 7x7x256 feature vector. These fixed-dimensional feature vectors are then fed into a classification and regression network containing fully connected layers. The output of this network consists of two parts: a classification score indicating whether each candidate region belongs to the "shrimp" category or the background category, and a fine-tuning offset of the bounding box coordinates of the candidate region. By setting a classification score threshold, such as 0.7, candidate regions with high confidence are selected, and a non-maximum suppression algorithm is used to remove highly overlapping detection boxes. Finally, the bounding box coordinates of each individual shrimp in the original video frame are obtained. In an example frame containing multiple shrimp, the trained shrimp target detection model may output four bounding boxes, corresponding to the precise locations of four individual shrimp in the image.

[0028] In some embodiments, the feature extraction network can employ different backbone network architectures to achieve a balance between detection accuracy and inference speed. The anchor point size and proportion used by the region generation network to generate candidate regions can be customized according to the common size distribution of shrimp in images, for example, mainly setting anchor points corresponding to small and medium-sized targets. The structure of the classification and regression networks can also be adjusted, for example, by increasing or decreasing the number of fully connected layers. In some embodiments, the inference process of the trained shrimp target detection model can use a single-stage detector architecture instead of the above two-stage architecture. The single-stage detector directly performs dense predictions on multi-level deep feature maps, and outputs bounding box coordinates and class probabilities, omitting the step of generating explicit candidate regions. This changes the processing flow, but the core objective remains to output the bounding box position of each individual shrimp.

[0029] In practical implementation, the training method for the shrimp target detection model includes collecting a large number of underwater images of shrimp ponds containing shrimp to form an original training image set. This original training image set needs to cover scenes with different time periods, water quality visibility, and shrimp densities. For example, a complete original training image set may consist of more than 50,000 images collected from 10 different shrimp ponds. Each image in the original training image set is labeled. The labeling process involves precisely selecting each individual shrimp in the image and assigning it the category label "shrimp," thus forming a labeled training sample set. In one data comparison, a labeled training sample set containing 10,000 images was labeled... The first set of training samples contained approximately 85,000 individual shrimp bounding boxes, while another set of labeled training samples, containing 50,000 images, labeled over 400,000 bounding boxes. Larger labeled training sets typically provide greater diversity for model training. Building a deep learning object detection model involves initializing a neural network model with random weights. Its structure includes a feature extraction network, a region generation network, and classification and regression networks. The deep learning object detection model is trained using the labeled training set, involving multiple iterations of forward and backward propagation. The network parameters of the deep learning object detection model are adjusted by optimizing the loss function. Typically composed of classification loss and regression loss The weighted composition takes the following form: ; in: It measures the loss for class prediction errors, such as cross-entropy loss. It is a loss that measures the regression error of the bounding box coordinates, such as smoothed L1 loss. and These are the weighting coefficients that balance the two losses. The loss function is calculated in each training iteration. Regarding the gradient of network parameters, and using optimization algorithms to update the parameters, during the training process, the detection accuracy of the deep learning object detection model is periodically evaluated on an independent validation set, for example, using the mean accuracy metric. When the mean accuracy metric of the deep learning object detection model on the validation set reaches a preset threshold and the loss function value tends to stabilize, training is stopped. The network parameter state obtained at this time is the trained shrimp object detection model.

[0030] Optionally, data augmentation techniques can be used to expand the labeled training sample set during the model training phase. Data augmentation operations include random horizontal flipping, random brightness and contrast adjustment, and random addition of noise simulating underwater suspended objects. These operations increase the diversity of the training data without requiring additional annotation. It is understandable that data augmentation helps improve the robustness of the trained shrimp target detection model to changes in lighting and partial occlusion. Optionally, the loss function... Weight adjustments can be introduced to target difficult sample mining, making the training process more focused on candidate regions that are difficult to classify. The optimization algorithm can be either stochastic gradient descent with momentum or Adam optimizer, and the learning rate can adopt a step descent strategy. Before deployment, the trained shrimp target detection model can be quantized or pruned to reduce the model size and accelerate inference. It is understandable that these optimization measures aim to make the shrimp target detection model adapt to different computational environment constraints.

[0031] In one embodiment of the present invention, in one implementation, cross-frame association and trajectory tracking are performed on each individual shrimp based on the recognition results of the shrimp target detection model, and kinematic features in its continuous motion trajectory are extracted. The trajectory tracking process specifically involves: in the initial original video frame of the video sequence, the bounding box positions of all shrimp individuals identified by the shrimp target detection model are initialized into multiple independent shrimp target trajectories, and a unique identifier is assigned to each newly initialized shrimp target trajectory. When processing the next original video frame, the bounding box positions of all shrimp individuals identified by the model in that frame are obtained, forming the current frame's detection target set. The motion correlation degree between the current position predicted based on the historical position of each existing shrimp target trajectory in the previous frame and the bounding box position of each shrimp individual in the current frame's detection target set is calculated. This motion correlation degree comprehensively considers the intersection-union ratio, center point distance, and motion speed consistency between bounding boxes. Based on the calculated motion correlation, data association algorithms such as the Hungarian algorithm are used to optimally match the shrimp individuals in the current frame's target set with the shrimp target trajectories of the previous frame. For successfully matched shrimp individuals, the latest position information of their respective target trajectories is updated. For shrimp individuals in the current frame's target set that fail to match any existing target trajectory, new shrimp target trajectories are created. This process is repeated until all original video frames are processed, thus forming a continuous motion trajectory for each shrimp individual from appearance to disappearance. This continuous motion trajectory is composed of the bounding box position coordinate sequence of the shrimp individual in different original video frames. The kinematic feature extraction process is as follows: for each formed continuous motion trajectory of a shrimp individual, its bounding box position coordinate sequence is obtained. Based on this bounding box position coordinate sequence, the displacement vector sequence of the shrimp individual between adjacent original video frames is calculated. Based on the displacement vector sequence, the movement velocity sequence and movement acceleration sequence of the shrimp individual per unit time are further calculated. The changes in the movement direction of the shrimp individual within a preset time window are statistically analyzed, and the statistical variance of its movement direction angle sequence is calculated. Based on the coordinate sequence of the center point of the bounding box of an individual shrimp, the range of its activity area is calculated, and the coverage area and perimeter of the activity area are estimated. Finally, the extracted kinematic features include at least the statistical variance of the movement velocity sequence, movement acceleration sequence, movement direction angle sequence, and the coverage area and perimeter of the activity area.

[0032] In practical implementation, based on the shrimp target detection model's recognition results in consecutive raw video frames, cross-frame association and trajectory tracking are performed for each individual shrimp. In the initial raw video frames of the video sequence, the bounding box positions of all shrimp individuals identified by the shrimp target detection model are initialized as multiple independent shrimp target trajectories. For example, if three shrimp are detected in the initial frame numbered 1, with their bounding box center coordinates of (100, 150), (300, 400), and (500, 200) respectively, the system creates three shrimp target trajectories and assigns them unique identifiers. ID1, ID2, and ID3 are used to obtain the bounding box positions of all shrimp individuals identified by the shrimp target detection model in the next original video frame, i.e., frame number 2. This constitutes the target set of the current frame. Assuming that four bounding boxes are detected in this frame, with center coordinates of (105, 155), (310, 405), (200, 300), and (505, 205), the motion correlation degree between the predicted position of each shrimp target trajectory in the previous frame and the bounding box position of each shrimp individual in the target set of the current frame is calculated. The formula for calculating the motion correlation degree M is as follows: ; in: This represents the intersection-over-union ratio (IoU) of two bounding boxes in two consecutive frames, where D represents the Euclidean distance between the center points of the two bounding boxes. The image diagonal length is used to normalize the distance. It is a measure of the consistency between the velocity direction predicted from historical trajectories and the current displacement direction. This is a coefficient used to balance the weights of various elements. Based on the calculated motion correlation matrix, the Hungarian algorithm, a data association algorithm, is used for optimal matching. This associates individual shrimp in the current frame's target set with existing shrimp target trajectories. For example, the association result is (105, 155) matches ID1, (310, 405) matches ID2, (505, 205) matches ID3, while (200, 300) does not match any existing shrimp target trajectory. The system creates a new shrimp target trajectory ID4 for this unmatched shrimp individual. This process is repeated until all original video frames are processed, thus forming a continuous motion trajectory for each shrimp individual, consisting of a sequence of bounding box position coordinates. See Table 1.

[0033] Table 1: Sequence of bounding box position coordinates of shrimp ID1 in consecutive video frames Frame number X-coordinate (in pixels) of the top-left corner of the bounding box Y-coordinate (in pixels) of the top-left corner of the bounding box Bounding box width (pixels) Bounding box height (pixels) 1 80 120 40 60 2 85 125 40 60 3 93 135 40 60 4 100 145 40 60 5 110 160 40 60 In some embodiments, the calculation of motion correlation can focus on different combinations of metrics, for example, it can set... , , To emphasize the importance of bounding box overlap, or set , , To emphasize the importance of center point distance, data association algorithms can also use nearest neighbor matching based on a greedy algorithm instead of the Hungarian algorithm. In a simple scenario, the greedy algorithm selects the currently detected target with the highest motion correlation for each existing shrimp target trajectory. In some embodiments, the predicted position can be generated using different motion models, such as a uniform velocity model, a Kalman filter, or a particle filter. The historical position of the shrimp target trajectory in previous frames is used to predict its possible position in the current frame. This changes the accuracy of the prediction, but the core step remains calculating the correlation between the prediction and the detection and performing the matching.

[0034] In practice, kinematic features are extracted from the continuous motion trajectory of each individual shrimp. For each individual shrimp, its bounding box position coordinate sequence is obtained. Based on the bounding box position coordinate sequence, the displacement vector sequence of the shrimp between adjacent original video frames is calculated. For example, for shrimp ID1 shown in Table 1, its bounding box center point is (100, 150) in frame 1 and (105, 155) in frame 2. Therefore, the displacement vector from frame 1 to frame 2 is (5, 5) pixels. Assuming a video sampling interval of 0.04 seconds, the instantaneous movement speed is... The kinematic features are calculated in pixels per second. Motion acceleration can be calculated from the velocity changes between consecutive frames. The number of changes in the movement direction of an individual shrimp within a preset time window is counted, and the statistical variance of its movement direction angle sequence is calculated. For example, the direction angle of the displacement vector within 10 consecutive frames is calculated, and its variance is obtained. The magnitude of the direction angle variance value can reflect the tortuosity of the shrimp's movement. Based on the bounding box position coordinate sequence of the individual shrimp, especially the coordinate sequence of the bounding box center point, the coverage area and perimeter of its activity area are calculated. The activity area can be defined by calculating the minimum bounding rectangle or convex hull of all center point coordinates. For example, the activity area of ​​shrimp ID1 within 100 frames may be 12,000 pixels, and the perimeter may be 500 pixels. The extracted kinematic features include at least the movement velocity sequence, movement acceleration sequence, statistical variance of the movement direction angle sequence, and the coverage area and perimeter of the activity area. These features together constitute a quantitative description of the shrimp's movement pattern.

[0035] Optionally, displacement, velocity, and acceleration can be calculated based on the center point of the bounding box or specific corner points of the bounding box. The statistical variance of the movement direction angle sequence can be calculated using a sliding time window, and the window length can be adjusted according to the specific needs of shrimp behavior analysis. The coverage area and perimeter of the activity area can be calculated by clustering or density estimation of trajectory points, rather than simply using the circumscribed geometry. Optionally, in addition to the above kinematic features, other features can be extracted from continuous motion trajectories, such as Fourier descriptors of the trajectory to characterize the periodicity of motion, or recursive graph features of the trajectory to analyze the complexity of motion. It is understood that the selection and calculation methods of kinematic features can be expanded and adjusted according to the specific needs of behavior pattern classification.

[0036] See Figure 3 This is a time-series curve of the movement speed of individual shrimp, fully presenting the movement speed changes of four shrimp (ID1-ID4) across 20 video frames. From frames 1 to 6, the speed of the four shrimp generally shows an upward trend, with ID3 and ID1 reaching their peaks first, indicating that the shrimp group gradually transitioned from an initial state to an active state. From frames 10 to 12, the speeds of ID1, ID2, and ID4 all exhibited periodic lows, representing behavioral switching points throughout the cycle, possibly related to short-term fluctuations in aquaculture environmental parameters. From frames 12 to 20, except for ID3 which remained consistently high, the speeds of the other IDs rebounded, then generally declined, exhibiting cyclical activity characteristics. ID3 represents a highly active individual and can be considered a key monitoring target; the low speed of ID4 suggests the need to monitor its health. The collective speed trough in frame 10 can serve as a crucial time anchor point for subsequent retrieval of aquaculture environmental data, verifying the correlation between environmental parameter changes and behavioral patterns.

[0037] In one embodiment of the present invention, in one implementation, specific behavioral patterns exhibited by each individual freshwater shrimp are identified by combining real-time collected shrimp pond aquaculture environmental parameters, and all identification results are statistically analyzed. The behavioral pattern identification process is as follows: real-time collected shrimp pond aquaculture environmental parameters are acquired, including at least water temperature, dissolved oxygen, and light intensity parameters. The kinematic characteristics of the target freshwater shrimp individual are aligned and fused with the shrimp pond aquaculture environmental parameters of the same time period on the time axis to form a spatiotemporal behavioral feature vector that can simultaneously reflect the movement state and the environmental state. This spatiotemporal behavioral feature vector is input into a pre-trained behavioral pattern classification model. The pre-trained behavioral pattern classification model analyzes and discriminates the input spatiotemporal behavioral feature vector, and outputs the category of the specific behavioral pattern exhibited by the target freshwater shrimp individual within the corresponding time period. These categories include at least normal cruising behavior, feeding behavior, fighting behavior, stress escape behavior, and stationary behavior. The statistical analysis process is as follows: within a preset statistical time period, all types of specific behavioral patterns identified by all freshwater shrimp individuals are summarized. For each specific behavioral pattern, the total number of shrimp individuals exhibiting this pattern within the statistical time period is counted, and the proportion of this number to the total number of shrimp individuals identified within the statistical period is calculated. This proportion is used as the frequency index of that specific behavioral pattern. For each specific behavioral pattern, the relevant kinematic characteristic values ​​of all shrimp individuals exhibiting that behavior are extracted, and the mean and variance of these characteristic values ​​are calculated. These statistical values ​​are used as the behavioral intensity index of that specific behavioral pattern. The frequency and intensity indices of all specific behavioral patterns are summarized to constitute the behavioral intensity and frequency indices of the entire shrimp population in the pond.

[0038] In practical implementation, the specific behavioral patterns exhibited by each individual shrimp are identified by combining real-time collected shrimp pond aquaculture environmental parameters. These parameters include at least water temperature, dissolved oxygen, and light intensity. In one example scenario, a water temperature sensor records the water temperature once per minute, with a value of 25.3 degrees Celsius; a dissolved oxygen sensor records the dissolved oxygen value once per minute, with a value of 6.8 mg / L; and a light intensity sensor records the light intensity value once per minute, with a value of 1200 lux. The kinematic characteristics of the target shrimp individual are aligned and fused with the shrimp pond aquaculture environmental parameters over time. For example, the kinematic characteristics of the target shrimp individual "ID_A" during the minute from 10:00 AM to 10:01 AM include an average movement speed of 15.2 mm / s, a movement direction angle variance of 0.85, and an activity area of ​​0.15 square meters. Within a few minutes, the shrimp pond aquaculture environment parameters were aligned as follows: water temperature 25.3 degrees Celsius, dissolved oxygen 6.8 mg / L, and light intensity 1200 lux. These features and parameters were combined to form a seven-dimensional spatiotemporal behavioral feature vector [15.2, 0.85, 0.15, 25.3, 6.8, 1200]. This spatiotemporal behavioral feature vector was then input into a pre-trained behavioral pattern classification model. The pre-trained behavioral pattern classification model is a support vector machine or neural network classifier trained on a large number of labeled shrimp spatiotemporal behavioral feature vectors. The pre-trained behavioral pattern classification model analyzes the input spatiotemporal behavioral feature vector, and the model outputs the category of the specific behavioral pattern exhibited by the target shrimp individual "ID_A" within that time period as "feeding behavior". The category of specific behavioral pattern includes at least normal patrolling behavior, feeding behavior, fighting behavior, stress escape behavior, and stationary behavior.

[0039] In some embodiments, the fusion of spatiotemporal behavioral feature vectors can employ more complex methods, such as concatenating kinematic feature sequences with environmental parameter sequences within a time window, rather than simply aligning averages. The pre-trained behavior pattern classification model can utilize different classification algorithms such as random forests, gradient boosting decision trees, or deep neural networks. In some embodiments, shrimp pond aquaculture environmental parameters can include more dimensions, such as pH and ammonia nitrogen concentration. These new parameters expand the dimensions of the spatiotemporal behavioral feature vectors, requiring the pre-trained behavior pattern classification model to be retrained on a training set containing these new parameters to maintain recognition accuracy.

[0040] In practice, the specific behavioral patterns of all identified freshwater shrimp individuals are statistically analyzed to quantify the behavioral intensity and frequency indicators of the entire freshwater shrimp population in the pond. Within a preset statistical time period, all specific behavioral patterns of the identified freshwater shrimp individuals are summarized. For example, if one hour is used as the statistical time period, the system continuously tracks and identifies the behavior of a total of 50 freshwater shrimp individuals in the pond within that hour, as shown in Table 2.

[0041] Table 2: Statistical Examples of Specific Behavioral Patterns of Shrimp Groups within One Hour Behavioral pattern categories The number of individual shrimp exhibiting this behavior The proportion of the total number of individual shrimp Average movement speed Movement speed variance Normal parade behavior 28 56% 20.5 4.1 Feeding behavior 15 30% 8.2 1.5 fighting behavior 2 4% 35.6 15.3 Stress-induced escape behavior 1 2% 102.3 25.7 static behavior 4 8% 0.5 0.1 For each specific behavioral pattern, the total number of shrimp individuals exhibiting that pattern within the statistical time period was counted, and the proportion of each pattern to the total number of shrimp individuals was calculated as an indicator of the frequency of occurrence of that specific behavioral pattern. For example, as shown in Table 1, the frequency of occurrence of "feeding behavior" was 30%, and the frequency of occurrence of "fighting behavior" was 4%. For each specific behavioral pattern, the relevant kinematic characteristics of all shrimp individuals exhibiting that pattern were extracted, and the mean and variance of the kinematic characteristics were calculated as indicators of the intensity of the specific behavioral pattern. For example, the intensity of "feeding behavior" included an average movement speed of 8.2 mm / s and a variance of 1.5, and the intensity of "stress-induced escape behavior" included an average movement speed of 102.3 mm / s and a variance of 25.7. You can use a value that includes the mean and variance The tuple representation of, i.e. ,in It represents the average value of a certain kinematic characteristic (such as movement speed) under a certain type of behavioral pattern. The variance of the distribution representing this characteristic is used to summarize the frequency and intensity of behavior patterns of specific behaviors across all categories, thus forming the behavior intensity and frequency indicators of the entire shrimp population in the pond.

[0042] Optionally, the frequency of behavior indicators can be calculated using a sliding time window for real-time updates, such as calculating the frequency of behavior occurrences within the past hour every 5 minutes to form a frequency time series. The intensity of behavior indicators can be calculated based on a combination of multiple kinematic characteristics, such as simultaneously calculating the mean and variance of multiple characteristics such as average movement speed, average acceleration, and average activity area. Optionally, statistical analysis can be performed separately for different water zones, dividing the shrimp pond into multiple areas and independently calculating the behavior indicators of the shrimp population in each area for spatial comparison. The variance term in the intensity of behavior indicators can be used to measure the differences in individual behavior within the population; a larger variance indicates lower consistency in individual behavior. It can be understood that the frequency of behavior indicators and the diversified intensity of behavior indicators together provide a quantitative dimension for assessing the status of the shrimp population.

[0043] See Figure 4 This is a time series graph of shrimp behavior frequency, fully presenting the frequency changes of the three core behaviors of shrimp within a 60-minute monitoring period. From 0-10 minutes, the normal cruising frequency increases from 55% to 58%, the feeding frequency increases from 28% to 32%, and the fighting frequency increases slightly to 5%, corresponding to the shrimp population entering an active phase from its initial state, adapting to the environment, and preparing to feed. From 25-30 minutes, normal cruising reaches its highest value (60%), feeding behavior simultaneously reaches its peak (35%), and the fighting frequency drops to its lowest value (2%), representing the healthiest and most active period for the shrimp population, corresponding to the peak feeding period after feeding, with no stress or competition among the shrimp. From 30-60 minutes, the frequencies of all three behaviors show a slow downward trend, with normal cruising falling from 60% to 54%, feeding from 35% to 27%, and the fighting frequency remaining below 5%, indicating that the shrimp population has completed feeding and entered a resting state, with overall stable condition.

[0044] In one embodiment of the present invention, a structured shrimp behavior analysis report is generated based on behavioral intensity and frequency indicators, combined with historical trends in shrimp pond aquaculture environmental parameters. The system establishes and maintains a behavior-environment correlation database, which stores behavioral intensity and frequency indicators obtained from previous statistical analyses, as well as shrimp pond aquaculture environmental parameters recorded synchronously with these indicators over time. The historical data accumulated in the behavior-environment correlation database is processed using time-series analysis methods to identify correlation rules between changes in shrimp pond aquaculture environmental parameters and changes in behavioral intensity or frequency indicators of various specific behavioral patterns. Based on the latest acquired behavioral intensity and frequency indicators and shrimp pond aquaculture environmental parameters within the current statistical time period, combined with the correlation rules learned from historical data, the system infers the overall behavioral state of the current shrimp population and analyzes potential environmental influencing factors that may lead to this state. The system, following a preset report template, organizes and fills the inferred overall behavioral status of the current shrimp population, various behavioral intensity indicators, behavioral frequency indicators, real-time shrimp pond aquaculture environmental parameters, and potential environmental impact factors into the corresponding positions of the template, generating a structured shrimp behavior analysis report containing text descriptions and data charts.

[0045] In practical implementation, a structured shrimp behavior analysis report is generated based on behavioral intensity and frequency indicators, combined with historical trends of shrimp pond environmental parameters. Establishing a behavior-environment correlation database is the first step. This database is stored in a time-series table format, with each record containing a timestamp, behavioral intensity indicator, behavioral frequency indicator, and synchronously collected shrimp pond environmental parameters. In one example scenario, the database records the hourly behavioral frequency indicator "feeding behavior frequency" and synchronous water temperature and dissolved oxygen parameters over the past 30 days. By performing time-series analysis on historical data in the database, the system identifies the correlation rules between changes in shrimp pond environmental parameters and changes in behavioral intensity or frequency indicators for various specific behavioral patterns. For example, the analysis found that when dissolved oxygen parameters were below 6.0 mg / L for three consecutive hours, the "feeding behavior frequency" indicator decreased by more than 50% in the following hour, a situation that occurred 15 times historically, whereas such a decrease only occurred twice when dissolved oxygen parameters were normal. The system calculates the confidence level of the correlation rules. To quantify this relationship, the formula is: ; in: This indicates the number of times in historical data the two events "dissolved oxygen parameters are below 6.0 mg / L for 3 consecutive hours" and "the frequency of feeding behavior decreases by more than 50% in the following hour" occurred together. This represents the total number of occurrences of the conditional event "dissolved oxygen parameter is below 6.0 mg / L for 3 consecutive hours". For 20 times, If the number of occurrences is 15, then the confidence level of the association rule is... =0.75, which indicates that when dissolved oxygen conditions are met, there is a high probability that the frequency of subsequent feeding behavior will decrease significantly. The system stores this association rule and its confidence level.

[0046] In some embodiments, the behavior-environment association database can be implemented using a relational database or a time-series database. The discovery of association rules can employ different time-series analysis methods, such as using cross-correlation analysis to calculate the correlation between behavioral indicators and environmental parameters over time, or using Granger causality tests to preliminarily determine whether changes in environmental parameters lead changes in behavioral indicators. In some embodiments, association rules are not limited to the relationship between a single environmental parameter and a single behavioral indicator, but can also be the relationship between combinations of multiple environmental parameters and composite changes in behavioral indicators. For example, the association between "water temperature above 28 degrees Celsius and light intensity below 500 lux" and "increased frequency of stress-induced escape behavior." In time-series analysis, a minimum support threshold can be set to filter out frequently occurring strong association patterns.

[0047] In practice, based on behavioral intensity indicators, behavioral frequency indicators, and shrimp pond aquaculture environmental parameters obtained within the current statistical period, and combined with association rules learned from historical data, the system infers the overall behavioral status and potential environmental influencing factors of the current freshwater shrimp population. For example, within the current statistical period, the system monitors that the "feeding behavior frequency" indicator continuously decreases from 35% to 12%, while the dissolved oxygen parameter slowly decreases from 6.5 mg / L to 5.8 mg / L, and the water temperature parameter remains stable. The system queries the behavior and environment association database and matches a historical association rule: "dissolved oxygen parameter below 6.0 mg / L for 3 consecutive hours" is associated with "feeding behavior frequency decreases by more than 50% in the following hour," and its confidence level is [not specified]. The value is 0.75. The current data situation partially meets the conditions of this rule (dissolved oxygen is below 6.0 mg / L but the duration has not reached 3 hours). Based on this rule, the system infers that the overall behavioral status of the current shrimp population is "significantly reduced feeding intention" and infers that potential environmental impact factors may include "low dissolved oxygen concentration". The system will also check other related rules in parallel to assess whether parameters such as water temperature and light intensity constitute other potential impacts.

[0048] Optionally, the inference process can employ a rule-based inference system or a simple Bayesian network, assigning different weights to different association rules to comprehensively evaluate the combined effects of multiple potential environmental influencing factors. The overall behavioral state description can predefine multiple standard state templates, such as "active and normal behavior," "inhibited behavior," and "stress present." The system selects the most suitable template based on the matching of indicators and rules. Optionally, the system can calculate a reliability score for each inferred potential environmental influencing factor. The reliability score is derived from the confidence of the matching association rule, the degree of matching between the current data and the rule conditions, and the historical validation count of the rule. It can be understood that the reliability score helps farmers judge the reliability of different early warning information.

[0049] In practice, a structured shrimp behavior analysis report is generated by organizing the overall behavioral status, behavioral intensity indicators, behavioral frequency indicators, shrimp pond aquaculture environmental parameters, and potential environmental impact factors of the current shrimp population according to a pre-set report template. The report template adopts a fixed chapter structure, including sections such as "Summary," "Overview of Population Behavior," "Detailed Behavioral Indicators," "Environmental Parameter Monitoring," "Correlation Analysis and Inference," and "Suggested Observation Points." In the "Overview of Population Behavior" section, the inferred overall behavioral status is output in textual description, such as "The overall feeding activity of the current shrimp population has significantly decreased." In the "Detailed Behavioral Indicators" section, the values ​​and change curves of various behavioral frequency and intensity indicators are displayed in the form of tables and trend graphs. In the "Environmental Parameter Monitoring" section, the specific values ​​and change trend graphs of current and recent water temperature, dissolved oxygen, and light intensity parameters are listed. In the "Correlation Analysis and Inference" section, the triggered association rules and their historical confidence levels are listed. The system automatically generates a report in PDF or webpage format, including inferred potential environmental impact factors and their reliability scores. Data charts in the report are automatically drawn from time-series data in the database using a plotting library, and text descriptions are automatically generated by the system based on predefined logic and templates. In some embodiments, the report generation frequency can be configured, such as generating a summary report daily or generating an alert report in real time when specific behavioral indicators exceed a threshold. The style of the report template and the specific sections it includes can be customized according to the specific needs of the farmers.

[0050] See Figure 5This is a heatmap showing the correlation between environmental parameters and shrimp behavior indicators, visually presenting the correlation coefficients between three aquaculture environmental parameters and five types of shrimp behavior indicators. Dissolved oxygen has the most significant impact on shrimp behavior, being a core environmental parameter determining feeding, stress, and movement. Water temperature is the main driver of shrimp stress and fighting behavior, while light intensity primarily affects the shrimp's feeding rhythm and daily activity level. Maintaining dissolved oxygen above the safe threshold is crucial; otherwise, it will directly lead to abnormal feeding and frequent stress, making it a top priority in aquaculture management. Avoid sudden increases in water temperature; cooling is necessary during high-temperature periods to prevent outbreaks of shrimp fighting and stress. Adopting appropriate light cycles improves feeding efficiency while avoiding stress caused by strong light. When a sudden increase in the frequency of stress behavior is detected, water temperature and dissolved oxygen should be prioritized for investigation to achieve rapid intervention.

[0051] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments that can be applied to other fields. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.

Claims

1. A method for analyzing shrimp behavior based on target detection, characterized in that, include: The dynamic video sequence of freshwater shrimp in the shrimp pond is continuously acquired using an image acquisition device. The dynamic video sequence of shrimp is processed by frame segmentation to obtain multiple original video frames arranged in chronological order; The trained shrimp target detection model is used to process each original video frame to identify the position of each individual shrimp in each original video frame. The shrimp target detection model is trained by deep learning based on sample images with labeled shrimp position information. Based on the recognition results of the shrimp target detection model in continuous original video frames, cross-frame association and trajectory tracking are performed on each individual shrimp to form a continuous motion trajectory for each individual shrimp. The kinematic features of the continuous movement trajectory of each individual shrimp were extracted and combined with real-time collected shrimp pond aquaculture environmental parameters to identify the specific behavioral patterns exhibited by each individual shrimp. Statistical analysis was performed on the specific behavioral patterns of all identified individual shrimp to quantify the behavioral intensity and frequency indicators of the entire shrimp population in the pond. Based on the aforementioned behavioral intensity and frequency indicators, and combined with the historical trends of the shrimp pond aquaculture environmental parameters, a structured shrimp behavior analysis report is generated.

2. The method for analyzing shrimp behavior based on target detection according to claim 1, characterized in that, The dynamic video sequence of shrimp is segmented into frames to obtain multiple original video frames arranged in chronological order, including: Set a video frame sampling frequency, and sample the shrimp dynamic video sequence at equal time intervals according to the video frame sampling frequency to obtain an initial video frame set; Each initial video frame in the initial video frame set is subjected to image preprocessing, which includes at least image denoising, illumination equalization, and image size normalization. Each initial video frame that has completed image preprocessing is arranged in chronological order according to its timestamp, forming multiple original video frames arranged in chronological order.

3. The method for analyzing shrimp behavior based on target detection according to claim 2, characterized in that, The process of using a trained shrimp target detection model to process each original video frame and identify the position of each individual shrimp in each original video frame includes: The original target video frame is input into the feature extraction network of the trained shrimp target detection model to extract multi-level deep feature maps of the original target video frame. The multi-level deep feature map is input into the region generation network of the trained shrimp target detection model to generate multiple candidate regions containing individual shrimp on the multi-level deep feature map. Perform feature pooling on each candidate region to generate a fixed-dimensional feature vector for each candidate region; The fixed-dimensional feature vector of each candidate region is input into the classification and regression network of the trained shrimp target detection model; The classification and regression network is used to classify each candidate region, determine whether the candidate region contains individual shrimp, and perform coordinate regression on the bounding box position of the candidate region containing individual shrimp to obtain the bounding box position of each individual shrimp in the target original video frame.

4. The method for analyzing shrimp behavior based on target detection according to claim 3, characterized in that, The process of cross-frame association and trajectory tracking for each individual shrimp to form a continuous motion trajectory for each individual shrimp includes: In the initial raw video frame, the bounding box positions of all shrimp individuals identified by the shrimp target detection model are initialized into multiple independent shrimp target trajectories, and a unique identifier is assigned to each shrimp target trajectory. In the next original video frame, the bounding box positions of all individual shrimp identified by the shrimp target detection model are obtained and used as the target set for the current frame. The motion correlation degree between the predicted position of each shrimp target trajectory in the previous frame and the bounding box position of each shrimp individual in the target set detected in the current frame is calculated. The motion correlation degree is calculated based on the intersection-union ratio, center point distance and motion speed consistency between the bounding boxes. Based on the motion correlation degree, a data association algorithm is used to match the individual shrimp in the current frame detection target set with the shrimp target trajectory of the previous frame, and update the position information of the shrimp target trajectory of the successfully matched shrimp individual. For shrimp individuals in the current frame's target set that do not match any existing shrimp target trajectories, create new shrimp target trajectories; The process is repeated until all original video frames are processed, thereby forming a continuous motion trajectory for each individual shrimp. The continuous motion trajectory is composed of the bounding box position coordinate sequence of the individual shrimp in different original video frames.

5. The method for analyzing shrimp behavior based on target detection according to claim 4, characterized in that, The extraction of kinematic features from the continuous movement trajectory of each individual shrimp includes: For the continuous movement trajectory of each individual shrimp, obtain its bounding box position coordinate sequence; Based on the bounding box position coordinate sequence, calculate the displacement vector sequence of the individual shrimp between adjacent original video frames; Based on the displacement vector sequence, calculate the movement velocity sequence and movement acceleration sequence of the individual shrimp per unit time. The number of times the movement direction of the individual shrimp changes within a preset time window is counted, and the statistical variance of its movement direction angle sequence is calculated. Based on the bounding box position coordinate sequence of the individual shrimp, calculate the coverage area and perimeter of its activity area; The kinematic features include at least the statistical variance of the movement velocity sequence, movement acceleration sequence, movement direction angle sequence, and the coverage area and perimeter of the activity area.

6. The method for analyzing shrimp behavior based on target detection according to claim 5, characterized in that, The method combines real-time collected shrimp pond aquaculture environmental parameters to identify specific behavioral patterns exhibited by each individual shrimp, including: The shrimp pond aquaculture environment parameters collected in real time are obtained, and the shrimp pond aquaculture environment parameters include at least water temperature parameters, dissolved oxygen parameters, and light intensity parameters; Align and fuse the kinematic characteristics of the target shrimp individual with the shrimp pond aquaculture environment parameters in the time dimension to form a spatiotemporal behavioral feature vector of the target shrimp individual; The spatiotemporal behavioral feature vector of the target shrimp individual is input into a pre-trained behavioral pattern classification model; The spatiotemporal behavioral feature vector is analyzed by the pre-trained behavioral pattern classification model, and the category of the specific behavioral pattern exhibited by the target shrimp individual in the corresponding time period is output. The category of the specific behavioral pattern includes at least normal patrolling behavior, feeding behavior, fighting behavior, stress escape behavior, and stationary behavior.

7. The method for analyzing shrimp behavior based on target detection according to claim 6, characterized in that, The specific behavioral patterns of all identified individual shrimp were statistically analyzed to quantify the behavioral intensity and frequency indicators of the entire shrimp population in the pond, including: Within a preset statistical time period, all specific behavioral patterns identified in individual shrimp are summarized. For each specific behavioral pattern, the total number of shrimp individuals exhibiting the specific behavioral pattern within the statistical time period is counted, and the proportion of the shrimp individuals to the total number of shrimp individuals is calculated as an indicator of the frequency of occurrence of the specific behavioral pattern. For each specific behavioral pattern, extract the relevant kinematic features of all shrimp individuals exhibiting the specific behavioral pattern, and calculate the mean and distribution variance of the kinematic features as the behavioral intensity index of the specific behavioral pattern. The frequency and intensity of specific behavioral patterns across all categories are combined to form the overall behavioral intensity and frequency indices for the entire shrimp population in the pond.

8. The method for analyzing shrimp behavior based on target detection according to claim 7, characterized in that, Based on the aforementioned behavioral intensity and frequency indicators, and combined with the historical trends of the shrimp pond aquaculture environmental parameters, a structured shrimp behavior analysis report is generated, including: Establish a behavior-environment association database, which stores the behavior intensity index, the behavior frequency index, and shrimp pond aquaculture environmental parameters that are synchronized with the behavior intensity index and the behavior frequency index in time. Time-series analysis was performed on historical data in the behavior and environment association database to identify the association rules between changes in shrimp pond aquaculture environmental parameters and changes in behavior intensity or frequency indicators of various specific behavior patterns. Based on the behavioral intensity index, the behavioral frequency index, and the shrimp pond aquaculture environment parameters obtained within the current statistical time period, and combined with the association rules, the overall behavioral status and potential environmental influencing factors of the current freshwater shrimp population are inferred. According to the preset report template, the overall behavioral status of the current shrimp population, the behavioral intensity index, the behavioral frequency index, the shrimp pond aquaculture environmental parameters, and the potential environmental impact factors are organized to generate a structured shrimp behavior analysis report containing text descriptions and data charts.

9. The method for analyzing shrimp behavior based on target detection according to claim 8, characterized in that, The training method for the shrimp target detection model includes: A large number of underwater images of shrimp ponds containing freshwater shrimp were collected to form the original training image set; Each image in the original training image set is labeled, and the bounding box position and category label of each individual shrimp are marked in the image to form a labeled training sample set. A deep learning object detection model is constructed, which includes a feature extraction network, a region generation network, and a classification and regression network. The deep learning target detection model is trained using the labeled training sample set. The network parameters of the deep learning target detection model are adjusted by iteratively optimizing the loss function until the detection accuracy of the model on the validation set reaches a preset threshold, thus obtaining the trained shrimp target detection model.

10. A shrimp behavior analysis system based on target detection, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the shrimp behavior analysis method based on target detection as described in any one of claims 1 to 9.