Think 2021: The premier hybrid cloud and AI event, May 11-12 Register now

Archived | Develop a web-based mobile health app that uses machine learning

Archived content

Archive date: 2019-05-21

This content is no longer being updated or maintained. The content is provided “as is.” Given the rapid evolution of technology, some content, steps, or illustrations may have changed.


This code pattern shows you how to develop and deploy a web-based app that you run from your mobile phone that checks your pulse rate and then evaluates these pulse rates using machine learning on other studies to get the most accurate values in reading pulse rates.


DISCLAIMER: This application is used for demonstrative and illustrative purposes only and does not constitute an offering that has gone through regulatory review. It is not intended to serve as a medical application. There is no representation as to the accuracy of the output of this application and it is presented without warranty.

Training machine learning models is currently a highly complex and computationally intensive process. To implement machine learning, developers need an overall understanding of the underlying hardware and software infrastructure, including how to configure Spark, how to install machine learning libraries within a framework that will host these libraries, and how to manage the jobs while they are running to handle failures and recovery. Fortunately, developers can now use IBM Watson Studio, which provides machine learning as a service, and have to know all of the underlying complexity of a machine learning system.

In this code pattern, we show you how to deploy a health app, which is web-based, which uses a gyroscope for pulse metrics, and which uses Watson Machine Learning on IBM Cloud and IBM Watson Studio. The health app is called MyPulse, and it is a Node.js app. MyPulse reads the live data that is generated in about a minute, transmits the data in real time to perform predictions on heart rate in seconds, and returns back the beats per minute (bpm) as scoring values. The health app provides other gyroscopic metrics and stores all the data values in a Cloudant database. It displays them on Watson IoT Platform too. All in real-time.

This pattern provides training data to make the existing machine learning model. The Jupyter notebook shows how the data is read by the Pixiedust library. A Spark instance is set up and associated to the machine learning model.



  1. Users go to the web app (MyPulse) in a browser on their smartphones. They hold the phone to their chest to take their pulse rate.
  2. The data values are sent in real time to the Cloudant database on IBM Cloud, to Watson IoT Platform, and to IBM Watson Studio and the Watson Machine Learning service.
  3. Watson Machine Learning validates the data with the deployed machine learning model in real time.
  4. The predicted pulse rate values from the trained machine learning model is sent back to the web app (MyPulse). The data is displayed on the app’s front page in real time. Users can enter their own values and receive instant feedback from the machine learning model.


Find the detailed steps for this pattern in the README. The steps will show you how to:

  1. Create the Node.js app.
  2. Set up the Watson Machine Learning service in IBM Cloud.
  3. Set up the machine learning model in IBM Watson Studio.
  4. Try it out on your smartphone.