Hybrid Machine Learning-Assisted Raman Spectroscopy with Generative Feature Augmentation for Pharmaceutical Identification
Organizations: Faculty of Physics and Physics Engineering University of Science Ho Chi Minh City 700000 Viet Nam · Vietnam National University Ho Chi Minh City 700000 Viet Nam · Advanced Materials Technology Institute Vietnam National University Ho Chi Minh City (formerly Affiliated with Center for Innovative Materials and Architectures) Ho Chi Minh City 700000 Viet Nam · University of Health Sciences (UHS) Viet Nam National University Ho Chi Minh City Ho Chi Minh City 700000 Viet Nam ·
Abstract
Rapid and reliable identification of pharmaceutical residues is important for safeguarding public health, ensuring food safety, and enabling practical Raman-based screening. In this study, we propose HyMLRaman, a hybrid Raman spectroscopy framework that combines deep spectral feature extraction, generative models, and classical machine-learning classifiers to identify six pharmaceutical compounds, including amoxicillin, chloramphenicol, ciprofloxacin, tetracycline, ibuprofen, and paracetamol. Raman spectra are converted into spectral images and encoded with several deep neural-network backbones, among which EfficientNet-B3 yields the most effective representation. The resulting 1536-dimensional embeddings are then used to train downstream classifiers, including SVM, KNN, logistic regression, random forest, XGBoost, and ANN, using stratified 10-fold cross-validation. The hybrid EfficientNet-B3--SVM configuration achieves the strongest baseline performance, reaching 96.31% accuracy and a macro-F1 score of 96.36%, outperforming the standalone CNN baseline. To address limited-data conditions, a generative model, a DDPM-based feature augmentation, is introduced in a PCA-reduced EfficientNet-B3 latent space. The low-data ablation results show that DDPM augmentation provides selective benefits, particularly for KNN with reduced training fractions, and that its effect remains classifier-dependent. Finally, an application-level Raman Pharmaceutical Analyzer demonstrates the feasibility of embedding the trained model into an interactive Raman analysis workflow. These results suggest that HyMLRaman provides a practical and interpretable route for rapid Raman-based pharmaceutical screening.
Figures & tables
| Hybrid ML model | Acc. (%) | Prec. (%) | Rec. (%) | F1 (%) | Acc. std. | F1 std. |
| EfficientNet-B3–SVM | 96.31 | 96.57 | 96.35 | 96.36 | 2.14 | 2.12 |
| EfficientNet-B3–ANN | 95.91 | 96.19 | 95.91 | 95.93 | 1.61 | 1.61 |
| EfficientNet-B3–LR | 95.61 | 95.86 | 95.58 | 95.62 | 2.14 | 2.15 |
| EfficientNet-B3–XGB | 95.31 | 95.69 | 95.43 | 95.42 | 1.85 | 1.86 |
| EfficientNet-B3–RF | 94.91 | 95.26 | 94.99 | 94.97 | 1.60 | 1.55 |
| EfficientNet-B3–KNN | 94.62 | 95.03 | 94.64 | 94.66 | 1.75 | 1.77 |
| Frac. | Model | Original Acc. | DDPM Acc. | Acc. | Original F1 | DDPM F1 | F1 |
| 25% | KNN | 93.616 | 94.115 | +0.499 | 93.628 | 94.154 | +0.526 |
| 25% | SVM | 94.510 | 94.811 | +0.301 | 94.582 | 94.861 | +0.279 |
| 25% | RF | 93.715 | 93.714 | -0.001 | 93.737 | 93.756 | +0.019 |
| 25% | LR | 94.311 | 94.212 | -0.099 | 94.356 | 94.235 | -0.121 |
| 25% | XGB | 93.119 | 92.919 | -0.200 | 93.179 | 92.902 | -0.277 |
| 25% | ANN | 94.810 | 94.210 | -0.600 | 94.838 | 94.225 | -0.613 |
Raman Spectroscopy
Raman spectroscopy uses inelastically scattered light to identify molecular vibrations and characterize materials, chemicals, and biological samples.
See all 16 papers