Artificial intelligence

Building and deploying a serverless AI model


In this article I will demonstrate the workflow for creating an AI model from scratch and then deploy it serverless in the cloud. It will be slightly technical but the amount of code is quite small. I will show you all the steps required to go from an EDA (Exploratory Data Analysis) on Google Colab to serving a deployed AI model with AWS Lambda and Google Cloud Functions.

Follow the link below to read more:

Building and deploying a serverless AI model

Artificial intelligence

AI use cases for images and automation


In this article I will discuss AI solutions based on images, automation and the value of non-perfect models. I will include some important considerations for your AI projects, how to think and what to focus on both regarding effort and ethics. I will use a few different use cases to illustrate my points and hopefully this will get your inspirational juices flowing.

Follow the link below to read more:

AI use cases for images and automation

Artificial intelligence

Anomaly detection overview


Anomaly detection is the notion of automatically looking at data and finding outliers, i.e. data points that do not fit in well with the rest of the dataset. Finding an outlier is usually a sign that something exceptional has happened that should trigger further investigations or actions. Anomaly detection can be performed on existing historical datasets e.g. when you are pre-processing your AI training data. It can also be used on a real time data stream from your business transactions or sensor readings to almost instantly flag a data point as anomalous. This is a great example of AI automating things that a human can do and with a glance at a graph see a problem.
In this article Torbjörn will discuss anomaly detection from a few different perspectives and with this new tool under your belt you will start to look at the world with different eyes!

Follow the link below to read more about Torbjörn’s blog

Anomaly detection overview

Artificial intelligence

AI shows what an avocado armchair looks like


OpenAI is an AI research company. They are probably most famous for their language model GPT-2 that allegedly was “too dangerous to be shared”. They soon released an even better model, GPT-3. This latest model was then used as the basis for training an AI called DALL-E to generate images from textual descriptions.
Using text-image pairs as a training dataset this model is able to combine unrelated concepts into plausible images of things that never actually existed.

Follow the link below to read more about Torbjörn’s blog

AI shows what an avocado armchair looks like

Artificial intelligence

Time series classification use cases


A time series is an ordered sequence of numbers over time. For certain problems you want to look at a specific time series and from its characteristics be able to say something clever about it. Perhaps its origin or about some feature of the source.
This is a class of problems called time series classification that Torbjörn will discuss in this article, and when you start looking for them they pop up absolutely everywhere!

Follow the link below to read more about Torbjön’s blog

Time series classification use cases

Artificial intelligence

AWS Lookout for Vision goes GA


A few days ago AWS announced General Availability for their service Lookout for Vision. This is an AI service that provides image based anomaly detection in manufacturing using computer vision. With basically no need for AI knowledge this service can be quickly implemented in your manufacturing process to detect product anomalies and defects at a low cost.
Torbjörn will also describe a cool real-world use case for this service!

Follow the link below to read more about Torbjön’s blog

AWS Lookout for Vision goes GA

Artificial intelligence

Simple AI with Google BigQuery


In this post Torbjörn will discuss two different AI use cases built around the AI capabilities provided by Google BigQuery ML.
This is a quick and easy way to get started with your AI projects, especially if you are already using Google Cloud. The first use case is a time series forecasting problem where we want to predict some monthly tracked cost 12 months ahead. The second use case is a variation of the first one where we basically want to predict the same cost for just the next month but based on historical events.

Follow the link below to read more about Torbjön’s blog

Simple AI with Google BigQuery

Artificial intelligence

How can AI help you with Product recommendations


Product recommendations is something most people have seen. Some of the most known examples are Netflix movie recommendations and Amazon product recommendations. Entire companies have this as their core offering – helping other companies do it better. But with a little help from AI, doing this well has now become much easier than before. Many companies also have or are planning to incorporate this into their marketing or selling strategies. And for obvious reasons. Showing attractive additional products or packages is often a good way to increase sales.

Traditionally this has been a purely statistical or analytical operation: “on the web page for product X, recommend things that product X buyers also bought”. This is a nice and simple way to start if you have never done recommendations before. But if you wanted to apply AI to this problem – could you? The not so surprising answer is “you could and you should”! As always you want to collect lots of examples to train your AI including things like this:

  • Current product name (on the current web page)
  • Current product price
  • Visitor total time on website
  • Pages visited before current page
  • Geographical location of visitor
  • Total visitor purchase history

With this information the AI will be able to learn the best additional product suggestions for each main product.

Why do this

When your customers have found something that they want, why not help them to find valuable and useful extra products? This could be a great service for your customers that set you apart from your competition. Of course this is by no means an act of altruism – since you will sell more and make more money. So it is a win-win situation!

How do I get started

A good way to get started with this is to pick out some high-volume products. Because the volumes are high you can set up A/B-testing which means that for some customers you show recommendations and for the others you don’t. You now have a way to compare the impact of the recommendations. You also limit the effort required to collect data and train the AI, and you will only affect a part of your business (“small blast radius”). Due to the law of large numbers you can have higher confidence in the results than if your product sells only a small number of items, since as the number of purchases grows the observed effect gets closer and closer to the “truth”.

This could be a rather big project depending on your internal-IT and general IT-maturity. But if you just want to “get it out there” there is a shortcut.

The fast way to get started is just a few steps away:

  • Find the data
  • Train and deploy your model
  • Insert some code in your product webpage
  • Done.

This is such a standardized service that almost all major cloud providers offers this via API integrations, here are a few:

  • AWS Personalize
  • Google Recommendations AI

If you want to learn more about AI please visit: praktisk.ai

Artificial intelligence

How can AI help you with Location Optimization


Does your company from time to time need to find the optimal geographical location for something? Perhaps you need to find the best spot for a new store, storage facility, windmill or food truck? To solve this we can use either of two different methods. But first we need to collect a number of location examples. The more examples we have the better the AI will be able to understand what we want it to learn. For each location we need to add as much data as we can find, like:

  • Average outside foot traffic
  • Proximity to highway
  • Windy days per year
  • Number of people working in the area
  • Day of week

If we treat this as a “classification” problem we also need to label every location as “good” or “bad”. We then train the AI on this data. Now we can show the AI new locations and it will tell us (classify) if it considers a particular location to be “good” or “bad”. Pretty neat.

Sometimes the good vs bad classification is not fine grained enough. Then we can treat this as a “regression” problem instead (meaning the AI will predict a number for us). To do this we need to assign a number instead of a label to each location. So a top location could be a 10, a bad location 1, and others somewhere in the middle. We train the AI and it will now be able to give us a number for new locations we show it. This way we are able to rank a list of possible new locations. Even neater!

Why do this

If you need to choose between several possible locations, why would you not want to pick the best one? Of course you want the one you hope will be attracting the most foot traffic, take the least time to drive a truck to, or generate the most electricity. As in many use cases us humans normally have a hunch, but there are too many interacting variables to know for sure. This is where the AI can shine and help us out with its opinion about something based on the examples we have trained it on. So this is a perfect way to make sure your company maximizes its revenue!

How do I get started

You probably have a list of potential locations you are choosing from as well as the example data you want to base your decision on. You need to enrich each item on this combined list with the data you want the AI to consider. This could mean that you have to dig into external data sources, maybe you have to buy statistical data or weather reports, or even just perform lots of web searches. You can even add images of the neighbourhood as input data about a location! Remember, the more relevant data you have, the better the AI’s predictions.

For a retail store chain, here are some example data points to collect:

  • Distance to nearest city center
  • Distance to nearest highway
  • Number of people living within 5 km from location
  • Store size
  • List of all departments in the store

Now when you train an AI with this data perhaps it will find the relationship that “big store, close to highway and has many departments” will be rated as 8. But perhaps it will also find that “small store, close to city center with many people living nearby” is a 10.

For a food truck here are some example data points to collect:

  • Street
  • People working in the area
  • People living in the area
  • Day of week
  • Day of month
  • Season
  • Today’s special was X

This might reveal that “on tuesdays in the summer” going to Street A will always be your best choice.

Remember that you yourself have rated the examples, so the AI will put a higher valuation on the things you have shown it to be more valuable. Hopefully this gives you a better material on which to base your final decision.

If you want to learn more about AI please visit: praktisk.ai