FMRFT: Fusion Mamba and DETR for Query Time Sequence Intersection Fish Tracking

Mingyuan Yao, Yukang Huo, Qingbin Tian, Jiayin Zhao, Xiao Liu, Ruifeng Wang, Lin Xue, Haihua Wang

TL;DR

Researchers have developed FMRFT, a real-time fish tracking model that combines the efficiency of State Space Models (Mamba) with the precision of Real-Time DEtection Transformers (RT-DETR). By introducing a novel query intersection module and a memory-efficient feature extractor, the system achieves a 94.3% MOTA (Multi-Object Tracking Accuracy) while requiring significantly less video memory than traditional Transformer-based models.

What Problem Does This Paper Address?

Monitoring fish behavior in industrial aquaculture is vital for early disease detection and feeding optimization. However, tracking individual fish is a "computer vision nightmare" for several reasons:

  1. High Similarity: One sturgeon looks almost exactly like another.
  2. Complex Environments: Underwater reflections, bubbles from oxygenators, and murky water create "visual noise."
  3. Frequent Occlusions: Fish constantly swim over and under each other, causing trackers to lose their "ID" or create redundant tracking boxes.
  4. Computational Cost: Standard Transformer-based trackers (like MOTR) are notoriously memory-hungry, making them difficult to deploy on the edge in real-world farming environments.

Methods

The authors propose the FMRFT (Fusion Mamba and DETR for Query Time Sequence Intersection) framework, which innovates in three key areas:

  • Fusion MIM (Mamba In Mamba): Instead of a standard backbone, the model uses a MIM architecture for feature extraction. This allows the model to capture both global context and fine-grained details (like fish boundaries) with linear computational complexity, solving the "memory explosion" issue of standard Transformers.
  • QTSI (Query Time Sequence Intersection): This module is used during training to calculate the Intersection Over Union (IoU) between "Tracking Queries" (what we think we're following) and "Detect Queries" (new things we've found). This prevents the model from generating multiple redundant boxes for the same fish and helps maintain a stable ID even when fish overlap.
  • MQIM (Mamba Query Interaction Module): This replaces the standard Query Interaction Module. By leveraging Mamba’s bidirectional temporal processing, it helps the model "remember" fish features across long sequences, which is crucial for tracking fast-moving targets.

Datasets

The study introduces a new multi-scenario sturgeon tracking dataset:

  • Scale: 8,000 high-quality images and 11,000 labeled frames.
  • Scenarios: It includes "Scene 1" (opaque plastic containers with simple lighting) and "Scene 2" (reflective metal containers with bubbles and water circulation) to simulate real-world factory farming.
  • Benchmarks: The model was compared against industry standards like ByteTrack, OC-SORT, FairMOT, and MOTR.

Key Insights and Ideas

  • Mamba > Transformers for Video: The "aha moment" here is the application of Mamba's linear scaling to the multi-object tracking (MOT) problem. While Transformers struggle with long video sequences due to quadratic complexity, Mamba handles the temporal "memory" of the fish much more efficiently.
  • Solving Redundancy via Intersection: Traditional query-based trackers often struggle with "double-tracking" a single object. By using the QTSI module to intersect tracking and detection queries, the authors effectively "de-duplicated" the model's output during the learning phase.
  • Multi-Scale Fusion is Mandatory: The authors found that simply extracting features wasn't enough; they had to deeply fuse deep-level detail with shallow-level global information (via the Fusion MIM) to distinguish fish from bubbles and reflections.

Key Results

The FMRFT model outperformed several state-of-the-art trackers across nearly all metrics:

  • Accuracy: Achieved an IDF1 score of 90.3% and a MOTA of 94.3%.
  • Efficiency: The model used only 6GB of Training Memory Allocation (TMA), compared to 10GB for MOTR and 23GB for OC-SORT.
  • Speed: It maintains a real-time processing speed of 50 FPS, making it viable for live monitoring.
  • Robustness: Ablation studies showed that adding the QTSI module alone improved the IDF1 score by 7.8%, proving its effectiveness in handling occlusions.

Limitations and Future Work

While FMRFT is highly effective, the authors noted a few areas for improvement:

  • Long-term Re-entry: If a fish leaves the frame or is occluded for an extremely long period, the model can still struggle with ID reassignment upon its return.
  • Dataset Diversity: The current dataset focuses on sturgeon. Future work aims to expand the dataset to include more fish species and even more complex aquatic environments.
  • Dedicated Feature Memory: The team plans to explore more advanced "dedicated feature memory" modules to further stabilize tracking for objects that disappear and reappear frequently.

Summary updated

BibTeX
@article{yao2025fmrft,
  author = {Mingyuan Yao and Yukang Huo and Qingbin Tian and Jiayin Zhao and Xiao Liu and Ruifeng Wang and Lin Xue and Haihua Wang},
  title = {{FMRFT: Fusion Mamba and DETR for Query Time Sequence Intersection Fish Tracking}},
  journal = {Comput. Electron. Agric.},
  year = {2025},
  doi = {10.1016/j.compag.2025.110742},
}
Figure