Next Article in Journal
Soundscape-Informed Urban Planning and Architecture in Historic Centers: A Multi-Layer Method for Soundscape Characterization Applied to Bilbao Old Town
Previous Article in Journal
Advances in Technologies for Energy Harvesting from Pavements: A Comprehensive Review
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Clinical Stress Level Prediction Using Metabolic Biomarkers and Genetic Algorithm–Based Machine Learning Models

by
Carlos H. Espino-Salinas
1,*,
Ricardo Mendoza-González
1,*,
Huizilopoztli Luna-García
2,
Alejandra Cepeda-Argüelles
2,
Ana G. Sánchez-Reyna
1,
Carlos E. Galván-Tejada
2,
Manuel Alejandro Soto Murillo
2,
Mónica Imelda Martínez Acuña
3 and
Rosa Adriana Martínez Esquivel
4
1
Systems and Computing Department, TecNM/Technological Institute of Aguascalientes, Av. Adolfo López Mateos 1801, El Llano 20330, Aguascalientes, Mexico
2
Unidad Académica de Ingniería Eléctrica, Universidad Autónoma de Zacatecas, Jardín Juarez, Zacatecas 98000, Mexico
3
Laboratorio de Epidemiología Ambietal, Unidad Académica de Ciencias Químicas, Universidad Autonoma de Zacatecas, Jardín Juárez, Zacatecas 98000, Mexico
4
Unidad Académica de Enfermeria, Universidad Autónoma de Zacatecas, Jardín Juarez, Zacatecas 98000, Mexico
*
Authors to whom correspondence should be addressed.
Appl. Sci. 2026, 16(8), 3636; https://doi.org/10.3390/app16083636
Submission received: 4 February 2026 / Revised: 14 March 2026 / Accepted: 23 March 2026 / Published: 8 April 2026
(This article belongs to the Special Issue Artificial Intelligence: Advantages in Diagnostic Procedures)

Abstract

Psychological stress is a major public health problem associated with adverse outcomes in physical and mental health. This study proposes an approach to predicting clinical stress levels using metabolic and endocrine biomarkers combined with machine learning models based on genetic algorithms. Data were obtained from 87 university students, including measurements of glucose, insulin, and cortisol, as well as perceived stress scores assessed using the Perceived Stress Scale (PSS). Stress levels were categorized into low ( n = 5 ), moderate ( n = 22 ), and high ( n = 60 ) classes, reflecting an imbalanced dataset. Feature engineering and genetic algorithm–based selection identified glucose concentration, the insulin–glucose ratio, and the insulin–cortisol ratio as the most relevant features. These were used to train XGBoost and Elastic Net models, which were evaluated using leave-one-out cross-validation. The XGBoost model achieved the best performance, with an accuracy of 0.77 and strong predictive capability for high stress levels. The results demonstrate the usefulness of machine learning based on metabolic biomarkers as an objective tool for stress assessment in psychological and clinical research.

1. Introduction

Any physical or psychological stimulus that disrupts homeostasis produces a stress response. These stimuli are called stressors, and the psychological and behavioral changes response to exposure to them contribute to the stress response. This response aims to allow the individual to adapt to indoor or external demands; however, when activated in a prolonged or intense manner, it can generate adverse effects on health. According to the World Health Organization (WHO), stress is a state of worry or mental tension resulting from a difficult situation [1]. Psychological stress represents a significant public health issue for several reasons. First, chronic stress can severally impact physical health, contributing to conditions such as cardiovascular disease, obesity, cancer, weakened immune systems and, generally, affects overall well-being across communities [2]. Second, mental health disorders, including anxiety and depression, are closely related to high stress levels [1]. Third, stress-related illnesses impose a substantial economic burden, covering healthcare costs, lost productivity, and disability costs [3].
From a physiological perspective, the stress response is primarly mediated by the activation of the hypothalamic-pituitary-adrenal (HPA) axis, which plays a central role in the neuro endocrine regulation of stress. Activation of this axis leads to the sequential release of corticotropin-releasing hormone (CRH), adrenocorticotropic hormone (ACTH), and finally, cortisol, considered one of the main biological biomarkers of stress [4].
However, activation of the HPA axis varies depending on the type of stress experienced. According to the American Psychological Association (APA), acute stress is characterized by its short duration and typically results from immediate stressors or demanding situations. The body’s alarm response induce temporary physiological chances, such as increased heart rate and adrenaline release, leading to a transient activation of the HPA axis that it generally adaptative and functional. In contract, choric stress occurs when stressors persist over a prolonged period, producing cumulative physiological and psychological effects. Chronic stress is associated with dysfunctional regulation of the HPA axis and sustained alterations in cortisol levels [5,6].
These alterations have been linked to chronic inflammatory processes, metabolic dysfunction, immune system impairment, and structural and functional changes in brain regions involved in emotional and cognitive regulation. In this context, the persistence of chronic stress represents a significant risk factor for the development of both physical and mental disorders, underscoring the importance of understanding its underlying physiological mechanisms for appropriate assessment and intervention [7].
Measuring stress is particularly complex, given that it involves physical, social, and biological factors. Achieving a multilevel assessment of stress requires greater coordination among different measurement methods. The exclusive use of self-report measures only explains a only a limited proportion of of the variance, as these instruments focus on perceived stress, while neglecting physiological components that may be not be consciously perceived [8].
In this context, the use of biomarkers has become a fundamental strategy for achieving a more comprehensive and objective assessment of stress. A biomarker is defined as a clinical, physiological, or anatomical element used to measure biological processes within the body in relation to a specific condition, either for diagnostic purpose or therapeutic intervention. To be considered valid, a biological marker must be sensitive, objective, specific, stable and quantifiable [9]. The integration of biomarkers with psychological measures allow for a deeper understanding on the phenomenon of stress and the implications for health.
Machine learning models are increasingly being considered useful tools in the field of mental health. Applications of machine learning in this domain focus on two main areas: (1) predicting therapeutic response and potential side effects of treatments, and (2) supporting differential diagnosis and the detection of risk for developing mental disorders [10]. In recent years, machine learning techniques have demonstrated growing potential for analyzing complex biomedical data and predicting health states based on multiple physiological variables [11].
Therefore, the aim of this study is to predict psychological stress levels using metabolic and endocrine biomarkers through the application of genetic algorithms and machine learning models. Specifically, this work seeks to identify the most relevant metabolic features associated with different stress levels, evaluate the predictive performance of multiple machine learning classifiers using genetically selected features, and provide an interpretable and biologically grounded framework for objective stress assessment. By integrating metabolic biomarkers this study seeks to contribute to the development of scalable and clinically relevant tools for stress evaluation in psychological and health research contexts.

Related Work

