---
title: 'GGDSM: Gain-guided Dynamic Style Memory'
url: https://www.emergentmind.com/topics/generalization-gain-guided-dynamic-style-memory-ggdsm
type: topic
---

# GGDSM: Gain-guided Dynamic Style Memory

Searching arXiv for the cited paper and closely related context.
Generalization Gain-guided Dynamic Style Memory (GGDSM) is a memory mechanism introduced within the Style Screening and Continuous Utilization (SSCU) framework for Federated Domain Generalization person re-identification (FedDG-ReID). Its purpose is to screen generated styles according to whether they improve the global model’s generalization performance, accumulate only the styles judged beneficial, and make those styles continuously available during subsequent training. In the formulation of SSCU, generated styles are not assumed to be uniformly useful: styles that increase the global model’s generalization ability are treated as **positive styles**, whereas styles that do not improve or degrade generalization are treated as **negative styles**. GGDSM operationalizes this distinction by using round-level improvement in the server model’s Rank-1 performance as the admission criterion for memory updates, thereby coupling style accumulation to measured generalization gain rather than to style generation alone [2507.16238].

## 1. Conceptual role within SSCU

GGDSM addresses a specific limitation in prior style-based FedDG-ReID pipelines: existing methods improve sample diversity through style transformation, but they implicitly treat all generated styles as beneficial. SSCU rejects that assumption and instead distinguishes between generated styles that help generalization and those that do not. In this setting, **positive styles** are generated styles that increase the global model’s generalization performance, while **negative styles** are generated styles that fail to improve or actively degrade it [2507.16238].

The framework-level rationale is procedural. Traditional methods discard generated styles after each communication round. SSCU instead evaluates the aggregated global model after each round; if performance improves, the styles generated in that round are treated as positive styles and stored, whereas non-improving styles are discarded. This establishes GGDSM as a selective retention mechanism rather than a passive replay buffer. A plausible implication is that GGDSM converts transient augmentation outputs into a cumulative repository of historically validated style information.

Within SSCU, GGDSM is not an isolated module. It is paired with a style memory recognition loss and a Collaborative Style Training (CST) strategy. The combined design ensures that style screening, accumulation, and reuse are parts of a single training loop rather than separate heuristics [2507.16238].

## 2. Generalization gain and the screening criterion

The paper does not introduce a separate explicit scalar formula named “generalization gain,” but it defines the screening process procedurally. In each round, clients train locally using generated styles, the server aggregates the client-global models, the aggregated global model is evaluated, and the current evaluation is compared with that of the previous round. The key indicator of generalization capability is the **Rank-1 performance of the global model** [2507.16238].

The operational criterion is:

\[
R^{(e)} > R^{(e-1)} \quad \Rightarrow \quad \text{current round styles are positive}
\]

where \(R^{(e-1)}\) is the previous round’s Rank-1 and \(R^{(e)}\) is the current round’s Rank-1. Conversely, if Rank-1 does not increase, the current round’s generated styles are treated as negative. The underlying equivalence is stated directly:

\[
\text{positive style} \iff \text{global Rank-1 increases after using these styles}
\]

\[
\text{negative style} \iff \text{global Rank-1 does not increase}
\]

An important property of this rule is that the judgment is made at the **round level** rather than per image. Styles generated during a round are collectively admitted or rejected based on whether the server-side evaluation improves. This means GGDSM treats the style set of a communication round as the unit of generalization attribution. This suggests that the memory stores styles validated by end-to-end federated optimization and aggregation, not merely by local reconstruction or augmentation quality [2507.16238].

## 3. Memory structure, initialization, and update dynamics

GGDSM maintains a **separate memory for each client**, with no interaction between the memories of different clients. Each client memory stores **category prototypes** for each identity. For client \(k\), the memory is

\[
M_k = \{M_k^i\}_{i=1}^{P_k}
\]

where \(P_k\) is the number of pedestrian identities on client \(k\) [2507.16238].

Before training begins, a pretrained global model extracts features from all training samples on a client, and those features are averaged by identity to initialize the memory. The initialization is written as

