Sleep Shift Scheduling Tool

Sleep loss and fatigue may lead to reduced performance and an increased risk to safety during many activities, including spaceflight. Your challenge is to develop an operational sleep shift scheduling tool that provides autonomous customization of a schedule for sleep, exercise, and nutrition to manage fatigue.

Sleep, exercise, nutrition scheduling tool by Team Legacy (London)

Summary

A smart, individualised, and integrated timetable planning app to aid astronaut planning out the day while continuously adjusting the timetable, sleeping, exercise, and nutrition based on individual conditions, circadian rhythm, and feedbacks automatically.

How We Addressed This Challenge

What did you develop?

We developed an django based app to help scheduling astronaut sleep and exercise shift as well as nutrition intake based on the shift.







Why is it important?

The lack of integrated and individualised solution for sleep, exercise, and nutrition planning makes it difficult to consider the influence of one on another. For instance, an astronaut with longer exercising hours may need more nutrition compare to another astronaut.







What does it do? 

The app takes all 3 factors into account to schedule a best possible timetable and guidance based on astronaut conditions.






How does it work? - Logics

Exercise planner:

The app considers exercises planning first carefully following ESA (European Space Agency) guidance for exercising in microgravity environment published in 2006.


There are 4 key variables output from the program including I. types of exercise, II. resistance training duration, III. aerobic training duration, IV. load of training with respect to maximum capacity measured pre-flight. To achieve the desired outputs, the app is split into 2 programs, 1. intensity calculator program and 2. workout suggestion program








Intensity Calculator Program:

The program returns a target workout intensity considering a. previous targeted intensity b. feedback from trainee (easiness) on previous training, and c. NASA targeted intensity.

The main logic of the program adopts PID controller with user feedback to calculate a suitable workout intensity for the astronaut in order to steadily approach appropriate workload.








workout suggestion program:

The targeted intensity is then fed into this program and suggests a suitable training (periodically, to keep astronaut interested), and returning the 4 key variables previously mentioned. The training equipment and suitable training used were selected in regards to ESA guidance.








Sleep & Schedule planner:

The app considers sleep and plan a schedule based on 1. objective data scoring program (feedback sensed from sleep biometric device, e.g. fitbit) and 2. subjective data scoring program (Pittsburgh Sleep Quality Index (PSQI) questionnaire filled by astronaut daily).







Objective data scoring program:


Objective data are collected via sleep monitoring sensors, where the data used were quantitative sleep data from NASA including the followings:

Sleep time, start and end times, date of data period, sleep onset, sleep latency, sleep efficiency, wake after sleep onset, light (white, blue, red and green) illumination, and sleep phases: light, deep, rapid eye movement, and wake.


From the sensor data, the app would calculate and return a score based on an algorithm similar to current commercial sleep monitoring wearables (e.g. OURA ring and Fitbit).








Subjective data scoring program:


Subjective data are collected from astronaut filled daily questionnaires, where the questionnaire was designed based on gold standard Pittsburgh Sleep Quality Index (PSQI). From the questionnaire, the app would understand how will did the astronaut sleep based on personal opinion.


Based on the objective and subjective scores the schedule planner app would then suggest actions to be taken. For instance, if the objective score is good (e.g. 80 out of 100), but subjectively astronaut feels tiresome (subjective score), the planar would suggest actions such as mediation (proven to be effective in improving PSQI score; Black et al., 2015). Another example would be advice to take melatonin if sleep latency was too high (may be effective, shown DIJK et al., 2001)


The program then takes the 2 scores, sleep-aiding advices, exercise information, working types and hours, meal time, and leisure time into account to schedule a timetable for the day.







Nutrition Guidance:

Lastly the app decide a nutrition guidance based on 1. the energy requirement of the scheduled activities in timetable 2. The amount (grams) of nutrition to have on the day.







Energy requirement program:

To calculate the energy requirement for the astronaut we would need to input following data:

gender, weight, age, and hours of each activity on the day. First of all, the app calculate the baseline energy requirement based on astronaut gender, weight and age, where the equation was given in Human energy requirements Report of a Joint FAO/WHO/UNU Expert Consultation, 2001 .


Next, the app correct the energy requirement based on the activities and hours of each activity through identifying the PAR (Physical activity ratio) of activities and calculate PAL (Physical activity level). The corrected energy requirement would be returned.







Amount of Nutrition program:

Inputting the corrected energy required on the day, the program finds how much nutrition to eat on each day, where nutrition include: protein, fat (saturated and unsaturated), carbohydrates, sugar, table salt (sodium chloride), and potassium weight to ingest on the day. The program priorities protein intake to fight muscle degeneration ascribe to mircogravitational environment. After deducting energy supported from protein, the remaining energy requirement is split into 5.7%, 19.9%, 71%, and 3.4% for astronaut to have saturated fat, unsaturated fat, carbohydrate, sugar respectively. Where the ratio is calculated based on WHO and FAO guidance after subtraction of energy supported from protein. The program then returns a individualised guidance to the front end of APP and display to astronaut.