The prediction of psychological stress has increasingly transitioned from purely descriptive and clinical assessments toward data-driven approaches that leverage physiological and metabolic biomarkers in combination with machine learning techniques. This shift has been motivated by the need for objective, scalable, and automated methods capable of capturing the complex and non-linear relationships underlying stress-related physiological responses. Within this context, metabolic biomarkers such as glucose, insulin, and cortisol have gained particular attention due to their direct involvement in stress-regulation pathways, especially within the hypothalamic–pituitary–adrenal (HPA) axis [12,13]. Cortisol, in particular, is widely recognized as the primary hormonal marker of stress and has been extensively utilized as a ground-truth reference in computational stress modeling studies, owing to its measurable presence in saliva, blood, urine, and hair samples [12].
Chronic psychological stress has been associated with physiological alterations mediated primarily through the activation of the hypothalamic–pituitary–adrenal (HPA) axis, which regulates cortisol secretion and influences several metabolic pathways related to glucose homeostasis and insulin signaling. In apparently healthy young adults, prolonged exposure to stressors may lead to subtle metabolic adjustments that remain within clinically normal ranges but still reflect early physiological responses to stress. Typical reference ranges reported for these biomarkers include fasting glucose levels of approximately 70–100 mg/dL, fasting insulin concentrations between 2–25 μIU/mL, and morning cortisol levels generally ranging from 5–25 μg/dL in healthy individuals. Although values within these intervals are considered physiologically normal, variations within the normal range may still indicate adaptive or stress-related metabolic responses. Consequently, analyzing combinations of metabolic biomarkers can provide valuable insight into early physiological manifestations of chronic stress before the onset of overt metabolic or endocrine disorders. These physiological relationships provide the biological rationale for using metabolic biomarkers as input variables in machine learning models designed to predict psychological stress.
Early machine learning approaches to stress assessment predominantly focused on physiological signals, such as electrodermal activity, heart rate variability, and blood volume pulse, using supervised classification techniques to discriminate between stress and non-stress states. Nath et al. [14] exemplify this line of research by proposing a stress monitoring framework based on electrodermal activity (EDA) and blood volume pulse (BVP), with salivary cortisol employed as an objective physiological indicator of stress. The authors extracted a set of 39 statistical features from the acquired signals and applied supervised feature selection to reduce dimensionality prior to model training. Multiple machine learning algorithms were evaluated, including logistic regression, Random Forest, k-nearest neighbors, and support vector machines. Their results demonstrated that logistic regression achieved superior performance, with macro- and micro-averaged F1-scores of 0.87 and 0.95, respectively, and an AUC of 0.81. While this study confirms the effectiveness of classical machine learning models in stress prediction, it primarily relies on signal-derived features and does not fully exploit metabolic biomarkers as predictive variables.
More recent research has expanded the scope of machine learning applications in stress-related studies by incorporating biochemical and metabolic data, particularly in the context of chronic stress and stress-related disorders. Dean et al. [15] proposed a multiscale machine learning framework for the analysis of post-traumatic stress disorder (PTSD) in war veterans, integrating genetic, proteomic, cellular, and physiological data. The study employed support vector machines combined with recursive feature elimination to identify relevant biomarkers associated with PTSD. Among the evaluated feature subsets, a combination of gamma-glutamyltyrosine, insulin, and cg01208318 achieved a classification accuracy of 60% in the validation cohort. Although the predictive accuracy remains moderate, this work highlights two critical aspects: first, the relevance of metabolic biomarkers in stress-related conditions, and second, the importance of effective feature selection strategies when dealing with high-dimensional biological data.
From a broader machine learning perspective, the role of stress-induced metabolic alterations has been investigated using unsupervised and semi-supervised learning techniques. Kiss et al. [16] analyzed stress as a key contributor to mental health disorders by employing a rodent model and combining proton nuclear magnetic resonance (1H-NMR) spectroscopy with multivariate statistical learning. The authors utilized principal component analysis and hierarchical clustering to identify stress-related metabolic patterns, followed by metabolite set enrichment analysis and pathway analysis. These findings demonstrate that stress leads to systemic metabolic reprogramming, which can be captured through machine learning-based pattern recognition methods. However, the study relies primarily on unsupervised techniques, limiting its predictive capacity for individual-level stress classification.
Parallel to these developments, advances in wearable sensing technologies have facilitated the integration of metabolic biomarker detection with real-time machine learning models. Akbulut et al. [17] developed a wearable, label-free aptasensor for cortisol quantification in saliva and sweat, coupled with image-based machine learning analysis. Gradient-boosted decision trees trained on image-derived features achieved a coefficient of determination R 2 = 0.998 , demonstrating the strong potential of ensemble learning methods for biomarker-based stress assessment. Similar approaches combining biosensors and machine learning have been reported in the literature, further reinforcing the feasibility of predictive stress modeling using biochemical data [18,19].
The existing literature shows a clear trend toward the use of machine learning for stress assessment, moving from signal-based classification to biomarker-based predictive modeling. In the context of stress prediction, the integration of genetic algorithms with machine learning models offers a promising pathway toward improving predictive accuracy and model robustness when using metabolic biomarkers. This work proposes an approach based on genetic algorithms to predict psychological stress from metabolic biomarkers, with the aim of improving feature selection, enhancing model generalization, and providing a more comprehensive understanding of the metabolic correlates of stress.

2. Materials and Methods

This section describes the methods used in this research, which consists of generating prediction models for different stress levels based on key characteristics that also help determine whether there is a relationship between them and a certain stress level. The proposed methodology consists of different well-defined stages for its development, which are shown in Figure 1. Initially, endocrinological, metabolic, and anthropometric data were collected from different participants who used the Perceived Stress Scale (PSS), instrument used to measure stress levels. Subsequently, feature engineering was applied in order to discover, based on machine learning models, whether the effect of one variable depends on the value of another. At the same time, the different stress levels were categorized into three classes (low, moderate, and high). A normalization process was also applied, which consists of adjusting or adapting certain characteristics in a data set so that they resemble each other and are contained in the same distribution. Once the previous stage is complete, the normalized data undergoes a series of genetic algorithms applied with different machine learning techniques in order to obtain the most significant characteristics that help determine which ones are related to a certain level of stress. Additionally, to strengthen the results obtained during the application of genetic algorithms, different stress prediction models were generated using only the most relevant variables or characteristics to finally verify, through validation metrics, that there is a relationship between these characteristics and a certain level of associated stress.

2.1. Data Acquisition

The study population consisted of students from nutrition and Pharmaceutical Chemist biologist, both from the Autonomous Univeristy of Zacatecas.
The sample size was calculated using the open-access software OpenEpi (Open Source Epidemiologic Statistics for Public Health) [20]. Based on a total population of 1786 students, a minimum sample of 92 participants was estimated, considering an anticipated frequency (p) of 50%, a confidence limit of 10%, a design effect of 1, and a 95% confidence interval.
Sociodemographic data, including age, sex, and semester, were collected using structured online questionnaire developed with Google Forms, which allowed the creation of a secure and organized database.
The Biochemical analyses of glucose, insulin, and cortisol were performed in a clinical laboratory (Tecno Lab, Jerez, Zacatecas, Mexico). Participants were required to adhere to an 8-h fasting period before blood sampling to prevent lipemia and mitigate preanalytical errors. To reduce variability associated with the circadian rhythm of cortisol, blood samples were collected during a standardized morning time window between 06:00 to 08:00 a.m.
For the glucose levels were determined using the dry chemistry spectrophotometry method, employing a FUJIMILM model FUJI DRI-CHEM NX600 analyzer. Insulin and cortisol concentrations were measured using chemiluminescent immunoassay (CLIA) with a CL-900i analyzer (CLIA CL-900i), following the manufacturer’s instructions and laboratory protocols. The anthropometric measurements were taken by nutrition undergraduate interns, according to the standardized ISAK procedure.
The informed consent was obtained from each participant; prior to participation, the consent form was provided, review and signed by those who agreed to take par, after which they continued with the process. The study received approval from the Ethics Committee of Health Science area of the University.

2.2. Feature Engineering

Feature engineering techniques are usually applied after data collection. This phase is usually part of data preprocessing, such as cleaning, anomaly detection, and normalization. The main objective of feature engineering is to design intelligent features in one of two possible ways: first, by adjusting existing features using various transformations, or by extracting new meaningful features from different sources [21]. In this study, a feature engineering process based on physiological, metabolic, glycemic, and endocrine relationships was implemented in order to model nonlinear relationships between the base variables (glucose, insulin, and cortisol) that play a fundamental role in metabolic regulation and possible stress response.
The features were generated from simple algebraic operations representing relevant physiological interactions, which are listed below.
1.
Insulin × Glucose: this feature shows the combined metabolic load, which means that if it is high, the body needs insulin to regulate glucose, suggesting that there is some insulin resistance. This is the basis for the HOME-IR index.
2.
Insulin/Glucose: the feature measures how much insulin is secreted per unit of glucose, meaning that a high value indicates compensatory hyperinsulinemia and a low value may reflect pancreatic deficiency.
3.
Glucose/Insulin: indicates insulin sensitivity, meaning that high values reflect good metabolic response and low values reflect insulin resistance.
4.
(Cortisol × Glucose)/Insulin: Represents the impact of cortisol on glucose metabolism adjusted for insulin.
5.
Insulin/Cortisol: Indicates the anabolic-catabolic balance, meaning that if the value of this feature is low, cortisol dominates; if it is high, insulin predominates.
These five characteristics are derived from the base characteristics (glucose, insulin, cortisol, HOMA) that allow for a more robust and informed representation of the participants’ metabolic status, incorporating nonlinear relationships that cannot be captured by analyzing the original variables in isolation. This simple feature engineering process provides a solid basis for training machine learning models aimed at identifying metabolic alterations and stress levels.

2.3. Categorization of the Target Variable

