Open Access
ARTICLE
Stress Detection of IT and Hospital Workers Using Novel ResTFTNet and Federated Learning Models
1 Department of Computer Science and Engineering, Vemana Institute of Technology, Koramangala, Bangalore, 560034, India
2 Department of Computer Science and Engineering, Jain (Deemed-to-be University), Bangalore, 560069, India
* Corresponding Author: Pikkili Gopala Krishna. Email:
Intelligent Automation & Soft Computing 2025, 40, 235-259. https://doi.org/10.32604/iasc.2025.063657
Received 20 January 2025; Accepted 06 March 2025; Issue published 28 April 2025
Abstract
Stress is mental tension caused by difficult situations, often experienced by hospital workers and IT professionals who work long hours. It is essential to detect the stress in shift workers to improve their health. However, existing models measure stress with physiological signals such as PPG, EDA, and blink data, which could not identify the stress level accurately. Additionally, the works face challenges with limited data, inefficient spatial relationships, security issues with health data, and long-range temporal dependencies. In this paper, we have developed a federated learning-based stress detection system for IT and hospital workers, integrating physiological and behavioral indicators for accurate stress detection. Furthermore, the study introduces a hybrid deep learning classifier called ResTFTNet to capture spatial features and complex temporal relationships to detect stress effectively. The proposed work involves two local models and a global model, to develop a federated learning framework to enhance stress detection. The datasets are pre-processed using the bandpass filter noise removal technique and normalization. The Recursive Feature Elimination feature selection method improves the model performance. FL aggregates these models using FedAvg to ensure privacy by keeping data localized. After evaluating ResTFTNet with existing models, including Convolution Neural Network, Long-Short-Term-Memory, and Support Vector Machine, the proposed model shows exceptional performance with an accuracy of 99.3%. This work provides an accurate and privacy-preserving method for detecting stress in hospital and IT staff.Keywords
Stress is defined as one’s mental, physical, and emotional response to stimuli, often known as a “stressor”. A stressor is an agent or factor that creates stress. Some stressors occur in family situations, work pressures, and sounds. It causes several physical and psychological health issues, such as anxiety, melancholy, headache, and irregular sleep [1]. The human brain plays a significant role in the physical and mental retorts to stress. It may affect the person’s neurological system and physiological life [2]. The World Health Organization (WHO) defines work-related stress as a response to work demands and pressures that exceed an individual’s knowledge and abilities, challenging their ability to cope [3]. Most of them get mental health issues from work-related stress, which negatively affects employee well-being, especially the shift workers in IT and healthcare [4]. The high technical expertise required, tight deadlines, and the need for continuous learning in the IT industry contribute to significant stress among employees. Similarly, hospital staff often face heavy workloads and extended working hours. As a result, many individuals in the IT and healthcare sectors experience high stress levels [5,6]. It is essential to detect the stress in IT and healthcare employees to prevent a healthy life globally. In previous studies, the researchers used physiological signals like photoplethysmogram (PPG), electrodermal activity (EDA), and blink rate to measure the stress [7].
There is an increasing demand for fast and resourceful stress detection methods to help people manage their stress levels. For that, various achievements have happened in stress detection in recent years, especially during COVID-19; stress levels have increased due to online classes, loss of jobs, and financial issues. The artificial intelligence (AI) system and machine learning techniques have an efficient capability to predict stress [8,9]. Techniques like Convolutional Neural Networks (CNN) and Long Short-Term Memory (LSTM) networks have proven useful for predicting psychological stress [10]. Additionally, Artificial Neural Networks (ANN) have been used to analyze physiological and demographic data from wearable technology to predict stress levels in working women. Wearable devices such as smartwatches, wristbands, and rings play a vital role in stress detection and offer innovative approaches to effectively manage stress [11,12]. Although there have been significant advancements, there are still some research gaps in stress detection in IT and hospital workers. The motivation behind this study arises from the need to develop a more effective and secure system for stress detection. Firstly, there is a need for a more accurate model that combines both physiological and behavioral indicators, offering a deeper understanding of stress beyond isolated physiological measurements. Secondly, data privacy remains a significant issue in health-related studies, especially when sensitive information is involved. Federated Learning (FL), a decentralized machine learning approach, offers a promising solution by enabling model training on local devices without sharing raw data, ensuring privacy while leveraging distributed datasets. Thirdly, existing stress detection models often struggle with long-range temporal dependencies and inefficient feature extraction methods, which can hinder performance. To overcome these issues, a more advanced hybrid deep learning classifier is necessary, one that is capable of capturing both spatial features and temporal relationships efficiently. The main contributions of this work are summarized as follows:
• This research proposes ResTFTNet, a hybrid deep learning model that effectively captures spatial features and long-range temporal dependencies in physiological and behavioral stress indicators to enhance feature extraction for stress detection with improved accuracy.
• This study develops a privacy-preserving Federated Learning (FL) framework to detect stress in IT and hospital workers, ensuring sensitive health data remains localized. This addresses the privacy concerns of sharing health data in traditional centralized machine learning systems.
• This study uses multimodal data by integrating both physiological signals and behavioral indicators to provide a more comprehensive and accurate stress classification.
• The study employs a bandpass filter noise removal technique to enhance the quality of physiological signals and Recursive Feature Elimination (RFE) for selecting the most relevant stress-related features, improving model efficiency and accuracy.
The research structure is organized as follows: Section 2 investigates the related work of stress detection using various DL and ML models with multimodal data. Section 3 explains the proposed methodology. Section 4 portrays the results and discussion, and Section 5 gives the conclusion.
2.1 Integration of Multi-Modal Physiological Data for Stress Detection
Kuttala et al. [13] proposed the multi-modal hierarchical CNN to detect stress using the ECG and EDA physiological signals. Furthermore, the study should incorporate hierarchical feature fusion and various multi-modal fusion techniques to obtain the hierarchical features efficiently. Zou et al. [14] applied the four types of physiological signals to classify the stress and human emotion states with a hybrid neural network classifier model. It includes two kinds of attention modules to enhance classification accuracy. Henceforth, additional signals were needed and integrated to improve the classification accuracy. Upadhya et al. [15] introduced a framework for stress detection using physiological and facial expressions. It utilized advanced ML models such as Long-Short-Term Memory (LSTM) networks, Support Vector Machines (SVM), and Convolutional Neural Networks (CNNs) for stress classification. The imbalanced data in the physiological data affected the model’s performance. Bodaghi et al. [16] improved the stress detection accuracy by the Multi-Dimensional Scaling (MDS) manifold method. It required various fusion levels (early, late, and intermediate) in multimodal learning networks. Xu et al. [17] presented the deep stress tracing method DST, which is used to trace human stress based on physiological signals collected by a noncontact ultra-wideband radar. Yet this study did not consider the performance of the user while completing the task, which reduces the detection accuracy.
2.2 Stress Detection with Machine Learning and Deep Learning Approaches
Mane et al. [18] introduced the new model by combining the two-dimensional CNN and LSTM network StressNet to detect stress using an electroencephalogram (EEG) signal. The study faced issues with the limited samples, and EEG data was time-consuming and expensive. The study [19] developed a supervised learning algorithm to detect and classify stress and relaxation states with heart rate variability. The study faced issues with the limited samples in the dataset, and feature selection caused an overfitting problem. Gedam et al. [20] investigated an advanced mental stress detection model to classify stress levels in Indian housewives using wearable physiological sensors and DL techniques. It used the SelectKBest and advanced feature selection model to improve the model’s performance. They suggested future work with a larger and more diverse dataset to improve the accuracy and advance the DL classifier for better performance. Ziaratnia et al. [21] presented a video-based stress detection and classification method using the multimodal classification model. This work integrated the two deep learning models, Compact Convolutional Transformer (CCT) and Long Short-Term Memory (LSTM), to form a CCT-LSTM for efficient feature extraction and temporal pattern recognition. However, the study faced issues with limited data size and computational requirements. Amin et al. [22] addressed the issues of driver’s stress detection using the advanced deep transfer learning model Xception pre-trained neural networks. This study is also classifying stress levels through electrocardiogram (ECG), heart rate (HR), galvanic skin response (GSR), electromyogram (EMG), and respiration (RESP) signals. Henceforth, the work needs to expand its stress performances by directly applying signals to deep neural networks for feature extraction and classification.
2.3 Federated Learning for Privacy-Preserving Stress Detection Systems
The authors of [23] proposed the federated learning (FL) based deep neural network (DNN) to preserve the privacy of patient data while classifying and monitoring the stress using physiological factors. Furthermore, the study needs to explore advanced deep-learning algorithms with multiple datasets to ensure the quality of the proposed model. Wang et al. [24] introduced a differential privacy-based federated transfer learning framework for monitoring mental health. The work especially focused on stress detection. Unfortunately, it struggled with the limited data availability in real-time applications, and it is important to provide a compromise on data security. Gupta et al. [25] designed the communication-efficient and privacy-preserving hybrid federated learning (HFL) paradigm to address the challenges in mental healthcare applications. This study proposed the two federated learning-based model for classification. The study needs improvement in the global model and reduces the computational overhead. Alahmadi et al. [26] proposed a novel framework for detecting mental stress using the Internet of Medical Things (IoMT) combined with federated learning (FL). In the future, this study will develop more advanced ML algorithms to improve the accuracy and efficiency of stress detection and implement real-time data processing and stress detection to provide immediate feedback and interventions. Gahlan et al. [27] proposed a Federated Learning-based Multi-modal Emotion Recognition System (F-MERS) framework to provide privacy. It integrates the physiological signals such as EEG, GSR, ECG, and RESP. Furthermore, the study focused on combining the physiological indicators with other physical indicators.
The above-mentioned related works faced problems with limited data, which is inherently sensitive to a variety of external factors, data security, and complex handling of spatial relationships and long-range temporal. To overcome these problems, we propose an integrated physiological and behavioral signal analysis for stress detection using ResTFTNet and FL models.
The proposed real-time stress detection and monitoring framework using DL and FL to develop the accuracy of the stress detection system in IT and hospital settings is shown in Fig. 1. The hybrid DL model is used to train the two local models; one is the IT worker’s stress dataset, and another one is the hospital workers dataset. The multimodal approach provides a holistic view of stress and improves accuracy and reliability in diverse and high-pressure environments. To ensure tamper-proof, we stored our multimodal dataset in IPFS storage space, which establishes a secure, transparent data management system and a decentralized platform. Then, the data is processed in the pre-processing steps to improve data integrity. After that, the preprocessed data is extracted using the wavelet transform method to capture the stress-related data signals. To select the significant features, we used the recursive feature elimination (RFE). The ResTFTNet classifier model combines to capture both spatial features and Transformers for temporal relationships to enhance accuracy and better decision-making. FL then aggregates their outputs to create a global model.

