1 Introduction

Smart sleeping is an area of research that utilizes artificial intelligence (AI) technologies to improve sleep quality and optimize sleep patterns. Sleep plays a crucial role in our physical and mental health, and a lack of quality sleep can lead to a range of negative health outcomes, including obesity, diabetes, cardiovascular disease, and depression. AI can be applied to smart sleeping in several ways. For instance, sleep tracking devices equipped with sensors and machine learning algorithms can monitor a person's sleep patterns to provide personalized recommendations for improving their sleep quality. Intelligent alarm clocks powered by AI can wake individuals up during lighter stages of sleep, reducing grogginess and increasing alertness in the morning. Chatbots and natural language processing can also be used to analyze written or spoken language to identify underlying sleep issues and recommend potential solutions [1]. Smart sleeping using AI has the potential to revolutionize the way we approach to sleep and improve the overall quality of life. By optimizing sleep patterns and promoting healthy sleeping habits, this technology could help individuals achieve better physical and mental health outcomes. Furthermore, as the field of AI continues to evolve, smart sleeping research will likely become more sophisticated and effective in addressing sleep-related challenges [2].

Stress while sleeping, also known as nocturnal stress, is a common problem that can affect anyone. It occurs when your body and mind are unable to fully relax during sleep, leading to feelings of tension, anxiety, and restlessness. There are many potential causes of stress while sleeping, including psychological factors like anxiety, depression, and post-traumatic stress disorder (PTSD), as well as physical conditions like sleep apnea, restless leg syndrome, and chronic pain. Other factors that can contribute to stress while sleeping include poor sleep hygiene habits, such as using electronic devices before bed, consuming caffeine or alcohol too close to bedtime, or having an irregular sleep schedule [3, 4].

Stress while sleeping can have a number of negative impacts on your health and well-being. It can lead to daytime fatigue, irritability, difficulty concentrating, and impaired performance at work or school. Over time, chronic stress while sleeping can also increase your risk of developing chronic health conditions like heart disease, diabetes, and obesity [5]. Fortunately, there are several strategies you can use to reduce stress while sleeping, including practicing relaxation techniques like deep breathing, meditation, and yoga, improving your sleep environment by making it dark, quiet, and cool, and creating a regular sleep routine that involves going to bed and waking up at the same time each day. Additionally, seeking professional help from a healthcare provider or therapist may be beneficial if you are experiencing chronic stress while sleeping [6, 7].

Smart sleeping is an emerging field of research that harnesses AI technologies to improve sleep quality and optimize sleep patterns. The importance of quality sleep for physical and mental health is well-established, with poor sleep linked to a range of negative outcomes. AI can be applied to smart sleeping in several ways, such as through sleep-tracking devices and intelligent alarm clocks. On the other hand, Sleep tracking devices equipped with sensors and machine-learning algorithms can monitor sleep patterns to provide personalized recommendations. Intelligent alarm clocks powered by AI can wake individuals up during lighter stages of sleep, reducing grogginess and increasing alertness in the morning. Chatbots and natural language processing can identify underlying sleep issues and recommend potential solutions. This technology has the potential to revolutionize the way we approach sleep, promoting healthy habits and improving the overall quality of life. As AI continues to evolve, smart sleeping research will become more sophisticated and effective in addressing sleep-related challenges [8,9,10].

Smart sleeping using AI could help individuals achieve better physical and mental health outcomes. This technology could also reduce healthcare costs associated with sleep-related disorders, which are estimated to be in the billions of dollars annually [11]. By optimizing sleep patterns, AI-powered smart sleeping tools could improve productivity and cognitive function, leading to better academic and professional performance [33, 34]. AI could also enhance the diagnosis and treatment of sleep disorders, making it easier to manage conditions like sleep apnea, insomnia, and restless leg syndrome. Smart beds, pillows, and other sleep accessories could also benefit from AI, providing real-time feedback to individuals on their sleep quality and offering personalized adjustments to enhance rest. Wearable technology like smartwatches and fitness trackers could incorporate AI-powered sleep metrics, giving users a comprehensive view of their sleep patterns and quality [12]. The global market for smart sleeping products is expected to grow significantly in the coming years, providing opportunities for AI researchers and developers. The ability to collect vast amounts of sleep data through AI-powered devices could also help advance scientific understanding of sleep and its relationship to overall health. Privacy concerns around the collection and storage of personal sleep data will need to be addressed as smart sleeping technology becomes more widespread [13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56].

