3.1. The Architecture Schema—Process and Structure
An overview of the complete pipeline, from data collection to the final classification, is provided before examining each component in detail.
Figure 1 illustrates the end-to-end methodology that was used for the prediction of stress, depicting the complete transformation sequence from raw data set to the classification output.
Figure 1 details how each stage operates for both classical and quantum computations. For consistency, the same pipeline was implemented for both noisy and noiseless quantum simulations. The process started at the point of gathering the data. The data collection had all of the participant’s individual information, physiological attributes, and the class label for each record.
Data preparation constituted the next stage, comprising nine separate preprocessing steps applied to all classifiers in order to ensure a fair comparison and reliable results. Once the training data had been cleaned up, it was passed to the classification methods. Hyperparameter testing became possible through this particular sequence.
In the testing phase, both the quantum and classical classifiers were evaluated on the held-out data to identify which models produced the highest accuracy and metrics. In total, seven classical and three quantum classifiers were studied; each quantum classifier was evaluated under both noisy and noiseless simulations. Thirteen configurations—seven classical and six quantum (three classifiers × noiseless/noisy)—were compared, yielding the best-performing configurations for this data set. The experimental results reflect the true performance characteristics of the model. These results were compared to help validate additional observations related to how long it took to sort and how accurate the classification was.
3.2. The Data Set
The empirical study was based on a data set created by Iqbal et al. to examine the physiological effects of stress [
61]. Since stress produces measurable physiological changes, the Empatica E4 wearable device was utilized to capture these signals. Data related to heart rate and breathing rates were collected during times of stress, as these measures reflect the physiological responses to stress. The Empatica E4 is a research-grade, wrist-worn device incorporating four sensors integrated into it, including a PPG sensor to measure the blood volume pulse in order to determine heart rate; a three-axis accelerometer to measure movement and orientation of the wrist; an electrodermal-activity (EDA) sensor; and an infrared (IR) temperature sensor to measure skin temperature. The two variables that were utilized as predictors for this project were heart rate and respiratory rate. Respiratory rates were determined using the raw PPG waveform [
62]. There is an important difference between how ECG data and PPG data are processed. ECG signals are derived from electrodes placed on the chest, provide high temporal resolution, and directly measure the heart’s electrical activity. PPG, on the other hand, indirectly measures both cardiac and respiratory cycles via optical means. It is also more susceptible to artifacts due to movement or perfusion issues at the measurement site. Therefore, this study was specifically designed to assess the low-fidelity, unobtrusive, and consumer-style wearable format as opposed to the high-fidelity ECG format. High-fidelity ECG is the clinical format most relevant to assessing physiological responses to stress continuously in an individual’s daily environment.
Thirty-five healthy participants, ranging in age from 18 to 75 years, volunteered for the research study and wore an Empatica E4. A broad age range was intentionally sought. Women who were breastfeeding and pregnant, as well as color-blind individuals, were excluded from the research, as these characteristics could introduce uncontrolled variability. Color-blind participants were excluded because the Stroop Color–Word Test requires accurate discrimination of the colors; this inability to perform this test invalidates the stress stimulus rather than reflecting the physiological stress response. Similarly, pregnant and breastfeeding women were also excluded in order to avoid introducing uncontrolled variations in autonomic and cardiovascular variability unrelated to the experimentally induced stressors. Each participant signed an informed consent prior to the beginning of the medical measurement collection.
Participants engaged in three different assigned tasks that produced pressure, such as the Stroop Color Test and the Trier Social Stress Test. Resting periods were placed between the assigned tasks since the physical structure required time for physiological recovery. The equipment captured heart rate and breathing rate during task and rest periods. Iqbal et al. reported that respiratory rate can be detected through other signals; therefore, they developed a novel algorithm to estimate respiratory rate from raw PPG signals as described in their work [
62]. They employed a Bayesian framework and a time-efficient expectation–maximization (EM) algorithm for the individual-level statistical analysis.
During the Trier Social Stress Test, the largest variations in terms of heart rate and breathing rates were produced. Iqbal et al. reported significant heart rate variations in 27 of the 35 participants (77%) and respiratory rate variations in 28 of the 35 participants (80%). Identifying whether individual participants’ heart rate and respiratory rate deviated from baseline was therefore a critical requirement.
The primary finding revealed that the variations in heart rate and respiratory rate are highly informative for stress detection. Given the discriminative value of the signals, a dedicated data set containing only these two physiological variables was developed to facilitate binary classification for stress detection. This open-access data set makes studying stress monitoring easier when individuals utilize wearable devices like the Empatica E4.
The data set was chosen for its suitability for data preparation and binary classification in this study. This methodology applies binary classification using complex data preparation and optimized classical, quantum and quantum hybrid machine learning algorithms on the data collected by the group of Iqbal et al.
3.3. Data Preprocessing
The Stress-Predict data set was preprocessed to ensure compatibility with both classical and quantum machine learning classifiers, improve data quality, and ensure a fair comparison in the subsequent classification experiments.
Missing data were first addressed by removing all records containing at least one missing value. This reduced the number of cases available for analysis from 112,516 to 112,472. The outliers were identified next based on Tukey’s interquartile range (IQR) method; for each feature, only rows whose values fell within
were retained, where
and
denote the 25th and 75th percentiles, respectively. Based on this process, an additional 3597 cases were dropped. Thus, the clean file contained 108,878 cases. The resulting per-feature IQR values are summarized in
Table 1.
Rows totaled 3597 fewer once the outlier removal was finished. Twenty-five individuals were selected at random from the entire population of individuals that participated. This sample size was chosen to keep the runtime in the quantum simulation tractable. Both the classical and quantum machine learning classifiers had to be compared in a fair manner; therefore, the same number of individuals was used for both methods.
Class weights were computed from the label distribution to address imbalance; Tomek links undersampling was applied to minimize class overlap, particularly near the decision boundary [
63]. This action removed ambiguous data examples so that the success of classification would be enhanced.
Mutual-information-based methods were utilized in the stage of feature selection to identify the most relevant features for each class. Retaining only the most informative features improved computational tractability and classification performance, which is a necessity given that quantum classifiers require medium-sized data sets to operate under the current technological advancements.
Following the feature selection stage, the data sets for each class were decreased to the 300 most representative samples. Reducing the sample size allowed for computations to occur while still maintaining enough variability for training the machine learning models. The data were organized in accordance with the time feature, then grouped into batches that contained two seconds each. These batches were formed to capture time-based patterns, which are essential for machine learning models. To eliminate any potential biases caused by the order of the data, the samples were shuffled after the batching was complete.
To improve the machine learning models, data normalization was applied using MinMaxScaler, which limited all values to be between 0 and 1. StandardScaler normalization was also evaluated but yielded lower accuracy on quantum classifiers; MinMaxScaler was adopted. The data were divided into 80% for the training phase and 20% for the testing phase to finalize the configuration.
Two consequences of this pipeline are acknowledged with full transparency and reviewed in
Section 5.6 as well. The first is that the combination of outlier removal, Tomek links cleaning, mutual information feature selection, and per-class subsampling creates a very simple binary problem that can be solved with high accuracy using standard machine learning algorithms. As such, the nearly perfect accuracies reported later may indicate how well each model is able to separate tasks rather than an indication of superior performance on the part of each model. The second result is that the feature set includes time (s), so it appears that in the Stress-Predict protocol, because of the placement of stress and rest blocks at constant time intervals throughout the experiment, the timestamp could potentially serve as a partial proxy for the timing of the block schedule. Both issues are dealt with in detail in
Section 5.6 as explicit threats to validity along with those experiments necessary to determine the extent to which they impact the conclusions drawn from the data.
Classical ablation and empirical bounding of the time predictor. Comparing mutual information for each participant reveals that time has the most discriminatory information of the three features examined:
nats, while
nats and
nats (mean ± standard deviation across participants;
Figure 2). The results confirm the scheduling-proxy concern. In the Stress-Predict protocol, the fixed temporal positions of the Stroop and Trier stress blocks create an independent temporal gradient from the physiological responses.
A classical ablation study was conducted to measure each classifier’s dependence on the time feature, using only HR and RR as inputs. All the classifiers were trained using the same preprocessing steps but without using time. The results show that there are two separate behavioral categories. The tree-based or distance-based classifiers—random forest (
pp), K-nearest neighbors (
pp), and decision trees (
pp)—perform well without the time, demonstrating that the physiological separation in HR and RR alone is real. The linear or density-based classifiers—support vector machine (
pp), quadratic discriminant analysis (
pp), naive Bayes (
pp), and linear discriminant analysis (
pp)—experience substantially larger drops, indicating that their performance achieved in the original pipeline is due to time’s structural properties and not its physiological content (
Figure 3).
These results reinforce the deliberate framing of this study as a noise-aware proof-of-concept benchmark on a physiologically separable data set (
Section 2.5). As quantum and classical classifiers used the same set of features throughout this study, the TOST equivalence found in
Section 4.5 is consistent within this evaluation context. It remains to be determined whether equivalence will hold in physiology-only data; thus, quantum re-simulation is required and is committed as future work (
Section 5.6, item 2).
3.4. The Classical Machine Learning Classifiers
In addition to being able to compare the performance of quantum classifiers with the performance of classical ones, the data set had to undergo preprocessing. The following seven classical machine learning algorithms were evaluated: K-nearest neighbors (KNN); naive Bayes (NB); decision trees (DTs); quadratic discriminant analysis (QDA); linear discriminant analysis (LDA); support vector machines (SVMs); and random forest (RF).
A random search method was used to evaluate many combinations of hyperparameters as listed in
Table 2. Additionally, 5-fold cross-validation (CV) was used to evaluate the robustness of each classifier’s performance.
During the training phase, the time it took to build each model was recorded. The best hyperparameter combination for each classifier was determined. The trained models were subsequently applied to generate predictions on the test data set. The time taken to make predictions for the test data set was recorded. The performance of each model was evaluated via a comprehensive classification report, comprising accuracy, precision, recall, and the F1 score. Confusion matrices were also constructed to extract TP, FN, FP, and TN, enabling a granular assessment of classifier quality.
Furthermore, the memory size of each trained model was determined. It provided insight into the computational efficiency of the models. Each classical classifier was therefore evaluated in three ways: classification accuracy, prediction time, and computational efficiency.
3.5. The Quantum Machine Learning Classifiers
In this subsection, the development of the QML classifiers is examined. There are three strategies that can be used to develop QML classifiers. The first strategy, VQC, employs a scalable parameterized circuit architecture for data classification. The second, QSVC, combines classical support vector classification with quantum kernel-based feature mapping. The third, PegasosQSVC [
64], is similar to the QSVC but replaces the standard SVM solver with a Pegasos stochastic subgradient descent algorithm. These hybrid quantum classifiers leverage the representational power of quantum circuits and the interpretability of classical optimization.
Therefore, the goal was to identify hyperparameter combinations governing each classifier’s circuit architecture—determining which feature maps, ansatz, and optimizers yield the highest accuracy and associated performance metrics.
Inside the VQC, the main architecture consists of a feature map and an ansatz. The circuit parameters were optimized using gradient-based and gradient-free solvers. Six different feature maps and four different ansatz designs were used with two optimizers. Therefore, there were a total of 48 unique quantum architecture circuits for the target classifiers.
For the QSVC, six different feature maps were evaluated. Therefore, six unique quantum architectures were generated. For the PegasosQSVC, six different feature maps were used and two different regularization parameters (C) were used with two different values for each step size. When the received collection of information was used, 24 cases of PegasosQSVC were studied. These cases are presented in
Table 3.
As mentioned earlier, the calculated working time for a real quantum computer began with the construction of the classifier. The feature maps and ansatz designs of every classifier were broken down into quantum circuits. These quantum circuits were further broken down into the gate level. By breaking them down, the type and size of gates inside the circuit could be followed. If the gate size was one, the single-qubit gate counter was incremented by one. If the gate size was two, the two-qubit gate counter was incremented by one.
Tau times for single- and two-qubit actions (see
Table 3) were multiplied by the total counts of single-qubit and two-qubit gates. The total circuit time for a single shot was obtained by adding the times for both gate types. Calculation for the final running time occurred when the number of shots defined for the simulation was multiplied by the total circuit time for one shot.
The running time of quantum circuits is a critical determinant of the practical feasibility of quantum classifiers. The basic gate operations—single-qubit and two-qubit gates—were analyzed in detail. The total running time was determined by the number of operations and the time that each operation took.
Each quantum circuit (qc) was broken down into its constituent single- and two-qubit gates, and the respective counts were tallied. The specific counters were modified according to the gate type identified during the counting process:
where
is the indicator function that assigns 1 when the condition is satisfied.
To make Equations (1) and (2) concrete, “breaking down” a circuit means transpiling the feature map and ansatz at a high level of abstraction into the basis of hardware-native gates such that all the operations are either a single-qubit gate (e.g., h, rx, ry, u3, acting on a wire) or a two-qubit entangling gate (e.g., cx, acting on a pair of wires). The counting routine is responsible for the iteration of the decomposed gate list, and an indicator function
is evaluated when gate
g operates on exactly one qubit, and 0 otherwise. Symmetrically, an indicator function
is assessed when gate
g operates on exactly two qubits, and 0 otherwise. Therefore,
and
are simply the number of one- and two-qubit operations in the compiled circuits. These values may be determined directly by inspecting the diagrams of the circuits: in
Figure 4,
Figure 5 and
Figure 6, every
H,
,
, or
P block contributes to
, whereas each pair of vertically connected control–target pairs (denoted by the ⊕ symbol controlling target symbols representing entanglements) contributes to
. As mentioned above, two-qubit gates also have significantly slower times (
vs.
) than single-qubit gates and are thus also much noisier on real hardware. Consequently, the ratio of two-qubit gates in a given decomposition has been identified as the primary contributor to both the predicted runtime and the noise sensitivity presented later. It follows then that more complex entangled feature maps are expected to degrade more rapidly due to the noise models.
Given the execution time per gate type, denoted as
for single-qubit gates and
for two-qubit gates, the total time needed for gate execution in a quantum classifier is computed as follows:
where:
denotes the total execution time for all single-qubit gates.
denotes the total execution time for all two-qubit gates.
is the cumulative execution time for the entire quantum circuit.
This method enables estimation of total circuit execution time and provides a common basis for comparing the computational efficiency of various quantum architectures, simulators, and backends.
Systematic evaluation of different circuit configurations was critical for identifying the most effective quantum classifier architecture. AerSimulator was used in both noise-free and noisy models to evaluate classifier performance under ideal and realistic hardware conditions, respectively. The specific steps for creating a noisy simulation model (that mimics a real quantum computer at extremely high noise levels) is shown in
Table 4. Included in each step are the relevant measurements.
The simulation incorporates the primary contributors to real-world quantum noise through a multi-channel architecture. (i) Stochastic gate failure, represented by depolarization errors on each of the original gate sets, was applied per gate type. Therefore, the total number of failures would increase exponentially for longer circuits. (ii) Measurement (readout) errors; these are modeled via a symmetric bit-flip confusion matrix for errors with a probability of and represent classical assignment errors during measurement. These types of errors were generally the largest error contributors found within current superconducting devices. (iii) Channels representing amplitude and phase damping were used to simulate energy loss and dephasing. Together, the combination of (ii) and (iii) provides qualitative behavior similar to that of a NISQ device rather than a purely stochastic simulator. It is therefore primarily due to the combination of (ii) and (iii) that the degradation of variational circuits (more complex, longer circuits comprising more two-qubit gates) was greater than the degradation observed for the simpler, shallower feature extraction circuit maps.
The noise model is input-signal-independent; it characterizes hardware-level errors in the quantum processor without correlating them to participants’ physiological waveform properties. As mentioned above, this was done intentionally since the noise associated with a processing unit is a characteristic of the hardware itself. Therefore, the authors argue that their results demonstrate tolerance to hardware noise of the quantum processor and not tolerance to variability in physiological signals. Joint modeling of device noise together with subject-specific signal noise is identified as future work in
Section 5.6.
3.6. Performance Evaluation Metrics for Classification Models
Several metrics were used to evaluate the performance of classifiers: accuracy, recall, precision, and F1 score. These metrics characterize the effectiveness of each classifier in classifying data precisely between the two classes and were derived from the confusion matrix entries: true positives (TPs), true negatives (TNs), false positives (FPs), and false negatives (FNs).
Accuracy. Accuracy was calculated as the ratio of correctly classified items to the total number of items. The formula for accuracy is:
Recall. Recall, also known as sensitivity or the true-positive rate, was calculated as the ratio of real positives that the classification models identified correctly. Recall was calculated for each class individually. For example, for class 0 (no-stress) and class 1 (stress),
High recall values indicate successful identification of positive instances and a low false-negative rate.
Precision. Precision was calculated as the ratio of correctly identified positive items to all items that the classification models identified as positive. High precision is required when false positives incur a large cost. It was calculated for each class after the testing was completed. Precision measures the reliability of the classification models.
F1 Score. The F1 score is the harmonic mean of precision and recall, providing a single composite measure of classifier performance. This special metric is useful when the two classes are not equally sized. It was recorded for each class because it is essential to have balanced classes. The F1 score is defined as