To see our website at full performance please update your browser or use other modern browsers such as Chrome, Firefox or Opera.
 
 

Alexa, tell me what to wear today.

An AI service that understands how human beings subjectively experience weather conditions, and can advise you what to wear.

Recently, I moved to a wonderful city called A Coruña, to work in MOBGEN:Lab’s department of Applied Artificial Intelligence. Beautiful city, great office, amazing colleagues, delicious food…there is only one thing that is not-so-great about the city, the weather. It’s pretty unpredictable.

My faulty ability to predict the weather resulted in me getting caught in the rain without an umbrella, almost freezing on my way to work, or overheating in my warm clothes on a sunny day.

As a developer and keen problem solver, this was certainly something that needed solving, even if it were just to scratch my own itch. Hence, for my first project in the Lab, I decided to develop a weather AI service. Not just a service that tells you what weather it is, but one that actually tells you how to dress for it. Whether or not you might want to bring an umbrella that day, or wear an extra layer of clothing. This way, I wouldn’t have to try and figure out what to wear every morning.

I went ahead and identified the technologies needed to bring the AI service to life: the interface, the intelligence and the needed data sets and computing power.

Alexa image from Andres Urena

The interface: Amazon Alexa

As the service only requires one command, a phone-app seemed like overkill. Using a voice UI would be the perfect option, as users can quickly say one command, while preparing to go outside, and then adjust their clothing based on the system’s response. For that reason, I decided to create a Skill for Amazon Alexa. Simple, easy, and intuitive.

The intelligence: neural networks

The core of this service would be a neural network: the brain behind it all. The role of the neural network is to translate analytical weather data into subjective experiences that can be interpreted by a human.

Neural networks are mathematical constructs that act similarly to a brain: thousands of neurons that are interconnected in different layers, that have the ability to learn. Neural networks can be taught to solve a large array of tasks. However, applying neural networks to solve real-world problems can get a little tricky for two reasons:

Neural networks only accept numeric input, and can only return numeric input. Therefore, the first challenge of working with neural networks is to turn your “human problem” into numbers.

The second challenge is, in order to train a neural network, you need data. A lot of data. This requires you to create a strong infrastructure with high levels of computing power and memory, in order to process all that data. Hence, I decided to use AWS cloud as it has great computing power and is easily scalable.

AI image from Alex Knight

Teaching a neural network how to interpret the weather like a human being

The way humans interpret weather is very subjective: each person can feel cold at a large range of temperatures. Factors such as the amount of sunlight, humidity or even the date can influence the subjective feeling of coldness. Therefore, to tackle the weather problem, a neural network is used to learn and to understand how human beings interpret weather subjectively.

The neural network is provided with a range of different weather data, including: temperature, weather code (raining, cloudy, etc.), cloud percentage, rain volume and wind speed. Then, the numeric results, or the ‘output’ from the neural network, need to be translated into sentences that can be understood by humans.

Each result provided by the neural network has a level of confidence, which denotes the certainty of the given result. Let’s take for example, a situation in which rain is predicted. If the result has a high confidence level, the recommendation is translated to “you must take an umbrella today, because it will rain a lot”. However, a low confidence level is translated to “you may need an umbrella today”, leaving it up to the user whether or not to take the risk of getting wet.

Additionally, the AI service stores the last recommendation that was given to the user. The next day, the service can ask the user if the latest recommendation was correct. Based on the user’s response, it learns and improves on its recommendations. This way, each piece of feedback given by any user, can improve the service and create a better system for all. This is similar to a crowdsourced experience, that is also provided by large players such as YouTube, Amazon and Netflix when they recommend products to their users.

Never getting to work soaked from the rain

Since I created the service, I ask my Alexa for today’s recommendation every day. The days of arriving to work soaked from the rain or sweating from the sun are long gone. This made me appreciate the power of applied neural networks more than I ever did before. We can use neural networks to improve people’s lives, even if it’s for a seemingly simple aspect of daily life, such as weather accessory recommendations. The commute to work has never been so easy.

 

Article written by Felipe Vieira.