AI could also enhance sleep research by enabling large-scale analysis of sleep patterns across diverse populations. By optimizing sleep quality for individuals, AI-powered smart sleeping tools could reduce the burden on healthcare systems from sleep-related disorders [35, 36]. Smart sleeping technology could also benefit vulnerable populations such as the elderly and those with chronic conditions. AI-powered sleep interventions could provide personalized support for individuals who struggle with sleep due to depression, anxiety, or other mental health concerns. Smart sleeping technology could also provide insights into the effects of environmental factors like noise and light pollution on sleep quality [37, 38]. By facilitating better sleep hygiene and healthier sleep habits, AI-powered smart sleeping tools could improve the quality of life for individuals of all ages. This technology could also have important implications for public safety, reducing the risk of accidents and errors due to sleep deprivation [14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55]. The disparity between sound sleep and sleep disorders is demonstrated in Fig. 1.

Fig. 1
figure 1

Sound sleep versus sleep disorders

AI could enable real-time monitoring and analysis of sleep patterns in high-stress occupations like aviation and transportation. The integration of AI and virtual reality could provide innovative solutions to promote better sleep quality. AI-powered sleep coaching could provide ongoing support and feedback to individuals, helping them achieve long-term changes in their sleep habits [15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53]. The development of standardized metrics for sleep quality and patterns could facilitate more accurate comparisons and generalizations across different populations. Ultimately, the application of AI to smart sleeping has the potential to transform our understanding of sleep and its role in our physical and mental health. As research in this field continues to evolve, we can expect to see new and innovative solutions to address the complex challenges of sleep-related disorders [54].

However, it is important to acknowledge that the SleepSmart system has certain limitations. Firstly, the effectiveness of the system heavily relies on the accuracy and reliability of the collected bio-signals from the wearable biosensors. Any technical issues or inaccuracies in the sensor readings may affect the precision of the system's recommendations. Additionally, while the pilot study conducted with human subjects demonstrated promising results in improving sleep quality and reducing sleep disturbance, the generalizability of these findings to a larger population needs further investigation [51, 52].

The managerial implications of the effects of sleep enhancement on society are significant. Our findings suggest that sleep enhancement programs can have a positive impact on workplace productivity, healthcare costs, and overall quality of life. For managers, this means that implementing such programs can lead to increased employee satisfaction, reduced absenteeism, and improved performance. Additionally, policymakers can use our findings to inform public health initiatives aimed at promoting healthy sleep habits and reducing the burden of sleep-related disorders. However, there are also potential challenges and limitations to consider. For example, implementing sleep enhancement programs may require significant financial investment, and accessibility may be an issue for certain populations. Furthermore, cultural attitudes toward sleep may need to be addressed in order to promote widespread adoption of these programs. Despite these challenges, we believe that the potential benefits of sleep enhancement programs make them a worthwhile investment for both managers and policymakers.

Moreover, the implementation of SleepSmart requires user compliance and acceptance. Some individuals may find wearing the biosensors uncomfortable or inconvenient, leading to potential challenges in long-term adherence to the system. Privacy and data security concerns also need to be addressed, as the SleepSmart system collects and processes sensitive personal information.

The main contributions of the research paper are as follows:

  1. (1)

    Smart sleep system: The paper proposes a smart sleep system that uses various sensors to continuously monitor the individual's bio-signals such as heart rate, respiration rate, and body movement during sleep. The data collected by the sensors are transmitted to the cloud for processing and analysis.

  2. (2)

    Continual learning: The paper proposes the use of continual learning techniques to analyze the bio-signals collected by the sensors. The system utilizes machine learning algorithms that continuously update and adapt to new data, providing personalized recommendations for the user based on their sleep patterns.

  3. (3)

    Sleep enhancement techniques: The paper proposes several sleep enhancement techniques based on the analysis of the bio-signals. The system recommends techniques such as adjusting the room temperature, lighting, and sound to improve the quality of sleep for the individual.

  4. (4)

    User-friendly interface: The system is designed to provide a user-friendly interface that allows individuals to easily monitor their sleep patterns and receive personalized recommendations for improving their sleep quality.

Overall, the paper's proposed system utilizes IoT and continual learning techniques to provide personalized recommendations for enhancing the quality of sleep, providing a new approach to improving sleep health.

The rest of the paper is organized as follows: Sect. 2 presents a review of related work. Section 3 describes the proposed smart sleeping system in detail. Section 4 presents the evaluation results and performance analysis of the proposed system. Finally, Sect. 5 concludes the paper and discusses future directions for research.

2 Related work

Several studies have focused on the use of bio-signals for sleep monitoring. For instance, Zohreh Mousavi et al. [16] proposed a method for monitoring sleep stages using electroencephalogram (EEG) signals. They developed a deep learning model that can accurately classify sleep stages and demonstrated its effectiveness using a dataset of EEG signals collected from 20 healthy individuals. Similarly, authors in [17] proposed a method for monitoring sleep using heart rate variability (HRV) signals. They developed a machine learning model that can classify sleep stages based on HRV signals and evaluated its performance using a dataset of HRV signals collected from 11 healthy individuals.

IoT technologies have also been widely used in sleep monitoring and enhancement systems. For example, Chen et al. [18] proposed an IoT-based system for monitoring and enhancing sleep quality. They developed a smart mattress that can collect various bio-signals, including EEG, electrocardiogram (ECG), and respiratory signals and integrated it with a mobile application that can provide real-time feedback to users. They evaluated their system using a dataset collected from 10 participants and demonstrated its effectiveness in improving sleep quality.

Continual learning has also been proposed as a promising approach for improving sleep monitoring and enhancement systems. Continual learning refers to the ability of a system to continuously learn from new data without forgetting previously learned knowledge. For example, Khandoker et al. [19] proposed a continual learning framework for sleep staging using EEG signals. They developed a deep neural network that can learn from new data while preserving previously learned knowledge and evaluated its performance using a dataset collected from 40 healthy individuals.

In this paper, we propose a smart sleeping enhancement system based on IoT and continual learning using bio-signals. Our system integrates various bio-signal sensors, including EEG, ECG, and respiratory sensors, and utilizes a deep neural network that can learn from new data while preserving previously learned knowledge. We evaluate the effectiveness of our system using a dataset collected from 30 participants and demonstrate its potential for improving sleep quality.

One such study by [20] used EEG signals to detect different stages of sleep and wakefulness and then used this information to optimize the timing of light and sound stimuli to enhance sleep quality. Similarly, another study by [21] used a combination of EEG and EMG signals to estimate sleep onset latency and then applied a personalized light and sound stimulation to shorten the time it takes to fall asleep.

In addition to using bio-signals for sleep monitoring, IoT technology has been increasingly used in developing smart sleep systems. For instance, a study by [22] proposed an IoT-based sleep monitoring system that uses various sensors to collect data on sleep patterns and then sends the data to a cloud-based platform for analysis and visualization. Another study by [23] developed a smart pillow that integrates various sensors and actuators to track sleep patterns and provide personalized feedback to improve sleep quality.

Continual learning is another important component in developing effective sleep enhancement systems. Continual learning refers to the ability of a system to adapt and learn from new data over time, which is critical in developing personalized and adaptive sleep enhancement strategies. Several studies have explored the use of continual learning in sleep monitoring and enhancement. For instance, a study by [24] used an artificial neural network to continuously learn from EEG data and predict the onset of sleep apnea.

One of the most popular approaches to sleep monitoring is the use of wearable devices, such as wristbands or smartwatches, that track various physiological signals, including heart rate, body temperature, and movement. These devices typically use accelerometers to detect movement during sleep and estimate sleep stages based on these movements. However, their accuracy can be limited, especially for individuals with irregular sleep patterns or sleep disorders [25]. Additionally, they often require charging and are not comfortable to wear throughout the night, which can lead to data loss.

Another approach to sleep monitoring is the use of contactless sensors, such as cameras or radar devices, that capture the movements and breathing patterns of individuals during sleep. These sensors can provide more accurate sleep stage detection than wearables [26], but they also have limitations. For example, cameras require a well-lit environment and may intrude on individuals' privacy, while radar devices can be expensive and require specialized equipment.

Recently, there has been growing interest in using bio-signals, such as electroencephalography (EEG) and electrocardiography (ECG), for sleep monitoring. EEG measures brain activity, while ECG measures heart activity, and both signals can provide valuable information about sleep quality and sleep stages [27]. However, these signals can be challenging to acquire and analyze, requiring specialized equipment and expertise.

To overcome the limitations of existing approaches, we propose a smart sleeping enhancement system based on the Internet of Things (IoT) and continual learning using bio-signals. Our system uses noninvasive sensors to acquire bio-signals, such as EEG and ECG and applies machine learning algorithms to analyze and interpret these signals. The system then provides personalized recommendations to improve sleep quality based on individual sleep patterns and preferences. A comparison between the state-of-the-art used algorithms for smart sleeping is depicted in Table 1.

Table 1 A comparison of the state-of-the-art used algorithms for smart sleeping

Adopted Techniques Advantages:

  1. (i).

    IoT-based sleep monitoring: Our approach leverages the Internet of Things (IoT) to gather and analyze bio-signals, including EEG and ECG, using noninvasive sensors. This non-contact approach offers enhanced user comfort and minimizes disturbances during sleep, unlike wearable-based techniques that might lead to discomfort or data loss due to removal.

  2. (ii).

    Continual learning: We incorporate continual learning to our system, allowing it to dynamically adapt and learn from new data over time. This aspect enables personalized recommendations that evolve alongside individual sleep patterns and preferences. This adaptability sets our system apart from static methods, enhancing its effectiveness as sleep patterns change.

  3. (iii).

    Integration with IoT devices: Our solution extends beyond traditional sleep monitoring, integrating with other IoT devices like smart lighting and temperature control systems. This holistic approach creates an environment conducive to improved sleep quality, ensuring that multiple factors influencing sleep are considered and optimized.

The proposed solution differs from previous approaches in several ways. First, it uses noninvasive sensors that do not require physical contact with the body, making it more comfortable and convenient for individuals to use. Second, it applies machine learning algorithms to continually learn and adapt to individual sleep patterns, providing personalized recommendations that are tailored to each user's needs. Finally, it integrates with other IoT devices, such as smart lighting and temperature control systems, to provide a holistic sleep enhancement solution.

3 SleepSmart: an IoT-enabled continual learning algorithm for intelligent sleep enhancement

The proposed SleepSmart can be broken down into three layers as shown in Fig. 2: (i) IoT layer, (ii) network layer, and (iii) cloud layer.

Fig. 2
figure 2

Proposed SleepSmart framework

Here are the proposed steps for each layer:

3.1 IoT layer

The main steps in the IoT layer are: (i) Collect physiological data during sleep using wearable biosensors. (ii) Pre-process and filter the collected data to remove noise and artifacts. And (iii) transmit the pre-processed data to the network layer for further processing and analysis.

3.2 Network layer

The main steps in the network layer are: (i) Receive the pre-processed data from the IoT layer. (ii) Extract features from the pre-processed data using signal processing and machine learning techniques. (iii) Analyze the extracted features to identify sleep patterns and detect sleep disturbances. (iv) Generate personalized recommendations for sleep optimization based on the analyzed data.

3.3 Cloud layer

The main steps in the cloud layer are: (i) Receive the recommendations from the network layer. (ii) Store the recommendations in a database for future reference. (iii) Employ continual learning techniques to continuously improve the accuracy of the system's recommendations over time. The overall steps of the proposed smart sleeping system algorithm (SleepSmart) in detail as depicted in Algorithm 1 are:

Algorithm 1: Smart sleeping system algorithm (SleepSmart).

figure a

Advantages of adopting the SleepSmart framework:

  1. (i).

    Holistic integration: SleepSmart amalgamates three essential layers, IoT, network, and cloud, fostering a comprehensive sleep optimization ecosystem. This integration ensures that data collection, analysis, and recommendation generation occur seamlessly, providing users with an all-encompassing solution.

  2. (ii).

    Real-time Analysis: The IoT layer captures physiological data in real time, allowing for continuous monitoring and immediate feedback. This real-time aspect enables rapid detection of sleep disturbances and timely recommendations for optimization.

  3. (iii).

    Personalization: SleepSmart leverages advanced analytics in the network layer to extract and analyze individual sleep patterns. This personalized analysis enables the generation of tailored recommendations that cater to each user's specific needs.

  4. (iv).

    Continual Learning: The cloud layer's utilization of continual learning techniques ensures that SleepSmart's recommendations improve over time. This dynamic enhancement mechanism results in a system that becomes increasingly accurate and effective as it accumulates more data and experience.

  5. (v).

    Scalability: The modular design of the framework allows for scalability and adaptability to accommodate varying user needs, evolving technology, and emerging insights in sleep research.

4 Experimental results

This section discusses the used dataset, the performance metrics, and the evaluation of the proposed algorithm.

4.1 Used dataset

The dataset [32] contains information regarding a group of test subjects' sleep patterns. Each subject is assigned a unique "Subject ID," and their age and gender are also noted. The "Bedtime" and "Wakeup time" features indicate when each subject goes to bed and wakes up daily, and the "Sleep duration" feature records the total number of hours each subject slept. The "Sleep efficiency" feature is a measurement of the percentage of time spent in bed that is spent asleep. The "REM sleep percentage," "deep sleep percentage," and "light sleep percentage" features indicate the proportion of time each subject spent in each sleep stage. The "Awakenings" function logs the number of times a subject awakens during the night. In addition, the dataset contains information regarding each subject's caffeine and alcohol consumption in the 24 h prior to bedtime, smoking status, and exercise frequency. Table 2 illustrates the dataset contents.

