Manuscript Offprint
arXiv:2610.34346Spatially-Aware Self-Organizing Graph Autoencoders via Localized Hebbian Learning
Robin Koç
Computer Engineering Department
Middle East Technical University
Ankara, Türkiye
Hazal Moğultay Özcan
Computer Engineering Department
Middle East Technical University
Ankara, Türkiye
Fatoş T. Yarman Vural
Computer Engineering Department
Middle East Technical University
Ankara, Türkiye
Abstract—Traditional autoencoders rely on static network architectures to learn latent representations. Recently we suggested a dynamic architecture inspired by Hebbian plasticity, enabling topological self-organization among convolutional feature maps [1]. Early implementations of this paradigm infer relationships among feature maps using global average pooling and model their interactions through scalar-valued connections. This approach falls short to fully exploit the underlying spatial information, embedded in input images. Furthermore, abrupt transitions between different loss functions and training dynamics can introduce representation shocks, leading to unstable feature learning. In this paper, we introduce a Spatially-Aware Self-Organizing Graph Autoencoder (S-LooM) to address these structural bottlenecks. By using spatial cross-correlation, and spatial kernels, S-LooM establishes dynamic connections among feature maps. We replace static scalar message passing of autoencoders with learnable spatial kernels and eliminate high-frequency deconvolutional artifacts observed in decoders using nearest-neighbor upsampling. Via a soft-blending training curriculum, the latent topology aligns smoothly during training. Our experiments show that S-LooM yields a more stable topology, compared to the state of the art dynamic architectures. Meaning, the graph structure that emerge has more resistance to feature entanglement and noise. It forms functional communities responsible for visual attributes, such as illumination, shape and texture even under high connection densities.
Keywords—graph neural networks, feature extraction, Hebbian plasticity, self-organization, spatial awareness
I. INTRODUCTION
Deep learning architectures, such as autoencoders, capture the underlying structure of given datasets through convolutional encoders and decoders. Although they are inspired by biological neurons from the start, they usually rely on static networks designed prior to training. This contrasts with biological neural networks, which exhibit adaptive connectivity through Hebbian plasticity, where synapses evolve dynamically based on co-activation [2] and exhibit highly adaptive plasticity.
In a foundational study [1], we introduced the LooM architecture, bridging the gap between the biological principle and autoencoders, by dynamically optimizing latent connectivity using a self-organizing graph. While LooM provided a proof-of-concept for Hebbian-guided representation learning, its initial implementation revealed specific bottlenecks in translating this concept to convolutional features:
-
Global Averaging in Hebbian Statistics Calculation: Determining Hebbian co-activation by averaging entire feature maps can merge features that exist in completely disjoint regions of the visual input, and provide incorrect co-activation statistics.
-
Restrictive Scalar Message Passing: Relying only on single scalar weights to pass messages between latent nodes limits structural expressivity, because a scalar can only uniformly amplify or dim an entire feature map. This was pushing the model to silencing or activating entire feature maps rather than allowing them to cooperate with one another.
-
Curriculum Transitions: Even though the introduction of graph loss value is gradual, abrupt introduction of message passing can cause shocks, forcing the decoder to unlearn weights as latent distributions suddenly shift.
-
Generative Checkerboard Artifacts: Standard transposed convolutions often suffer from uneven kernel overlaps, which introduces high-frequency checkerboard artifacts to the spatial outputs. Since the Hebbian teacher relies on statistical correlation, this artifacts act as noise when gathering Hebbian statistics, forcing the model into forming false topological connections.
To address these challenges, we propose S-LooM (Spatially-Aware LooM), a graph-autoencoder architecture driven by Hebbian learning. The S-LooM architecture is built upon three main components: a convolutional encoder, a convolutional decoder, and a self-organizing graph layer between them where each node represents a feature map extracted by the encoder. This graph structure evolves during training to discover relationships between feature maps, and allow them to interact with each other during later parts of the training and inference. The graph layer relies on two core mechanisms, Hebbian statistics gathering by using co-activations between feature maps, and message passing for cooperation between said feature maps based on gathered statistics. To overcome the limitations of early implementations, S-LooM replaces the scalar message passing between nodes with learnable spatial kernels that allow spatial feature blending, and utilizes localized spatial cross-correlation to ensure that connections only form between features co-activating within similar receptive fields. Finally, to stabilize
Our PyTorch implementation and interactive evaluation dashboard are publicly available at https://github.com/robinkoc/LooMs.
this dynamic learning process, we employ an artifact-free decoding scheme to prevent artificial noise from corrupting the Hebbian statistics, alongside a soft-blending curriculum to gradually introduce message passing and mitigate representation shock. To promote reproducibility, our PyTorch implementation and the interactive evaluation dashboard are publicly available at https://github.com/robinkoc/LooMs.
Hebbian Plasticity in Modern Architectures Hebbian learning served as the foundation for associative memory in Hopfield networks [6], but its non-differentiable nature has limited its integration into backpropagation-driven deep learning [5]. In a recent study [1], we bridged this gap by using Hebbian co-activation statistics as a detached topological teacher for a learnable autoencoder graph. However, proposed model relied on global average pooling to gather co-activation statistics, abstracted away the spatial geometric context, and treated activations of complex two-dimensional feature maps as isolated scalars.
Spatial Coherence and Generative Artifacts A persistent goal in visual generative modeling is the preservation of visual integrity. Many traditional autoencoder architectures flatten latent variables into dense vectors, destroying spatial dimensions. And models that retain the spatial nature of feature maps, utilize transposed convolutions, thus frequently suffer from checkerboard artifacts caused by kernel overlaps. As demonstrated by Odena et al. [7], replacing standard deconvolution operations with resize-convolutions (nearest-neighbor upsampling followed by standard convolution) eliminates these high-frequency distortions. S-LooM requires the integration of this artifact-free decoding since artificial structural noise corrupts the Hebbian co-activation statistics that guide the model itself.
III. GENERAL ARCHITECTURE OF S-LOOM
Following the baseline established in the LooM framework [1], the S-LooM architecture is composed of three primary parts: a convolutional encoder that extracts spatial feature maps, and a convolutional decoder that reconstructs the original input from the feature maps and between them a dual-graph layer that orchestrates these features topologically, as illustrated in Fig. 1. This modular pipeline keeps topological self-organization in the latent space, preserving the foundational encoding and decoding mechanics of the autoencoding process.
The S-LooM encoder E produces K feature maps that are explicitly preserved as two-dimensional matrices. This design choice retains the geometric context for each input image . A sigmoid function is applied at the

Fig. 1: Graphical abstract of the S-LooM architecture. The encoder extracts feature maps, which branch into localized spatial correlations to be used for the Hebbian Matrix , and spatial maps themselves are fed into the Learnable Graph . The red arrow between the graph structures represents the topological alignment loss.
output of the encoder to normalize the value ranges. The matrix containing the extracted feature maps is defined as:
These feature maps are then passed to a graph layer G inserted between the encoder and the decoder. This layer dynamically reorganizes the feature maps based on their emerging co-activation relationships, strictly without altering their dimensions:
The decoder then reconstructs the image from these modified matrices:
However, a structural vulnerability in the prior implementations was their reliance on standard transposed convolution operations in the decoder. Transposed convolutions with stride greater than one, frequently suffer from uneven kernel overlaps, which introduces periodic checkerboard artifacts into the reconstructed outputs. Because our Hebbian graph relies heavily on spatial cross-correlation between feature maps to learn the latent topology, artificial noise can create false statistical correlations by back-propagating from the decoder, distorting gathered Hebbian statistics, thus the graph structure itself.
To overcome this problem, the S-LooM uses artifact-free resize-convolutions instead of transposed convolutions in decoder. Let be any feature map within the decoder. First, we expand its spatial dimensions by a scale factor using nearest-neighbor upsampling, defined as . This duplicates existing values to stretch the feature map without creating overlapping artifacts. A standard 2D convolution with learnable weights is then applied to process the features into the next layer's output: .
By separating the spatial expansion and learnable convolution step , we make sure that every pixel has uniform structural paths during backpropagation. This prevents the artificial checkerboard patterns often caused by transposed convolutions, keeping the gradients clean so the Hebbian graph learns from real visual features rather than structural noise.
IV. SPATIALLY-AWARE DUAL-GRAPH LAYER
The core of the S-LooM framework is the dual-graph layer. This layer orchestrates the topological self-organization without requiring a predefined adjacency matrix. It consists of two parallel structures: the learnable autoencoder graph and the Hebbian graph. The learnable autoencoder graph, , is defined by a node set and an edge weight matrix :
where are the spatial feature maps obtained in Equation (1).
The Hebbian graph, represented by its edge weight matrix , acts as a topological guide. It dictates the statistical relationships between feature maps based on their co-activations. As can be seen in the dashed red alignment arrow in Fig. 1, this topological guidance is enforced on the learnable graph through an addition to the standard autoencoder loss function. By pulling the weights of learnable autoencoder graph toward the Hebbian graph during backpropagation, this mechanism ensures that the emergent graph reflects visual relationships, forming a latent space without sacrificing reconstruction accuracy.
Because the network’s learnable parameters and the statistical co-activations are continuously updated throughout the learning process, both graphs evolve simultaneously. To formalize this, let t represent the current training step. At any given time step t, the dual-graph layer is expressed as the union of the evolving weights over the shared nodes:
In order to enforce genuine inter-feature message passing and prevent the network from collapsing into an identity mapping, the graph layer explicitly masks self-connections, . Specifically, the connection that any feature node i makes with itself is strictly zeroed out, enforcing across both graphs at all time steps t.
A. Localized Hebbian Co-activation
In S-LooM, co-activation statistics are calculated according to localized spatial alignment. Given centered and normalized feature maps, the co-activation between features and at time is calculated directly via their maximum spatial cross-correlation also at time :
where denotes the cross-correlation operator, and represent the two-dimensional spatial shifts applied during the operation.
Since S-LooM derives Hebbian updates directly from pairwise spatial similarities rather than independent node scalars, evaluating activation thresholds on individual nodes is mathematically incompatible. Instead, to explicitly enforce graph sparsity, S-LooM dynamically prunes weak connections by computing a quantile threshold directly over the edges. Based on a target sparsity ratio p, this approach zeroes out weak structural connections while accumulating the correlation values of the surviving active edges according to the following formula:
where is the indicator function that outputs 1 if the condition is met and 0 otherwise, and is a momentum coefficient controlling the update speed of the connections. Before used as a target for the learnable graph, the Hebbian graph is normalized to create a stable and balanced "graph skeleton" ( ):
where m and n iterate over all feature nodes to find the maximum edge weight across the entire Hebbian graph.
B. Spatial Message Passing
Message passing enables latent feature maps to exchange information and cooperate based on their co-activation relationships. However, relying on scalar weights to formulate these messages limits structural expressivity. When a message is computed by multiplying a source feature map with a single scalar, the operation uniformly amplifies or dims the entire map. To overcome this restriction, S-LooM introduces learnable spatial kernels between nodes. Let represent a learnable 2D convolutional kernel defining the spatial transformation of messages from feature node to node .
Unlike a scalar weight, a spatial kernel allows the model to shift features, allowing the network to construct cooperative visual representations by recombining parts of co-activating feature maps. To ensure the network initially relies entirely on the encoder feature map outputs without untrained graph interference, these spatial kernels are initialized from a zero-mean normal distribution with a small standard deviation (0.02).
During the forward pass, the continuous scalar edge weights act as continuous gating mechanisms that determine the scales of the values in these spatial kernels. The total aggregated message passed to the -th feature map is computed using a 2D convolution operator (denoted by *) between spatial kernel and source (j-th) feature map itself:
To maintain numerical stability and prevent exploding activations during graph aggregation, S-LooM employs a strict scale-preservation mechanism. The updated feature map is computed by adding the aggregated messages to the original feature map (acting as an identity skip connection) and normalizing by the total weight of the incoming edges:
Because the initial encoder features are constrained to a range via a sigmoid activation, this normalization formulation mathematically bounds the aggregated output. It ensures that even under highly dense graph topologies, the magnitude of the latent representations fed into the decoder remains stable and protected from exploding gradients.
V. SOFT-BLENDING CURRICULUM AND OPTIMIZATION
The network jointly optimizes the visual reconstruction performance ( ) and the graph topology similarity ( ):
The total loss is dynamically balanced as:
The LooM training protocol utilized a ramp function to smooth the transition between training phases, but this ramp function was only effective on the graph loss coefficient ( ). So, LooM still subjected the forward pass to a hard, half-instantaneous transition by allowing the message passing to take effect on the feature maps instantly (switching abruptly from to ). This caused sudden shifts in the latent distribution fed to the decoder and caused representation shock. To resolve this, S-LooM refines the multi-stage curriculum by applying a soft-blending mechanism directly to the feature maps:
• Stage 1 (Warm-up): The graph layer is bypassed ( ). The goal is merely for the convolutional filters to extract basic spatial features and reach a stable reconstruction error.
• Stage 2 (Topological Alignment & Soft-Blending): The graph layer is activated. To prevent representation shock, S-LooM introduces a soft-blending curriculum function . Over a predefined ramp period of epochs, the latent representation smoothly interpolates between the raw encoder features F and the graph-processed features as follows:
where linearly scales from 0 to 1. Simultaneously, the coefficient scales up from zero to equalize gradient magnitudes, optimizing via . Basically not just gradually introducing the graph loss to the mix, also gradually increasing the effects of the message passing on the feature maps.
• Stage 3 (Structural Specialization): The graph layer is frozen. The model subjects the feature maps to a final fine-tuning on the fixed topology.
This smooth curriculum allows the decoder to adapt gradually to the changing latent topology, contributing to the stable validation performance observed in our empirical evaluations.
VI. EXPERIMENTS AND RESULTS
In this section, we evaluate the performance of S-LooM. We are constraining our evaluations to Cifar-10 dataset to be able to isolate the effects of architectural changes while benchmarking it against the original LooM architecture [1]. Because this work builds upon the conceptual basis of a prior study, our evaluations are focused on how the shift from global scalar routing to spatially-aware message passing impacts baseline fidelity, stability across graph densities, and visual explainability.
A. Experimental Setup and Baseline Performance
To ensure a fair comparison, S-LooM was trained using identical hyper-parameters to the prior LooM study: a latent space of feature maps, the Adam optimizer (learning rate of 0.001), loss, and a 150-epoch limit.
Under a highly sparse target constraint (sparsity ratio of ), the prior LooM model recorded a validation loss of 0.0272. In contrast, S-LooM achieved a validation loss of 0.0114 under the exact same conditions. This reduction in reconstruction error validates the combination of architectural upgrades. The artifact-free nearest-neighbor upsampling provides the Hebbian teacher with clean spatial signals, while the integration of localized cross-correlation and learnable spatial kernels provides more expressivity than the prior architecture's rigid scalar message passing. As visually confirmed in Fig. 2, this spatial approach successfully yields high-fidelity reconstructions while maintaining a strictly governed topological latent space.
Originals