Figure 1: Diagrammatic representation of the proposed methodology
The study involved 78 participants from a hospital setting and 50 participants from the IT industry. Data was collected over six months, from February 2024 to July 2024, with a total of 128 participants. During our study, the participants were equipped with sensors to gather various physiological information, including HR, EDA, ST, and blood volume pulse (BVP). Additionally, eye-tracking devices are used to measure the blink ratio throughout the experiment. We collected both IT and hospital employees’ comprehensive information regarding our study’s objectives, data usage, and privacy measures. Informed consent was obtained from each individual, clearly outlining their participation and rights regarding the data being collected. All these data are anonymized before storage and analysis. We removed personal identifiers, and the data was processed to prevent re-identification of any individuals. Due to the strong anonymization process, no sensitive information such as names, addresses, or contact information is included. After the initial data collection phase, the dataset size was increased from 128 participants to 11,600 data points to further enhance the model’s robustness and accuracy. The expansion of the dataset involved several strategies to augment the data while maintaining its authenticity and relevance for stress prediction. Data augmentation techniques including Noise Injection, Time Warping, Time Shifting, and Windowing and Slicing were applied to create additional samples from the existing data. These methods aimed to generate more diverse data without requiring the collection of new raw data, making the models more adaptable to variations in stress responses. To ensure privacy and data security, the study utilized Federated Learning to process data from both the IT and hospital sectors. The data collected from IT employees was sent to Local Model 1, while the data from hospital employees was sent to Local Model 2. Both models were trained separately on the local devices, and only the aggregated model updates were shared, ensuring that sensitive personal information remained private and secure.
Data preprocessing is the initial step that applies to the raw data from the dataset to prepare it for further analysis. It includes various techniques such as cleaning, transforming, rescaling, etc. The data set contains irrelevant features, noise, and inconsistencies. It is essential to clean and prepare model training. As a preprocessing step, we use the bandpass filter technique for noise removal and normalization techniques.
3.2.1 Noise Removal Using the Bandpass Filter Technique
Noise removal is a crucial step in multiple bio-signals data. Filtering is the most commonly used method to remove noise in physiological signals such as PPG, EDA, HRV, and so forth. This removes the low-frequency noise with a high-pass filter and high-frequency with a low-pass filter, but it may remove some EEG signals from the data. However, the Band-pass filter eliminates high and low-frequency noise [28]. Here, we applied the bandpass filter to expand the data quality and ensure the subsequent analysis of the raw data signal containing low and high frequencies. It allows only the frequencies within a specific range. The bandwidth
where,
Normalization is an essential data preprocessing step that can improve the precision and effectiveness of the classification model. It is a procedure for rescaling the numerical values to a common range between 0 and 1 [29]. After denoising, the physiological data undergo normalization because they contain different ranges of baseline. Normalization is performed to prevent irrelevant data in the dataset.
3.2.3 Labeling to Assign Stress Level
In deep learning, the data label is essential for training the classifier. Here, we labeled the data to indicate the corresponding stress levels, such as “low stress,” “moderate stress,” and “high stress.” This can be done by the workers self-reporting or with the help of other sensors. The data is labeled to guide the model in knowing the difference in stress levels.
A label encoder encodes the categorial value into numerical value [30]. The columns “stress levels” and “distressed” are in categorical values. It is essential to convert both columns into numerical values. A Label Encoder object was created for each column to transform categorical data into numeric representations. The Label Encoder fitted and transformed the data in stress levels are categorized as “low” encoded as 0, “medium” as 1, and “high” encoded as 2. This ensures compatibility with machine learning algorithms. This step is necessary for most ML-based models requiring input numerical values.
3.3 Feature Extraction Using Wavelet Transform
Feature extraction is a critical process that effectively transforms raw data into numerical features, enabling efficient processing while maintaining the integrity of the original data set. Wavelet transform is a signal analysis tool that handles signal inconsistencies and non-stationary challenges [31]. Our work uses the wavelet transform (WT) as a feature extraction technique to extract the important features associated with stress at different signal scales and frequencies. The wavelet transform decomposes the signals into a set of wavelet function
where, the
where, the
where,
3.4 Feature Selection via Recursive Feature Elimination (RFE)
RFE [32] is a wrapper-based feature selection method that uses a backward elimination approach to identify the most essential features. Initially, a prediction model is trained using all available features, and the consequence of each feature is assessed. Next, RFE ranks the features based on their status and iteratively removes the least relevant ones, using model performance metrics to guide the process. This remains until the chosen number of features is retained, resulting in an optimal subset of features for the model. The pseudo-code of the feature selection using RFE is given in Algorithm 1.

