Search papers, labs, and topics across Lattice.
This study systematically evaluates a transformer-based model for classifying bacterial Raman spectra, utilizing a nested leave-one-replicate-out cross-validation framework. The transformer outperformed conventional machine-learning methods, including PCA combined with LDA, SVM, and Random Forest classifiers, achieving the highest classification accuracy across independent test replicates. Additionally, the model demonstrated robust performance directly on raw spectra, underscoring its potential for reliable spectral classification and the necessity of replicate-aware validation in model assessments.
Transformer models not only excel in classifying bacterial Raman spectra but also outperform traditional methods without requiring any preprocessing.
Transformer-based models have recently attracted increasing attention for Raman spectral classification. In this study, a transformer-based approach was systematically evaluated using a nested leave-one-replicate-out cross-validation framework and compared with conventional machine-learning pipelines combining PCA or ICA with LDA, SVM, and Random Forest classifiers. A bacterial Raman dataset comprising 5,417 single-cell spectra from six bacterial species and nine independent measurement replicates was used. The transformer consistently achieved the highest classification performance across independent test replicates and significantly outperformed all conventional approaches. Analysis of the learned latent feature space revealed improved class separation compared with PCA- and ICA-based representations. Furthermore, the transformer maintained superior performance when applied directly to raw Raman spectra without preprocessing, demonstrating robust behavior across measurement replicates. These findings highlight the potential of transformer-based models for robust Raman spectral classification and emphasize the importance of replicate-aware validation for realistic model evaluation.