Equipping Federated Graph Neural Networks with Structure-aware Group
  Fairness
Graph Neural Networks (GNNs) have been widely used for various types of graph
data processing and analytical tasks in different domains. Training GNNs over
centralized graph data can be infeasible due to privacy concerns and regulatory
restrictions. Thus, federated learning (FL) becomes a trending solution to
address this challenge in a distributed learning paradigm. However, as GNNs may
inherit historical bias from training data and lead to discriminatory
predictions, the bias of local models can be easily propagated to the global
model in distributed settings. This poses a new challenge in mitigating bias in
federated GNNs. To address this challenge, we propose $\text{F}^2$GNN, a Fair
Federated Graph Neural Network, that enhances group fairness of federated GNNs.
As bias can be sourced from both data and learning algorithms, $\text{F}^2$GNN
aims to mitigate both types of bias under federated settings. First, we provide
theoretical insights on the connection between data bias in a training graph
and statistical fairness metrics of the trained GNN models. Based on the
theoretical analysis, we design $\text{F}^2$GNN which contains two key
components: a fairness-aware local model update scheme that enhances group
fairness of the local models on the client side, and a fairness-weighted global
model update scheme that takes both data bias and fairness metrics of local
models into consideration in the aggregation process. We evaluate
$\text{F}^2$GNN empirically versus a number of baseline methods, and
demonstrate that $\text{F}^2$GNN outperforms these baselines in terms of both
fairness and model accuracy.
Nan Cui, Xiuling Wang, Wendy Hui Wang, Violet Chen, Yue Ning
# Equipping Federated Graph Neural Networks with Structure-aware Group Fairness

###### Abstract

Graph Neural Networks (GNNs) have been widely used for various types of graph data processing and analytical tasks in different domains. Training GNNs over centralized graph data can be infeasible due to privacy concerns and regulatory restrictions. Thus, federated learning (FL) becomes a trending solution to address this challenge in a distributed learning paradigm. However, as GNNs may inherit historical bias from training data and lead to discriminatory predictions, the bias of local models can be easily propagated to the global model in distributed settings. This poses a new challenge in mitigating bias in federated GNNs. To address this challenge, we propose \(\mathrm{F}^{2}\mathrm{GNN}\), a Fair Federated Graph Neural Network, that enhances group fairness of federated GNNs. As bias can be sourced from both data and learning algorithms, \(\mathrm{F}^{2}\mathrm{GNN}\) aims to mitigate both types of bias under federated settings. First, we provide theoretical insights on the connection between data bias in a training graph and statistical fairness metrics of the trained GNN models. Based on the theoretical analysis, we design \(\mathrm{F}^{2}\mathrm{GNN}\) which contains two key components: a _fairness-aware local model update scheme_ that enhances group fairness of the local models on the client side, and a _fairness-weighted global model update scheme_ that takes both data bias and fairness metrics of local models into consideration in the aggregation process. We evaluate \(\mathrm{F}^{2}\mathrm{GNN}\) empirically versus a number of baseline methods, and demonstrate that \(\mathrm{F}^{2}\mathrm{GNN}\) outperforms these baselines in terms of both fairness and model accuracy. The code is publicly accessible via the following link: [https://github.com/yuening-lab/F2GNN](https://github.com/yuening-lab/F2GNN).

Graph Neural Networks Federated Learning Group Fairness

## 1 Introduction

Graph neural networks (GNNs) have emerged as a formidable tool for generating meaningful node representations [16, 17, 18] and making accurate predictions on nodes by leveraging graph topologies [17, 18]. GNNs have been studied in many applications such as knowledge graph completion [15], biology [19, 20], and recommender systems [16, 21]. A substantial portion of graph data originates from human society and various aspects of people's lives. Such data inherently contain sensitive information, susceptible to discrimination and prejudice. In many high-stakes domains such as criminal justice [14], healthcare [15], and financial systems [16, 17], ensuring fairness in the results of graph neural networks with respect to certain minority groups of individuals is of profound societal importance. These types of data are frequently distributed across multiple machines. Thus, challenges are present when applying machine learning tasks that could benefit from utilizing global data. To overcome these obstacles, federated learning has emerged as a promising solution. By leveraging a federated learning framework, organizations can collaborate on a task without compromising the confidentiality of their data. This enables the creation of a shared model while maintaining data privacy, allowing for secure and efficient cooperation among different organizations and local clients.

As a result, several works have emerged in the field of federated learning combined with GNNs [15, 16, 17, 18] to address various challenges. He _et al._[15] present an open benchmark system for federated GNNs that facilitates research in this area. Xie _et al._[16] propose a graph clustered federated learning framework that dynamically identifies clusters of local systems based on GNN gradients. Yao _et al._[17] leverage federated learning
to train Graph Convolutional Network (GCN) models for semi-supervised node classification on large graphs, achieving fast convergence and minimal communication. Nonetheless, there is also research indicating that predictions of GNNs (over centralized data) can be unfair and have undesirable discrimination [11, 12]. Under the federated learning setting, the bias in the local GNN models can be easily propagated to the global model. While most of the prior works [1, 13, 14] have primarily focused on debiasing federated learning models trained on non-graph data, none of them have studied federated GNNs. How to enhance the fairness of GNNs under federated settings remains to be largely unexplored.

In general, the bias of GNNs can be stemmed from two different sources: (1) bias in graph data [15, 16], and (2) bias in learning algorithms (e.g., the message-passing procedure of GNNs) [17, 18]. In this paper, we aim to enhance the group fairness of federated GNNs by mitigating both types of bias. In particular, in terms of data bias, we group the nodes by their sensitive attribute (e.g., gender and race). Then we group the links between nodes based on the sensitive attribute values of the connecting nodes: (1) the _intra-group links_ that connect nodes belonging to the same node groups (i.e., the same sensitive attribute value), and (2) the _inter-group links_ that connect nodes that belong to different node groups. Based on the link groups, we consider the data bias that takes the form of the _imbalanced distribution between inter-group and intra-group links_, which is a key factor to the disadvantage of minority groups by GNNs [15]. On the other hand, in terms of model fairness, we consider two well-established group fairness definitions: _statistical parity_ (SP) [19, 20] and _equalized odds_ (EO) [17, 20].

In this paper, we propose F\({}^{2}\)GNN, one of the first federated graph neural networks that enhances group fairness of both local and global GNN models. Our contributions are summarized as follows: 1) We provide theoretical insights on the connection between data bias (imbalanced distributions between inter-group and intra-group links) and model fairness (SP and EO); 2) Based on the theoretical findings, we design F\({}^{2}\)GNN that enhances group fairness of both local and global GNN models by taking both the data bias of local graphs and statistical fairness metrics of local models into consideration during the training of both local and global models; 3) Through experiments on three real-world datasets, we demonstrate that F\({}^{2}\)GNN outperforms the baseline methods in terms of both fairness and model accuracy.

## 2 Related Work

**Group fairness in GNNs.** Existing studies on fair graph learning can be broadly classified into three categories: data augmentations [13, 14, 15], problem optimization with fairness considerations [10, 17], and adversarial debiasing methods [16, 20, 21]. Data augmentations [16, 20] are used to create a balanced graph, followed by contrastive learning to learn fair graph representations. Biased edge dropout [21] is proposed to mitigate the impact of homophily and promote fairness in graph representation learning. Fair Message Passing (FMP) approach [17] uses optimization techniques to transform the message-passing scheme into a bi-level optimization framework. Adversarial debiasing [20] has been studied to mitigate graph bias and takes advantage of a sensitive feature estimator to require less sensitive information. Masrour _et al._[20] propose a post-processing step to generate more heterogeneous links to overcome the filter bubble effect and introduces a framework combining adversarial network representation learning with supervised link prediction. Hussain _et al._[15] inject edges between nodes with different labels and sensitive attributes to perturb the original graphs, followed by an adversarial training framework to debias the perturbed graphs. This work studies inter-group edges between different cases (e.g., different labels and different sensitive groups). However, it does not consider inter/intra-group edges' ratio. Recent studies have utilized mixing techniques for addressing fairness concerns in graph learning. Wang _et al._[20] generate fair views of features and adaptively clamp weights of the encoder to avoid using sensitive-related features. Ling _et al._[14] use data augmentations to create fair graph representations, followed by adversarial debiasing training. However, their theoretical proofs make strong assumptions regarding the loss function being bounded by a fixed constant. All these works are focused on fairness in centralized GNNs, and none of them have considered GNNs under the federated setting.

**Fairness of federated learning.** In contrast to traditional fairness considerations in machine learning, federated learning has a unique fairness concept, performance fairness, at the device level. This is akin to fair resource allocation [1, 2] in wireless networks, which extends the notion of accuracy parity by evaluating the degree of uniformity in device performance. Li _et al._[14] give a solution to address fairness concerns in federated learning through an optimization objective that minimizes an aggregated reweighted loss, where devices with higher losses are assigned proportionally higher weights. Further, Bi-level optimization schemes [13, 14] aim to reduce the variance of test accuracy across devices, thereby increasing federated-specific fairness. In addition to the traditional fairness performance, there is a growing body of research in fair-federated learning [20, 15] that focuses on the general fairness definition, such as Ezzeldin _et al._[14] create a server-side aggregation step to weight local models performing well on fairness measures higher than others, and Du _et al._[14] use kernel reweighing functions to assign reweighing values to each training sample in both the loss function and fairness constraint.
Qi _et al._ [QWW\({}^{+}\)22] present a fair vertical federated learning framework that assembles multiple techniques. They first learn representations from fair-insensitive data stored in some platforms and then send the learned representations to other platforms holding sensitive information. Subsequently, the authors conduct adversarial training with sensitive information to debias the representations. Unlike these works that consider learning models trained over non-graph data, we focus on GNNs and aim to enhance group fairness.

## 3 Federated Graph Learning

**Notations.** Given an undirected graph \(\mathcal{G}=(\mathcal{V},\mathcal{E},\mathbf{X})\) that consists of a set of nodes \(\mathcal{V}\), edges \(\mathcal{E}\), and the node features \(\mathbf{X}\), let \(\mathbf{A}\) be the adjacency matrix of \(\mathcal{G}\). We use \(\mathbf{Z}\) to denote the node representations (embedding) learned by a GNN model. In this paper, we consider node classification as the learning task. We use \(y\) and \(\hat{y}\) to denote the ground truth and the predicted labels respectively.

**Federated Graph Learning.** In this paper, we consider _horizontal federated learning_ (HFL) setting [DSS\({}^{+}\)22,PZS\({}^{+}\)22] with \(K\) clients \(\{C_{1},\ldots,C_{K}\}\) and a server \(\mathcal{S}\). Each client \(C_{i}\) owns its private graph \(\mathcal{G}_{i}\). Different \(\mathcal{G}_{i}\) can have different \(\mathcal{V}_{i}\) and \(\mathbf{A}_{i}\). All clients share the same set of node features.

In the HFL setting, clients do not share their local graphs with the server \(\mathcal{S}\) due to various reasons (e.g., privacy protection). Thus the goal of HFL is to optimize the overall objective function while keeping private graphs locally

\[\arg\min_{\omega}\sum_{i=1}^{K}\mathcal{L}_{i}(\omega)=\arg\min_{\omega}\sum_{ i=1}^{K}\sum_{j=1}^{N_{i}}\boldsymbol{\ell}_{i}(v_{j},\mathcal{G}_{i}; \omega),\]

where \(\mathcal{L}_{i}(\omega)\) denotes the loss function parameterized by \(\omega\) on client \(C_{i}\), \(N_{i}\) is the number of nodes in the local graph \(\mathcal{G}_{i}\), and \(\boldsymbol{\ell}_{i}(v_{j},\mathcal{G}_{i};\omega)\) denotes the average loss over the local graph on client \(C_{i}\).

In this paper, we adapt the SOTA FedAvg framework [MMR\({}^{+}\)17] to our setting. In FedAvg, only model parameters are transmitted between \(\mathcal{S}\) and each client \(C_{i}\). Specifically, during each round \(t\), \(\mathcal{S}\) selects a subset of clients and sends them a copy of the current global model parameters \(\omega_{t}\) for local training. Each selected client \(C_{i}\) updates the received copy \(\omega_{t}^{i}\) by an optimizer such as stochastic gradient descent (SGD) for a variable number of iterations locally on its own data and obtains \(\omega_{t}^{i}\). Then \(\mathcal{S}\) collects the updated model parameters \(\omega_{t}^{i}\) from the selected clients and aggregates them to obtain a new global model \(\omega_{t+1}\). Finally, the server broadcasts the updated global model \(\omega_{t+1}\) to clients for training in round \(t+1\). The training process terminates when it reaches convergence.

## 4 Group Fairness and Data Bias

In this paper, we mainly focus on group fairness. In general, group fairness requires that the model output should not have discriminatory effects towards _protected groups_ (e.g., female) compared with _un-protected groups_ (e.g., male), where protected and un-protected groups are defined by a sensitive attribute (e.g., gender) [BHN19].

**Node groups.** We adapt the conventional group fairness definition to our setting. We assume each node in the graph is associated with a _sensitive attribute_\(s\) (e.g., gender, race) [MMS\({}^{+}\)22]. The nodes are partitioned into distinct subgroups by their values of the sensitive attribute. For simplicity, we consider a binary sensitive attribute in this paper. In the following discussions, we use \(s=0\) and \(s=1\) to indicate the protected and un-protected node groups respectively.

**Inter-group and intra-group edges.** Based on the definition of the protected node groups, we further partition edges in a graph into two groups: (1) _inter-group edges_ that consist of the edges connecting the nodes that belong to different groups (e.g., the edges between female and male nodes); and (2) _intra-group edges_ indicate the edges connecting nodes in the same group (e.g., the edges between female and female nodes).

**Data bias in edge distribution.** Recent studies have shown that one potential data bias in graphs that can lead to unfairness of GNNs is the imbalanced distribution between the inter-group edges and the intra-group ones in training graphs [HCS\({}^{+}\)22a, MWY\({}^{+}\)20a, SSHU21]. Therefore, in this paper, we focus on one particular type of data bias which takes the form of the imbalance between the distribution of inter-group and intra-group edges. In particular, we define _group balance score_ (GBS) to measure this type of bias in edge distribution as follows.

**Definition 1**.: _Given a graph \(\mathcal{G}\), let \(|\mathcal{E}_{\text{inter}}|\) and \(|\mathcal{E}_{\text{intra}}|\) be the number of inter-group edges and intra-group edges in \(\mathcal{G}\) respectively. \(|\mathcal{E}|=|\mathcal{E}_{\text{intra}}|+|\mathcal{E}_{\text{inter}}|\) denotes the total number of edges. Group balance score (GBS) (denoted as \(B\)) is defined as follows:_

\[B=1-(|H_{\text{intra}}|-|H_{\text{inter}}|),\]

_where \(H_{\text{intra}}=\frac{|\mathcal{E}_{\text{intra}}|}{|\mathcal{E}|}\) and \(H_{\text{inter}}=\frac{|\mathcal{E}_{\text{intra}}|}{|\mathcal{E}|}\)._
Intuitively, a higher \(B\) value indicates a better balance between the inter-group edges and intra-group ones. \(B\) reaches its maximum (i.e., \(B=1\)) when the graph is perfectly balanced between the two edge groups (i.e., \(|H_{\text{intra}}|=|H_{\text{inter}}|\)).

**Group fairness of models.** To measure the group fairness of the target GNN model, we employ two well-established fairness definitions: _statistical parity_ (SP) [1, 10, 11] and _equalized odds_ (EO) [13, 12, 11]. In this paper, we adapt both fairness notations to the node classification task. Formally,

**Definition 2** (Statistical Parity).: _Statistical parity measures the difference in probabilities of a positive outcome of node groups, which is computed as the follows:_

\[\Delta_{\text{SP}}=|P(\hat{y}=1|s=0)-P(\hat{y}=1|s=1)|.\]

**Definition 3** (Equalized Odds).: _Equalized odds measures the difference between the predicted true positive rates of node groups, which is computed as the follows:_

\[\Delta_{\text{EO}}=|P(\hat{y}=1|y=1,s=0)-P(\hat{y}=1|y=1,s=1)|.\]

