Fish body detecting and counting method for passage behind fish pump of fishing boat

By using an improved RT-DETR model to detect and count fish in the post-pump channel environment of fishing vessels, the problems of missed detection, false detection, and insufficient real-time performance were solved, achieving efficient and reliable detection and counting for fishery resource assessment.

CN121921132APending Publication Date: 2026-04-24EAST CHINA SEA FISHERIES RES INST CHINESE ACAD OF FISHERY SCI +1
View PDF 0 Cites 1 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
EAST CHINA SEA FISHERIES RES INST CHINESE ACAD OF FISHERY SCI
Filing Date
2025-11-21
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

Existing technologies for fish detection in the post-pump channel environment of fishing vessels suffer from problems such as missed detection, false detection, duplicate counting, and insufficient real-time performance, making it difficult to meet the fishery's needs for transparency, precision, and data-driven decision-making.

Method used

An improved RT-DETR model is adopted, which uses the MGI-FE module for multi-scale group interactive feature extraction, the ADC-MI module for dynamic adjustment of region weights based on local statistical information, the ARPU module for inverse reconstruction upsampling, and the CRC module for multi-path structure folding. Combined with NMS-free ensemble prediction decoding and virtual counting lines, fish detection and counting are achieved.

Benefits of technology

It significantly reduces missed detections and latency, improves the reliability and real-time performance of catch estimation, is suitable for edge deployment, and meets the needs of fishery resource assessment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121921132A_ABST
    Figure CN121921132A_ABST
Patent Text Reader

Abstract

The invention relates to a fish body detection counting method for a channel behind a fish pump of a fishing boat, and provides an NMS-free fish body detection model MGI-RTDETR based on an improved RT-DETR for small targets, rapid movement, strong blur, highlight shielding and limited shipborne computing power. The model integrates multi-scale grouping interaction, dynamic context mixing, detail fidelity fusion, deployment period re-parameterization and back projection up-sampling, and real-time detection of one fish and one frame is achieved. And in combination with lightweight multi-target tracking, outputting paragraph counting by adopting a one-way cross-line combined de-duplication strategy. According to the method, missing detection and time delay can be remarkably reduced, edge deployment is facilitated, and the method is suitable for near-real-time fishing estimation, operation monitoring and resource evaluation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of computer vision and fisheries information technology, and in particular to a method for detecting and counting fish in the post-pump channel of a fish pump on a fishing vessel. Background Technology

[0002] Marine fisheries management and ecological assessment urgently require timely and reliable methods for quantifying onboard catches. Current methods commonly used in practice, such as manual logs, sampling and weighing, and empirical calculations, suffer from high subjectivity, poor timeliness, and difficulty in linking operation location and time, failing to meet the demands of modern fisheries for transparency, precision, and data-driven decision-making.

[0003] With the development of deep learning, video-based automated detection / counting is gradually being applied to aquaculture and offshore operations. One-stage detectors, such as the YOLO series, offer high throughput but have limited sensitivity to small targets under strong reflectivity and motion blur. Two-stage and heavy-duty Transformer detectors offer higher accuracy but struggle to achieve real-time performance on edge devices. End-to-end DETR systems remove non-max-state errors (NMS) through Hungarian matching and offer global modeling advantages, but early model training and inference costs are high. Real-time modified RT-DETR strikes a balance between speed and accuracy, providing an engineeringly feasible foundation for shipborne real-time detection.

[0004] However, in the post-pump channel scene, including the pump outlet ejection section and the subsequent conveying / sliding section, the following issues are simultaneously observed: ① strong motion blur and trailing caused by high-speed movement; ② specular highlights, strong local reflections, and sensor suppression artifacts caused by water splashes and droplets; ③ weakened boundaries due to mutual occlusion and crowding of fish, resulting in elongated and small-scale targets; ④ complex textures of the deck / equipment background that change rapidly with lighting and humidity. These factors collectively weaken shallow high-frequency and boundary cues, reduce the ability of conventional main channels to separate elongated targets, and cause missed detections, frame merging—mistaking adjacent individuals for a single target—and false alarms regarding water splashes / highlights.

[0005] Existing improvement approaches mainly include: enhancing multi-scale and edge-sensitive features in the backbone, introducing efficient local-global interaction in the encoder / decoder, and improving cross-scale fusion and upsampling in the neck to preserve details. However, most methods assume a relatively "clean" input and do not adequately consider the extreme blurring and highlight suppression in the post-pump channel; deblurring prior methods have high computational overhead and are difficult to meet real-time requirements at the end; traditional upsampling methods, such as bilinear or deconvolution, easily introduce edge blurring or checkerboard artifacts, further impairing the boundary consistency of the slender fish body.

[0006] At the counting level, multi-target tracking (MOT) and line-crossing counting are common engineering paradigms. Among them, ByteTrack, by utilizing low-score detections for association, can maintain trajectory continuity in occasional low-confidence frames, such as moments of splash obstruction. It is suitable for online coupling with end-to-end detectors without NMS to suppress duplicate counting and output segment-level fish number estimates in fixed channels. However, its counting stability still highly depends on the recall and boundary quality of the front-end detection. Summary of the Invention

[0007] The technical problem to be solved by the present invention is to provide a fish detection and counting method for the post-pump channel of fish pumps on fishing vessels, which can significantly reduce missed detections and latency, facilitate edge deployment, and is suitable for near real-time catch estimation, operation monitoring and resource assessment.

[0008] The technical solution adopted by this invention to solve its technical problem is: to provide a method for detecting and counting fish in the post-pump channel of a fish pump on a fishing vessel, comprising:

[0009] Collect image frame sequences of fish moving along the pump's rear channel and perform preprocessing;

[0010] A fish detection model based on an improved RT-DETR is constructed to identify fish bodies in sequentially input image frames and obtain fish detection results; the improved RT-DETR includes:

[0011] An MGI-FE module is introduced into the backbone network to extract multi-scale grouped interactive features.

[0012] An ADC-MI module is embedded in the neck network to dynamically adjust the weights of the set regions based on the local statistical information of its input features. Then, ADPF, CRC and ARPU modules are introduced to perform multi-scale feature fusion.

[0013] Based on the fused features, ensemble prediction decoding without NMS is used to generate fish categories and corresponding bounding boxes;

[0014] Multi-target tracking is performed in real time based on the fish body detection results;

[0015] A virtual counting line perpendicular to the flow direction is arranged in the channel after the pump. The number of times the same tracking trajectory effectively crosses the virtual counting line for the first time is counted to obtain the fish count result.

[0016] Furthermore, the MGI-FE module divides the module input features into four groups according to the channel dimension, and then processes them through the pixel-gated saliency branch, the local context optimization branch, the sparse mid-range coupling branch, and the hierarchical global aggregation branch before concatenating them. After concatenation, the features are processed by 1×1 convolution and channel MLP residual units in sequence to output the corresponding scale features.

[0017] Furthermore, the pixel-gated saliency branch performs two 1×1 convolution expansion-compression processes on the branch input features to obtain a pixel-by-pixel gated weight map. Then, the gated weight map is multiplied by the branch input features and added to the branch input features before being output.

[0018] Furthermore, the local context optimization branch performs 3×3 convolution and normalization on the branch input features sequentially before outputting the results.

[0019] Furthermore, the sparse mid-range coupled branch performs key point screening on the branch input features within a neighborhood of a set radius. The generated key point map is upsampled and used as a gating factor to be multiplied point by point with the branch features before being output.

[0020] Furthermore, the hierarchical global aggregation branch compresses the high-resolution branch input features through sparse selection and then aggregates them using grouping / dilated convolution before outputting the results. For the low-resolution branch input features, a lightweight Transformer-style attention is introduced to obtain long-range dependencies, which are then added to the residuals of the branch input features before outputting the results.

[0021] Furthermore, the step of dynamically adjusting the weight of the set region based on the local statistical information of its input features includes:

[0022] After applying layer normalization to the input features and performing channel expansion with 1×1 projection, the features are divided into multiple sub-branches according to different receptive fields.

[0023] Global statistics and linear mapping are performed on the input features, and the depth convolution kernel weights of each branch are adaptively generated to assign higher weights to the specified regions.

[0024] The features output from each sub-branch are rearranged and lightweight fused through channels, and then processed sequentially by 1×1 convolution and residual units before being output.

[0025] Furthermore, the ADPF module divides the input high-resolution features and upsampled low-resolution features into several segments according to channels. Each segment is assigned adaptive fusion weights based on global statistics and linear mapping. After fusion segment by segment, the segments are processed by 1×1 convolution and then output.

[0026] Furthermore, the ARPU module uses depth-separable back-projection convolution instead of standard convolution, establishes a regularized closed inverse for the downsampling convolution in the frequency domain, normalizes the back-projection convolution kernel through softmax, uses cyclic filling for the boundary, and uses bilinear interpolation results as the initial solution.

[0027] Furthermore, the CRC model adopts a multi-level parallel path convolutional structure during the training phase, and folds each path into an equivalent convolution during the deployment phase, and then superimposes the homogeneous kernel on the channel dimension to be equivalent to a single 3×3 convolution.

[0028] Furthermore, the counting of the number of times the same tracking trajectory first effectively crosses the virtual counting line includes:

[0029] Set hysteresis rules based on minimum duration and / or minimum net displacement;

[0030] A fish crossing the virtual counting line in the direction of the flow and satisfying the hysteresis rule is considered a valid crossing. The number of times the same tracking trajectory is successfully crossed for the first time is counted.

[0031] Beneficial effects

[0032] By adopting the above-mentioned technical solution, the present invention has the following advantages and positive effects compared with the prior art:

[0033] Based on the RT-DETR framework, this invention makes targeted modifications to the distortion mechanism and deployment constraints of the video in the post-pump channel, improving the overall reliability of shipborne real-time detection and subsequent counting without introducing additional time-consuming deblurring / complex attention.

[0034] This invention effectively enhances the edge fidelity of slender fish bodies and the separation ability of adjacent fish bodies under motion blur and specular highlight interference by multi-scale grouped interactive feature extraction of the MGI-FE module and adaptive fusion of the ADPF module, thus solving the problem of blurred outlines and overlapping occlusion of fish bodies in the back channel caused by high-speed movement.

[0035] This invention uses the ADC-MI module to dynamically adjust the region weights based on the local statistical information of the input features, adaptively generate convolution kernels, accurately weight blurry and highlight regions, effectively suppress pseudo responses such as water splashes and reflections, significantly improve the resolution of scenes close to the fish and partially occluded, reduce the phenomenon of box merging and undersegmentation, and adapt to the needs of dense fish school detection.

[0036] This invention achieves ×2 upsampling through inverse reconstruction using the ARPU module, reducing checkerboard artifacts and noise amplification, while balancing detail recovery and numerical stability.

[0037] This invention employs a CRC module to decouple training and inference, folding the multi-path structure into a single-path convolution. While maintaining the expressive power of the training phase, it significantly reduces inference latency. Combined with NMS-free ensemble prediction decoding to simplify the post-processing workflow, it can further improve deployment efficiency and fully adapt to the real-time requirements of shipborne resource-constrained equipment.

[0038] This invention natively couples end-to-end detection with multi-target tracking, and combines the first effective crossing rule of the virtual counting line to achieve accurate deduplication of fish trajectory counting. This effectively avoids the risk of duplicate counting or omission, and meets the engineering implementation requirements for the segment-level estimation of fish catch in the post-pump channel of fishing vessels. Attached Figure Description

[0039] Figure 1 This is a schematic diagram of the overall process of a preferred embodiment of the present invention;

[0040] Figure 2 This is a schematic diagram of dataset collection in preferred embodiment 1 of the present invention;

[0041] Figure 3 This is a schematic diagram of the structure of the improved RT-DETR model of preferred embodiment 1 of the present invention;

[0042] Figure 4 This is a schematic diagram of the network structure of the MGI module in the preferred embodiment of the present invention;

[0043] Figure 5 This is a schematic diagram of the adaptive dynamic context mixing module of the preferred embodiment of the present invention;

[0044] Figure 6 This is a schematic diagram of the adaptive detail-preserving pyramid fusion structure of the preferred embodiment of the present invention;

[0045] Figure 7 This is a schematic diagram of the reparameterized convolution block in preferred embodiment 1 of the present invention;

[0046] Figure 8 This is a schematic diagram illustrating the structural differences between standard convolution, transposed convolution, and inverse convolution in a preferred embodiment of the present invention.

[0047] Figure 9 This is a comparison chart of the target detection effects of the preferred embodiment 1 of the present invention;

[0048] Figure 10 This is a thermal comparison diagram of target detection in the preferred embodiment of the present invention. Detailed Implementation

[0049] The present invention will be further illustrated below with reference to specific embodiments. It should be understood that these embodiments are for illustrative purposes only and are not intended to limit the scope of the invention. Furthermore, it should be understood that after reading the teachings of this invention, those skilled in the art can make various alterations or modifications to the invention, and these equivalent forms also fall within the scope defined by the appended claims.

[0050] The embodiments of the present invention relate to a method for fish detection and segment-level counting in the post-pump channel of a fish pump on a fishing vessel. The problem to be solved is that during the operation of a light-operated purse seine fishing vessel, the imaging environment in the post-pump channel or deck conveyor belt exhibits complex characteristics such as small-sized targets, rapid displacement, strong motion blur, specular highlights, and dense occlusion.

[0051] First, the directional blurring and trailing caused by the high-speed jet significantly erase the high-frequency details of the fish's outline, weakening the response of shallow edges and "widening / blunting" the target's shape, resulting in low recall and positioning deviation for small targets.

[0052] Secondly, the strong reflections / highlights produced by water splashes, water droplets, and wet decks form bright spots and bands on the image, which can easily be misjudged as the edge of the fish or the main body of the fish school, leading to false detections and fluctuations in confidence level.