The Perceived Stress Scale (PSS) is a self-reported measure consisting of 14 items with a five-point response format, which was designed to address the degree to which participants felt their lives were unpredictable, uncontrollable, and overloaded rather than focusing on a specific event. According to various studies, it has been shown to be a viable, reliable, and valid tool for assessing perceived stress, both in research and in clinical and population contexts [22]. It is important to mention that the instrument score for each response for items 1, 2, 3, 8, 11, 12, and 14 is related to 0 = never, 1 = almost never, 2 = occasionally, 3 = often, 4 = very often, and for items 4, 5, 6, 7, 9, 10, and 13, they relate to 4 = never, 3 = almost never, 2 = occasionally, 1 = often, 0 = very often. The direct score obtained from the sum of the 14 items ranging from 0 to 56 indicates that a higher score corresponds to a higher level of perceived stress, and it is said that a moderate level of stress fluctuates between 10 and 25; beyond these scores, stress is considered high [23].
Given the above statements, during the categorization stage of the target variable, participants with a score below 20 are assigned the label 0, those with a score between 20 and 25 are assigned the label 1, and those with a score above 25 are assigned the label 2, which corresponds to low, moderate, and high, respectively, for the classification of different levels of stress.

2.4. Data Normalization

Data normalization is a task of tabular data preprocessing, its importance lies in the need to reduce outliers and increase the accuracy of machine learning models. In the present study, z-normalization shown in Equation (1) was applied [24].
z = ( x u ) s
The z-normalization or standardization of a sample x is calculated where u is the mean of the samples and s is the standard deviation. This process is performed independently on each feature. This process is a common requirement for many machine learning estimators; however, the performance of the generated models could be compromised if the individual features do not more or less resemble normally distributed standard data [25].

2.5. Genetic Algorithms

A genetic algorithm (GA) is an evolutionary algorithm inspired by natural selection and the biological process of reproduction of the fittest individual. GA is one of the most popular optimization algorithms currently used in machine learning applications. It initially consists of having a population with random candidate solutions and developing an optimal solution from generation to generation. Subsequently, during the search process, the GA applies a series of genetic operators (selection, crossover, and mutation) [26]. Then, in the evolutionary selection, a search is performed for the best models for predicting stress levels using different machine learning algorithms such as: K-Nearest Neighbors (KNN) [27], Random Forest (RF) [28], Support Vector Machine (SVM) [29], and Nearcent [30]. Finally, the genes (characteristics) that are repeated most frequently when classifying participants are extracted. This process is summarized in Figure 2.
AGs have provided acceptable solutions for finding significant variables for large data sets. However, when the number of characteristics is reduced, they have also proven to be quite efficient, as it is possible to find relationships between key variables and a target or output variable, as demonstrated in this study with stress levels. These algorithms are based on sub-algorithms to improve accuracy and precision [32].
In the context of this research, the GALGO 1.4 generic software package was implemented, which uses genetic algorithms to solve optimization problems involving the selection of subsets of variables. GALGO is implemented in the R statistical programming environment using object-oriented programming with S3 methods. This tool can be used to solve any optimization problem, especially in very large data sets (but not limited to them) where variable selection is an important factor [33]. For the development of stress level prediction research, metabolic data was used to create a random population of characteristics with a specific size (n). These characteristics are evaluated using a fitness function to assess their ability to classify a dependent variable, which generates an accuracy value.
For the process of identifying the most significant characteristics associated with the different stress levels established using genetic algorithms, random forest, SVM, KNN, and Nearcent were used as underlying classifiers. For optimization, a goalFitness of 0.95 was set, which guarantees a high predictive capacity of the selected subset of variables. On the other hand, a maximum of 1000 big bangs and up to 200 evolutionary generations per event were defined, allowing for an exhaustive exploration of the solution space, thus helping convergence towards optimal variable configurations. The storage frequency of the evolutionary process was set to every 5 iterations (saveFrequency = 5) to monitor the stability of the algorithm and analyze the evolution of the selection of characteristics over time. Finally, the standardization of variables was disabled (scale = False), maintaining the original scale of the characteristics to preserve the biomedical interpretation of stress-related variables.

2.6. Stress Prediction Models

Once the most relevant characteristics of the collected dataset had been selected and described at the beginning of the manuscript, different machine learning models were developed. The aim of this stage is to reaffirm and guarantee the results previously obtained in the feature selection phase using AGs, avoiding overfitting or underfitting. The algorithms proposed in this section are: XGBoost and ElasticNet, which seek to give more robustness and solidity to the results obtained, so that there is consistency between them. This also works as a method of comparison between different algorithms.

2.6.1. XGBoost

Extreme Gradient Boosting (XGBoost) is a machine learning algorithm that boosts decision trees. Boosting refers to the ensemble learning technique that consists of creating different models sequentially, where each new model attempts to correct the deficiencies of the previous model. In tree boosting, each model added to the ensemble constitutes a decision tree [34]. The XGBoost algorithm is briefly presented below.
First, integrate the tree model with addition method, assuming a total of K-trees, and use F to represent the basic tree model as shown in Equation (2).
y ^ i = k = 1 K f k ( x i ) , f k F
The objective function is defined as shown in the Equation (3).
L = i l ( y ^ i , y i ) + k Ω ( f k )
where l is the loss function and represents the error between the predicted value and the actual value; Ω is the function used for regularization in order to avoid overfitting (Equation (4)).
Ω ( f ) = γ T + 1 2 λ w 2
where T represents the number of leaves per tree, and w represents the weight of the leaves of each tree [35].

2.6.2. ElasticNet

Elastic Net (EN) is a regularization technique used in machine learning to prevent overfitting and improve the predictive performance of models. EN combines both L1 and L2 regularization, which promote sparsity and reduction of model coefficients, respectively. Like AGs, it can be used to solve high-dimensional optimization problems with a large number of variables, where traditional methods may not be effective. EN can also help improve the stability and accuracy of optimization solutions by reducing the impact of noisy or irrelevant variables, while maintaining the most important variables in the model [36].
In multi-class classification, EN is commonly applied over multinomial logistic regression as shown in Equation (5).
P ( y i = c x i ) = exp w c x i j = 1 C exp w j x i
And the objective function is defined given the Equation (6).
L ( W ) = 1 N i = 1 N c = 1 C I ( y i = c ) log P ( y i = c x i ) + λ c = 1 C α w c 1 + 1 α 2 w c 2 2
The process for developing stress prediction models with machine learning algorithms used the Leave-One-Out-Cross-Validation (LOOCV) method to estimate predictive accuracy [37].
Additionally, it was necessary to incorporate a class balancing process using Synthetic Minority Oversampling Technique (SMOTE) in order to ensure that the model has the capacity for generalization, given the sample size and class imbalance. SMOTE is established as a viable option for solving this type of problem, as this technique seeks to address class distribution imbalance by generating artificial samples for the minority class. SMOTE has proven effective in improving the performance of classification models in datasets with high levels of imbalance, increasing the representation of minority classes and expanding the training dataset [38].

2.7. Validation

To establish the viability of stress prediction models using machine learning algorithms and the selection of the most significant metabolic biomarkers using AGs, it was necessary to define certain validation metrics (Table 1) that help quantify the performance of the proposal in this study.
Additionally, confusion matrices were also generated to evaluate and visualize the behavior of the classification models. It is essentially a square matrix where the rows represent the actual classes and the columns represent the predicted class.
For the experimentation process, Python version 3.13.5, R version 3.6.3, and the GALGO 1.4 package for R version 1.2 were used. You can access the complete source code and process data via the following link: https://github.com/Dantecore2/Stress_Data.git, accessed on 14 March 2026.

3. Results