Intuitively, \(\Delta_{\text{SP}}\) measures the difference between the positive rates of two different node groups, while \(\Delta_{\text{EO}}\) measures the difference between the true positive rates for these two groups. Both measurements of SP and EO are equally important and complementary in terms of fairness in node classification. We are aware of the existence of other accuracy measurements (e.g., false positive rate). These accuracy measurements will be left for future work.

In this paper, we consider both _local fairness_ and _global fairness_, i.e. the outputs of both local and global models should be fair in terms of statistical parity and equalized odds. As shown in the prior study [11], although local fairness and global fairness do not imply each other, global fairness is theoretically upper-bounded by local fairness for both SP and EO metrics when data follows the IID distribution. Our empirical studies (Section 7) will show that F\({}^{2}\)GNNcan achieve both local fairness and global fairness for non-IID distribution.

## 5 Connection between Data Bias and Model Fairness

Data bias has been shown as an important source of model unfairness. In this section, we investigate how the imbalanced distribution between the intra-group and inter-group links impacts the model fairness (in terms of SP and EO).

Directly examining how data bias can impact SP and EO is challenging. Therefore, we take an alternative approach that deals with model fairness from the lens of graph representations. Intuitively, group fairness requires that the model outputs should not be distinguishable based on sensitive attributes. As GNNs rely on graph representations to generate the model outputs for the downstream tasks, group fairness can be achieved when the graph representations are invariant to the sensitive attributes [11]. Informally, this requires independence between the graph representation and the sensitive attribute. How can the imbalanced distribution between the intra-group and inter-group links impact the correlation between the graph representation and the sensitive attribute? Next, we present our main theoretical analysis of the impact study.

In this paper, we utilize the _Point-Biserial Correlation_[1], a special case of the Pearson correlation, to measure the correlation between the graph representation and the sensitive attribute. We do not consider other correlation metrics such as the Pearson correlation because the Point-Biserial Correlation accepts dichotomous variables as input.

**Definition 4** (Point-Biserial Correlation Coefficient).: _The point-biserial correlation coefficient is a statistical measure that quantifies the degree of association between a continuous-level variable and a dichotomous variable. In particular, given a dichotomous variable \(s\) (\(s\in\{0,1\}\)), and a continuous variable \(X\), the point-biserial correlation coefficient \(\rho_{X,s}\) between \(X\) and \(s\) is defined as:_

\[\rho_{X,s}=\frac{\mu_{0}-\mu_{1}}{\sigma_{X}}\sqrt{\frac{N_{0}N_{1}}{N^{2}}},\]

_where \(\mu_{0}\) (\(\mu_{1}\)) is the mean value of \(X\) that are associated with \(s=0\) (\(s=1\)), \(N_{0}\) (\(N_{1}\)) is the number of samples in the class \(s=0\) (\(s=1\)), \(N=N_{0}+N_{1}\), and \(\sigma_{X}\) is the standard deviation of \(X\)._

The conventional definition of the point-biserial correlation involves a 1-dimensional variable, \(X\). In line with the existing work [11], we extend this concept to incorporate higher-dimensional data, using a node feature matrix \(\mathbf{X}\). The node feature matrix is denoted as \(\mathbf{X}\in\mathbb{R}^{N\times d}\), where \(N\) represents the number of nodes and \(d\) denotes the feature dimension. In our work, we define the \(\mu_{0}\) (\(\mu_{1}\)) stated in the above definition as the mean of \(j\)-th dimension of node feature of the nodes possessing a sensitive attribute \(s=0\) (\(s=1\)), where \(j\in\{1,...,d\}\). The formal notions of \(\mu_{0}\) and \(\mu_{1}\) can be expressed as \(\mu_{j}^{s=0}\) and \(\mu_{j}^{s=1}\), the details of the calculation of \(\mu_{0}\) and \(\mu_{1}\) can be found Appendix A.1. For convenience, we will use \(\mu_{0}\) (\(\mu_{1}\)) and \(\mu_{j}^{s=0}\) (\(\mu_{j}^{s=1}\)) interchangeably. After computing the means \(\mu_{0}\) and \(\mu_{1}\) for a specific column \(j\), we can calculate the point-biserial correlation following the conventional definition.
Given a graph \(\mathcal{G}\), let \(s\) be the sensitive attribute of \(\mathcal{G}\) and \(\mathbf{Z}\) be the representation (node embeddings) of \(\mathcal{G}\). Next, we will present the theoretical analysis of the relationship between the data bias (group balance score) and the correlation \(\rho_{\mathbf{Z},s}\) between \(s\) and \(\mathbf{Z}\). Our theoretical analysis relies on two assumptions regarding the model and the data distribution respectively:

* **Model assumption**: We assume the GNN model contains a linear activation function [1, 1]. We note that although our theoretical analysis relies on the assumption of linear activation function, our algorithmic techniques are generic and can be applied to various GNN models, including those with non-linear activation functions.
* **Data assumption**: Let \(\mathbf{X}_{j}^{s=0}\) (\(\mathbf{X}_{j}^{s=1}\)) be the \(j\)-th feature of those data samples associated with the sensitive attribute \(s=0\) (\(s=1\)). By following the prior works [1, 2], we assume the data values of \(\mathbf{X}_{j}^{s}\) follows a Gaussian distribution \(\mathcal{N}(\mu_{j}^{s},\sigma_{j}^{s})\), where \(\mu_{j}^{s}\) and \(\sigma_{j}^{s}\) are the mean and variance of \(\mathbf{X}_{j}^{s}\).

Based on the assumptions, we derive the following lemma:

**Lemma 5**.: _Given a graph \(\mathcal{G}\) and a GNN model that satisfies the data and model assumptions respectively, the Point-biserial correlation (denoted as \(\rho_{\mathbf{Z},s}\)) between the graph representation \(\mathbf{Z}\) and the sensitive attribute \(s\) is measured as the following:_

\[\rho_{\mathbf{Z},s}=(N_{0}\mu_{0}-N_{1}\mu_{1})(H_{\text{intra}}-H_{\text{ inter}})\cdot\frac{\sqrt{N_{0}\,N_{1}}}{\sigma_{\mathbf{Z}}N^{2}},\]

_where \(H_{\text{intra}}\) and \(H_{\text{inter}}\) are defined by Definition 1, \(N_{0}\)\((N_{1})\) is the number of nodes associated with \(s=0\)\((s=1)\), \(\sigma_{\mathbf{Z}}\) is the standard deviation of \(\mathbf{Z}\), \(N\) is the total number of nodes of \(\mathcal{G}\), and \(\mu_{0}\) (\(\mu_{1}\)) is the mean value of nodes that are associated with \(s=0\) (\(s=1\))._

The proof of Lemma 5 can be found in Appendix A.2. Intuitively, when \(\rho_{\mathbf{Z},s}=0\) (i.e., the graph representation is independent of the sensitive attribute), either \(N_{0}\mu_{0}=N_{1}\mu_{1}\) or \(H_{\text{intra}}=H_{\text{inter}}\). Remark that both \(N_{0}\) and \(N_{1}\) are fixed values for a given graph. Therefore, we derive the following important theorem:

**Theorem 6**.: _Let \(\mathcal{G}\) be a graph that satisfies the given data assumption, and \(\mathbf{Z}\) be the representation of \(\mathcal{G}\) learned by a GNN model that satisfies the given model assumption. Then the Point-biserial correlation \(\rho_{\mathbf{Z},s}\) between the graph representation \(\mathbf{Z}\) and the sensitive attribute \(s\) is positively correlated/monotonically increasing with \(|H_{\text{intra}}-H_{\text{inter}}|\). In particular, \(\rho_{\mathbf{Z},s}=0\) when \(H_{\text{intra}}=H_{\text{inter}}\)._

The details of the proof for Theorem 6 can be found in Appendix A.3. As Theorem 6 suggests, the imbalanced distribution between inter-group and intra-group links is one of the key factors to the correlation between the graph representation and the sensitive attribute. As the model predictions largely rely on the graph representations, the unfairness in the model predictions can be largely reduced if the graph representation is independent of the sensitive attribute. Therefore, a graph with a more (less, resp.) balanced distribution between inter-group and intra-group links should lead to a more (less, resp.) fair model. We will follow this insight and design F\({}^{2}\)GNN.

## 6 The Proposed Method: F\({}^{2}\)Gnn

In a nutshell, F\({}^{2}\)GNN follows the same principles as FedAvg [1]: in each round \(t\), the server \(\mathcal{S}\) uniformly samples a set of clients. Each selected client \(C_{i}\) receives a copy of the current global parameters \(\omega_{t}\), and obtains its local model update \(\omega_{t}^{i}\) by learning over its local graph \(\mathcal{G}_{i}\) with \(\omega_{t}\) as the initialized model parameters. Then each client \(C_{i}\) sends \(\omega_{t}^{i}\) back to \(\mathcal{S}\). \(\mathcal{S}\) aggregates all the received local model updates on \(\omega_{t}\) and obtain \(\omega_{t+1}\). To equip both local fairness and global fairness with the federated learning framework, F\({}^{2}\)GNN comprises two main components:

* _Client-side fairness-aware local model update scheme_: each client \(C_{i}\) obtains \(\omega_{t}^{i}\) by adding local fairness as a penalty term to the loss function of its local model.
* _Server-side fairness-weighted global model update scheme_: When \(\mathcal{S}\) aggregates all local model updates from the clients, it takes both the fairness metrics of local models (e.g., SP or EO) and data bias of local graphs as aggregation weights.

Figure 1 illustrates the framework of F\({}^{2}\)GNN, and detailed steps of our algorithm are summarized in Algorithm 1. Next, we present the details of each component.
### Client-side Fairness-aware Local Model Update

Intuitively, the design of the local model update scheme should serve two objectives: 1) it ensures the convergence of not only the local models on the client side but also the global model on the server side, especially when the data across different clients is non-iid, and 2) it equips fairness (both SP and EO) with the local models by seamlessly incorporating the fairness constraint into the training process of local model updates. To achieve these objectives, we utilize two key techniques: (i) model interpolation by leveraging the Jensen-Shannon (JS) divergence [14], and (ii) adding fairness as a penalty term to the loss function of the local models. Next, we discuss the details of each technique.

**JS divergence between global and local models.** One challenge of GNN training under federated setting is that the local data on each client may not be IID [13, 12]. The difference in data distribution can lead to a contradiction between minimizing local empirical loss and reducing global empirical loss and thus prevent the global model to reach convergence. To tackle the non-IID challenge, inspired by Zheng _et al._[13], F\({}^{2}\)GNN measures the difference between the local and the global model, and takes such difference into consideration when updating local model parameters.

