Inferensys

Glossary

K-Means Clustering

An unsupervised machine learning algorithm that partitions received IQ samples into a predefined number of clusters by iteratively minimizing the within-cluster sum of squares, enabling blind estimation of the transmitted constellation points.
ML engineer managing model training cluster on laptop, GPU utilization visible, technical deep learning setup.
UNSUPERVISED CONSTELLATION LEARNING

What is K-Means Clustering?

K-Means clustering is an unsupervised machine learning algorithm that partitions received IQ samples into a predefined number of clusters by iteratively minimizing the within-cluster sum of squares, enabling blind estimation of transmitted constellation points without prior knowledge of the modulation format.

K-Means clustering operates on raw IQ samples by randomly initializing K centroids in the complex plane and iteratively refining their positions. Each received symbol is assigned to the nearest centroid based on Euclidean distance, after which centroids are recalculated as the geometric mean of their assigned points. This process converges when centroid movement falls below a threshold, yielding estimated constellation points that directly correspond to the transmitter's symbol map.

In automatic modulation classification, K-Means serves as a blind centroid estimation technique that reconstructs the constellation geometry without requiring pilot symbols or prior knowledge. The algorithm's performance degrades under phase ambiguity and carrier frequency offset, necessitating preprocessing compensation. The number of clusters K must be specified a priori or determined via validation metrics, making it most effective when the modulation order is approximately known or bounded.

BLIND CONSTELLATION RECOVERY

Key Characteristics of K-Means in Signal Processing

K-Means clustering serves as a foundational unsupervised learning technique for partitioning raw IQ samples into distinct groups, enabling the blind estimation of transmitted constellation points without prior knowledge of the modulation scheme.

01

Centroid Initialization Strategies

The selection of initial cluster centers critically impacts convergence speed and the quality of the recovered constellation. Random initialization can lead to suboptimal local minima, while K-Means++ intelligently spreads initial centroids across the IQ plane to improve consistency. In signal processing, domain-specific initialization using constant modulus pre-scaling or angular histogram peaks often outperforms generic methods by leveraging the geometric structure of digital modulations.

02

Within-Cluster Sum of Squares (WCSS) Minimization

The core objective function, often called inertia, quantifies the compactness of clusters by summing the squared Euclidean distances between each IQ sample and its assigned centroid. The algorithm iteratively executes two steps:

  • Assignment Step: Each sample is assigned to the nearest centroid, forming Voronoi regions.
  • Update Step: Centroids are recomputed as the arithmetic mean of all samples in their region. This process monotonically decreases WCSS until convergence, effectively acting as a blind minimum-distance decoder.
03

Handling Phase Ambiguity and Rotation

A raw K-Means output recovers the relative geometry of the constellation but not its absolute phase orientation. The resulting cluster centers will exhibit an arbitrary fixed rotational offset. This phase ambiguity is typically resolved in post-processing by:

  • Computing the fourth-power phase estimator for QPSK-like symmetries.
  • Aligning the recovered centroids with a known unique word or pilot sequence.
  • Applying differential decoding to render the absolute rotation irrelevant.
04

Determining the Optimal K Value

The number of clusters K corresponds to the modulation order M (e.g., K=4 for QPSK, K=16 for 16-QAM). When M is unknown, it is estimated using validation metrics:

  • Elbow Method: Plotting WCSS against increasing K to identify the point of diminishing returns.
  • Silhouette Analysis: Measuring how similar a sample is to its own cluster compared to neighboring clusters.
  • Gap Statistic: Comparing the WCSS curve to its expectation under a null reference distribution of the data.
05

Sensitivity to Noise and Outliers

K-Means is inherently sensitive to additive white Gaussian noise (AWGN) and impulsive outliers because the squared Euclidean distance heavily penalizes large deviations. A single high-noise sample can significantly skew a centroid estimate. Mitigation strategies include:

  • Preprocessing with a median filter to suppress impulse noise.
  • Using K-Medoids, which selects actual data points as centers, for improved robustness.
  • Applying data cleaning to discard samples with an EVM exceeding a statistical threshold before clustering.
06

Computational Complexity and Real-Time Use

The standard Lloyd's algorithm has a complexity of O(n * K * d * i), where n is the number of IQ samples, d is the dimensionality (2 for IQ data), and i is the number of iterations. For real-time spectrum classification, this can be prohibitive. Acceleration techniques include:

  • Mini-batch K-Means, which processes random subsets of samples per iteration.
  • Triangle inequality acceleration (Elkan's algorithm) to skip unnecessary distance calculations.
  • Hardware implementation on FPGAs using parallel distance computation pipelines.
K-MEANS CLUSTERING FOR SIGNAL CONSTELLATIONS

Frequently Asked Questions

Answers to common questions about applying unsupervised K-Means clustering to blind modulation recognition and constellation estimation in digital communication systems.

K-Means clustering is an unsupervised machine learning algorithm that partitions received IQ samples into a predefined number of clusters by iteratively minimizing the within-cluster sum of squares, enabling blind estimation of the transmitted constellation points. In the context of signal constellation classification, the algorithm treats each received complex baseband sample as a point in the two-dimensional IQ plane and groups these points into K clusters, where K corresponds to the hypothesized modulation order (e.g., K=4 for QPSK, K=16 for 16-QAM). The algorithm alternates between an assignment step, where each IQ sample is assigned to the nearest centroid based on Euclidean distance, and an update step, where each centroid is recalculated as the mean of all samples assigned to it. This process converges when the centroid locations stabilize, yielding estimated constellation point positions that can be compared against a library of ideal reference constellations for modulation identification. Unlike supervised deep learning approaches, K-Means requires no labeled training data, making it valuable for blind modulation recognition in cognitive radio and spectrum monitoring applications where the transmitter's modulation scheme is unknown a priori.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.