3.5 Classification Using ResTFTNet
This study proposes an advanced hybrid classification approach using ResTFTNet, a deep learning model that effectively captures both spatial features and long-range temporal dependencies in stress-related signals. This step uses the deep learning-based classifier to classify the stress levels using extracted and selected features. For effective classification, we use the CNN-based classifier. The convolutional neural network (CNN) captures the longitudinal features from the signal data. For that, we use the ResNet-101 classifier. ResNet-101 effectively extracts spatial features that are used for detecting patterns associated with stress. ResNet-101 [33] is a residual network that contains 101 deep layers. Deeper networks often encounter degradation problems during the convergence process, which can lead to a rapid decline in accuracy. ResNet addresses this degradation issue by utilizing a deep residual learning framework. The architecture generally follows a convolutional neural network (CNN) structure but with residual blocks replacing traditional stacked convolutional layers. In this study, we integrated the two models to introduce the hybrid DL classifier for accurate stress detection. Fig. 2 shows the architecture diagram of the proposed ResTFTNet model.

Figure 2: Architecture diagram of proposed CNN-based TFT model
The network starts with an input layer that takes the input features and passes them to the convolutional layer to perform feature extraction. This extracts the low-level features using small filters to capture basic patterns. Next, the residual block is one of the core innovations of ResNet-101. It skips one or more layers common in every block, which helps avoid the degradation problem. The extracted features are given to TFT to handle the complex temporal pattern.
The Temporal Fusion Transformer (TFT) is a cutting-edge architecture that uses attention mechanisms specifically crafted for interpretable multi-horizon time series forecasting. The TFT integrates deep learning capabilities with a focus on interpretability by employing recurrent layers to process local sequences and self-attention mechanisms to capture long-term dependencies. This combination enables the TFT to learn temporal relationships across multiple scales effectively [34]. The gated residual network (GRN) is used throughout TFT to capture the complex temporal pattern and dependencies. The architecture of GRN is given in Fig. 3. The variable ‘a’ is the primary input for the Gated Residual Network (GRN). It first passes through a dense layer with an Exponential Linear Unit (ELU) activation, followed by a linear layer with dropout. The output is then fed into a Gated Linear Unit (GLU). Finally, the GRN output is obtained by normalizing the sum of ‘a’ and the GLU output, incorporating a residual connection. Finally, the fully connected (FC) layer is passed to softmax activation for classification tasks.

