WorksComputer Science
FedSGN: Federated Sparse Grassmann Newton Learning for IoT Anomaly Detection
Abstract
Anomaly detection plays a critical role in securing the Internet of things (IoT). Although existing federated principal component analysis (PCA) methods can learn the subspace of normal samples without sharing raw data, they often suffer from feature redundancy that may degrade detection performance. To address this limitation, we propose a novel and effective federated sparse Grassmann Newton (FedSGN) learning method for IoT anomaly detection. Technically, our FedSGN leverages the -norm constraint on the global projection matrix to eliminate redundancy and introduces an orthogonality penalty to preserve the intrinsic structure. Moreover, we develop an augmented Lagrangian solver integrated with a semismooth Newton scheme to enable parallel client updates and Grassmann projection for robustness. Numerical experiments demonstrate that the proposed method achieves favorable overall detection performance while reducing communication overhead. The source code is publicly available at https://github.com/xianchaoxiu/FedSGN
Introduction
The Internet of things (IoT) connects different devices equipped with sensing, computing, and communication capabilities, finding extensive applications in fields such as smart manufacturing, transportation, healthcare, and urban services [1]. Through continuous data exchange, these systems can monitor the physical environment and respond to evolving conditions [2]. However, this pervasive connectivity significantly expands the attack surface, leading to critical security and privacy vulnerabilities [3, 4]. Currently, anomaly detection, which aims at identifying observed data that deviates from normal behavioral patterns, has attracted intensive research attention within the IoT ecosystem. Interested readers may refer to the recent surveys [5, 6, 7].
Traditional IoT anomaly detection methods often collect raw data generated by devices into a central server. However, the sharing and processing of these records raise concerns regarding the use and protection of personal data [8, 9]. Federated learning (FL) offers a distributed alternative in which clients retain their raw data and collaborate solely by exchanging model information [10, 11]. Nevertheless, the heterogeneity of devices and variations in local data distributions increase the complexity of such collaboration [12, 13]. To address these challenges in intrusion detection, regularized model aggregation is combined with adaptive differential privacy [14]. Yet a federated detector must still balance detection capability against local computation and repeated model transmission at resource-constrained gateways.
Neural networks and deep learning have been widely applied for IoT anomaly detection [15, 16]. These methods learn representations of normal samples to identify deviations. An autoencoder (AE) compresses inputs through an encoder and reconstructs them through a decoder, using reconstruction errors as anomaly scores [17, 18]. Extending this method to distributed data, federated AE (FedAE) train local models collaboratively without centralizing raw records, while FedAE2 uses a deeper architecture within the same reconstruction framework [19]. Beyond reconstruction learning, a bidirectional generative adversarial network (BiGAN) jointly trains an encoder, a generator, and a discriminator to learn mappings between the data and latent spaces through adversarial learning [20]. Federated BiGAN (FedBiGAN) extend this framework to distributed clients, with FedBiGAN2 adopting a deeper architecture [19]. While these methods broaden the representation models available for federated detection, practical deployment also requires attention to model efficiency and interpretability. To reduce computational overhead, knowledge distillation has been explored for graph-based anomaly detection [21]. To further address the difficulty of explaining federated detection decisions without access to local training data, synthetic reference samples have been investigated [22]. However, communication costs and feature interpretability remain important considerations when deploying neural network-based methods on IoT devices.
Principal component analysis (PCA) offers a lightweight way for IoT anomaly detection [23, 24]. As shown in [25], by employing PCA for feature compression, the storage resource requirements for devices can be reduced. Furthermore, federated PCA enables clients to learn a subspace representation of normal samples collaboratively without the need to exchange raw data. Representative anomaly detection methods include FedPE, which utilizes the alternating direction method of
This work was supported in part by the National Natural Science Foundation of China under Grants 62204044 and 12371306, the State Key Laboratory of Integrated Chips and Systems under Grant SKLICS-K202302, and the Shenzhen Nature Science Research Foundation Key Project under Grant ZDYJ20251211121303005. (Corresponding author: Xianchao Xiu.)
Jingjing Liu is with the School of Microelectronics, Shanghai Key Laboratory of Chips and Systems for Intelligent Connected Vehicle, Shanghai University, Shanghai 200444, China, and also with the State Key Laboratory of Integrated Chips and Systems, Fudan University, Shanghai 201203, China. (email: [email protected]).
Xiansen Ju is with the School of Microelectronics, Shanghai Key Laboratory of Chips and Systems for Intelligent Connected Vehicle, Shanghai University, Shanghai 200444, China (email: [email protected]).
Xianchao Xiu is with the School of Mechatronic Engineering and Automation, Shanghai University, Shanghai 200444, China (email: [email protected]).
Wanquan Liu is with the School of Intelligent Systems Engineering, Sun Yat-sen University, Shenzhen 510275, China (email: [email protected]). multipliers (ADMM) [26] in Euclidean space, and FedPG, which optimizes on an intrinsic Grassmann manifold [19]. More recently, FedEP incorporates -norm sparse regularization term and local models, thereby accommodating client-specific noise and enhancing system robustness [27]. Although such methods can reduce model complexity, they do not impose explicit constraints on the number of nonzero rows in the global projection matrix [28], [29]. Therefore, redundant features may persist in the shared representation, which not only limits the interpretability but also hinders the reduction of model transmission volume.
To address the above issue, we propose an effective federated sparse Grassmann Newton learning method, abbreviated as FedSGN, for IoT anomaly detection. Different from FedEP that relies on the -norm regularization term on the local model, our FedSGN imposes an -norm constraint on the global projection matrix, thereby enabling explicit feature selection. To the best of our knowledge, it has not been explored in federated learning. During the optimization process, an orthogonality penalty term is introduced to preserve the subspace structure, which differs fundamentally from FedPE and FedPG that depend on singular value decomposition (SVD). Thus, the resulting projection matrix can be transmitted in the sparse form, reducing the communication overhead for the global model. The framework of our proposed FedSGN is provided in Figure 1.
Figure 1. Framework of our proposed FedSGN. In each round, clients update their local models and send the updates to the server, which aggregates them and refines the shared sparse subspace. After training, samples with large reconstruction errors are flagged as anomalies.
The main contributions of the current work can be summarized in the following three aspects.
We propose FedSGN, a federated sparse subspace model designed to provide a new idea for IoT anomaly detection. By incorporating an -norm constraint alongside an orthogonality penalty, our model enables global feature selection through collaborative learning among clients.
We develop an efficient optimization algorithm based on the ADMM strategy, which decouples parallel client updates from global sparse updates. On the server side, a semismooth Newton method is employed to accelerate the computation of subproblems.
We evaluate the proposed FedSGN using both synthetic and three real-world datasets. In addition, we visualize the feature selection achieved through sparsity and compare the model transmission volume.
The remainder of this paper is organized as follows. Section II introduces some related works. Section III presents our proposed model and optimization algorithm. Section IV reports the experimental results. Section V concludes the paper.
Related Work
This section briefly introduces necessary notations, as well as the basics of sparse PCA and federated PCA.
Notations
Throughout this work, matrices are denoted by boldface uppercase letters, vectors by boldface lowercase letters, and scalars by italic letters. For , its th row, th column, and th entry are denoted by , , and , respectively. The inner product of two matrices is , where denotes the trace, and denotes the transpose. The -norm and Frobenius norm are defined as and , respectively. Moreover, the -norm counts the nonzero rows, which is defined as , where represents the cardinality of an index set . In addition, the operator stacks the columns of . Additional notation will be introduced where needed.
Sparse PCA
PCA is a classic subspace learning method that preserves the essential information of data through a low-dimensional representation. Given a centered data matrix , its reconstruction objective can be formulated as
where is an orthonormal basis, is an orthogonality constraint, which also constitutes a manifold. However, this PCA does not explicitly constrain the number of nonzero rows in the basis matrix. In the field of intrusion detection for IoT, feature engineering can reduce the training and detection costs by selecting and constructing informative features [30]. In this regard, sparse PCA introduces sparse regularization terms into its objective [31], [32]. A common formulation is
where determines the degree of sparsity in . If an entire row is zero, it implies that the corresponding feature has been excluded from the representation. Although problem (2) can promote row-wise sparsity, it cannot directly constrain the number of rows that are retained. In contrast, provides an explicit characterization with at most nonzero rows [33], [34]. This yields the following PCA variant
From an optimization perspective, the combination of and renders the problem non-convex. Consequently, it necessitates the use of appropriate solution algorithms, such as ADMM [35], manifold proximal gradient method [36], and Riemannian ADMM [37]. It should be noted that they are first-order optimization algorithms, whereas this paper employs a second-order algorithm based on a semismooth Newton strategy.
Federated PCA
Federated PCA aims to learn a common subspace from data distributed across clients, without the need to exchange raw records [38], [39]. Let denote the data matrix for the th client, its local basis, and the shared basis. Here, is the number of features and is the number of training samples at client . A standard consensus-based federated PCA formulation in [19] is given by
where . Although the consensus constraints above can ensure that the basis is shared, they do not directly facilitate feature selection. In comparison, this paper considers federated sparse PCA which enables efficient feature selection by imposing row-wise sparse constraints on the shared basis.
The Proposed Method
Problem Formulation
Motivated by the above observations, we attempt to learn a shared orthogonal subspace of dimension that contains at most nonzero rows. By integrating problem (3) and problem (4), it derives the following mathematical model
where counts the nonzero rows of . The subspace dimension and feature budget satisfy .
Instead, we leverage an equivalent objective function based on covariance and replace the strict orthogonality constraints with a penalty on the global matrix. This leads to the following sparse consensus problem
where is the orthogonality penalty weight and
Assume that is the final global orthogonal basis obtained by solving problem (6). For a centered sample , the squared reconstruction residual is used as its anomaly score
A sample is classified as anomalous when its score exceeds a calibrated threshold.
Optimization Algorithm
Obviously, problem (6) is a non-convex optimization problem. To this end, we resort to the ADMM algorithm for consensus optimization [26], while incorporating the sparsity-constrained framework presented in [40]. For ease of description, let
For each consensus constraint , , introduce a Lagrange multiplier and a penalty parameter . Consequently, the augmented Lagrangian function for problem (6) is defined as
where and
| Algorithm 1: Optimization Algorithm for Solving Problem (6) |
| Input: Local training matrices , sparsity , tolerance , iteration limits and , and parameters , , . |
| Initialize: , , and with . |
| 1 while do |
| ▷ Server: global sparse update |
| 2 Set and . |
| 3 while do |
| 4 Select the support . |
| 5 if then break |
| 6 Write and . Compute using (26) and (27), and set . |
| 7 Accept the Newton direction if the system is solvable and . Otherwise, set and . |
| 8 Choose the step-size according to . Update by (28). |
| 9 Set |
| 10 end |
| 11 Set and broadcast it. |
| ▷ Clients: parallel local updates |
| 12 foreach client in parallel do |
| 13 Update by (34). |
| 14 Update by (35). |
| 15 end |
| 16 Set |
| ▷ Grassmann projection |
| 17 Compute the QR factorization , and set as the Grassmann subspace representation. |
| 18 end |
| Output: Global projection matrix . |
Table 1.
Following the alternating minimization scheme, problem (6) can be solved by
where the second and third updates are performed locally by each client . Next, we will describe fast solvers for subproblem (12) and subproblem (12b), and the whole optimization algorithm for solving problem (6) is summarized in Algorithm 1.
Update Y
When and are fixed, the global update in subproblem (12) can be rewritten as
Actually, the above problem does not admit a closed-form solution. The gradient of is given by
Furthermore, the Hessian matrix is
where
where denotes the Kronecker product, and is the permutation matrix satisfying
where is an arbitrary matrix.
Let denote the collection of index sets corresponding to the largest row norms of , where is a step-size parameter. For any given support set , the sparse projection condition can be expressed as
where denotes the row-wise hard thresholding operator, which retains the rows with the largest -norm values and sets the remaining rows to zero. To characterize the stationarity condition of the sparse projection, we define the projection residual as
By rearranging the rows of according to the support set and its complementary set , the projection residual can be rewritten as
and at the stationary point, it is equivalent to
Thus, the stationary condition of the -subproblem can be formulated as the following nonlinear equation
Once the support set is determined, is differentiable with respect to .
Below, we discuss how to solve (22) for seeking a stationary point on the selected support set. For a fixed outer iteration , let for the inner Newton iterate, with . At inner iteration , choose . In this paper, we utilize a semismooth Newton method [41] with hard thresholding [42] to compute the search direction by solving
where represents its Jacobian matrix evaluated at the current iterate .
To index the Hessian of by vectorized coordinates, define
Here, indexes feature rows, , and . Grouping coordinates in the order of and , respectively, gives
where denotes the Hessian submatrix corresponding to the selected feature rows, and is an identity matrix associated with the unselected feature dimensions.
Due to the block structure of the Jacobian matrix, the Newton direction can be efficiently obtained by solving a reduced linear system. Furthermore, the unselected rows of the current iterate need not be zero when the support changes. Therefore, the Newton equation in (23) reduces to
The remaining direction rows are given by
The reduced Hessian need not be nonsingular. If the Newton system cannot be solved, the negative gradient on the selected rows is used as a fallback direction, while (27) is retained. To preserve row-wise sparse constraints, update , where, after ordering the rows by and its complement via
Here, the step-size is chosen by the Armijo line search specified in Algorithm 1.
Update Xi
Update : Given the updated global subspace matrix , each client computes its local variable by solving
which is equivalent to
Taking the derivative with respect to and setting it to zero yields
Recall that
then substituting it into (31), it holds
Rearranging the above equation gives the closed-form solution
Update bold0mu mumu falsei
Update : After obtaining and , the dual variables are calculated as
Complexity Analysis
In each communication round, the server performs at most sparse Newton steps, each costing , followed by a Grassmann projection costing . The clients perform their local updates in parallel, with a total computational cost of . The server sends at most coefficients and row indices to each client, while each client uploads values. Thus, row-wise sparse constraints reduce the broadcast volume, and clients exchange model variables without sharing raw data.
Numerical Experiments
This section begins by describing the experimental setups, then presents the experimental results on both synthetic and real-world datasets, and finally conducts ablation studies and provides further discussion.
Experimental Settings
Compared Methods
To demonstrate the superiority of our proposed FedSGN, the following seven state-of-the-art federated anomaly detection methods are considered.
FedAE [43]: A federated autoencoder that detects anomalies from reconstruction errors, which provides a nonlinear reconstruction baseline.
FedAE2 [19]: A deeper variant of FedAE that also uses reconstruction errors for anomaly detection.
FedBiGAN [20]: A federated bidirectional generative adversarial network that uses adversarial training to learn a representation of normal data.
FedBiGAN2 [19]: A deeper variant of FedBiGAN that retains its bidirectional adversarial training scheme.
FedPE [19]: A federated PCA method that uses ADMM in Euclidean space, which is a subspace baseline without Grassmann optimization.
FedPG [19]: A federated PCA method that optimizes directly on the Grassmann manifold, which represents a geometric baseline.
FedEP [27]: A personalized federated PCA method that promotes element-wise sparsity in local representations and row-wise regularization in local models.
Dataset Description
The experiments involve both synthetic and real-world data. Here, the synthetic dataset contains 50-dimensional normal and anomalous samples generated from controlled distributions, with the anomaly intensity governed by the normalized mean shift . Table I lists the selected real-world datasets, including
| Datasets | Features | Training | Testing | Classes |
| UNSW-NB15 | 39 | 65,000 | 65,332 | 10 |
| NSL-KDD | 34 | 125,973 | 22,544 | 5 |
| TON-IoT | 49 | 114,956 | 66,557 | 10 |
Table I. Statistics of the real-world datasets
UNSW-NB15 [44] combines contemporary normal samples with nine categories of attacks. After preprocessing, 39 numerical features are retained.
NSL-KDD [45] is a refined version of the KDD’99 dataset with redundant records reduced. Its labels cover normal samples as well as four attack categories: DoS, Probe, R2L, and U2R.
TON-IoT [46] comprises heterogeneous telemetry and network attacks, including DDoS, DoS, scanning, ransomware, and injection activities.
Evaluation Metrics
According to [27], five standard metrics are utilized to evaluate the performance of the compared methods. Let TP, TN, FP, and FN represent true positives, true negatives, false positives, and false negatives, respectively.
Accuracy (ACC): The overall proportion of correctly classified records, defined as
Precision (PRE): The ratio of correctly identified attacks to all predicted attack records, defined as
| Methods | UNSW-NB15 | NSL-KDD | TON-IoT | ||||||||||||
| ACC ↑ | PRE ↑ | REC ↑ | FNR ↓ | F1 ↑ | ACC ↑ | PRE ↑ | REC ↑ | FNR ↓ | F1 ↑ | ACC ↑ | PRE ↑ | REC ↑ | FNR ↓ | F1 ↑ | |
| FedAE | 80.88 | 80.66 | 95.27 | 4.73 | 87.36 | 83.74 | 86.84 | 84.19 | 15.81 | 85.50 | 87.89 | 93.52 | 91.36 | 8.64 | 92.43 |
| FedAE2 | 82.80 | 83.45 | 93.80 | 6.20 | 88.32 | 83.35 | 86.90 | 83.32 | 16.68 | 85.07 | 89.81 | 94.63 | 92.34 | 7.66 | 93.47 |
| FedBiGAN | 81.49 | 83.04 | 91.63 | 8.37 | 87.12 | 83.36 | 89.93 | 79.69 | 20.31 | 84.50 | 88.83 | 92.42 | 92.42 | 7.57 | 92.42 |
| FedBiGAN2 | 81.59 | 81.98 | 94.16 | 5.84 | 87.65 | 82.01 | 83.71 | 84.92 | 15.08 | 84.31 | 89.53 | 95.82 | 91.93 | 8.07 | 93.83 |
| FedPE | 82.15 | 81.06 | 95.14 | 4.86 | 87.54 | 81.91 | 85.62 | 81.99 | 18.01 | 83.77 | 87.15 | 89.17 | 94.94 | 5.06 | 91.96 |
| FedPG | 81.95 | 82.82 | 93.36 | 6.64 | 87.77 | 81.61 | 83.25 | 84.75 | 15.24 | 83.99 | 88.89 | 92.73 | 94.32 | 5.68 | 93.52 |
| FedEP | 83.31 | 82.17 | 97.00 | 3.00 | 88.97 | 84.24 | 89.66 | 81.75 | 18.25 | 85.52 | 90.48 | 92.61 | 96.65 | 3.35 | 94.59 |
| FedSGN (Ours) | 87.92 | 87.66 | 96.13 | 3.87 | 91.70 | 85.55 | 91.18 | 82.61 | 17.39 | 86.68 | 91.33 | 93.39 | 96.64 | 3.36 | 94.99 |
Table 2. Detection performance (%) on different datasets, where the best results are marked in bold.
Recall (REC): The ratio of correctly detected attacks to all actual attack records, defined as
False negative rate (FNR): The fraction of actual anomalies that are incorrectly classified as normal, defined as
F1 score (F1): The harmonic mean of PRE and REC, providing a balanced measure of model performance, defined as
It should be noted that higher values for ACC, PRE, REC, and F1, along with a lower FNR value, indicate better IoT anomaly detection performance. Furthermore, receiver operating characteristic (ROC) curves and the area under the ROC curve (AUC) are also reported to evaluate discrimination across decision thresholds.
Implementation Issues
For real-world datasets, categorical fields are encoded, and numerical features are standardized using statistics fitted to the normal training data. Normal training records are distributed across clients, while raw samples remain local. For the proposed FedSGN, the subspace dimension is set to , the row support size to , and the number of communication rounds to 20. In addition, all compared methods utilize the same data preprocessing and partitioning, and specific setups are detailed in the corresponding subsections.
Synthetic Results
In the experiments, we construct a synthetic dataset in which each sample consists of 50 features, with both normal and anomalous records generated. FedPG and FedEP are selected as federated subspace baselines for comparison and the results are shown in Figure 2. Here, blue points represent normal samples and red points represent anomalous ones. It can be observed that the representations learned by different methods vary. However, the degree of compactness or overlap exhibited within this three-dimensional space does not directly reflect performance in anomaly detection. This is because the detector actually makes its decisions based on reconstruction residuals in the original feature space, rather than on the distances shown in the visualization. Furthermore, to examine performance under varying degrees of anomalies, we keep the normal samples unchanged while constructing anomalous samples with different anomaly intensities. Anomaly intensity is represented by the standardized mean displacement . Here, denotes the displacement magnitude relative to the normal distribution, and denotes the standard deviation of normal samples. As shown in Figure 3, the AUC, REC, and F1 metrics generally improve as the anomaly intensity increases. This indicates that the greater the deviation from the normal distribution, the easier it is to identify the anomalous samples. Across the evaluated range of anomaly intensities, FedSGN consistently achieves higher AUC values than the other two methods. At higher anomaly intensities, the REC values for all three methods tend to converge, yet FedSGN maintains its advantage in terms of F1. Overall, these results indicate favorable anomaly discrimination and detection performance of our FedSGN.
Figure 2. Three-dimensional visualization of reconstructed normal and anomalous samples.
Figure 3. Detection performance under different anomaly intensities for the synthetic datasets.
Real-World Results
In this section, FedSGN is evaluated using the UNSW-NB15, NSL-KDD, and TON-IoT datasets. We first compare detection performance, followed by convergence behavior and sparse feature selection.
Detection Performance
Detection Performance: As presented in Table II, our FedSGN achieves the highest ACC and F1 on all three datasets. Specifically, on the UNSW-NB15 dataset, it obtains an ACC of 87.92% and an F1 of 91.70%, both exceeding those of the compared methods. Moreover, FedEP achieves higher REC on the UNSW-NB15 dataset and slightly higher REC on the TON-IoT dataset, while FedBiGAN2 obtains higher PRE on the TON-IoT dataset. Nevertheless, the lead held by FedSGN in terms of ACC and F1 indicates better overall classification performance and a favorable tradeoff between PRE and REC. These findings align with FedSGN, which involves collaboratively learning a shared normal subspace while explicitly filtering for key feature rows.
Furthermore, Figure 4 provides the ROC curves of all methods across the three datasets. On the UNSW-NB15 dataset, FedSGN shows higher true positive rates over intermediate false positive rate intervals. On the NSL-KDD dataset, the advantage is more apparent at low false positive rates, while the curves become closer and cross in subsequent intervals. On the TON-IoT dataset, it also performs favorably in several low and intermediate false positive rate intervals. Overall, these curves complement the ACC and F1 results by showing favorable detection tradeoffs over several threshold ranges.
Figure 4. ROC curves of the compared methods on the three real-world datasets.
Convergence Behavior
To investigate convergence behavior, we compare FedPG, FedEP, and FedSGN over 150 global communication rounds. Because the methods optimize different objectives, each loss sequence is independently min-max normalized and causally smoothed using an exponential moving average with a span of seven rounds. The resulting curves illustrate the relative loss reduction of each method.
As illustrated in Figure 5, our FedSGN exhibits a rapid loss decrease during the early rounds, followed by a relatively flat trajectory. This indicates that most observed loss improvement occurs early, with smaller changes in subsequent iterations. Although the loss curve of FedEP stabilizes earlier on the TON-IoT dataset, our FedSGN also shows a rapid loss decline followed by a relatively flat trajectory. In summary, these observations suggest that leveraging second-order information for sparse updates in FedSGN is effective.
Figure 5. Normalized convergence curves over 150 global communication rounds.
Sparse Feature Analysis: To examine the effects of row-wise sparse constraints on feature selection and model interpretability, we compare FedPG and FedSGN on three real-world datasets. Both methods use identical client partitions and orthogonal initialization, with a subspace dimension of 10, 10 clients, and 30 global communication rounds. Here, feature importance is measured by the -norm of each row of the learned subspace matrix and normalized by the maximum row norm of each method.
As shown in Figure 6, blue denotes FedPG and red denotes FedSGN, with FedPG mirrored to the left for comparison. It can be observed that FedPG assigns nonzero weights to all 39, 34, and 49 input features of the UNSW-NB15, NSL-KDD, and TON-IoT datasets, respectively. In contrast, FedSGN retains only 15 feature rows on each dataset and sets all remaining rows to zero. By zeroing unselected rows, FedSGN restricts the global subspace representation to an explicit subset of original features instead of merely shrinking their weights. The retained rows and their relative weights map directly to original data fields, making the features used by the model clearer. These results demonstrate how the -norm constraint controls the feature set and makes the learned subspace representation more interpretable.

