Accurate Diagnosis of Respiratory Viruses Using an Explainable Machine Learning with Mid-Infrared Biomolecular Fingerprinting of Nasopharyngeal Secretions
Wenwen Zhang, Zhouzhuo Tang, Yingmei Feng, Xia Yu, Qi Jie Wang, Zhiping Lin
TL;DR
This work tackles rapid, multi-virus discrimination using noninvasive mid-infrared spectroscopy of nasopharyngeal secretions augmented by an explainable RoPE-SAT transformer. By preprocessing spectra with SNV normalization and second-order derivatives, augmenting data with Mixup, and applying Grad-CAM for interpretability, the approach achieves over 95% accuracy with high sensitivity and specificity across two cohorts despite differing VTMs and drying protocols. The model highlights biologically meaningful spectral regions corresponding to lipids, proteins (Amide bands), nucleic acids, and carbohydrates, providing mechanistic insight into virus-host spectral signatures. With an ~80% reduction in attention computation and robust performance in varied sample-preparation conditions, this method offers a scalable, on-site screening tool for respiratory viral infections and lays groundwork for broader virus coverage and real-world deployment.
Abstract
Accurate identification of respiratory viruses (RVs) is critical for outbreak control and public health. This study presents a diagnostic system that combines Attenuated Total Reflectance Fourier Transform Infrared Spectroscopy (ATR-FTIR) from nasopharyngeal secretions with an explainable Rotary Position Embedding-Sparse Attention Transformer (RoPE-SAT) model to accurately identify multiple RVs within 10 minutes. Spectral data (4000-00 cm-1) were collected, and the bio-fingerprint region (1800-900 cm-1) was employed for analysis. Standard normal variate (SNV) normalization and second-order derivation were applied to reduce scattering and baseline drift. Gradient-weighted class activation mapping (Grad-CAM) was employed to generate saliency maps, highlighting spectral regions most relevant to classification and enhancing the interpretability of model outputs. Two independent cohorts from Beijing Youan Hospital, processed with different viral transport media (VTMs) and drying methods, were evaluated, with one including influenza B, SARS-CoV-2, and healthy controls, and the other including mycoplasma, SARS-CoV-2, and healthy controls. The model achieved sensitivity and specificity above 94.40% across both cohorts. By correlating model-selected infrared regions with known biomolecular signatures, we verified that the system effectively recognizes virus-specific spectral fingerprints, including lipids, Amide I, Amide II, Amide III, nucleic acids, and carbohydrates, and leverages their weighted contributions for accurate classification.