Figure 3: Gated Residual Network (GRN) architecture
The ResTFTNet approach in this study captures spatial features and complex temporal relationships, which is very useful for accurately detecting and classifying worker stress. It can process both spatial context and dynamic, time-dependent data, allowing it to make more accurate and context-aware predictions, improving the overall performance of stress detection systems.
The FL model is a combined global machine-learning method that trains selected models across several clients or devices while ensuring user data privacy [35]. This work uses the FL to report the problem of stress detection. It allows local preprocessing, synchronization, and personalization on individual devices, reducing central server load and ensuring privacy by sharing only model updates.
Aggregation into the Global Model
We use federated averaging (FedAvg) to aggregate the two local models into the global model. FedAvg is one of the premier methods utilized in FL, making it an essential choice for effective decentralized training. This is used to aggregate the local model into the global model. The FedAvg is given in Eq. (5).
where,
This section explains the results of the experiments conducted on the IT worker’s stress dataset and hospital worker’s stress dataset using the hybrid DL and FL models. The performance of the proposed model is evaluated by discussing the performance of each local model and FL as separate states. First, we evaluate the software and hardware setups used in the training process, as given in Section 4.1. In Section 4.2, the statistical analysis of the performance evaluation is given. The performance evaluation of the proposed DL and FL model is given in Section 4.3. Section 4.4 provides the validation result of the proposed model with another external dataset. We also created a web application for predicting worker stress in low devices (mobile phones). The experimental result is shown in Section 4.5. Additionally, the ablation study experiment is explained in Section 4.6. The comparative analysis of the proposed stress detection model with existing works is shown in Section 4.7, and the result of the proposed model is discussed in Section 4.8.
The experimental setting for stress detection using the DL model was implemented on the Windows 10 system. The specification and configuration of the system are given in Table 1. The models are built using Python 3.12 with Tensorflow version 2.17 as a deep learning framework. Intel Core i5 6500 CPU @ 3.20 GHz, 8.0 GB DDR3, Graphics = Intel(R) HD Graphics 530Software.

The training of DL and FL models is conducted on a CPU-based system without GPU acceleration, which results in relatively slow training and inference times. The models are trained for 50 epochs with a batch size of 32, requiring approximately 12 h for local training and 25 h for federated learning (FedAvg), which includes additional overhead from model synchronization and communication across multiple nodes. The inference time per model is 600 ms, which is slower than desired for real-time applications, and the memory usage is around 6 GB per model. Deployment on the CPU is challenging due to these limitations, making it difficult to scale the system efficiently. The scalability of the system is considered low to medium, primarily due to CPU constraints.
4.2 Statistical Analysis of Evaluation Metrics
Performance evaluation of the stress detection DL and FL model requires several evaluation metrics to assess its performance. These metrics ensure the model’s robustness, reliability, and generalizability. Performance metrics include accuracy, precision, recall, F1 score, Matthew’s correlation coefficient (MCC), specificity, false negative rate (FNR), and false positive rate (FPR). These metrics provide unique insights into the model’s strengths and weaknesses.
Accuracy: Accuracy refers to the proportion of correctly classified instances compared to the evaluated instances. It is one of the simplest metrics used to assess model performance. Accuracy provides a general idea of how well the model performs across all classes and can be calculated using the formula presented in Eq. (6).
Precision: Precision, also known as positive predictive value, measures the accuracy of positive predictions made by a classifier. High precision indicates a low false positive rate for the model. Eq. (7) shows the formula used to calculate precision.
Recall: Recall, which is also referred to as sensitivity or the true positive rate, measures a classifier’s ability to identify all relevant instances (true positives). It is calculated using the formula provided in Eq. (8). A high recall indicates that the model effectively identifies most of the positive instances.
F1 score: The F1 score is the harmonic mean of precision and recall, providing a single metric that balances both. It can be calculated using the formula given in Eq. (9).
Matthew’s correlation coefficient (MCC): The MCC calculates the discrepancy between the actual and predicted value. The MCC is calculated using Eq. (10).
Specificity: The specificity (true negative) is the number of correctly predicted negative cases divided by the number of all negative cases calculated by Eq. (11).
FNR and FPR: The false-positive rate (FPR) is the chance that the null hypothesis is true. For a result that is not significant, the false-negative rate (FNR) is the chance that the alternative hypothesis is true. The FNR and FPR are calculated using Eqs. (12) and (13):
From Eqs. (6)–(13), TP, TN, FP, and FN represent true positive, true negative, false positive, and false negative.
4.3 Performance Analysis of Local Models
The performance of the stress detection model was evaluated through metrics of accuracy, precision, recall, F1 score, Matthew’s correlation coefficient (MCC), specificity, false negative rate (FNR), and false positive rate (FPR). The accuracy implies the model’s ability to detect the data precisely. Precision made a number of correct positive observations. The MCC calculates the discrepancy between the actual and predicted value. The model’s capacity to predict genuine positive and true adverse outcomes is indicated by recall and specificity.
The performance of the proposed model is assessed by evaluating the performance of local models 1, 2, and the global model in accurate stress detection. Table 2 shows the incomparable performance of local models 1 and 2 on the IT workers dataset and hospital worker datasets across various metrics, including accuracy, precision, recall, F1 score, Matthews Correlation Coefficient (MCC), specificity, False Positive Rate (FPR), and False Negative Rate (FNR). Figs. 4 and 5 show the bar graph of the local models 1 and 2 performance metrics.


Figure 4: Performance metrics of local model 1

Figure 5: Performance metrics of local model 2
4.3.1 Performance Analysis of Local Model 1
Fig. 6 displays the accuracy and loss curves for local model 1, presenting insights into its performance during training. The training and validation curves converge smoothly from the first to the last epoch, exhibiting negligible fluctuations. The curves help estimate local model 1’s performance and its capability to adapt to the IT worker dataset. The gap between the curves indicates that overfitting did not occur during training.

Figure 6: Accuracy and loss curve of local model 1
Fig. 7 shows the confusion matrix used to evaluate local model 1, detecting stress. The true labels are represented by each column and the forecast labels are denoted by each row. The matrix provides insight into the accuracy of stress detection.

Figure 7: Assessment of local model 1 with the confusion matrix
4.3.2 Performance Analysis of Local Model 2
Fig. 8 displays the accuracy and loss curves of local model 2 for 30 epochs. The training and validation curves converge smoothly, indicating local model 2’s ability to adapt to the hospital workers’ Dataset. Fig. 9 shows the confusion matrix used to evaluate local model 2, detecting stress.

