Graph Archetype Contrastive Learning
- The paper introduces GAC as an identity-aware contrastive mechanism that refines EEG graph representations by anchoring samples to subject-specific archetypes.
- GAC organizes EEG embeddings by applying a two-level contrastive loss—sequence and channel—to enhance feature consistency and class separability.
- Empirical results show that integrating GAC within the SFTG framework improves EEG visual decoding performance under high intra-subject variability.
Graph Archetype Contrastive Learning (GAC) is an identity-aware contrastive learning mechanism introduced within the Spatial-Functional Awareness Transformer-based graph archetype contrastive learning (SFTG) framework for decoding visual neural representations from electroencephalography (EEG) signals (Sun et al., 29 Sep 2025). In that formulation, EEG is treated as a high-dimensional, noisy, non-Euclidean signal whose variability is strongly affected by subject-specific factors such as anatomy, scalp placement, cognition, attention, and temporal drift. GAC addresses the specific problem that multiple representations of the same underlying neural pattern may arise from temporal shifts and other variability, especially under high intra-subject variability. Rather than treating each EEG trial as an isolated sample, it organizes learned EEG graph representations around subject-specific archetypes and contrasts each sample against the archetype of its own identity, with the stated aim of improving feature consistency and class separability (Sun et al., 29 Sep 2025).
1. Conceptual role in EEG-based visual decoding
Within SFTG, GAC is paired with the EEG Graph Transformer (EGT). The division of labor is explicit: EGT builds the representation, and GAC shapes the geometry of that representation space (Sun et al., 29 Sep 2025). The broader problem setting is EEG-based visual decoding, where EEG signals are described as noisy, low-SNR, non-Euclidean, and prone to noise and artifacts. The paper further argues that high intra-subject variability can produce unstable learning signals and inconsistent feature spaces, because two EEG sequences from the same subject may look quite different even though they reflect the same underlying neural state (Sun et al., 29 Sep 2025).
The central claim attached to GAC is therefore not merely that contrastive learning is beneficial, but that the contrastive targets should be identity-aware. In the proposed formulation, each subject is associated with a stable subject-level anchor derived from the model’s own learned graph-level features. Individual trials are pulled toward that anchor while being pushed away from the archetypes of other subjects or identities. This identity-aware organization is presented as the mechanism by which SFTG improves robustness and generalization under subject variability (Sun et al., 29 Sep 2025).
A common misconception would be to treat GAC as a generic prototype loss. The paper explicitly distinguishes it from prior prototype-clustering approaches that produce identity-agnostic pseudo-labels and can be unstable under intra-subject variability. In GAC, the archetypes are ground-truth identity-aware rather than identity-agnostic (Sun et al., 29 Sep 2025).
2. Graph representation and the EGT backbone
The SFTG framework begins from an EEG sequence represented as , where is the number of channels and is the number of time steps (Sun et al., 29 Sep 2025). Because EEG electrodes are not arranged on a grid, the channels are modeled as a graph with adjacency matrix . This graph structure is used to capture spatially meaningful relationships among electrodes and functional connectivity across distant channels.
For the graph encoder, each time step corresponds to a graph with node set
and edge set
The adjacency matrix is initialized from spatial or functional connectivity patterns (Sun et al., 29 Sep 2025).
To inject graph structure into the transformer, positional encodings are computed from the graph Laplacian:
Using the 0 smallest non-trivial eigenvectors, each node receives a positional embedding 1, which is combined with the node feature as
2
The EGT then uses multiple full-relation (FR) heads to model interactions between electrodes:
3
4
followed by residual normalization and FFN refinement:
5
6
Finally, graph-level representations are pooled across nodes and time:
7
This 8 is the sequence-level EEG graph representation that becomes the input to GAC (Sun et al., 29 Sep 2025).
3. Subject-specific archetypes
GAC begins by collecting sequence-level graph embeddings from training EEG samples, denoted
9
and grouping them by ground-truth identity into
0
Here, 1 indexes the identity or subject class, and 2 is the number of EEG sequences for that identity (Sun et al., 29 Sep 2025).
The archetype of the 3-th identity is defined as the mean of that subject’s sequence-level graph features:
4
This definition is the core of the method. The archetype is not a manually designed prototype, but the average of the model’s own learned graph features for a given identity. The paper’s rationale is that such an archetype provides a stable anchor against trial-level perturbations and can reduce within-subject spread while increasing between-subject distance (Sun et al., 29 Sep 2025).
This suggests that the term “archetype” is being used in a specifically operational sense rather than in a broader unsupervised representation-learning sense. It denotes a subject-level average in the learned EEG graph embedding space, computed from ground-truth identity groupings. A plausible implication is that the stability of the archetype depends on the quality of the EGT features from which it is estimated, which is consistent with the paper’s presentation of EGT and GAC as tightly coupled components rather than separable modules.
4. Contrastive objective and supervision levels
The full GAC loss combines sequence-level and channel-level supervision:
5
The paper therefore defines GAC as a two-level contrastive objective rather than a single prototype-matching term (Sun et al., 29 Sep 2025).
The sequence-level objective is
6
In this loss, the sample representation 7 is the anchor, the matching archetype 8 is the positive, and all other subject archetypes 9 for 0 are negatives. The similarity metric is the dot product 1, scaled by temperature 2 (Sun et al., 29 Sep 2025).
The channel-level loss is
3
Here, 4 is the 5-th EEG graph representation for sample 6 of identity 7. The linear projections 8 and 9 align channel-level graph features and archetypes into a shared contrastive embedding space 0 (Sun et al., 29 Sep 2025).
The stated motivation for the two-level structure is that sequence-level graph features capture the subject’s broader neural pattern, while channel-level features reflect local temporal snapshots. By combining the two terms with temperatures 1 and 2 and a balancing coefficient 3, GAC is designed to enforce consistency at both the global sequence level and the finer-grained channel level (Sun et al., 29 Sep 2025).
5. Training dynamics and optimization logic
The training procedure described for GAC is organized as a sequence of operations on encoded graph representations. First, EEG graphs are constructed from multichannel EEG. Second, each graph is encoded with EGT into node-level and sequence-level embeddings. Third, the sequence-level embeddings are grouped by ground-truth identity. Fourth, an archetype 4 is computed for each identity by averaging its embeddings. Fifth, the GAC loss is applied:
5
Sixth, the model is trained end-to-end so that representations become more consistent and discriminative (Sun et al., 29 Sep 2025).
Two implementation details are emphasized. One is that the channel-level loss uses linear projection heads 6 and 7 to map sample features and archetypes into the same contrastive space. The other is that graph features are built over a sequence of 8 graph snapshots and aggregated with equal weighting in the pooled representation 9 (Sun et al., 29 Sep 2025).
The paper also notes that this formulation can be interpreted as an Expectation-Maximization-like optimization strategy, because archetypes are repeatedly estimated from current representations and then used to refine those representations. This suggests a recurrent alternation between representation estimation and prototype stabilization, although the method is still described as end-to-end training rather than as a separately staged EM algorithm. A plausible implication is that the archetype computation provides a dynamically updated regularizing structure inside the representation space.
6. Empirical evidence, scope, and interpretation
The reported empirical evidence is drawn from comprehensive subject-dependent and subject-independent evaluations on the Things-EEG dataset, where SFTG is said to significantly outperform prior state-of-the-art EEG decoding methods (Sun et al., 29 Sep 2025). In the main results table, the framework achieves the best results in both settings.
| Setting | Top-1 | Top-5 |
|---|---|---|
| Subject-dependent | 55.4% | 83.8% |
| Subject-independent | 13.6% | 35.4% |
The comparison baselines listed in the paper are BraVL, NICE, NICE-SA, NICE-GA, ATM-S, VE-SDN, and UBP. SFTG is reported as consistently the best or near-best across nearly all subjects. The paper interprets this as support for the claim that GAC helps generalization and robustness, especially under subject variability (Sun et al., 29 Sep 2025).
The ablation study isolates the contribution of GAC more directly by comparing Baseline, NC, EGT + NC, and EGT + GAC. The reported progression is that simply adding naive contrastive learning helps over the baseline, adding EGT gives a large jump because graph structure matters, and replacing NC with GAC gives the best performance. Across the five subjects in the ablation table, EGT + GAC consistently improves over EGT + NC in both mAP and Rank-1. The paper explicitly states that GAC improves mAP by 1.1–3.4% and Rank-1 by 0.8–2.2% over the direct contrastive baseline, and presents this as confirmation that archetype-based contrastive supervision is more effective than naive contrastive learning (Sun et al., 29 Sep 2025).
The qualitative evidence is more indirect. Representational similarity analysis shows clear intra-category clustering in EEG representations aligned with image features, and t-SNE visualization shows well-separated clusters, especially for animal and food categories. The paper notes that these are not direct GAC-only results, but treats them as consistent with the claim that the learned EEG embedding space is more semantically organized (Sun et al., 29 Sep 2025). This distinction is important: the strongest evidence specific to GAC is the ablation comparison, whereas RSA and t-SNE support the broader representational interpretation of SFTG.
Taken together, the paper characterizes GAC not as an auxiliary loss in the narrow sense, but as the main mechanism for handling high intra-subject variability in EEG-based visual decoding. Its role is to stabilize EEG graph representations by defining subject-specific archetypes as means of learned sequence-level graph features and by contrasting both sequence-level and channel-level representations against those archetypes. In the proposed framework, improved feature consistency within a subject and improved class separability across subjects or identities are the principal outcomes attributed to that design (Sun et al., 29 Sep 2025).