Menopause is a stage in a woman's life when her ovaries stop producing the hormones estrogen and progesterone and she stops menstruating. It is a normal part of aging and marks the end of a woman's reproductive years. Menopause typically occurs in a woman's late 40's to early 50's. There are so many symptoms that will occur during the Menopause. Sleep Disorder is an intensive symptom among them. According to the National Sleep Foundation, approximately 61% of menopausal women have sleep problems.Sleep disorders will probably occur due to the other menopausal symptoms such as hot flashes, night sweats, etc.
When you don’t get enough sleep hours, it can lead to several issues such as heart problems, weight gain, and diabetes, etc. So here we are introducing the solution Sleep Guard which works,based on AI(artificial intelligence). This is a wearable that is extremely built for women who have to suffer from sleep disorders. Let's see the demo video
How it works?This wearable runs along with the companion app. By means of AI, the wearable can track your sleep. If any sleep disorders are detected, it will search for the root cause of sleep disorder. The wearable will check the body temperature and humidity and verifies whether it is from hot flashes or night sweats. When the sleep disorder is due to the hot flashes or night sweats, the wearable can trigger the smart fan, AC or any smart cooling devices. That will operate according to your body temperature and humidity.
If sleep disorders are due to any other reasons such as anxiety or depression,the sleep-inducing songs will be played through the companion app. That will automatically push into a person to sleep.
Apart from this, your sleeping data will be instantly uploaded to the cloud via the companion app. Your sleep quality statistics will be displayed in the companion app. So the person can easily track and improve their sleep quality by means of this wearable. One of its strange features is that any smart devices can be easily plugged with this wearable. I think this will be the best aid for sleep disorders during menopause.
DesignIn this project we are detecting sleep disorders,with the number of motions produced by a person in a certain amount of time during sleep. The number of motions made by a person is greater than a threshold value in a certain time, we detect a sleep disrupt the event. According to the number of motions produced,we classify the sleep stages as
1.Deep Sleep
2.Sleep
3.Awake
We are considering some basic postures occurring during sleep. When this posture is identified, it will count the motion value. The basic postures are
- Supine
- Left-Lateral
- Right-Lateral
- Prone
- Rollover - This posture is identified when a person rotates from left-lateral to right lateral or vice versa.
Here reference position is taken as Supine for Left-lateral,right-lateral, and prone postures. For the rollover, any right-lateral or left-lateral can be the reference. So any of the above postures are done by the person from the supine position will be regarded as a motion. According to the motion values in a certain time, we can almost predict the sleeplessness in a body. We need a powerful device to make it real.
HardwareIn this project we are using the SmartEdgeAgile device for detecting the postures. The SmartEdge Agile device is a certified hardware solution, embedded with a full software stack featuring Edge Intelligence.
This device has a wide variety of on-board sensors. In this project, we are utilizing its accelerometer,gyroscope,temperature, and humidity sensors. By combining these sensor values with AI we can create an outbreak.
Unlike all the other functionalities, working with AI-based monitoring requires the use of the AI Studio tool, available on the portal. AI Studio offers an easy and intuitive way to create the models, which are needed for using AI. One of its AI features is motion recognition. Actually this device transfers its data to the Brainium platform through the gateway. It communicates via Bluetooth with the gateway. The Brainium gateway can be downloaded from the ios or android store.
This device can be easily charged via the USB port and has more run time.
SoftwareHere comes the software part of the project.
- Brainium Portal
For using the SmartEdge Agile board you need to signup to the Brainium platform.
- Installing the Brainium Gateway
The SmartEdge Agile uses Bluetooth to talk to a local gateway which will serve as a proxy for traffic back up into the cloud. You can either use your phone, there is a gateway application for both iPhone and Android, or so long as it has Bluetooth on board, a Raspberry Pi.
Going back to the portal we can see our new gateway.
- Adding Your SmartEdge Agile
Click on the plus icon in the devices column next to your gateway in the portal. Click on the ‘Agree’ button and your gateway will start looking for your SmartEdge Agile device.
Turn on your SmartEdge Agile device by pressing the button on the end underneath the red charging LED. Press and hold for around two seconds.
- Project
Click on the Projects icon, and then on the ‘Create Project’ button.
Name your project. Then we can add our device to the project.
- Machine Learning
With Motion Recognition, the user needs to record the motions they want to detect, using the SmartEdge Agile device, making sure each motion is repeated multiple times, then use those recordings as training to generate the AI model.
Once the model is generated and deployed to the device, AI rules for monitoring can be created. The overall process is quite simple. So here,we are training our wearable to detect those basic postures.
Click on the ‘Motion Recognition’ button in the portal menu bar. This will bring you to the AI Studio Workspace. Now go ahead and click on that big purple ‘+’ in the bottom right of your browser again. This will let you create a new Workspace.
After creating the new workspace, click on it in the portal and you’ll be presented with a screen, allowing you to create a number of motions. Click on the ‘Record new training set’ button in the top right of your browser window,then we can record our motions. During entire data recording and using the wearable should follow the same orientations,otherwise it wouldn't detect the motions.
Here are the motions we are training with the wearable.
I have recorded around 20 motions each for a posture. The number of datasets increases the precision also increases. Let's see a video to know,how the training goes on?
Here reference position is taken as Supine for Left-lateral,right-lateral, and prone postures. For the rollover, any right-lateral or left-lateral can be the reference
Afterwards by selecting all sets of data we can now generate our model.
Now we have a model. Then we need to select our workspace and model and also we apply the model to the device.
So training is over. We also add temperature and humidity widgets to access the real-time temperature and humidity.
- MQTT API
Then we can access the real time data which is sent from the users.
MQTT API is available over WebSockets by the following URI: wss://ns01-wss.brainium.com and it's secured. The MQTT protocol provides username and password fields in the CONNECT message for authentication. The client has the option to send a username and a password when it connects to an MQTT broker. For connection to Branium Platform this option is a must:
- the username has the specified static value : oauth2-user
- the password is different for each user and equals to external access token (it's available in the user's profile).
Also, because of in MQTT the word "topic" refers to an UTF-8 string that the broker uses to filter messages for each connected client, the user identifier akka userId should be specified in each topic. The user can find it in its profile : user ID
I have attached the python code which talks to MQTT topics and will manipulate it.
Python example (you have to download a certificate - https://brainium.blob.core.windows.net/public/docs/cacert.crt)
Here Is a message format when the motion is detected
We take only the motions which have a large probability. The temperature and humidity will be in this message format
{
"timestamp":1538754149379,
"scalar": 23.8999996185303
}
Then this values are pushed to the Google Fire Base.
- Firebase
Firebase is a mobile and web application development platform. Firebase frees developers to focus on crafting fantastic user experiences. You don’t need to manage servers. In our project, we use Firebase real-time database to instantly retrieve data so that there is no time delay.
.To find Firebase URL
- Go to Firebase
- Then go and open your project (If you have no projects create one)
- Then move to Real-Time Database in Database
- The URL in the screenshot is the Firebase URL
Then go to the rules, replace "false" by "true" to make read and write operations.
The values will be updated in the firebase bucket under specific tag. If you want to know more about setting up Firebase read the detailed guide here.
- Kodular
Kodular allows anyone to make perfect Android apps easily without writing any line of code. Kodular allows you to focus on the ideas and not the code. A mobile application is made by the Kodular which shows the sleep data in real-time. Design the application as shown and code block to give it life.
In this project we are solving sleep disorders with Artificial intelligence. It is a complete solution for a person who suffers from sleep disorders during menopause. Let see the wearable.
Comments