Using machine learning to predict potential delays in acute stroke care

Historical data can help to improve present performance, and when such data is made available in real time, it becomes even more valuable.  However, detecting intricate patterns from data is tough for traditional statistical models.  Machine learning with neural networks, however, has shown remarkable results in such tasks – on structured as well as unstructured data.

With my recent foray into machine learning based on Prof Andrew Ng’s excellent courses ( &, and over 15 years data available from the acute stroke care program at Baby Memorial Hospital, the circumstances were ripe to attempt building a neural network – for predicting potential delays based on parameters recorded at the time of admission.

The full technical details of how this was designed and implemented are available at

The parameters that influenced treatment time were identified as the duration of symptoms (onset to arrival time), age, time of day and severity of stroke.  However, taken individually, the effects were very weak. Using these four parameters from over 200 patients, a 3-layered neural network implemented using the TensorFlow framework. After training, the network achieved an accuracy of ~ 60% in predicting delays.

This was then validated on an independent set of data.

The next step is showing a real-time notification: “Predicted DNT > 45 min!” (Door to Needle Time, stands for the time interval from hospital arrival to the initiation of clot-removal therapy) when a new patient from BMH with potential delay is entered in the MCare Acute Stroke app.

Machine learning powered delay prediction shown in the acute stroke pathway app

The accuracy of prediction should gradually go up, as the neural network is trained with more data.

In an emergency like stroke, every minute matters.

Machine learning AI trained on historical data has the potential to improve care by informing the team in advance about possible delays.

[Technical side note: Getting the neural network working on the Node.js app backend was done by implementing the forward part of the network, along with the trained parameters from TensorFlow, in Javascript.]

Jan 1st is a place!

The Earth, along with us, takes 365 days 6 hours 9 minutes and 10 seconds to complete one trip around the Sun. Our location on Jan 1st – the New Year’s Day – is opposite the constellation of Sagittarius (the Archer) in this celestial circle at present.

But.. why “at present”?

Because the position of Jan 1st recedes slightly each year. The reason is that the present ‘Gregorian’ calendar system reckons 1 year a little shorter at 365 days 5 hours 49 minutes and 12 seconds – around 20 min less than the actual orbital time (or the ‘Sidereal Year’).

This is done not arbitrarily, but for a very good reason: a gentle sweep or precession of the Earth’s rotational axis, which causes seasons to arrive slightly faster than they otherwise should each year by around 20min. This slightly shorter year is called the ‘Tropical Year’ in contrast to the ‘Sidereal Year’. The Tropical Year is, for all practical purposes, what we mean by one year.

This ‘axial precession’ or ‘precession of the equinoxes’, which takes around 26000 years for a full cycle, was known since antiquity – ancient Sanskrit astrological texts called it the ‘ayanamsa’.

So every year, on an average, we celebrate Jan 1st around 20 min earlier than the previous year, taking around 26000 years (365x24x60/20) to come back full circle.

In addition, there is the annual difference of ~5h:49m continually corrected by the leap year cycle that adds February 29th every 4th year – except on century years other than those divisible by 400.

This curious century year exception, known as the Gregorian reform, was added by Pope Gregory XIII in 1582 to correct the Julian calendar introduced by Julius Caesar in 45BC which only had leap years, and thus an average tropical year of 365 days and 6 hours: an error of ~11 minutes, which however lead to a cumulative error of 15 days by 1582! Because of this rule, 1700, 1800 & 1900 were not leap years, but 2000 was – being divisible by 400.

To summarise: Jan 1st does a regular 4-year hop around, with an occasional interruption of the forward leap in three out of four century years, while it gently recedes along the Earth’s orbit over a 26000 year period.

Jan 1st is a moving place!

Welcome once again to Jan 1st my co-travelers in this cosmic merry-go-round, and may our next round be a jolly good one 🙂

Happy New Year!

What is the role of the entrepreneur?

Humans evolved as multi-skilled hunter-gatherers who fend for themselves – born entrepreneurs!

However, an “entrepreneur” is now generally portrayed as a job creator – nothing wrong with that: but instead of making an army of drones, what if, by sharing opportunity and knowledge, a network of entrepreneurship is encouraged?

This is happening right now: distributed monetization platforms including app stores, blogging, video streaming, e-commerce & “sharing economy” (e.g., Airbnb) platforms are all leading a silent revolution where millions of people are taking back control of their livelihood doing what they love without the confines of a stereotyped job.

The pleasures of entrepreneurship are no longer esoteric! And little wonder the people behind these networks are often considered the ‘super-entrepreneurs’ of today.

Traditional business institutions also ought to consider evolving in this direction by allowing employees – and customers – to move beyond defined roles and encouraging creativity and initiative at all levels.

This will improve job satisfaction and the sense of meaning and fulfillment to those who have given up their true nature to be a part of the enterprise.

And finally, to answer the question, the true role of an entrepreneur is democratizing entrepreneurship.


… Two vast and trunkless legs of stone
Stand in the desert. . . . Near them, on the sand,
Half sunk a shattered visage lies

And on the pedestal, these words appear:

‘My name is Ozymandias, King of Kings;
Look on my Works, ye Mighty, and despair!’

Nothing beside remains. Round the decay
Of that colossal Wreck, boundless and bare
The lone and level sands stretch far away.

– Shelly

The meaninglessness of human achievement.. humbling yet emancipating. Our efforts may be insignificant, yet they are precious, as their transience is guaranteed in the cosmic scale of time.

​”It’s not about you” 

In the movie adoption of Marvel’s Dr Strange, at a time of conflict and crisis, a mystic guru reveals to the doctor: “It’s not about you”. 

It is portrayed as the moment of realisation when the egomaniacal hero comes to terms with the true nature and depth of his mission.

Comics and movies aside, this is a stirring concept: your life really is about the impact you have on other people. May be a handful, may be millions – whatever. 

In the end, your life is “not about you”.

8 new planets found in ‘Goldilocks zone’, NASA may find Earth’s ‘twin’ very soon

Dark Matter Space


(Click Image To download)

NASA is closer than ever to finding a twin for the Earth, astronomers said today, announcing the discovery of eight new planets that circle in the habitable zones of their stars.

Two of the eight are the most Earth-like of any known planets found so far outside our solar system, astronomers told the 225th meeting of the American Astronomical Society in Seattle, Washington.

The pair are likely to have hard, rocky surfaces in addition to being an orbiting distance from their stars that is neither too hot nor too cold for water and possibly life to exist, astronomers said. The discovery doubles the number of known planets that are close in size to the Earth and believed to be in the so-called “Goldilocks zone” of the stars they orbit.


Representational image. AFP

“We are now closer than we have ever been to finding a twin for…

View original post 179 more words

The 2 pm Plane

Imagine a plane flying constantly (solar powered, maybe) above the Earth, from East to West, with a velocity equal and opposite to the Earth’s rotation, taking 24 hours to complete one round trip.

twoppSuppose this flight starts today at 2pm.

Now, can we conclude that the position of the sun in the sky for those in the plane will be fixed and thus the time inside will always be 2pm, as long this flight is maintained?

The question is: What about the date? Will it change or will it just remain the same?

My take on it is, the concept of a day is no longer valid under these conditions, and therefore date becomes arbitrary and can no longer be measured by those inside the plane. It has to be communicated from outside – that is, from the surface. The same must hold true for any observer who leaves the Earth’s surface and its rotational frame of reference that gives us our hours and days!

A Theory of Money

Sometime ago, I happened to read Adam Smith’s master piece on economics the “Wealth of Nations”.  (At least most of the first half!)

One of the central concepts in the book is that “Labour is the first price” – that all value, wealth and money are ultimately derived from, and are thus based upon, human effort or labour. This really impressed me at the time of reading.

But later, on trying to apply this concepts to various situations, there seemed to perhaps be some deficiencies in this argument. Take the software industry for instance – where the initial effort gets multiplied so many times in terms of value.

So what really is money?
So what really is money?

As a real world example, for instance, how did Bill Gates with Microsoft become the richest man in the world? Certainly not by doing the most labour – but probably by making its value reach millions of people all over the world.

So it is not just labour, though labour is definitely required.  The first price could in fact be something else.  And trying to answer that is what this post is about.


The word pain here stands for a need, a lacking, an unfulfilled wish or desire.  This creates the opportunity for value.  If everybody had everything they wanted, and were thus in a state of ultimate bliss, who would need anything?

Examples of such “pain” include:

  • I can’t find information easily: Relieved by Google search -> a business with enormous value
  • I can’t stay in touch with my old friends: Relieved by Whatsapp, Facebook -> valued in billions
  • I am bored: The entire entertainment industry – movies, music, even resorts, tours & theme parks
  • I am hungry, thirsty, need to look good, feel sick etc, etc, etc

Can’t any product or business in some way be linked to relieving some kind of pain?

So pain creates an opportunity – and what relieves it will be perceived to be of value – something people will be willing to “pay” for. The perceived value should logically be more or less proportionate to the amount of pain relieved – both in terms of quantity and quality.

And further,  when more people get access to the product or service, its value will naturally get multiplied.

So the value of a product, service or business can be expressed as:

Pain relieved per person x number of persons whose pain gets relieved

So to answer the Bill Gate’s question, the products and services of Microsoft – Windows, Office etc must have relieved a lot of pain for a lot of people around the world, who were thus willing to “pay” for it.

The moral of all this could perhaps be summarized like this:

The way for a person or organization to become more valuable is to find a way to relieve some kind of “pain” for people – the more pain, and the more people, the better.  

A good place to get inspired in this regard is one’s own life – what are the pains perceived, and are they being relived by existing products or services? If not, a great opportunity for generating value has no doubt been found!

There is also an “evil” corollary: by generating pain, an unscrupulous person or business could actually create an opportunity which can then be exploited. Several examples of this do come to mind!

So to conclude, perhaps “pain” can be considered as the first price. Labour, through generating products and services that relieve pain, does indeed generate value – not because of the labour per-se but from the pain it relieves. This also explains why this value can be amplified, several fold, with the help of technology.

Thoughts on Neuroscience, Technology and Spirituality