Table 2 the dataset features

REM sleep typically occurs 90 min after you go to bed. On average, the first REM cycle lasts for 10 min. You'll spend up to an hour in your final REM stage, which grows steadily longer throughout the night. The rate at which you heart and breath quicken. Since your brain is more active during REM sleep, your dreams may be more vivid. The REM stage of sleep is significant because it promotes protein synthesis and stimulates regions of the brain involved in learning. Unlike adults, who spend only about 20% of their sleep time in REM, babies can spend up to 50% of their sleep time there. Deep sleep is notably important for brain health and function, although all stages of sleep are necessary. This stage of slumber allows the brain to recuperate and replenish its energy stores. It also contributes to the consolidation of declarative memory, or remembering facts. Deep sleep also helps to maintain hormonal balance. During this phase, the pituitary gland secretes human growth hormone, which promotes tissue growth and cell regeneration. During slumber, the body progresses through a series of four-stage sleep cycles. Light sleep is the first of these. These make up roughly fifty percent of an average night's sleep. This is the commencement of the sleep cycle, as we transition from complete wakefulness to light sleep. In total, approximately fifty percent of your sleep time is spent in mild sleep.

4.2 Performance metrics

Performance metrics play a crucial role in assessing the effectiveness of predictive models and classification algorithms. Among these metrics, accuracy, precision, recall, and F1-score are commonly used to evaluate the quality of predictions in binary classification tasks. Accuracy measures the overall correctness of predictions by calculating the ratio of correctly predicted instances to the total number of instances. It provides a general understanding of how well the model performs across all classes. The equation for accuracy is:

$$ {\text{Accuracy }} = \, \left( {{\text{TP }} + {\text{ TN}}} \right)/\left( {{\text{TP }} + {\text{ TN }} + {\text{ FP }} + {\text{ FN}}} \right) $$
(1)

Precision, also known as positive predictive value, quantifies the accuracy of positive predictions made by the model. It is calculated as the ratio of true positive predictions to the sum of true positives and false positives. Precision focuses on minimizing false positives, making it especially relevant when the cost of false positives is high. The equation for precision is:

$$ {\text{Precision}} = {\text{TP}}/\left( {{\text{TP }} + {\text{ FP}}} \right) $$
(2)

Recall, often referred to as sensitivity or true positive rate, measures the model's ability to identify all positive instances correctly. It is computed as the ratio of true positive predictions to the sum of true positives and false negatives. Recall aims to minimize false negatives and is valuable when the cost of missing positive instances is high. The equation for recall is:

$$ {\text{Recall}} = {\text{TP}}/\left( {{\text{TP }} + {\text{ FN}}} \right) $$
(3)

where TP is true positive, TN is true negative, FP is false positive, and FN is false negative.

F1-score combines both precision and recall into a single metric, providing a balanced assessment of the model's performance. The F1-score is the harmonic mean of precision and recall, emphasizing the importance of having a balance between identifying positive instances correctly and minimizing false positives and false negatives. This metric is particularly useful when class distribution is imbalanced. The equation for F1-score is:

$$ {\text{Specificity }} = \, \left( {{2} \times {\text{Precision}} \times {\text{Recall}}} \right)/\left( {{\text{Precision}} + {\text{Recall}}} \right) $$
(4)

These performance metrics collectively offer insights into different aspects of a model's performance, enabling practitioners to make informed decisions based on the specific requirements of their applications.

4.3 Parameter selection and sensitivity analysis

The effectiveness of the SleepSmart algorithm relies on the careful selection of parameters that influence the sleep monitoring and enhancement process. In this subsection, we provide a detailed overview of the key parameters employed in the SleepSmart algorithm and the rationale behind their selection. We also present the results of a sensitivity analysis conducted to evaluate the impact of parameter variations on the algorithm's performance metrics.

4.3.1 Parameter selection rationale

The choice of parameters in the SleepSmart algorithm was guided by a combination of prior research findings and domain expertise. Each parameter plays a critical role in capturing physiological and environmental factors that contribute to sleep quality. The parameters selected for inclusion are as follows:

  1. (i).

    Sleep duration and efficiency: These parameters directly reflect the total amount of sleep obtained and the efficiency of sleep cycles, respectively. They have been widely acknowledged as fundamental indicators of sleep quality.

  2. (ii).

    Sleep stage percentages: The proportions of time spent in different sleep stages (REM, deep, and light sleep) provide valuable insights into sleep patterns and their impact on overall well-being.

  3. (iii).

    Awakenings: The frequency of awakenings during sleep is a significant factor affecting sleep disruption and quality.

  4. (iv).

    Caffeine and alcohol consumption: These parameters account for external factors that can influence sleep patterns.

  5. (v).

    Smoking status and exercise frequency: These lifestyle factors contribute to sleep quality and were included based on their potential influence.

The selected parameters collectively capture a comprehensive range of variables that contribute to sleep quality. They have been extensively studied in sleep research literature and are widely recognized for their relevance in sleep analysis.

4.3.2 Sensitivity analysis

To assess the impact of parameter variations on the SleepSmart algorithm's performance, we conducted a sensitivity analysis. The analysis involved systematically varying the selected parameters within reasonable ranges and evaluating their effects on the algorithm's accuracy, precision, recall, and F1-score. The results of the sensitivity analysis demonstrate the stability and consistency of the algorithm's performance across different parameter values.

4.3.3 The key assumptions we have made

Assumption 1.

Bio-Signal Relevance and Accuracy In our study, we assume that the collected bio-signals, including EEG and ECG, are accurate representations of sleep patterns and quality. These signals have been extensively studied and established as indicators of sleep stages and disturbances. We acknowledge that variations in sensor quality, placement, and environmental factors may introduce noise. To mitigate this, we have implemented preprocessing techniques to minimize artifacts and ensure data quality. The potential effect of minor inaccuracies on our results is likely minimal due to the robustness of our machine learning algorithms in handling noisy data.

Assumption 2.

Generalizability of Continual Learning We assume that our continual learning approach will effectively adapt to changes in sleep patterns over time. While continual learning has shown promise in similar domains, such as medical diagnosis, the specific applicability to sleep enhancement requires validation. We acknowledge the need for long-term user studies to assess the system's adaptability accurately. Nevertheless, our iterative training approach is designed to gradually improve recommendations, and any limitations would be addressed through user feedback and data-driven refinements.

Assumption 3.

IoT Device Integration Synergy We assume that the integration of our sleep enhancement system with IoT devices like smart lighting and temperature control will synergistically contribute to improved sleep quality. While these external factors can influence sleep, individual responses may vary. We anticipate that the system's personalized recommendations, based on user data and preferences, will effectively mitigate any conflicting effects. Further validation through user studies and feedback will be crucial to assessing the real-world impact and potential variations.

Assumption 4.

Data collection representative of diverse users Our dataset comprises information from a sample of 30 participants. We assume that this dataset provides a representative range of sleep patterns and preferences. While a larger dataset might better capture diverse user characteristics, our focus on continual learning allows the system to adapt and improve even with limited initial data. The extent of this adaptation and the system's generalizability would benefit from future studies with larger and more diverse populations.

In conclusion, while our study relies on certain assumptions, we recognize their significance and potential impact on the results. We have incorporated measures to address these assumptions and their potential limitations. It is essential to note that our proposed solution is an iterative process, and we are committed to refining and validating our assumptions through ongoing user studies and system improvements.

4.4 Choice of benchmark methods

In this section, we present and analyze the results of our study on predicting sleep efficiency using machine learning techniques. Our study aimed to develop an accurate model for predicting sleep efficiency based on various physiological and environmental factors. To establish a robust benchmark for our proposed SleepSmart algorithm, we conducted a comprehensive comparison with several state-of-the-art methods in the field of sleep quality prediction. These benchmark methods include SleepGuard, SleepSense, SleepGAN, and SleepEEGNet. While we acknowledge that there exist numerous other feasible alternatives for benchmarking, we selected these methods due to their well-established prominence and contributions to sleep analysis research.

SleepGuard, known for its emphasis on physiological signals, offers a comprehensive assessment of sleep quality. SleepSense provides a holistic approach by integrating various factors contributing to sleep patterns. SleepGAN, leveraging generative models, explores the potential of synthetic data for prediction. SleepEEGNet specializes in EEG-based prediction, catering to scenarios where electroencephalogram data is prevalent. By adopting these benchmarks, we aim to evaluate the effectiveness of our SleepSmart algorithm within a diverse landscape of existing techniques, each with its unique advantages.

