Community Membership Hiding via Gradient-based Optimization

Matteo Silvestri, Edoardo Gabrielli, Fabrizio Silvestri, Gabriele Tolomei · OpenReview

Abstract

We tackle the problem of community membership hiding (CMH), which involves strategically altering a network's structure to obscure a target node's membership in a specific community identified by a detection algorithm. We reformulate the original discrete counterfactual graph objective as a differentiable constrained optimization task. To solve this, we propose $\nabla$-CMH, a gradient-based method that modifies the network's structure within the feasible bounds for an individual target node, effectively concealing its membership. Experimental results across multiple datasets and community detection algorithms show that our approach surpasses existing baselines, offering a better balance between accuracy and computational efficiency.

Introduction

Community detection algorithms are widely used to uncover functional groups in social and biological networks. However, these tools pose privacy risks by potentially revealing sensitive user attributes—such as political affiliation or health status—based solely on network connectivity. The Community Membership Hiding (CMH) problem seeks to mitigate this by minimally "rewiring" a target node's local neighborhood so that detection algorithms no longer associate it with its original sensitive group.

Methodology: The $\nabla$-CMH Framework

The primary challenge in CMH is the discrete nature of graph modifications (adding or deleting edges). Previous approaches using Deep Reinforcement Learning (DRL) are computationally intensive and often fail to find optimal solutions within strict modification budgets.

$\nabla$-CMH introduces a continuous relaxation of the problem. By representing edge perturbations as real-valued vectors, the task is transformed into a differentiable constrained optimization problem.

Strategic rewiring of node $u$'s neighborhood. Orange lines indicate deleted edges, while green dashed lines represent added edges to obscure community membership.

Key innovations include:

  • Promising Actions Heuristic: Since community detection is often a "black box," $\nabla$-CMH uses structural properties (e.g., degree and betweenness centrality) to prioritize disconnecting from influential community members and connecting to influential outsiders.
  • Iterative Refinement: The algorithm dynamically updates the community structure and stops as soon as the hiding objective is met, ensuring minimal disruption to the graph.
  • $\nabla$-CMH-P (Projected): A variant designed for transferability, ensuring the full budget is utilized to provide robust protection against multiple detection algorithms.

Experimental Results

The authors evaluated $\nabla$-CMH on six diverse datasets, including social networks (kar, fb-75), citation networks (arxiv), and infrastructure graphs (pow). Performance was measured using the F1 score, balancing hiding success with the preservation of the overall graph structure (Normalized Mutual Information).

Performance comparison (F1 score) of $\nabla$-CMH variants against state-of-the-art baselines across six real-world datasets.

As shown in the experimental results, $\nabla$-CMH and its projected variant consistently outperform baselines like DICE and DRL-Agent. Notably, $\nabla$-CMH achieved a 5x speedup over DRL-based methods on the fb-75 dataset while using significantly less of the allowed modification budget.

Discussion and Key Insights

  • Stealthiness: Unlike heuristic methods that target high-degree "hubs," $\nabla$-CMH tends to modify connections with low-importance nodes (low PageRank). This makes the privacy-preserving changes less detectable and less disruptive to the network's core structure.
  • Efficiency: Gradient-based optimization allows for a more precise search of the perturbation space compared to the exploration-heavy nature of RL.
  • Transferability: Modifications optimized against one algorithm (e.g., Louvain) frequently succeeded in hiding the node from others (e.g., Leiden), particularly when using the $\nabla$-CMH-P variant.

Conclusion

$\nabla$-CMH provides a robust and efficient framework for protecting individual privacy in networked data. By framing community hiding as a differentiable optimization task, the method achieves superior performance with minimal structural impact. Future work will focus on scaling these techniques to massive graphs and exploring multi-node hiding strategies.

Summary updated

BibTeX
@misc{silvestri2025community,
  author = {Matteo Silvestri and Edoardo Gabrielli and Fabrizio Silvestri and Gabriele Tolomei},
  title = {{Community Membership Hiding via Gradient-based Optimization}},
  year = {2025},
  eprint = {2502.00432},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2502.00432},
}
Figure