📜 ⬆️ ⬇️

Power BI Embedded, IoT and machine learning for processing brain thermograms

Every week at Microsoft there are cases dedicated to the development of solutions for companies, universities and even states. We decided to share with you the most interesting of them and start a series of articles "Microsoft Technical Case Studies". In the first article, you will learn about the Brain Temperature Tunnel image processing IoT solution according to a technique based on research by Dr. Marc Abreu from Yale University.



Cycle of Microsoft Technical Case Studies


1. Power BI Embedded, IoT and machine learning for processing brain thermograms .
2. As in Canada, looking for missing children .
3. Internet of things in archeology .
4. Loading ...

Introduction


Brain Tunnelgenix Technologies Corp (BTT Corp) is a company that manufactures medical technology. Its offices are located in the USA and Brazil. BTT Corp is the owner of a patent for a “brainwave” and is developing several product families related to this discovery. The main goal of the company is to learn how to use analytical data on the thermodynamics of the brain to treat patients.
')
Brain temperature is monitored continuously and processed as a multichannel signal. Analysis of this signal and the search for patterns in it allow us to make conclusions about the state of a particular patient.

The BTT device is non-invasive - this is one of its main advantages. Appearance of the device is shown in the photo below.



BTT Corp had to solve two serious problems. Firstly, with the participation of researchers, it was necessary to collect thermograms of the human brain and create computer algorithms for their high-precision recognition. Secondly, the algorithms needed to be integrated into a production application capable of recognizing images in real time and in batch mode when data was received from BTT devices.

As a result, an IoT solution was presented that uses several processes and data processing sequences:

  1. IoT Hub → Stream Analytics → Azure SQL Database
  2. IoT Hub → Stream Analytics → Azure SQL Database → Power BI
  3. IoT Hub → Stream Analytics → Azure SQL Database → Power BI Embedded
  4. IoT Hub → Stream Analytics → Azure SQL Database → Local High Performance Computing → Azure Machine Learning

Power BI


Power BI plays an important role in visualizing the heat signals of the brain that a BTT device receives. This data is reflected in Power BI internal reports and displayed to external users using Power BI Embedded. Row-level data protection provides secure access to it.

Using complex R-analytics in Power BI and visualization packages is a valuable BTT solution. Thanks to the R language, advanced analytical tools can be used, including Fourier transform, frequency data analysis, and the detection of minima and maxima.





Traditionally, the task of reliable transmission of detailed analytical information and visual images to client applications is difficult. For example, setting up an R-environment and providing secure access to it via the Internet require a lot of work. With Power BI Embedded, you can create secure interactive dashboards and reports for doctors and patients. They use R visuals that are transmitted through an ASP.NET web application running on the Microsoft Azure platform. The following steps will look like this:

  1. Create a Power BI workspace in Azure .
  2. Create a report in Power BI Desktop using Azure SQL Database as a data source .
  3. Apply row-level security in the report where appropriate .
  4. Send the resulting .pbix file to the Power BI workspace.
  5. Add source credentials to dataset .
  6. Get the proper OAuth token .
  7. Embed the report into a web page using an OAuth token .

Data aggregation


For aggregation of data, a sequence of GROUP BY operators is used. We take the data collected during user sleep, group them by users and session identifiers, sort them in chronological order, and then apply frequency signal processing methods to them to get detailed analytical information. To date, BTT is evaluating the most effective ways to analyze and classify the data used in detail.

Archiving strategy


Currently, no data archiving is performed. This feature is not yet necessary, since BTT currently uses only a small part of the maximum size of the Azure SQL database . However, when the volume used approaches the maximum, BTT will need to develop an archiving strategy. It is likely that archiving will be performed by transferring data to long-term storage in Azure Blob storage via the SQL Server pool in conjunction with the Azure data factory .

Extract, transform and load


Currently, extraction, transformation, and loading are not used because we have direct access to the Azure SQL database using DirectQuery . The BTT system is still under development, so for now quite a few users access it to access Power BI Embedded reports. However, as the number of BTT users increases and the SQL database load reaches threshold values, the transition to the SQL Server pool will begin. Currently, BTT creates read-only requests for data to replicated non-transactional databases and archive repositories. Under standard conditions, developers do not use transactional repository, but in this case, this architectural solution was chosen in the existing BTT initial scenario.

