Four-Class Classifier Overview
- Four-class classification is a system that assigns inputs to one of four exclusive classes using decision rules based on maximum probability or raw logits.
- Quantum implementations like QCNN and SWAP-Test leverage amplitude encoding, parameter-shift training, and specialized measurement mapping to achieve high accuracy.
- Classical methods such as OSELM and CASIMAC use multi-neuron outputs and simplex-based kernel techniques to deliver robust, calibrated performance.
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 -class scenarios, enabling both focused benchmarking and technical analysis of quantum and classical classifier architectures.
1. Formal Definition and Decision Rule
Let denote the input feature space and denote the set of possible labels. A four-class classifier is a function constructed so that for any , assigns a single label corresponding to the predicted class for . In probabilistic settings, the classifier may additionally output a vector of class probabilities with , and prediction is performed via .
The key performance metrics are classification accuracy, cross-entropy loss, and in some settings, calibration error (e.g., ECE for calibrated confidence estimation) (Heese et al., 2021). The prediction rule is thus
where 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" (Bokhan et al., 2022) and "Multi-Class Quantum Convolutional Neural Networks" (Mordacci et al., 2024), QCNNs for four classes process images as follows:
- Data Encoding: Amplitude encoding of a normalized vectorized image, often preprocessed by PCA to fit amplitudes into qubits (e.g., 256 features 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 (Bokhan et al., 2022) or by mapping computational basis states to the four classes (Mordacci et al., 2024).
- 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 ), QCNNs achieve test accuracies in the $85$-- range, narrowly trailing compact classical CNN baselines ($90$--) under matched parameter budgets (Bokhan et al., 2022, Mordacci et al., 2024).
SWAP-Test Based Multi-Class Classifiers
The Multi-Class SWAP-Test classifier (Pillay et al., 2023) applies the following scheme:
- Data and Label-State Encoding: Each sample is encoded as a quantum state via a feature map ; each class gets a fixed single-qubit "label state" whose Bloch vector 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 are weights computed from training overlaps.
- Decision Rule: Assign the class index maximizing the inner product .
- 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 accuracy; finite-sampling and depolarizing noise up to do not degrade accuracy (Pillay et al., 2023).
Polyadic Quantum Classifier
The Polyadic Quantum Classifier (Cappelletti et al., 2020) supports -class prediction with 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 class 0, ..., 11 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 accuracy (simulated QPU), compared to XGBoost at (Cappelletti et al., 2020).
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 output neurons (one-hot encoding). The only modified hyperparameters relative to binary or three-class settings are output dimension and initialization block size (Er et al., 2016). In this regime, each prediction is handled as where .
- Expected Accuracy: For moderate-scale four-class problems, OSELM achieves $80$-- accuracy, with millisecond-scale online updates and sub-millisecond prediction times (Er et al., 2016).
- Calibrated Simplex-Mapping Classifier (CASIMAC): Embeds the four labels as vertices of a regular tetrahedron ( 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 (Heese et al., 2021).
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 (Bokhan et al., 2022Mordacci et al., 2024) | Quantum NISQ | Ancilla or basis state → softmax 4-probabilities |
| SWAP-Test (Pillay et al., 2023) | Quantum NISQ | Label state tomography → vector inner product |
| Polyadic (Cappelletti et al., 2020) | Quantum NISQ | -qubit bitstring mapped to class index |
| OSELM (Er et al., 2016) | Classical online | 4 output neurons, decision |
| CASIMAC (Heese et al., 2021) | Classical, kernel | Closest simplex vertex in |
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 (Bokhan et al., 2022, Mordacci et al., 2024, Cappelletti et al., 2020). Adam is standard for classical parameter updates, with learning rates in and minibatch training.
- Classical Algorithms: Recursive least squares or direct kernel ridge/GPR fitting; no explicit learning rate (Er et al., 2016, Heese et al., 2021).
- Bayes-Optimality: In the quantum detection-theory framework, the four-class classifier is realized by optimizing a set of four projective or POVM measurements minimizing the average error (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 (Tiwari et al., 2018).
6. Performance, Robustness, and Scalability
- Four-Class QCNNs: Achieve $85$-- accuracy on subsets of MNIST (digits , ), with network sizes 200 trainable parameters and training regimes of 10--50 epochs (Bokhan et al., 2022, Mordacci et al., 2024).
- SWAP-Test Classifier: Yields $99$-- accuracy on ideal and noise-limited synthetic 4-class problems; is robust to depolarizing noise due to invariant angular assignment (Pillay et al., 2023).
- Polyadic Quantum Classifier: Attains on synthetic four-class data, with two-qubit circuits and no need for deep variational circuits (Cappelletti et al., 2020).
- Classical Baselines: OSELM achieves $80$-- across several real-world problems; CASIMAC matches kernel SVM and GPC accuracy while additionally providing calibrated confidence estimates (Er et al., 2016, Heese et al., 2021).
7. Technical and Practical Considerations
- Encoding Overhead: Amplitude encoding of high-dimensional classical features into qubits is bottlenecked by circuit complexity; PCA and dimensionality reduction are typically used to fit classical data into tractable numbers of qubits for quantum classifiers (Bokhan et al., 2022, Mordacci et al., 2024).
- 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 (Heese et al., 2021).
- 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 (Bokhan et al., 2022, Mordacci et al., 2024, Cappelletti et al., 2020, Pillay et al., 2023).
- Scalability: For all NISQ quantum schemes, increasing the class number typically requires either increased qubit count () or expanded measurement schemes; circuit compression and parameter-sharing techniques are discussed as possible improvements (Bokhan et al., 2022, Cappelletti et al., 2020).
References
- Multiclass classification using quantum convolutional neural networks with hybrid quantum-classical learning (Bokhan et al., 2022)
- Multi-Class Quantum Convolutional Neural Networks (Mordacci et al., 2024)
- Polyadic Quantum Classifier (Cappelletti et al., 2020)
- A Multi-Class SWAP-Test Classifier (Pillay et al., 2023)
- An Online Universal Classifier for Binary, Multi-class and Multi-label Classification (Er et al., 2016)
- Calibrated simplex-mapping classification (Heese et al., 2021)
- Multi-class Classification Model Inspired by Quantum Detection Theory (Tiwari et al., 2018)