Detecting Covid-19 Using Visible or Near-Infrared Spectroscopy and Machine Learning


In a new study published in Spectrochimica Acta Part A: Molecular and Biomolecular Spectroscopy, scientists from the Federal University of Sao Francisco Valley in Pernambuco, Brazil tested a new means of detecting SARS-CoV-2 using a combination of visible or near-infrared (Vis-NIR) and machine learning algorithms (1).

Coronavirus Covid-19 background - 3d rendering | Image Credit: © Production Perig -

Coronavirus Covid-19 background - 3d rendering | Image Credit: © Production Perig -

Though there have been many advancements in detecting and treating COVID-19, there is still more work to be done. Diagnosis is usually done via RT-PCR tests, and while they are accurate in detecting SARS-CoV-2, the virus that causes COVID-19, tests are expensive due to specialized equipment needed to run the tests and highly skilled personnel needed for these tests to function. As such, there is interest in finding alternative means of detecting SARS-CoV-2, such as rapid immunochromatography tests or by analyzing saliva samples. For this study, the scientists decided to explore the potential of using Vis-NIR spectroscopy to detect SARS-CoV-2.

Vis-NIR spectroscopy is a technique based on interactions between studied objects and optical waves of different wavelengths in the Vis-NIR spectrum. These interactions can occur via vibrational reflectance, transmittance, or absorbance. There is precedence for this technique being used to detect diseases, as previous studies have used the technique to detect viruses like influenza and zika. Additionally, machine learning algorithms can be used to find patterns in data, detecting slight changes that cannot be perceived by traditional algorithms. The purpose of the study was to combine these two techniques and evaluate their promise in detecting SARS-CoV-2. Additionally, there was a focus on using low-cost materials that could be integrated into the public health system.

The study involved obtaining spectral signals from nasopharyngeal swab samples that had been previous analyzed using RT-PCR tests. The team analyzed 314 samples, 42 of which were positive for COVID-19. Using digital signal processing techniques like Savitzky–Golay filters and statistical methods, the scientists could parse through irrelevant data and identify relevant features. Automatic sample identification was conducted through various machine learning algorithms, such as SVM and Random Forest. Additionally, a 5-fold cross-validation technique was used to evaluate the models’ performances.

Using the proposed method, the scientists were able to achieve an accuracy rate of 75%, a sensitivity of 80%, and a specificity of 70%. This was all possible under conditions like the nasopharyngeal swab samples. These results led the scientists to see potential in using Vis-NIR spectroscopy to identify SARS-CoV-2, though more research is needed to fully validate this idea.


(1) Coelho, B. F. O.; Nunes, S. L. P.; de França; C. A.; Costa, D. d. S.; Carmo, R. F. d.; Prates, R. M.; Filho, E. F. S.; Ramos, R. P. On the Feasibility of Vis-NIR Spectroscopy and Machine Learning for Real Time SARS-CoV-2 Detection. Spectrochim. Acta A Mol. Biomol. Spectrosc. 2024, 308, 123735. DOI:

Related Content