UCL IXN Emergency Room Busyness predictions - a generalised Azure ML model for the NHS

Published May 05 2020 06:34 AM 1,500 Views
Microsoft

IXN.png

 
Introduction:

Meet the UCL team, Project aimed to create a generalised system to allow the modelling of any emergency department within an evaluation framework. 

 

EthanWood.jpg
Ethan Wood, team leader, who worked on project coordination, the database engineering of the backend, as well as research and literature.
(https://www.linkedin.com/in/ethan-wood-london/)

 

NoanLeRenard.jpg
Noan Le Renard, who worked on the front-end web app, as well as research and literature.
(https://www.linkedin.com/in/noanlerenard/)

 

WChen.png
Wuhao Chen, who worked on the machine learning model, data visualization, and research.
(https://www.linkedin.com/in/wchen1999/Through our university, University College London, Industry Exchange Network program, we are working as technical consultants for Microsoft, contracted to a major NHS hospital.

 

Our challenge:

Our project aimed to create a generalised system to allow the modelling of any emergency department within an evaluation framework. A model can be written in Python where once uploaded; it will be run against historical patient data to gain a score for its particular metric.

 

The system automatically manages and scales models whilst providing a simple python object interface to patient data. One of the provided models is a machine learning algorithm of emergency department admissions, with improved accuracy compared to the current admission prediction system. The framework will include a graphical user interface for interacting with the models and a RESTful API to retrieve and request data.

 

Our approach:

Initially, alongside forecasting emergency department busyness, the NHS were interested in the impact of third-party data on these predictions. As a result, the first half of our project was spent acquiring substantial third-party data to start researching any potential correlation that may exist with our dataset. The extrinsic factors we initially investigated were weather related (e.g. temperature, humidity, precipitation…) as our client thought that they were most likely to have direct impact on emergency department busyness. In addition, after finding the news outlet local to our hospital's area, we wanted to research the links between the news headlines and our dataset.

 

However, despite arduous work and research, most of our studies came back to be inconclusive as they were not statistically meaningful. Nonetheless, in order to gain insight on our research, we decided to meet a research group working on a similar project to ours. Withal, despite their increased time and experience in the field and having a more restrained scope, they still struggled to find meaningful progress on finding correlations between health records and third-party data.

 

As a result, to accommodate the timespan that we were given, we decided to change the direction of our client deliverables, and after approval from Microsoft and the NHS, we built a feasible final product with a much larger reach and scale: a generalized system for modelling an emergency department.

 

This solution consists of a front end which can both upload and interact with the models, and a back end that consists of a swarm of models interacting with a central database. However, as part of our compromise to still fulfill on our client deliverables, we also developed and trained a machine learning model for our hospital that can accurately predict busyness and integrates into our platform.

 

Our technical solution:

Despite redefining our deliverables, we still built a technical solution to our initial problem. We think the inclusion of this is warranted as through there creation, we were able to get a better grasp on the complexity of our project which ultimately led to its change in direction.

 

Following our exhaustive research, we were able to create a simple busyness model based on the prediction of the number of patients currently in the emergency department. Using historical data, we were able to simulate the department's current state and create historical predictions. For our front end, we built a dashboard utilizing React to visualize the data. We eventually reused this as part of our final front end for a more user-friendly interaction with the model output.

 

To increase our chances of finding correlations with third party data, we found a local news agency and scraped their website. However, as the news website was poorly designed, we had to resort to building a custom web scrapper in R to retrieve the news headlines and their corresponding date and time. To convert these headlines into a datatype we could compare to our dataset to find correlations with, we decided to use google TextRank and the RAKE algorithm to extract the important keywords.

After the shift in deliverables, our generalised system to allow the modelling of any emergency department consists of a front and back end. The former takes the form of a webserver built with Node.Js that is used to upload new models and interact with existing ones. Using a RESTful API to retrieve and request data, the user now has access to historical and prediction data, as well as executing operations on models such as seeding (calculating all historical values) or evaluating (calculating all historical prediction values and comparing them to the known historical value).

 

When a model is uploaded from our frontend, it passes through blob storage to our Model Swarm Cluster, where the models are stored, and the predictions are run. The final part of our backend consists of a PostgreSQL database in which the model's results are stored, and commands are passed to the cluster to fetch data and further configure the models. The retrieved data is then passed to the front end where it is displayed to the user.

 

 

ArchitectureIXNNHS.PNG

Fig 1. System architecture diagram

 

Due to the sequential nature of our dataset, we have chosen the industry’s common approach, which is a recurrent neural network to predict future attendance level. Firstly, our model’s input is a vector of 252 historical time steps composed of three weeks of history with 9 features for each step. The first layer is composed of 16 GRU neurons which connects to a second GRU layer with 16 neurons. The third layer is also a GRU layer which makes this model a 3-stacked GRU network, its output is then fed into a dense layer of 12 neurons, which will output a vector of 6 values for our final prediction. (c.f Fig 2.)

 

GRUNetwork.PNG

Fig 2. GRU network structure.

 

Our use of Microsoft and Azure technologies:

With our access to a vast array of medical records, one of the key requirements of our project was the security of our dataset. Thankfully, we were able to conduct our work in a contained and secure environment through Azure’s services.

 

This dataset was stored in a secure limited access blob storage account, which allowed both us and our client to quickly interact with the data, manipulate it, and transfer it to other Azure services. For example, for our backend, we eventually migrated our dataset into an Azure Database for PostgreSQL for the ease of interaction with both our models and frontend.

 

Our research, ML development, and training was done through Azure’s Machine Learning Studio. By virtue of this secure and seamless workflow that we could scale for any operation, we were able to orchestrate research on correlations between third-party data and our dataset through our access to Juypter Notebook and R Studio, alongside testing multiple machine learning models with different parameters.

 

Moreover, we employed this service's AutoML feature to automatically create, train, and validate a wide range of candidate algorithms, such as an SVM, decision tree, and random forest in order to establish a baseline for our future neural network approach.

 

It is also worth noting that we were recommended to use PowerBI as a tool, especially for its data visualizations and its ability to automatically generate prediction models. However, despite its integration with Azure, our dataset far exceeded the software’s maximal capacities, thus limiting us to powerful virtual machines for our research.

 

What we learnt:

With the exhaustive use of machine learning models during our project, we stumbled upon a few roadblocks which allowed us to learn from our mistakes and therefore improve our models. Initially, our technical mentor at Microsoft suggested that after we cleaned our dataset, we should use Azure’s AutoML feature to automate the time-consuming task of machine learning model development. However, despite running standard data sanitizations procedures, our AutoML model was only ever 56% accurate.

This led us to ask the NHS about the quality and reliability of our dataset. After a discussion, we learned about certain limits of medical datasets, namely that certain data quality conditions such as completeness, accuracy and timeliness are prone to human error and inconsistencies. As a result, in order not to negatively skew our predictions models, we started to create machine learning models only from parameters we knew satisfied these conditions. Eventually, after trying both classical and neural network approaches to time series forecasting, we were able to create an RNN model which produces predictions that correctly aligns with our real-world situations.


We determined that the models produced by AutoML were not well suited for our situation, as they were manipulating our problem as more of a classification task, disregarding the inherent relationship between time steps. After careful deliberation and research, we decided to further our research using recurrent neural networks as our main model for time-series prediction as it captures its underlying relationship and context. At first, we were using a specific type of recurrent neural network called a LSTM (c.f. Fig. 3). After testing, we decided to use a GRU network instead (c.f. Fig. 4) as its more efficient to train because it only contains 2 gates per cell, as opposed to 3 for an LSTM. Its result is on par with that of the LSTM net whilst reducing the overall training time. However, due to the nature of a recurrent neural network, it is very easy to overfit the model. We therefore reduced its complexity and applied recurrent dropout to our model’s stacked layer.  Eventually, our model was able to predict the trend in attendance more accurately than the moving average approach that our hospital is currently using.

 

LSTMCell.PNG

Fig 3.  LSTM cell

 

GRUCell.PNG

Fig 4. GRU cell

 

At the start of the project, we were faced with the conundrum of choosing a cloud service as opposed to physical hardware. One of our key requirements was that our data was to be kept secure and therefore stay on the Azure cloud for protection and to be backed up, but we thought that not being able working on our local devices would be an inconvenience to our workflow.

Much to our surprise, it was an enjoyable turn of expectations when we were able to learn about the benefits of using a cloud service such as Azure. Being able to spin up virtual machines with interactive programming environments such as Jupyter Notebook or R studio allowed for a seamless workflow, indistinguishable from working with our own servers, that was now hosted on the Azure platform and therefore readily accessible from any device with a connection.


Furthermore, being able to create a virtual environment with specific technical specifications offered us an astounding level of flexibility for any situation. Coupled with the fact that we were working with a budget, the information on the scope of our billing account available alongside a cost-effective pay-per-use basis enabled us to forecast our quotas with ease.


Whilst creating our generalized system, we projected ourselves and envisioned a future in which our product would be simultaneously used by multiple hospitals. Immediately, we grew concerned for the efficiency of our systems and the scaling of our tools. However, using a cloud service provider lets us upgrade the specifications of our Azure services to match any client’s demand instantly (especially when using a docker swarm).

 

Our Future plan:

From a purely technical standpoint, we hope to enhance the generalized system by enriching its features. For example, making more data more data readily accessible to researchers, creating an easier to use API, and all around increasing the efficient and load times of our components. We also want to foresee a future where through more iterative rounds of user testing, we create an easier and more efficient user experience for the interactions with the model through our frontend.

 

Regarding our generalized system for modelling an emergency department, we hope that after our hospital adopts it, it can be rolled out to other trusts around the UK as they recognize its benefits. This would allow any NHS facility with a medical dataset to model its own emergency department and accurately predict its busyness. It also allows NHS trusts to share models between departments as it is as simple as emailing a file. Fortunately for us, as we are using Azure, this increase in scale can be done simply and efficiently by allocating more resources to our services.

 

Finally, we plan to pursue the academic side of our project by trying to improve and expand our busyness algorithm. For example, we can research and iteratively test to improve its logic, efficiency and syntax. We think that using academia to our advantage can teach us about the inner intricacies of creating models, which we can use to refine the way they are interacted with and processed in our generalized system.

%3CLINGO-SUB%20id%3D%22lingo-sub-1360103%22%20slang%3D%22en-US%22%3EUCL%20IXN%20Emergency%20Room%20Busyness%20predictions%20-%20a%20generalised%20Azure%20ML%20model%20for%20the%20NHS%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1360103%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSTRONG%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22IXN.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F188963iD47DFEE1508C0A96%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22IXN.png%22%20alt%3D%22IXN.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%26nbsp%3B%3CBR%20%2F%3E%3C%2FSTRONG%3E%3CSTRONG%3EIntroduction%3A%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EMeet%20the%20UCL%20team%2C%20Project%20aimed%20to%20create%20a%20generalised%20system%20to%20allow%20the%20modelling%20of%20any%20emergency%20department%20within%20an%20evaluation%20framework.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22EthanWood.jpg%22%20style%3D%22width%3A%20183px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F188958iFBB190FE8488C078%2Fimage-size%2Fsmall%3Fv%3D1.0%26amp%3Bpx%3D200%22%20title%3D%22EthanWood.jpg%22%20alt%3D%22EthanWood.jpg%22%20%2F%3E%3C%2FSPAN%3E%3CBR%20%2F%3EEthan%20Wood%2C%20team%20leader%2C%20who%20worked%20on%20project%20coordination%2C%20the%20database%20engineering%20of%20the%20backend%2C%20as%20well%20as%20research%20and%20literature.%3CBR%20%2F%3E(%3CA%20href%3D%22https%3A%2F%2Fwww.linkedin.com%2Fin%2Fethan-wood-london%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fwww.linkedin.com%2Fin%2Fethan-wood-london%2F%3C%2FA%3E)%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorLee%20Stott_5%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22NoanLeRenard.jpg%22%20style%3D%22width%3A%20200px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F188959i8A9BEB7985613611%2Fimage-size%2Fsmall%3Fv%3D1.0%26amp%3Bpx%3D200%22%20title%3D%22NoanLeRenard.jpg%22%20alt%3D%22NoanLeRenard.jpg%22%20%2F%3E%3C%2FSPAN%3E%3CBR%20%2F%3ENoan%20Le%20Renard%2C%20who%20worked%20on%20the%20front-end%20web%20app%2C%20as%20well%20as%20research%20and%20literature.%3CBR%20%2F%3E(%3CA%20href%3D%22https%3A%2F%2Fwww.linkedin.com%2Fin%2Fnoanlerenard%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fwww.linkedin.com%2Fin%2Fnoanlerenard%2F%3C%2FA%3E)%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorLee%20Stott_6%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22WChen.png%22%20style%3D%22width%3A%20150px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F188960iBFFF693F4B788933%2Fimage-size%2Fsmall%3Fv%3D1.0%26amp%3Bpx%3D200%22%20title%3D%22WChen.png%22%20alt%3D%22WChen.png%22%20%2F%3E%3C%2FSPAN%3E%3CBR%20%2F%3EWuhao%20Chen%2C%20who%20worked%20on%20the%20machine%20learning%20model%2C%20data%20visualization%2C%20and%20research.%3CBR%20%2F%3E(%3CA%20href%3D%22https%3A%2F%2Fwww.linkedin.com%2Fin%2Fwchen1999%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fwww.linkedin.com%2Fin%2Fwchen1999%2F%3C%2FA%3EThrough%20our%20university%2C%20University%20College%20London%2C%20Industry%20Exchange%20Network%20program%2C%20we%20are%20working%20as%20technical%20consultants%20for%20Microsoft%2C%20contracted%20to%20a%20major%20NHS%20hospital.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-1144349947%22%20id%3D%22toc-hId-1144349947%22%3E%3CSTRONG%3EOur%20challenge%3A%20%3C%2FSTRONG%3E%3C%2FH3%3E%0A%3CP%3EOur%20project%20aimed%20to%20create%20a%20generalised%20system%20to%20allow%20the%20modelling%20of%20any%20emergency%20department%20within%20an%20evaluation%20framework.%20A%20model%20can%20be%20written%20in%20Python%20where%20once%20uploaded%3B%20it%20will%20be%20run%20against%20historical%20patient%20data%20to%20gain%20a%20score%20for%20its%20particular%20metric.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20system%20automatically%20manages%20and%20scales%20models%20whilst%20providing%20a%20simple%20python%20object%20interface%20to%20patient%20data.%20One%20of%20the%20provided%20models%20is%20a%20machine%20learning%20algorithm%20of%20emergency%20department%20admissions%2C%20with%20improved%20accuracy%20compared%20to%20the%20current%20admission%20prediction%20system.%20The%20framework%20will%20include%20a%20graphical%20user%20interface%20for%20interacting%20with%20the%20models%20and%20a%20RESTful%20API%20to%20retrieve%20and%20request%20data.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--663104516%22%20id%3D%22toc-hId--663104516%22%3E%3CSTRONG%3EOur%20approach%3A%3C%2FSTRONG%3E%3C%2FH3%3E%0A%3CP%3EInitially%2C%20alongside%20forecasting%20emergency%20department%20busyness%2C%20the%20NHS%20were%20interested%20in%20the%20impact%20of%20third-party%20data%20on%20these%20predictions.%20As%20a%20result%2C%20the%20first%20half%20of%20our%20project%20was%20spent%20acquiring%20substantial%20third-party%20data%20to%20start%20researching%20any%20potential%20correlation%20that%20may%20exist%20with%20our%20dataset.%20The%20extrinsic%20factors%20we%20initially%20investigated%20were%20weather%20related%20(e.g.%20temperature%2C%20humidity%2C%20precipitation%E2%80%A6)%20as%20our%20client%20thought%20that%20they%20were%20most%20likely%20to%20have%20direct%20impact%20on%20emergency%20department%20busyness.%20In%20addition%2C%20after%20finding%20the%20news%20outlet%20local%20to%20our%20hospital's%20area%2C%20we%20wanted%20to%20research%20the%20links%20between%20the%20news%20headlines%20and%20our%20dataset.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHowever%2C%20despite%20arduous%20work%20and%20research%2C%20most%20of%20our%20studies%20came%20back%20to%20be%20inconclusive%20as%20they%20were%20not%20statistically%20meaningful.%20Nonetheless%2C%20in%20order%20to%20gain%20insight%20on%20our%20research%2C%20we%20decided%20to%20meet%20a%20research%20group%20working%20on%20a%20similar%20project%20to%20ours.%20Withal%2C%20despite%20their%20increased%20time%20and%20experience%20in%20the%20field%20and%20having%20a%20more%20restrained%20scope%2C%20they%20still%20struggled%20to%20find%20meaningful%20progress%20on%20finding%20correlations%20between%20health%20records%20and%20third-party%20data.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20a%20result%2C%20to%20accommodate%20the%20timespan%20that%20we%20were%20given%2C%20we%20decided%20to%20change%20the%20direction%20of%20our%20client%20deliverables%2C%20and%20after%20approval%20from%20Microsoft%20and%20the%20NHS%2C%20we%20built%20a%20feasible%20final%20product%20with%20a%20much%20larger%20reach%20and%20scale%3A%20a%20generalized%20system%20for%20modelling%20an%20emergency%20department.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20solution%20consists%20of%20a%20front%20end%20which%20can%20both%20upload%20and%20interact%20with%20the%20models%2C%20and%20a%20back%20end%20that%20consists%20of%20a%20swarm%20of%20models%20interacting%20with%20a%20central%20database.%20However%2C%20as%20part%20of%20our%20compromise%20to%20still%20fulfill%20on%20our%20client%20deliverables%2C%20we%20also%20developed%20and%20trained%20a%20machine%20learning%20model%20for%20our%20hospital%20that%20can%20accurately%20predict%20busyness%20and%20integrates%20into%20our%20platform.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-1824408317%22%20id%3D%22toc-hId-1824408317%22%3E%3CSTRONG%3EOur%20technical%20solution%3A%3C%2FSTRONG%3E%3C%2FH3%3E%0A%3CP%3EDespite%20redefining%20our%20deliverables%2C%20we%20still%20built%20a%20technical%20solution%20to%20our%20initial%20problem.%20We%20think%20the%20inclusion%20of%20this%20is%20warranted%20as%20through%20there%20creation%2C%20we%20were%20able%20to%20get%20a%20better%20grasp%20on%20the%20complexity%20of%20our%20project%20which%20ultimately%20led%20to%20its%20change%20in%20direction.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFollowing%20our%20exhaustive%20research%2C%20we%20were%20able%20to%20create%20a%20simple%20busyness%20model%20based%20on%20the%20prediction%20of%20the%20number%20of%20patients%20currently%20in%20the%20emergency%20department.%20Using%20historical%20data%2C%20we%20were%20able%20to%20simulate%20the%20department's%20current%20state%20and%20create%20historical%20predictions.%20For%20our%20front%20end%2C%20we%20built%20a%20dashboard%20utilizing%20React%20to%20visualize%20the%20data.%20We%20eventually%20reused%20this%20as%20part%20of%20our%20final%20front%20end%20for%20a%20more%20user-friendly%20interaction%20with%20the%20model%20output.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETo%20increase%20our%20chances%20of%20finding%20correlations%20with%20third%20party%20data%2C%20we%20found%20a%20local%20news%20agency%20and%20scraped%20their%20website.%20However%2C%20as%20the%20news%20website%20was%20poorly%20designed%2C%20we%20had%20to%20resort%20to%20building%20a%20custom%20web%20scrapper%20in%20R%20to%20retrieve%20the%20news%20headlines%20and%20their%20corresponding%20date%20and%20time.%20To%20convert%20these%20headlines%20into%20a%20datatype%20we%20could%20compare%20to%20our%20dataset%20to%20find%20correlations%20with%2C%20we%20decided%20to%20use%20google%20TextRank%20and%20the%20RAKE%20algorithm%20to%20extract%20the%20important%20keywords.%3C%2FP%3E%0A%3CP%3EAfter%20the%20shift%20in%20deliverables%2C%20our%20generalised%20system%20to%20allow%20the%20modelling%20of%20any%20emergency%20department%20consists%20of%20a%20front%20and%20back%20end.%20The%20former%20takes%20the%20form%20of%20a%20webserver%20built%20with%20Node.Js%20that%20is%20used%20to%20upload%20new%20models%20and%20interact%20with%20existing%20ones.%20Using%20a%20RESTful%20API%20to%20retrieve%20and%20request%20data%2C%20the%20user%20now%20has%20access%20to%20historical%20and%20prediction%20data%2C%20as%20well%20as%20executing%20operations%20on%20models%20such%20as%20seeding%20(calculating%20all%20historical%20values)%20or%20evaluating%20(calculating%20all%20historical%20prediction%20values%20and%20comparing%20them%20to%20the%20known%20historical%20value).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhen%20a%20model%20is%20uploaded%20from%20our%20frontend%2C%20it%20passes%20through%20blob%20storage%20to%20our%20Model%20Swarm%20Cluster%2C%20where%20the%20models%20are%20stored%2C%20and%20the%20predictions%20are%20run.%20The%20final%20part%20of%20our%20backend%20consists%20of%20a%20PostgreSQL%20database%20in%20which%20the%20model's%20results%20are%20stored%2C%20and%20commands%20are%20passed%20to%20the%20cluster%20to%20fetch%20data%20and%20further%20configure%20the%20models.%20The%20retrieved%20data%20is%20then%20passed%20to%20the%20front%20end%20where%20it%20is%20displayed%20to%20the%20user.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorLee%20Stott_0%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ArchitectureIXNNHS.PNG%22%20style%3D%22width%3A%20403px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F188969i9783EEE80FC0C147%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22ArchitectureIXNNHS.PNG%22%20alt%3D%22ArchitectureIXNNHS.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EFig%201.%20System%20architecture%20diagram%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EDue%20to%20the%20sequential%20nature%20of%20our%20dataset%2C%20we%20have%20chosen%20the%20industry%E2%80%99s%20common%20approach%2C%20which%20is%20a%20recurrent%20neural%20network%20to%20predict%20future%20attendance%20level.%20Firstly%2C%20our%20model%E2%80%99s%20input%20is%20a%20vector%20of%20252%20historical%20time%20steps%20composed%20of%20three%20weeks%20of%20history%20with%209%20features%20for%20each%20step.%20The%20first%20layer%20is%20composed%20of%2016%20GRU%20neurons%20which%20connects%20to%20a%20second%20GRU%20layer%20with%2016%20neurons.%20The%20third%20layer%20is%20also%20a%20GRU%20layer%20which%20makes%20this%20model%20a%203-stacked%20GRU%20network%2C%20its%20output%20is%20then%20fed%20into%20a%20dense%20layer%20of%2012%20neurons%2C%20which%20will%20output%20a%20vector%20of%206%20values%20for%20our%20final%20prediction.%20(c.f%20Fig%202.)%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorLee%20Stott_1%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22GRUNetwork.PNG%22%20style%3D%22width%3A%20313px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F188965iED0D0C42872CAD50%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22GRUNetwork.PNG%22%20alt%3D%22GRUNetwork.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EFig%202.%20GRU%20network%20structure.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-16953854%22%20id%3D%22toc-hId-16953854%22%3E%3CSTRONG%3EOur%20use%20of%20Microsoft%20and%20Azure%20technologies%3A%20%3C%2FSTRONG%3E%3C%2FH3%3E%0A%3CP%3EWith%20our%20access%20to%20a%20vast%20array%20of%20medical%20records%2C%20one%20of%20the%20key%20requirements%20of%20our%20project%20was%20the%20security%20of%20our%20dataset.%20Thankfully%2C%20we%20were%20able%20to%20conduct%20our%20work%20in%20a%20contained%20and%20secure%20environment%20through%20Azure%E2%80%99s%20services.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20dataset%20was%20stored%20in%20a%20secure%20limited%20access%20blob%20storage%20account%2C%20which%20allowed%20both%20us%20and%20our%20client%20to%20quickly%20interact%20with%20the%20data%2C%20manipulate%20it%2C%20and%20transfer%20it%20to%20other%20Azure%20services.%20For%20example%2C%20for%20our%20backend%2C%20we%20eventually%20migrated%20our%20dataset%20into%20an%20Azure%20Database%20for%20PostgreSQL%20for%20the%20ease%20of%20interaction%20with%20both%20our%20models%20and%20frontend.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOur%20research%2C%20ML%20development%2C%20and%20training%20was%20done%20through%20Azure%E2%80%99s%20Machine%20Learning%20Studio.%20By%20virtue%20of%20this%20secure%20and%20seamless%20workflow%20that%20we%20could%20scale%20for%20any%20operation%2C%20we%20were%20able%20to%20orchestrate%20research%20on%20correlations%20between%20third-party%20data%20and%20our%20dataset%20through%20our%20access%20to%20Juypter%20Notebook%20and%20R%20Studio%2C%20alongside%20testing%20multiple%20machine%20learning%20models%20with%20different%20parameters.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EMoreover%2C%20we%20employed%20this%20service's%20AutoML%20feature%20to%20automatically%20create%2C%20train%2C%20and%20validate%20a%20wide%20range%20of%20candidate%20algorithms%2C%20such%20as%20an%20SVM%2C%20decision%20tree%2C%20and%20random%20forest%20in%20order%20to%20establish%20a%20baseline%20for%20our%20future%20neural%20network%20approach.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIt%20is%20also%20worth%20noting%20that%20we%20were%20recommended%20to%20use%20PowerBI%20as%20a%20tool%2C%20especially%20for%20its%20data%20visualizations%20and%20its%20ability%20to%20automatically%20generate%20prediction%20models.%20However%2C%20despite%20its%20integration%20with%20Azure%2C%20our%20dataset%20far%20exceeded%20the%20software%E2%80%99s%20maximal%20capacities%2C%20thus%20limiting%20us%20to%20powerful%20virtual%20machines%20for%20our%20research.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--1790500609%22%20id%3D%22toc-hId--1790500609%22%3E%3CSTRONG%3EWhat%20we%20learnt%3A%3C%2FSTRONG%3E%3C%2FH3%3E%0A%3CP%3EWith%20the%20exhaustive%20use%20of%20machine%20learning%20models%20during%20our%20project%2C%20we%20stumbled%20upon%20a%20few%20roadblocks%20which%20allowed%20us%20to%20learn%20from%20our%20mistakes%20and%20therefore%20improve%20our%20models.%20Initially%2C%20our%20technical%20mentor%20at%20Microsoft%20suggested%20that%20after%20we%20cleaned%20our%20dataset%2C%20we%20should%20use%20Azure%E2%80%99s%20AutoML%20feature%20to%20automate%20the%20time-consuming%20task%20of%20machine%20learning%20model%20development.%20However%2C%20despite%20running%20standard%20data%20sanitizations%20procedures%2C%20our%20AutoML%20model%20was%20only%20ever%2056%25%20accurate.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CP%3EThis%20led%20us%20to%20ask%20the%20NHS%20about%20the%20quality%20and%20reliability%20of%20our%20dataset.%20After%20a%20discussion%2C%20we%20learned%20about%20certain%20limits%20of%20medical%20datasets%2C%20namely%20that%20certain%20data%20quality%20conditions%20such%20as%20completeness%2C%20accuracy%20and%20timeliness%20are%20prone%20to%20human%20error%20and%20inconsistencies.%20As%20a%20result%2C%20in%20order%20not%20to%20negatively%20skew%20our%20predictions%20models%2C%20we%20started%20to%20create%20machine%20learning%20models%20only%20from%20parameters%20we%20knew%20satisfied%20these%20conditions.%20Eventually%2C%20after%20trying%20both%20classical%20and%20neural%20network%20approaches%20to%20time%20series%20forecasting%2C%20we%20were%20able%20to%20create%20an%20RNN%20model%20which%20produces%20predictions%20that%20correctly%20aligns%20with%20our%20real-world%20situations.%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EWe%20determined%20that%20the%20models%20produced%20by%20AutoML%20were%20not%20well%20suited%20for%20our%20situation%2C%20as%20they%20were%20manipulating%20our%20problem%20as%20more%20of%20a%20classification%20task%2C%20disregarding%20the%20inherent%20relationship%20between%20time%20steps.%20After%20careful%20deliberation%20and%20research%2C%20we%20decided%20to%20further%20our%20research%20using%20recurrent%20neural%20networks%20as%20our%20main%20model%20for%20time-series%20prediction%20as%20it%20captures%20its%20underlying%20relationship%20and%20context.%20At%20first%2C%20we%20were%20using%20a%20specific%20type%20of%20recurrent%20neural%20network%20called%20a%20LSTM%20(c.f.%20Fig.%203).%20After%20testing%2C%20we%20decided%20to%20use%20a%20GRU%20network%20instead%20(c.f.%20Fig.%204)%20as%20its%20more%20efficient%20to%20train%20because%20it%20only%20contains%202%20gates%20per%20cell%2C%20as%20opposed%20to%203%20for%20an%20LSTM.%20Its%20result%20is%20on%20par%20with%20that%20of%20the%20LSTM%20net%20whilst%20reducing%20the%20overall%20training%20time.%20However%2C%20due%20to%20the%20nature%20of%20a%20recurrent%20neural%20network%2C%20it%20is%20very%20easy%20to%20overfit%20the%20model.%20We%20therefore%20reduced%20its%20complexity%20and%20applied%20recurrent%20dropout%20to%20our%20model%E2%80%99s%20stacked%20layer.%26nbsp%3B%20Eventually%2C%20our%20model%20was%20able%20to%20predict%20the%20trend%20in%20attendance%20more%20accurately%20than%20the%20moving%20average%20approach%20that%20our%20hospital%20is%20currently%20using.%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorLee%20Stott_2%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22LSTMCell.PNG%22%20style%3D%22width%3A%20321px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F188966iE6B357413D032C37%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22LSTMCell.PNG%22%20alt%3D%22LSTMCell.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EFig%203.%20%26nbsp%3BLSTM%20cell%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorLee%20Stott_3%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22GRUCell.PNG%22%20style%3D%22width%3A%20308px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F188967i45B2CE2AB2CB88D2%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22GRUCell.PNG%22%20alt%3D%22GRUCell.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EFig%204.%20GRU%20cell%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAt%20the%20start%20of%20the%20project%2C%20we%20were%20faced%20with%20the%20conundrum%20of%20choosing%20a%20cloud%20service%20as%20opposed%20to%20physical%20hardware.%20One%20of%20our%20key%20requirements%20was%20that%20our%20data%20was%20to%20be%20kept%20secure%20and%20therefore%20stay%20on%20the%20Azure%20cloud%20for%20protection%20and%20to%20be%20backed%20up%2C%20but%20we%20thought%20that%20not%20being%20able%20working%20on%20our%20local%20devices%20would%20be%20an%20inconvenience%20to%20our%20workflow.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CP%3EMuch%20to%20our%20surprise%2C%20it%20was%20an%20enjoyable%20turn%20of%20expectations%20when%20we%20were%20able%20to%20learn%20about%20the%20benefits%20of%20using%20a%20cloud%20service%20such%20as%20Azure.%20Being%20able%20to%20spin%20up%20virtual%20machines%20with%20interactive%20programming%20environments%20such%20as%20Jupyter%20Notebook%20or%20R%20studio%20allowed%20for%20a%20seamless%20workflow%2C%20indistinguishable%20from%20working%20with%20our%20own%20servers%2C%20that%20was%20now%20hosted%20on%20the%20Azure%20platform%20and%20therefore%20readily%20accessible%20from%20any%20device%20with%20a%20connection.%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EFurthermore%2C%20being%20able%20to%20create%20a%20virtual%20environment%20with%20specific%20technical%20specifications%20offered%20us%20an%20astounding%20level%20of%20flexibility%20for%20any%20situation.%20Coupled%20with%20the%20fact%20that%20we%20were%20working%20with%20a%20budget%2C%20the%20information%20on%20the%20scope%20of%20our%20billing%20account%20available%20alongside%20a%20cost-effective%20pay-per-use%20basis%20enabled%20us%20to%20forecast%20our%20quotas%20with%20ease.%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EWhilst%20creating%20our%20generalized%20system%2C%20we%20projected%20ourselves%20and%20envisioned%20a%20future%20in%20which%20our%20product%20would%20be%20simultaneously%20used%20by%20multiple%20hospitals.%20Immediately%2C%20we%20grew%20concerned%20for%20the%20efficiency%20of%20our%20systems%20and%20the%20scaling%20of%20our%20tools.%20However%2C%20using%20a%20cloud%20service%20provider%20lets%20us%20upgrade%20the%20specifications%20of%20our%20Azure%20services%20to%20match%20any%20client%E2%80%99s%20demand%20instantly%20(especially%20when%20using%20a%20docker%20swarm).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-697012224%22%20id%3D%22toc-hId-697012224%22%3E%3CSTRONG%3EOur%20Future%20plan%3A%3C%2FSTRONG%3E%3C%2FH3%3E%0A%3CP%3EFrom%20a%20purely%20technical%20standpoint%2C%20we%20hope%20to%20enhance%20the%20generalized%20system%20by%20enriching%20its%20features.%20For%20example%2C%20making%20more%20data%20more%20data%20readily%20accessible%20to%20researchers%2C%20creating%20an%20easier%20to%20use%20API%2C%20and%20all%20around%20increasing%20the%20efficient%20and%20load%20times%20of%20our%20components.%20We%20also%20want%20to%20foresee%20a%20future%20where%20through%20more%20iterative%20rounds%20of%20user%20testing%2C%20we%20create%20an%20easier%20and%20more%20efficient%20user%20experience%20for%20the%20interactions%20with%20the%20model%20through%20our%20frontend.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ERegarding%20our%20generalized%20system%20for%20modelling%20an%20emergency%20department%2C%20we%20hope%20that%20after%20our%20hospital%20adopts%20it%2C%20it%20can%20be%20rolled%20out%20to%20other%20trusts%20around%20the%20UK%20as%20they%20recognize%20its%20benefits.%20This%20would%20allow%20any%20NHS%20facility%20with%20a%20medical%20dataset%20to%20model%20its%20own%20emergency%20department%20and%20accurately%20predict%20its%20busyness.%20It%20also%20allows%20NHS%20trusts%20to%20share%20models%20between%20departments%20as%20it%20is%20as%20simple%20as%20emailing%20a%20file.%20Fortunately%20for%20us%2C%20as%20we%20are%20using%20Azure%2C%20this%20increase%20in%20scale%20can%20be%20done%20simply%20and%20efficiently%20by%20allocating%20more%20resources%20to%20our%20services.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFinally%2C%20we%20plan%20to%20pursue%20the%20academic%20side%20of%20our%20project%20by%20trying%20to%20improve%20and%20expand%20our%20busyness%20algorithm.%20For%20example%2C%20we%20can%20research%20and%20iteratively%20test%20to%20improve%20its%20logic%2C%20efficiency%20and%20syntax.%20We%20think%20that%20using%20academia%20to%20our%20advantage%20can%20teach%20us%20about%20the%20inner%20intricacies%20of%20creating%20models%2C%20which%20we%20can%20use%20to%20refine%20the%20way%20they%20are%20interacted%20with%20and%20processed%20in%20our%20generalized%20system.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1360103%22%20slang%3D%22en-US%22%3E%3CP%3EOur%20project%20aimed%20to%20create%20a%20generalised%20system%20to%20allow%20the%20modelling%20of%20any%20emergency%20department%20within%20an%20evaluation%20framework.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1360103%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3Eacademic%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Efaculty%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Eixn%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Elearning%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EProject%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Estudent%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Eucl%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Version history
Last update:
‎May 07 2020 02:58 AM
Updated by: