BioData Mining20261 citation

Quantum Angle–distance kernel for ECG classification and anomaly detection: a quantum-inspired framework for biomedical signal analysis

A. Salehi, H. R. Goudarzi, A. Heydarian

Quantum-inspiredECGKernel MethodsAnomaly Detection

An ECG is a stream of heartbeats, and somewhere in that stream sits the one beat that matters — the arrhythmia a cardiologist is hunting for. Teaching a machine to find it is deceptively hard: recordings are noisy, the dangerous beats are rare, and models that are flexible enough to catch them tend to overfit the handful of labelled examples we have. This paper started from a simple suspicion: maybe the bottleneck isn't the classifier, but the ruler it uses to decide when two heartbeats are "alike."

One ruler isn't enough

Most kernel methods compare two beats with a single notion of closeness — typically a radial distance. That quietly throws away geometry. Two heartbeats can point in nearly the same direction yet sit at very different magnitudes, or share a magnitude while pointing apart. A single-distance ruler collapses those cases together, and the classifier never gets to see the difference.

So we gave the kernel two rulers instead of one, both measured against a fixed reference point: the angle between beats (their alignment) and the projection gap (how far each sits from the reference). Drag the heartbeat below and watch how the two terms disagree — and why you need both.

Angle θ (alignment)
90°
Projection gap Δ
1
Kernel similarity0.49

Drag the purple point. With angle + distance together, a beat only scores high when it is both aligned and at a similar radius — the single-term views collapse cases the full kernel keeps apart.

Encoding a heartbeat as a quantum state

To make those angles meaningful, each heartbeat's descriptive features are mapped into a fixed-length complex vector through a simulated quantum encoding — amplitudes and phases living in a Hilbert space. Crucially, the whole scheme fits in just 11 qubits.

Heartbeat features11-qubit complex state

Each feature sets a qubit's amplitude and phase. Eleven qubits is small enough to be within reach of near-term quantum hardware — and of wearable, resource-constrained clinical devices.

Conceptually, the Quantum Angle–distance kernel multiplies the two factors together, so a pair of beats scores highly only when it is both aligned and at a similar radius:

k(x,y)  =  12(1+cosθxy)angular alignment    exp ⁣(γxryr)projection gapk(x,y)\;=\;\underbrace{\tfrac{1}{2}\bigl(1+\cos\theta_{xy}\bigr)}_{\text{angular alignment}}\;\cdot\;\underbrace{\exp\!\bigl(-\gamma\,\bigl|\,\lVert x-r\rVert-\lVert y-r\rVert\,\bigr|\bigr)}_{\text{projection gap}}

where θxy\theta_{xy} is the angle between the encoded states and rr is the reference point. Because each factor is a valid positive-definite similarity, their product is too — so it drops straight into a standard SVM.

Does it work?

On real ECG data the kernel matches or beats a tuned RBF-SVM, and it stays stable across runs:

.000
AUC-ROCclassification · ±0.003
.000
Macro F1classification · ±0.005
.000
AUCanomaly detection · ±0.005

An ablation confirms the intuition the visual above is built on: drop either the angle term or the distance term and performance falls — the two carry complementary information, and only their combination separates every case cleanly.

Why it matters

A more expressive ruler buys accuracy without a bigger, more opaque model — exactly what biomedical signals need, where labels are scarce and a clinician has to trust the pipeline. And because the encoding needs only 11 qubits, the same idea is a candidate for near-term quantum hardware and for the kind of wearable, resource-constrained devices that monitor hearts outside the hospital.

Cite this work

bibtex
@article{salehi2026quantum, title = {Quantum Angle–distance kernel for ECG classification and anomaly detection: a quantum-inspired framework for biomedical signal analysis}, author = {A. Salehi and H. R. Goudarzi and A. Heydarian}, journal = {BioData Mining}, year = {2026}, doi = {10.1186/s13040-026-00519-3} }