Figure 6. Comparison of feature weights across different datasets.
Ablation Studies
In this part, we conduct ablation studies of our proposed FedSGN on the UNSW-NB15 dataset. The experiment uses 10 clients, a 10-dimensional subspace, and 20 global communication rounds, with the sparsity level set to 15. All variants follow the same data preprocessing pipeline and evaluation criteria. The following three variants are considered
Case I: Replace the Newton direction with the negative gradient direction.
Sparse Feature Analysis
Case II: Remove the -norm constraint.
Case III: Remove the Grassmann projection.
As listed in Table III, our FedSGN achieves the highest ACC, F1, and AUC among the evaluated configurations. In Case I, the resulting detection performance is close to the complete model, which indicates that replacing the Newton direction with the negative gradient direction alters the optimization strategy, but it does not change the underlying mathematical form of the model itself. In fact, the primary purpose of introducing the Newton direction is to accelerate convergence while maintaining a high level of detection performance. In Case II, removing the row-wise sparse constraints leads to a decline in ACC and F1 by approximately 7.3% and 5.2%, respectively. This suggests that selecting 15 feature rows enables a more compact representation without compromising detection performance. Furthermore, the retained feature rows correspond directly to the original data features and facilitate transmission via sparse matrices. In Case III, removing the Grassmann projection results in a decrease in ACC and F1 by 4.83% and 2.84%, respectively, which confirms the effectiveness of this projection step. It should be noted that this variant removes only the Grassmann projection while retaining the orthogonality penalty term used during the training process.
| Variants | Sparsity | Newton | Grassmann | ACC (%) | F1 (%) | AUC (%) |
| Case I | ✓ | × | ✓ | 87.25 | 91.29 | 83.26 |
| Case II | × | ✓ | ✓ | 80.59 | 86.54 | 81.17 |
| Case III | ✓ | ✓ | × | 83.09 | 88.86 | 81.96 |
| FedSGN | ✓ | ✓ | ✓ | 87.92 | 91.70 | 83.60 |
Table 3. Component ablation results on the UNSW-NB15 dataset.
Figure 7 presents the normal and anomaly score distributions of our FedSGN and its three variants on the UNSW-NB15 dataset, with blue and red denoting normal and anomalous samples, respectively. Evidently, FedSGN places most normal samples in the lower score region and anomalous samples in the higher region, showing clear separation between the two classes. Note that the score distributions for Case II and Case III exhibit significant overlap in the middle range, a finding that corroborates the results presented in Table III. Together, these observations support the roles of row-wise sparse constraints and the Grassmann projection in learning a discriminative normal data subspace.
Figure 7. Visualization of normal and anomaly score distributions.
Discussion
Communication Efficiency
In the communication comparison experiments, we set up 20 clients and 20 iterations, with each client performing one model representation transmission during the two-way communication phase in every iteration. For all four federated subspace methods, the subspace dimension is set to 10. FedSGN transmits its global projection matrix in sparse form, retaining 15 nonzero feature rows. As shown in Figure 8, our FedSGN has a smaller model transmission volume than the compared methods under this common exchange budget. This result illustrates how explicit feature selection produces a more compact model representation.
Figure 8. Model transmission volume on the three evaluated datasets.
Inference Efficiency
For all four subspace methods, the subspace dimension is set to 10, and a consistent batch size of 4096 normalized samples is used. As shown in Figure 9, our FedSGN achieves the lowest estimated tensor storage and shorter inference time compared to neural baseline methods. Compared with the other subspace methods, FedSGN uses less estimated tensor storage but takes slightly longer.
Figure 9. Estimated peak tensor memory versus inference time.
Conclusion
This paper has proposed a novel federated learning method for IoT anomaly detection. Specifically, our FedSGN imposes an -norm constraint on the global projection matrix to learn a shared subspace and explicitly select key features. By incorporating an orthogonality penalty and performing Grassmann projection in each iteration, FedSGN maintains an effective subspace representation. Moreover, we developed an augmented Lagrangian algorithm with parallel client updates and semismooth Newton optimization for the global sparse update. Numerous experiments have demonstrated favorable overall detection performance of the proposed method when compared against benchmark FedPG and FedEP.
In the future, we focus on the following three research directions. First, developing more efficient optimization algorithms to enhance inference efficiency. Second, adaptive sparsity mechanisms will be designed to improve model generalization. Third, extending the proposed method to neural networks is of importance for practical applications.
References
- [1]O. Aouedi, T.-H. Vu, A. Sacco, D. C. Nguyen, K. Piamrat, G. Marchetto, and Q.-V. Pham, “A survey on intelligent Internet of things: Applications, security, privacy, and future directions,” IEEE Communications Surveys & Tutorials, vol. 27, no. 2, pp. 1238–1292, 2025.
- [2]A. Rejeb, K. Rejeb, S. Simske, H. Treiblmaier, and S. Zailani, “The big picture on the Internet of things and the smart city: A review of what we know and what we need to know,” Internet of Things, vol. 19, p. 100565, 2022.DOI
- [3]J. Zhou, Z. Cao, X. Dong, and A. V. Vasilakos, “Security and privacy for cloud-based IoT: Challenges,” IEEE Communications Magazine, vol. 55, no. 1, pp. 26–33, 2017.DOI
- [4]S. Tang, L. Chen, K. He, J. Xia, L. Fan, and A. Nallanathan, “Computational intelligence and deep learning for next-generation edge-enabled industrial IoT,” IEEE Transactions on Network Science and Engineering, vol. 10, no. 5, pp. 2881–2893, 2023.arxiv.org/abs/2110.14937
- [5]J. Tu, L. Yang, and J. Cao, “Distributed machine learning in edge computing: Challenges, solutions and future directions,” ACM Computing Surveys, vol. 57, no. 5, pp. 1–37, 2025.
- [6]S. Liu, Y. Yu, Y. Zong, P. L. Yeoh, L. Guo, B. Vucetic, T. Q. Duong, and Y. Li, “Delay and energy-efficient asynchronous federated learning for intrusion detection in heterogeneous industrial internet of things,” IEEE Internet of Things Journal, vol. 11, no. 8, pp. 14739–14754, 2024.DOI
- [7]D. Adhikari, W. Jiang, J. Zhan, D. B. Rawat, and A. Bhattarai, “Recent advances in anomaly detection in internet of things: Status, challenges, and perspectives,” Computer Science Review, vol. 54, p. 100665, 2024.DOI
- [8]A. D. Koundouros and G. M. Kapitsaki, “A mapping of IoT user-centric privacy preserving approaches to the GDPR,” Internet of Things, vol. 11, p. 100179, 2020.
- [9]Z. Li, W. Yao, J. Luo, and Z. Huang, “Flow-based IoT intrusion detection via improved generative federated distillation learning,” IEEE Internet of Things Journal, vol. 12, no. 10, pp. 14797–14811, 2025.DOI
- [10]B. McMahan, E. Moore, D. Ramage, S. Hampson, and B. A. y. Arcas, “Communication-efficient learning of deep networks from decentralized data,” in Artificial Intelligence and Statistics. PMLR, 2017, pp. 1273–1282.arxiv.org/abs/1602.05629
- [11]D. C. Nguyen, M. Ding, P. N. Pathirana, A. Seneviratne, J. Li, and H. V. Poor, “Federated learning for Internet of things: A comprehensive survey,” IEEE Communications Surveys & Tutorials, vol. 23, no. 3, pp. 1622–1658, 2021.DOI
- [12]T. Li, A. K. Sahu, M. Zaheer, M. Sanjabi, A. Talwalkar, and V. Smith, “Federated optimization in heterogeneous networks,” Proceedings of Machine Learning and Systems, vol. 2, pp. 429–450, 2020.
- [13]Q. Lin, W. Liu, S. Zheng, J. Ji, K.-C. Wong, J. Li, and C. A. Coello Coello, “Federated intrusion detection system with cost-sensitive learning for internet of things,” IEEE Internet of Things Journal, vol. 12, no. 19, pp. 39 677–39 688, 2025.DOI
- [14]T. Hu, Q. Chen, Y. Hu, S. Hou, H. Yan, P. Yi, and Z. Cui, “Efficient and privacy-preserving network intrusion detection based on federated learning in SDN-enabled IIoT network,” IEEE Internet of Things Journal, vol. 12, no. 20, pp. 41 904–41 923, 2025.DOI
- [15]A. Abusitta, G. H. de Carvalho, O. A. Wahab, T. Halabi, B. C. Fung, and S. Al Mamoori, “Deep learning-enabled anomaly detection for IoT systems,” Internet of Things, vol. 21, p. 100656, 2023.
- [16]H. Huang, P. Wang, J. Pei, J. Wang, S. Alexanian, and D. Niyato, “Deep learning advancements in anomaly detection: A comprehensive survey,” IEEE Internet of Things Journal, vol. 12, no. 21, pp. 44 318–44 342, 2025.arxiv.org/abs/2503.13195
- [17]C. Ieracitano, A. Adeel, F. C. Morabito, and A. Hussain, “A novel statistical analysis and autoencoder driven intelligent intrusion detection approach,” Neurocomputing, vol. 387, pp. 51–62, 2020.
- [18]L. Ruff, J. R. Kauffmann, R. A. Vandermeulen, G. Montavon, W. Samek, M. Kloft, T. G. Dietterich, and K.-R. Müller, “A unifying review of deep and shallow anomaly detection,” Proceedings of the IEEE, vol. 109, no. 5, pp. 756–795, 2021.DOI
- [19]T.-A. Nguyen, L. T. Le, T. D. Nguyen, W. Bao, S. Seneviratne, C. S. Hong, and N. H. Tran, “Federated PCA on Grassmann manifold for IoT anomaly detection,” IEEE/ACM Transactions on Networking, vol. 32, no. 5, pp. 4456–4471, 2024.DOI
- [20]J. Donahue, P. Krähenbühl, and T. Darrell, “Adversarial feature learning,” in Proc. Int. Conf. Learn. Represent., 2017.arxiv.org/abs/1605.09782
- [21]X. Zhou, J. Wu, W. Liang, K. I.-K. Wang, Z. Yan, L. T. Yang, and Q. Jin, “Reconstructed graph neural network with knowledge distillation for lightweight anomaly detection,” IEEE Transactions on Neural Networks and Learning Systems, vol. 35, no. 9, pp. 11 817–11 828, 2024.DOI
- [22]R. Kalakoti, H. Bahsi, and S. Nõmm, “Synthetic data-driven explainability of federated learning-based intrusion detection system,” IEEE Internet of Things Journal, vol. 13, no. 4, pp. 5918–5944, 2026.DOI
- [23]D. H. Hoang and H. D. Nguyen, “A PCA-based method for IoT network traffic anomaly detection,” in 2018 20th International Conference on Advanced Communication Technology (ICACT). IEEE, 2018, pp. 381–386.
- [24]Z. Liu, H. Lv, X. Liu, C. Ma, F. Wu, L. Liu, and L. Cui, “Similarity and diversity: PCA-based contribution evaluation in federated learning,” IEEE Internet of Things Journal, vol. 12, no. 12, pp. 20 393–20 405, 2025.DOI
- [26]S. Boyd, N. Parikh, E. Chu, B. Peleato, and J. Eckstein, “Distributed optimization and statistical learning via the alternating direction method of multipliers,” Foundations and Trends in Machine Learning, vol. 3, no. 1, pp. 1–122, 2011.
- [27]X. Xiu, C. Huang, W. Zhang, and W. Liu, “Efficient personalized federated PCA with manifold optimization for IoT anomaly detection,” IEEE Internet of Things Journal, vol. 13, no. 16, pp. 37 252–37 262, 2026.
- [28]J. Liu, X. Ju, X. Xiu, and W. Liu, “Bi-level unsupervised feature selection with ℓ₂,₀-norm,” Pattern Recognition, p. 114687, 2026.DOI
- [29]X. Li, C. Huang, A. Yang, and X. Xiu, “Enhancing unsupervised feature selection via double sparsity constrained optimization,” Knowledge-Based Systems, p. 116924, 2026.
- [30]A. Ghubaish, Z. Yang, A. Erbad, and R. Jain, “LEMDA: A novel feature engineering method for intrusion detection in IoT systems,” IEEE Internet of Things Journal, vol. 11, no. 8, pp. 13 247–13 256, 2024.arxiv.org/abs/2404.16870
- [31]H. Zou, T. Hastie, and R. Tibshirani, “Sparse principal component analysis,” Journal of Computational and Graphical Statistics, vol. 15, no. 2, pp. 265–286, 2006.
- [32]M. Journée, Y. Nesterov, P. Richtárik, and R. Sepulchre, “Generalized power method for sparse principal component analysis,” Journal of Machine Learning Research, vol. 11, no. 15, pp. 517–553, 2010.
- [33]X. Dong, F. Nie, L. Tian, R. Wang, and X. Li, “Unsupervised discriminative feature selection with ℓ₂,₀-norm constrained sparse projection,” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 47, no. 10, pp. 8321–8335, 2025.DOI
- [34]Y. Zhu, X. Xiu, W. Liu, and C. Yin, “Joint sparse subspace clustering via fast ℓ₂,₀-norm constrained optimization,” Expert Systems with Applications, vol. 265, p. 125845, 2025.DOI
- [35]X. Xiu, Z. Miao, and W. Liu, “A practical-aware fault diagnosis framework focusing on accurate isolation,” IEEE Transactions on Industrial Informatics, vol. 19, no. 2, pp. 1356–1365, 2023.DOI
- [36]S. Chen, S. Ma, L. Xue, and H. Zou, “An alternating manifold proximal gradient method for sparse principal component analysis and sparse canonical correlation analysis,” INFORMS Journal on Optimization, vol. 2, no. 3, pp. 192–208, 2020.DOI
- [37]J. Li, S. Ma, and T. Srivastava, “A Riemannian alternating direction method of multipliers,” Mathematics of Operations Research, vol. 50, no. 4, pp. 3222–3242, 2025.DOI
- [38]A. Grammemos, R. Mendoza-Smith, J. Crowcroft, and C. Mascolo, “Federated principal component analysis,” in Advances in Neural Information Processing Systems, vol. 33, 2020, pp. 6453–6464.
- [39]K. Wang and Z. Song, “High-dimensional cross-plant process monitoring with data privacy: A federated hierarchical sparse PCA approach,” IEEE Transactions on Industrial Informatics, vol. 20, no. 3, pp. 4385–4396, 2024.DOI
- [40]W. Qu, H. Chen, X. Xiu, and W. Liu, “Distributed sparsity constrained optimization over the Stiefel manifold,” Neurocomputing, vol. 602, p. 128267, 2024.DOI
- [41]X. Xiao, Y. Li, Z. Wen, and L. Zhang, “A regularized semi-smooth Newton method with projection steps for composite convex programs,” Journal of Scientific Computing, vol. 76, no. 1, pp. 364–389, 2018.arxiv.org/abs/1603.07870
- [42]S. Zhou, N. Xiu, and H.-D. Qi, “Global and quadratic convergence of Newton hard-thresholding pursuit,” Journal of Machine Learning Research, vol. 22, no. 12, pp. 1–45, 2021.
- [43]G. E. Hinton and R. R. Salakhutdinov, “Reducing the dimensionality of data with neural networks,” Science, vol. 313, no. 5786, pp. 504–507, 2006.pubmed.ncbi.nlm.nih.gov/16873662
- [44]N. Moustafa and J. Slay, “UNSW-NB15: A comprehensive data set for network intrusion detection systems (UNSW-NB15 network data set),” in 2015 Military Communications and Information Systems Conference (MilCIS). IEEE, 2015, pp. 1–6.DOI
- [45]M. Tavallaee, E. Bagheri, W. Lu, and A. A. Ghorbani, “A detailed analysis of the KDD CUP 99 data set,” in 2009 IEEE Symposium on Computational Intelligence for Security and Defense Applications. IEEE, 2009, pp. 1–6.DOI
- [46]T. M. Booij, I. Chiscop, E. Meeuwissen, N. Moustafa, and F. T. Den Hartog, “ToN_IoT: The role of heterogeneous data and the need for standardization of features and attack types in IoT network intrusion data sets,” IEEE Internet of Things Journal, vol. 9, no. 1, pp. 485–496, 2022.