As a result of the data acquisition process, 87 valid observations were obtained for the metabolic variables of interest. Glucose had a mean of 89.99 ng/dL ( S D = 52.59 ), with values ranging from 26 to 560 ng/dL, showing high interindividual variability. Insulin had a mean of 16.40 μIU/mL ( S D = 10.21 ), while cortisol had a mean of 13.67 μg/dL ( S D = 4.59 ). The HOMA-IR index was calculated from glucose and insulin values, yielding a mean of 4.01 ( S D = 6.04 ), with a range between 0.6 and 55.9, suggesting the presence of different degrees of insulin resistance within the analyzed population, as shown in Table 2.
Likewise, additional descriptive analyses of the total sample ( N = 87 ) presented in Table 3 reveal distinct patterns that are clinically relevant. Glucose remains relatively stable across groups (ranging from 87.60 to 90.14 ng/dL), while insulin shows a progressive upward trend: from 8.72 μIU/mL in the low-stress group, increasing to 14.45 μIU/mL in moderate stress, and reaching 18.15 μIU/mL in the high-stress group. This parallel increase in the insulin/glucose ratio (0.10–0.22) suggests a phenomenon of compensatory hyperinsulinemia, which could indicate a relationship between chronic stress and the development of insulin resistance. Cortisol, the main effector of the HPA axis, also shows a progressive and consistent increase (11.48–14.09 µg/dL) as the severity of perceived stress increases, which is physiologically consistent with the sustained activation of this axis in contexts of chronic stress. The high standard deviation observed in variables such as HOMA-IR within the high stress group ( S D = 7.30 ) reflects the wide metabolic heterogeneity of the sample. These results confirm a marked metabolic diversity in the sample and support the combined use of glucose, insulin, cortisol, and HOMA-IR for the analysis of metabolic status and its possible relationship with stress.
Once data collection was complete, two key processes were applied. The first consisted of generating new metabolic features (Insulin × Glucose, Insulin/Glucose, Glucose/Insulin, (Glucose × Cortisol)/Insulin, and Insulin/Cortisol) from those obtained (Glucose (ng/dL), Insulin (IU/mL), Cortisol (g/dL), and HOMA) during data collection, resulting in a total of 9 features, 88 observations, and 3 classes (0—mild stress, 1—moderate stress, and 2—high stress). The second process consists of categorizing the different scores ranging from 0 to 56, indicating that a higher score (greater than 25) corresponds to a high perceived stress level. On the other hand, a moderate stress level is said to be between 20 and 25. Finally, levels below 20 are considered mild stress levels.
Once the feature engineering and categorization of the target variable stages have been completed, the feature selection process begins with the implementation of AGs with the unnormalized data and the normalized or standardized data, obtaining the results shown in the Table 4. The algorithms used are: SVM, Random Forest, Nearcent, and KNN.
As can be seen in the table above, AG using RFC and unnormalized data performed best in predicting stress levels with an average accuracy of 0.7586. In Figure 3, despite the limited amount of data for the mild and moderate classes, these results proved that there is a significant relationship between glucose feature (Glucose ng/dL), the amount of insulin secreted per unit of glucose (Insulin/Glucose), and the anabolic-catabolic balance with high stress levels (Insulin/Cortisol), given their prevalence and variability in the observations obtained during data acquisition.
The implementation of GA provides us with a large collection of chromosomes. While most are good solutions to the prediction problem, the graph shown above indicates which one should be chosen by means of a black straight line, highlighting the model to be used and its accuracy rate at the top. This process is known as forward selection, which ensures that the genes most represented in the chromosome population are included in a single summary model.
Figure 4 shows the stability of the range of the top 50 genes (features), which makes it easier for the GA to stop or continue the process once the highest-ranking genes have stabilized. When genes show many changes in rank, the graph displays different colors, indicating that the range of these genes is unstable. As can be seen, the top two “black” genes stabilize quickly, while the lower-ranked ‘gray’ genes would require thousands of solutions to stabilize. An additional fact to consider is that in the forward selection process, in order to improve accuracy, the “red” feature is also selected.
To verify that the search process effectively achieves the objective, it is necessary to observe the stability of the solutions across generations. Figure 5 illustrates that, on average, convergence toward the solution occurs around generation ±25, which is consistent with the expected behavior of the algorithm. The plotted lines represent, respectively, the average fitness of all chromosomes in the population and the average fitness of those chromosomes that have not yet reached the target solution.
Additionally, considering that genetic algorithms are stochastic optimization methods whose solutions may vary between executions, multiple runs were conducted using different machine learning algorithms. However, these additional experiments did not result in a significant improvement in accuracy. As illustrated in Figure 6, when normalized data was used, the RFC algorithm achieved the best performance with an accuracy of 0.7206. In comparison, the NearCent, SVM, and KNN algorithms obtained accuracies of 0.4459, 0.6904, and 0.6908, respectively, as reported in Table 4.
Figure 7 shows the evolution of fitness values over generations for a population of chromosomes using normalized data. The results indicate that the algorithm reaches a stable region after the initial generations, where the average fitness of the population gradually converges and remains relatively constant. This behavior suggests that, despite the stochastic nature of genetic algorithms, repeated runs tend to converge toward similar solutions, indicating a stable feature selection process. The figure shows the average fitness of all chromosomes in the population, allowing us to observe the consistency of the optimization process across generations.
Furthermore, in order to strengthen the results previously obtained in the feature selection phase using genetic algorithms, an additional experiment was conducted consisting of generating two stress level prediction models using machine learning algorithms (XGBoost and Elastic Net), taking as reference only the most significant variables, which are Glucose, Insulin/Glucose, and Insulin/Cortisol. LOOCV was considered to ensure the robustness of the models’ predictions and to guaranty the relationship between the selected variables and high stress levels. Table 5 shows the performance of the models using the validation metrics of accuracy, precision, recall, and F1-Score.
In order to provide an overview of the results obtained, the Figure 8. shows the confusion matrix resulting from the best-performing algorithm (XGBoost).
Based on the overall values obtained, it can be observed that the performance of the models notably varies depending on both the learning algorithm and whether class balancing is applied. When the models were trained using the original, unbalanced dataset, the variation in accuracy was relatively limited; for instance, the XGBoost algorithm achieved an accuracy of 0.74 when all features were considered. However, the application of genetic algorithms for intelligent feature selection enabled the identification of the most relevant variables for stress prediction, increasing the accuracy to 0.77. These results suggest that evolutionary algorithms can enhance the predictive capability of machine learning models while reducing the dimensionality of the feature space. This reduction in complexity is particularly relevant for future implementations, especially in clinical and psychological research settings where efficient and interpretable stress assessment tools are required.
On the other hand, although the results presented above are relevant for potential applications in clinical contexts, particularly for identifying elevated stress levels, it is important to consider additional experiments that address the class imbalance present in the original dataset. In this regard, the SMOTE class balancing technique was applied to mitigate the bias caused by the little representation of certain classes. The use of class balancing strategies has been shown to be effective in health-related datasets [41]. After generating a balanced version of the dataset, new experiments were conducted, the results of which are presented in Table 6.
Incorporating class balancing techniques proved to be a viable strategy for improving the model’s ability to correctly classify minority stress levels, achieving an accuracy rate of 0.86. Balancing the dataset, along with selecting the most significant features using genetic analysis, significantly improved classification performance for the low- and moderate-stress classes, which had previously shown no promising results. This improvement highlights the importance of addressing class imbalance when developing predictive models.
It is important to note that the first approach, which considers data acquisition in a real clinical setting, class imbalance is inherent in the dataset, which causes models such as XGBoost to have limitations in identifying groups with low and moderate stress levels. However, when class balancing is applied, it becomes clear that, although this imbalance constitutes a limitation in the primary analysis, the metabolic characteristics selected by GA have, in themselves, the ability to discriminate between different levels of stress once this factor is controlled.

4. Discussion

The results obtained in this study suggest that metabolic biomarkers may contain relevant information for predicting psychological stress levels using machine learning techniques. In particular, the feature selection process based on genetic algorithms identified three variables: glucose, insulin/glucose and insulin/cortisol, as the most informative predictors of perceived stress. These variables reflect key physiological interactions between glucose metabolism, insulin regulation, and endocrine balance, which are known to be influenced by chronic stress through the activation of the HPA axis.
The descriptive analysis revealed a progressive increase in insulin levels and insulin-related ratios across stress groups, accompanied by a moderate increase in cortisol concentrations. This pattern may reflect compensatory metabolic responses associated with prolonged exposure to stress. Chronic activation of the HPA axis promotes cortisol secretion, which can influence glucose metabolism and insulin signaling. Even in apparently healthy young adults, these physiological adaptations may represent early metabolic responses to sustained psychological stress.
From a methodological perspective, the results highlight the usefulness of combining genetic algorithms with machine learning techniques for feature selection and predictive modeling. Genetic algorithms enabled the identification of a compact subset of relevant metabolic variables, reducing the dimensionality of the dataset while preserving predictive performance. This characteristic is particularly important in biomedical studies where datasets are typically small and noisy.
An additional aspect that should be considered is the presence of class imbalance in the original dataset. The predominance of the high-stress class affected the predictive capacity of the models for minority categories, particularly the low-stress group. This behavior is consistent with challenges commonly reported in machine learning classification tasks involving imbalanced biomedical datasets. After applying the SMOTE class balancing technique, the predictive performance of the models improved significantly, especially for the underrepresented classes. These findings confirm that addressing class imbalance is a critical step when developing predictive models in small clinical datasets.
There are several studies that seek to implement data preprocessing techniques for the detection, prediction, and monitoring of stress and mental disorders related to this condition, according to the literature review presented by Razavi et al. [42] in 2024. However, few involve the use and implementation of GA that allow for the selection of features for the optimization of machine learning. Below are the most recent studies addressing the advantages of using GA for the prediction or detection of stress in people.
First, Hamatta et al. [43]. investigate stress detection techniques using electroencephalography (EEG), photoplethysmography (PPG), and galvanic skin response (GSR) data. The authors mention that AG plays an important role, highlighting that it provides better data extraction and reduces the dimensional quality of the information collected, allowing for up to 99.9% accuracy by applying preprocessing, image segmentation, feature extraction, and convolutional neural networks (CNN) to identify stress. Although the proposal presents relevant accuracy, it should be noted that its implementation in a clinical setting could present various complications, as the devices used for data acquisition could be highly invasive, which contrasts with collecting medical history information that may be related to some level of stress. On the other hand, despite having an AG application stage to optimize the generation of the stress classification model, CNNs continue to have a high time and processing cost compared to machine learning algorithms.
Another related study conducted by Anwar et al. [44]. states that photoplethysmography (PPG) is considered an alternative for detecting mental stress by extracting 26 characteristics from the time domain and frequency domain, in order to implement multiple machine learning classifiers and AGs to classify these characteristics, achieving 72% accuracy through stratified cross-validation with KNN exclusion, which provided an 81% increase. Although biological data is a viable option for identifying many health problems, in the field of psychology it is difficult to delegate diagnosis to electronic devices, which, although they are often an acceptable support tool, will always require human intervention by professional diagnosticians, supplemented by historical biological information such as metabolic data.
Similar to the approach proposed in this research paper, Ratul et al. [45]. developed a model for predicting perceived stress using machine learning techniques, principal component analysis, cross-validation, and AGs for hyperparameter optimization, including demographic data and academic performance during the COVID-19 pandemic. Their prediction models demonstrated an accuracy of 80.5%, precision of 1.0, an F1 score of 0.890, and a recall of 0.826, thus concluding that it is possible to develop prediction systems that enable people to maintain their mental health. A relevant consideration of the study is the use of AGs as a hyperparameter selection process that identifies values that improve the algorithm training process [46], which contrasts with the present proposal that they are used for feature selection. Another important point is the data source, as reliability may be affected by the self-reported nature of the survey responses, which may be subject to bias and inaccurate memory.
Other interesting proposals mention that physiological data, including heart rate variability (HRV) derived from the interbeat interval (IBI), blood volume pulse (BVP), or electrodermal activity (EDA), are useful for real-time stress detection with accuracy rates of up to 97.07%, highlighting that HRV and EDA are the most relevant characteristics obtained through AGs [47]. However, Sağbaş et al. [48]. state that physiological data acquisition requires additional equipment and is difficult for users to carry with them at all times. That is why they propose a real-time stress detection system based on behavior that people use constantly throughout the day, such as typing on a virtual keyboard, obtaining 172 raw sensor attributes. Here, it is mentioned that the dimensionality of the information could be a problem affecting the performance of machine learning algorithms, which is why they implement binary code chromosomal GAs to reduce the number of features. As a result of the experiments, they obtained an accuracy of 89.61 and an F-measure of 0.9052 using the KNN algorithm, highlighting their findings. Despite this latest proposal, a significant association has been demonstrated between excessive cell phone use and negative effects on physical and mental well-being, including anxiety, depression, and stress [49].
In contrast, the present study focuses on metabolic biomarkers that can be obtained through routine laboratory tests. This characteristic may represent an advantage for potential clinical applications, since metabolic information is often available in standard medical evaluations. Therefore, integrating metabolic biomarkers with machine learning techniques could contribute to the development of complementary tools for stress assessment, supporting traditional psychological evaluations and enabling the early identification of stress-related physiological alterations.

5. Conclusions

This work evaluated the prediction of psychological stress based on metabolic and endocrine biomarkers using genetic algorithms and machine learning models, outperforming assessments based solely on self-reports. The proposed approach demonstrates how data-driven intelligent systems can be designed to extract meaningful physiological information from complex biological data, enabling objective and scalable stress assessment.
The application of genetic algorithms played a central role in the system design by performing feature selection. This optimization process reduced the original set of features to a compact subset of metabolically relevant biomarkers, specifically glucose, insulin-to-glucose ratio, and insulin-to-cortisol ratio. This dimensionality reduction is critical, as it directly impacts model stability, computational efficiency, and generalization capability, particularly in biomedical scenarios characterized by limited sample sizes and noisy measurements.
This balance between accuracy and computational efficiency represents an important technical requirement for the development of computational decision-support tools. However, given the exploratory nature of the present study and the limitations of the dataset, the proposed models should be interpreted as a proof-of-concept rather than as a clinically deployable system. Further validation using larger and more diverse datasets will be necessary before considering potential applications in clinical or semi-clinical environments.
Another methodological consideration in this study concerns the class imbalance present in the dataset. Since the three stress groups were not equally represented, the Synthetic Minority Oversampling Technique (SMOTE) was applied to generate a balanced dataset and enable a more detailed comparison between models trained on the original imbalanced data and those trained on the balanced dataset. SMOTE is a widely used data augmentation technique that generates synthetic samples of the minority class based on the k-nearest neighbors of existing observations, enabling machine learning algorithms to better learn the decision boundaries of underrepresented classes. This strategy has been widely adopted in machine learning applications in the biomedical and healthcare fields to mitigate bias caused by class imbalance and improve predictive performance when minority classes are underrepresented. For example, studies in healthcare analytics have shown that applying SMOTE can significantly improve the sensitivity and overall predictive performance of classification models trained on imbalanced clinical datasets [41,50]. In this study, the use of SMOTE enabled a more comprehensive analysis of the metabolic patterns associated with different stress levels by allowing comparison of predictive models under both imbalanced and balanced data conditions.
The proposed framework demonstrates robustness in handling small datasets with correlated variables, a common limitation in biomedical and physiological research. The use of genetic algorithms as a feature selection mechanism, rather than solely for hyperparameter tuning, distinguishes this work from many existing approaches and highlights their suitability for optimizing machine learning pipelines in complex biological systems. This design choice aligns with engineering principles of modularity and adaptability, allowing the feature selection stage to be seamlessly integrated with different classifiers or extended to other types of biomedical data.

Limitations and Future Work

Despite this methodological strategy, this study presents several limitations that should be considered when interpreting the results. First, the dataset exhibited a notable class imbalance, particularly in the low-stress category, which included only five observations out of the 87 analyzed. Although the use of SMOTE helped mitigate this issue during model training, the limited number of original observations may still affect the stability of class-specific performance metrics. Additionally, the analyzed population consisted of university students from the Nutrition and Pharmaceutical Biochemistry programs at a single institution. While this relatively homogeneous cohort facilitated controlled data collection, it may limit the generalizability of the findings to broader or more diverse populations. Future studies with larger and more balanced datasets will be essential to further validate the robustness and generalizability of the proposed predictive models.
In terms of future applications, the proposed approach lays the groundwork for the development of intelligent stress monitoring systems that rely on routinely collected metabolic data, such as those obtained from clinical laboratory tests or digital health platforms. The combination of genetic algorithms and machine learning offers a scalable and adaptable solution that can be extended to other mental health–related conditions or integrated into broader health decision-support systems. However, further research is required to confirm the robustness and broader applicability of the proposed framework. In particular, future studies with larger and more balanced datasets will be essential to further validate the robustness and generalizability of the predictive models and to assess their performance across more diverse populations and clinical contexts.

Author Contributions

Conceptualization, C.H.E.-S., A.G.S.-R., C.E.G.-T. and A.C.-A.; data acquisition, M.I.M.A. and A.C.-A.; data curation, C.H.E.-S., M.I.M.A. and A.G.S.-R.; formal analysis, C.H.E.-S., A.C.-A. and C.E.G.-T.; funding acquisition, C.E.G.-T.; investigation, C.H.E.-S., A.C.-A., A.G.S.-R. and M.A.S.M.; methodology, C.H.E.-S., H.L.-G., A.C.-A. and R.M.-G.; project administration, H.L.-G., R.M.-G., R.A.M.E. and M.A.S.M.; resources, H.L.-G., C.E.G.-T. and R.M.-G.; software, C.H.E.-S., C.E.G.-T. and M.A.S.M.; supervision, H.L.-G., M.A.S.M., C.E.G.-T. and R.M.-G.; validation, C.E.G.-T., H.L.-G. and R.M.-G.; visualization, C.H.E.-S.; writing—original draft, C.H.E.-S., A.C.-A., A.G.S.-R. and M.I.M.A.; writing—review and editing, H.L.-G., R.M.-G., C.E.G.-T., M.A.S.M. and R.A.M.E. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

You can access the complete source code and process data via the following link: https://github.com/Dantecore2/Stress_Data.git, accessed on 14 March 2026.

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
ACTHAdrenocorticotropic hormone
APAAmerican Psychological Association
AUCArea Under the Curve
BVPBlood volume pulse
CLIAChemiluminescent immunoassa
CNNConvolutional neural networks
CRHCorticotropin-releasing hormone
EDAElectrodermal activity
EEGElectroencephalography
ENElastic Net
FNFalse Negative
FPFalse Positive
GAGenetic algorithm
GSRGalvanic skin response
HPAHypothalamic-pituitary-adrenal
HRVHeart rate variability
IBIInterbeat interval
KNNK-Nearest Neighbors
LOOCVLeave-One-Out-Cross-Validation
PPGPhotoplethysmography
PSSPerceived Stress Scale
PTSDPost-traumatic stress disorder
RFRandom Forest
SDStandard Deviation
SVMSupport Vector Machine
TNTrue Negative
TPTrue Positive
WHOWorld Health Organization
XGBoostExtreme Gradient Boosting
1H-NMRProton nuclear magnetic resonance

References

  1. Smith, M.D.; Wesselbaum, D. Global evidence on the prevalence of and risk factors associated with stress. J. Affect. Disord. 2025, 374, 179–183. [Google Scholar] [CrossRef]
  2. Steptoe, A.; Kivimäki, M. Stress and cardiovascular disease. Nat. Rev. Cardiol. 2012, 9, 360–370. [Google Scholar] [CrossRef]
  3. Hassard, J.; Teoh, K.R.; Visockaite, G.; Dewe, P.; Cox, T. The cost of work-related stress to society: A systematic review. J. Occup. Health Psychol. 2018, 23, 1. [Google Scholar] [CrossRef] [PubMed]
  4. Chu, B.; Marwaha, K.; Sanvictores, T.; Awosika, A.O.; Ayers, D. Physiology, stress reaction. In StatPearls [Internet]; StatPearls Publishing: Treasure Island, FL, USA, 2024. [Google Scholar]
  5. Godoy, L.D.; Rossignoli, M.T.; Delfino-Pereira, P.; Garcia-Cairasco, N.; de Lima Umeoka, E.H. A comprehensive overview on stress neurobiology: Basic concepts and clinical implications. Front. Behav. Neurosci. 2018, 12, 127. [Google Scholar] [CrossRef]
  6. Pascual, A.M.P.L. Acciones cerebrales de los esteroides: Estado actual de la respuesta al estrés e implicaciones en la conducta. Monogr. Real Acad. Nac. Farm. 2010, 29, 33–85. [Google Scholar]
  7. McEwen, B.S. Physiology and neurobiology of stress and adaptation: Central role of the brain. Physiol. Rev. 2007, 87, 873–904. [Google Scholar] [CrossRef]
  8. Morera, L.P.; Tempesti, T.C.; Pérez, E.; Medrano, L.A. Biomarcadores en la medición del estrés: Una revisión sistemática. Ansiedad Estrés 2019, 25, 49–58. [Google Scholar] [CrossRef]
  9. Bejarano, C.A. Biomarcadores asociados al estrés. RECIMUNDO Revista Científica de la Investigación y el Conocimiento 2024, 8, 139–148. [Google Scholar]
  10. Shatte, A.B.; Hutchinson, D.M.; Teague, S.J. Machine learning in mental health: A scoping review of methods and applications. Psychol. Med. 2019, 49, 1426–1448. [Google Scholar] [CrossRef] [PubMed]
  11. Beam, A.L.; Kohane, I.S. Big data and machine learning in health care. JAMA 2018, 319, 1317–1318. [Google Scholar] [CrossRef]
  12. Nater, U.M.; Skoluda, N.; Strahler, J. Biomarkers of stress in behavioural medicine. Curr. Opin. Psychiatry 2013, 26, 440–445. [Google Scholar] [CrossRef] [PubMed]
  13. Noushad, S.; Ahmed, S.; Ansari, B.; Mustafa, U.H.; Saleem, Y.; Hazrat, H. Physiological biomarkers of chronic stress: A systematic review. Int. J. Health Sci. 2021, 15, 46. [Google Scholar]
  14. Nath, R.K.; Thapliyal, H.; Caban-Holt, A. Machine learning based stress monitoring in older adults using wearable sensors and cortisol as stress biomarker. J. Signal Process. Syst. 2022, 94, 513–525. [Google Scholar] [CrossRef]
  15. Dean, K.R.; Hammamieh, R.; Mellon, S.H.; Abu-Amara, D.; Flory, J.D.; Guffanti, G.; Wang, K.; Daigle, B.J., Jr.; Gautam, A.; Lee, I.; et al. Multi-omic biomarker identification and validation for diagnosing warzone-related post-traumatic stress disorder. Mol. Psychiatry 2020, 25, 3337–3349. [Google Scholar] [CrossRef]
  16. Kiss, D.; Ambeskovic, M.; Montina, T.; Metz, G.A. Stress transgenerationally programs metabolic pathways linked to altered mental health. Cell. Mol. Life Sci. 2016, 73, 4547–4557. [Google Scholar] [CrossRef]
  17. Akbulut, F.P.; Ikitimur, B.; Akan, A. Wearable sensor-based evaluation of psychosocial stress in patients with metabolic syndrome. Artif. Intell. Med. 2020, 104, 101824. [Google Scholar] [CrossRef]
  18. Healey, J.A.; Picard, R.W. Detecting stress during real-world driving tasks using physiological sensors. IEEE Trans. Intell. Transp. Syst. 2005, 6, 156–166. [Google Scholar] [CrossRef]
  19. Giannakakis, G.; Grigoriadis, D.; Giannakaki, K.; Simantiraki, O.; Roniotis, A.; Tsiknakis, M. Review on psychological stress detection using biosignals. IEEE Trans. Affect. Comput. 2019, 13, 440–460. [Google Scholar] [CrossRef]
  20. OpenEpi. OpenEpi Menu. Sitio Web Con Calculadoras Epidemiológicas en Línea. 2026. Available online: https://www.openepi.com/Menu/OE_Menu.htm (accessed on 14 March 2026).
  21. Li, Z.; Ma, X.; Xin, H. Feature engineering of machine-learning chemisorption models for catalyst design. Catal. Today 2017, 280, 232–238. [Google Scholar] [CrossRef]
  22. Koğar, E.Y.; Koğar, H. A systematic review and meta-analytic confirmatory factor analysis of the perceived stress scale (PSS-10 and PSS-14). Stress Health 2024, 40, e3285. [Google Scholar] [CrossRef] [PubMed]
  23. Remor, E.; Carrobles, J.A.G. Versión española de la escala de estrés percibido (PSS-14): Estudio psicométrico en una muestra VIH+. Ansiedad Estrés 2001, 7, 195–201. [Google Scholar]
  24. Izonin, I.; Tkachenko, R.; Shakhovska, N.; Ilchyshyn, B.; Singh, K.K. A Two-Step Data Normalization Approach for Improving Classification Accuracy in the Medical Diagnosis Domain. Mathematics 2022, 10, 1942. [Google Scholar] [CrossRef]
  25. Nur Hakim, M.I.; Siswanto, J.; Qalban, A.A.; Nuryono, A.A. Increasing the Accuracy of Classification Models with a Scaler for Bus Rapid Transit (BRT) Reliability Values. In Proceedings of the 2024 International Conference on Electrical Engineering and Computer Science (ICECOS), Palembang, Indonesia, 25–26 September 2024; pp. 211–216. [Google Scholar] [CrossRef]
  26. Alhijawi, B.; Awajan, A. Genetic algorithms: Theory, genetic operators, solutions, and applications. Evol. Intell. 2024, 17, 1245–1256. [Google Scholar] [CrossRef]
  27. Halder, R.K.; Uddin, M.N.; Uddin, M.A.; Aryal, S.; Khraisat, A. Enhancing K-nearest neighbor algorithm: A comprehensive review and performance analysis of modifications. J. Big Data 2024, 11, 113. [Google Scholar] [CrossRef]
  28. Manzali, Y.; Elfar, M. Random Forest Pruning Techniques: A Recent Review. Oper. Res. Forum 2023, 4, 43. [Google Scholar] [CrossRef]
  29. Bansal, M.; Goyal, A.; Choudhary, A. A comparative analysis of K-Nearest Neighbor, Genetic, Support Vector Machine, Decision Tree, and Long Short Term Memory algorithms in machine learning. Decis. Anal. J. 2022, 3, 100071. [Google Scholar] [CrossRef]
  30. Morgan-Benita, J.; Sánchez-Reyna, A.G.; Espino-Salinas, C.H.; Oropeza-Valdez, J.J.; Luna-García, H.; Galván-Tejada, C.E.; Galván-Tejada, J.I.; Gamboa-Rosales, H.; Enciso-Moreno, J.A.; Celaya-Padilla, J. Metabolomic Selection in the Progression of Type 2 Diabetes Mellitus: A Genetic Algorithm Approach. Diagnostics 2022, 12, 2803. [Google Scholar] [CrossRef]
  31. Espino-Salinas, C.H.; Galván-Tejada, C.E.; Sánchez-Reyna, A.G.; Luna-García, H.; Gamboa-Rosales, H.; Morgan-Benita, J.A.; Celaya-Padilla, J.M.; Galván-Tejada, J.I. Feature Selection of Motor Activity in Intervals of Time with Genetics Algorithms for Depression Detection. Rev. Mex. Ing. Biomed. 2023, 44, 38–52. [Google Scholar] [CrossRef]
  32. Sohail, A. Genetic Algorithms in the Fields of Artificial Intelligence and Data Sciences. Ann. Data Sci. 2023, 10, 1007–1018. [Google Scholar] [CrossRef]
  33. Trevino, V.; Falciani, F. GALGO: An R package for multivariate variable selection using genetic algorithms. Bioinformatics 2006, 22, 1154–1156. [Google Scholar] [CrossRef]
  34. Mitchell, R.; Frank, E. Accelerating the XGBoost algorithm using GPU computing. PeerJ Comput. Sci. 2017, 2017, e127. [Google Scholar] [CrossRef]
  35. Li, W.; Yin, Y.; Quan, X.; Zhang, H. Gene Expression Value Prediction Based on XGBoost Algorithm. Front. Genet. 2019, 10, 1077. [Google Scholar] [CrossRef] [PubMed]
  36. Nasir, I.M.; Raza, M.; Ulyah, S.M.; Shah, J.H.; Fitriyani, N.L.; Syafrudin, M. ENGA: Elastic Net-Based Genetic Algorithm for human action recognition. Expert Syst. Appl. 2023, 227, 120311. [Google Scholar] [CrossRef]
  37. Silva, L.A.; Zanella, G. Robust Leave-One-Out Cross-Validation for High-Dimensional Bayesian Models. J. Am. Stat. Assoc. 2024, 119, 2369–2381. [Google Scholar] [CrossRef]
  38. Matharaarachchi, S.; Domaratzki, M.; Muthukumarana, S. Enhancing SMOTE for imbalanced data with abnormal minority instances. Mach. Learn. Appl. 2024, 18, 100597. [Google Scholar] [CrossRef]
  39. Yin, M.; Wortman Vaughan, J.; Wallach, H. Understanding the Effect of Accuracy on Trust in Machine Learning Models. In Proceedings of the 2019 CHI Conference on Human Factors in Computing Systems, New York, NY, USA, 4–9 May 2019. [Google Scholar] [CrossRef]
  40. Diallo, R.; Edalo, C.; Awe, O.O. Machine Learning Evaluation of Imbalanced Health Data: A Comparative Analysis of Balanced Accuracy, MCC, and F1 Score. In Practical Statistical Learning and Data Science Methods: Case Studies from LISA 2020 Global Network, USA; Awe, O.O., Vance, A.E., Eds.; Springer Nature: Cham, Switzerland, 2025; pp. 283–312. [Google Scholar] [CrossRef]
  41. Reyna, A.G.S.; Mendoza-Gonzalez, R.; Luna-García, H.; Padilla, J.M.C.; Benita, J.A.M.; Espino-Salinas, C.H.; Galván-Tejada, J.I.; Rondon, D.; Villalba-Condori, K. Synthetic data analysis for early detection of Alzheimer progression through machine learning algorithms. PeerJ Comput. Sci. 2024, 10, e2437. [Google Scholar] [CrossRef]
  42. Razavi, M.; Ziyadidegan, S.; Mahmoudzadeh, A.; Kazeminasab, S.; Baharlouei, E.; Janfaza, V.; Jahromi, R.; Sasangohar, F. Machine Learning, Deep Learning, and Data Preprocessing Techniques for Detecting, Predicting, and Monitoring Stress and Stress-Related Mental Disorders: Scoping Review. JMIR Ment. Health 2024, 11, e53714. [Google Scholar] [CrossRef]
  43. Hamatta, H.S.; Banerjee, K.; Anandaram, H.; Alam, M.S.; Durai, C.A.D.; Devi, B.P.; Palivela, H.; Rajagopal, R.; Yeshitla, A. Genetic Algorithm-Based Human Mental Stress Detection and Alerting in Internet of Things. Comput. Intell. Neurosci. 2022, 2022, 1687–5265. [Google Scholar] [CrossRef]
  44. Anwar, T.; Zakir, S. Machine Learning Based Real-Time Diagnosis of Mental Stress Using Photoplethysmography. J. Biomimetics, Biomater. Biomed. Eng. 2022, 55, 154–167. [Google Scholar] [CrossRef]
  45. Ratul, I.J.; Nishat, M.M.; Faisal, F.; Sultana, S.; Ahmed, A.; Mamun, M.A.A. Analyzing Perceived Psychological and Social Stress of University Students: A Machine Learning Approach. Heliyon 2023, 9, e17307. [Google Scholar] [CrossRef]
  46. Jadav, J.; Chauhan, U. Personalized Features-Based Stress Detection with Hyperparameter Tuning Using Genetic Algorithm. Reliab. Theory Appl. 2024, 19, 298–309. [Google Scholar] [CrossRef]
  47. Shikha, S.; Sethia, D.; Indu, S. Optimization of Wearable Biosensor Data for Stress Classification Using Machine Learning and Explainable AI. IEEE Access 2024, 12, 169310–169327. [Google Scholar] [CrossRef]
  48. Sağbaş, E.A.; Korukoglu, S.; Ballı, S. Real-time stress detection from smartphone sensor data using genetic algorithm-based feature subset optimization and k-nearest neighbor algorithm. Multimed. Tools Appl. 2024, 83, 1–32. [Google Scholar] [CrossRef]
  49. Daniyal, M.; Javaid, S.F.; Hassan, A.; Khan, M.A.B. The Relationship between Cellphone Usage on the Physical and Mental Wellbeing of University Students: A Cross-Sectional Study. Int. J. Environ. Res. Public Health 2022, 19, 9352. [Google Scholar] [CrossRef]
  50. Viloria, A.; Pineda Lezama, O.B.; Mercado-Caruzo, N. Unbalanced data processing using oversampling: Machine Learning. Procedia Comput. Sci. 2020, 175, 108–113. [Google Scholar] [CrossRef]