Specifically, let \(\omega_{t}\) and \(\omega^{i}_{t-1}\) be the global model parameters at epoch \(t\) and the local model parameters maintained by the client \(C_{i}\) at epoch \(t-1\), respectively. Let \(D_{\hat{\mathbf{Y}}_{\text{global}}}\) and \(D_{\hat{\mathbf{Y}}_{\text{local}}}\) be the distribution of the node labels in client \(C_{i}\)'s local graph predicted by the global model (with \(\omega_{t}\) as parameters) and local model (with \(\omega^{i}_{t-1}\) as parameters). Upon receiving \(\omega_{t}\), the client \(C_{i}\) calculates the Jensen-Shannon (JS) divergence (denoted as \(\text{js}^{i}_{t}\)) between \(D_{\hat{\mathbf{Y}}_{\text{global}}}\) and \(D_{\hat{\mathbf{Y}}_{\text{local}}}\) as follows:

\[\text{js}^{i}_{t}=\text{JS}(D_{\hat{\mathbf{Y}}_{\text{global}}}||D_{\hat{ \mathbf{Y}}_{\text{local}}}).\]

Intuitively, a higher \(\text{js}^{i}_{t}\) value indicates a greater difference between the global model and the local one. Next, the client \(C_{i}\) computes the initialized value of its local model update \(\omega^{i}_{t}\) (denoted as \(\hat{\omega}^{i}_{t}\)) as follows:

\[\hat{\omega}^{i}_{t}\leftarrow(1-\text{js}^{i}_{t})\cdot\omega^{i}_{t-1}+ \text{js}^{i}_{t}\cdot\omega_{t}. \tag{1}\]

Following Eqn. (1), when the global model largely varies from the local model, the global model \(\omega_{t}\) is considered more important than the local model \(\omega^{i}_{t}\). Consequently, \(\omega^{i}_{t}\) will be closer to \(\omega_{t}\). This will expedite the global model to move towards the global stationary point and reach convergence.

**Fairness penalty term.** To equip fairness with the local models, we focus on a widely-used in-process approach, where fairness criteria are introduced during the training process, typically by adding a fairness constraint or penalty to the formulation of their objective function [13, 12]. Therefore, we do not include sensitive features as inputs to the GNNs but instead use them during training as part of a penalty on disparity. Formally, we define the fairness penalty term of the client \(C_{i}\) at epoch \(t\) (denoted as \(\mathbf{\ell}^{i}_{\text{fair}_{t}}\)) as the sum of two types the norm-1 of group fairness (SP and EO) measured over \(C_{i}\)'s local graph \(\mathcal{G}_{i}\):

\[\mathbf{\ell}^{i}_{\text{fair}_{t}}=||\Delta^{i}_{\text{SP}_{t}}||_{1}+||\Delta^{ i}_{\text{EO}_{t}}||_{1}.\]

Figure 1: An overview of F\({}^{2}\)GNN. In each iteration, client \(C_{i}\) receives the global model, calculates the Jensen-Shannon (JS) divergence \(\text{js}^{i}_{t}\), and updates the local model \(\hat{\omega}^{i}_{t}\). Local data is processed through a 2-layer GCNs, and the model is trained over several epochs. The updated model \(\omega^{i}_{t}\) and the group balance score \(B_{i}\) are uploaded to the server. The server then computes the data-bias and model-fairness weights, integrates them, and uses the combined weight to aggregate the local models and update the global model \(\omega_{t}\).
Then, the fairness penalty term is added to the loss function of the local model as follows:

\[\mathbf{\ell}(\omega_{t}^{i};\mathbf{Z}_{i})=\mathbf{\ell}_{\text{util}_{t}}^{i}+\alpha \,\mathbf{\ell}_{\text{fair}_{t}}^{i}, \tag{2}\]

where \(\mathbf{\ell}_{\text{util}_{t}}^{i}\) denotes the utility loss (e.g., entropy loss for node classification), and \(\alpha\) is a tunable hyper-parameter.

**Local model parameter updates.** Finally, the client \(C_{i}\) obtains the final local model update \(\omega_{t}^{i}\) by executing multiple SGD steps:

\[\omega_{t}^{i}\leftarrow\hat{\omega}_{t}^{i}-\eta\cdot\nabla\mathbf{\ell}(\omega_ {t}^{i};\mathbf{Z}_{i}),\]

where \(\hat{\omega}_{t}^{i}\) is the initialized local model update (Eqn. (1)), \(\eta\) is the learning rate, and \(\nabla\mathbf{\ell}(\omega_{t}^{i};\mathbf{Z}_{i})\) denotes the gradient of the loss function (Eqn. (2)).

After completing local training, the client \(C_{i}\) uploads its local model parameters \(\omega_{t}^{i}\), the local fairness loss \(\mathbf{\ell}_{\text{fair}_{t}}^{i}\), and a group balance score \(B^{i}\) to the server \(\mathcal{S}\). We remark that sharing aggregated information of the local graphs such as \(\mathbf{\ell}_{\text{fair}_{t}}^{i}\) and \(B^{i}\) with the server will make attacking individual information harder and thus protect their privacy.

### Server-side Fairness-weighted Global Model Update

The server-side model update scheme in each iteration consists of four steps:

* _Step 1._ Calculate the _data-bias weight_\(\gamma_{\mathbf{\mathcal{E}}_{t}}\) based on the group balance scores provided by each client;
* _Step 2._ Derive the _model-fairness weight_\(\gamma_{\mathbf{\mathcal{F}}_{t}}\) using the fairness loss metrics uploaded by the clients, ensuring fairness metrics are integrated into the global model aggregation process;
* _Step 3._ Combine the data-bias weight and model-fairness weight into a combined weight (\(\gamma_{t}\)); and
* _Step 4._ Aggregate the local model updates with the global model utilizing the combined weight.

The following elaboration provides a detailed description of each step.