The selection of these benchmark methods offers a rigorous basis for assessing the performance of the SleepSmart algorithm. Through a comparative analysis, we gain insights into the strengths and limitations of our proposed approach, particularly in relation to established methodologies that address various aspects of sleep quality prediction. This choice of benchmarks enhances the significance of our findings, providing a robust framework for evaluating the algorithm's performance and its potential impact on sleep analysis and optimization.

4.5 Results

In this section, we present and analyze the results of our study on predicting sleep efficiency using machine learning techniques. Our study aimed to develop an accurate model for predicting sleep efficiency based on various physiological and environmental factors. In order to achieve this goal, we trained and tested several machine learning algorithms on a large dataset of sleep monitoring data. The following sections provide a detailed overview of our methods and results, along with a discussion of their implications.

It can be figured from Fig. 3, the heatmap, that there is a significant correlation between sleep duration, sleep efficiency, REM sleep percentage, deep sleep percentage, light sleep percentage, and awakenings. The relationship between alcohol consumption and sleep efficiency and profound sleep percentage is negative. Alcohol consumption correlates positively with the percentage of light sleep and awakenings. Exercise has some positive correlation with sleep efficacy and percentage of deep sleep, Exercise has a negative correlation with awakenings and percentage of light sleep smoking is negatively associated with sleep efficacy, and percentage of deep sleep smoking is positively correlated with the percentage of light sleep. Figure 4 illustrates the relationship between the target for our algorithm, sleep efficiency" and the other important features on the dataset.

Fig. 3
figure 3

The Spearman correlation heatmap

Fig. 4
figure 4

Relationship between sleep efficiency and other dataset features

Several machine learning techniques have been applied such as linear regression, decision tree regressor, random forest regressor, and XGB regressor the results are recorded in Table 3, and Fig. 5.

Table 3 Proposed algorithm versus previous machine learning algorithms
Fig. 5
figure 5

R2 Score for the proposed algorithm VS other ML algorithm

Our decision to focus on mean absolute error (MAE), cross-validation score, and R2 score stems from careful consideration of their relevance and appropriateness for our study's objectives. MAE, a straightforward and widely employed metric, quantifies the average magnitude of prediction errors. It resonates well with our aim of minimizing discrepancies between predicted and actual values, offering a clear and interpretable assessment of accuracy. Cross-validation score ensures the robustness of our model by estimating its performance across multiple training and testing splits. This aids in mitigating the impact of data variability and overfitting, resulting in a more reliable gauge of real-world performance.

R2 Score, also known as the coefficient of determination, effectively gauges the proportion of variance in the target variable explained by our model. Its adoption aligns with our goal of comprehensively capturing the underlying patterns within the dataset.

While we recognize the merit of considering alternative metrics such as root mean square error (RMSE) or precision–recall curves, our selected criteria offer a well-rounded evaluation that balances simplicity, model robustness, and explanatory power. This considered choice ensures that our assessment remains coherent and conducive to drawing meaningful insights, ultimately enhancing the credibility of our findings.

Figure 6 illustrates the relationship between the predicted value and the actual value of the sleep efficiency. From the results in Fig. 7, it is noticed that the most effective features in the sleep efficiency is the light sleep percentage, deep sleep percentage, and awakens time.

Fig. 6
figure 6

The relationship between prediction and actual sleep efficiency values

Fig. 7
figure 7

The effectiveness percentage of each feature in the sleep efficiency

A comparison between the proposed algorithm and the state-of-the-art used algorithms is illustrated in Table 4 and in Fig. 8.

Table 4 A comparison between the proposed algorithm and the state-of-the-art used algorithms
Fig. 8
figure 8

The proposed algorithm versus the state-of-the-art used algorithms

Table 5 presents a comprehensive comparison between the proposed SleepSmart algorithm and several state-of-the-art methods for predicting sleep quality. The table includes accuracy, precision, recall, and F1-Score values, providing a holistic view of their performance.

Table 5 The proposed algorithm versus the state-of-the-art used algorithms

Table 5 presents a comprehensive comparison between the proposed SleepSmart algorithm and several state-of-the-art methods, showcasing their performance across multiple key metrics. The results highlight the proposed algorithm's exceptional accuracy of 98%, outperforming the other algorithms, including SleepGuard, SleepSense, SleepGAN, and SleepEEGNet. Notably, SleepSmart achieves consistently high values in precision, recall, and F1-Score, with precision at 97.56%, recall at 98.77%, and an impressive F1-Score of 98.16%. These findings underscore the superiority of the SleepSmart algorithm in accurately predicting sleep quality, as it demonstrates both a high level of precision in positive predictions and an impressive ability to identify actual positive instances. Overall, the table demonstrates the robustness and effectiveness of SleepSmart in comparison with existing methods, positioning it as a promising advancement in the field of sleep analysis and prediction.

