A Reconstruction-Residual Input-Quality Gate for Class-Discriminant Codebook Pipelines: A Graded, Calibrated Self-Knowledge Channel and Its Honest Limits

A pipeline that compresses each window of a continuous signal to a single class-discriminant codebook token is small and fast, but the aggressive compression makes its downstream classifier sensitive to acquisition degradation and its anomaly monitor prone to false alarms under noisy input. A deployed device must therefore know when its own input is unreliable. We show that the information needed is already present, for free, in the pipeline: the reconstruction residual orthogonal to the codebook subspace — the part of a window's feature representation the codebook does not capture, computed as a by-product of the class-discriminant projection with no separately-trained detector — is a graded, conformally-calibratable, cross-modality input-quality signal that gates downstream operations. On real twelve-lead electrocardiography the residual detects injected degradations (additive noise, gain miscalibration, lead dropout, baseline wander) at AUC 0.84–0.99, is monotone in severity (Spearman ≈ +1.0), calibrates to a target coverage by split conformal (empirical coverage within 0.03–0.04 of target) and transfers across subjects and datasets (coverage drift ≈ 0.02), generalizes across modalities (AUC ≈ 0.998 electrocardiographic, ≈ 1.000 inertial), and far exceeds a classifier's maximum-softmax confidence (AUC 0.964 vs 0.294), while being competitive with — not superior to — a dedicated reconstruction-error or Mahalanobis detector. The same residual restores a streaming anomaly monitor's specificity under intermittent degradation (false-alarm rate ≈ 0.569 → ≈ 0.105 = clean, ≈ 94% abstention purity). We then report — and resolve — a safety pitfall found by pre-registered evaluation: a naively-placed (clean-calibrated) threshold suppresses genuine pathology along with corruption (anomaly recall ≈ 0.21 → ≈ 0.00), because pathology is itself mildly off-manifold; the residual nonetheless separates near-manifold pathology (median 5.6) from off-manifold corruption (median 13.7) at AUC 0.953, so a threshold placed in the corruption regime restores specificity (false-alarm ≈ 0.674 → ≈ 0.343 ≈ clean ≈ 0.339) while retaining ≈ 75% of anomaly recall versus ≈ 8% for a clean-calibrated threshold — a favorable tradeoff, not a free lunch. We disclose honest negatives verbatim: the gate is scoped to gross off-manifold degradation and flags subtle real annotated artifacts only weakly (AUC ≈ 0.6); it does not generalize to electroencephalography with the present features (AUC ≈ 0.51); it ties an in-subspace distance for selective-prediction accuracy; and it is not a robust defense against in-subspace adversarial perturbation. Standard mitigations (augmentation-trained codebook fitting, amplitude normalization, lead-masking) recover most of the underlying classifier fragility (≈ 60–85% of the perturbation gaps), and the pipeline meets a wearable energy/latency budget (≈ 4.3 ms and ≈ 0.21 mW per record). The contribution is the integration of a free, graded, calibrated input-quality gate into an existing class-discriminant compression pipeline, with its limits measured rather than assumed. Keywords / index terms: input-quality assessment; out-of-distribution detection; selective prediction; reconstruction residual; class-discriminant codebook; signal-quality gating; conformal calibration; anomaly-monitor specificity; edge deployment; electrocardiogram; human activity recognition; pre-registration; honest negatives. References: 1. D. Hendrycks and K. Gimpel, "A baseline for detecting misclassified and out-of-distribution examples in neural networks," ICLR, 2017. 2. K. Lee et al., "A simple unified framework for detecting out-of-distribution samples and adversarial attacks," NeurIPS, 2018. 3. Y. Geifman and R. El-Yaniv, "Selective classification for deep neural networks," NeurIPS, 2017. 4. V. Vovk, A. Gammerman, and G. Shafer, Algorithmic Learning in a Random World, Springer, 2005. 5. P. Wagner et al., "PTB-XL, a large publicly available electrocardiography dataset," Scientific Data, 2020. 6. G. Moody and R. Mark, "The impact of the MIT-BIH arrhythmia database," IEEE EMB Magazine, 2001. 7. D. Anguita et al., "A public domain dataset for human activity recognition using smartphones," ESANN, 2013. 8. B. Efron and R. J. Tibshirani, An Introduction to the Bootstrap, Chapman & Hall/CRC, 1993. 9. R. J. Ferlic and K. K. Ferlic, companion deposits (Papers 19, 20, 21, 22), Zenodo, 2026. Companion deposits in this Zenodo Community (spiral-domain-encoder-campaign): · Paper 19 — 10.5281/zenodo.20788187 · Paper 20 — 10.5281/zenodo.20802759 · Paper 21 — 10.5281/zenodo.20802826 · Paper 22 — 10.5281/zenodo.20805321

Authors

Institutions

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-06-24
DOI
https://doi.org/10.5281/zenodo.20821667
Primary Topic
ECG Monitoring and Analysis
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
preprint

A Reconstruction-Residual Input-Quality Gate for Class-Discriminant Codebook Pipelines: A Graded, Calibrated Self-Knowledge Channel and Its Honest Limits