\[
M_k^i = \frac{1}{n_k^i} \sum_{x \in X_k^i} f_{\text{pretrain}(x) \tag{1}
\]

where \(X_k^i\) is the set of all images of identity \(i\) on client \(k\), \(n_k^i\) is the number of images in that set, and \(M_k^i\) is the category prototype for identity \(i\). The source text notes obvious LaTeX or typographical corruption in this equation, but the intended operation is identity-wise prototype initialization from a pretrained model [2507.16238].

For an input image \(x_k^i\), the stylization model \(f_T^k\) of client \(k\) generates a stylized image

\[
\hat{x}_k^i = f_{T^k}(x_k^i) \tag{2}
\]

and the stylized features used for memory update are denoted in Algorithm 1 as

\[
\hat{F}_k = \|f_{Client-G}^k(\hat{B}_k)\|_2
\]

that is, the \(L_2\)-normalized features extracted by the client-global model from stylized batches [2507.16238].

Memory updates are momentum-based:

\[
M_k^i \leftarrow (1 - m) M_k^i + m \sum_{x \in B_k^i} \| f_{Client-G}^k(\hat{x}_k^i) \|_2 \tag{3}
\]

where \(B_k^i\) denotes all images of identity \(i\) in the mini-batch on client \(k\), \(f_{Client-G}^k\) is the client-global model, \(\|\cdot\|_2\) denotes \(L_2\)-normalization, and \(m \in [0,1]\) is the momentum coefficient. The memory prototype is therefore not replaced outright; instead, it is gradually updated toward newly validated stylized features. The paper emphasizes that this supports continuous accumulation of positive styles, implicit expansion of training samples, and mitigation of limited local data [2507.16238].

The update is conditional rather than continuous. If the round does not improve the global Rank-1, then the styles are discarded and the memory is not updated. GGDSM is therefore a **gated memory** in the precise sense that admission is controlled by server-side generalization improvement [2507.16238].

## 4. Style memory recognition loss

To exploit the memorized positive styles, SSCU introduces a **style memory recognition loss**. Its stated motivation is that cross-entropy alone focuses too much on correct identity classification and may cause overfitting to particular styles. The proposed loss instead maximizes similarity with the correct prototype while minimizing similarity with the other prototypes, encouraging style-robust representations [2507.16238].

For an image \(x_k^i\) and client memory \(M_k\) containing \(P_k\) identities, the loss is

\[
L_{id}(f,x_k^i,M_k^i) = -\log \frac{\exp(\|f(x_k^i)\|^T_2 M_k^i / \tau)} {\sum_{n=1}^{P_k} \exp(\|f(x_k^i)\|^T_2 M_k^n / \tau)} \tag{4}
\]

where \(f\) is the model to be optimized, \(M_k^i\) is the prototype for identity \(i\), and \(\tau\) is a temperature factor. Similarity is computed by a dot product between the normalized feature and the prototype [2507.16238].

The loss is instantiated on two branches:

\[
L_{PS\_L}^k(f^k_{Client-L},x_k^i,M_k^i) = L_{id}(f^k_{Client-L},x_k^i,M_k^i) \tag{6}
\]

\[
L_{PS\_G}^k(f^k_{Client-G},x_k^i,M_k^i) = L_{id}(f^k_{Client-G},x_k^i,M_k^i) \tag{7}
\]

and then combined as

\[
\begin{aligned}
L_{PS}^k(f^k_{Client-L},f^k_{Client-G},x_k^i,M_k^i) &= L_{PS\_L}^k(f^k_{Client-L},x_k^i,M_k^i) \\
&\quad + L_{PS\_G}^k(f^k_{Client-G},x_k^i,M_k^i)
\end{aligned} \tag{8}
\]

This two-branch formulation makes the memory usable by both client-local and client-global models. A plausible implication is that the memory acts as an identity-conditioned style regularizer across local and federated representations, rather than as a purely auxiliary classification target [2507.16238].

## 5. Interaction with Collaborative Style Training

GGDSM is tightly coupled to SSCU’s **Collaborative Style Training (CST)**, which uses both newly generated styles and accumulated positive styles. CST contains two parallel branches: **New Style Adaptation (NSA)** and **Positive Style Continuous Utilization (PSCU)** [2507.16238].

In NSA, original images are stylized and fed into the client-global model. The optimization objective is the sum of cross-entropy loss and triplet loss:

\[
\begin{aligned}
L_{NS}^{k} &= L_{CE}(cls_{k}(f_{Client-G}^{k}(\hat{x}_{k}^{i})), y_k^i) \\
&+ L_{Tri}(f^{k}_{Client-G}(\hat{x}_{k}^{i}, y_k^i))
\end{aligned} \tag{5}
\]

where \(cls_k\) is the client-specific classifier and \(y_k^i\) is the identity label [2507.16238].

In PSCU, the system uses the untransformed original images \(x_k^i\) together with the memory prototypes \(M_k^i\). Both the client-local and client-global models are trained with the style memory recognition loss defined above. Conceptually, the division of labor is explicit: NSA handles rapid adaptation to newly generated styles, GGDSM screens and stores the beneficial styles, and PSCU continuously reuses them [2507.16238].

The coupling is central to the meaning of GGDSM. Without CST, GGDSM would only filter and store styles; with CST, the stored positive styles are integrated into ongoing optimization. The paper therefore frames GGDSM not merely as a storage structure, but as the memory component of a broader style accumulation-and-reuse pipeline.

## 6. Training procedure and optimization pathway

Algorithm 1 specifies the client–server workflow in which GGDSM operates. Each client first initializes its memory,

\[
M_k \leftarrow \text{INITIALIZE}(X_k, M_k, f_{server})
\]

using the server model. Then, for each communication round \(e = 1, \dots, E\), the server distributes the server model to each client; each client samples a batch \(B_k\), generates a stylized batch

\[
\hat{B}_k \leftarrow f_T^k(B_k),
\]

trains the client-global model with the new-style adaptation objective,

\[
f_{Client-G}^{k} \leftarrow L_{NS}(f_{Client-G}^{k}, \hat{B}_k),
\]

trains both client-global and client-local models with the positive-style utilization objective,

\[
f_{Client-G}^{k}, f_{Client-L}^{k} \leftarrow L_{PS}(f_{Client-G}^{k}, f_{Client-L}^{k}, B_k, M_k),
\]

and extracts stylized features,

\[
\hat{F}_k = \|f_{Client-G}^{k}(\hat{B}_k)\|_2.
\]

The server then aggregates client-global models as

\[
f_{server} \leftarrow \sum_{k=1}^{K} \frac{N_k}{N} f^k_{Client-G},
\]

evaluates the aggregated model, and updates the client memories only if Rank-1 improves:

\[
M_k \leftarrow \text{UPDATE}(M_k,\hat{F}_k)
\]

[2507.16238].

The paper does not explicitly print a single weighted combined objective in the provided text, but the algorithm indicates sequential application of \(L_{NS}\) and then \(L_{PS}\). Accordingly, the client-side optimization can be summarized as optimizing \(f_{Client-G}^k\) and \(f_{Client-L}^k\) using \(L_{NS}^k + L_{PS}^k\), with \(L_{NS}\) operating on stylized data and \(L_{PS}\) operating on original data and memory prototypes [2507.16238].

A key procedural point is that the memory update occurs **after** server aggregation and evaluation, not during every local mini-batch step. This differentiates GGDSM from ordinary online prototype updates and makes the memory dependent on federated generalization feedback rather than only on local training dynamics [2507.16238].

## 7. Empirical behavior, implementation profile, and interpretation

The paper characterizes GGDSM as lightweight. The memory stores only category prototypes, there is no inter-client memory exchange, the update is a momentum average, and the recognition loss is prototype-based. Relative to style generation and standard ReID training, the added overhead is therefore described as minimal [2507.16238].

The implementation details reported for SSCU are: backbone same network as **DACS**; epochs **60**; batch size **64**; initial learning rate **1e-3**; weight decay **5e-4**; momentum **0.9**; **MultiStepLR** scheduler with milestones at epochs **20** and **40**; framework **Python 3.9** and **PyTorch 2.1.0**; hardware **two Nvidia RTX-2080Ti GPUs** [2507.16238].

The ablation study directly supports the memory accumulation mechanism. On the protocol **MS+C2+C3→M**, the reported results are: Baseline **20.8 mAP / 51.9 Rank-1**; **Baseline + PSCU** **33.6 / 61.3**; **Baseline + NSA** **36.2 / 63.9**; **Baseline + NSA + PSCU** **39.5 / 66.4**. On **M+C2+C3→MS**, the results are: Baseline **6.1 / 20.7**; **+PSCU** **7.5 / 22.6**; **+NSA** **7.9 / 24.7**; **+NSA+PSCU** **11.9 / 32.3**. These comparisons show that both branches help, that the memory branch alone yields a substantial gain, and that the combination performs best [2507.16238].

The main leave-one-out evaluation also reports the best average performance for SSCU. For **MS+C2+C3 → M**, SSCU achieves **39.5 mAP / 66.4 Rank-1**, compared with DACS at **36.3 / 61.2**. For **M+C2+C3 → MS**, SSCU reports **11.9 / 32.3**, compared with DACS at **10.4 / 27.5**. For **M+C2+MS → C3**, SSCU reports **32.8 / 34.1**, compared with DACS at **30.7 / 34.1**. Averaged over three unseen domains, SSCU reaches **28.1 mAP / 44.3 Rank-1**, compared with DACS at **25.8 / 40.9** [2507.16238].

The paper also reports source-domain recognition performance, emphasizing that DG methods often prioritize target generalization while overlooking source performance. SSCU reports **73.0 / 88.7** on M, **84.9 / 83.9** on C2, and **50.4 / 53.2** on C3, outperforming DACS on each of those source-domain evaluations [2507.16238].

Finally, the visualization evidence in Fig. 3 is used to motivate GGDSM directly: some generated styles lose substantial detail and are labeled as negative styles, whereas positive styles preserve detail and improve performance; when styles are screened and memorized, the model recovers more quickly from performance drops than methods that discard all styles. The paper interprets this as evidence that generalization-gain-guided screening is necessary. More broadly, the reported results suggest that GGDSM improves generalization by filtering harmful styles, accumulating beneficial stylistic diversity across rounds, and enabling persistent reuse of validated styles rather than treating augmentation outputs as disposable [2507.16238].

Source: https://www.emergentmind.com/topics/generalization-gain-guided-dynamic-style-memory-ggdsm