S-LooM
Fig. 2: Qualitative evaluation of S-LooM reconstructions. The model yields high quality reconstructions while maintaining a strictly governed topological latent space.
B. Stability Across Graph Densities and Feature Entanglement
The target sparsity ratio determines the density of the topology dictated by the Hebbian teacher. Table I displays the validation losses obtained across a range of sparsity ratios.
TABLE I: COMPARISON OF TARGET SPARSITY ON VALIDATION LOSS
| Sparsity Ratio (p) | Prior LooM Loss | S-LooM Loss |
|---|---|---|
| 0.05 | 0.0272 | 0.0114 |
| 0.10 | 0.0283 | 0.0103 |
| 0.20 | 0.0305 | 0.0104 |
| 0.30 | 0.0322 | 0.0107 |
| 0.40 | 0.0340 | 0.0097 |
| 0.50 | 0.0361 | 0.0106 |
A notable limitation of the foundational architecture was its fragility to scaling; as the graph became denser ( ), the inclusion of statistically weaker connections introduced direct structural noise, steadily degrading reconstruction performance. S-LooM, however, maintains a highly stable validation loss ( ) across all densities.
However, qualitative analysis reveals that while the loss remains mathematically stable at high densities (p = 0.50), the latent space suffers from severe feature entanglement. In dense configurations, the network is forced into a tangled state where ablating a single node causes widespread, image-wide color and shape distortions. Conversely, at high sparsity (p = 0.05), the network exhibits functional modularity. As demonstrated in Fig. 3, comparing the converged learnable spatial graph ( ) to the localized Hebbian teacher ( ) reveals a strong, highly sparse topological alignment. This alignment yields interpretable feature relationships without sacrificing the quantitative reconstruction performance.

Fig. 3: Matrix visualization comparing the converged learnable spatial graph and the localized Hebbian teacher graph with target sparsity , demonstrating strong topological alignment.
C. Functional Specialization and Community Emergence
A primary goal of the foundational LooM framework was to organically cluster features into semantically meaningful communities. S-LooM's spatial awareness comes closer to this vision. Applying community detection algorithms to the converged S-LooM spatial graph (p = 0.05) reveals a highly specialized functional division. We continued with the Louvain method over alternatives because it organically discovers communities based on edge weights without requiring a predefined number of clusters, making it a natural fit for analyzing our self-organizing topology.
By systematically silencing all edges associated with specific clusters on the graph structure during inference, we can map the visual responsibility of each community. Fig. 4 illustrates this ablation process on a selected validation sample. While this specific image provides a particularly clear visualization of the network's compartmentalization, the functional roles of these communities remain consistent across the dataset. The network reliably segments into functional groups, such as structural body handlers (Comm 1), boundary/shadow mappers (Comm 2 and 3), and high-frequency texture details (Comm 4).
Crucially, the Hebbian teacher naturally isolates a large portion of the feature nodes (e.g., 17 nodes). Ablating this entire isolated pool yields a nearly imperceptible difference map, demonstrating empirically that the sparse graph successfully identifies and quarantines redundant or uninformative filters.
D. Micro-Level Explainability via Single-Edge Lesioning
Beyond macro-level community structures, the S-LooM architecture provides precise, micro-level explainability. To demonstrate that individual graph edges coordinate localized spatial information rather than acting as redundant global passages, we performed single-edge lesioning.
As shown in Fig. 5, severing the single strongest edge in the network (Node Node 31) does not cause a generalized blur or a complete channel failure across the reconstructed image. Instead, it strictly degrades a highly localized area, the lower-left headlight and bumper contour of the truck. This demonstrates that S-LooM achieves spatial explainability, allowing us to trace specific visual outputs directly to individual connections within the latent graph.
Original (Automobile)
Standard S-LooM Recon

