Malaria parasite cultures
Sample collection and parasite cultures were completed at Ifakara Health Institute’s laboratories in Bagamoyo, Tanzania using a protocol adapted from Trager and Jensen [47], with slight adjustments. Group O + blood was obtained from four malaria-free volunteers, and kept in tubes containing the anticoagulant, ethylenediaminetetraacetic acid (EDTA) for continuous culturing of P. falciparum strains NF54 and FCR3. The blood was centrifuged at 2500 rpm at 24°C for 10 minutes to obtain RBCs. The RBCs were then washed, diluted to 50% haematocrit with uncomplemented media (Roswell Park Memorial Institute (RPMI) 1640 media supplemented with hypoxanthine, neomycin and 4-(2-hydroxyethyl)-1-piperazineethanesulfonic acid (HEPES), and stored at 4°C.
The washed RBCs were used to culture P. falciparum in vitro for up to seven days. The asexual malaria parasites were grown in uninfected washed O + RBCs as host cells at 5% haematocrit, maintained in RPMI-1640 medium supplemented with 25 mM HEPES, 100 µM hypoxanthine, neomycin, 5% Albumax II and 24 mM Sodium bicarbonate. The parasite culture was gassed with a mixture of 5% CO2, 3% O2, and 93% N2 and incubated at 37°C. The culture was examined daily for parasitaemia estimation using field-stained (Hemacolor® rapid staining) thin blood smears under a compound microscope in 10 fields. Two rounds of parasite synchronization was performed to ensure the remaining of only ring-stage P. falciparum [48]. The culture was kept until the ring-stage parasitaemia level reached > 6% and was used for experimental dilutions. Parallel malaria-free cultures with only media and O + RBCs from the same volunteers were kept to create controls. The process was repeated for up to 11 batches, until we recruited and diluted blood from 70 volunteers.
Recruitment of malaria-free volunteers
We recruited malaria-free individuals from tertiary-level colleges in Bagamoyo, eastern Tanzania, following sensitization meetings, during which we explained the objectives, procedures, potential risks and benefits of the study. Participants who expressed interest were contacted by phone and requested to provide informed consent. The consenting participants were screened for malaria parasites using RDTs by taking a finger-prick blood sample, followed by a confirmatory quantitative polymerase chain reaction (qPCR) [49, 50]. Participants who tested negative for malaria were enrolled in the study, while those who tested positive were treated following Tanzania's malaria treatment guidelines and excluded from the study [51]. A total of 70 volunteer participants were recruited, all between 20 and 40 years old. A total of 40 mL venous blood was drawn in an EDTA tube from each participant and used for laboratory dilutions of cultured malaria parasites to create different malaria parasitaemia and haematocrit ratios.
Haematocrit dilutions to mimic anaemic conditions
For each participant, we made two sets of haematocrit dilutions to simulate different anaemic conditions for both infected and un-infected blood. One set had malaria-free blood at 50%, 25%, and 12.5% haematocrit content, while the other comprised infected red blood cells (iRBCs) from cultured parasites, adjusted to 50%, 25%, and 12.5% haematocrit ratios using respective plasma. For uninfected blood, 40 ml of venous blood from each participant was split into 5 ml and 35 ml portions and centrifuged to separate plasma from RBCs. After separation, plasma was transferred to empty 1.5mL tubes for haematocrit dilutions. RBCs from the 5 ml portion were used to formulate a 50% haematocrit stock solution by adding plasma from the same volunteer. Serial dilutions was done by transferring 2.5 ml of the stock solution to a second tube, and adding 2.5 ml of previously obtained plasma to simulate moderate anaemia (25% haematocrit) and severe anaemia (12.5% haematocrit) conditions (Fig. 1). On the other hand, for infected blood, when the culture reached > 6% ring stage parasitaemia, it was centrifuged to separate iRBCs from the culture media and washed twice. Washed iRBCs volume was 0.5 ml, which was mixed with an equal volume of participant plasma (0.5 ml) to create a 50% haematocrit ratio stock solution; and serially diluted to 25% and 12.5% solutions (Fig. 1).
Serial dilutions for different parasite densities and controls
The parasite dilutions were performed at the respective haematocrit ratios. Initially, the cultured parasitaemia was standardized to 6% stock – and in cases where the initial densities were higher, this was lowered to the 6% densities. Serial dilutions were done to create three additional parasitaemia levels, i.e. 0.1%, 0.002% and 0.00003%, were created from the stock solution.
The control group included malaria-negative samples at haematocrits of 50%, 25%, and 12.5% prepared from uninfected RBC from the culture with plasma from same individual participants. To ensure RBC distribution matched malaria parasitaemia dilutions, uninfected haematocrits from the culture were diluted with uninfected haematocrits from participants in volumes equal to the parasitaemia dilutions (Table S1).
Preparation of dried blood spots
For each individual volunteer, we created five replicates of dry blood spots (DBS) for each parasite density at each haematocrit level, resulting in a total of 75 DBS per participant. For each DBS, 50 µL of blood was added on the circular spot on the Whatman™ paper cards. The cards were air-dried for up to 3 hours and labelled with batch number, date, parasitaemia levels, haematocrit ratio, and participant ID. To prevent cross-contamination, each card was sealed in a plastic bag. The cards were then grouped by participant ID and stored in a cool environment in a larger bag with desiccant packets and a humidity card, awaiting transportation to another Ifakara Health Institute’s facility, the VectorSphere, at Ifakara, Tanzania for infrared scanning. During transport, the bags were kept in a cooler box with ice packs separated by plastic sheeting.
Acquisition and pre-processing of infrared spectra
The DBS were individually scanned using a Fourier transform infrared spectrometer (FT-IR) with a wavenumber range of 4000 − 500 cm⁻¹ and a resolution of 2 cm⁻¹. The instrument employed was a compact Bruker Alpha FTIR interferometer, equipped with a Platinum-Attenuated Total Reflectance (ATR) module that incorporates diamond crystals. Scanning was done after 3–5 days of DBS storage. Each blood spot was punched and placed on the diamond crystal. For scanning, each blood spot was excised, positioned on the diamond crystal, and subjected to pressure using an anvil to enhance the contact area with the crystal, thereby optimizing the depth of light penetration. Each spot was scanned 32 times to obtain an averaged spectrum, which was labelled by project initial, study site, participant ID, haematocrit ratio, parasitaemia ratio, and dates.
To quantify the depth of light penetration (d) in whole blood, we employed a theoretical approach that considers the wavelength of light (λ), incidence angle (θ), and the refractive indices of whole blood (n₁) and the diamond crystal (n₂) used in the spectrometer. The penetration depth (d) was calculated using the formula.
Given that the incidence angle (θ) was fixed at 45º, the refractive index of whole blood (n₁) was determined using the Sellmeier equation (with λ expressed in micrometres) [52]:
Similarly, the refractive index of the diamond crystal (n₂) was ascertained through its corresponding Sellmeier equation [16]:
The acquired spectra were then pre-processed using a Python program to compensate for atmospheric interferences, water vapour and carbon dioxide (CO2). The pre-processed spectra were subsequently used for training, testing, and validating machine-learning algorithms.
Selection of machine learning models
Machine learning analysis was conducted using the Python programming language, version 3.9. Employing a supervised ML classification approach, seven classifiers were evaluated: Logistic Regression (LR), Support Vector Machine (SVM), Random Forest (RF), Gradient Boosting (XBG), Decision Tree (DT), Extra Tree (ET) Classifier, and Bagging Classifier (BC).
The non-anaemic class (50% haematocrit) was utilized for ML algorithm selection and training, while the two other haematocrit ratios (25% and 12.5%) were kept separate and used to assess the impact of anaemia on the ability of the models to classify infected versus non-infected specimen from sets of previously unseen spectra (Table S2). To do this, the non-anaemia data was shuffled and split into two portions; 70% for model selection, training, and testing, while 30% were kept separate as an unseen dataset for validating the trained model. Further, 70% portion were divided into 80–20% train-test split, respectively.
We employed stratified shuffle split, 10-fold cross-validation (SSS-CV) to select the best machine-learning algorithm for identifying malaria infections. The seven mentioned algorithms were evaluated, and the best one was selected based on accuracy scores to distinguish malaria infections within the non-anaemia class using three approaches: (i) Cross-validation using datasets with high contrast (Positive class = 6%, N = 230) against the negative class (Negative = 0%, N = 230); (ii) Cross-validation with all concentrations (6%, 0.1%, 0.002%, and 0.00003%) combined as the positive class (N = 220) against the malaria-negative class (N = 220); and lastly, (iii) Cross-validation with low contrast (positive class = 0.00003%, N = 226) against the negative class (N = 226) datasets.
Training, testing and validation of machine learning models to identify malaria parasite presence in non-anaemic spiked blood
The best ML algorithms selected through SSS-CV were then trained on 80% of the spectra data from non-anaemic blood using three distinct approaches: (i) High Contrast: Models were trained using infrared spectra derived from DBS with the highest parasite densities (6%) as positive samples and non-infected blood as negatives. (ii) All Concentrations: Models were trained using combined infrared spectra data from DBS with any parasite densities as positives, and non-infected DBS served as negatives. (iii) Low Contrast: Models were trained using infrared spectra derived from DBS with the lowest parasite densities (0.00003%) as positives, and non-infected blood as negatives. The trained models underwent fine-tuning through Grid Search for optimal hyperparameter optimization.
For testing purposes, the final tuned classifiers were tested on a similar parasitaemia class used for training. For instance, the model trained on 80% of the data with high contrast at 6% against negatives was also tested on the remaining 20% of the data at the highest contrast against negative classes. In addition to accuracy, other evaluation measures such as sensitivity, specificity, recall, and F1-score on the test set (20%) were calculated. Finally, the best classifiers were validated on a completely unseen dataset, the 30% kept separate at the start. Beginning with non-anaemic classes at different parasitaemia levels, the total number of DBS included for model validation in the non-anaemic class with various parasitaemia levels were as follows: validated model performance on predicting malaria infections at non-anaemic conditions when positive at 6% parasitaemia (N = 82) against negative 0% (N = 82); then validated positive at 0.1% (N = 82) against negative 0% (N = 82), followed by positive at 0.002% (N = 82) against negative 0% (N = 82), and finally, positive at 0.00003% parasitaemia (N = 82) against negative 0% (N = 82).
Evaluating the effect of anaemia on performance of MIR-ML for distinguishing between blood samples with and without malaria parasites
The best classifiers developed for predicting malaria infections without considering anaemia were evaluated on a new dataset comprising cases of moderate anaemia (with a haematocrit level of 25%) and severe anaemia (with a haematocrit level of 12.5%). This evaluation was structured across four distinct categories: (1) malaria-positive with a 6% parasitaemia rate (N = 101) versus malaria-negative with a 0% parasitaemia rate (N = 101), (2) malaria-positive with a 0.1% parasitaemia rate (N = 101) versus malaria-negative (N = 101), (3) malaria-positive with a 0.002% parasitaemia rate (N = 101) versus malaria-negative (N = 101), and (4) malaria-positive with a 0.00003% parasitaemia rate (N = 101) versus malaria-negative (N = 101). We computed the accuracy, sensitivity, and specificity of these models using a bootstrap method with 100 iterations and establishing a 95% confidence interval for these metrics. Finally, a generalized linear model was used to test the statistically significant effect of anaemia and parasitaemia on the performance of MIRs-ML approaches in predicting malaria infections.