Inspiration
Our inspiration comes from two life experiences. First and foremost, the study-sleep-life balance is a key feature in our university life. While it's impossible to study 24/7 or procrastinate forever, finding the 'Goldilocks' way to manage our sleep is crucial. Each of us has our own efficient sleep strategy—some sleep a full 7 or 8 hours, while others opt for power naps lasting less than 2 hours. However, time alone isn't the ultimate measure of sleep quality; we are curious about the stages of sleep.
Secondly, one of us has a friend who struggled with sleeping and went to the hospital for treatment. During the treatment, multiple doctors had to stay up all night, taking turns to measure the signal and, at the same time, observe through a camera. The friend said that when the doctor finds an unusual spike, the doctors must also confirm it with their naked eyes. This story highlighted that current electricity measurements cannot fully capture a patient's status. We hope that our coding can address these issues.
What it does
Our project serves a dual purpose. Firstly, our model predicts sleep stages with an 85% accuracy, a valuable improvement for those determining the sleep stage of their patients. Achieving higher accuracy also signifies the efficiency and effectiveness of current modeling skills. In the second part, we delved into sleep "fairness" issues, questioning if good sleep quality is equally accessible to everyone. We investigated whether there's a "sleep equity" disturbance at the tract level, exploring correlations between median income levels and sleep time. This raises questions about potential connections to city planning or public policy issues.
How we built it
For data pre-processing, we applied the Fast Fourier Transform to pass a frequency domain version of the 3D NumPy array. The raw array was reduced from 6 to 2 channels (EEG channels). EEG measurements showed strong correlations with different sleep stages. We normalized and concatenated vectors across all epochs into a matrix. We used a 75% training, 25% testing split, and optimized model parameters using grid-search. Our XGBoost model achieved an 85% accurate classification on the test sample, demonstrating robustness and satisfactory generalization.
Challenges
While we aimed to build a model for sleep stage classification, we engaged in grid searches and processing data for the XGBoost model. This process demanded a deep understanding of the underlying algorithms and their interactions. During our testing and debugging stage, we need to identify whether it is a potential misclassification or a limitation. Investigating correlations between sleep patterns and socioeconomic variables at the tract level introduced challenges in data interpretation and understanding the implications of our findings. Bridging the gap between data science and societal impact required interdisciplinary insights and collaboration. With our project encompassing data science, UI/UX/GUI design, and census data analysis, the team faced the challenge of coordinating varied skill sets. In this environment, coworking demanded effective communication and understanding of other's work, leading us to be "jack of all trades."
Accomplishments that we're proud of
Our project had tasks in three main areas: data and machine learning, UI/UX/GUI, and analyzing US census data to assess sleep patterns in underrepresented communities. We are proud to have improved step-by-step 1% model prediction accuracy. Our UI/UX/GUI and census work resulted in visualizations that conveyed our thoughts effectively. We drew on our memories and previous learnings to navigate challenges. Additionally, we value the mentor-mentee connections established during our 2024 Rice Datathon Experience, where two of us had prior hackathon or datathon experience, while two had none.
What we learned
Throughout our project, we gained valuable insights and knowledge. Firstly, delving into the intricacies of sleep stages taught us the importance of nuanced approaches in data analysis. Understanding the correlations between EEG measurements and sleep patterns broadened our comprehension of sleep science. Additionally, tackling the sleep "fairness" issue allowed us to explore the intersection of data science with societal implications, raising questions about equitable access to good sleep.
Working on diverse tasks, from data processing to UI/UX/GUI design and census analysis, enhanced our collaborative skills. We learned to navigate challenges, drawing on our collective expertise and individual experiences. Moreover, the mentor-mentee connections formed during the 2024 Rice Datathon Experience provided valuable guidance and insights, contributing to our learning and growth.
What's Next
Looking ahead, we envision several avenues for further exploration. Firstly, expanding our dataset would address our challenge, allowing for more robust and comprehensive model training. This could involve collaboration with sleep clinics or institutions to obtain diverse and extensive sleep data.
Next, we could refine our model by incorporating more advanced techniques, additional data, or exploring different algorithms. Continuous optimization of parameters and feature selection could further enhance the accuracy of our sleep stage classification.
Beyond the technical aspects, our findings on sleep equity raise intriguing questions about urban planning and public policies. Future steps might involve collaborating with experts in these fields to investigate and address systemic factors contributing to disparities in sleep quality.
Overall, in terms of personal development, we aim to delve deeper into areas where we face challenges, expanding our knowledge base and refining our skills. The experience gained from this project serves as a foundation for future endeavors in both data science and DEI/societal impact.
Built With
- keras
- matplotlib
- mne
- numpy
- pandas
- pickle
- python
- scikit-learn
- scipy
- taipy
- tensorflow
- xgboost
Log in or sign up for Devpost to join the conversation.