**Data-bias weight.** Upon obtaining local parameters from the selected subset of clients at epoch \(t-1\), the server first constructs a data-bias weight \(\gamma_{\mathbf{\mathcal{E}}_{t}}\in\mathbb{R}^{K^{\prime}}\), where \(K^{\prime}\) represents the number of clients in the subset:

\[\gamma_{\mathbf{\mathcal{E}}_{t}}=\operatorname{softmax}\big{(}B^{1},...,B^{K^{ \prime}}\big{)}.\]

Each element in \(\gamma_{\mathbf{\mathcal{E}}_{t}}\) corresponds to the group balance score \(B^{i}\) for each client \(C_{i}\). Given that each client \(C_{i}\) maintains a graph \(\mathcal{G}_{i}\), the data-bias weight \(\gamma_{\mathbf{\mathcal{E}}_{t}}\) effectively gauges the equilibrium between inter- and intra-edges within each client graph.

**Model-fairness weight.** While the group balance score provides a useful measure of the balance between inter- and intra-edges within each client graph, it is static and unable to capture the model's evolving learning process regarding fairness. To address this, we also consider a dynamic _fairness metric weight_\(\gamma_{\mathcal{F}}\in\mathbb{R}^{K^{\prime}}\) that evaluates the statistical parity \(\Delta_{\text{SP}_{t}}^{i}\) and equalized odds \(\Delta_{\text{E}\text{O}t}^{i}\) of each client's local model at each iteration:

\[\gamma_{\mathcal{F}_{t}}=\exp\big{(}\operatorname{softmax}(\gamma_{\mathcal{F} _{t}}^{\prime})\big{)}.\]

To calculate \(\gamma_{\mathcal{F}_{t}}\), we start by a weight vector \(\gamma_{\mathcal{F}_{t}}^{\prime}\), which takes each client's sum of two types of group fairness metrics as the element. Therefore, \(\gamma_{\mathcal{F}_{t}}^{\prime}\) can be illustrated as:

\[\gamma_{\mathcal{F}_{t}}^{\prime}=\big{[}\Delta_{\text{SP}_{t}}^{1}+\Delta_{ \text{E}\text{O}_{t}}^{1},...,\Delta_{\text{SP}_{t}}^{K^{\prime}}+\Delta_{ \text{E}\text{O}_{t}}^{K^{\prime}}\big{]}.\]

To magnify the effect of this dynamic model-fairness weight \(\gamma_{\mathcal{F}_{t}}^{\prime}\), we use an exponential function to rescale it after passing through a softmax function. This expands its range while maintaining its relative proportions as exponential functions grow faster than linear ones.

We employ the softmax function to standardize the two weight vectors, making them comparable. Given the distinct properties of the group balance score \(B\), which is bounded within the interval \([0,1]\), each element in \(\gamma_{\mathcal{E}_{t}}\) adheres to the same constraints. On the other hand, each element in \(\gamma_{\mathcal{F}_{t}}^{\prime}\) is a composite of two statistical fairness metrics for each client. This combination yields a value bounded within the range of \([0,2]\). By utilizing the \(\operatorname{softmax}\) function, we standardize the ranges of these two weights, harmonizing their scales and facilitating subsequent hyperparameter tuning and combination operations.
**Combined weight.** After computing \(\gamma_{\mathcal{E}_{t}}\) and \(\gamma_{\mathcal{F}_{t}}\), we integrate them into a singular weight vector \(\gamma_{t}\in\mathbb{R}^{K^{\prime}}\) using the following equation:

\[\gamma_{t}=\operatorname{softmax}\big{(}\frac{\lambda\cdot\gamma_{\mathcal{E}_{ t}}+\gamma_{\mathcal{F}_{t}}}{\tau}\big{)}, \tag{3}\]

where \(\lambda\) is a hyperparameter, and \(\tau\) is the temperature parameter of the \(\operatorname{softmax}\) function. This equation normalizes the two weight vectors \(\gamma_{\mathcal{E}_{t}}\) and \(\gamma_{\mathcal{F}_{t}}\) to probability distributions that sum to one, thereby producing a new weight vector \(\gamma_{t}\). The temperature parameter controls the smoothness of the probability distribution, while the hyperparameter \(\lambda\) adjusts the relative importance of data bias in the final combination.

**Global model updating strategy.** With the unified weights, we update the global model \(\omega_{t}\) by combining the uploaded local models \(\omega_{t}^{i}\) from \(K^{\prime}\) clients, where \(i\in 1,...,K^{\prime}\), with the combined weight vector \(\gamma_{t}\) as follows:

\[\omega_{t}\leftarrow\gamma_{t}^{1}\cdot\omega_{t}^{1}+...+\gamma_{t}^{K^{ \prime}}\cdot\omega_{t}^{K^{\prime}}, \tag{4}\]

where \(\gamma_{t}^{i}\) is the \(k\)-th element of the combined weight vector. The updated global model \(\omega_{t}\) is then broadcasted to all clients by the server.

## 7 Experimental Evaluation

In this section, we present the results of our experiments on three real-world datasets for node classification tasks. Our proposed approach, \(\text{F}^{2}\text{GNN}\) is evaluated and compared against several baseline schemes in terms of both utility and fairness metrics.

### Experimental Setup

