Skip to main content

Insomnia Data Analysis and Automation Project

In this project, I developed a fully automated system to extract and analyze sleep data from images, with a focus on insomnia research. The project involved processing images from sleep tracking applications, such as Samsung Health, and converting the data into structured formats for further analysis.

Visit github
  • Extracting Sleep Period
  • Cropping Graph
  • Grayscaling
  • Creating CSV
  • Visualization
The Slice web application showing a selected user annotation.

Extracting Sleep Period

This is example of source data image, as you can see here given: Sleep period, overall time of sleep, 4 Sleeps stages and graph. Here I used "Tesseract" to extract sleep period and added it to image file name, to use it further.

Multiple user annotations on a shared layer.

Cropping Graph

After extracting sleep period time and adding it on file name, I dont need other text information, so I cropped graph.

The new My Slides tab in slice, showing annotated and favorited slides.

Grayscaling

Here I converted RGB image into Grayscale, and changed each image width to equal sleep minute(in first step I added sleep time into file name).

Students at the University of New South Wales using the new collaborative annotation features

Creating CSV

This is How final CSV file looks like. It has 3 column and rows count is equal to sleep period of each image. If sleep period 7hr (7x60=420), row count will be 420 also.

Students at the University of New South Wales using the new collaborative annotation features

Visualization

This is last visualization. I tried show accuracy between source file and CSV. graph on below made from CSV information. Accuracy result is quite high.

Students at the University of New South Wales using the new collaborative annotation features