---
title: Four-Class Classifier Overview
url: https://www.emergentmind.com/topics/four-class-classifier
type: topic
---

# Four-Class Classifier Overview

A four-class classifier is a classification algorithm designed to assign each input sample to one of exactly four mutually exclusive classes. This paradigm generalizes the binary classification scenario to a multiclass setting and is relevant across quantum and classical machine learning, signal processing, and information retrieval. Four-class classification exposes algorithmic and representational considerations distinct from either binary or general $N$-class scenarios, enabling both focused benchmarking and technical analysis of quantum and classical classifier architectures.

## 1. Formal Definition and Decision Rule

Let $X$ denote the input feature space and $Y = \{1,2,3,4\}$ denote the set of possible labels. A four-class classifier is a function $f: X \to Y$ constructed so that for any $x \in X$, $f(x)$ assigns a single label $y \in Y$ corresponding to the predicted class for $x$. In probabilistic settings, the classifier may additionally output a vector of class probabilities $p = [p_1, p_2, p_3, p_4]$ with $\sum p_i = 1$, and prediction is performed via $f(x) = \arg\max_{i=1}^4 p_i$.

The key performance metrics are classification accuracy, cross-entropy loss, and in some settings, calibration error (e.g., ECE for calibrated confidence estimation) [2103.02926]. The prediction rule is thus
$$
\hat{y} = \arg\max_{i=1,2,3,4} s_i(x)
$$
where $s_i(x)$ is either a raw logit or a probability for each class.

## 2. Quantum Classifier Architectures for Four Classes

Quantum machine learning has produced multiple families of four-class classifiers tailored to NISQ-era hardware, notably the Quantum Convolutional Neural Network (QCNN) and the SWAP-Test Classifier.

### Quantum Convolutional Neural Networks (QCNN)

In "Multiclass classification using quantum convolutional neural networks with hybrid quantum-classical learning" [2203.15368] and "Multi-Class Quantum Convolutional Neural Networks" [2404.12741], QCNNs for four classes process images as follows:

- **Data Encoding:** Amplitude encoding of a normalized vectorized image, often preprocessed by PCA to fit $2^n$ amplitudes into $n$ qubits (e.g., 256 features $\to$ 8 qubits).
- **Circuit Architecture:** Layered quantum circuits with convolutional (single- and multi-qubit gates) and pooling (qubit reduction via entangling gates or tracing out) stages, ultimately mapping data qubits to a set of two or more measured qubits.
- **Measurement and Output:** Final measured qubits yield a four-dimensional readout, either one-hot via ancillas [2203.15368] or by mapping computational basis states $|00\rangle,|01\rangle,|10\rangle,|11\rangle$ to the four classes [2404.12741].
- **Training Objective:** Classical softmax and cross-entropy loss over output probabilities, with parameters updated by the parameter-shift rule and optimizers such as Adam.
- **Numerical Results:** On PCA-reduced MNIST (digits $\{0,1,2,3\}$), QCNNs achieve test accuracies in the $85$--$93\%$ range, narrowly trailing compact classical CNN baselines ($90$--$97\%$) under matched parameter budgets [2203.15368, 2404.12741].

### SWAP-Test Based Multi-Class Classifiers

The Multi-Class SWAP-Test classifier [2302.02994] applies the following scheme:

- **Data and Label-State Encoding:** Each sample is encoded as a quantum state via a feature map $U_{\Phi}(x)$; each class $i$ gets a fixed single-qubit "label state" $|\ell_i\rangle$ whose Bloch vector $y_i$ is placed as one vertex of the Tammes-optimal tetrahedron on the Bloch sphere.
- **Circuit Topology:** Utilizes a modified SWAP-test on two data registers, a label qubit, an ancilla, and an index register for training samples.
- **Measurement and Assignment:** Single-qubit tomography on the label register yields a vector $y_{\mathrm{pred}} = \sum_{i=1}^4 \alpha_i y_i; \ \alpha_i$ are weights computed from training overlaps.
- **Decision Rule:** Assign the class index maximizing the inner product $y_i \cdot y_{\mathrm{pred}}$.
- **Noise Robustness:** The scheme is invariant to depolarizing noise on the label qubit, as the predicted vector uniformly shrinks but angular relations are preserved unless label-vectors become non-separable.
- **Empirical Results:** On 4-XOR synthetic data, ideal simulations yield $100\%$ accuracy; finite-sampling and depolarizing noise up to $p=0.1$ do not degrade accuracy [2302.02994].

### Polyadic Quantum Classifier

The Polyadic Quantum Classifier [2007.14044] supports $2^N$-class prediction with $N$ measured qubits. For four-class problems:

- **Circuit:** 2 entangled qubits with repeated data encoding, entangling, and trainable rotation blocks.
- **Output Mapping:** Measurement in the computational basis; bitstrings mapped to class indices (00 $\rightarrow$ class 0, ..., 11 $\rightarrow$ class 3).
- **Loss and Optimization:** Mini-batch cross-entropy loss, parameter-shift and gradient-free optimizers.
- **Numerical Results:** On a 2D four-Gaussian benchmark, achieves $85\% \pm 2.8\%$ accuracy (simulated QPU), compared to XGBoost at $88\%$ [2007.14044].

## 3. Classical Four-Class Classifier Methodologies

Four-class classification in classical learning typically leverages well-established architectures with minimal adaptation:

