An underwater multi-target tracking method based on stable semantic region
By defining a stable semantic region for the fish head and introducing a coordinate attention mechanism and instance segmentation branch, and using the physical centroid of the fish head as a tracking anchor point, the problem of positioning deviation and inaccurate attitude caused by fish body deformation in underwater fish swarm tracking is solved, achieving higher tracking accuracy and stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN UNIV
- Filing Date
- 2026-03-31
- Publication Date
- 2026-06-09
AI Technical Summary
Existing multi-target tracking methods suffer from positioning errors and missed detections in underwater fish school tracking due to the non-rigid deformation of the fish bodies. Furthermore, existing methods lack the ability to perceive the fish's posture information, leading to a decrease in tracking stability and accuracy.
An underwater multi-target tracking method based on stable semantic regions is adopted. By defining a stable semantic region for the fish head, a feature extraction network with coordinate attention mechanism and an instance segmentation branch are introduced. The physical centroid of the fish head is used as the tracking anchor point. The target association and trajectory tracking are performed by combining the position information of the stable semantic region of the fish head. An occlusion-robust centerline fitting strategy is designed.
It effectively avoids positioning deviations caused by non-rigid deformation of the fish body, improves the accuracy and stability of underwater fish tracking, enhances the accuracy of fish head detection and trajectory continuity, and ensures the stability of attitude determination in complex environments.
Smart Images

