# The Flag Median and FlagIRLS

arXiv: https://arxiv.org/abs/2203.04437 · HTML: https://mlsanity.com/paper/2203.04437/

## Key facts

- Cited by 9 papers in the map (data through 14 Oct 2026).
- Builds on 4 of its 24 references that are in the map.
- First posted on arXiv 8 Mar 2022.

## Builds on (most cited first, 4 of 4)

- [Riemannian SVRG: Fast Stochastic Optimization on Riemannian Manifolds](https://mlsanity.com/paper/1605.07147/) (2016)
- [Kernel Methods on Riemannian Manifolds with Gaussian RBF Kernels](https://mlsanity.com/paper/1412.0265/) (2014)
- [Grassmannian Learning: Embedding Geometry Awareness in Shallow and Deep Learning](https://mlsanity.com/paper/1808.02229/) (2018)
- [Non-Linear Temporal Subspace Representations for Activity Recognition](https://mlsanity.com/paper/1803.11064/) (2018)

## Built on by (most cited first, 9 of 9)

- [Chordal Averaging on Flag Manifolds and Its Applications](https://mlsanity.com/paper/2303.13501/) (2023)
- [Fun with Flags: Robust Principal Directions via Flag Manifolds](https://mlsanity.com/paper/2401.04071/) (2024)
- [Deep Hierarchical Learning with Nested Subspace Networks for Large Language Models](https://mlsanity.com/paper/2509.17874/) (2025)
- [Nested subspace learning with flags](https://mlsanity.com/paper/2502.06022/) (2025)
- [A Flag Decomposition for Hierarchical Datasets](https://mlsanity.com/paper/2502.07782/) (2025)
- [Robustness of Generalized Median Computation for Consensus Learning in Arbitrary Spaces](https://mlsanity.com/paper/2503.05215/) (2025)
- [Flag Aggregator: Scalable Distributed Training under Failures and Augmented Losses using Convex Optimization](https://mlsanity.com/paper/2302.05865/) (2023)
- [A Granular Grassmannian Clustering Framework via the Schubert Variety of Best Fit](https://mlsanity.com/paper/2512.23766/) (2025)
- [Robust conditional dimension reduction for dissimilarity data](https://mlsanity.com/paper/2609.06284/) (2026)

## Abstract (arXiv)

Finding prototypes (e.g., mean and median) for a dataset is central to a number of common machine learning algorithms. Subspaces have been shown to provide useful, robust representations for datasets of images, videos and more. Since subspaces correspond to points on a Grassmann manifold, one is led to consider the idea of a subspace prototype for a Grassmann-valued dataset. While a number of different subspace prototypes have been described, the calculation of some of these prototypes has proven to be computationally expensive while other prototypes are affected by outliers and produce highly imperfect clustering on noisy data. This work proposes a new subspace prototype, the flag median, and introduces the FlagIRLS algorithm for its calculation. We provide evidence that the flag median is robust to outliers and can be used effectively in algorithms like Linde-Buzo-Grey (LBG) to produce improved clusterings on Grassmannians. Numerical experiments include a synthetic dataset, the MNIST handwritten digits dataset, the Mind's Eye video dataset and the UCF YouTube action dataset. The flag median is compared the other leading algorithms for computing prototypes on the Grassmannian, namely, the ℓ2-median and to the flag mean. We find that using FlagIRLS to compute the flag median converges in 4 iterations on a synthetic dataset. We also see that Grassmannian LBG with a codebook size of 20 and using the flag median produces at least a 10% improvement in cluster purity over Grassmannian LBG using the flag mean or ℓ2-median on the Mind's Eye dataset.