- **Online Universal Classifier (OSELM):** An online sequential Extreme Learning Machine with $L=4$ output neurons (one-hot encoding). The only modified hyperparameters relative to binary or three-class settings are output dimension and initialization block size [1609.00843]. In this regime, each prediction is handled as $\hat{j} = \arg\max_{j=1,\ldots,4} \hat{y}_j$ where $\hat{y} = \beta^T h(x)$.
- **Expected Accuracy:** For moderate-scale four-class problems, OSELM achieves $80$--$95\%$ accuracy, with millisecond-scale online updates and sub-millisecond prediction times [1609.00843].

- **Calibrated Simplex-Mapping Classifier (CASIMAC):** Embeds the four labels as vertices of a regular tetrahedron ($\mathbb{R}^3$ simplex), mapping data to the corresponding simplex region via k-nearest-neighbor attraction/repulsion and kernel ridge or Gaussian process regression. Predictions are given by the closest vertex in latent space; confidence is provided by Monte Carlo estimation of the Gaussian probability mass within each class-region [2103.02926].

## 4. Comparative Table of Representative Four-Class Classifiers

Below is a summary of classifier type, quantum/classical regime, and characteristic features (restricted to explicit content in the provided data).

| Classifier                       | Regime            | Output/Decision Scheme                           |
|:----------------------------------|:------------------|:-------------------------------------------------|
| QCNN ([2203.15368],[2404.12741])  | Quantum NISQ      | Ancilla or basis state → softmax 4-probabilities |
| SWAP-Test ([2302.02994])          | Quantum NISQ      | Label state tomography → vector inner product     |
| Polyadic ([2007.14044])           | Quantum NISQ      | $N$-qubit bitstring mapped to class index         |
| OSELM ([1609.00843])              | Classical online  | 4 output neurons, $\arg\max_j$ decision           |
| CASIMAC ([2103.02926])            | Classical, kernel | Closest simplex vertex in $\mathbb{R}^3$         |

## 5. Optimization, Training, and Theoretical Properties

- **Optimization in Quantum Models:** Parameter-shift rule for gradient estimation dominates, leveraging two-point evaluations for efficient, hardware-compatible training [2203.15368, 2404.12741, 2007.14044]. Adam is standard for classical parameter updates, with learning rates in $[5\times10^{-5},\,10^{-2}]$ and minibatch training.
- **Classical Algorithms:** Recursive least squares or direct kernel ridge/GPR fitting; no explicit learning rate [1609.00843, 2103.02926].
- **Bayes-Optimality:** In the quantum detection-theory framework, the four-class classifier is realized by optimizing a set of four projective or POVM measurements $\{\Pi_k\}$ minimizing the average error $R$ (Helstrom bound). This yields a classifier reducing to classical one-vs-rest in the commuting case but admits strictly lower average risk with quantum-encoded or entangled class/states [1810.04491].

## 6. Performance, Robustness, and Scalability

- **Four-Class QCNNs:** Achieve $85$--$93\%$ accuracy on subsets of MNIST (digits $\{0,1,2,3\}$, $\{3,4,5,6\}$), with network sizes $<$200 trainable parameters and training regimes of 10--50 epochs [2203.15368, 2404.12741].
- **SWAP-Test Classifier:** Yields $99$--$100\%$ accuracy on ideal and noise-limited synthetic 4-class problems; is robust to depolarizing noise due to invariant angular assignment [2302.02994].
- **Polyadic Quantum Classifier:** Attains $85\% \pm 2.8\%$ on synthetic four-class data, with two-qubit circuits and no need for deep variational circuits [2007.14044].
- **Classical Baselines:** OSELM achieves $80$--$95\%$ across several real-world problems; CASIMAC matches kernel SVM and GPC accuracy while additionally providing calibrated confidence estimates [1609.00843, 2103.02926].

## 7. Technical and Practical Considerations

- **Encoding Overhead:** Amplitude encoding of high-dimensional classical features into $n$ qubits is bottlenecked by $O(2^n)$ circuit complexity; PCA and dimensionality reduction are typically used to fit classical data into tractable numbers of qubits for quantum classifiers [2203.15368, 2404.12741].
- **Readout and Calibration:** Direct mapping of measurement outcomes to class indices ensures hardware efficiency in both Polyadic and QCNN architectures. Methods such as CASIMAC provide explicit statistical calibration via simplex-based geometries and kernel regression [2103.02926].
- **NISQ Suitability:** Quantum architectures (QCNN, Polyadic, SWAP-Test) are explicitly designed to constrain circuit depth and qubit count, employing repeated pooling, sparse multi-qubit gates, and data-reuploading [2203.15368, 2404.12741, 2007.14044, 2302.02994].
- **Scalability:** For all NISQ quantum schemes, increasing the class number $L$ typically requires either increased qubit count ($n = \lceil\log_2 L\rceil$) or expanded measurement schemes; circuit compression and parameter-sharing techniques are discussed as possible improvements [2203.15368, 2007.14044].

## References

- Multiclass classification using quantum convolutional neural networks with hybrid quantum-classical learning [2203.15368]
- Multi-Class Quantum Convolutional Neural Networks [2404.12741]
- Polyadic Quantum Classifier [2007.14044]
- A Multi-Class SWAP-Test Classifier [2302.02994]
- An Online Universal Classifier for Binary, Multi-class and Multi-label Classification [1609.00843]
- Calibrated simplex-mapping classification [2103.02926]
- Multi-class Classification Model Inspired by Quantum Detection Theory [1810.04491]

Source: https://www.emergentmind.com/topics/four-class-classifier