Base Error (Orig vs Recon)
Ablated: Comm 1 (N=6)
Ablated: Comm 2 (N=5)
Ablated: Comm 3 (N=2)
Ablated: Comm 4 (N=2)
Ablated: Isolated Nodes (N=17)
Fig. 4: Community Ablation Analysis. The difference maps isolate the distinct semantic responsibilities of each Louvain-detected community. Note the minimal impact of the isolated nodes, demonstrating the graph's ability to quarantine uninformative filters.
Original
Standard Graph Recon
Severed Edge (10–31)
Explainability Diff Map

Fig. 5: Single-Edge Lesioning. Severing a single graph connection (10 ↔ 31) results in a highly localized disruption (isolated in the difference map), indicating the network's spatial precision.
E. Computational Complexity
We evaluate the computational overhead of S-LooM by comparing it to a standard convolutional autoencoder. During training, calculating pairwise spatial cross-correlations to construct the Hebbian graph adds a computational cost of per batch, where is the number of feature maps and is the spatial size of each feature map. To optimize training time, we vectorize this operation using tensor unfolding and parallelized matrix multiplication, effectively trading increased VRAM utilization for rapid GPU execution.
Crucially, because the Hebbian statistics gathering is disabled post-training, the architectural overhead during deployment is minimal. During inference, S-LooM relies solely on the spatial message passing, which mathematically acts as a masked 2D convolution with a complexity of , where is the spatial kernel size. Because this operation occurs entirely at the highly compressed latent bottleneck (e.g., ), S-LooM maintains an inference speed almost identical to a standard autoencoder.
VII. Conclusion
This study introduced S-LooM, a spatially-aware autoencoder architecture, designed to address the limitations of global averaging, scalar message passing and the tendency of latent graphs to entangle under dense connections. By transitioning to localized spatial cross-correlation and learnable spatial kernels, alongside an artifact-free nearest-neighbor decoding scheme, S-LooM mitigates the artificial structural noise (checkerboard patterns) that generated false statistical correlations in prior implementations. Furthermore, a soft-blending training curriculum mitigates representation shock, preventing sudden shifts in latent distributions from disrupting previously learned weights.
Empirical evaluations on CIFAR-10 demonstrate that these architectural refinements yield reduction in baseline reconstruction error. More importantly, the shift from node-based to edge-based sparsity provides stability at high graph densities. Through systematic community ablation and single-edge lesioning, we validated that the resulting sparse latent graph organically compartmentalizes into distinct, explainable functional modules, successfully isolating structural boundaries, high-frequency textures, and redundant connections. Finally, S-LooM demonstrates that with proper spatial grounding, self-organizing Hebbian architectures can transition from theoretical topologies into robust, interpretable representation learning systems. Because this study focuses on isolating the effects of architectural changes compared to the LooM model, evaluations were constrained to the CIFAR-10 dataset. Future work will benchmark S-LooM against a broader array of graph-based models and scale the architecture for higher-resolution, complex datasets to further validate its capabilities.
REFERENCES
[1] R. Koç, H. M. Özcan, and F. T. Yarman Vural, “LooM: Self-Organizing Graph Autoencoders via Hebbian Learning,” Proceedings of the Sinyal İşleme ve İletişim Uygulamaları (SIU), 2026.
[2] D. O. Hebb, The Organization of Behavior: A Neuropsychological Theory. Wiley, New York, 1949.
[3] T. N. Kipf and M. Welling, “Variational Graph Auto-Encoders,” NIPS Workshop on Bayesian Deep Learning, 2016.
[4] Y. Zhu, W. Xu, J. Zhang, B. Du, and F. Nie, “Deep graph structure learning for robust representations: A survey,” arXiv preprint arXiv:2103.03036, 2021.
[5] T. Miconi, K. Stanley, and J. Lehman, “Differentiable plasticity: training plastic neural networks with backpropagation,” International Conference on Machine Learning (ICML), pp. 3559-3568, 2018.
[6] J. J. Hopfield, “Neural networks and physical systems with emergent collective computational abilities,” Proceedings of the National Academy of Sciences of the United States of America, vol. 79, no. 8, pp. 2554–2558, 1982.
[7] A. Odena, V. Dumoulin, and C. Olah, “Deconvolution and Checkerboard Artifacts,” Distill, 2016.