skip to Main Content

The Ultimate Beginner’s Guide to Building AI in the Digital Enterprise

First — let me say, after two days in Palo Alto talking to technology titans, but also just overhearing conversations in coffee shops and great Burmese restaurants, all everyone is talking about is AI.

HanaHaus innovation / meeting space in Palo Alto

I recently spoke at a tech conference in Barcelona on the topic of intelligent apps and practical ways for regular people (i.e. no Ph.D required) to get started on AI. This conversation generated an overwhelming interest in ways to get started in digital enterprises across the globe. In fact I just returned from an innovation meeting in London with a forward-thinking Fortune 500 company to plan just that. I thought though, instead of me flying personally to every large enterprise each week, I’ll just share my thoughts in this blog!

Let’s start with an example.

A Machine Learning App for: Age, Gender, and Sentiment Analysis

link

Me: Before having 3 kids

(imagine me taking a photo live on the stage)

And after…

 

You’ll notice that in 6 years, I have somehow become actually 8.3% less male, aged two decades, and … well.

So what happened here?

Using AI models running on my phone, these algorithms were trained to spot patterns resulting in these predictions. Basically the program was able to figure out a photo’s characteristics, without me being specifically programmed with if/else statements the desired outcome. Or:

We got the machine to do something without explicitly programming it to do that thing

Artificial Intelligence or AI is a pretty generic term that encompasses a whole category of technologies. There is artificial general intelligence which is the magic that makes WestWorld fun (but is also pretty far out there). And there is more discrete AI which is confined to a particular scenario that can be trained. Within this last camp you have Machine Learning (or ML) which is the most practical for usage in the enterprise — we’re basically just teaching the machine to figure things out by giving it a lot of examples. There are better descriptions out there, like Wikipedia,  if you want to learn what machine learning is all about. But this guide, is for people that want to actually start, not just read about it. I hope you find it useful.

5 Key Steps to AI for Beginners

  1. Use existing API’s
  2. Use a model that is already trained
  3. Train a model from existing public data sets
  4. Build your own data, then use wizards
  5. (okay, after this it gets harder)

1. Use existing APIs

So this is really the big secret. In most of the intelligent apps that we build we simply use an existing API on the internet that is already trained. Basically all of the major tech companies have done the hard work for you. These are either free for limited use, or very inexpensive. Here are my favorites to get started:

Just a note, the AWS celebrity spotter is pretty fun: https://console.aws.amazon.com/rekognition/home?region=us-east-1#

Which celebrity do you look like? (Gérarde Vives?)

2. Use a model that is already trained

A model is what you get, after you have chosen algorithm and run through a ton of training data. It’s sort of the finished product, just waiting for a place to run and evaluate new data. Some (very kind) people have taken well known models, packaged them up, and made these available for download. You can than simply insert these into XCode for an iOS app, or into a Python server for TensorFlow.

CoreML (Apple): https://developer.apple.com/machine-learning/

TensorFlow (Google): https://github.com/tensorflow/models

3. Train a model from existing data

When you talk to most people working on AI, the most difficult part is finding a lot of data, and cleaning up that data to make it useful. Luckily, in many many cases this is already done too! Many of the top research institutes and universities have published this data with full sets. For example, in this UCI ML repository, there are data sets for road elevations, body movement calculations, income calculation, sign language, blog feedback, and 400+ more.

UCI Machine Learning Repository: https://archive.ics.uci.edu/ml/index.php <- 417 data sets

OpenML Data search: https://www.openml.org/search?type=data <- 2505 data sets

Wikipedia: https://en.wikipedia.org/wiki/List_of_datasets_for_machine_learning_research <- (a lot)

4. Build your own data, then use wizards

In cases where there is no API, no existing models, and no existing data, you’re very likely forced to build your own data set and start there. Yikes. But what do you do with that data, how do you choose an algorithm, load data into programs and begin the training regimen? And then once you have a model, how do you access it in the future to make new predictions? Luckily, there are now wizards for this! Just upload your Excel spreadsheet, and out comes an API.

For example, I was recently working on an app for calendar analytics. Basically “Where has all of my time gone?”. I wanted to optimize my calendar and increase efficiency. So what I did was exported my full Google Calendar for the last 5 years into a Google Sheet, and then spent 20-30 hours labeling every single event (about 15,000).

From there you can simply upload your spreadsheet to Amazon’s machine learning services and after a few simple questions it outputs you a model and you can click one button to turn that into an API: https://docs.aws.amazon.com/machine-learning/latest/dg/creating-ml-model-on-the-amazon-ml-console.html

After about 20 minutes, I had it all up and running. I then was able to add this API into my XCode app, and now all calendar entries automatically get assigned a category (Fitness, Commute, Work, Eating, Hanging Out, Chores, etc.) based off of calendar attributes (time of day, subject, body, attendees, type of attendees, etc.)

Here is the final product:

AI

5. (okay after that, it gets harder)

If you get to the point now where none of the above was sufficient, things get a bit harder. You should probably know or learn Python, get to know the key algorithms, TensorFlow and a lot of math! :)

But I thought I would still share one thing I enjoyed.

Try out the Google tutorial on TensorFlow (TensorFlow is probably the most popular library / kit / tool set for ML): https://www.tensorflow.org/tutorials/image_recognition

This tutorial walks you through the basics of getting data, loading up Python, selecting an algorithm, and training a model. Ultimately you will get a model output that you can use.

This particular example uses image recognition to identify digits (a very common example).

You’ll end up with something like this:

AI

From here, you can build a Cloud Foundry project from this model. This blog explains all the heavy lifting: https://www.skiptag.de/how-to-run-a-trained-tensorflow-model-on-cloud-foundry/

Being the good SAP partner that I am, what better cloud to run this on than SAP Cloud Platform! So I used the Python engine, loaded up a suitable environment and pushed my project there.

It’s a little bit hard to see in the screen shot, but you can see I’m using POSTman to test a post to SAP’s cloud with the number 3 drawn out, and it outputs the correct recommendation:

AI

Conclusion

I hope after reading this you immediately go out and incorporate AI into one of your digital enterprise applications. I also hope that after reading this, you realize that in fact this technology is very accessible, and that you don’t need to have a PhD. in mathematics to still make incredible use of it.

Please let me know any questions in this blog below in comments or find me on twitter @gavinpquinn

 

Back To Top