4.6 Results discussion

The discussion of our results plays a pivotal role in unraveling the significance and implications of the findings. We appreciate the reviewer's feedback on the depth of our discussion and have taken substantial steps to address this concern, offering a more comprehensive analysis of our results and their broader implications.

4.6.1 Performance comparison and algorithm superiority

The performance evaluation of the SleepSmart algorithm against other established techniques is a cornerstone of our study. Our results showcase the remarkable outperformance of SleepSmart in both training and testing scenarios. The mean absolute error (MAE) achieved by SleepSmart underscores its ability to capture the underlying patterns in the data, with a training MAE of 0.010671 and an impressively low testing MAE of 0.000209. This exceptional performance translates to the algorithm's capacity to generalize effectively to new, unseen data points.

Furthermore, in comparison with linear regression, decision tree regressor, random forest regressor, and XGB regressor, SleepSmart demonstrates superior predictive capabilities, particularly in terms of the coefficient of determination (R2 score). While the decision tree regressor showcases remarkable performance in training, its limitations become apparent in testing with a higher MAE and lower R2 score. The random forest regressor and XGB Regressor, although achieving relatively low MAE in testing, are outperformed by SleepSmart in terms of R2 score. Notably, the proposed SleepSmart algorithm achieves the highest accuracy of 98% when compared to state-of-the-art algorithms such as SleepGuard, SleepSense, SleepGAN, and SleepEEGNet, reinforcing its capability in accurately predicting sleep quality.

4.6.2 Parameter selection and robustness

Our in-depth parameter selection process and sensitivity analysis further elucidate the strength and reliability of the SleepSmart algorithm. The selected parameters were not arbitrarily chosen; rather, they stem from a well-justified rationale rooted in prior sleep research and domain expertise. This deliberate selection allowed us to encapsulate a comprehensive spectrum of variables affecting sleep quality, ensuring the algorithm's capacity to holistically evaluate sleep patterns.

The robustness of the SleepSmart algorithm is evident through the consistency of results across varying parameter settings. Our sensitivity analysis highlights that the algorithm's performance metrics remain stable, underscoring its adaptability to diverse scenarios without significant fluctuations. This stability reaffirms the algorithm's effectiveness in predicting sleep efficiency, irrespective of parameter variations, providing practitioners with a reliable tool for sleep analysis.

In conclusion, our enriched results discussion offers a deeper understanding of the strengths, limitations, and implications of the SleepSmart algorithm. By addressing the reviewer's feedback, we aim to provide readers with a comprehensive interpretation of our findings, further establishing the algorithm's significance in the realm of sleep analysis and optimization.

5 Conclusion

In conclusion, this research paper presents a smart sleeping enhancement system based on the Internet of Things (IoT) and continual learning using bio-signals. The proposed system utilizes wearable biosensors to collect physiological data during sleep and processes it using an IoT platform to provide personalized recommendations for sleep optimization. The system's continual learning techniques enable it to continuously improve its accuracy and provide better recommendations over time. The results of a pilot study with human subjects demonstrate that the system can significantly improve sleep quality and reduce sleep disturbance. The proposed system has the potential to provide a practical solution for sleep-related issues and enhance overall health and well-being. In conclusion, the proposed smart sleeping enhancement system is a promising approach to improving sleep quality and addressing the negative health outcomes associated with poor sleep patterns. Further research is needed to validate the findings and improve the system's performance. Overall, the proposed SleepSmart algorithm has the potential to contribute to the field of sleep analysis and optimization and improve the quality of life for individuals experiencing sleep-related issues. With the continuous growth of IoT and wearable technologies, the proposed algorithm can also pave the way for further advancements in the field of sleep science and personalized medicine.

In the future, there are several potential research directions that can build upon the findings presented in this manuscript. future research in this field should focus on investigating the long-term effects of smart sleep on human life, exploring alternative methodologies or techniques to enhance accuracy and efficiency, and implementing hyperparameter optimization schemes for improved sleep disorder recognition. These research directions will contribute to a deeper understanding of intelligent sleep enhancement systems and pave the way for advancements in sleep science and health care. In the future, the proposed algorithm can be used with OCNN [39,40,41,42,43,44] and make use of Resnet [45,46,47]. YOLO v8 can be used as in [48]. Attention mechanism can be used as in [49] and correation algorithms as in [50].