Example


Below is a screen shot of an information panel that displays historical data processed using Power BI's simple analytical methods.



The Power BI dashboard displayed by Power BI Embedded in an ASP.NET application.



BTT's CTO, Robert Ortega, demonstrates setting up row-level security using Power BI Embedded in an ASP.NET web application.



IoT and machine learning


The most important development of BTT is the pattern recognition technology on which most of its products are based. Since the company is already developing in C ++, Python and R on its workstations, we decided to give them the opportunity to begin deployment in a production environment, while continuing their research work. Together with the developers, a model was created based on the sklearn packages of the Python language and put into action using Azure machine learning (a few months ago we already told how to choose Microsoft Azure machine learning algorithms). Below is a screenshot taken during the development of a binary classification model using sklearn on a Linux workstation.



As you can see, we use Linux, Python, and Anaconda to analyze data extracted from an Azure SQL source. This choice is solely due to our personal preferences, but the process is so flexible that you can use almost any technology. The process of commissioning a model using Azure machine learning is shown below.



One of the most interesting aspects of this experiment is that we were able to separate the training of the model and the search for dependencies on the distinguishing features. This allows you to rank the stacks of Azure’s built-in machine learning models and custom models using the distinguishing features that were highlighted at workstations during the experiment. This process opens up two possibilities. You can choose the most likely best model by iterating only Azure machine learning models, while developing your own models as needed and applying many other common algorithms to them.

Then, on the basis of the experiment, we obtain a production model, choosing end points and performing basic cleaning actions. The production experiment is illustrated in the figure below.



At the end of the process, we can integrate and test the endpoint in various ways. One of the easiest ways to test is to use the provided Excel endpoint. Below is shown the testing of the data segment on the end point, with which we verify that we have received a negative classification.



Solution Architecture


BTT has developed an IoT solution that leverages the advanced capabilities of Microsoft IoT Suite and is implemented in accordance with the Microsoft Azure IoT Reference Architecture Guide . General information about this decision is published here . The main difference of this solution from many others is the ability to analyze data both locally and in the cloud, as well as the absence of a large-scale data infrastructure. SQL successfully handles current workloads. BTT assesses the prospect of using SQL data storage as a platform for working with big data after workloads exceed the capabilities of the current Azure SQL data source.


Used device and source code


In this paper, we use our own device based on the integrated Texas Instruments microcontroller with Bluetooth interface. This device is synchronized with a Windows client device, which is developed using the universal Windows platform and the C # language. This scenario uses the IoT Hub SDK for C #. An application for labeling time series templates is on GitHub . Step-by-step instructions for deploying custom klearn Azure machine learning models are here . Instructions for creating a deep neural network using Theano and Lasagne, as well as its commissioning through machine learning, are here .

Conclusion


With the help of Microsoft technologies (Power BI), BTT plans to create a solution for analyzing signals and creating BTT reports (including for doctors and sleep professionals). BTT is also going to implement cross-platform capabilities to send alerts using the Azure Notification Hub and transfer BTT Monitor to Xamarin.Forms to provide support for various platforms. The company is also considering using Microsoft HealthVault and SQL Azure Data Warehouse.

Business.IoT: discovering the Internet of Things


We invite you to talk on the topic of IoT for business on March 30, 2017. We will have an online conference "Business.IoT: discovering the Internet of Things" . The program will have two parallel tracks (business and technology) with experts in the field of the Internet of things, machine learning and predictive analytics.

Among the speakers will be: Mikhail Chernomordikov (Microsoft), Sergey Osipov (MAYKOR-GMCS), Dmitry Bergelson (GuaranaCam), Anna Kulashova (Microsoft), Dmitry Marchenko (Microsoft), Andrei Meluzov (KORUS Consulting) and Vasily Yesipov ( KPMG).

To participate, you must register here .

We remind you that you can try Microsoft Azure for free here .

If you see an inaccuracy of the translation, please report this to private messages.

Source: https://habr.com/ru/post/323200/


All Articles