What do you hope to achieve? - Goal

With the app we wish to create a smart, individualised, and integrated timetable planning system to aid astronaut planning out the day while continuously adjusting the timetable, sleeping, exercise and nutrition based on individual conditions automatically.

How We Developed This Project

What inspired your team to choose this challenge?

One of our teammate suffered from occasional insomia so we decided to take on the challenge along with finding him some advices.






What was your approach to developing this project?

We build our project based current solid evidence and gold standard as well as taking in to account the data NASA has. We divided the project into 3 sections, sleep, nutrition and exercise and assign to each of the team member, finally integrate all 3 programs to a user interactive application.






What tools, coding languages, hardware, software did you use to develop your project?

Github was used to share code files among members, coding languages used include python, javascript, and html/css. Hardware used was only laptops. Software used includes visual studio and spyder.






What problems and achievements did your team have?

This is our first Hackathon challenge and had no clue how everythings work especially when all communications were moved online. We also had a lot of time pressure, insufficient prior knowledge in all 3 sectors (sleep, nutrition and exercise), and little experiences on front-end applications.


Our greatest achievements of the project were successfully develop algorithms based scientific evidence and a working user interactive application. Also we had a lot of fun!!

How We Used Space Agency Data in This Project
  1. Exercise intensity, type, and duration is planned and calculated based on ESA published data, Petersen, N., et al., Exercise in space: the European Space Agency approach to in-flight exercise countermeasures for long-duration missions on ISS. Extreme Physiology & Medicine, 2016. 5: p. 13.
  2. Quantitative data of sleeping conditions is from NASA data source as given in url: https://2020.spaceappschallenge.org/challenges/sustain/sleep-shift-scheduling-tool/details
Data & Resources
  1. Petersen, N., et al., Exercise in space: the European Space Agency approach to in-flight exercise countermeasures for long-duration missions on ISS. Extreme Physiology & Medicine, 2016. 5: p. 13.
  2. Dorf, R.C. & Bishop, Robert H., author, 2017. Modern control systems Thirteenth edition, global.
  3. Quantitative data of sleeping conditions is from NASA data source as given in url: https://2020.spaceappschallenge.org/challenges/sustain/sleep-shift-scheduling-tool/details
  4. Dijk, D.J., et al., Sleep, performance, circadian rhythms, and light-dark cycles during two space shuttle flights. American Journal of Physiology-Regulatory Integrative and Comparative Physiology, 2001. 281(5): p. R1647-R1664.
  5. Buysse, D.J., et al., THE PITTSBURGH SLEEP QUALITY INDEX - A NEW INSTRUMENT FOR PSYCHIATRIC PRACTICE AND RESEARCH. Psychiatry Research, 1989. 28(2): p. 193-213.
  6. Black, D.S., et al., Mindfulness Meditation and Improvement in Sleep Quality and Daytime Impairment Among Older Adults With Sleep Disturbances A Randomized Clinical Trial. Jama Internal Medicine, 2015. 175(4): p. 494-501.
  7. Healthy diet fact sheet no. 394, WHO, 2018 https://www.who.int/publications/m/item/healthy-diet-factsheet394
  8. Protein and amino acid requirements in human nutrition. Report of a joint FAO/WHO/UNU expert consultation (WHO Technical Report Series 935), 2007, https://www.who.int/nutrition/publications/nutrientrequirements/WHO_TRS_935/en/
  9. Joint FAO/WHO Scientific update on carbohydrates in human nutrition. European Journal of Clinical Nutrition, Volume 61(Supplement 1), December 2007, https://www.who.int/nutrition/publications/nutrientrequirements/scientific_update_carbohydrates/en/
  10. Fats and Fatty Acids in Human in Nutrition. Joint FAO/WHO Expert Consultation November 10-24, 2008, Geneva, Switzerland https://www.who.int/nutrition/publications/nutrientrequirements/anm_fatsandfattyacids_human_nut/en/
  11. Guideline: potassium intake for adults and children, WHO, 2012, https://www.who.int/publications/i/item/9789241504829
  12. Guideline: sodium intake for adults and children, WHO, 2012, https://www.who.int/publications/i/item/9789241504836
  13. Guideline: sugars intake for adults and children, WHO 2015, https://www.who.int/publications/i/item/9789241549028
  14. Human energy requirements. Report of a Joint FAO/WHO/UNU Expert Consultation Rome, 17–24 October 2001 http://www.fao.org/3/a-y5686e.pdf
Tags
#sleep, #nutrition, #exercise, #schedule
Judging
This project was submitted for consideration during the Space Apps Judging process.