Skip to content
indibiPublic

About

Repository of Grouped outlier Robust Higher-order PCA model implementations and related experiments.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

9 Commits

Folders and files

Repository files navigation

Higher-order Grouped Outlier Robust PCA

Introduction

This repository organizes the Higher-order Grouped Outlier Robust Principal Component Analysis (HoGORPCA) model implementations and anomaly detection experiments performed in [SIGPRO] and [SSP_2025]. The family of HoGORPCA models, which refer with $\mathrm{[SNN]-[LOGN+GTV]}$, extend traditional Sparse $(\mathcal{S})$ + Low-rank $(\mathcal{X})$ tensor decomposition models, by incorporating the topological structure of spatial, temporal domains into the regularization of the sparse outliers $(\mathcal{S})$. Conventional tensor decomposition models usually only use Lasso penalty ($\ell_1$ norm) to regulate the sparsity of $(\mathcal{S})$ and neglects the modeling of likely grouped behavior of the outliers such as occurring in contiguous time segments. This is illustrated in Figure 1 (Image taken from canyiliu TRPCA github page).

Figure 1: Robust Tensor PCA, tensor decomposition model.

Proposed domain topology aware robust tensor decomposition models, under the $\mathrm{[SNN]-[LOGN+GTV]}$ umbrella incorporates the structure of the spatial, temporal domains into the tensor decomposition with graphs, and enhances the tensor decompositions' performance with the detection of grouped (spatially or temporally) outliers. We use two structured sparsity promoting penalties, namely Latent Overlapping Grouped Norms and Graph Total Variation, both defined through a graph, extending the naive Lasso $\ell_1$ penalty used in Robust Tensor Decomposition frameworks.

Figure 2: Example illustration of a spatial proximity graph and temporal line graph connecting consecutive time points $\mathfrak{G}_S, \mathfrak{G}_T$ along with their product graph $\mathfrak{G}_ST$.

The extension of $\ell_1$ norm regularizer to include spatial information through $[\mathrm{LOGN(S-E)}]$ (Spatial edge), $[\mathrm{LOGN(S-N)}]$ (Spatial neighborhood), and $[\mathrm{LOGN(S-N)+GTV(S)}]$ looks like below in action.

Figure 3: Visualization of the anomaly scores obtained for Urban-1 scene from [ABU HSI]. Top row (from left to right): Pseudo-RGB view of the scene, anomaly scores obtained by HoRPCA, anomaly scores obtained by L1 + GTV(S), Precision-Recall Curves. Bottom row (from left to right): Anomaly Labels, LOGN(S-E), LOGN(S-N), ROC Curves.

We illustrate the effects of the GTV and LOGN regularizations, we apply the regularizations on recovering two different temporally grouped anomaly segments.

Figure 4: LOGN and GTV regularizers applied to recover a noisy temporal signal with two grouped anomalies, namely Coherent anomaly with coherent signs and Incoherent anomaly with incoherent, non-smooth signs. LOGN is better at recovering Inoherent anomaly segments whereas GTV is better at recovering the Coherent ones due to the smoothing effect of GTV regularizer.

Model Implementations

The implementations of the Higher-Order Grouped Outlier Robust PCA models can be found in ./src/models/lr_ssd/ folders. Within this folder,

  • snn__logn_gtv.py contains $\mathrm{[SNN]-[LOGN+GTV]}$ model implementation
  • snn_logs.py contains $\mathrm{[SNN]-[LOGN]}$ model implementation.

The Singleton implementation of Higher-order Robust PCA ($\mathrm{HoRPCA}$) model can be found in ./src/models/horpca/horpca_torch.py

📝 Note: $\mathrm{[SNN]+[LOGN+GTV]}$ can be considered a generalization of $\mathrm{[SNN]-[LOGN]}$ and $\mathrm{HoRPCA}$ algorithms. Consequently, $\mathrm{[SNN]+[LOGN+GTV]}$ model with the hyper-parameters and groupings are chosen accordingly specializes to $\mathrm{HoRPCA}$ and $\mathrm{[SNN]-[LOGN]}$. We often called on the $\mathrm{[SNN]+[LOGN+GTV]}$ implementation with the corresponding settings for convenience instead of calling the implementations in snn_logs.py or horpca_torch.py.

I intend to upload more user friendly versions of these implementations in my t-regs repository.

Experiment Results and Setup

Example applications, experiment and experiment processes can be found in ./experiment_board/ folder for the publications [1,2] under the following structre:

  1. Higher-order Grouped Outlier Robust PCA with Graph Total Variation (SIGPRO)
    1. Synthetic Experiments: The details of the experiment, the hyper-parameter selection scripts and the results can be found in ./experiment_board/anomaly_detection_synthetic_exps/.
    2. NYC Event Detection and SMD Anomaly Detection Experiments: Dataset loader python scripts and classes can be found in ./data/nyc_taxi_dataset.py and ./data/server_machine_dataset.py folders. Dataset pre-processing steps and experiment scripts along with the results can be found in ./experiment_board/anomaly_detection_real_data_exps/. Specifically, ./experiment_board/anomaly_detection_real_data_exps/smd_and_nyc_pipeline.ipynb holds the crucial data processing and anomaly detection pipeline.
  2. Higher-order Grouped Outlier Robust PCA SSP_2025 The experiment scripts and the configurations can be found in ./experiment_board/lr_sparse_identifiability_exps/. Please refer to the README.md file in the folder. The synthetic experiment results for this publication are also organized in Experiment report

References

  • [SIGPRO]: Indibi, M., Aviyente, S. (2025). “Spatio-temporal Anomaly Detection: A Regularized Robust Tensor Decomposition with Graph Total Variation and Grouped Sparsity”, Under revision at EURASIP Journal of Signal Processing
  • [SSP_2025]: Indibi, M., & Aviyente, S. (2025, June). Higher-Order Grouped Outlier Robust PCA for Spatio-temporal Anomaly Detection. In 2025 IEEE Statistical Signal Processing Workshop (SSP) (pp. 176-180). IEEE.
  • ABU Hyperspectral Image

Contributors

Mert Indibi

About

Repository of Grouped outlier Robust Higher-order PCA model implementations and related experiments.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages