We’d like to enhance our apps with AI, but we have nobody who understands the neural nets, TensorFlows, Spark GPU clusters or the higher Σ-math involved. The good news is you don’t need to be a math or AI magician to have AI infused in your apps. Instead you’ll utilize either premade AI services, or standard machine learning algorithms to common business problems. This blog article helps you select the right flavor from the start, and effectively – prevents you from trying to reinvent the wheel.
I got first time interested in AI about two decades ago. Went to the local book store, picked up “Neural Net Fundamentals” university course book. After browsing for a while I dumped the book: Everything was explained with math equations, and that day I decided that AI was not meant for me. I did not return to the subject for a decade.
AI Flavors: Utilizers and Builders
The AI discussion often revolves over the technical nuts and bolts of the AI. How deep my neural network shoud be? What bias should I use? Why TensorFlow is much better than MS CNTK or any other option. Should I use Spark or Hadoop clusters to train my models? This discussion is relevant to those who build algorithms from scratch, which is roughly 5% of the AI utilization cases. The rest 95%? You reuse already invented methods.
There’s two kinds of AI (or machine learning if you prefer) workers out there:
- Algorithm builders, who build new or improved algorithms to solve problems which either had no existing or decently working solution. This is 5% of all cases, but seems to represent 95% of the public discussion.
- Algorithm utilizers, who use off-the-shelf, battle proven pre-trained models, algorithms or canned AI services to solve real life business scenarios. 95% of the AI cases fall into this category. Yours too.
Using existing algorithms to solve standard machine learning problems is relatively easy. An analogy would be picking the right tool for the job. If you want a hole in the wall, you choose power drill, not a nail polisher. If you want coffee, you don’t use washing machine. Your toolbox is filled with ready made AI services, pre-trained models and different machine learning algorithms, each suitable for solving certain kind of problem. In order to make coffee you don’t need to know what’s inside the coffee maker. You add water and coffee grind, and the magic happens. The same goes with algorithms. You need to know that if you want to separate cat images from dog images, you’d use a two class classifier algorithm to get the job done. Or, if you wanted to predict how much your house is worth, you pick a regression algorithm from your toolbox.
In reverse: If you don’t know the toolbox content, you easily end up building your own apparatus from scratch to make a hole on the wall. You need to learn how neural nets, naive bayesians, markov chains and TensorFlows work internally. Building and inventing new algorithms is difficult; Your job is only to utilize. Leave the algorithm design for giants like Microsoft, Google, and for the chinese white coat university doctors to do in their dark dungeons. All my respect to these hard workers, who make my life much easier.
Now, let’s take a closer look on the utilizers first.
Utilizers stand on the shoulders of giants, building their solutions on top of work by others. The most important skill for an utilizer is to know the toolbox: The canned AI services and standard machine learning algorithms available to solve standard business problems. For your convenience, below is an list of a few typical cases, which have perfectly working solution available, right off the machine learning algorithm shelf:
Classify items into two classes (which class this item belongs to)
- Is this an image of a cat or not? You can replace “cat” with anything like “broken powerline” or “pothole on the pavement”.
- Is this email spam or not?
- Has this image mature content or not?
Classify items in multiple classes ( = categorization)
- Is this IT support ticket about lost passwords, broken laptop, expired certificate or other?
- Is this article about news, sports, politics or business?
- Is this expense receipt about taxi, parking, hotel, entertainment or other costs?
- User said “I need a taxi now” to the chatbot. Does the user want to order taxi, cancel an existing taxi order, ask for taxi ETA, or nothing of the previous (classify the user input into predefined intents)
Predict numerical values with regression
- I sold 10 ice creams when temperature was +10°C, 15 ice creams at +15°C, and 20 at +20°C. How many ice creams I’ll sell if the temperature outside is tomorrow +25°C?
- I’m an used car salesperson, and I have an Audi A6 to sell. It has 250 000 kilometers in the hood, and it’s from 2007. Based on my company sales history, what price I should set for it to get it sold?
Find structure with clustering
- I have a library of documents on my storage. Can I find some kinds of groups in the mass of documents that would lead to meaningful categories?
- Based on my customer’s purchase history, what might my customer segments be?
- This guy has never used credit card in Russia, now there are multiple big value purchases during the day.
- This person has never bought diapers and baby food before, now there are 8 purchases on that category during last week.
- Car engine is running hotter than combination of outside temperature, rpm figures and oil pressure would historically suggest.
The utilizer picks a service or an algorithm from the toolbox to solve the problem. The rest is mechanical work. With canned AI services, you typically upload your training data like in this custom vision service, and then just start utilizing the service with REST api calls. On using the machine learning algorithms side, the workflow always goes like this:
- Get some good quality training data
- Split it into training and test material
- Choose the algorithm
- Train the model with the training data
- Evaluate the result with your test data.
- If predictions were good enough, publish the model for other applications to use.
- If not, either fine tune the algorithm in use, or try another algorithm that also fits this type of problem.
To help with the algorithm selection, newbie utilizers (like me) use “cheat sheets” like this. Using these gets you already to the right direction. When evaluating the training data quality and correlations the data may contain, it helps if you passed your high school stats math course (mean, median, deviation, correlation). A good utilizer also knows the limitations of the algorithm used; why, how and when the algorithm fails. And it will fail. First trial runs always give crappy results. Know your tool (the algorithm) and fine tune the parameters to compensate. Or use more and/or better quality data.
Next: When your problem does not fit the categories mentioned before…
The AI magicians are needed when you are building the “Japanese speaking flying chainsaw” (thank you Petri for this excellent analogy). The flying chainsaw represents anything that hasn’t been done before, or a standard working solution has not yet emerged. These guys know their TensorFlows, neural nets and the deep math stuff. Cloud computing clusters are used to train and test multiple models until construct that’s good enough is found. All this stuff is exciting I admit, but totally irrelevant to most of us just utilizing the inventions made by these magicians.
To reduce the myths, this is what typically happens in the deep dungeons:
- The magician makes an initial guess (hypothesis) that this kind of algorithm (or bunch of algorithms combined) might solve the problem at hand.
- They test the initial hypothesis. If the guess turns out a disaster from the start, go back to step one. Otherwise: Proceed.
- When you got something that resembles a viable solution, use massive computation power to train slightly different versions on the model with huge amounts of training data. Evaluate each of the models the computation produced. Basically you make the models “compete” with each other which one produces best results.
- When your time or budget is up, pick the current best, and you have your winning model.
A bit of an oversimplification, but you should get the general idea.
A new hope…
Drop that university “Neural Net Anatomy” textbook immediately. Ditch that TensorFlow manual. You don’t need those. Your AI needs can be solved with existing, battle tested algorithms, get yourself familiar with these. A person with some common sense, basic high school math and programming background can start exploring and utilizing AI in real world app development right away. Build on top of ready made solutions, use cheat sheets, pick up the suitable algorithm, implement the basic model creation workflow. After a few weeks of trial and error: Your intelligent app is up and running!
Links for the utilizers
- Master Algorithm book: If you just skip the main the topic here (the search for master algorithm), this is the best book containing math & programming free explanations on how each of the most common machine learning algorithms work + what are good at, and their limitations. A must read for every utilizer!
- MS Machine Learning Studio algorithm cheat sheet is an excellent help for selecting the algorithm
- Companion explanations of the MS Machine learning studio algorithms
- … and the Machine learning studio itself. A drag and drop kind of tool for building models, with huge library of examples. Free trials available!
- Microsoft Azure canned AI services as the fastest way to implement AI in your apps.