Abstract
State Space Models (SSMs), particularly Mamba, have emerged as efficient alternatives to Transformers for global modeling in computer vision. However, applying Mamba to 2D image tasks like Super-Resolution (SR) often suffers from "local pixel forgetting" due to fixed 1D scanning patterns. We present TSP-Mamba, which reformulates local pixel aggregation as a Traveling Salesman Problem (TSP). By dynamically finding the shortest path between pixels based on visual similarity, TSP-Mamba preserves local correlations while maintaining linear complexity. Our approach achieves state-of-the-art performance in lightweight super-resolution benchmarks with significantly reduced computational overhead.
Introduction
The advent of Mamba has brought linear computational complexity to global modeling, a significant leap over the quadratic scaling of Transformers. Despite this, the transition from 1D sequences to 2D images remains challenging. Standard scanning patterns, such as raster or snake scans, often separate spatially adjacent pixels in the flattened 1D sequence, leading to a loss of local context—a critical component for Single-Image Super-Resolution (SISR).
TSP-Mamba addresses this by introducing a content-adaptive scanning strategy. By treating image patches as graphs and solving for the optimal traversal path, the model ensures that visually similar and spatially close pixels remain proximal in the sequence processed by the SSM.
Methodology
The core innovation of TSP-Mamba lies in its structure-aware scanning mechanism, which combines global and local perspectives.
TSP-based Local Scanning
To mitigate local pixel forgetting, we treat a local $4 \times 4$ patch as a graph where nodes represent pixels. The edge weights are defined by the negative Cosine similarity between pixel features. We then solve a simplified version of the Traveling Salesman Problem to find the shortest path that visits every pixel. To maintain efficiency, we restrict the search to immediate neighbors and fix the starting point.
TSP-LSTM Block and Global Integration
Information along the optimal path is aggregated using a bidirectional LSTM, enhanced with Distance Embeddings to account for "jumps" across edges or discontinuities. This locally-enriched sequence is then integrated into a standard 2D-SSM pipeline for global context modeling.
Experiments and Results
We evaluated TSP-Mamba on standard SISR benchmarks (Set5, Set14, BSD100, Urban100, Manga109) using the DIV2K training set.
- Accuracy: TSP-Mamba consistently outperforms existing SOTA models. For instance, it exceeds the baseline MambaIR by 0.71dB on the Manga109 dataset at $\times 2$ scale.
- Efficiency: The "Tiny" variant (TSP-Mamba-T) uses only 59% of the parameters and 57% of the FLOPs compared to MambaIR while maintaining competitive performance.
- Generalization: In zero-shot depth map super-resolution tests on the NYU-V2 dataset, TSP-Mamba outperformed MambaIR by nearly 1dB, indicating superior feature representation capabilities.
Discussion and Conclusion
TSP-Mamba demonstrates that the efficiency of State Space Models can be effectively harnessed for image restoration by making the scanning process content-adaptive. By following the "flow" of the image through a TSP-based path, the model preserves essential local structures. Future work will focus on improving robustness to noise and exploring hierarchical path optimization to further bridge the local-global gap.
Summary updated