Figure 8: Accuracy and loss curve of local model 2

Figure 9: Assessment of local model 2 with the confusion matrix
4.3.3 Performance Analysis of Global Model
Fig. 10 demonstrates the precision and loss curve of the global model for stress detection. This curve is a tool for estimating the model’s improvement and adaptation to the integrated dataset used. The accuracy curve shows the effectiveness of the FL in improving the challenges in stress detection, and the loss curve reduces the prediction errors in the classification performances. Table 3 shows the performance metrics of the global model.

Figure 10: Accuracy and loss curve of global model

4.3.4 Error Performance Metrics of Two Local Models and FL Global Model
This study also evaluates the performances of the local models and FL global models through several error metrics, such as Mean Square Error (MSE), Mean Absolute Error (MAE), and Mean Absolute Percentage Error (MAPE).
Table 4 presents the performance metrics for three models: two local models and one federated learning (FL) global model. It shows that the FL Global Model outperforms the others with the lowest Mean Squared Error (MSE) of 0.001987, Mean Absolute Error (MAE) of 0.04432, and a Mean Absolute Percentage Error (MAPE) of 6.33%. Local Model 1 has an MAE of 0.0489 and a MAPE of 6.99%, while Local Model 2 shows significantly higher errors with an MAE of 0.14567 and a MAPE of 20.81%. Overall, the FL Global Model is the best choice based on these metrics.

4.3.5 ROC-AUC Curve for Federated Learning
A ROC-AUC curve is useful for visualizing the trade-off between correctly identifying stress (True Positives) and incorrectly flagging non-stressful states as stressful (False Positives) at various classification thresholds. Additionally, a detailed breakdown of False Positives and False Negatives offers valuable insights into the specific errors the model makes when identifying stress states.
Fig. 11 demonstrates the ROC-ACU curve for FL model stress detection. In the graph, the ROC curve reaches the top-left corner, indicating a TPR of 1 and an FPR of 0. The provided graph shows that the suggested model has achieved perfect accuracy in stress evaluation.

Figure 11: ROC-AUC curve for FL model
4.3.6 Experiment on Non-IID Data Setup
The performance of Federated Learning (FL) under Independent and Identically Distributed (IID) and Non-IID. It plots accuracy against communication rounds, comparing the convergence and stability of the FL model. The blue dashed line represents the performance of FL when the data across different clients is IID. The red solid line shows the performance of FL under non-IID data distribution. Non-IID data means that the data distribution varies significantly across clients, which is more representative of real-world scenarios. This graph indicates that FL with non-IID data converges more slowly compared to the IID scenario.
Fig. 12 demonstrates the impact of data distribution on the performance of FL. IID data leads to faster convergence, while non-IID data poses challenges, resulting in slower convergence. Each client trains a local model and the models are aggregated using the Federated Averaging (FedAvg) algorithm. The global model is evaluated after each round to track accuracy. Finally, the results of IID and non-IID training are plotted to analyze the impact of data distribution on FL performance.

Figure 12: Experimental result of IID and non-IID data in FL
4.4 Results of the Proposed Model’s Performance across Different Datasets
To further validate the model’s generalizability, we validate our proposed model using a worker stress detection database from another center that was not part of the training dataset. For that, we use the stress detection dataset, which captures various psychological, behavioral, and physiological attributes of each participant. It is a CSV file format dataset. Our proposed method evaluates the model’s performance metrics on the external validation dataset. The proposed model evaluates the model’s performance metrics of hospital and IT workers dataset. The performance metrics of our proposed model with the dataset used for training, with the external stress detection dataset to obtain the model’s generalizability, are analyzed.
Table 5 demonstrates that the model’s performance on the stress detection dataset was not significantly different from the proposed training dataset. It shows that our proposed model is better generalized across various stress detection datasets. The successful validation of our model using the stress detection dataset highlights its potential as a reliable tool for decision-making.

4.5 Result of the Web App Testing to Predict Worker Stress
This section analyses the results of the web app testing for worker stress detection based on stress levels. We created a stress-detect web application for displaying the stress level of the hospital and TI workers based on their physiological and psychological details. The app page includes the details of blink rate, RR, HRV, ST, motion, voice stress, and cortisol levels. We fill in the obtainable details in the appropriate blanks and then click the Predict button. Then the application automatically generates the message representing whether the person is stressed or not, the stress score, and the stress levels of the worker or a person shown in Figs. 13 and 14.

Figure 13: Web-based mobile application for stress prediction

Figure 14: Prediction results
The ablation study evaluates the model’s presentation with and without the RFE feature selection method. It removes or eliminates the least important one to select the significant one to improve the model’s efficiency. Figs. 15 and 16 indicate the performance of local models 1 and 2 with and without the feature selection component (RFE) based on the accuracy metric. The result highlights the significant impact of RFE on improving model performance and detection accuracy.

Figure 15: Comparison of metrics with and without RFE feature selection in local model 1

Figure 16: Comparison of metrics with and without RFE feature selection in local model 2
In this part, we compare the performance of the proposed models with existing stress detection methods. We evaluate existing deep learning and federated learning models to demonstrate our proposed model’s adaptability and efficiency. Additionally, we also provide a comparison of other standard transformer models to ensure the scalability of the model.
4.7.1 Comparison Analysis of ResTFTNet and Existing Models
The comparative analysis of the proposed ResTFTNet model with other DL models shows the efficiency and robustness of the proposed model in accurate stress detection.
Fig. 17 demonstrates the comparison evaluation of our proposed model, ResTFTNet, with existing models. It shows that the proposed classifier achieves 99% accuracy, surpassing other models CNN, SVM, and CNN [14], CNN-LSTM [15], MDS [16], and StressNet [19], which achieved accuracies of 83.88%, 87%, 96%, and 97.8%, respectively.