[0053] Third, fish are slender and often close to each other / block each other. Existing end-to-end real-time detectors are prone to frame merging—two fish are combined into one frame—and fragmentation—the same fish is divided into multiple frames, resulting in insufficient separation in crowded areas.

[0054] Fourth, the scale span and density fluctuations within the post-pump channel are large. Direct addition or splicing of cross-scale fusion can easily lead to the dilemma of "detail noise being amplified or semantics being suppressed", further impairing the detectability of small targets and slender structures. Traditional upsampling, such as bilinear or transposed convolution, can also introduce edge blurring or checkerboard artifacts, worsening boundary fitting.

[0055] Fifth, DETR / RT-DETR type NMS-free decoding is sparser in matching small targets under blur and occlusion, more sensitive to hyperparameters, and has a significant decrease in high IoU indicators such as mAP75 and insufficient robustness across thresholds.

[0056] Sixth, significant domain shift: the training data mostly comes from natural scenes, which makes it difficult to cover the distribution of highlights / blurs in the post-pump channel and complex deck textures, thus limiting the generalization of existing models;

[0057] Seventh, the limited computing power and real-time constraints on ships make it difficult to deploy multi-branch attention or heavy two-stage solutions; at the same time, it is also necessary to take into account the stability of the connection with the back-end lightweight tracking / crossing statistics link to avoid the risk of repeated counting or missed counting due to detection jitter amplification.

[0058] This implementation method mainly includes the following parts:

[0059] S1 Data Acquisition and Preprocessing;

[0060] S2 Improved forward inference of the end-to-end detection network MGI-RTDETR;

[0061] S3 NMS-free end-to-end decoding, pairing and filtering;

[0062] S4 Online Multi-Target Tracking Coupling and Counting.

[0063] Each part will be explained in detail below.

[0064] S1 Data Acquisition and Preprocessing: Requires Unified Size and Lightweight Augmentation. S1.1 Acquisition Source: Acquire video frames from the pump aft channel or deck conveyor belt scene, with an original resolution of, for example, 2560×1400 and a frame rate of approximately 25 FPS. S1.2 Size Normalization: Scale and pad the entire frame proportionally to 640×640 and complete coordinate mapping; preferably, do not perform ROI clipping to maintain the stability of the geometric and lighting context and facilitate cross-ship type and cross-camera position migration. S1.3 Lightweight Data Augmentation: During training, use randomized scaling / translation, horizontal flipping, and mild HSV jitter; during inference, only scale normalization and normalization processing are performed to avoid introducing additional latency and uncertainty. S1.4 Batch Processing and Accuracy: Training uses standard batch processing and EMA / gradient clipping for steady-state convergence; the inference stage can run on FP32 / FP16 to adapt to the computing power characteristics of edge GPUs / NPUs.

[0065] S2 Improved End-to-End Detection Network MGI-RTDETR Forward Inference (Backbone + Neck) S2.1 Backbone: Employs MGI-FE (Multi-Scale Grouped Interaction) for multi-scale grouped interactive feature extraction. The input channel is divided into four branches: Pixel Gated Detail Enhancement (PGS): Enhances high-frequency edges suppressed by motion blur; Local Context Refinement (LCR): Stabilizes neighborhood structure and continuity with 3×3 convolution; Sparse Mid-Range Coupling (SMC): Represents mid-range coupling between adjacent individuals with sparse keypoints / neighborhood relationships, alleviating frame merging and under-segmentation; Hierarchical Global Aggregation (HGA): Compresses and aggregates with lightweight convolutions on the high-resolution side, and approximates long-range dependencies with lightweight attention on the low-resolution side, suppressing background highlights and large-scale perturbations. After concatenation of the four branches, they are back-injected via 1×1 projection and channel-MLP residuals, outputting P2–P5 pyramid features. S2.2 Intra-scale Dynamic Mixing: ADC-MI (Adaptive Dynamic ContextMixing) is inserted into the encoder / neck, where the convolutional kernel is adaptively generated from the input statistics, assigning higher weights to areas of strong blur and local highlights, and suppressing pseudo-responses caused by splashes / reflections. S2.3 Cross-scale Fusion: ADPF (Adaptive Detail-Preserving Fusion) is used at the merging of high / low resolution branches, learning weights for each channel segment to finely balance "details vs. semantics," avoiding amplification of detail noise or suppression of semantics caused by simple addition / merging. S2.4 Upsampling and Deployment: At ×2 upsampling, ARPU (Adaptive Reverse-Projection Upsampler) is used to reconstruct high-resolution features from a back-projection perspective, weakening checkerboard artifacts and preserving fine edges; at the deployment end, CRC (Consolidated Re-parameterized Convolution) is used to fold the multi-path convolutions during training into a single 3×3 convolutional kernel, restoring single-path latency and cache friendliness. S2.5 Output Candidates: Dense candidates and their corresponding confidence or regression parameters are used as inputs for end-to-end decoding.

[0066] S3. End-to-end decoding without NMS, pairing and filtering. S3.1 Matching mechanism: The Hungarian matching paradigm is used to perform one-to-one allocation between candidates and targets, and end-to-end optimization is performed by jointly using classification confidence and IoU regression loss. S3.2 Threshold consistency: To ensure fairness with the comparison methods, scores and Top-K rules are uniformly set (RT-DETR series maintains no NMS), and a consistent post-processing window is used across different models. S3.3 Stability: For small targets and occluded instances, the decoder combines pyramid priors and adaptive weights during the allocation stage to improve localization stability and cross-threshold robustness (mAP50→mAP50-95) in high IoU (e.g., mAP75) scenarios.

[0067] S4 Online Multi-Target Tracking Coupling and Counting S4.1 Tracking Coupling: The detection results are input online into a lightweight MOT, such as the ByteTrack workflow. A dual-threshold candidate pool, Kalman prediction, and Hungarian matching are used, incorporating intermittent low-confidence detection to maintain trajectory continuity. S4.2 Cross-Line Counting: A virtual counting line perpendicular to the flow direction is set in the channel. A unidirectional cross-line crossing + hysteresis rule is used to determine the "first valid crossing," and a minimum duration / minimum net displacement is configured to filter short-term jitter. The same trajectory is counted only once, and short-term ID switching is aliased and merged to output a segment-level count estimate.

[0068] The MGI-RTDETR model consists of an improved backbone network, a hybrid encoding / neck and a deployment-focused parameterization module, characterized by: (1) Multi-scale grouped interactive feature extraction network (MGI-FE). The input features are divided into four groups according to channels, and pixel-gated detail enhancement (suppressing high-frequency degradation under blur), local context refinement (stabilizing neighborhood structure), sparse mid-range coupling (modeling mid-range correlation of adjacent trajectories) and hierarchical global aggregation (compressing long-range background interference) are performed respectively. After the four branches are spliced, they are implemented by 1×1 projection and channel MLP to achieve lightweight cross-channel interaction, so as to obtain multi-scale expression that takes into account both edges and context. (2) Adaptive dynamic context mixing module (ADC-MI). The input is first expanded by LayerNorm and 1×1 projection, and then divided into multiple branches; the depth convolution kernel of each branch is generated by the input statistics adaptively, so as to give higher weight to the motion blur significant area and suppress water splash highlights and reflection noise. Finally, it is regressed to the channel by 1×1 projection and stabilized by residual connection. (3) Adaptive detail-preserving pyramid fusion (ADPF). At the cross-scale fusion point, the high-resolution branch will be... Compared with the upsampled low-resolution branch Divided into segments according to channel Predict segment weights using statistical heads And fuse them according to equations (1)–(2):

