Papers › DGMamba: Domain Generalization via Generalized State Space Model

DGMamba: Domain Generalization via Generalized State Space Model

11 Apr 2024arXiv:2404.07794archive 2025-07-28

Shaocong Long, Qianyu Zhou, Xiangtai Li, Xuequan Lu, Chenhao Ying, Yuan Luo, Lizhuang Ma, Shuicheng Yan

Domain generalization~(DG) aims at solving distribution shift problems in various scenes. Existing approaches are based on Convolution Neural Networks (CNNs) or Vision Transformers (ViTs), which suffer from limited receptive fields or quadratic complexities issues. Mamba, as an emerging state space model (SSM), possesses superior linear complexity and global receptive fields. Despite this, it can hardly be applied to DG to address distribution shifts, due to the hidden state issues and inappropriate scan mechanisms. In this paper, we propose a novel framework for DG, named DGMamba, that excels in strong generalizability toward unseen domains and meanwhile has the advantages of global receptive fields, and efficient linear complexity. Our DGMamba compromises two core components: Hidden State Suppressing~(HSS) and Semantic-aware Patch refining~(SPR). In particular, HSS is introduced to mitigate the influence of hidden states associated with domain-specific features during output prediction. SPR strives to encourage the model to concentrate more on objects rather than context, consisting of two designs: Prior-Free Scanning~(PFS), and Domain Context Interchange~(DCI). Concretely, PFS aims to shuffle the non-semantic patches within images, creating more flexible and effective sequences from images, and DCI is designed to regularize Mamba with the combination of mismatched non-semantic and semantic information by fusing patches among domains. Extensive experiments on five commonly used DG benchmarks demonstrate that the proposed DGMamba achieves remarkably superior results to state-of-the-art models. The code will be made publicly available at https://github.com/longshaocong/DGMamba.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2404.07794")

Code

Syntology Ran 10 of 19 code samples harvested from 1 repository linked to this paper; 9 have no recorded run. Of those that ran: 1 ran · honoured contract; 9 ran with no contract checked.

By repository: official repository: 19 samples from 1 repository, 10 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

longshaocong/dgmamba officialmentioned in paperpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

19 samples harvested; 10 ran; 1 honoured the contract we drafted; 9 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · honoured contract
9ran
9unverified

Licence: 19 of the 19 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from longshaocong/dgmamba. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

DG_accuracy longshaocong/dgmamba/utils/dgutil.py official repository ran no licence file found · pointer only · 662cf8d97140cda9 · report
build_optimizer longshaocong/dgmamba/utils/optimizer.py official repository ran no licence file found · pointer only · a18d89a1835d386e · report
build_scheduler longshaocong/dgmamba/utils/lr_scheduler.py official repository ran no licence file found · pointer only · 016895042cc7e7ef · report
flops_selective_scan_ref longshaocong/dgmamba/models/DGMamba.py official repository ran no licence file found · pointer only · 70da3e1d0057bfd4 · report
get_grad_norm longshaocong/dgmamba/utils/utils.py official repository ran · honoured contract no licence file found · pointer only · eec1e7cba51d5e8e · report
image_train longshaocong/dgmamba/datautil/imgdata/util.py official repository ran no licence file found · pointer only · a58ba2e71a236bcb · report
img_param_init longshaocong/dgmamba/utils/dgutil.py official repository ran no licence file found · pointer only · 052a1046098cf3e8 · report
l_loader longshaocong/dgmamba/datautil/imgdata/util.py official repository ran no licence file found · pointer only · a6c359ef4eaf2794 · report
rgb_loader longshaocong/dgmamba/datautil/imgdata/util.py official repository ran no licence file found · pointer only · cdf44342cf572e6d · report
train_valid_target_eval_names longshaocong/dgmamba/utils/dgutil.py official repository ran no licence file found · pointer only · bba624070b5f54a1 · report
auto_resume_helper longshaocong/dgmamba/utils/utils.py official repository unverified no licence file found · pointer only · 0c32459bef92ff8c · report
check_keywords_in_name longshaocong/dgmamba/utils/optimizer.py official repository unverified no licence file found · pointer only · b0a5beb34716d5a6 · report
create_logger longshaocong/dgmamba/utils/logger.py official repository unverified no licence file found · pointer only · 80450600f7f09b0a · report
cross_selective_scan longshaocong/dgmamba/models/DGMamba.py official repository unverified no licence file found · pointer only · 18cfe27d0fac09c9 · report
flops_selective_scan_fn longshaocong/dgmamba/models/DGMamba.py official repository unverified no licence file found · pointer only · 9a3adc8e6de35ac1 · report
get_config longshaocong/dgmamba/config.py official repository unverified no licence file found · pointer only · 794b88ac04e1b5f1 · report
load_checkpoint_ema longshaocong/dgmamba/utils/utils.py official repository unverified no licence file found · pointer only · 48adeb55bee17fb9 · report
set_weight_decay longshaocong/dgmamba/utils/optimizer.py official repository unverified no licence file found · pointer only · 2d5473f673967c35 · report
update_config longshaocong/dgmamba/config.py official repository unverified no licence file found · pointer only · f7288a06dd5000ae · report

Tasks

Domain GeneralizationMambamodel

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Convolution

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections