Saturday, 22 July 2017

GSoC 2017: Second Evaluations

As laid out in my previous post, development of the Tango Device Server for the Biometric Signal Sensor's Interface and the Graphical User Interface (GUI) for the hexoskin smart shirt data collection and anomaly detection were the next milestones in line for the completion of this project.

The Tango control system is a free open source device-oriented controls toolkit for controlling any kind of hardware or software. The Tango Device server for the project is the heart of the project that integrates all the modules/components of the system. It provides various endpoints that is used for the monitoring of the astronauts.

The Tango Device Server is built by defining a server class that inherits from the Device class, using PyTango. The class definition consists of mainly two items:
  • Attributes
  • Commands
The attributes are certain variables that characterize the class and it's instances. The Biometric Device server has the following attributes.
  • username
    Username of the astronaut | Read-only | string
  • recordID
    Record ID of the current live session. Hexoskin records all the sessions of activities using record IDs | Read-only | integer
  • userinfo
    Astronaut account information as a JSON string. This is consumed by the GUI to display these details | Read-only | string
 The commands are the endpoints that is opened for the clients to call, to perform actions.
  • af_to_gui
    Atrial Fibrillation anomalies are retrieved from the database and provided to the client as a JSON string. This is consumed by the Flask GUI server that is the client.
  • vt_to_gui
    Ventricular Tachycardia anomalies are retrieved from the database and provided to the client as a JSON string. This is consumed by the Flask GUI server that is the client.
     
  • apc_to_gui
    APC/PVC and PVC-hamilton anomalies are retrieved from the database and provided to the client as a JSON string. This is consumed by the Flask GUI server that is the client.
     
  • start_monitoring
    This is the command used to start the biometric monitoring. It starts all the three anomaly detection algorithms developed till now - Atrial Fibrillation,
    Ventricular Tachycardia and APC/PVC and PVC-hamilton - in the background. 
This created Tango Device server is then added into the database using a small register_monitor.py script. Once the device server starts running, it is available to the client. In this case, the client is the GUI.

The graphical user interface has been developed using Python Flask, and the front-end is neatened up using Materializecss. The GUI is split up into web pages:
  1. The landing page :- This consists of the generic details of the astronaut such as the name, email ID, username, height, weight, etc. It also showcases basic biometrics such as Resting heart rate, BMI, VO2 max, respiration coefficient and much more.
    The major element in the landing page is the Astronaut status box. This box shows the condition of the astronaut. The box - when green - means that there has not been any detection of anomaly in the past X (say, 7) days. A red box (as shown in the picture below) depicts the state where there was an anomaly detected in the past 7 days.



  2. The anomalies page :- The anomalies detected - using Dipankar's anomaly detection modules - are displayed in this page. They are displayed graphically using interactive plots, using plot.ly. But instead of having the plot made online and embedding the plots inside website using the URL, the plots are made in the Flask Server using code, and displaying it on the front-end end using Plotly.js.


Sunday, 9 July 2017

GSoC 2017:- Road Plan for Phase II

The first phase of the Biometric Signal Sensor's Interface, which was to finish writing the modules for Hexoskin Smart Shirt polling, the health monitor helper for the Tango device server and the integration of the Anomaly Detection module is wrapped up.

First evaluation was cleared and as the deliverable to demonstrate the work done a video of the working of modules was made. The video shows the hexoskin dashboard indicating the real-time data that was collected - yes, I was wearing the Hexoskin Smart Shirt. The video progresses to display the output of the modules (raw data collected from the Smart Shirt, Atrial Fibrillation Anomaly Detection and Ventricular Tachycardia Anomaly Detection) that was developed, on the terminal.



Now, the following requirements lie -
  • Tango Device Server
  • Graphical User Interface (GUI) for the hexoskin data collected and anomaly detected
The TANGO control system is a free open source device-oriented controls toolkit for controlling any kind of hardware or software and building SCADA systems.
The Tango Device Server is to be developed that polls the Smart Shirt, gathers data, requests anomaly detection from the AD (Anomaly Detector) module and finally presents that to the user in a GUI.

The development for this device server requires the development of what are known as commands, that would do the above said tasks.

The GUI to display the required information is the next requirement. The GUI system should communicate using Tango exclusively, i.e it should not read directly from the Hexoskin device, using the Hexoskin API, but use the Tango device server.

A good choice for would be to use Python Flask for building a web based GUI.

As far as division of the work goes, I plan on getting the Tango device server, with necessary commands for the anomaly detection and the GUI, done first. But assuming that this wouldn't be quite exhaustive, the Flask based GUI can be soon started.