[0069]

[0070] This segmented adaptive fusion alleviates the dilemma of "detail noise amplification" and "semantic suppression" without significantly increasing computing power, and improves the fusion quality of blurred edges and small targets. (4) Reparameterized convolutional blocks (CRC-Block). During the training phase, multi-branch or multi-level paths are preserved, and during the inference phase, the convolution-normalization pairs of each path are folded into a single block. In the convolution kernel, equations (3)–(4) are satisfied:

[0071]

[0072] Adding the same kernels together yields an equivalent single kernel, achieving "training multiple branches and pushing a single branch," restoring single-path delay while maintaining accuracy. This type of description, which uses formulas to depict the folding relationship of parameters within the module, is a common style in the specification. (5) Adaptive Back Projection Upsampling (ARPU). High-resolution features are reconstructed at the ×2 upsampling point using the idea of ​​"inverse filtering": channel learnable regularization and kernel normalization stabilize inverse operation, with the core being a depth-separable restoration operator, and numerical stability is maintained by front / back 1×1 projection and residual bypass; compared with fixed interpolation or transposed convolution, the fidelity of edges and slender structures is higher, and checkerboard artifacts are significantly reduced. (6) End-to-end decoding and counting components. The decoding end maintains the Hungarian matching paradigm without NMS; when counting is required, detection is coupled with lightweight online tracking, and a virtual counting line perpendicular to the flow direction is set. The trajectory is counted once for the first unidirectional crossing of the line, in order to suppress jitter and repeated counting caused by occasional low-resolution frames.

[0073] The training and inference implementation of the model constructed in this embodiment are as follows: E1, Data preparation and preprocessing: Acquire images or video frames of the pump back channel and conveyor belt scene, uniformly scale or pad to a fixed resolution, and perform random scaling, translation, horizontal flipping and light color perturbation; E2, Training: Train the end-to-end loss using the AdamW optimizer and cosine / segmented learning rate scheduling, and use EMA and gradient pruning to stabilize convergence; E3, Inference and deployment: Perform forward inference on edge devices or shipboard gateways using FP32 / FP16; CRC-Block is folded into a single convolution during the deployment phase to reduce latency; when counting is required, the estimated number of entries within a time segment is output using a cross-line strategy.

[0074] Preferred Embodiment 1: A method for fish detection and segment-level counting in the post-pump channel of a fish pump on a fishing vessel, the overall structure of which is as follows: Figure 1 As shown.

[0075] Step 1: Data Acquisition and Labeling.

[0076] In actual operation of the South China Sea light-based seine netting, a fixed camera (Hikvision FM8877215, 25 FPS, 2560×1400) was installed at the pump rear passage / deck conveyor belt. The camera position was approximately 3 meters above and in front of the fish storage bin, covering the main movement area of ​​the fish after they fall into the passage from the pump outlet. Figure 2 As shown. Nighttime operations are the primary mode, accompanied by strong directional lighting, localized specular highlights, and water splashes; camera parameters such as shutter speed, gain, and white balance are kept constant within a single flight segment to reduce drift within the domain. For engineering reproducibility, ROI clipping is not performed, preserving the complete deck context, including railings, chutes, conveyors, and pump pipe sections.

[0077] Frames were extracted from multiple video segments of aspiration or transport at fixed intervals, preferably at 1–2 FPS equidistant sampling, with a small number of random samples added at the beginning and end of each segment to cover abrupt changes in state, such as sudden flow or intermittent pump stoppage. To reduce temporal correlation, the number of samples included in each video segment was limited and the minimum interval between adjacent frames was controlled; highly similar images were deduplicated, and "near-duplicate frames" across segments were removed. To cover typical working conditions, samples were divided into three crowding densities based on the number of visible fish in a single frame and the degree of occlusion: low density—sufficient target spacing and little overlap; medium density—partially close to each other, with directional blur; and high density—significant overlap and clustering, strong splashes or specular interference. Density labels were only used for subsequent hierarchical evaluation and visualization analysis and did not participate in training or loss weighting. A total of 396 single-category (fish) detection images were ultimately generated.

[0078] Visible fish bodies are labeled using axis-aligned bounding boxes (AABB), following these rules: Visibility: Targets that can be identified as "fish bodies" are labeled; bright spots caused only by water splashes / highlights are not labeled. Occlusion / Truncation: When occluded by the device or edge of the image, the bounding box is defined by the visible area; instances with an occlusion ratio >80% and whose category cannot be determined are ignored. Size Threshold: Extremely small targets (short side <8 px) are ignored and not included in the ground truth evaluation if they cannot be reliably reproduced. Overlapping Individuals: Fish bodies that are close together but can be distinguished as two or more are bounded separately; if only one main body shape can be identified, merging them is prohibited. Motion Blur / Traces: "Wheels" caused by motion blur are not bound separately; the bounding box should be as close as possible to the centroid and main axis of the main body.

[0079] Standard annotation tools, such as LabelImg / LabelMe, are used to complete two rounds of annotation: the first round is drawn frame by frame by the annotator; the second round is checked for consistency by the reviewer, focusing on checking for missing or overlapping bounding boxes, mislabeling of strong highlight areas, and handling of extremely small targets. Arbitration is organized for disputed samples, and adjacent frames are reviewed if necessary to determine instance ownership. Both the original coordinates and the scaled / letterboxed coordinates are saved during export to ensure consistent mapping between training and evaluation. After removing nearly duplicate frames, training / validation / testing are divided in a 7 / 1 / 2 ratio (example: 277 / 40 / 79), with the smallest unit being a "video segment," to avoid frames of the same segment appearing in both training and testing. The three densities are evenly distributed across the three partitions; the file hierarchy includes images / and labels / subdirectories, and a manifest file (train.txt / val.txt / test.txt) is provided.

[0080] Step 2: Construct the improved end-to-end detection network MGI-RTDETR.

[0081] To balance accuracy and latency in the complex scenarios of "small targets + high speed + ambiguity + occlusion" in the post-pump channel / conveyor belt, MGI-RTDETR, while maintaining the end-to-end, NMS-free decoding paradigm of RT-DETR, has undergone a lightweight but targeted structural reconstruction of the backbone, encoder, and neck. The MGI-RTDETR structure is as follows: Figure 3 As shown. The overall output still shows a multi-scale pyramid of P2–P5, which is then fed into the hybrid encoder and decoder; the implementation strives to use... The algorithm primarily uses pointwise convolution, depthwise separable convolution, and group operations to reduce the overhead of attention-based global operators at high resolutions.