Randolph James Ferlic, Kimberly Kate Ferlic
Zenodo (CERN European Organization for Nuclear Research)
ECG Monitoring and Analysis
preprint

A Reconstruction-Residual Input-Quality Gate for Class-Discriminant Codebook Pipelines: A Graded, Calibrated Self-Knowledge Channel and Its Honest Limits

Randolph James Ferlic, Kimberly Kate Ferlic
preprint en

Abstract

A pipeline that compresses each window of a continuous signal to a single class-discriminant codebook token is small and fast, but the aggressive compression makes its downstream classifier sensitive to acquisition degradation and its anomaly monitor prone to false alarms under noisy input. A deployed device must therefore know when its own input is unreliable. We show that the information needed is already present, for free, in the pipeline: the reconstruction residual orthogonal to the codebook subspace — the part of a window's feature representation the codebook does not capture, computed as a by-product of the class-discriminant projection with no separately-trained detector — is a graded, conformally-calibratable, cross-modality input-quality signal that gates downstream operations. On real twelve-lead electrocardiography the residual detects injected degradations (additive noise, gain miscalibration, lead dropout, baseline wander) at AUC 0.84–0.99, is monotone in severity (Spearman ≈ +1.0), calibrates to a target coverage by split conformal (empirical coverage within 0.03–0.04 of target) and transfers across subjects and datasets (coverage drift ≈ 0.02), generalizes across modalities (AUC ≈ 0.998 electrocardiographic, ≈ 1.000 inertial), and far exceeds a classifier's maximum-softmax confidence (AUC 0.964 vs 0.294), while being competitive with — not superior to — a dedicated reconstruction-error or Mahalanobis detector. The same residual restores a streaming anomaly monitor's specificity under intermittent degradation (false-alarm rate ≈ 0.569 → ≈ 0.105 = clean, ≈ 94% abstention purity). We then report — and resolve — a safety pitfall found by pre-registered evaluation: a naively-placed (clean-calibrated) threshold suppresses genuine pathology along with corruption (anomaly recall ≈ 0.21 → ≈ 0.00), because pathology is itself mildly off-manifold; the residual nonetheless separates near-manifold pathology (median 5.6) from off-manifold corruption (median 13.7) at AUC 0.953, so a threshold placed in the corruption regime restores specificity (false-alarm ≈ 0.674 → ≈ 0.343 ≈ clean ≈ 0.339) while retaining ≈ 75% of anomaly recall versus ≈ 8% for a clean-calibrated threshold — a favorable tradeoff, not a free lunch. We disclose honest negatives verbatim: the gate is scoped to gross off-manifold degradation and flags subtle real annotated artifacts only weakly (AUC ≈ 0.6); it does not generalize to electroencephalography with the present features (AUC ≈ 0.51); it ties an in-subspace distance for selective-prediction accuracy; and it is not a robust defense against in-subspace adversarial perturbation. Standard mitigations (augmentation-trained codebook fitting, amplitude normalization, lead-masking) recover most of the underlying classifier fragility (≈ 60–85% of the perturbation gaps), and the pipeline meets a wearable energy/latency budget (≈ 4.3 ms and ≈ 0.21 mW per record). The contribution is the integration of a free, graded, calibrated input-quality gate into an existing class-discriminant compression pipeline, with its limits measured rather than assumed. Keywords / index terms: input-quality assessment; out-of-distribution detection; selective prediction; reconstruction residual; class-discriminant codebook; signal-quality gating; conformal calibration; anomaly-monitor specificity; edge deployment; electrocardiogram; human activity recognition; pre-registration; honest negatives. References: 1. D. Hendrycks and K. Gimpel, "A baseline for detecting misclassified and out-of-distribution examples in neural networks," ICLR, 2017. 2. K. Lee et al., "A simple unified framework for detecting out-of-distribution samples and adversarial attacks," NeurIPS, 2018. 3. Y. Geifman and R. El-Yaniv, "Selective classification for deep neural networks," NeurIPS, 2017. 4. V. Vovk, A. Gammerman, and G. Shafer, Algorithmic Learning in a Random World, Springer, 2005. 5. P. Wagner et al., "PTB-XL, a large publicly available electrocardiography dataset," Scientific Data, 2020. 6. G. Moody and R. Mark, "The impact of the MIT-BIH arrhythmia database," IEEE EMB Magazine, 2001. 7. D. Anguita et al., "A public domain dataset for human activity recognition using smartphones," ESANN, 2013. 8. B. Efron and R. J. Tibshirani, An Introduction to the Bootstrap, Chapman & Hall/CRC, 1993. 9. R. J. Ferlic and K. K. Ferlic, companion deposits (Papers 19, 20, 21, 22), Zenodo, 2026. Companion deposits in this Zenodo Community (spiral-domain-encoder-campaign): · Paper 19 — 10.5281/zenodo.20788187 · Paper 20 — 10.5281/zenodo.20802759 · Paper 21 — 10.5281/zenodo.20802826 · Paper 22 — 10.5281/zenodo.20805321

Zenodo (CERN European Organization for Nuclear Research)
EP Analytics (United States) (US)
Peace, Justice and strong institutions
ECG Monitoring and Analysis
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.