Abstract
Protecting privacy in social graphs may require obscuring nodes' membership in sensitive communities. However, doing so without significantly disrupting the underlying graph topology remains a key challenge. In this work, we address the community membership hiding problem, which involves strategically modifying the graph structure to conceal a target node's affiliation with a community, regardless of the detection algorithm used. We reformulate the original discrete, counterfactual graph search objective as a differentiable constrained optimisation task. To this end, we introduce $\nabla$-CMH, a new gradient-based method that operates within a feasible modification budget to minimise structural changes while effectively hiding a node's community membership. Extensive experiments on multiple datasets and community detection methods demonstrate that our technique outperforms existing baselines, achieving the best balance between node hiding effectiveness and graph rewiring cost, while preserving computational efficiency.
Introduction
Community detection algorithms are powerful tools for uncovering latent structures in complex networks, often used for targeted advertising or recommendation systems. However, these algorithms pose significant privacy risks, as they can inadvertently reveal sensitive user attributes such as political leanings or religious affiliations. While a user could leave a platform to protect their privacy, a more nuanced approach is Community Membership Hiding (CMH). CMH involves strategically adding or removing a minimal number of edges so that detection algorithms no longer associate a target node with a sensitive community.
The primary challenge in CMH is the discrete nature of graph structures. Previous approaches have relied on computationally expensive Deep Reinforcement Learning (DRL) or rigid heuristics that often require unrealistic actions, such as severing ties with highly central nodes. This work introduces $\nabla$-CMH, which reframes the discrete CMH task as a differentiable, constrained optimization problem.
Methodology: $\nabla$-CMH
$\nabla$-CMH relaxes the discrete graph-rewiring problem into a differentiable one through three key innovations:
- Continuous Relaxation: To enable backpropagation through binary edge states, we introduce a real-valued perturbation vector. A
tanhtransformation constrains these values between -1 and 1, which are then thresholded to map to discrete actions: remove an edge (-1), do nothing (0), or add an edge (+1). - Differentiable Loss Function: The optimization is guided by a two-part loss function. The hide loss pushes the node away from its current community by encouraging actions like disconnecting from internal hubs. The distance loss penalizes large structural changes to ensure the graph's overall topology remains intact.
- Dynamic Recalibration: Unlike static methods, $\nabla$-CMH dynamically recalculates community structures. If the hiding goal is met early, the optimizer stops, conserving the modification budget and minimizing graph disruption.
Experimental Evaluation
We evaluated $\nabla$-CMH on six real-world datasets: social interactions (kar, vote, fb-75), information networks (words, arxiv), and infrastructure (pow). Performance was tested against four standard community detection algorithms: greedy, leiden, walktrap, and dgcluster.
Key Results
Our experiments demonstrate that $\nabla$-CMH consistently achieves superior hiding performance. In symmetric evaluation settings, it outperformed all six baselines in terms of F1 score, which balances hiding success with graph structure preservation.
Key findings include:
- Efficiency: $\nabla$-CMH is significantly faster than DRL-based agents, with speedups ranging from 1.75x to nearly 5x on the
fb-75dataset. - Budget Conservation: On
fb-75, $\nabla$-CMH achieved its goals using only 11.3% of the allocated budget, whereas baselines typically exhausted the full 100%. - Practicality: Unlike heuristics that target high-degree nodes (the "VIP" trap), $\nabla$-CMH selects less prominent edges for modification, making the suggested changes more realistic for actual users.
- Transferability: While gradient-based methods can overfit, the $\nabla$-CMH-P variant, which utilizes the full budget, acts as a regularizer and improves transferability to unseen detection algorithms.
Conclusion
$\nabla$-CMH provides an efficient and effective solution for masking community membership with minimal graph disruption. By reframing the problem as a differentiable optimization task, it achieves higher success rates and better preserves topology than existing methods. Future work will focus on scaling the method to billion-node networks and addressing the simultaneous hiding of multiple nodes across multiple communities.
Summary updated