Figure 1. Proposed methodology for the development of the research: The arrows indicate the direction of data flow and processing between each stage of the pipeline, from data acquisition to final results. The highlighted red box within the genetic algorithm representation denotes the selected gene (feature) during the evolutionary optimization process, illustrating how specific features are chosen as part of a candidate solution.
Figure 1. Proposed methodology for the development of the research: The arrows indicate the direction of data flow and processing between each stage of the pipeline, from data acquisition to final results. The highlighted red box within the genetic algorithm representation denotes the selected gene (feature) during the evolutionary optimization process, illustrating how specific features are chosen as part of a candidate solution.
Applsci 16 03636 g001
Figure 2. GA methodology for selecting the most significant characteristics for predicting participants with work-related stress Feature Selection of Motor Activity in Intervals of Time with Genetic Algorithms for Depression Detection. The binary values (0 and 1) shown in red within the chromosomes indicate the inclusion (1) or exclusion (0) of specific features in the candidate solution during the genetic algorithm process [31].
Figure 2. GA methodology for selecting the most significant characteristics for predicting participants with work-related stress Feature Selection of Motor Activity in Intervals of Time with Genetic Algorithms for Depression Detection. The binary values (0 and 1) shown in red within the chromosomes indicate the inclusion (1) or exclusion (0) of specific features in the candidate solution during the genetic algorithm process [31].
Applsci 16 03636 g002
Figure 3. Models using forward selection methodology. The solid black line represents the average overall accuracy. The vertical dotted line marks the optimal subset of four predictors and The horizontal axis indicates the number and order of variables sequentially incorporated into the model during the forward selection procedure. The [1] indicates the optimal model selected after evaluating multiple combinations of variables (features).
Figure 3. Models using forward selection methodology. The solid black line represents the average overall accuracy. The vertical dotted line marks the optimal subset of four predictors and The horizontal axis indicates the number and order of variables sequentially incorporated into the model during the forward selection procedure. The [1] indicates the optimal model selected after evaluating multiple combinations of variables (features).
Applsci 16 03636 g003
Figure 4. Ranking of the most significant metabolic features for stress prediction.
Figure 4. Ranking of the most significant metabolic features for stress prediction.
Applsci 16 03636 g004
Figure 5. Evolution of maximum fitness over generations: The central adjustment curve represents the global behavior of the algorithm.
Figure 5. Evolution of maximum fitness over generations: The central adjustment curve represents the global behavior of the algorithm.
Applsci 16 03636 g005
Figure 6. Models using forward selection methodology and data normalized. The solid black line represents the average overall accuracy. The vertical dotted line marks the optimal subset of four predictors and The horizontal axis indicates the number and order of variables sequentially incorporated.
Figure 6. Models using forward selection methodology and data normalized. The solid black line represents the average overall accuracy. The vertical dotted line marks the optimal subset of four predictors and The horizontal axis indicates the number and order of variables sequentially incorporated.
Applsci 16 03636 g006
Figure 7. Evolution of maximum fitness over generations using data normalized: The central adjustment curve represents the global behavior of the algorithm.
Figure 7. Evolution of maximum fitness over generations using data normalized: The central adjustment curve represents the global behavior of the algorithm.
Applsci 16 03636 g007
Figure 8. Percentage confusion matrices obtained in the stress prediction model using 3 variables selected by GA.
Figure 8. Percentage confusion matrices obtained in the stress prediction model using 3 variables selected by GA.
Applsci 16 03636 g008
Table 1. Validation metrics used for model performance evaluation.
Table 1. Validation metrics used for model performance evaluation.
NameFormulaBrief Description
Accuracy T P + T N T P + T N + F P + F N Overall proportion of correctly classified instances across all classes [39].
Precision T P T P + F P Measures how many of the predicted positive instances are actually correct; reflects the reliability of positive predictions [40].
Recall T P T P + F N Indicates the ability of the model to correctly identify all relevant positive instances; also known as sensitivity [40].
F1-score 2 · Precision · Recall Precision + Recall Harmonic mean of precision and recall, providing a balanced measure, especially suitable for imbalanced datasets [40].
Table 2. Descriptive statistics of metabolic and endocrine biomarkers for the total sample ( N = 87 ).
Table 2. Descriptive statistics of metabolic and endocrine biomarkers for the total sample ( N = 87 ).
VariableMeanQ1 (25%)Median (50%)Q3 (75%)Range (Min–Max)
Glucose (ng/dL)89.9979.0086.0094.0026.00–560.00
Insulin (µIU/mL)16.409.1114.6020.213.17–57.25
Cortisol (µg/dL)13.6711.3412.8216.085.58–24.74
HOMA-IR4.012.003.104.300.60–55.90
Insulin/Glucose0.200.120.170.240.04–0.65
Insulin/Cortisol1.330.771.161.620.25–5.09
Table 3. Distribution of metabolic and endocrine biomarkers across stress level groups (low, moderate, high). Values are presented as M e a n ± S D .
Table 3. Distribution of metabolic and endocrine biomarkers across stress level groups (low, moderate, high). Values are presented as M e a n ± S D .
VariableLow Stress (n = 5)Moderate Stress (n = 22)High Stress (n = 60)
Glucose (ng/dL)87.60 ± 10.4590.14 ± 10.6690.00 ± 12.87
Insulin (µIU/mL)8.72 ± 1.7414.45 ± 3.6218.15 ± 11.31
Cortisol (µg/dL)11.48 ± 3.1313.03 ± 3.9814.09 ± 4.89
HOMA-IR1.90 ± 0.453.23 ± 0.974.68 ± 7.30
Insulin/Glucose0.10 ± 0.020.16 ± 0.040.22 ± 0.14
Insulin/Cortisol0.78 ± 0.201.17 ± 0.371.44 ± 0.98
Table 4. GALGO models—Average Accuracy.
Table 4. GALGO models—Average Accuracy.
DatasetGalgo ModelML ModelAverage Accuracy
Standardized dataknnK-Nearest Neighbours0.6908
nearcentNearest Centroid0.4459
svmSupport Vector Machines0.6904
ranforestRandom Forest Classifier0.7206
Non-standardized dataknnK-Nearest Neighbours0.669
nearcentNearest Centroid0.438
svmSupport Vector Machines0.6897
ranforestRandom Forest Classifier0.7586
Table 5. Results obtained by applying intelligent feature selection and machine learning algorithms (XGBoost and EN) for stress prediction.
Table 5. Results obtained by applying intelligent feature selection and machine learning algorithms (XGBoost and EN) for stress prediction.
AlgorithmClassPrecisionRecallF1-ScoreSupport
XGBoostLow Stress0.000.000.005
Moderate Stress0.680.590.6322
High Stress0.830.900.8660
Accuracy 0.77
Elastic NetLow Stress0.060.400.115
Moderate Stress0.500.450.4822
High Stress0.810.480.6060
Accuracy 0.47
Table 6. Results obtained using relevant features, class balancing, and machine learning algorithms (XGBoost and EN).
Table 6. Results obtained using relevant features, class balancing, and machine learning algorithms (XGBoost and EN).
AlgorithmBalnced ClassPrecisionRecallF1-ScoreSupport
XGBoostLow Stress0.840.970.9060
Moderate Stress0.860.850.8660
High Stress0.880.770.8060
Accuracy 0.86
Elastic NetLow Stress0.580.820.6860
Moderate Stress0.550.470.5060
High Stress0.600.450.5160
Accuracy 0.58
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Espino-Salinas, C.H.; Mendoza-González, R.; Luna-García, H.; Cepeda-Argüelles, A.; Sánchez-Reyna, A.G.; Galván-Tejada, C.E.; Soto Murillo, M.A.; Martínez Acuña, M.I.; Martínez Esquivel, R.A. Clinical Stress Level Prediction Using Metabolic Biomarkers and Genetic Algorithm–Based Machine Learning Models. Appl. Sci. 2026, 16, 3636. https://doi.org/10.3390/app16083636

