FedClusAvg: Federated Cluster Average
- FedClusAvg is defined as a federated learning algorithm that integrates intra‑client clustering and deviation‑based weighting to manage Non‑IID data and enhance privacy.
- The method extends standard FedAvg with a two‑tier (or three‑tier in FedClusAvg+) approach, reducing communication rounds and improving scalability.
- Empirical results in prosumer energy management and FDIA detection demonstrate significant accuracy gains and faster communication compared to conventional methods.
Federated Cluster Average (FedClusAvg) is a federated learning algorithm designed to cope with strongly Non‑IID data while preserving user privacy. In the published formulations devoted to prosumer energy management and to false data injection attack detection in smart grids, it extends FedAvg by combining clustering and stratified sampling inside each client, deviation‑based weighting of local or server‑side parameters, and, in the FedClusAvg+ variant, a three‑tier clients → sub‑servers → main server architecture intended to reduce communication rounds and improve scalability (Li et al., 9 Mar 2025, Li et al., 20 Jul 2025).
1. Definition, motivation, and scope
FedClusAvg appears in settings where local data are both privacy‑sensitive and statistically heterogeneous. In prosumer energy management, the motivating examples include users who both consume and produce energy, with local records reflecting features such as EV ownership, driving patterns, and detailed energy consumption profiles; the stated objective is to enable these data to participate in intelligent decision making without revealing privacy (Li et al., 9 Mar 2025). In smart grids, the same algorithmic pattern is used for FDIA detection under geographically heterogeneous SCADA and PMU measurements, where identical variables may follow distinct statistical distributions across regions and where centralized collection is constrained by privacy, regulation, transmission cost, and scalability (Li et al., 20 Jul 2025).
Within this literature, FedClusAvg has two principal forms. The basic version is a two‑tier client–server method: the server broadcasts a global model, each client internally partitions its own dataset into clusters, performs multiple local iterations on these clusters, and sends back an aggregated client model. FedClusAvg+ inserts a sub‑server layer between clients and the main server, so that client updates are first aggregated regionally and only then sent upward. In both forms, clustering is performed inside each client’s dataset rather than over the client population itself. This design choice distinguishes FedClusAvg from clustered FL frameworks that explicitly partition clients into groups.
2. Optimization model and two-tier algorithm
FedClusAvg retains the standard federated empirical risk minimization objective
with
where client holds dataset , , and (Li et al., 9 Mar 2025).
The basic per‑round pipeline is server initialization, broadcast of the current global model , local client updates, and server aggregation. The distinctive step is that a client does not train on as a single pool. Instead, it clusters into several “small clients,” trains a model on each cluster 0, and then aggregates these cluster models into a client model 1. The within‑client aggregation is defined by
2
3
4
The server then performs a second deviation‑based aggregation over clients: 5
6
7
A gradient‑form description is also given in the prosumer formulation: local cluster gradients 8 are averaged by first computing a data‑size‑weighted mean, then assigning weights according to deviation from that mean, and finally taking a weighted combination of the gradients. The parameter‑level and gradient‑level versions are presented as conceptually equivalent.
3. Intra-client clustering, stratified sampling, and FedClusAvg+
The client‑side clustering routine is described as cluster stratified sampling. Each local sample is represented as
9
and attributes are standardized before clustering. The routine denoted “SpectralClust” in the pseudo‑code uses a longest‑distance rule. A threshold 0 with 1 is chosen, one sample is selected as the first center 2, the farthest sample becomes 3, and additional centers are added only if
4
where
5
Samples are then assigned by nearest center. The implementation details state that clients with 6 are eligible for clustering, that the distance between class centers in the optimal scheme is greater than 7 of the average pre‑clustering sample distance, that the number of clusters is roughly 8, and that if 9 the client attempts clustering; otherwise it falls back to treating the whole 0 as one cluster (Li et al., 9 Mar 2025).
After clustering, each cluster is trained for 1 local epochs over mini‑batches: 2 The resulting cluster models are combined into a single client model by the deviation‑based weighting above. The stratified aspect is therefore not a separate random subsampling mechanism; it is primarily a grouping‑then‑aggregation scheme.
FedClusAvg+ extends this logic hierarchically. For sub‑server 3 with clients 4, the sub‑server computes
5
6
The main server then aggregates sub‑server models: 7
8
The intended effect is to replace 9 main‑server uploads per round with 0 uploads per round while retaining the same local clustering logic (Li et al., 20 Jul 2025).
4. Treatment of heterogeneity, privacy model, and a notable ambiguity
FedClusAvg addresses Non‑IID data in two complementary ways. First, it reduces within‑client heterogeneity by splitting each client’s data into more homogeneous clusters and training cluster‑specific local models. Second, it mitigates disagreement across clients by weighting models according to their deviation from a pre‑average model at the client, sub‑server, and server levels. The stated motivation is that when the parameter deviation of a client is large, the weight of that parameter should be reduced so that the algorithm can achieve higher accuracy in processing Non‑IID data (Li et al., 9 Mar 2025, Li et al., 20 Jul 2025).
A well‑known interpretive issue follows immediately from the formulas. The explicit definitions use
1
so the implemented weights increase with deviation rather than decrease. Both the prosumer formulation and the smart‑grid formulation note this inconsistency between the textual explanation and the mathematical expression. The natural reading is that the published method is defined by the formulas as written, while the prose suggests an opposite intuition. A plausible implication is that FedClusAvg should be treated as a heuristic aggregation rule whose exact robustness mechanism is not theoretically settled.
The privacy model is the standard FL locality assumption. Raw client data do not leave the device or local gateway; only parameters or gradients are exchanged. The prosumer paper explicitly states that it does not introduce differential privacy, secure aggregation protocols, homomorphic encryption, or specific MPC schemes, and the FDIA paper presents differential privacy, secure multi‑party computation, homomorphic encryption, and secure aggregation as possible extensions rather than implemented components (Li et al., 9 Mar 2025, Li et al., 20 Jul 2025). Likewise, neither formulation provides formal convergence proofs or theoretical rates.
5. Application domains and empirical evidence
Although the prosumer paper is motivated by energy management, its reported experiments use a cardiovascular disease dataset from Kaggle with 70,000 records, 11 input features, a logistic regression model, 100 clients, learning rate 2, 3 local epochs, and 4 server rounds. In the two‑tier setting, the reported mean metrics are: accuracy 5 for FedClusAvg versus 6 for FedAvg, precision 7 versus 8, recall 9 versus 0, and 1 versus 2. In the three‑tier setting, FedClusAvg+ reports mean accuracy 3 versus 4 for FedAvg+, precision 5 versus 6, recall 7 versus 8, and 9 versus 0. KS curves and accuracy‑versus‑round plots are described as favoring the clustered method (Li et al., 9 Mar 2025).
The FDIA paper evaluates the method on the IEEE 118‑bus system and larger benchmark systems. For IEEE‑118, with 100 clients and 5 sub‑servers, FedClusAvg reports mean accuracy 1, precision 2, recall 3, and 4, compared with 5, 6, 7, and 8 for FedAvg. FedClusAvg+ reports mean accuracy 9, precision 0, recall 1, and 2, compared with 3, 4, 5, and 6 for FedAvg+. Against FedProx and FedNova on IEEE‑118, the three‑tier version reports mean accuracy 7 and 8, compared with 9 and 0 for FedProx, and 1 and 2 for FedNova. On larger systems—IEEE‑300, a regional grid with 1,500 buses, and a provincial grid with 5,000 buses—the paper reports consistent Accuracy and AUC advantages for FedClusAvg+. Under very high heterogeneity (3 difference), the reported accuracy gaps between FedClusAvg+ and FedAvg+ are 4 points on IEEE‑300 and 5 points on the provincial grid. Communication measurements further report per‑round delay reductions from approximately 6 to 7 under WiFi and from 8 to 9 under 5G when moving from FedClusAvg to FedClusAvg+ (Li et al., 20 Jul 2025).
6. Position within clustered federated learning and privacy-preserving averaging
FedClusAvg belongs to a broader family of clustered or cluster‑aware federated methods, but its clustering locus is distinctive. FedGroup groups clients according to similarities between their optimization directions and then runs group‑wise FedAvg or FedProx, using cosine‑similarity‑based clustering and the Euclidean distance of Decomposed Cosine similarity (EDC) to reduce the cost of client clustering (Duan et al., 2020). FedCluster, by contrast, partitions devices into multiple clusters and performs federated learning cyclically in each learning round, yielding a cluster‑wise FedAvg update schedule with nonconvex rate 0 under the stated assumptions (Chen et al., 2020). These frameworks cluster clients; FedClusAvg clusters samples within each client.
The weighting logic of FedClusAvg also sits near later work on cluster‑skew. FedDRL defines cluster‑skew as a setting in which groups of clients have similar local data distributions and shows that purely sample‑proportional aggregation can overly favor groups with more clients, even when label size and number of samples are balanced. Its remedy is adaptive, loss‑driven aggregation weights produced by deep reinforcement learning rather than by a closed‑form deviation rule (Nguyen et al., 2022). This does not make FedDRL a FedClusAvg method, but it clarifies the broader problem to which deviation‑aware weighting responds.
A separate line of work uses clusters primarily for privacy rather than for handling Non‑IID data. In cluster‑based secure multi‑party computation for histopathology images, hospitals are partitioned into equal‑size clusters, each hospital splits its local model into additive shares with coefficients 1, cluster members exchange masked shares, and the server recovers the exact global average
2
without observing any individual 3 (Hosseini et al., 2022). This is a cluster‑mediated average, but the cluster structure is a logical SMC device rather than a statistical clustering mechanism.
Recent work also exposes limits of flat prototype averaging in unsupervised federated clustering. One‑Shot Hierarchical Federated Clustering argues that fragmented and multi‑granular global clusters can make naive prototype averaging distort the global structure, and instead proposes one‑way prototype‑level communication together with server‑side hierarchical fusion of client clusterlets (Cai et al., 10 Jan 2026). In decentralized clustered FL, DFCA shows that cluster‑specific models can be aggregated without a server by means of a sequential running average over neighbors as updates arrive, illustrating a serverless form of cluster‑wise averaging (Kirch et al., 17 Oct 2025). Taken together, these neighboring lines of work suggest that “federated cluster average” is best understood not as a single canonical protocol, but as a design pattern spanning intra‑client clustering, client‑level grouping, secure cluster‑mediated averaging, and decentralized cluster‑wise consensus.