[0082] The main trunk adopts "Conv → MGI-FE alternating stacking: hierarchical generation: the original input is processed twice Convolutional downsampling yields P2, and then an MGI-FE module is inserted for each level of resolution reduction, resulting in P3, P4, and P5, forming a bottom-up hierarchical representation. The MGI-FE module (Multi-Scale Grouped Interaction) converts the input features... The data is divided into 4 groups for parallel processing based on each channel: Pixel Gated Saliency (PGS): Two layers Convolution performs "expansion-compression" to generate pixel-by-pixel gated maps, focusing on restoring high-frequency contours caused by blur; Local Context Refinement (LCR): single-path +BN+ activation enhances local structural continuity; Sparse mid-range coupling (SMC): for radius... Key points within the neighborhood are sparsely selected (Top-k) to model medium-scale trajectory / deformation relationships; Hierarchical Global Aggregation (HGA): high-resolution branches first use light compression (e.g., grouping / holeing) to suppress redundancy, then perform lightweight global aggregation; low-resolution branches can use minimal attention to approximate the global layout. After four branches are concatenated... The system integrates Channel-MLP (expansion ratio 2) + residuals to achieve inter-channel reshaping and information reinjection with extremely low overhead. Channel alignment: all levels use a unified approach. Projection alignment of channel count ensures plug-and-play functionality for subsequent modules, such as the MGI module. Figure 4 As shown; Intuitive effect: P2–P3 focus on the restoration of edges and fine textures, while P4–P5 provide stable context and deformation priors, laying the foundation for subsequent cross-scale interactions.

[0083] Introducing ADC-MI (Adaptive Dynamic Context Mixing) into each scale branch of the hybrid encoder: Channel adaptive expansion and decomposition: for First do LayerNorm and The projection performs channel expansion, followed by division into multiple sub-branches based on receptive domain (primarily small / medium receptive domains), with different branches targeting different motion and density patterns. Dynamic context blending: Each branch employs input-adaptive depthwise separable convolutions; the kernel weights are obtained through linear mapping using lightweight global statistics (such as GAP), thus assigning higher weights to motion-distorted regions and suppressing noise introduced by splashes / highlights. Rearrangement and residual backinjection: The outputs of each branch undergo channel rearrangement and lightweight fusion, finally... The projection restores the channel and the residual is back-injected into the main branch. The structure of the ADC-MI module is as follows: Figure 5 As shown. Design motivation: To provide "input-adaptive, local-mid-range parallel" intra-scale interaction without introducing expensive global attention, thereby improving robustness under high-speed blur and occlusion conditions.

[0084] At the neck convergence point, ADPF (Adaptive Detail-Preserving Pyramid Fusion) is used to adaptively balance the ratio between high-resolution details and low-resolution semantics: segmented weighted fusion: Let the high-resolution features be... The low resolution of upsampling is Divided into equal channels part Segment-level weights are generated using a lightweight statistical header (global pooling + linear mapping). And perform intra-segment fusion:

[0085] splicing and compression:

[0086] Then, standardization and activation are performed. Experience configuration: All are stable. It typically offers a better balance between accuracy and overhead. The structure of an ADPF is as follows: Figure 6 As shown. Intuitive effect: In areas where edges and fine textures are easily blurred and "smoothed out," higher weights are assigned to high-resolution branches; while in areas with severe deformation or congestion, low-resolution steady-state semantics are appropriately introduced, significantly reducing the binary choice problem of "mistakenly killing details or overwhelming semantics."

[0087] Introduce CRC-Block (Consolidated Re-parameterized Convolution) at several bottlenecks: During training: preserve multiple paths (e.g., ...). , With a small amount of vertical stacking, the representation capacity is increased and stabilized for optimization; during deployment: for each path, Conv-BN is first folded in the standard way.

[0088]

[0089] Then, the homogeneous nuclei are summed laterally and merged into a single nucleus. Convolution kernel; the structure of CRC-Block is as follows Figure 7 As shown. Benefits: Inference overhead and cache access fall back to the single-path level, while the multi-path expressiveness during training is retained in the deployment core, improving FPS without sacrificing accuracy.

[0090] ARPU (Adaptive Reverse-Projection Upsampler) is used at the neck region where magnification is needed: The core idea is to treat upsampling as the inverse problem of "depth convolution + stride sampling", and approximate the first-order closed-form solution with lightweight regularized back projection, avoiding the checkerboard artifacts of transposed convolution and the blurring of edges with fixed interpolation. Implementation path: pre-normalization → Premix → Backprojection kernel (depth, step size 2) → Post-mixing + residual bypass; the back-projection kernel and channel-based regularization parameters are learnable, with their numerical range constrained by the Sigmoid function to stabilize high-frequency amplification. The structural differences between standard convolution, transposed convolution, and inverse convolution are as follows: Figure 8 As shown. Visual effect: Maintains sharper edges and textures at high-contrast boundaries (fish body / splash / slide) in the post-pump channel, while maintaining consistency with the existing neck API interface.

[0091] Maintaining RT-DETR's one-to-one ensemble prediction training and NMS-free decoding: During training, Hungarian matching uniquely aligns queries with ground truth values, and the loss consists of classification and bounding box regression / IoU; during inference, the deduplicated detection results are directly output, avoiding the latency and instability caused by multiple thresholds / multiple rounds of NMS. To adapt to upstream modifications, the detection head is aligned with P2–P5 in terms of channel count and feature resolution, requiring no additional API modifications. Adopting the same NMS-free decoding paradigm as RT-DETR: One-to-one supervision is established during training through object queries and Hungarian matching; during inference, the deduplicated target bounding boxes and class scores are directly output, eliminating the need for post-processing NMS and reducing latency and threshold sensitivity.

[0092] Step 3, Training Strategy.

[0093] In the PyTorch environment, we employ the AdamW optimizer combined with a two-stage optional learning rate scheduling: cosine annealing or multistep decay. All comparison models maintain consistent batch size, initial learning rate, and total number of epochs to ensure comparability. Training is performed with a linear warm-up for the first few epochs / iterations to eliminate cold-start oscillations, and weighted exponential moving average (EMA) is used for stable convergence. Gradient clipping is enabled to address gradient spikes caused by extreme density and strong blurring, using the global norm as the benchmark, and mixed precision training (AMP) is used by default to reduce memory usage and improve throughput. The loss function consists of a linearly weighted classification loss (e.g., weighted CE or Focal), an L1 loss for bounding box regression, and a GIoU loss.

[0094]

