A confusion matrix is a tabular visualization of a classification model's performance where each row represents the instances in an actual class, and each column represents the instances in a predicted class. The diagonal elements count correct classifications, while off-diagonal elements reveal specific misclassification patterns between different modulation types.
Glossary
Confusion Matrix

What is a Confusion Matrix?
A confusion matrix is a specific table layout that allows visualization of the performance of a supervised learning algorithm, typically a classifier, by displaying the counts of correct and incorrect predictions broken down by each actual class.
For automatic modulation classification, the matrix quantifies how often a QPSK signal is mistaken for 16QAM versus BPSK, providing granular error analysis beyond simple accuracy. Derived metrics like precision, recall, and F1-score are computed directly from the matrix's true positives, false positives, and false negatives to evaluate classifier robustness under varying signal-to-noise ratios.
Key Metrics Derived from the Confusion Matrix
The confusion matrix is a raw tabulation of predictions versus actual classes. The following scalar metrics are derived from its cell counts to provide a concise, objective assessment of a modulation classifier's performance.
Accuracy
The most intuitive metric, representing the ratio of correct predictions to the total number of predictions. It is calculated as (TP + TN) / (TP + TN + FP + FN). While useful for balanced datasets, accuracy can be highly misleading in scenarios with class imbalance, such as when one modulation scheme dominates the spectrum. A high accuracy score might simply reflect the classifier's ability to guess the majority class.
Precision (Positive Predictive Value)
Precision answers: Of all signals classified as a specific modulation, how many actually were that modulation? It is the ratio of True Positives (TP) to the sum of True Positives and False Positives (TP + FP). High precision is critical in electronic warfare or spectrum enforcement, where a false positive (misidentifying a friendly signal as a threat, or a legal signal as illegal) triggers costly, incorrect actions.
Recall (Sensitivity or True Positive Rate)
Recall answers: Of all actual signals of a given modulation, how many did the classifier correctly identify? It is the ratio of True Positives (TP) to the sum of True Positives and False Negatives (TP + FN). High recall is vital in signal intelligence (SIGINT), where missing an instance of a target signal (a false negative) means a complete failure to detect a potentially critical transmission.
F1 Score
The harmonic mean of Precision and Recall, providing a single balanced metric that penalizes extreme trade-offs. Calculated as 2 * (Precision * Recall) / (Precision + Recall). The F1 score is the preferred metric when you seek a balance between avoiding false alarms (Precision) and missing real signals (Recall), and it is especially robust on datasets with uneven class distributions.
Specificity (True Negative Rate)
Specificity answers: Of all signals that are NOT a target modulation, how many were correctly rejected? It is the ratio of True Negatives (TN) to the sum of True Negatives and False Positives (TN + FP). In spectrum monitoring, high specificity ensures that the classifier does not constantly raise false alarms by incorrectly labeling benign background noise or other known signals as the target modulation of interest.
Macro vs. Weighted Averaging
For multi-class problems like modulation recognition, per-class metrics must be aggregated. Macro-averaging computes the metric independently for each class and takes the unweighted mean, treating all modulation schemes equally. Weighted averaging computes the mean weighted by each class's true support (number of instances), giving more influence to frequently occurring modulations. The choice depends on whether rare signal types are as important as common ones.
Frequently Asked Questions
A confusion matrix is the foundational diagnostic tool for evaluating automatic modulation classification (AMC) performance. It provides a granular, class-by-class breakdown of correct and incorrect predictions, revealing not just overall accuracy but the specific types of confusion occurring between modulation schemes in a cognitive radio system.
A confusion matrix is a tabular visualization that displays the performance of a classification algorithm by counting the number of correct and incorrect predictions for each actual modulation class. In automatic modulation classification (AMC), the rows of the matrix represent the true transmitted modulation scheme (e.g., QPSK, 16QAM, 64QAM), while the columns represent the classifier's predicted modulation type. Each cell C_{i,j} contains the count of instances where a signal of true class i was classified as class j. The main diagonal contains correct classifications (true positives), while off-diagonal elements represent specific misclassifications. For example, a cell at row '16QAM' and column '64QAM' quantifies how often a 16QAM signal is mistaken for 64QAM, providing critical insight into the classifier's discriminative weaknesses in the signal constellation space.
Confusion Matrix vs. Other Evaluation Metrics
Comparing the diagnostic depth and applicability of the confusion matrix against aggregate metrics for modulation classification evaluation.
| Feature | Confusion Matrix | Accuracy | ROC Curve |
|---|---|---|---|
Per-class error analysis | |||
Aggregate performance summary | |||
Visualizes class confusion pairs | |||
Threshold-invariant evaluation | |||
Handles multi-class natively | |||
Identifies specific misclassifications | |||
Computational simplicity | O(n_classes²) | O(1) | O(n_thresholds) |
Suitable for imbalanced data |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Essential metrics and visual tools derived from or closely related to the confusion matrix for evaluating modulation classifier performance.
Receiver Operating Characteristic (ROC) Curve
A graphical plot illustrating the diagnostic ability of a binary classifier by mapping the True Positive Rate (TPR) against the False Positive Rate (FPR) as the decision threshold varies. For modulation classification, ROC curves are often generated per class using a one-vs-all approach. The Area Under the Curve (AUC) provides a single scalar value summarizing performance: an AUC of 1.0 indicates perfect separation, while 0.5 represents random guessing. This tool is essential for selecting operating points that balance sensitivity and specificity in signal identification systems.
Precision and Recall
Two fundamental per-class metrics derived directly from confusion matrix cell counts. Precision answers: 'Of all signals predicted as Class X, what fraction truly belong to Class X?' It is calculated as TP / (TP + FP). Recall answers: 'Of all true Class X signals, what fraction did the classifier correctly identify?' It is calculated as TP / (TP + FN). In spectrum monitoring, high precision minimizes false alarms, while high recall ensures few threat signals are missed. The F1-Score provides the harmonic mean of the two for a balanced single metric.
Cohen's Kappa Coefficient
A statistical measure of inter-rater agreement that accounts for the possibility of agreement occurring by chance. Unlike simple accuracy, Cohen's Kappa provides a more robust picture by subtracting the expected accuracy of a random classifier. The formula is κ = (p_o - p_e) / (1 - p_e), where p_o is observed agreement and p_e is expected agreement. Values range from -1 to 1:
- κ = 1: Perfect agreement
- κ = 0: Agreement equivalent to chance
- κ < 0: Agreement worse than random This is critical when evaluating classifiers on imbalanced modulation datasets.
Symbol Error Rate (SER)
The probability that a detected symbol differs from the transmitted symbol. In the context of a confusion matrix for modulation classification, SER is the sum of all off-diagonal elements divided by the total number of test samples. For a given modulation scheme M, the SER is 1 - (TP_M / Total_M). This metric is fundamental for evaluating the raw physical-layer performance of a classifier and is often plotted against Signal-to-Noise Ratio (SNR) to generate performance curves that reveal the SNR threshold required for reliable operation.
Normalized Confusion Matrix
A transformation of the raw confusion matrix where each cell is divided by the total number of true samples for its corresponding class. This produces row-wise proportions that sum to 1.0, revealing the conditional probability P(Predicted Class | True Class). Normalization is essential when classes are imbalanced—for example, when QPSK signals appear 100x more often than 256-QAM in a dataset. It prevents the visual representation from being dominated by high-prevalence classes and exposes systematic confusion patterns, such as a classifier frequently mistaking 16-QAM for 64-QAM.
Macro vs. Micro Averaging
Two strategies for aggregating per-class metrics into a single global score. Macro-averaging computes the metric independently for each class and then takes the unweighted mean, treating all modulation schemes equally regardless of their frequency. Micro-averaging aggregates the contributions of all classes by summing the individual true positives, false positives, and false negatives globally before computing the metric. Micro-averaging is dominated by frequent classes, while macro-averaging reveals how well the classifier handles rare modulation types. The choice depends on whether all signal types are equally important.

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us