Figure 17: Comparison of performance metrics for ResTFTNet and existing models
4.7.2 Comparison Analysis of the ResTFTNet Model with Other Standard Transformer Models
The comparison analysis of the ResTFTNet model over other standard transformer-based models highlights the superiority of the proposed model. Here, we used the vanilla transformer as a standard transformer-based model to compare with our proposed ResTFTNet model.
Table 6 compares the proposed transformer model with the baseline transformer model. As evident from Table 6, our ResTFTNet model outperforms the baseline model (vanilla transformer) across all three error metrics (MSE, MAE, and MAPE). Notably, the proposed transformer model achieves 0.001987 of MSE, 0.04432 of MAE, and 6.33% of MAPE compared to the baseline model achieves 0.0021 of MSE, 0.05 of MAE, and 7.10% of MAPE, respectively. This indicates that the proposed transformer model performs better in minimizing prediction errors than the vanilla transformer model and provides better and more accurate stress detection.

4.7.3 Comparative Analysis of FedAvg Aggregation Model with Other FL Aggregation Models
The comparison performances of the proposed federated learning aggregation model fedAvg with other baseline federated learning models such as FedProx, FedNova, and FedOpt.
Table 7 illustrates the comparison performances of the FedAvg aggregation model with other FL aggregation models. Among the FL aggregation models proposed FedAvg outperforms all other FL aggregation models for the basic metrics (accuracy, precision, recall, and F1_score) due to its simplicity and computational efficiency. It exhibits superior performance by achieving metrics of 99.3 %, 98.22 %, 100%, and 95.28% surpassing other FL aggregation models such as FedProx ( 98.8%, 97.9 %, 99.7 %, and 95.7%), FedNova (99%, 98%, 99.8%, and 95.5%), and FedOpt (99.2%, 98.2%, 99%, and 96%), respectively. It proves that the other FL aggregation models face slow convergence and complexity issues. However, the FedAvg maintains a straightforward averaging technique that ensures stable learning and achieving strong convergence without the added computational overhead of alternative methods.