[0095] Furthermore, isomorphic deep supervision (auxiliary loss) is applied to each layer of the decoder. The search range was determined using a grid search on the validation set, following the principle of "classification and localization losses of the same magnitude, with IoU terms slightly higher than L1," to improve localization stability and recall balance in small target and crowded scenarios. Normalized coordinates were used for the bounding box parameters. To eliminate scale sensitivity, images are scaled / filled to 640×640 using Letterbox. Online enhancement remains lightweight: random scaling and translation, horizontal flipping, and slight HSV jitter are limited to avoid disrupting the fish's main axis and slender shape. For geometric fidelity and deployment consistency, heavy stitching enhancements such as Mosaic / MixUp are not used in the main results. To approximate real-world noise, only slight Gaussian noise / brightness jitter is added with a low probability, avoiding strong filtering that distorts boundaries. Training uses hierarchical random sampling: sampling is done in approximately equal proportions using low / medium / high density buckets to ensure a stable distribution of crowding in each mini-batch and reduce inter-batch variance. Adjacent frames of the same video segment are not simultaneously included in training and validation to avoid temporal correlation leakage. Initial learning rate, weight decay, and other hyperparameters are selected using a small-range grid / Bayes search on the validation set with consistent metrics (F-Score and mAP50:95). For AdamW... Common robust settings are adopted and fixed across all methods. Model regularization, besides weight decay, does not introduce additional strong regularization, such as large label smoothing, to avoid over-suppression of small and ambiguous targets; the momentum of BN / LayerNorm is... The framework's default stable configuration is used. Each epoch evaluates Precision / Recall / F-Score, mAP50, mAP50–95, and throughput (FPS) on the validation set. The best checkpoint is saved using mAP50–95 as the primary metric and F-Score as a secondary metric, and a mild early stopping strategy is implemented; experiments terminate if no improvement is observed in the metrics over several epochs. All experiments use a fixed random seed, and Git commit numbers and complete configuration files are recorded to ensure reproducibility. All comparison methods strictly share the same training / validation protocol, differing only in network structure and their intrinsic hyperparameters.

[0096] Step 4: Reasoning and Output

[0097] To ensure fair evaluation of throughput and latency, this work uses a single GPU (NVIDIA V100-16GB) with uniform settings of FP32, batch=4, and input resolution of 640×640 for offline inference benchmarking. All methods maintain strict consistency in thresholds and hyperparameters such as Top-K during inference: the RT-DETR series employs its NMS-free decoding, using only class-independent confidence thresholds. Compared to the full graph Top-K (default) The YOLO / SSD series uniformly adopts intra-class NMS, and the NMS IoU threshold, confidence threshold, and number of retained values ​​remain consistent across models. Timing is based on the frame-by-frame average time after 100 warm-ups (excluding data loading), and the mean FPS and standard deviation are reported to measure stability.

[0098] Under the above configuration, the proposed MGI-RTDETR achieves a real-time output level of approximately 50 FPS while maintaining 44.5 GFLOPs and 13.39M parameters, with an average of (50.46) FPS. Its throughput is comparable to RT-DETR-R18, while exhibiting lower inter-frame jitter and standard deviation in high / medium / low density segments. For ease of engineering deployment, we further provide a latency breakdown: the backbone + neckline accounts for approximately 55–60%, the hybrid encoder and decoder for approximately 30–35%, and the detection head and post-processing for less than 10%. Since the decoding is NMS-free, the "significantly amplified NMS overhead with increasing target number" does not occur in dense scenes, resulting in a smoother latency increase with density. All detection results are output as a set of one-fish-one-frame data, with each record containing [cx, cy, w, h], relative to a normalized center point of 640 and width / height... , (Single-class fish). To align with the original video resolution (2560×1400), the inference end saves the letterbox affine parameters and uses an inverse transform to losslessly restore the 640 coordinates to the original image coordinate system; then, boundary clipping and rounding are performed, while retaining the values ​​synchronized with the frame timestamps. This format is compatible with subsequent ByteTrack zero-copy integration: the tracker consumes it directly. Structured array. Thresholds are consistent with Top-K. When there are large highlights or water droplet occlusions in consecutive frames, the quality-aware query of MGI-RTDETR can still iteratively refine from a reliable seed, resulting in a more stable output score distribution and reducing intermittent detection drops with "fluctuations". Combined with the NMS-free single threshold strategy, the post-processing time can be maintained at different densities, reducing the scheduling pressure on the real-time system. The detection set output by the inference end per frame can be directly fed to ByteTrack: 1) The tracker performs cross-frame association based on [x1,y1,x2,y2,score] and timestamps; 2) During the counting phase, the virtual crossing definition (coordinates in the original map system) is read, and the trajectory that first meets the conditions of unidirectional crossing and minimum continuous frame / net displacement is counted once; 3) The estimated number of items is summarized by segment.

[0099] The experiment benchmarked MGI-RTDETR against various strong real-time detectors on the post-pump channel test set, using a unified protocol: FP32, 640×640, batch=16; unified post-processing for YOLO / SSD series, and NMS-free decoding for RT-DETR series, with thresholds consistent with top-K. The metrics simultaneously covered classification-localization Precision, Recall, F-Score, mAP50, mAP75, mAP50–95, and efficiency Params, FLOPs, and FPS, consistent with the experimental structure commonly used in the field of fish vision. The comparison results of the evaluation metrics of different models are shown in Table 1.

[0100] Table 1 Experimental results of different fuzzy target detection models

[0101]

[0102] The experimental method achieved the best detection quality among all models: F-Score 81.23%, mAP50 81.00%, and mAP50–95 28.29%. Compared to the strongest Transformer baseline RTDETR-R18, it improved by 19.14, 22.17, and 3.31 percentage points, respectively; compared to the more competitive YOLOv8-RTDETR, F-Score and mAP50 improved by 18.26% and 18.82%, respectively. This is consistent with our design goal of maintaining boundary details and stabilizing the detection of crowded flow fields under strong blurring and splashing conditions.

[0103] While YOLO11n boasts high precision, its recall is low, and its F-score is moderate, indicating a tendency to miss detections in high-density jets. YOLOv5s-All and YOLOv8-RTDETR show improvements in recall, but their F-scores still lag significantly behind. MGI-RTDETR achieves both high precision and strong recall, demonstrating that grouped multi-scale interaction and adaptive hybridization suppress false positives caused by specular splashes and reduce missed detections due to motion blur and partial occlusion. Under the more stringent IoU (mAP75), all real-time baselines decline, but this method still ranks first, indicating more accurate positioning even when disturbed and distorted by water spray at the edge of the post-pump channel; this advantage is also reflected in the average mAP50–95, demonstrating robustness across thresholds.

[0104] Despite incorporating richer context modules, MGI-RTDETR maintains deployment-friendly overhead and a throughput of approximately 50.46 FPS, which is comparable to RTDETR-R18 and faster than some lighter baselines. Compared to RTDETR-R18, we achieved a significant improvement in accuracy while reducing the number of parameters by approximately 32.6% and FLOPs by approximately 21.8%, demonstrating that the introduced MGI-FE, ADC-MI, ADPF, and deployment-time CRC reparameterization deliver a genuine improvement in the accuracy-efficiency tradeoff, rather than simply adding more capacity.

[0105] Under the low-latency constraints common in shipborne gateways, MGI-RTDETR achieves optimal accuracy with essentially constant throughput. The greatest benefit occurs in recall-constrained scenarios, such as dense schools of fish and strong blurring, aligning with our design goals for mid-range coupling and global flow field modeling. Detail-preserving upsampling and adaptive fusion improve the stability of strict IoU, enabling mAP50–95 to surpass all real-time baselines. In summary, MGI-RTDETR represents a new state-of-the-art (SOTA) solution for anti-blurring real-time detection of small targets in post-pump channel imagery, and provides a solid foundation for subsequent tracking-based counting and visualization analysis.

