Benchmarking deep learning architectures for MALDI-TOF mass spectrometry in infectious disease diagnostics and vector-borne disease surveillance Authors: Noshine Mohammad, Alexandre Godmer, Renaud Piarroux, Cécile Nabet, Xavier Tannier Published: 2026 ABSTRACT AbstractEmerging global health threats, from antimicrobial resistance to vector-borne diseases, require scalable diagnostic solutions. Matrix-assisted laser desorption/ionization time-of-flight (MALDI-TOF) mass spectrometry has revolutionized microbial diagnostics but remains underutilized in public health due to algorithmic challenges in interpreting and generalizing complex spectra. Here, we present a systematic benchmarking framework to expand MALDI-TOF’s utility for field-deployable diagnostics using diverse deep learning architectures and preprocessing strategies, including approaches newly applied to spectral data. Using a total of 7424 mass spectra from clinical and field-collected datasets, we evaluated Mycobacterium abscessus subspecies and antimicrobial resistance classification (814 training/187 test spectra from 33/8 isolates); Anopheles mosquito species identification across anatomical parts (legs: 1047/188 spectra from 211/40 specimens; head: 1089/214 spectra; thorax: 999/279 spectra); and mosquito age estimation (legs: 806/144 spectra from 202/36 specimens; head: 727/124 spectra; thorax: 689/117 spectra). Results demonstrate that balanced accuracy ranged from 84% to 95% for species/subspecies identification and from 91% to 99% for resistance prediction, and that mean absolute error ranged from 1.9 to 3.8 days for age estimation. Key to this performance are adaptations managing instrumental and biological variability. We further assess computational efficiency and energy consumption, highlighting trade-offs between accuracy and deployment feasibility. These findings support AI-enhanced MALDI-TOF as a practical tool for global health surveillance and precision diagnostics in resource-limited settings.Subject terms: Computational biology and bioinformatics, Microbiology, Diseases, Medical research, Developing world Introduction Global health threats such as antimicrobial resistance and the spread of vector-borne diseases are reshaping the landscape of infectious disease surveillance and control1–3. These challenges demand accurate, scalable, and affordable diagnostic tools to support timely surveillance and intervention efforts across both clinical and public health settings. Matrix-assisted laser desorption and ionization time-of-flight mass spectrometry (MALDI-TOF MS) has revolutionized clinical microbiology by enabling rapid and cost-effective identification of microorganisms4–6. This technology generates a unique protein fingerprint of a species, strain, or physiological state of an organism by separating proteins based on their mass-to-charge ratio. Its expanding applications, from bacteria, fungi, and parasites7,8 to more recent advances in identifying arthropod vectors such as mosquitoes9, position it as a compelling platform for broader integration into global disease surveillance systems. Despite its success in routine species-level identification, the diagnostic potential of MALDI-TOF MS remains underexploited for more complex inference tasks that are critical for public health, such as distinguishing closely related organisms or predicting subtle biologically and epidemiologically relevant traits, including antimicrobial resistance10,11 or vector age4. These tasks are particularly challenging because they rely on weakly discriminative, high-dimensional spectral patterns that are sensitive to biological variability, experimental conditions, and instrumental noise. In such settings, conventional database-matching algorithms12,13 often fail14, and while high-resolution technologies such as tandem mass spectrometry (MS/MS) coupled with chromatography can improve performance, their cost, processing time, and technical complexity limit scalability, especially in resource-constrained contexts4. Enhancing MALDI-TOF MS to address these complex diagnostic challenges could therefore substantially expand its role as a frontline surveillance tool. AI-based approaches offer a promising alternative. However, most studies rely on traditional machine learning models15 (e.g., random forests, SVM, KNN), which often struggle to capture the complexity of MALDI-TOF spectral variation arising from biological heterogeneity, experimental protocols, and instrumental parameters16. While these models can achieve moderate accuracy under standardized conditions, their limited representational capacity often reduces robustness and generalization across heterogeneous real-world datasets17–20. Deep learning methods are theoretically better suited to these challenges21–24, yet current work remains fragmented, typically focusing on narrow diagnostic tasks, isolated datasets, or single architectures25,26. Existing algorithmic frameworks (e.g., Greener et al.27) further lack practical, device-specific implementation guidance. Critically, no comprehensive benchmark currently exists that systematically evaluates deep neural architectures across multiple MALDI-TOF diagnostic tasks using real-world datasets. As a result, the field lacks principled guidance on which model families, spectral representations, and computational trade-offs are most appropriate for deployment in operational clinical and surveillance contexts, particularly in resource-constrained environments such as rural clinics or mobile laboratories. In this study, we address this gap by systematically benchmarking classification and regression pipelines built from a diverse set of neural network architectures (Fig. 1), including one- and two-dimensional convolutional neural networks, recurrent neural networks, a transformer architecture, hybrid models, and autoencoders, combined with different spectral representations. This comprehensive evaluation across architectural families is motivated by their complementary strengths: convolutional networks excel at local pattern detection in spectral peaks, recurrent models capture sequential dependencies across mass-to-charge ratios, transformers model long-range spectral interactions, and autoencoders learn robust, noise-invariant representations. By comparing these approaches, we identify not only the highest-performing models but also the architectural principles best suited to specific diagnostic challenges and deployment scenarios. Conceptual overview of spectral representations, model architectures, and diagnostic tasks. Raw MALDI-TOF (Matrix-Assisted Laser Desorption/Ionization Time-of-Flight) spectra were processed into multiple representations, including peak-based inputs, spectrograms, and scalograms. These representations enabled the evaluation of diverse model families, including one-dimensional convolutional neural network (1DCNN), temporal convolutional network (TCN), recurrent neural networks (RNNs), Transformer architecture, deep autoencoders (DAE) combined with conventional machine learning models, two-dimensional convolutional neural networks (2D CNNs), and hybrid 2DCNN–RNN architectures. The framework was applied to key diagnostic and epidemiological tasks: differentiation of Mycobacterium abscessus subspecies with antibiotic resistance detection, Anopheles species identification, and mosquito age estimation. We focus on three clinically and epidemiologically targeted tasks that remain challenging for routine microbiological workflows: (1) subspecies classification and antimicrobial resistance detection in Mycobacterium abscessus, (2) species identification of Anopheles mosquitoes, and (3) estimation of mosquito age as a proxy for transmission risk. Beyond diagnostic accuracy, all models are evaluated in terms of computational efficiency and energy consumption, reflecting real-world deployment constraints. By rigorously evaluating field-ready AI architectures across heterogeneous, real-world MALDI-TOF datasets, this work bridges the gap between algorithmic development and scalable deployment, strengthening the integration of deep learning with mass spectrometry to support precision medicine and real-time public health surveillance. Results Model performance across tasks Performance was evaluated across three datasets: Anopheles species identification, mosquito age estimation, and Mycobacterium abscessus (MABS) subspecies and resistance classification. For classification, balanced accuracy is reported on the independent test set; for cross-validation (CV), standard accuracy (mean ± standard deviation, SD) is used. Mean Absolute Error (MAE, mean ± SD) is reported for regression. An overview of the top-performing models is provided in Table 1. Complete results for all models are summarized in Tables 2–4. Model rankings are visualized in Figs. 2–4. Computational efficiency and energy consumption are shown in Figs. 5–7. Detailed cross-validation results are available in Supplementary Tables S1–S3, with isolate/specimen-level metrics in Tables S4–S6. Table 1Performance summary of best-performing models across tasksTaskBest modelMetricCV-STDInference timeAnopheles speciesDAE + GB0.95±0.03139.4 sAnopheles age1DCNN1.92±0.5835.98 sMABS subspeciesRNN-BiGRU0.95±0.10166.25 sMABS R/S1DCNN0.99±0.1243.41 sPerformance metrics are reported as balanced accuracy for classification tasks (Anopheles species, MABS subspecies, MABS resistance with R: resistant and S: susceptible) and mean absolute error (MAE) for the regression task (Anopheles age).STD standard deviation across cross-validation (CV) folds, DAE deep autoencoder, GB gradient boosting, 1DCNN one-dimensional convolutional neural network, RNN-BiGRU recurrent neural network with bidirectional gated recurrent units. Performance summary of best-performing models across tasks Performance metrics are reported as balanced accuracy for classification tasks (Anopheles species, MABS subspecies, MABS resistance with R: resistant and S: susceptible) and mean absolute error (MAE) for the regression task (Anopheles age). STD standard deviation across cross-validation (CV) folds, DAE deep autoencoder, GB gradient boosting, 1DCNN one-dimensional convolutional neural network, RNN-BiGRU recurrent neural network with bidirectional gated recurrent units. Table 2Model performance for Anopheles species identificationModel typeModelLegsHeadThoraxNeural network1DCNN0.88[0.83, 0.93]0.80[0.76, 0.85]0.88[0.84, 0.91]TCN0.93[0.87, 0.97]0.81[0.76, 0.86]0.84[0.80, 0.88]RNN-BiGRU0.92[0.85, 0.96]0.81[0.77, 0.85]0.85[0.81, 0.89]ESN0.84[0.75, 0.92]0.84[0.80, 0.89]0.84[0.79, 0.87]Transformer0.90[0.85, 0.96]0.84[0.80, 0.88]0.85[0.82, 0.89]2DCNN spectrogram0.89[0.83, 0.94]0.81[0.76, 0.85]0.90[0.87, 0.94]2DCNN BiGRU-Hybrid spectrogram0.91[0.86, 0.96]0.83[0.80, 0.88]0.89[0.86, 0.93]2DCNN scalogram0.91[0.85, 0.96]0.83[0.79, 0.88]0.83[0.77, 0.89]2DCNN BiGRU-Hybrid scalogram0.89[0.83, 0.95]0.79[0.74, 0.84]0.76[0.69, 0.83]DAE autoencoder +MLDAE + KNN0.86[0.80, 0.92]0.83[0.79, 0.87]0.91[0.88, 0.95]DAE + XGBoost0.91[0.86,0.97]0.83[0.79,0.88]0.89[0.86,0.93]DAE + ExtraTrees0.93[0.89, 0.98]0.82[0.78, 0.87]0.86[0.83, 0.91]DAE + RF0.91[0.87, 0.97]0.82[0.78, 0.87]0.86[0.82, 0.90]DAE + GB0.95[0.90, 0.99]0.78[0.74, 0.83]0.88[0.84, 0.92]DAE + LightGBM0.93[0.88, 0.98]0.76[0.76, 0.85]0.91[0.87, 0.94]DAE + GNB0.65[0.55, 0.75]0.60[0.51, 0.69]0.56[0.51, 0.63]DAE + LDA0.91[0.86, 0.96]0.84[0.80, 0.89]0.90[0.87, 0.94]DAE + QDA0.48[0.46, 0.50]0.58[0.54, 0.63]0.55[0.51, 0.59]DAE + SVC0.89[0.84, 0.95]0.80[0.76, 0.85]0.85[0.81, 0.89]DCAE autoencoder +MLDCAE + KNN0.84[0.78, 0.90]0.80[0.76, 0.85]0.85[0.81, 0.89]DCAE + XGBoost0.90[0.85,0.96]0.84[0.78,0.91]0.87[0.82, 0.91]DCAE + ExtraTrees0.90[0.84, 0.95]0.82[0.78, 0.87]0.86[0.83, 0.90]DCAE + RF0.90[0.84, 0.95]0.84[0.80, 0.89]0.87[0.83, 0.91]DCAE + GB0.88[0.82, 0.93]0.83[0.79, 0.88]0.83[0.79, 0.88]DCAE + LightGBM0.90[0.84, 0.95]0.87[0.83, 0.91]0.86[0.82, 0.90]DCAE + GNB0.76[0.67, 0.84]0.61[0.57, 0.67]0.61[0.55, 0.68]DCAE + LDA0.84[0.78, 0.91]0.76[0.72, 0.81]0.82[0.78, 0.86]DCAE + QDA0.30[0.23, 0.38]0.25[0.20, 0.30]0.39[0.36, 0.42]DCAE + SVC0.88[0.82, 0.93]0.74[0.70, 0.79]0.84[0.80, 0.88]Balanced accuracy [95% CI] across mosquito body parts and model architectures. Bold indicates the overall top-performing models across tasks. Autoencoder hybrids (DAE: fully connected Deep Autoencoder; DCAE: Deep Convolutional Autoencoder) were evaluated with conventional ML classifiers: KNN (K-Nearest Neighbors), XGBoost (Extreme Gradient Boosting), ExtraTrees, RF (Random Forest), GB (Gradient Boosting), Light Gradient Boosting Machine (LightGBM), GNB (Gaussian Naive Bayes), LDA (Linear Discriminant Analysis), QDA (Quadratic Discriminant Analysis), and SVC (Support Vector Classifier). Model performance for Anopheles species identification 0.88 [0.83, 0.93] 0.80 [0.76, 0.85] 0.88 [0.84, 0.91] 0.93 [0.87, 0.97] 0.81 [0.76, 0.86] 0.84 [0.80, 0.88] 0.92 [0.85, 0.96] 0.81 [0.77, 0.85] 0.85 [0.81, 0.89] 0.84 [0.75, 0.92] 0.84 [0.80, 0.89] 0.84 [0.79, 0.87] 0.90 [0.85, 0.96] 0.84 [0.80, 0.88] 0.85 [0.82, 0.89] 0.89 [0.83, 0.94] 0.81 [0.76, 0.85] 0.90 [0.87, 0.94] 0.91 [0.86, 0.96] 0.83 [0.80, 0.88] 0.89 [0.86, 0.93] 0.91 [0.85, 0.96] 0.83 [0.79, 0.88] 0.83 [0.77, 0.89] 0.89 [0.83, 0.95] 0.79 [0.74, 0.84] 0.76 [0.69, 0.83] 0.86 [0.80, 0.92] 0.83 [0.79, 0.87] 0.91 [0.88, 0.95] 0.91 [0.86,0.97] 0.83 [0.79,0.88] 0.89 [0.86,0.93] 0.93 [0.89, 0.98] 0.82 [0.78, 0.87] 0.86 [0.83, 0.91] 0.91 [0.87, 0.97] 0.82 [0.78, 0.87] 0.86 [0.82, 0.90] 0.95 [0.90, 0.99] 0.78 [0.74, 0.83] 0.88 [0.84, 0.92] 0.93 [0.88, 0.98] 0.76 [0.76, 0.85] 0.91 [0.87, 0.94] 0.65 [0.55, 0.75] 0.60 [0.51, 0.69] 0.56 [0.51, 0.63] 0.91 [0.86, 0.96] 0.84 [0.80, 0.89] 0.90 [0.87, 0.94] 0.48 [0.46, 0.50] 0.58 [0.54, 0.63] 0.55 [0.51, 0.59] 0.89 [0.84, 0.95] 0.80 [0.76, 0.85] 0.85 [0.81, 0.89] 0.84 [0.78, 0.90] 0.80 [0.76, 0.85] 0.85 [0.81, 0.89] 0.90 [0.85,0.96] 0.84 [0.78,0.91] 0.87 [0.82, 0.91] 0.90 [0.84, 0.95] 0.82 [0.78, 0.87] 0.86 [0.83, 0.90] 0.90 [0.84, 0.95] 0.84 [0.80, 0.89] 0.87 [0.83, 0.91] 0.88 [0.82, 0.93] 0.83 [0.79, 0.88] 0.83 [0.79, 0.88] 0.90 [0.84, 0.95] 0.87 [0.83, 0.91] 0.86 [0.82, 0.90] 0.76 [0.67, 0.84] 0.61 [0.57, 0.67] 0.61 [0.55, 0.68] 0.84 [0.78, 0.91] 0.76 [0.72, 0.81] 0.82 [0.78, 0.86] 0.30 [0.23, 0.38] 0.25 [0.20, 0.30] 0.39 [0.36, 0.42] 0.88 [0.82, 0.93] 0.74 [0.70, 0.79] 0.84 [0.80, 0.88] Balanced accuracy [95% CI] across mosquito body parts and model architectures. Bold indicates the overall top-performing models across tasks. Autoencoder hybrids (DAE: fully connected Deep Autoencoder; DCAE: Deep Convolutional Autoencoder) were evaluated with conventional ML classifiers: KNN (K-Nearest Neighbors), XGBoost (Extreme Gradient Boosting), ExtraTrees, RF (Random Forest), GB (Gradient Boosting), Light Gradient Boosting Machine (LightGBM), GNB (Gaussian Naive Bayes), LDA (Linear Discriminant Analysis), QDA (Quadratic Discriminant Analysis), and SVC (Support Vector Classifier). Table 4Model performance for MABS subspecies and antibiotic resistance classificationModel typeModelSubspecies classificationResistance predictionNeural network1DCNN0.78[0.72, 0.83]0.99[0.98, 1.00]TCN0.77[0.72, 0.82]0.97[0.93, 1.00]RNN-BiGRU0.95[0.90, 0.98]0.83[0.79, 0.87]ESN0.82[0.76, 0.87]0.93[0.90, 0.96]Transformer0.67[0.65, 0.69]0.85[0.82, 0.88]2DCNN spectrogram0.60[0.57, 0.63]0.87[0.83, 0.91]2DCNN BiGRU-Hybrid spectrogram0.59[0.56, 0.63]0.50[0.50, 0.50]2DCNN scalogram0.74[0.69, 0.79]0.84[0.79, 0.88]2DCNN BiGRU-Hybrid scalogram0.82[0.77, 0.87]0.76[0.70, 0.84]DAE autoencoder + MLDAE + KNN0.65[0.64,0.67]0.59[0.51,0.68]DAE + XGBoost0.65[0.62,0.69]0.65[0.59,0.73]DAE + ExtraTrees0.65[0.64,0.67]0.59[0.51,0.67]DAE + RF0.65[0.64,0.67]0.67[0.6,0.75]DAE + GB0.65[0.64,0.67]0.88[0.82,0.93]DAE + LightGBM0.66[0.67,0.67]0.78[0.72,0.86]DAE + GNB0.59[0.55,0.63]0.72[0.67,0.77]DAE + LDA0.68[0.67,0.7]0.79[0.73,0.85]DAE + QDA0.51[0.46,0.56]0.62[0.55,0.69]DAE + SVC0.65[0.63,0.67]0.74[0.67,0.82]DCAE autoencoder + MLDCAE + KNN0.58[0.54,0.62]0.75[0.68,0.81]DCAE + XGBoost0.93[0.89,0.97]0.72[0.64,0.8]DCAE + ExtraTrees0.56[0.52,0.61]0.79[0.72,0.86]DCAE + RF0.66[0.67,0.67]0.78[0.71,0.85]DCAE + GB0.68[0.63,0.75]0.80[0.73,0.88]DCAE + LightGBM0.87[0.82,0.92]0.77[0.7,0.85]DCAE + GNB0.50[0.46,0.56]0.83[0.78,0.89]DCAE + LDA0.70[0.65,0.77]0.62[0.54,0.71]DCAE + QDA0.33[0.33,0.33]0.50[0.5,0.5]DCAE + SVC0.51[0.46,0.56]0.75[0.68,0.83]Balanced accuracy [95% CI] for Mycobacterium abscessus clinical isolate characterization. Bold indicates the overall top-performing models across tasks. Autoencoder hybrids (DAE: fully connected Deep Autoencoder; DCAE: Deep Convolutional Autoencoder) were evaluated with conventional ML classifiers: KNN (K-Nearest Neighbors), XGBoost (Extreme Gradient Boosting), ExtraTrees, RF (Random Forest), GB (Gradient Boosting), Light Gradient Boosting Machine (LightGBM), GNB (Gaussian Naive Bayes), LDA (Linear Discriminant Analysis), QDA (Quadratic Discriminant Analysis), and SVC (Support Vector Classifier). Model performance for MABS subspecies and antibiotic resistance classification 0.78 [0.72, 0.83] 0.99 [0.98, 1.00] 0.77 [0.72, 0.82] 0.97 [0.93, 1.00] 0.95 [0.90, 0.98] 0.83 [0.79, 0.87] 0.82 [0.76, 0.87] 0.93 [0.90, 0.96] 0.67 [0.65, 0.69] 0.85 [0.82, 0.88] 0.60 [0.57, 0.63] 0.87 [0.83, 0.91] 0.59 [0.56, 0.63] 0.50 [0.50, 0.50] 0.74 [0.69, 0.79] 0.84 [0.79, 0.88] 0.82 [0.77, 0.87] 0.76 [0.70, 0.84] 0.65 [0.64,0.67] 0.59 [0.51,0.68] 0.65 [0.62,0.69] 0.65 [0.59,0.73] 0.65 [0.64,0.67] 0.59 [0.51,0.67] 0.65 [0.64,0.67] 0.67 [0.6,0.75] 0.65 [0.64,0.67] 0.88 [0.82,0.93] 0.66 [0.67,0.67] 0.78 [0.72,0.86] 0.59 [0.55,0.63] 0.72 [0.67,0.77] 0.68 [0.67,0.7] 0.79 [0.73,0.85] 0.51 [0.46,0.56] 0.62 [0.55,0.69] 0.65 [0.63,0.67] 0.74 [0.67,0.82] 0.58 [0.54,0.62] 0.75 [0.68,0.81] 0.93 [0.89,0.97] 0.72 [0.64,0.8] 0.56 [0.52,0.61] 0.79 [0.72,0.86] 0.66 [0.67,0.67] 0.78 [0.71,0.85] 0.68 [0.63,0.75] 0.80 [0.73,0.88] 0.87 [0.82,0.92] 0.77 [0.7,0.85] 0.50 [0.46,0.56] 0.83 [0.78,0.89] 0.70 [0.65,0.77] 0.62 [0.54,0.71] 0.33 [0.33,0.33] 0.50 [0.5,0.5] 0.51 [0.46,0.56] 0.75 [0.68,0.83] Balanced accuracy [95% CI] for Mycobacterium abscessus clinical isolate characterization. Bold indicates the overall top-performing models across tasks. Autoencoder hybrids (DAE: fully connected Deep Autoencoder; DCAE: Deep Convolutional Autoencoder) were evaluated with conventional ML classifiers: KNN (K-Nearest Neighbors), XGBoost (Extreme Gradient Boosting), ExtraTrees, RF (Random Forest), GB (Gradient Boosting), Light Gradient Boosting Machine (LightGBM), GNB (Gaussian Naive Bayes), LDA (Linear Discriminant Analysis), QDA (Quadratic Discriminant Analysis), and SVC (Support Vector Classifier). Heatmap of model rankings for the species classification task (Anopheles species dataset). The heatmap illustrates the ranking of each model across the three evaluated anatomical parts, where a lower rank indicates better performance. Models are ranked from 1 (best) to higher values (worse). Rankings ending in .5 indicate tied performance between models for that specific part. Heatmap of model rankings for the MABS dataset (subspecies and antibiotic resistance identification). Model rankings for the MABS dataset are visualized across the two evaluation criteria: subspecies identification and antibiotic resistance classification. Lower ranks correspond to superior performance. Fractional ranks (e.g., .5) denote ties between models where performance was equivalent for a specific criterion. Performance–efficiency trade-off across classification and regression tasks. A Anopheles species classification (leg anatomical part). B Anopheles age estimation (leg anatomical part). C MABS subspecies identification. D MABS antibiotic resistance detection. Each point represents a model. The x-axis shows training time (seconds). The y-axis shows classification balanced accuracy (%) for (A), (C), and (D), and mean absolute error (MAE) for panel B. Models located toward the upper-left region in (A), (C), and (D), and the lower-left region in (B), achieve high predictive performance with low computational cost, representing an optimal performance–efficiency balance. Energy consumption of models during training. Estimated energy usage (in kilowatt-hours, kWh) was calculated using CarbonTracker, a tool for monitoring the energy and carbon footprint of machine learning workflows. For the Anopheles species and age estimation tasks, results are shown using leg spectra only; other anatomical parts were processed independently and showed comparable energy profiles (see Supplementary Information). For autoencoder-based models (DAE fully connected deep autoencoder, DCAE deep convolutional autoencoder), reported values reflect only the dimensionality reduction step. Energy consumption for subsequent conventional machine learning models was typically below 0.01 kWh (see Supplementary Information for details). Anopheles species identification As shown in Table 1 and detailed in Table 2, Deep Autoencoder (DAE) + Gradient Boosting achieved 95% balanced accuracy with low variability (±3% CV SD). Recurrent Neural Network – Bidirectional Gated Recurrent Unit (RNN-BiGRU), Temporal Convolutional Network (TCN), and Transformer also performed well (90–93% balanced accuracy, <5% CV SD, Table S1), while hybrid Two-Dimensional (2D) models showed greater variance. Performance rankings were consistent across anatomical parts (Fig. 2). The performance–efficiency trade-offs for these models are shown in Figs. 5–7. Mosquito age estimation Performance metrics in Table 3 show that the 1-Dimensional Convolutional Neural Network (1DCNN) achieved the lowest MAE (1.92 days, ±0.58 days CV SD), closely followed by TCN (1.94 days, ±0.33 days). Transformer and 2D hybrid models provided marginal gains on specific parts but with higher variability, as did autoencoder-based features (Table S2). Figure 3 illustrates these patterns across body parts. Architectures capturing temporal dependencies (1DCNN, TCN, RNN-BiGRU) outperformed static feature representations such as autoencoder-extracted features or fixed 2D spectral images for this regression task. Table 3Model performance for mosquito age estimationModel typeModelLegsHeadThoraxNeural network1DCNN2.27[2.00, 2.54]2.04[1.77, 2.38]1.92[1.67, 2.17]TCN2.49[2.19, 2.84]2.08[1.74, 2.46]1.94[1.65, 2.23]RNN-BiGRU2.77[2.39, 3.14]3.36[2.81, 3.91]2.80[2.27, 3.34]ESN2.99[2.65, 3.33]3.35[2.87, 3.78]2.85[2.44, 3.31]Transformer2.81[2.42, 3.24]3.30[3.16, 3.64]2.96[2.42, 3.58]2DCNN spectrogram2.68[2.34, 3.03]2.56[2.18, 2.93]2.43[2.04, 2.81]2DCNN BiGRU-Hybrid spectrogram3.24[2.79, 3.74]3.86[3.35, 4.40]3.57[2.97, 4.24]2DCNN scalogram3.09[2.75, 3.51]3.68[3.18, 4.20]2.33[1.99, 2.73]2DCNN BiGRU-Hybrid scalogram3.25[2.90, 3.66]3.99[3.12, 4.91]2.20[1.85, 2.58]DAE autoencoder + MLDAE + KNN3.25[2.85, 3.70]2.97[2.55, 3.40]2.26[1.82, 2.78]DAE + XGBoost3.34[2.93, 3.74]3.56[3.02, 4.08]3.23[2.68, 3.81]DAE + ExtraTrees2.64[2.33, 2.97]3.39[2.93, 3.83]2.25[1.89, 2.64]DAE + RF2.50[2.23, 2.80]3.69[3.18, 4.27]2.96[2.43, 3.58]DAE + GB2.78[2.48, 3.10]3.31[2.84, 3.83]2.67[2.22, 3.18]DAE + LightGBM2.46[2.15, 2.77]3.52[3.09, 3.99]3.07[2.48, 3.68]DAE + LR3.28[2.96, 3.62]2.93[2.43, 3.42]2.78[2.39, 3.23]DCAE autoencoder + MLDCAE + KNN3.28[2.87, 3.72]3.00[2.47, 3.54]2.84[2.43, 3.23]DCAE + XGBoost3.30[2.86, 3.76]4.61[4.10, 5.14]3.25[2.64, 3.96]DCAE + ExtraTrees2.81[2.50, 3.15]3.56[3.18, 4.02]2.44[2.12, 2.81]DCAE + RF2.54[2.14, 2.97]3.72[3.31, 4.18]2.79[2.29, 3.35]DCAE + GB2.58[2.22, 2.93]3.10[2.72, 3.52]2.60[2.16, 3.09]DCAE + LightGBM2.47[2.10, 2.82]3.16[2.77, 3.57]2.52[2.07, 3.05]DCAE + LR9.79[7.84, 12.24]7.89[6.77, 9.09]16.23[12.68, 20.06]Mean absolute error (MAE) [95% CI] across mosquito body parts and model architectures. Bold indicates the overall top-performing models across tasks. Autoencoder hybrids (DAE: fully connected Deep Autoencoder; DCAE: Deep Convolutional Autoencoder) were evaluated with conventional ML regressors: KNN (K-Nearest Neighbors), XGBoost (Extreme Gradient Boosting), ExtraTrees, RF (Random Forest), GB (Gradient Boosting), Light Gradient Boosting Machine (LightGBM), and LR (Linear Regression). Model performance for mosquito age estimation 2.27 [2.00, 2.54] 2.04 [1.77, 2.38] 1.92 [1.67, 2.17] 2.49 [2.19, 2.84] 2.08 [1.74, 2.46] 1.94 [1.65, 2.23] 2.77 [2.39, 3.14] 3.36 [2.81, 3.91] 2.80 [2.27, 3.34] 2.99 [2.65, 3.33] 3.35 [2.87, 3.78] 2.85 [2.44, 3.31] 2.81 [2.42, 3.24] 3.30 [3.16, 3.64] 2.96 [2.42, 3.58] 2.68 [2.34, 3.03] 2.56 [2.18, 2.93] 2.43 [2.04, 2.81] 3.24 [2.79, 3.74] 3.86 [3.35, 4.40] 3.57 [2.97, 4.24] 3.09 [2.75, 3.51] 3.68 [3.18, 4.20] 2.33 [1.99, 2.73] 3.25 [2.90, 3.66] 3.99 [3.12, 4.91] 2.20 [1.85, 2.58] 3.25 [2.85, 3.70] 2.97 [2.55, 3.40] 2.26 [1.82, 2.78] 3.34 [2.93, 3.74] 3.56 [3.02, 4.08] 3.23 [2.68, 3.81] 2.64 [2.33, 2.97] 3.39 [2.93, 3.83] 2.25 [1.89, 2.64] 2.50 [2.23, 2.80] 3.69 [3.18, 4.27] 2.96 [2.43, 3.58] 2.78 [2.48, 3.10] 3.31 [2.84, 3.83] 2.67 [2.22, 3.18] 2.46 [2.15, 2.77] 3.52 [3.09, 3.99] 3.07 [2.48, 3.68] 3.28 [2.96, 3.62] 2.93 [2.43, 3.42] 2.78 [2.39, 3.23] 3.28 [2.87, 3.72] 3.00 [2.47, 3.54] 2.84 [2.43, 3.23] 3.30 [2.86, 3.76] 4.61 [4.10, 5.14] 3.25 [2.64, 3.96] 2.81 [2.50, 3.15] 3.56 [3.18, 4.02] 2.44 [2.12, 2.81] 2.54 [2.14, 2.97] 3.72 [3.31, 4.18] 2.79 [2.29, 3.35] 2.58 [2.22, 2.93] 3.10 [2.72, 3.52] 2.60 [2.16, 3.09] 2.47 [2.10, 2.82] 3.16 [2.77, 3.57] 2.52 [2.07, 3.05] 9.79 [7.84, 12.24] 7.89 [6.77, 9.09] 16.23 [12.68, 20.06] Mean absolute error (MAE) [95% CI] across mosquito body parts and model architectures. Bold indicates the overall top-performing models across tasks. Autoencoder hybrids (DAE: fully connected Deep Autoencoder; DCAE: Deep Convolutional Autoencoder) were evaluated with conventional ML regressors: KNN (K-Nearest Neighbors), XGBoost (Extreme Gradient Boosting), ExtraTrees, RF (Random Forest), GB (Gradient Boosting), Light Gradient Boosting Machine (LightGBM), and LR (Linear Regression). Heatmap of model rankings for the age estimation task (Anopheles age dataset). The heatmap presents model performance rankings for the age estimation task across the three evaluated anatomical parts, with 1 being the best rank. Tied rankings are indicated by .5, reflecting identical performance scores between models for a given anatomical part. MABS subspecies and antimicrobial resistance classification For the MABS dataset (Table 4), RNN-BiGRU achieved 95% balanced accuracy for subspecies classification (±10% CV SD), while 1DCNN reached 99% balanced accuracy for resistance prediction (±12% CV SD). TCNs and Transformers also performed well, whereas spectrogram-based hybrids were less effective (50–60% balanced accuracy). Autoencoder-based pipelines showed reliable performance (Table S3, Fig. 4), suitable for limited (41 strains) and imbalanced datasets. Performance–efficiency trade-offs Training time and energy usage varied widely across architectures (Figs. 5–7): lightweight models (1DCNN, TCN, Echo State Network (ESN)) completed training in 1–2 min and consumed <0.01 kWh, whereas Transformer and 2D hybrid architectures were more computationally demanding due to pre-training and image-based processing. Figure 5 illustrates the performance–efficiency trade-off: for classification tasks (panels A, C, D), models toward the top-left corner achieve high balanced accuracy with low computational cost; for regression (panel B), models toward the bottom-left corner represent the optimal trade-off. Across tasks, lightweight temporal models generally occupied these optimal regions, demonstrating strong predictive performance with minimal computational cost. Energy consumption28 followed similar trends, with the most time-intensive architectures also exhibiting the highest values (Figs. 6–7). Overall consumption remained modest across all models, with the upper range (0.07 kWh) roughly equivalent to running a standard laptop for less than one hour. Model training times. Training durations (in seconds) are reported across all tasks. For the Anopheles dataset and age estimation tasks, only leg spectra were used, as other anatomical parts were processed separately and showed comparable execution times (see Supplementary Information). For autoencoder-based pipelines (DAE: fully connected Deep Autoencoder; DCAE: Deep Convolutional Autoencoder), reported durations reflect only the dimensionality reduction step. Subsequent training of conventional machine learning models typically required less than 5 s (see Supplementary Information). Discussion Deep learning can enhance the diagnostic value of MALDI-TOF mass spectrometry while remaining computationally efficient, which is critical for clinical and field deployment. By exploring non-traditional spectral representations—including aligned 1D vectors, dimensionality-reduced embeddings, and 2D formats such as spectrograms and scalograms—we were able to capture spectral features often overlooked by conventional workflows. These representations enabled the application of architectures typically used for images, time-series, or audio29, expanding MALDI-TOF’s analytical potential and allowing the extraction of subtle, biologically relevant patterns. Among the evaluated architectures, RNN-BiGRU, TCN, and 1DCNN consistently achieved high performance across both microbial and entomological tasks. These models generalized well across datasets, maintained low inference latency, and exhibited minimal energy consumption, highlighting the importance of selecting architectures that match the underlying spectral structure. While Transformer-based, hybrid, and autoencoder pipelines showed some task-specific promise, they were generally more computationally demanding and less robust on limited datasets. Our energy consumption analysis provides empirical support for this constraint, demonstrating that their computational overhead often outweighs their marginal performance benefit in clinical settings, underscoring that fit-for-purpose, lightweight architectures are preferable for real-world MALDI-TOF applications, particularly in resource-constrained environments, where simplicity and reliability are key. We explicitly addressed the field’s well-known lack of external validation and its associated susceptibility to overfitting, which remains a major limitation of MALDI-TOF machine learning pipelines30. Rather than relying solely on within-dataset cross-validation15, we adopted a dual evaluation strategy combining cross-validation with independent test sets and cross-dataset assessment. For microbial spectra (MABS), we used held-out test sets, while for Anopheles mosquito datasets, we incorporated data from two laboratories to provide a first assessment of inter-instrument generalizability. Importantly, this design was not merely evaluative but constitutive of our modeling approach: models were developed, selected, and compared based on their ability to generalize across datasets rather than maximize within-task accuracy alone. This approach mitigates data-specific biases and better reflects real-world deployment conditions, where acquisition protocols, instruments, and population structures inevitably differ. By combining balanced accuracy on independent test sets with standard accuracy across cross-validation folds, we were able to explicitly distinguish predictive power from model stability. We therefore argue that systematic cross-dataset validation should become a standard practice in MALDI-TOF-based AI research to ensure scalability beyond controlled experimental environments. In this context, standardizing preprocessing pipelines and quantifying instrument-related variability will be critical for reliable large-scale deployment15. Applying this framework to real diagnostic tasks yielded robust performance across key challenges. In clinical microbiology, we addressed the need to differentiate closely related Mycobacterium abscessus subspecies and detect antimicrobial resistance (AMR)—persistent limitations of conventional MALDI-TOF systems31 that require models capable of capturing fine-grained spectral differences. Using a relatively small dataset (n = 814 spectra), our RNN-BiGRU model achieved reliable subspecies classification, surpassing earlier approaches based on traditional machine learning20. For AMR detection, the streamlined 1DCNN attained 99% balanced accuracy with minimal preprocessing. This performance matches that of traditional models reliant on complex feature engineering15,21,32–34. It also aligns with state-of-the-art approaches using Transformers or transfer learning, which typically require vastly larger datasets (20,000–300,000 spectra)32,33,35,36. These advances support the deployment of such models in routine microbiology workflows, where rare pathogens and class imbalance are common. In entomological surveillance, the framework proved effective for high-resolution tasks. Models predicted mosquito age with a mean absolute error of 2–3 days and achieved up to 95% balanced accuracy for genetically diverse species identification, including both field-collected and laboratory-reared specimens, with misclassifications confined to the most spectrally similar species (An. gambiae vs. An. coluzzii). These results echo recent work using specialized architectures such as Siamese networks37 and autoencoders38 but are strengthened by validation on independent, multi-laboratory test data. These performance metrics support the feasibility of scalable vector surveillance and real-time epidemiological monitoring. This framework could be adapted for longitudinal surveillance and outbreak detection by modeling temporal shifts in spectral profiles or by establishing baseline models for anomaly detection. Several limitations of our approach should be acknowledged. Not all advanced architectures are equally suited to the current data landscape of clinical mass spectrometry. Transformer-based models did not outperform simpler architectures in our benchmark, reflecting a mismatch between their data requirements (typically massive corpora) and current MALDI-TOF dataset scales. While domain-adapted variants show promise for specific tasks like AMR prediction32, their general superiority for routine clinical applications remains unestablished. This underscores the need for systematic benchmarks to define the pre-training data scale and quality required for effective fine-tuning. These architectural constraints intersect with broader limitations for clinical translation. First, our validation was largely confined to single-instrument settings (MABS, Anopheles age datasets), limiting the assessment of robustness across devices and protocols. As demonstrated in prior work16, future studies must prioritize comprehensive out-of-distribution validation (multi-site, multi-platform) to establish reproducibility—a critical step for regulatory adoption15. Second, dataset sizes, especially for M. abscessus, constrained our evaluation of global strain diversity, underscoring the need for expanded, geographically diverse cohorts. Third, the utility of advanced spectral transformations (e.g., Wavelet, Fourier)39,40, was strongly task-dependent, proving ineffective for complex microbial tasks—possibly due to reduced interpretability on non-temporal m/z data—but beneficial for entomological applications. This highlights a pragmatic trade-off: these transformations may enhance predictive power in specific contexts, but at the cost of direct interpretability, which must be weighed on a per-application basis. Finally, while this study focused on deep learning for automated feature extraction, future work should include direct comparisons with traditional machine learning and established preprocessing methods (e.g., 6000-point binning21) to fully contextualize performance37. Beyond these methodological and validation challenges, successful integration into clinical workflows requires overcoming persistent operational barriers, including the development of user-friendly interfaces41. Consequently, future progress hinges on three integrated priorities: (1) rigorous external validation of efficient architectures across heterogeneous settings; (2) targeted methodological innovation, including specialized designs (e.g., ensemble42 and hybrid43 models), emerging paradigms (e.g., Transformers32,35,44, Siamese networks37), and refined spectral preprocessing (e.g., Discrete Wavelet Transforms45,46); and (3) the development of enabling infrastructure—specifically, standardized spectral databases with robust quality control, alongside interpretability tools (e.g., attention maps) and a maintained focus on computational efficiency—to foster clinical trust and ensure deployability. The architectures identified here—achieving >95% accuracy with sub-second inference47,48—demonstrate that this balance is attainable and lay a foundation for translating MALDI-TOF into a scalable, actionable platform. To bridge the gap between these algorithmic insights and real-world applications, we provide a practical roadmap for integration in the “Practical Integration and Deployment” section of the Supplementary Information. This roadmap details key deployment considerations, including interoperability with existing laboratory information systems, scalability constraints, and a cost-benefit analysis for resource-limited settings. By maintaining a focus on efficiency and real-world applicability, this work charts a clear pathway to transition MALDI-TOF from a research tool into a broadly deployable resource for precision diagnostics and global health surveillance. A critical next step will be prospective clinical validation across diverse geographies, potentially integrated with emerging portable MALDI-TOF systems to pave the way for AI-driven diagnostics at the point of care. Methods To evaluate model performance, we used three distinct cohorts (referred to as datasets in the rest of the article), considering computational constraints: MABS dataset, Anopheles age dataset, Anopheles species dataset. Each dataset was divided into a training set and an independent test set to assess model performance on previously unseen data (Fig. 8). Schematic overview of the analytical pipeline. Raw MALDI-TOF (Matrix-Assisted Laser Desorption/Ionization Time-of-Flight) spectra from microbial isolates and mosquito samples underwent standardized preprocessing, including baseline correction, interpolation, and normalization. Spectra were then converted into multiple input formats, including aligned one-dimensional (1D) vectors, embeddings for autoencoders, Short-Time Fourier Transform (STFT) spectrograms, and Continuous Wavelet Transform (CWT) scalograms (two-dimensional, 2D representations), before model training. These representations enabled evaluation of diverse deep learning architectures, including convolutional (1DCNN), recurrent (RNN-BiGRU), temporal convolutional (TCN), Transformer, hybrid, and autoencoder-based models. Models were trained and compared across diagnostic tasks using a unified evaluation framework combining cross-validation, independent test sets, and computational cost metrics. Dataset formation and task definition Subspecies and drug resistance classification in Mycobacterium abscessus (MABS dataset) Mycobacterium abscessus subspecies—M. abscessus subsp. abscessus (M. abscessus), M. abscessus subsp. bolletii (M. bolletii), and M. abscessus subsp. massiliense (M. massiliense)—are opportunistic pathogens responsible for severe pulmonary and soft-tissue infections49–52. Differentiating between these genetically similar subspecies is clinically important because they exhibit distinct patterns of susceptibility to clarithromycin, a cornerstone antibiotic in treatment. Most M. abscessus and M. bolletii strains are resistant due to the erm(41) gene53, while M. massiliense is generally susceptible due to genetic mutations54–56, affecting treatment outcomes53,57. MALDI-TOF MS is a standard diagnostic tool for microbial identification, but it struggles to resolve these closely related subspecies due to overlapping protein profiles58. The “MABS” dataset (Table 5), sourced from a public repository59, includes mass spectra from clinical isolates: M. abscessus (comprising 61% of the total spectra, 20 isolates), M. massiliense (27%, 9 isolates), and M. bolletii (12%, 4 isolates). Clarithromycin-resistant isolates constitute 68% of the dataset, reflecting real-world prevalence60,61. Table 5Overview of datasets and their translational significanceDatasetTaskLabel distribution (or value range)Data distribution (training/test)TargetClinical / epidemiological significanceMABSMulticlass classification (Three classes)M. subsp. abscessus (61%)M. subsp. bolletii (12%)M. subsp. massiliense (27%)33/8 isolates814/187 spectraM. subsp. abscessus, M. subsp. bolletii,M. subsp. massilienseGuides targeted therapy and infection control protocols.MABSBinary classificationR (68%)S (32%)33/8 isolates814/187 spectraResistant,SensitiveEnables early detection to switch to effective therapy.Anopheles ageRegression0 (13%)3 (12%)6 (10%)8 (7%)10 (10%)14 (12%)17 (7%)20 (12%)24 (8%)28 (10%)Legs:202 / 36 specimens806 / 144 spectraHead:183 / 32 specimens727 / 124 spectraThorax:179 / 31 specimens689 / 117 spectraMosquito age estimation 0 to 28 daysEstimates transmission risk to optimize insecticide spraying campaigns.Anopheles speciesMulticlass classification (Four classes)An. arabiensis (46%)An. coluzzii (33%)An. gambiae (20%)An. funestus (2%)Legs:211 / 40 specimens1047 / 188 spectraHead:214 / 46 specimens1089 / 214 spectraThorax:203 / 54 specimens999 / 279 spectraAn. arabiensis,An. coluzzii,An. gambiae,An. funestusIdentifies primary vectors for focused and sustainable insecticide use.Summary of datasets used across classification and regression tasks, including label distribution, training/testing splits, prediction targets, and the clinical or epidemiological rationale for each task. Overview of datasets and their translational significance M. subsp. abscessus (61%) M. subsp. bolletii (12%) M. subsp. massiliense (27%) 33/8 isolates 814/187 spectra M. subsp. abscessus, M. subsp. bolletii, M. subsp. massiliense R (68%) S (32%) 33/8 isolates 814/187 spectra Resistant, Sensitive 0 (13%) 3 (12%) 6 (10%) 8 (7%) 10 (10%) 14 (12%) 17 (7%) 20 (12%) 24 (8%) 28 (10%) Legs: 202 / 36 specimens 806 / 144 spectra Head: 183 / 32 specimens 727 / 124 spectra Thorax: 179 / 31 specimens 689 / 117 spectra An. arabiensis (46%) An. coluzzii (33%) An. gambiae (20%) An. funestus (2%) Legs: 211 / 40 specimens 1047 / 188 spectra Head: 214 / 46 specimens 1089 / 214 spectra Thorax: 203 / 54 specimens 999 / 279 spectra An. arabiensis, An. coluzzii, An. gambiae, An. funestus Summary of datasets used across classification and regression tasks, including label distribution, training/testing splits, prediction targets, and the clinical or epidemiological rationale for each task. The dataset was split 80/20 into training and test sets and used to evaluate deep learning models for both subspecies classification and resistance prediction—two tasks that are highly relevant to rapid diagnostics in clinical settings. The imbalance in subspecies and resistance classes also serves as a challenge for robust algorithm development. Age estimation of field-collected Anopheles mosquitoes (Anopheles age dataset) Mosquito age is a critical factor in malaria transmission: the older the mosquito, the higher the likelihood it has survived long enough to become infectious. Accurate age grading in the field remains a major bottleneck in vector control, with current methods being labor-intensive, imprecise, and poorly scalable62. MALDI-TOF MS has recently shown potential in addressing this challenge63,64 by capturing subtle age-dependent changes in mosquito protein profiles65. The “Anopheles age” dataset (Table 5), derived from a previous study64, comprises An. arabiensis specimens reared from larvae collected at two distinct field sites in Senegal (Senegal 1 and Senegal 2) to maximize genetic variability. Specimens were processed independently on the same MALDI-TOF instrument to introduce technical variation and simulate real-world diagnostic heterogeneity. Age classes were homogenously distributed (7–13%) across the dataset (see Table 5). Spectra from 80% of the combined dataset were used for training, while an independent test set was drawn from Senegal 1. Senegal 2 data showed comparable results but were excluded due to limited sample size64. Spectra from anatomical parts (legs, head, thorax) were treated as independent inputs to test model robustness across body compartments. This dataset was used to evaluate deep learning models for continuous mosquito age prediction from MALDI-TOF spectra—an important advancement for epidemiological modeling and targeted vector control. Species identification in African malaria vectors (Anopheles species dataset) Effective malaria control requires accurate identification of vector species, as different Anopheles species vary in their transmission capacity, behavior, and insecticide resistance. In sub-Saharan Africa, species from the An. gambiae complex and An. funestus account for over 90% of malaria transmission66,67. However, current identification methods face limitations: molecular tools are accurate but expensive and slow, while morphological approaches struggle to distinguish cryptic species68,69. MALDI-TOF spectrometry shows promise in distinguishing species using protein biomarkers17,70. The “Anopheles species” dataset (Table 5) includes specimens from field collections and insectary colonies across multiple African countries, encompassing genetic, physiological, and geographical diversity. This includes An. arabiensis (Senegal, South Africa), An. coluzzii (Mali, Guinea), An. gambiae (Mali, Guinea, Congo, Kenya), and An. funestus (Mali). Samples included both laboratory-reared larvae and wild-caught, blood-fed adults to simulate real-world heterogeneity (see Table S7 in Supplementary Information for additional details). Despite extensive sample variation, conventional approaches (e.g., t-tests, ANOVA, PCA) failed to identify discriminating spectral peaks (Figs. S1 and S2, Supplementary Information), highlighting the complexity of the classification task. Spectra were divided 80/20 into training and test sets. Each anatomical part (legs, head, thorax) was evaluated independently to assess model performance across biologically distinct inputs. This dataset enables rigorous evaluation of neural networks for distinguishing closely related vector species, with three key applications: (1) resolving cryptic species within the An. gambiae complex (An. arabiensis, An. coluzzii, An. gambiae)67, including the challenging differentiation of An. gambiae and An. coluzzii70; (2) identifying the more distant An. funestus as a taxonomic control; and (3) validating MALDI-TOF’s potential as a scalable tool for field surveillance. The inclusion of both laboratory and wild specimens ensures relevance to real-world deployment scenarios. Mass spectrometry data acquisition For the Mycobacterium abscessus dataset, protein extracts from 41 strains were prepared using the MycoEx59 and analyzed in eight technical replicates on a Microflex LT MALDI-TOF mass spectrometer (Bruker Daltonics) following the manufacturer’s standard clinical diagnostics method (CE-IVD). Key instrument parameters were: mass range 2000–20,000 Da, ion source 1 voltage 20 kV, lens voltage 8.45 kV, and pulsed ion extraction 330 ns. Spectra were acquired from 500 laser shots per spot. For the Anopheles mosquito datasets, protein extracts from dissected body parts were processed as previously described63 and spotted in quadruplicate. Spectral acquisition was performed using the same Microflex LT system (Bruker France SAS) with default parameters. To ensure data quality across all datasets, we excluded spectra with flat peaks, anomalous peaks, or a mass shift >500 ppm. For the mosquito data, we additionally applied a minimum Bruker log score of 2 and a correlation index of 0.8 between replicates of the same mosquito specimen, consistent with our prior work64. Deep learning models for MALDI-TOF spectra with multiple input representations MALDI-TOF mass spectrometry is a powerful technology in biomedical diagnostics, producing high-dimensional spectral profiles that encode rich proteomic information. Each MALDI-TOF spectrum consists of approximately 20,000 data points—capturing both peptide/protein signals and instrumental noise45,71–73. Given the complexity of these signals, tailored preprocessing steps are essential to denoise the data, enhance peak structure, and optimize downstream model performance. We evaluated a range of deep learning models, each paired with preprocessing workflows adapted to their input needs. These models span convolutional, recurrent, transformer, hybrid, and autoencoder architectures, and support binary and multiclass classification, as well as regression tasks. Supplementary figures are provided in the Supplementary Information. One-dimensional convolutional neural networks (1D CNNs) We implemented two 1DCNN architectures designed for sequential input: a standard 1D Convolutional Neural Network (1DCNN) and a Temporal Convolutional Network (TCN). Preprocessing To preserve the original spectral information, preprocessing was limited to essential steps: gentle smoothing64, baseline correction74, and a derivative-based transformation75 to accentuate peaks. Spectral alignment76 ensured sample comparability (Fig. S3). This approach provided the convolutional layers with minimally altered data for optimal feature detection. Models Both models apply convolutional layers to detect and localize discriminative peaks in the spectrum. The TCN extends this by employing hierarchical, dilated convolutions that capture long-range dependencies across the spectrum77,78. This is particularly beneficial in MALDI-TOF, where biologically relevant signals may be separated by long intervals but remain functionally linked (see Fig. S4). Recurrent neural networks (RNNs) and transformer architecture We evaluated three neural architectures for 1D spectral sequences: a Bidirectional Gated Recurrent Unit -based RNN with attention (RNN-BiGRU), an Echo State Network (ESN), and a Transformer-based model with self-supervised pre-training. Preprocessing After smoothing and baseline correction, spectra were standardized to 5,000 points via interpolation, contrasting with the 6000-point binning used elsewhere21. This resolution preserves peak morphology while ensuring uniform input length for recurrent architectures. Test spectra were independently adjusted to avoid data leakage75. A first derivative was applied to enhance noise suppression and center information (Fig. S5). Models The RNN-BiGRU model incorporates an attention mechanism to weigh critical time points within the spectrum, facilitating the identification of subtle but biologically meaningful deviations79,80. The ESN, in contrast, utilizes a fixed, randomly initialized reservoir of recurrent neurons81, enabling fast training while retaining the capacity to model long-range temporal dependencies. This makes ESNs particularly appealing for high-throughput, real-time diagnostics (see Fig. S6). The Transformer architecture82,83 employs multi-head self-attention to capture global dependencies across spectral regions without recurrence32,35. We implemented a two-stage training approach: first, self-supervised pre-training using masked spectral reconstruction44 to learn rich spectral representations; second, supervised fine-tuning for classification and regression tasks (see Fig. S11). This approach enables the model to leverage unlabeled data while maintaining strong performance on downstream diagnostic tasks (see Fig. 9). Transformer architecture with self-supervised pre-training for spectral analysis. Left: Self-supervised pre-training learns spectral representations from unlabeled data via masked reconstruction. The model predicts masked spectral regions, capturing intrinsic data structure without ground-truth labels. Right: Supervised fine-tuning adapts the pre-trained model to specific diagnostic tasks using labeled spectra. The encoder, optionally frozen during fine-tuning, extracts meaningful features for the classification head. Two-dimensional representations for computer vision models To apply image-based deep learning to MALDI-TOF spectra, we first transformed the one-dimensional spectra into two-dimensional representations using two complementary time–frequency methods: the Short-Time Fourier Transform (STFT)84–86 to generate spectrograms, and the Continuous Wavelet Transform (CWT)39,87,88 to produce scalograms. In this abstraction, the mass-to-charge (m/z) axis is treated as a pseudo-temporal domain. Although these transforms have been used previously for feature extraction and noise reduction, their output features are not directly interpretable in terms of the original biophysical properties; we included them here to empirically evaluate their predictive power. We then evaluated both standard 2DCNN and hybrid 2DCNN–BiGRU architectures on these transformed data. Preprocessing for 2D transformations Prior to transformation, all spectra underwent baseline correction and were interpolated to a standardized length of 4,000 points. The STFT89 or CWT90 was then applied to generate the corresponding 2D representations. Spectrograms89 were formatted as normalized grayscale images, while scalograms90 were formatted as RGB images, both ready for model input (see Figs. 10 and 11). Spectrogram generation pipeline for 2DCNN and 2DCNN BiGRU-hybrid models. Raw spectral data undergoes baseline correction and interpolation (spacing of 5), reducing dimensionality from 20,000 to 4000 points. The resulting spectrum is differentiated and transformed into a two-dimensional time–frequency representation (spectrogram) using the Short-Time Fourier Transform (STFT) via Librosa. This time–frequency representation is then normalized and rendered as a 128 × 128 grayscale image using OpenCV. In the spectrogram, intensity reflects signal magnitude (lighter tones indicate higher intensity), capturing temporal and frequency-dependent features. A colorized version is shown for visualization. Scalogram generation pipeline for 2DCNN and 2DCNN BiGRU-hybrid models. Following baseline correction and 5-point interpolation (reducing from 20,000 to 4000 data points), the spectrum is differentiated and processed using the Continuous Wavelet Transform (CWT), enabling multi-scale frequency analysis. The transformed signal is segmented into nine parts to capture local spectral variations at multiple scales, each converted into a 75 × 75 RGB scalogram using Matplotlib and Skimage. These scalograms represent wavelet coefficients across time and scale, with color variations corresponding to different spectral intensities and resolutions. Model architectures First, standard 2D CNNs learn spatial patterns of intensity89 across the image. Second, hybrid 2DCNN–Bidirectional GRU models first extract spatial features with a CNN and then capture temporal context across frequency bands or scales using recurrent layers91. While both transforms enable the use of computer vision models, they emphasize different aspects of the data: STFT highlights localized frequency patterns, whereas CWT captures multi-scale spectral structures. For scalograms, this multi-scale analysis was operationalized by dividing the CWT-transformed signal into sequential segments, processing each with a TimeDistributed 2DCNN, and modeling their temporal evolution with the BiGRU component (see Supplementary Figs. S7 and S8). Complete architectural details are provided in the Supplementary Information. Deep autoencoders for latent feature learning Autoencoders92 were used to learn compressed latent representations of MALDI-TOF spectra in a semi-supervised framework, enabling subsequent use in classical machine learning algorithms. Preprocessing Spectra underwent core preprocessing steps—smoothing, baseline correction, interpolation, and normalization—to generate standardized 5000-point inputs (Fig. S9). Models Two architectures were tested: a fully connected Deep Autoencoder (DAE) and a Deep Convolutional Autoencoder (DCAE). The encoder compresses spectra into ~100-dimensional latent vectors that preserve essential information while removing redundancy and noise. These embeddings were then used to train a suite of conventional classifiers and regressors (e.g., SVM, XGBoost, Random Forests, LightGBM, LDA/QDA, KNN). The decoder, while not used in this study, could be deployed to reconstruct denoised spectra when needed25,38 (see Fig. S10). Implementation details All data processing and model development were conducted in Python, using TensorFlow and Keras, with specialized libraries such as Keras-TCN for temporal convolutional models. To prevent data leakage and ensure robust evaluation, spectra were stratified by strain (for MABS) or specimen (for mosquito datasets), with replicates assigned exclusively to either training (80%) or testing (20%) sets via StratifiedKFold from Scikit-Learn93. To further assess model stability and generalization, we performed repeated k-fold cross-validation (CV). Due to class imbalance, we used a 4-fold CV for the Anopheles age and MABS datasets, and a 3-fold CV for the Anopheles species identification dataset. Each CV scheme was repeated 5 times with different random partitions, and results are reported as mean ± standard deviation across all runs (Supplementary Information, Tables S1–S3). Model training was performed on a GTX TITAN X Maxwell GPU using the Adam optimizer. Model configurations were task-specific: classification models used softmax output activation trained with categorical cross-entropy loss; regression models used ReLU output activation trained with Huber loss and evaluated using Mean Absolute Error; autoencoders employed Mean Squared Error loss for spectral reconstruction and denoising. To address memory constraints and class imbalance, we utilized data generators for batching and applied class weighting during training. Early stopping (patience = 20) was implemented to prevent overfitting. Hyperparameters, including batch size and number of epochs, were tuned based on memory availability and preprocessing requirements. Model performance was evaluated using standard metrics, including accuracy, F1 score, precision, recall, AUROC, and balanced accuracy for classification, and mean absolute error (MAE), AUROC94, and R² for regression. Balanced accuracy95 and MAE were used as primary metrics to account for class imbalance and error robustness, respectively. All metrics were reported with 95% confidence intervals, estimated via the empirical bootstrap method96. Full performance metrics are provided in Supplementary Information, including a REFORMS checklist to support reproducibility and methodological transparency97. Ethics statement The study was conducted in accordance with the Declaration of Helsinki and with national (France) and institutional (Assistance Publique–Hôpitaux de Paris) standards. As only fully anonymized patient samples were used, and these were not obtained specifically for this study through any interaction or intervention with living individuals, neither informed consent nor IRB review was required. Supplementary information Supplementary_Information_review_2 Acknowledgements We are grateful to the Sorbonne Center for Artificial Intelligence (SCAI) for the technical support. We thank the Ile-de-France Region and Cerba HealthCare for their financial support of this work, as part of a DIM1Health project. The funder played no role in study design, data collection, analysis and interpretation of data, or the writing of this manuscript. We also extend our thanks to Marin Poinsignon for his valuable contribution to the preparation of certain datasets used in this study. Author contributions X.T. supervised the work and contributed resources. N.M. and X.T. developed the methodology, performed formal analysis, and wrote the original draft. N.M. wrote the main manuscript text. N.M., X.T., C.N. and A.G. conceived the study. N.M., A.G. and C.N. conducted investigations and curated data. N.M., A.G., R.P. and C.N. secured funding, contributed resources, and reviewed/edited the manuscript. N.M., C.N. and X.T. prepared visualizations. All authors read and approved the final manuscript. Data availability The MABS dataset generated and analyzed during the current study is available in the public repository [https://zenodo.org/records/5793313]. The mosquito datasets (*Anopheles* age and *Anopheles* species) generated and analyzed during the current study are not publicly available due to restrictions imposed by the data owner, but are available from the corresponding author on reasonable request. The underlying code for data preprocessing, model architectures, model evaluation and tuning, as well as result analysis, is available in the Epidemiology_DeepLearning_MALDI_Mohammad_et_al. repository and can be accessed via this link: [https://github.com/NoshineMo/Epidemiology_DeepLearning_MALDI_Mohammad_et_al]. Competing interests The authors declare no competing interests. Footnotes Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. Supplementary information The online version contains supplementary material available at https://doi.org/10.1038/s41746-026-02816-x. References Associated Data Supplementary Materials Supplementary_Information_review_2 Data Availability Statement The MABS dataset generated and analyzed during the current study is available in the public repository [https://zenodo.org/records/5793313]. The mosquito datasets (*Anopheles* age and *Anopheles* species) generated and analyzed during the current study are not publicly available due to restrictions imposed by the data owner, but are available from the corresponding author on reasonable request. The underlying code for data preprocessing, model architectures, model evaluation and tuning, as well as result analysis, is available in the Epidemiology_DeepLearning_MALDI_Mohammad_et_al. repository and can be accessed via this link: [https://github.com/NoshineMo/Epidemiology_DeepLearning_MALDI_Mohammad_et_al].