A Sheaf-based Framework for Architecture-Agnostic Comparison of Neural Networks

Title

A Sheaf-based Framework for Architecture-Agnostic Comparison of Neural Networks

Subject

Physics

Creator

Francesco Papini

Date

2025

Abstract

Comparing neural networks across architectures is a challenging task: performance metrics like accuracy are often non-exhaustive, while representation metrics (e.g., CKA/RDM) can be biased and affected by data preprocessing. We introduce a sheaf-based framework that produces a compact, dataset-conditioned functional fingerprint of a network using intermediate activations. Starting from a model’s computational graph (in this work restricted to sequential MLP/CNN architectures) we build a sheaf by attaching metric–measure stalks to layers and construct linear restriction maps via entropic Gromov–Wasserstein optimal transport. From each sheaf we build a filtration and extract the trajectory of Laplacian eigenvalues. We use the mean eigenvalue curves as our network fingerprint. To compare models, we compute Dynamic Time Warping (DTW) distance between fingerprints. We conduct extensive experiments with different architectures and datasets and empirically show that our fingerprints cluster models by functional behaviour and separate trained from random instances with high external validity, while exhibiting strong internal quality and robustness. This new approach complements existing representation metrics, scales to heterogeneous widths/depths without one-to-one layer matches, and provides a principled, low-dimensional summary for cross-architecture comparison.

Meta Tags

Sheaf theory, Cellular sheaves, Sheaf Laplacian, Architecture-agnostic model comparison, Neural network comparison, Functional similarity, Representational similarity, Activation geometry, Metric–measure spaces, Gromov–Wasserstein optimal transport (GW), Entropic optimal transport, Dynamic Time Warping (DTW), Spectral fingerprints, Eigenvalue trajectories, Weight-threshold filtration, Spectral graph theory, Topological data analysis (TDA), Permutation invariance, Cross-architecture analysis, Model fingerprinting, Robustness and stability, Clustering metrics (ARI, Silhouette), CNNs, MLPs, Digit dataset, Synthetic Torus dataset, CKA, RSA, Procrustes.

Files

Citation

Francesco Papini, “A Sheaf-based Framework for Architecture-Agnostic Comparison of Neural Networks,” URSS SHOWCASE, accessed November 3, 2025, https://linen-dog.lnx.warwick.ac.uk/items/show/821.