Figure CN122176492A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of computer vision and underwater intelligent sensing technology, and in particular to an underwater multi-target tracking method based on stable semantic regions. Background Technology
[0002] Multi-Object Tracking (MOT) technology in computer vision is a core support for achieving intelligent management of underwater fish schools and improving fishery production efficiency. Existing technologies primarily employ two-stage and single-stage frameworks for MOT implementation: two-stage frameworks, represented by SORT and DeepSORT, decouple tracking from target detection and data association, but the high degree of deformation of the fish body leads to the propagation of detection errors and low computational efficiency; single-stage frameworks, represented by FairMOT, achieve end-to-end fusion of detection and re-identification, balancing speed and accuracy. However, both methods rely on the geometric center of the entire fish's bounding box as the tracking anchor point. Since fish are typical non-rigid objects, they undergo drastic deformations during swimming (such as tail swings and sharp turns), causing significant drift in the geometric center of their bounding box. This leads to problems such as motion prediction failure, incorrect identity feature extraction, and trajectory drift, resulting in a significant decrease in tracking stability and accuracy.
[0003] Furthermore, the core tasks of fish school tracking include target detection and identity re-identification. Regarding target detection, some researchers have attempted to use fish eye texture as a typical feature for individual identification. However, fish eyes are relatively small, and in real-world aquaculture environments, dynamic changes in lighting conditions and the inherent optical properties of water make it easy for the fine edges and texture details of small targets to be lost in deep feature maps, leading to inaccurate detection. In the trajectory tracking stage, the positioning deviation and trajectory drift caused by fish body deformation are equally significant. Existing methods only form fish school trajectories through reference point association, lacking perception of fish posture information and failing to accurately reflect fish school movement information.
[0004] Therefore, proposing an underwater multi-target tracking method based on stable semantic regions to address the difficulties of existing technologies is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0005] In view of this, the present invention provides an underwater multi-target tracking method based on a stable semantic region, which can effectively avoid the problems of positioning deviation and missed detection caused by the non-rigid deformation of the fish body, and improve the accuracy and stability of underwater fish school tracking.
[0006] To achieve the above objectives, the present invention adopts the following technical solution: An underwater multi-target tracking method based on stable semantic regions includes: S1. Acquire underwater images and define the stable semantic region of the fish head; S2. A feature extraction network with a coordinate attention mechanism is used to extract features and detect fish heads in underwater images, and the fish head detection results are obtained. S3. In the multi-target tracking framework FairMOT, an instance segmentation branch is introduced to generate a segmentation mask for the stable semantic region of the fish head corresponding to each fish body based on the fish head detection results. S4. Calculate the physical centroid of the stable semantic region of the fish head based on the segmentation mask, and use the physical centroid as the tracking anchor point to perform target association and trajectory tracking. S5. Using the physical centroid of the stable semantic region of the fish head as a reference point, and combining the position information of the stable semantic region of the fish head, determine the real-time spatial position of the fish body. Based on the relative relationship between the physical centroid and the stable semantic region, determine the real-time attitude of the fish body and complete the tracking of multiple targets.
[0007] Optionally, in the above method, in S1, a stable semantic region for the fish head is defined, specifically as follows: Using the snout tip P1(x) of the fish 1, y1) is the front vertex of the fish's head, and P2(x) is the posterior end point of the gill cover. 2, y2) and P3(x3,y3) serve as the two endpoints of the posterior margin of the operculum; With P1 as the vertex, P2 and P3 as the endpoints of the arc-shaped side, and P1P2 and P1P3 as the straight side, a triangular-like region with an arc-shaped side is formed.
[0008] Optionally, in the above method, S2 employs a feature extraction network incorporating a coordinate attention mechanism to perform feature extraction and fish head detection on underwater images, specifically as follows: DLA-34 is used as the backbone network for feature extraction. A coordinate attention module is introduced at the feature fusion output of the DLA-34 backbone network to pool the feature map along the horizontal and vertical directions to generate a direction-aware feature vector. Then, the vector is generated by convolution and non-linear activation to generate an attention weight map. The attention weight map is used to recalibrate the original input feature map.
[0009] The above method, optionally, includes the following workflow for the coordinate attention module in S2: For the input feature map The coordinate attention module uses a size of [size missing] along the horizontal and vertical directions respectively. and The pooling cores are aggregated, with a height of The Output of each channel Calculation formula: ; Width is The Output of each channel Calculation formula: ; Obtaining direction-aware feature vectors and Then, the features are concatenated in the spatial dimension and subjected to 1×1 convolution F1 dimensionality reduction and non-linear activation to generate intermediate feature maps. : ; in, This indicates a splicing operation. It is a non-linear activation function; Will Divide again along the spatial dimension and Attention weight map is generated by 1×1 convolution and sigmoid activation. and The original input feature map Multiplying with the weight map completes the feature recalibration: .
[0010] Optionally, in the above method, in S4, the physical centroid of the stable semantic region of the fish head is calculated based on the segmentation mask, specifically as follows: The fish head binarization mask matrix extracted by the instance segmentation branch network prediction is M, and the midpoint of the matrix is... The pixel value at that location is Where 1 represents the fish head foreground and 0 represents the background water; a local segmentation binarized mask for the fish head is generated using instance segmentation branches, and the target's physical centroid is reconstructed using spatial moment features in image processing. The calculation process is as follows: Calculate the zeroth spatial moment of the mask region : , This represents the total number of pixels corresponding to the actual area of the fish head. Calculate along shaft and First-order spatial moment of axis : , ; These are respectively represented as the weighted sum of the coordinates of all foreground pixels within the region; The true physical centroid coordinates of the target are calculated through integral equivalence. : .
[0011] Optionally, in the above method, in S5, the real-time spatial position of the fish body is determined by using the physical centroid of the stable semantic region of the fish head as a reference point and combining it with the position information of the stable semantic region of the fish head. Based on the relative relationship between the physical centroid and the stable semantic region, the real-time pose of the fish body is determined to complete multi-target tracking. Specifically: Point the tip of the snout P1 towards the midpoint P of the posterior edge of the operculum. m The line connecting the two points serves as the central axis of the triangle-like structure, and the central axis is parallel to the physical centroid. The direction of the line connecting the two is the direction of the fish's swimming movement. Calculate the angle θ of the swimming direction:
[0012] Where θ∈[0, 2π); When P1 is occluded or the positioning error exceeds a set threshold, the central axis is fitted based on the longest edge direction of the fish head binarized mask M, while fusing the attitude angle θ from the previous frame. t-1 After smoothing, the formula for calculating the direction angle is:
[0013] Where, θ mask The orientation angle fitted to the longest edge of the mask. These are the preset weighting coefficients.
[0014] As can be seen from the above technical solution, compared with the prior art, the present invention provides an underwater multi-target tracking method based on stable semantic regions, which has the following beneficial effects: The present invention breaks the limitation of traditional tracking relying on the geometric center of the entire fish bounding box. Based on the behavioral laws of fish, it selects the fish head region, which is morphologically stable and less affected by non-rigid deformation, as the core tracking anchor point, and clarifies its geometric shape as a "triangle with one side being arc-shaped". This fundamentally avoids the positioning drift and trajectory breakage problems caused by the fish body's violent deformation or mutual occlusion due to tail swinging, sharp turns, etc., and provides a stable foundation for subsequent accurate positioning and attitude determination; The present invention introduces a coordinate attention mechanism into the feature extraction network. This mechanism, by capturing spatial location information and channel dependencies, enables the network to automatically focus on high-discriminative features such as the fish head, effectively suppressing complex underwater environments ( Background interference (such as changes in lighting and water turbidity) significantly improves the detection accuracy of small target fish heads, providing a complete and reliable target candidate set for tracking tasks. This invention innovatively combines instance segmentation and spatial moment calculation to accurately extract the true physical centroid of the fish head, solving the semantic misalignment problem caused by geometric center drift in traditional methods. By fusing the centroid with the feature points of the triangular region of the fish head, it can not only achieve stable localization but also determine the fish posture in real time and accurately, providing richer information for analyzing fish school behavior. This invention designs an occlusion-robust central axis fitting strategy. When key points of the fish head (such as the snout) are occluded or inaccurately located, it can perform smooth correction based on the long edge direction of the fish head segmentation mask and combined with historical posture information, ensuring the stability and continuity of posture determination in complex tracking scenarios. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0016] Figure 1 A flowchart of an underwater multi-target tracking method based on a stable semantic region provided by the present invention; Figure 2 This is a schematic diagram of the stable semantic region of the fish head in an underwater multi-target tracking method based on a stable semantic region provided by the present invention. Figure 3 A comparison diagram of the center positioning mechanism of the present invention and the traditional method is provided in a specific embodiment of the present invention. Detailed Implementation
[0017] 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.
[0018] Reference Figure 1 As shown, this invention discloses an underwater multi-target tracking method based on stable semantic regions, comprising: S1. Acquire underwater images and define the stable semantic region of the fish head; S2. A feature extraction network with a coordinate attention mechanism is used to extract features and detect fish heads in underwater images, and the fish head detection results are obtained. S3. In the multi-target tracking framework FairMOT, an instance segmentation branch is introduced to generate a segmentation mask for the stable semantic region of the fish head corresponding to each fish body based on the fish head detection results. S4. Calculate the physical centroid of the stable semantic region of the fish head based on the segmentation mask, and use the physical centroid as the tracking anchor point to perform target association and trajectory tracking. S5. Using the physical centroid of the stable semantic region of the fish head as a reference point, and combining the position information of the stable semantic region of the fish head, determine the real-time spatial position of the fish body. Based on the relative relationship between the physical centroid and the stable semantic region, determine the real-time attitude of the fish body and complete the tracking of multiple targets.
[0019] Furthermore, in S1, the stable semantic region of the fish head is defined as follows: Based on the behavioral characteristics of fish, it is clear that the fish head region is morphologically stable, less affected by non-rigid deformation of the fish body, and contains key information about the fish's posture. The fish head region is used as the tracking core to replace the traditional method of using the entire fish bounding box as the tracking reference. The stable area of the fish head structure is defined based on key feature points and the arc edge of the gill cover. This area can accurately cover the key structure of the fish head, effectively avoid the interference of fish body deformation on localization, and provide a stable regional basis for centroid extraction. Reference Figure 2 As shown, the snout tip P1(x1,y1): the tip of the fish's mouth, which is the front vertex of the fish's head and is marked in red. It is the core reference point for determining the fish's head posture. P2(x2,y2) and P3(x3,y3) at the posterior edge of the gill cover: These two endpoints of the posterior edge of the gill cover are marked in green and are the core nodes that form the arc-shaped edge of the fish head. Fish head morphology: With P1 as the vertex, P2 and P3 are the actual gill cover arcs (blue solid lines, not straight lines), and P1 P2 and P1 P3 are straight sides (red dashed lines), forming an approximate "triangle with one side being arc-shaped". This triangular region is the stable semantic region of the fish head. Regardless of how the fish's body deforms, the head region always maintains a relatively rigid physical structure. As long as the algorithm can accurately lock the center of mass of the fish's head, the time series of the coordinates of that center of mass can smoothly and realistically reflect the fish's actual movement trajectory.
[0020] Furthermore, in S2, a feature extraction network incorporating a coordinate attention mechanism is used to extract features and detect fish heads in underwater images, specifically: DLA-34 is used as the backbone network for feature extraction. Its unique tree structure enables efficient fusion of deep semantic information and shallow spatial information, providing high-quality feature support for subsequent target detection. At the feature fusion output of the DLA-34 backbone network, a Coordinate Attention (CA) module is introduced. This module uses a separate directional encoding mechanism to take into account both channel dependence and spatial location information. It can automatically focus on the high-discriminative features of the fish head, suppress background interference, and improve the accuracy of fish head detection in complex underwater environments. The CA module pools the feature map along the horizontal and vertical directions to generate directional-aware feature vectors. Then, after convolution and non-linear activation, attention weight maps are generated. The attention weight maps are used to recalibrate the original input feature map.
[0021] Furthermore, the workflow of the coordinate attention module in S2 is as follows: For the input feature map The coordinate attention module uses a size of [size missing] along the horizontal and vertical directions respectively. and The pooling cores are aggregated, with a height of The Output of each channel Calculation formula: ; Width is The Output of each channel Calculation formula: ; Obtaining direction-aware feature vectors and Then, the features are concatenated in the spatial dimension and subjected to 1×1 convolution F1 dimensionality reduction and non-linear activation to generate intermediate feature maps. : ; in, This indicates a splicing operation. It is a non-linear activation function; Will Divide again along the spatial dimension and Attention weight map is generated by 1×1 convolution and sigmoid activation. and The original input feature map Multiplying with the weight map completes the feature recalibration: ; By introducing the CA module, the fish head structure features with high discriminative power can be automatically learned and emphasized, achieving precise focusing in complex underwater environments. This solves the problem of trajectory breakage from the front end and provides a precise prerequisite for subsequent centroid extraction and positioning.
[0022] Furthermore, in S3, an instance segmentation branch is introduced into the multi-target tracking framework FairMOT to accurately process underwater fish images, segmenting the stable semantic region of the fish head corresponding to each fish body and generating a fish head region segmentation mask. This clarifies the specific range of the fish head region, providing accurate regional basis for reference point extraction. Instance segmentation combines the localization advantages of target detection with the pixel-level classification capabilities of semantic segmentation. It can not only effectively distinguish between targets and background in the image, but also generate a unique pixel-level mask for each fish head target, providing reliable support for subsequent centroid calculation.
[0023] Furthermore, in S4, the physical centroid of the stable semantic region of the fish head is calculated based on the segmentation mask, specifically as follows: The fish head binarization mask matrix extracted by the instance segmentation branch network prediction is M, and the midpoint of the matrix is... The pixel value at that location is Where 1 represents the fish head foreground and 0 represents the background water; a local segmentation binarized mask for the fish head is generated using instance segmentation branches, and the target's physical centroid is reconstructed using spatial moment features in image processing. The calculation process is as follows: Calculate the zeroth spatial moment of the mask region : , This represents the total number of pixels corresponding to the actual area of the fish head. Calculate along shaft and First-order spatial moment of axis : , ; These are respectively represented as the weighted sum of the coordinates of all foreground pixels within the region; The true physical centroid coordinates of the target are calculated through integral equivalence. : ; The centroid coordinates are determined by the actual pixel spatial distribution of the fish head entity region and are independent of the easily expanding and deformable bounding box. This effectively avoids the interference of boundary stretching caused by the fish tail swing or viewpoint change on the centroid positioning. Using the physical centroid of the fish head as a reference point, it effectively solves the problem of geometric center drift caused by the drastic deformation of the fish body, ensuring stable and accurate positioning of the fish body even in scenarios where fish occlude each other and there is no rigid deformation, laying the foundation for subsequent trajectory tracking.
[0024] Furthermore, in S5, using the physical centroid of the stable semantic region of the fish head as a reference point, and combining the position information of the stable semantic region of the fish head, the real-time spatial position of the fish body is determined. Based on the relative relationship between the physical centroid and the stable semantic region, the real-time pose of the fish body is determined, thus completing multi-target tracking. Specifically: Point the tip of the snout P1 towards the midpoint P of the posterior edge of the operculum. m The line connecting the two points serves as the central axis of the triangle-like structure, and the central axis is parallel to the physical centroid. The direction of the line connecting the two is the direction of the fish's swimming movement. Calculate the angle θ of the swimming direction:
[0025] Where θ∈[0, 2π), it can directly map the actual swimming direction of the fish (θ=0 degrees, corresponding to horizontal to the right; θ=90 degrees, corresponding to vertical upward; θ=180 degrees, corresponding to horizontal to the left), ensuring that the direction determination is consistent with the actual swimming state; To address common issues such as occlusion of the snout end P1 and inaccurate localization during tracking, a robust central axis fitting strategy is proposed to prevent pose determination failure. When P1 is occluded or the localization error exceeds a set threshold (e.g., 3 pixels), the central axis is fitted based on the longest edge direction of the fish head binarized mask M, while simultaneously fusing the pose angle θ from the previous frame. t-1 After smoothing, the formula for calculating the direction angle is:
[0026] Where, θ mask The orientation angle fitted to the longest edge of the mask. These are the preset weighting coefficients.
[0027] In one specific embodiment, an underwater fish swarm video dataset, FishTrack-Seg (containing over 4000 frames and 8 minutes in length, covering complex scenes such as varying lighting, dense fish schools, and non-rigid fish deformation), was constructed. Standard evaluation metrics for object detection (AP, recall, precision) and multi-object tracking (MOTA, IDF1) were used. The dataset was compared with two mainstream baseline models, DeepSORT and FairMOT. Combined with ablation experiments and feature visualization, the specific technical effects and overall performance improvements brought about by the various technical features of this invention were comprehensively verified. All models were trained uniformly (input resolution 1088×608, Adam optimizer, training for 60 epochs) and inference parameters were used to ensure fairness in the comparison. Detailed explanation follows: Table 1. Effects of different attention mechanisms on fish head detection performance
[0028] Compared to baseline models without attention mechanisms and models using traditional SE-Block, the CA module introduced in this invention brings significant performance improvements: F1 score is improved by 14.76% and precision by 29.08%, with the significant improvement in recall (reaching 98.79%) being particularly crucial. Since recall directly determines the trajectory continuity of subsequent tracking tasks, the CA module can effectively extract tiny fish head features from overlapping fish groups and complex backgrounds, reducing missed detections and providing a complete target candidate set for tracking tasks.
[0029] The algorithm of this invention is compared with mainstream multi-target tracking algorithms, and the experimental results are shown in Table 2.
[0030] Table 2 Comparison of Identity Recognition Capabilities of Different Models
[0031] The results shown in Table 2 demonstrate that the present invention achieves significant improvements in core tracking metrics. Compared to FairMOT, the MOTA metric is improved by 16.2% (from 70.0% to 86.2%), and the IDF1 metric is improved by 11.4% (from 60.8% to 72.0%). The improvement in IDF1 directly verifies that mask centroid localization can effectively reduce ID switching rate, improve the stability of target identification, and reduce trajectory breakage.
[0032] Reference Figure 3 As shown, to intuitively explain why our method has higher tracking stability (IDF1), we... Figure 3 The paper presents a comparison between the center positioning mechanism proposed in this invention and traditional methods. Figure 3The left-middle image shows the theoretical training target of a traditional center-based detector (such as FairMOT), with the red heatmap area representing the geometric center of the target learned by the model. However, when the fish body undergoes non-rigid curling (or severe deformation), this geometric center (marked by a red triangle) drifts significantly into the surrounding background water, introducing invalid water features and causing a serious misalignment between subsequent feature extraction and target semantics. In contrast, this invention innovatively uses a segmentation mask (yellow area) to strictly lock the tracking anchor point in the rigid fish head region. The physical centroid (marked by a blue star) calculated through the stable semantic region of the fish head is always firmly attached to the fish body, rather than drifting into the background. This design ensures that the Re-ID branch can continuously extract effective and consistent identity features from the highly stable and recognizable semantic region of the fish head, solving the problem of unreliable feature extraction caused by semantic misalignment in traditional methods.
[0033] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for system or system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and relevant parts can be referred to the descriptions in the method embodiments. The systems and system 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 creative effort.
[0034] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. An underwater multi-target tracking method based on stable semantic regions, characterized in that, include: S1. Acquire underwater images and define the stable semantic region of the fish head; S2. A feature extraction network with a coordinate attention mechanism is used to extract features and detect fish heads in underwater images, and the fish head detection results are obtained. S3. In the multi-target tracking framework FairMOT, an instance segmentation branch is introduced to generate a segmentation mask for the stable semantic region of the fish head corresponding to each fish body based on the fish head detection results. S4. Calculate the physical centroid of the stable semantic region of the fish head based on the segmentation mask, and use the physical centroid as the tracking anchor point to perform target association and trajectory tracking. S5. Using the physical centroid of the stable semantic region of the fish head as a reference point, and combining the position information of the stable semantic region of the fish head, determine the real-time spatial position of the fish body. Based on the relative relationship between the physical centroid and the stable semantic region, determine the real-time attitude of the fish body and complete the tracking of multiple targets.
2. The underwater multi-target tracking method based on stable semantic regions according to claim 1, characterized in that, In S1, the stable semantic region of the fish head is defined as follows: Using the snout tip P1(x) of the fish 1, y1) is the front vertex of the fish's head, and P2(x) is the posterior end point of the gill cover. 2, y2) and P3(x3,y3) serve as the two endpoints of the posterior margin of the operculum; With P1 as the vertex, P2 and P3 as the endpoints of the arc-shaped side, and P1P2 and P1P3 as the straight side, a triangular-like region with an arc-shaped side is formed.
3. The underwater multi-target tracking method based on stable semantic regions according to claim 2, characterized in that, In S2, a feature extraction network incorporating a coordinate attention mechanism is used to extract features and detect fish heads in underwater images, specifically: DLA-34 is used as the backbone network for feature extraction. A coordinate attention module is introduced at the feature fusion output of the DLA-34 backbone network to pool the feature map along the horizontal and vertical directions to generate a direction-aware feature vector. Then, the vector is generated by convolution and non-linear activation to generate an attention weight map. The attention weight map is used to recalibrate the original input feature map.
4. The underwater multi-target tracking method based on stable semantic regions according to claim 3, characterized in that, In S2, the workflow of the coordinate attention module is as follows: For the input feature map The coordinate attention module uses a size of [size missing] along the horizontal and vertical directions respectively. and The pooling cores are aggregated, with a height of The Output of each channel Calculation formula: ; Width is The Output of each channel Calculation formula: ; Obtaining direction-aware feature vectors and Then, the features are concatenated in the spatial dimension and subjected to 1×1 convolution F1 dimensionality reduction and non-linear activation to generate intermediate feature maps. : ; in, This indicates a splicing operation. It is a non-linear activation function; Will Divide again along the spatial dimension and Attention weight map is generated by 1×1 convolution and sigmoid activation. and The original input feature map Multiplying with the weight map completes the feature recalibration: 。 5. The underwater multi-target tracking method based on stable semantic regions according to claim 4, characterized in that, In S4, the physical centroid of the stable semantic region of the fish head is calculated based on the segmentation mask, specifically as follows: The fish head binarization mask matrix extracted by the instance segmentation branch network prediction is M, and the midpoint of the matrix is... The pixel value at that location is Where 1 represents the fish head foreground and 0 represents the background water; a local segmentation binarized mask for the fish head is generated using instance segmentation branches, and the target's physical centroid is reconstructed using spatial moment features in image processing. The calculation process is as follows: Calculate the zeroth spatial moment of the mask region : , This represents the total number of pixels corresponding to the actual area of the fish head. Calculate along shaft and First-order spatial moment of axis : , ; These are respectively represented as the weighted sum of the coordinates of all foreground pixels within the region; The true physical centroid coordinates of the target are calculated through integral equivalence. : 。 6. The underwater multi-target tracking method based on stable semantic regions according to claim 5, characterized in that, In S5, the physical centroid of the stable semantic region of the fish head is used as a reference point. Combined with the position information of the stable semantic region of the fish head, the real-time spatial position of the fish body is determined. Based on the relative relationship between the physical centroid and the stable semantic region, the real-time pose of the fish body is determined, thus completing multi-target tracking. Specifically: Point the tip of the snout P1 towards the midpoint P of the posterior edge of the operculum. m The line connecting the two points serves as the central axis of the triangle-like structure, and the central axis is parallel to the physical centroid. The direction of the line connecting the two is the direction of the fish's swimming movement. Calculate the angle θ of the swimming direction: Where θ∈[0, 2π); When P1 is occluded or the positioning error exceeds a set threshold, the central axis is fitted based on the longest edge direction of the fish head binarized mask M, while fusing the attitude angle θ from the previous frame. t-1 After smoothing, the formula for calculating the direction angle is: Where, θ mask The orientation angle fitted to the longest edge of the mask. These are the preset weighting coefficients.