Compression Pipeline for Sub-Millisecond Sleep Apnea Detection on Mobile Neural Engines
We present a four-phase compression pipeline that takes a 204,801-parameter 1D-CNN sleep apnea classifier — the Stage-2 classifier of a cascaded two-stage audio sleep monitoring architecture in which a short-window snore-detection CNN's per-second output forms one of three feature channels of the Stage-2 input matrix (the cascade architecture is the subject of companion work [Yang L., 2026a, b]) — down to a 9,416-parameter model that runs at 0.064 millisecond inference latency on the Apple M2 Neural Engine — a 234× speedup versus the original baseline. The pipeline combines (i) architectural redesign substituting a Global-Average-Pooling + Coordinate-Attention head for the parameter-heavy Flatten + Dense head; (ii) Quantization-Aware Training (QAT) on Linear layers with 10 fine-tuning epochs, which we find acts as an implicit regularizer on the small (n ≈ 3000) training set and produces a 0.22% accuracy increase rather than a degradation; (iii) L1-structured Conv1D filter pruning at 50% ratio with 20 fine-tuning epochs under cosine-annealed learning rate, which we find provides a second 1.13% accuracy increase, again attributable to regularization on small data; and (iv) CoreML conversion and deployment to the Apple Neural Engine. The combined pipeline produces a model of size 56.4 KB (94% reduction versus the original 820 KB baseline) while improving classification accuracy from 83.59% to 88.49% — that is, neither size nor accuracy is sacrificed. The pipeline establishes that a smartphone-only sleep apnea screening pipeline operating in real time on consumer mobile hardware is feasible. Data and code availability: The compression pipeline code (architectural redesign, QAT, L1-structured pruning, and CoreML conversion) is publicly availableat https://github.com/somnisense/apnea-compression-pipeline under the MIT License. By design, no audio recordings, labels, derived feature matrices, or trained model checkpoints are distributed with the repository: the original recordings were collected under participant consent that does not cover public release of either the waveforms or the derived features. Competing interests: The author is the founder of SomniAI LLC, the entity that may commercialize the technology described in this work. The methods described are also the subject of three co-filed U.S. provisional patent applications by SomniAI LLC. No external funding was received.
Authors
- Yang L (ORCID: https://orcid.org/0009-0002-4798-5161)
Institutions
- Sheridan College (US)
- Inter-Mountain Laboratories (United States) (US)
- United Animal Health (United States) (US)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-06-12
- DOI
- https://doi.org/10.5281/zenodo.20663768
- Primary Topic
- Obstructive Sleep Apnea Research
- Type
- preprint