The proposed hybrid DL model aims to improve stress detection in real-world scenarios by integrating DL and FL. This model combines the physiological and behavioral signals of IT and hospital workers to provide more accurate stress detection than the traditional methods. The two local models are integrated into the global model using federated learning. The performance metrics of local models 1 and 2 show that the ResTFTNet model effectively addresses class imbalance, overfitting, and limited data availability. We selected the ResTFTNet classifier for IT and hospital data to classify worker stress. This model combines residual connections with temporal and spatial components, enhancing feature extraction and gradient handling. ResTFTNet employs CNN-based spatial feature extraction alongside the self-attention mechanism of Transformers, effectively capturing long-range temporal dependencies and fine-grained spatial features. Our comparison with standard Transformer models demonstrates that ResTFTNet outperforms them in accuracy, robustness, and scalability, as illustrated in Table 6. The training and validation loss curves for the two local models show the best performance during the training process, effectively avoiding overfitting. Moreover, the network depth analysis is also performed by increasing and decreasing the layer of the ResTFTNet model, it shows with 6 layers, the model achieves low accuracy. Increasing the depth to 12 layers improves accuracy further, suggesting the model is better at capturing more complex patterns. The confusion matrix showed the model’s ability to correctly identify stress levels. The ROC-AUC curve strengthens the stress detection model which accurately detects stress in the workers as given in Fig. 11. Additionally, we also tested our FL models to perform non-IID settings and compared them with IID data given in Fig. 12. The stress detection application for predicting the stress using the signals is also created in the create-react app and the results are shown in Figs. 13 and 14. An ablation study is also conducted by removing the feature selection component in Figs. 15 and 16. Fig. 17 and Table 7 compare the proposed model with the existing Deep Learning models and FL aggregation model to ensure robust stress detection in hospitals and IT workers. Additionally, we compare our proposed transformer model with the baseline model (vanilla transformer). It proves the proposed model’s effectiveness which has fewer performance errors leading to accurate stress detection.
Our innovative stress detection model is highly applicable in real-world environments such as hospital staff, IT workers, public safety workers, educational Institutes, and manufacturing fields. They are the most stressed persons and our model detects the stress more accurately and helps to make early treatment for stress reduction. In hospitals, the model supports emergency and intensive care staff, preventing burnout and ensuring good patient care. In IT, it helps developers and network teams work more effectively and avoid burnout. Public safety workers, like firefighters and police, use real-time stress monitoring to make better decisions. In call centers, the model improves employee well-being and customer satisfaction. For air traffic controllers, it reduces mental strain. In manufacturing, it checks for fatigue and stress-related mistakes to keep workers safe. Overall, this model boosts worker well-being and performance in demanding jobs.
The proposed worker stress detection model has great potential but it has several limitations that can affect its reliability and predictivity of the model. Inconsistent and insufficient data cause inaccurate stress prediction in high-stress situations. Additionally, ensuring privacy may also lead to challenges related to data heterogeneity and synchronization between different nodes, potentially affecting the model’s accuracy. The future work is expanded to overcome these issues. The proposed model provides superior accuracy and robustness in detecting stress among IT and hospital workers, effectively addressing challenges like class imbalance and overfitting. Despite data inconsistencies and privacy concerns, this model holds significant potential for real-time, personalized stress management and intervention in high-pressure environments, paving the way for improved worker well-being and performance.
We developed an effective approach for stress detection systems for IT and hospital workers that enhances health and work performance through the federated learning (FL) model. It integrates physiological and behavioral data to present a promising solution to improve workplace well-being. By combining physiological and psychological signals, our system provides real-time assessments of stress levels, enabling personalized interventions. The hybrid DL classifier model comprising a CNN with a Temporal Fusion Transformer (TFT) effectively captured the spatial features and long-range temporal dependencies of stress data. The study achieved an impressive accuracy of 99.3% in stress detection, outperforming traditional models like CNN, LSTM, and SVM while ensuring data privacy by keeping sensitive information localized. We further enhanced stress detection performance through Recursive Feature Elimination (RFE) for feature selection, alongside bandpass filtering and normalization during pre-processing. This creates a reliable solution for real-time stress monitoring in high-stress environments, with the potential for adaption in other high-risk professions. Future work will focus on increasing the transparency of the model’s execution to facilitate its adoption in healthcare settings.
Acknowledgement: Not applicable.
Funding Statement: No funding was received for conducting this study.
Author Contributions: I and my co-author contributed to the conception of the problem setting and overall design of the work. Pikkili Gopala Krishna built the conceptualization and methodology, Jalari Somasekar implemented the work, and writing was done by Pikkili Gopala Krishna and Jalari Somasekar. This version was revised and improved by Pikkili Gopala Krishna and Jalari Somasekar, who also read and approved the final manuscript. All authors reviewed the results and approved the final version of the manuscript.
Availability of Data and Materials: Data openly available in a public repository. The data that support the findings of this study are openly available in data world at https://data.world/project-029/ws72034 (accessed on 5 March 2025). Availability of code: https://github.com/Project007-MA/str0802.git (accessed on 5 March 2025). Website link: https://papaya-marigold-e6326b.netlify.app/ (accessed on 5 March 2025). Validation dataset link: https://www.kaggle.com/datasets/swadeshi/stress-detection-dataset (accessed on 5 March 2025).
Ethics Approval: The dataset used in this study was specifically created for stress management research, and all necessary precautions were taken to maintain participant confidentiality. No personally identifiable information (PII) was collected, and all data were anonymized before processing the research is original and all the figures and tables are created by the authors of this manuscript.
Conflicts of Interest: The authors declare no conflicts of interest to report regarding the present study.
References
1. Rodrigues F, Correia H. Semi-supervised and ensemble learning to predict work-related stress. J Intell Inf Syst. 2024 Feb;62(1):77–90. doi:10.1007/s10844-023-00806-z. [Google Scholar] [CrossRef]
2. Saffari F, Norouzi K, Bruni LE, Zarei S, Ramsøy TZ. Impact of varying levels of mental stress on phase information of EEG Signals: a study on the Frontal, Central, and parietal regions. Biomed Signal Process Control. 2023 Sep 1;86:105236. doi:10.1016/j.bspc.2023.105236. [Google Scholar] [CrossRef]
3. Ciccarelli M, Papetti A, Germani M. A review of work-related stress detection, assessment, and analysis on-field. Procedia CIRP. 2023 Jan 1;120(1):1220–5. doi:10.1016/j.procir.2023.09.152. [Google Scholar] [CrossRef]
4. Riches S, Taylor L, Jeyarajaguru P, Veling W, Valmaggia L. Virtual reality and immersive technologies to promote workplace wellbeing: a systematic review. J Ment Health. 2024 Mar 3;33(2):253–73. doi:10.1080/09638237.2023.2182428. [Google Scholar] [PubMed] [CrossRef]
5. Ajayi FA, Udeh CA. Combating burnout in the IT industry: a review of employee well-being initiatives. Int J Appl Res Soc Sci. 2024 Apr;6(4):567–88. doi:10.51594/ijarss.v6i4.1010. [Google Scholar] [CrossRef]
6. Doleman G, De Leo A, Bloxsome D. The impact of pandemics on healthcare providers’ workloads: a scoping review. J Adv Nurs. 2023 Dec;79(12):4434–54. doi:10.1111/jan.15690. [Google Scholar] [PubMed] [CrossRef]
7. Masri G, Al-Shargie F, Tariq U, Almughairbi F, Babiloni F, Al-Nashash H. Mental stress assessment in the workplace: a review. IEEE Trans Affect Comput. 2023 Sep 7;15(3):958–76. doi:10.1109/TAFFC.2023.3312762. [Google Scholar] [CrossRef]
8. Haque Y, Zawad RS, Rony CS, Al Banna H, Ghosh T, Kaiser MS, et al. State-of-the-art of stress prediction from heart rate variability using artificial intelligence. Cognit Comput. 2024 Mar;16(2):455–81. doi:10.1007/s12559-023-10200-0. [Google Scholar] [CrossRef]
9. Mittal S, Mahendra S, Sanap V, Churi P. How can machine learning be used in stress management: a systematic literature review of applications in workplaces and education. Int J Inf Manag Data Insights. 2022 Nov 1;2(2):100110. doi:10.1016/j.jjimei.2022.100110. [Google Scholar] [CrossRef]
10. Tian Y. Identification and modeling of college students’ psychological stress indicators for deep learning. Sci Program. 2022;2022(1):6048088–9. doi:10.1155/2022/6048088. [Google Scholar] [CrossRef]
11. Devi DS, Sujithra M, Velvadivu P, Kavya VV, Jhunandhini S. Predictive stress management for working women in educational institutions using federated learning and wearable technology. In: 2024 8th International Conference on I-SMAC (IoT in Social, Mobile, Analytics and Cloud) (I-SMAC); 2024 Oct 3; IEEE. p. 1554–9. doi:10.1109/I-SMAC61858.2024.10714822. [Google Scholar] [CrossRef]
12. Taskasaplidis G, Fotiadis DA, Bamidis P. Review of stress detection methods using wearable sensors. IEEE Access. 2024 Mar 4;12(136):38219–46. doi:10.1109/ACCESS.2024.3373010. [Google Scholar] [CrossRef]
13. Kuttala R, Subramanian R, Oruganti VR. Multimodal hierarchical CNN feature fusion for stress detection. IEEE Access. 2023 Jan 16;11:6867–78. doi:10.1109/ACCESS.2023.3237545. [Google Scholar] [CrossRef]
14. Zou C, Deng Z, He B, Yan M, Wu J, Zhu Z. Emotion classification with multi-modal physiological signals using multi-attention-based neural network. Cogn Comput Syst. 2024;6:1–11. [Google Scholar]
15. Upadhya J, Poudel K, Ranganathan J. A comprehensive approach to early detection of workplace stress with multi-modal analysis and explainable AI. In: Proceedings of the 2024 Computers and People Research Conference; 2024 May 29. p. 1–9. doi:10.1145/3632634.3655878. [Google Scholar]
16. Bodaghi Morteza, Hosseini Majid, Gottumukkala Raju. A multimodal intermediate fusion network with manifold learning for stress detection. In: 2024 IEEE 3rd International Conference on Computing and Machine Intelligence (ICMI); 2024; IEEE. p. 1–8. doi:10.1109/ICMI60790.2024.10586177. [Google Scholar] [CrossRef]
17. Xu J, Xiao T, Lv P, Chen Z, Cai C, Zhang Y, et al. Tracing human stress from physiological signals using UWB Radar. IEEE Internet Things J. 2024 Jun 5;11(20):32773–90. doi:10.1109/JIOT.2024.3410033. [Google Scholar] [CrossRef]
18. Mane SA, Shinde A. StressNet: hybrid model of LSTM and CNN for stress detection from electroencephalogram signal (EEG). Results Control Optim. 2023 Jun 1;11:100231. doi:10.1016/j.rico.2023.100231. [Google Scholar] [CrossRef]
19. Bahameish M, Stockman T, Requena Carrión J. Strategies for reliable stress recognition: a machine learning approach using heart rate variability features. Sensors. 2024 May 18;24(10):3210. doi:10.3390/s24103210. [Google Scholar] [PubMed] [CrossRef]
20. Gedam S, Paul S. Machine-learning-enabled stress detection in Indian housewives using wearable physiological sensors. In: AI-driven IoT systems for Industry 4.0. CRC Press; 2024. p. 289–303 doi:10.1201/9781003432319. [Google Scholar] [CrossRef]
21. Ziaratnia S, Laohakangvalvit T, Sugaya M, Sripian P. Multimodal deep learning for remote stress estimation using CCT-LSTM. In: Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision; 2024. p. 8336–44. doi:10.1109/WACV57701.2024.00815. [Google Scholar] [CrossRef]
22. Amin M, Ullah K, Asif M, Shah H, Waheed A, Din I. Fuzzy performance estimation of real-world driver’s stress recognition models based on physiological signals and deep learning approach. J Ambient Intell Humaniz Comput. 2024 Aug 3;1–6. doi:10.1007/s12652-024-04834-7. [Google Scholar] [CrossRef]
23. Almadhor A, Sampedro GA, Abisado M, Abbas S, Kim YJ, Khan MA, et al. Wrist-based electrodermal activity monitoring for stress detection using federated learning. Sensors. 2023 Apr 14; 23(8):3984. doi:10.3390/s23083984. [Google Scholar] [PubMed] [CrossRef]
24. Wang Z, Yang Z, Azimi I, Rahmani AM. Differential private federated transfer learning for mental health monitoring in everyday settings: a case study on stress detection. arXiv:2402.10862. 2024 Feb 16. [Google Scholar]
25. Gupta A, Maurya MK, Dhere K, Chaurasiya VK. Privacy-preserving hybrid federated learning framework for mental healthcare applications: clustered and quantum approaches. IEEE Access. 2024 Sep 19;12:145054–68. doi:10.1109/ACCESS.2024.3464240. [Google Scholar] [CrossRef]
26. Alahmadi A, Khan HA, Shafiq G, Ahmed J, Ali B, Javed MA, et al. A privacy-preserved IoMT-based mental stress detection framework with federated learning. J Supercomput. 2024 May;80(8):10255–74. doi:10.1007/s11227-023-05847-3. [Google Scholar] [CrossRef]
27. Gahlan N, Sethia D. Federated learning inspired privacy sensitive emotion recognition based on multi-modal physiological sensors. Cluster Comput. 2024 Jun;27(3):3179–201. doi:10.1007/s10586-023-04133-4. [Google Scholar] [CrossRef]
28. AlShemmary EN, Hilal BK, Abdulbaqi AS, Ahmed MA, Lu Z. EEG eye blink artifacts removal with wavelet denoising and bandpass filtering. Baghdad Sci J. 2024;11:3617–31. [Google Scholar]
29. Eid AM, Soudan B, Nassif AB, Injadat M. Comparative study of ML models for IIoT intrusion detection: impact of data preprocessing and balancing. Neural Comput Appl. 2024 May;36(13):6955–72. doi:10.1007/s00521-024-09439-x. [Google Scholar] [CrossRef]
30. Bilal M, Ali G, Iqbal MW, Anwar M, Malik MSA, Kadir RA. Auto-prep: efficient and automated data preprocessing pipeline. IEEE Access. 2022;10(1):107764–84. doi:10.1109/ACCESS.2022.3198662. [Google Scholar] [CrossRef]
31. Ahsan MM, Raman S, Siddique Z. Invariant scattering transform for medical imaging. In: Data driven approaches on medical imaging. Cham: Springer Nature Switzerland; 2023 Oct 17. p. 127–57 [Google Scholar]
32. Napa KK, Kumar AK, Murugan S, Mahammad K, Assegie TA. Early prediction of chronic heart disease with recursive feature elimination and supervised learning techniques. Int J Artif Intell ISSN. 2024;2252(8938):8938. [Google Scholar]
33. Amin M, Ullah K, Asif M, Waheed A, Haq SU, Zareei M, et al. ECG-based driver’s stress detection using deep transfer learning and fuzzy logic approaches. IEEE Access. 2022 Mar 10;10(12):29788–809. doi:10.1109/ACCESS.2022.3158658. [Google Scholar] [CrossRef]
34. Jafari A, Fox G, Rundle JB, Donnellan A, Ludwig LG. Time series foundation models and deep learning architectures for earthquake temporal and spatial nowcasting. GeoHazards. 2024 Nov 21;5(4):1247–74. doi:10.3390/geohazards5040059. [Google Scholar] [CrossRef]
35. Qi P, Chiaro D, Guzzo A, Ianni M, Fortino G, Piccialli F. Model aggregation techniques in federated learning: a comprehensive survey. Future Gener Comput Syst. 2024 Jan 1;150(6245):272–93. doi:10.1016/j.future.2023.09.008. [Google Scholar] [CrossRef]
Cite This Article
Copyright © 2025 The Author(s). Published by Tech Science Press.This work is licensed under a Creative Commons Attribution 4.0 International License , which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.


Submit a Paper
Propose a Special lssue
View Full Text
Download PDF
Downloads
Citation Tools