Topological-Guided Block Screening (TGBS)
- TGBS is a method that identifies the neural network layer with maximal topological class separability using persistent homology.
- It computes persistence diagrams and distances (e.g. Wasserstein) between activations to differentiate within-class from between-class variations.
- The selected block underpins FedTopo, enhancing representation alignment in federated learning with heterogeneous, non-IID data.
Topology-Guided Block Screening (TGBS) is a principled procedure for selecting, from among all intermediate blocks in a neural network, the single layer whose feature activations encode maximally discriminative topological information as measured by persistent homology. Within the context of federated learning under non-I.I.D. conditions, TGBS serves as the key precursor to topologically-informed representation alignment, targeting features most robust to client data heterogeneity and most semantically useful for class-level discrimination (Hu et al., 16 Nov 2025).
1. Motivation and Role in Federated Learning
In federated learning, each client’s local data distribution can diverge markedly from the joint population, causing learned representations to drift toward incompatible optima. Conventional pixel- or patch-level matching objectives often fail to capture the global, multi-scale geometric structure relevant to high-dimensional tasks. TGBS addresses this gap by screening for network blocks whose feature activations, when expressed as topological summaries—connected components (), loops (), etc.—exhibit strong separation between within-class and between-class pairs. Empirical findings show that shallow layers are overly responsive to low-level, noisy textures, while overly deep layers can overcompress and lose critical geometry. Selecting an optimally informative block is thus essential for targeting features that are stable for alignment across clients and sampling conditions (Hu et al., 16 Nov 2025).
2. Persistent Homology on Neural Activations
Let be an input, the tensor of activations at block , and a channel index. Each channel is treated as a scalar field over the 2D grid , inducing a sublevel-set filtration,
As varies, connected components (0-dimensional homology; ) are born (at ), merge, and persist until death (at ); cycles (1-dimensional; ) similarly appear and vanish. The full persistence diagram in degree for channel is
with the number of -dimensional topological features.
3. Topological Separability and Block Selection Criteria
For block , persistence diagrams are computed for samples in a validation set. Pairwise diagram distances (using metrics such as Wasserstein or bottleneck) are gathered: for same-class and for different-class pairs. With similarity defined as , the ROC curve is constructed to evaluate how well topological summaries separate class labels. Correspondingly, the block’s topological separability score is
a strictly increasing proxy for mutual information . The block maximizing this AUC is chosen as the topology-informative block.
4. Algorithmic Workflow and Pseudocode
The TGBS procedure operates as follows:
- Candidate screening: For each block in backbone , activations are extracted for all validation samples .
- Dimensionality reduction: (Optional) PCA compresses to channels.
- Persistence computation: For each , persistent homology is calculated for and .
- Distance sampling: For each metric , within-class and between-class pairs are sampled, their diagram distances calculated, similarities inverted, and ROC AUC measured.
- Aggregated scoring: The mean AUC across metrics is computed per block.
- Selection: The block maximizing AUC is returned.
Pseudocode:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
Algorithm: TGBS( backbone f, candidate blocks B, validation set D, distance metrics M, N_pairs )
for each block b in B do
Extract activations z_i = f_b(x_i) for all x_i in D
(Optional) Dimensionality reduction: ẑ_i = PCA(z_i) to K channels
For each sample i, compute PD_i = PersistentHomology(ẑ_i) for H_0 and H_1
for each metric m in M do
Sample N_pairs within-class pairs Pw and N_pairs between-class pairs Pb
Compute distances d_{jk} = dist_m(PD_j,PD_k) for (j,k) in P = Pw ∪ Pb
Set similarities s_{jk} = -d_{jk} and compute AUC_m(b) = ROC_AUC( {s_{jk} )
end for
AUC(b) = (1/|M|) sum_{m in M} AUC_m(b)
end for
b* = argmax_{b in B} AUC(b)
return b* |
5. Topological Signature Construction: Persistence Images
Raw persistence diagrams are mapped to birth–persistence coordinates for compatibility with learning-based frameworks. The density function
is rasterized over a fixed grid and flattened to vector , yielding a persistence image. Features with persistence below a threshold may be pruned to reduce noise.
6. Computational Characteristics and Practical Considerations
For , worst-case PH reduction is , , but practical implementations tend toward near-linear time via union-find and clearing heuristics: . Typically, is reduced to via PCA and only per block are sampled. Conversion from persistence diagrams to persistence images incurs per channel; across channels the cost is . For a ResNet-18 layer with , , 5k validation examples require only minutes of computation. This suggests that TGBS scales efficiently even for moderately sized networks and datasets.
7. Illustrative Usage and Integration within FedTopo
Upon pre-training, TGBS is run on a held-out validation set to select the topology-informative block . During each federated learning round, clients extract activations at and compute topological embeddings,
comparing local to global . Topological Alignment Loss (TAL) is instantiated as
with total local loss given by and adaptive scheduling for . By concentrating TAL on , FedTopo aligns precisely those features whose topology maximizes class discriminability, significantly reducing representation drift under non-I.I.D. client splits (Hu et al., 16 Nov 2025).
In summary, Topology-Guided Block Screening constitutes a computationally efficient, data-driven mechanism for block selection in deep neural networks, identifying layers whose persistent-homology signatures maximize topological class separability. This screening underpins both the compact topological embedding and the robust representational alignment realized in the FedTopo framework, and is essential for mitigating the representational divergence endemic to non-I.I.D. federated learning environments.