[0106] The experiment progressively replaced modules on the RTDETR-R18 baseline to quantify the contribution of each component of MGI-RTDETR. The experiment followed a progressive reporting format common in aquatic vision work, gradually replacing modules and reporting accuracy / efficiency to clearly attribute improvements to specific structural choices.

[0107] Replacing the backbone with MGI-FE significantly enhances multi-scale representation: Precision improves by 10.0% to 70.3%, and F-Score improves by 7.04% to 69.13%. Localization is improved across all IoU levels, while computational cost is reduced by 12.2 GFLOPs and the number of parameters by 6.55, and FPS remains real-time. This demonstrates that MGI-FE can recover edge details under motion blur without sacrificing throughput. Adding ADC-MI further improves discriminative power in turbulent scenes: Precision improves by 5.04% to 75.34%, and F-Score improves by 3.02% to 72.15%. High IoU accuracy is particularly noticeable, with mAP50:95 improving to 30.07% and display frame alignment tighter; mAP50 slightly decreases, reflecting the trade-off towards stricter localization. However, at approximately equal computational power, the speed increases to 50.91 FPS. After introducing ADPF, segmented adaptive fusion boosted precision to 81.57%, F-score to 76.33%, and mAP50 to 68.73% by 3.72%. However, we observed an abnormal decline in high IoU metrics: without sufficient parameter tuning, channel segment weights may overemphasize detail edges, sacrificing box tightness. Nevertheless, overall confidence and low IoU recall were improved, while real-time performance remained consistent. During the CRC deployment phase, integrating multi-path blocks into a single 3×3 core resulted in the merging of multiple branches during training into a single path during deployment, leading to more stable latency and unchanged computational power. However, improper reparameterization timing or subsequent calibration could cause accuracy regression, revealing the sensitivity of BN folding and post-fusion calibration. Finally, by introducing ARPU and performing end-to-end retraining, the system achieved both high-resolution neckline recovery and spatial fidelity, resulting in optimal overall performance. Compared to intermediate variants, ARPU also mitigated the high IoU weakness caused by ADPF and integrated the gains from MGI-FE and ADC-MI.

[0108] MGI-FE delivers the greatest single-item accuracy leap with minimal computational cost, enhancing multi-scale features to resist blurring; ADC-MI slightly sacrifices low IoU AP in exchange for significantly high IoU alignment, which is crucial for occluded scenes; ADPF improves confidence and recall, but requires fine-tuning of segments and weights to avoid oversmoothing under strict IoU; CRC ensures deployment speed, provided that BN folding / calibration is appropriate; ARPU coordinates the entire chain, restores sharp edges and stabilizes gradients, enabling the model to achieve the best accuracy-efficiency balance under post-pump channel blurring and splashing conditions.

[0109] Table 2 Ablation Experiment Results

[0110]

[0111] To supplement the quantitative results, the experiment performed a qualitative comparison of five detectors on three images of the post-pump channel scene: RTDETR-R18, YOLOv5s-All, KAYOLO, Improved MobileNet-SSD, and MGI-RTDETR. The three images covered different levels of crowding: high density, medium density, and low density, such as... Figure 9 As shown. All methods use the same input resolution (640×640), score threshold, and NMS configuration; predicted bounding boxes and confidence scores are overlaid on each image. Furthermore, we provide heatmap visualizations of the same four images to explore the attention regions of each model.

[0112] In high-density scenes: In the most crowded image, small targets, fish bodies occluding each other, severe motion blur, and strong specular highlights coexist. MGI-RTDETR achieved the most complete target coverage with very few false negatives and clean separation of adjacent individuals. Its predicted bounding boxes are stretched and aligned along the long axis of the fish body, with the main direction of "head-to-tail" being consistent, thus preserving the slender shape of the fish body well. It produces almost no false positives when facing bright stripes / spots and undulating textures formed by water splashes under strong light. In contrast, RTDETR-R18 can locate several targets, but it sometimes divides the same fish into two or more boxes and occasionally misses in areas with strong specular highlights. YOLOv5s-All tends to have high accuracy, but recall decreases for partially occluded individuals, resulting in false negatives in dense areas. KAYOLO exhibits the phenomenon of treating two adjacent fish as one and enclosing them with a large box in densely packed areas of fish, indicating insufficient modeling of their mid-range relationships. Improved MobileNet-SSD triggered the most splash-type false alarms near high-contrast water jets.

[0113] In medium-density scenes, in two images with moderate clutter, moderate target spacing, directional motion blur, and intermittent highlights, MGI-RTDETR exhibits consistent confidence and stable bounding box shapes across all objects: predicted boxes fit the overall contour, and there are few false positives for bright spots formed by water splashes / reflections. This effectively avoids two common problems with lightweight backbones: one is that only the head or tail is bounded, resulting in insufficient bounding; the other is that the center and width / height of the bounding boxes fluctuate irregularly between adjacent frames. RTDETR-R18 performs well overall, but it is more prone to undersegmentation when individual objects overlap / grab edges, mistaking two closely spaced fish for one bounding box. YOLOv5s-All and KAYOLO each miss several samples with moderate-intensity blur; KAYOLO occasionally merges adjacent pairs of objects into one large bounding box. Improved MobileNet-SSD still triggers sporadic false positives at bright water droplets / ripples. Overall, MGI-RTDETR balances adjacent separation and confidence stability under medium-density conditions, and is more robust in recall and localization under directional ambiguity and local specular interference.

[0114] In low-density scenes: most detectors perform reasonably well when there are few targets and they are well separated; however, MGI-RTDETR exhibits the highest accuracy and can suppress background triggering caused by back-pump channels, deck textures, and backlit water mist. Compared to YOLOv5s-All / KAYOLO, our model produces fewer low-confidence false boxes; compared to RTDETR-R18, it has better principal axis alignment during fast, diagonal motion.

[0115] In terms of visualization, MGI-RTDETR simultaneously achieves: reducing false detections induced by splashing water; maintaining a slender outer contour under blur; and preserving individual separation in dense schools of fish. This aligns with the aforementioned superior F-Score and mAP metrics.