**Datasets.** We employ three real-world datasets, Pokec-z, Pokec-n, and NBA, that are widely used for GNN training [1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 182, 184, 186, 187, 188, 189, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 222, 206, 217, 218, 219, 22, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 282, 284, 285, 286, 287, 288, 289, 291, 292, 293, 294, 295, 296, 297, 298, 299, 299, 300, 311, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 333, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 388, 389, 390, 391, 392, 301, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 42, 403, 404, 409, 42, 409, 43, 409, 44, 411, 434, 44, 424, 44, 445, 446, 409, 42, 441, 44, 45, 46, 409, 44, 42, 45, 47, 48, 49, 410, 42, 409, 44, 42, 46, 409, 43, 44, 44, 45, 46, 409, 44, 47, 48, 49, 42, 49, 43, 44, 45, 46, 409, 44, 47, 49, 45, 48, 49, 46, 409, 47, 49, 48, 49, 49, 400, 41, 40, 42, 409, 44, 45, 46, 409, 47, 49, 48, 49, 49, 400, 41, 40, 43, 409, 41, 44, 45, 46, 409, 45, 47, 49, 48, 49, 410, 42, 409, 44, 45, 46, 409, 46, 409, 47, 48, 49, 49, 410, 42, 409, 43, 44, 45, 46, 409, 49, 410, 44, 45, 47, 49, 410, 42, 409, 45, 46, 409, 47, 49, 48, 49, 410, 49, 411, 43, 44, 45, 46, 409, 49, 411, 44, 45, 47, 49, 410, 42, 409, 45, 46, 409, 47, 49, 411, 45, 48, 49, 410, 42, 409, 45, 49, 411, 46, 47, 49, 412, 40, 46, 409, 47, 49, 413, 44, 45, 47, 49, 414, 48, 49, 415, 49, 416, 417, 418, 419, 42, 419, 43, 45, 46, 409, 410, 42, 409, 45, 47, 49, 413, 45, 46, 409, 47, 48, 49, 49, 414, 49, 415, 49, 416, 417, 41, 418, 419, 42, 41, 42, 42, 43, 44, 45, 46, 409, 41, 47, 48, 49, 415, 42, 43, 44, 45, 47, 49, 416, 42, 45, 46, 409, 47, 49, 417, 49, 418, 42, 409, 45, 419, 42, 43, 45, 46,
number of hops to grow the networks. Each network (or subgraph) is considered as a client. We evaluate our proposed approach on the Pokec datasets in a setting with 30 clients, each holding a 3-hop ego-network, and on the NBA dataset in a setting with 10 clients, each holding a 3-hop ego-network. See more details in Appendix D.

### Performance Evaluation

Table 1 provide a comprehensive performance comparison of various models on the Pokec datasets, with a particular focus on their fairness attributes, specifically \(\Delta_{\text{SP}}\) and \(\Delta_{\text{EO}}\). The results on the NBA dataset can be found in Appendix E Table 4.

Specifically, we evaluate the models on a global test set as well as local test sets. Each local client has its corresponding test set. After we get the metrics from all clients, we report the median value of these clients for each metric. Among the evaluated methods, our proposed framework, \(\text{F}^{2}\text{GNN}\) consistently outperforms other methods across all three datasets in both global and local sets. In particular, \(\text{F}^{2}\text{GNN}\) achieves the lowest \(\Delta_{\text{SP}}\) and \(\Delta_{\text{EO}}\) values in all three datasets, indicating the effectiveness of the proposed scheme for group fairness in federated settings.

The trade-off performance of each model on the three datasets is illustrated in Table 2. The proposed method achieves the highest trade-off values for the Pokec-z, Pokec-n, and NBA datasets, respectively, demonstrating its exceptional ability to balance accuracy and fairness.

In summary, our proposed \(\text{F}^{2}\text{GNN}\) framework outperforms other baselines in terms of \(\Delta_{\text{SP}}\), \(\Delta_{\text{EO}}\), and trade-off values across all datasets. These results validate the effectiveness and robustness of \(\text{F}^{2}\text{GNN}\) in achieving competitive performance while maintaining group fairness in node classification tasks. These findings also highlight the broad applicability of our approach in the field of federated learning, suggesting its potential for adaptation to other domains.

Given the limited number of baseline models, we further evaluate our approach in comparison to several Fair GNNs within a non-federated setting. Comprehensive experimental results and supplementary information can be found in Table 5 presented in Appendix E.

### Ablation Study

In the ablation study reported in Figure 2, we evaluate the significance of the client-side fairness-aware local model updates and the server-side fairness-weighted model updates in our proposed model on the Pokec datasets and the NBA dataset. The omission of the client-side updates or server-side updates leads to a noticeable decrease in accuracy and an increase in the disparity measures \(\Delta_{\text{SP}}\) and \(\Delta_{\text{EO}}\), underscoring their importance in maintaining both classification accuracy and fairness. Although discarding the server-side fair aggregation scheme results in the highest accuracy and AUC values on the Pokec-z dataset, it negatively impacts fairness, indicating its significant role in promoting fairness.

\begin{table}
\begin{tabular}{l c
The full model, F\({}^{2}\)GNN achieves the best balance between accuracy and fairness, demonstrating the effectiveness of all components in federated graph learning.

## 8 Conclusion

This research investigates the impact of data bias in federated learning, particularly in the context of graph neural networks. We emphasize the significance of considering the correlation between sensitive attributes and graph structures, in achieving model fairness. To address these challenges, we propose F\({}^{2}\)GNN, a comprehensive approach that incorporates fairness in both client-side local models and server-side aggregation schemes. Our experiments on real-world datasets demonstrate the effectiveness of our algorithm in mitigating bias and enhancing group fairness without compromising downstream task performance. Moving forward, we acknowledge the importance of strengthening privacy protection when uploading group balance scores. One potential solution is the utilization of techniques such as homomorphic encryption, which enables computations on encrypted data and secure aggregation on the server side.
