Evading Community Detection via Counterfactual Neighborhood Search

Andrea Bernini, Fabrizio Silvestri, Gabriele Tolomei · DOI

Abstract

Community detection techniques are useful for social media platforms to discover tightly connected groups of users who share common interests. However, this functionality often comes at the expense of potentially exposing individuals to privacy breaches by inadvertently revealing their tastes or preferences. Therefore, some users may wish to preserve their anonymity and opt out of community detection for various reasons, such as affiliation with political or religious organizations, without leaving the platform. In this study, we address the challenge of community membership hiding, which involves strategically altering the structural properties of a network graph to prevent one or more nodes from being identified by a given community detection algorithm. We tackle this problem by formulating it as a constrained counterfactual graph objective, and we solve it via deep reinforcement learning. Extensive experiments demonstrate that our method outperforms existing baselines, striking the best balance between accuracy and cost.

Introduction

In the era of massive social networks, community detection has become a standard tool for grouping users based on shared behaviors and interests. While these algorithms power recommendation engines and content discovery, they also present a significant privacy risk. By analyzing a user's connections, an algorithm can infer sensitive affiliations—such as political leanings or religious beliefs—even if the user has never explicitly shared that information.

This paper introduces a novel approach to community membership hiding. Unlike previous work that focuses on hiding entire groups, this research empowers individual users to safeguard their privacy by strategically rewiring their local network connections. The goal is to find the minimal set of structural changes (adding or removing specific edges) that causes a "black-box" detection algorithm to no longer associate a target node with its original community.

The authors formulate the problem as a constrained counterfactual graph search. The core question is: "What is the minimal change I can make to my neighborhood such that the algorithm no longer recognizes me as a member of community X?"

Figure 1: Overview of the community membership hiding process. The framework uses a DRL agent to iteratively rewire the neighborhood of a target node (D) until it is successfully 'hidden' from its original community according to a similarity threshold.

The problem is modeled as a Markov Decision Process (MDP) and solved using the Advantage Actor-Critic (A2C) reinforcement learning algorithm.

  • State Representation: A Graph Neural Network (GNN) captures the complex structural properties of the network, serving as the input for the DRL agent.
  • Action Space: The agent can choose to either remove an existing edge to a node inside its community or add a new edge to a node outside its community.
  • Reward Function: The agent is rewarded for successfully "hiding" the node (measured by a similarity threshold $\tau$) while being penalized for making too many changes or distorting the graph’s overall structure (measured by Normalized Mutual Information and Jaccard distance).

Experimental Evaluation

The DRL-Agent was trained on the words dataset and evaluated across five diverse real-world networks: kar (Zachary’s Karate Club), words (adjective/noun adjacency), vote (Wikipedia voting), pow (US power grid), and fb-75 (Facebook social graph).

Key Results and Robustness

The DRL-Agent consistently outperformed baseline heuristics, including Random, Degree-based, and Betweenness-based rewiring. It achieved the highest F1 score (the harmonic mean between success rate and graph similarity), demonstrating an optimal trade-off between privacy and graph utility.

A critical finding is the agent's transferability. An agent trained to evade a specific "Greedy" modularity-based algorithm remained highly effective against other algorithms it had never encountered, such as Louvain or Walktrap. This suggests that the DRL agent learns general structural "weak points" in community detection logic.

Figure 5: Success rates in asymmetric testing scenarios. The DRL-Agent demonstrates superior performance and robustness even when the testing algorithm (Louvain or Walktrap) differs from the training algorithm (Greedy), across various modification budgets (beta).

Conclusion

This work demonstrates that deep reinforcement learning can effectively empower individuals to manage their privacy in social networks. By framing community hiding as a counterfactual search, the DRL-Agent finds efficient, transferable strategies for anonymity. While scalability for massive networks remains a challenge, future work will explore Multi-Agent Reinforcement Learning (MARL) to handle simultaneous hiding attempts by multiple users and incorporate node features to enhance deception strategies.

Summary updated

BibTeX
@inproceedings{bernini2024evading,
  author = {Andrea Bernini and Fabrizio Silvestri and Gabriele Tolomei},
  title = {{Evading Community Detection via Counterfactual Neighborhood Search}},
  booktitle = {ACM SIGKDD Conference on Knowledge Discovery and Data Mining},
  year = {2024},
  doi = {10.1145/3637528.3671896},
}
Figure