[0116] We visualized the heatmaps of three images to examine the feature assignments of each model under motion blur and specular highlight interference, such as... Figure 10As shown, the high response of MGI-RTDETR is mainly distributed along the overall outline of the slender fish body and the target area in patches, and it tends to suppress the texture of the transport grid, jet stripes and deck highlights; the distribution pattern is relatively stable under high / medium / low density. The results show that MGI-FE + ADPF prompts attention to the discriminative region consistent with the target shape / boundary, and ARPU reduces the false texture and fragmented response at high contrast boundaries during the upsampling stage. The RTDETR-R18 heatmap tends to spill over into the background stripes and water splash ridges, and has a weak alignment with the real target range; this is consistent with its target fragmentation and tail end missed detection phenomenon in crowded / blurred scenes. YOLOv5s-All / KAYOLO / MobileNet-SSD: It exhibits patchy and discretized response on blurred frames, and frequently activates bright spots / water droplets; this explains its results of more false detections of water splashes and lower recall of slender individuals in actual tests. The heatmaps illustrate that our model can shift model capacity from background highlights and regular textures to regions consistent with the target shape, thus maintaining more stable localization and separation under typical interferences in post-pump channel video, such as blur, reflections, and dense proximity, consistent with its advantages in mAP and counting accuracy. Despite these advantages, MGI-RTDETR may still underperform in near-saturated and extremely blurred post-pump channels, occasionally merging two nearly collinear fish bodies into a single bounding box. These examples are relatively rare; introducing temporally smoothed or lightweight cross-frame consistency priors is expected to compensate for the remaining gaps without changing the detector head.

[0117] To further verify the effectiveness of the detector in dynamic channel scenarios and lay the foundation for subsequent catch counting on the boat end, we coupled the detection results online with the lightweight multi-target tracker ByteTrack to construct a line-crossing counting module. Specifically, a virtual counting line perpendicular to the flow direction was set up in the channel after the pump. The first time a confirmed trajectory crossed this line in the specified direction, it was counted, consistent with mainstream practices for dynamic counting in aquaculture / fisheries. We cut out segments of low, medium, and high density from the entire fish-pulling operation video and manually verified the segment-level ground truth frame by frame: low density 20, medium density 634, and high density 171. The counting results are shown in Table 3. In terms of segment-level absolute error (prediction − ground truth), the model (MGI-RTDETR + ByteTrack) was +1 / -122 / -86 at the three densities, all better than the strongest baseline. Compared to RTDETR-R18, we approximately halved the positive bias at low density, reduced the low count at medium density by approximately 25%, and narrowed the low count at high density by approximately 8%. Compared to the best non-RT-DETR baseline for each density range, Ours reduced the error from 145 to 122 at medium density; and generally reduced the count by 5–20 lines at high density compared to other methods.

[0118] The results show two consistent trends. First, low-density scenes are more prone to exposing the over-detection tendency of the general YOLO / SSD backbone, mostly due to false targets induced by water splash highlights and the edges of the pump channel; our MGI-FE and ADPF effectively suppress such artifacts, making the predictions closest to the ground truth. Second, low counts are generally observed in medium / high density scenes, mainly because occlusion chains, motion blur, and partial detection near the pump outlet are merged into a single trajectory. Here, ADC-MI and ARPU maintain clearer contours and boundaries under blur, making ByteTrack's matching more stable, thus achieving leading accuracy in medium density and the highest high-density score in the group. Residual errors are mainly concentrated in the extremely short high-flow jet segment: fish body overlap and water splash peaks instantaneously occlude the contours, which are known challenges in single-frame driven detection-tracking counting processes. Under the same tracker and counting rules, MGI-RTDETR provides more reliable counts in all three densities, especially showing a significant advantage in low / medium density, and exhibiting the highest resilience in high-density scenes. The results support our core argument: feature design for fuzzy and fine-structure fidelity can significantly improve the stability of downstream counting in post-pump channel video while maintaining engineering deployability.

[0119] Table 3. Fish count results of different models at different density levels

[0120]

Claims

1. A method for detecting and counting fish in the post-pump channel of a fish pump on a fishing vessel, characterized in that, include: The image frame sequence of the fish moving along the pump channel was acquired and preprocessed. A fish detection model based on an improved RT-DETR is constructed to identify fish in sequentially input image frames and obtain fish detection results. The improved RT-DETR includes: An MGI-FE module is introduced into the backbone network to extract multi-scale grouped interactive features. An ADC-MI module is embedded in the neck network to dynamically adjust the weights of the set regions based on the local statistical information of its input features. Then, ADPF, CRC and ARPU modules are introduced to perform multi-scale feature fusion. Based on the fused features, ensemble prediction decoding without NMS is used to generate fish categories and corresponding bounding boxes; Multi-target tracking is performed in real time based on the fish body detection results. A virtual counting line perpendicular to the flow direction is arranged in the channel after the pump. The number of times the same tracking trajectory effectively crosses the virtual counting line for the first time is counted to obtain the fish count result.

2. The method according to claim 1, characterized in that, The MGI-FE module divides the input features into four groups according to the channel dimension. After processing by the pixel-gated saliency branch, the local context optimization branch, the sparse mid-range coupling branch, and the hierarchical global aggregation branch, the features are concatenated. The concatenated features are then processed by 1×1 convolution and channel MLP residual units in sequence to output the corresponding scale features.

3. The method according to claim 2, characterized in that, The pixel-gated saliency branch performs two 1×1 convolution expansion-compression processes on the branch input features to obtain a pixel-by-pixel gating weight map. Then, the gating weight map is multiplied by the branch input features and added to the branch input features before being output.

4. The method according to claim 2, characterized in that, The local context optimization branch performs 3×3 convolution and normalization on the branch input features in sequence before outputting the results.

5. The method according to claim 2, characterized in that, The sparse mid-range coupled branch performs key point screening on the branch input features within a neighborhood of a set radius. The generated key point map is upsampled and used as a gating factor to be multiplied point by point with the branch features before being output.

6. The method according to claim 2, characterized in that, The hierarchical global aggregation branch compresses the high-resolution branch input features through sparse selection and then aggregates them using grouping / dilated convolution before outputting the results. For the low-resolution branch input features, a lightweight Transformer-style attention is introduced to obtain long-range dependencies, which are then added to the residuals of the branch input features before outputting the results.

7. The method according to claim 1, characterized in that, The dynamic adjustment of the set region weights based on local statistical information of its input features includes: After applying layer normalization to the input features and performing channel expansion with 1×1 projection, the features are divided into multiple sub-branches according to different receptive fields. Global statistics and linear mapping are performed on the input features, and the depth convolution kernel weights of each branch are adaptively generated to assign higher weights to the specified regions. The features output from each sub-branch are rearranged and lightweight fused through channels, and then processed sequentially by 1×1 convolution and residual units before being output.

8. The method according to claim 1, characterized in that, The ADPF module divides the input high-resolution features and upsampled low-resolution features into several segments according to channels. Each segment is assigned adaptive fusion weights based on global statistics and linear mapping. After fusion of each segment, the segments are processed by 1×1 convolution and then output.

9. The method according to claim 1, characterized in that, The ARPU module uses depth-separable back-projection convolution instead of standard convolution, establishes a regularized closed inverse for downsampling convolution in the frequency domain, normalizes the back-projection convolution kernel through softmax, uses cyclic filling for the boundary and uses bilinear interpolation results as the initial solution.

10. The method according to claim 1, characterized in that, The CRC model employs a multi-level parallel path convolutional structure during the training phase, and folds each path into an equivalent convolution during the deployment phase. Then, it superimposes the homogeneous kernels on the channel dimension to form a single 3×3 convolution.

Citation Information

Cited By

  • Encrypted traffic classification method and system based on state space modeling and cross-dimensional scanning

    CN122120213A