AMA Style

Espino-Salinas CH, Mendoza-González R, Luna-García H, Cepeda-Argüelles A, Sánchez-Reyna AG, Galván-Tejada CE, Soto Murillo MA, Martínez Acuña MI, Martínez Esquivel RA. Clinical Stress Level Prediction Using Metabolic Biomarkers and Genetic Algorithm–Based Machine Learning Models. Applied Sciences. 2026; 16(8):3636. https://doi.org/10.3390/app16083636

Chicago/Turabian Style

Espino-Salinas, Carlos H., Ricardo Mendoza-González, Huizilopoztli Luna-García, Alejandra Cepeda-Argüelles, Ana G. Sánchez-Reyna, Carlos E. Galván-Tejada, Manuel Alejandro Soto Murillo, Mónica Imelda Martínez Acuña, and Rosa Adriana Martínez Esquivel. 2026. "Clinical Stress Level Prediction Using Metabolic Biomarkers and Genetic Algorithm–Based Machine Learning Models" Applied Sciences 16, no. 8: 3636. https://doi.org/10.3390/app16083636

APA Style

Espino-Salinas, C. H., Mendoza-González, R., Luna-García, H., Cepeda-Argüelles, A., Sánchez-Reyna, A. G., Galván-Tejada, C. E., Soto Murillo, M. A., Martínez Acuña, M. I., & Martínez Esquivel, R. A. (2026). Clinical Stress Level Prediction Using Metabolic Biomarkers and Genetic Algorithm–Based Machine Learning Models. Applied Sciences, 16(8), 3636. https://doi.org/10.3390/app16083636

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop