days
-6
-7
hours
-1
0
minutes
-4
-8
seconds
-1
-4
search
Training AI services in the cloud

AI as smart services for everyone

Rainer Stropek
© Shutterstock.com / studiostoks

If you cannot or do not want to build an AI project from scratch, you have countless choices of ready-made services. But what can you do if the finished services do not fit the project? Customizable AI and ML models in the cloud, which you can train with your own data, provide a remedy.

Artificial intelligence (AI) and Machine Learning (ML) inspire the imagination of many SaaS providers. Wouldn’t it be nice if we could replace complicated input masks with an easy-to-use bot? Why do we still have to type in the travel expense receipt? A photo with a smart AI in the background can do that. In practice, teams trying to do this encounter a lot of problems. First of all, in many cases, there is a lack of relevant development experience. Finished AI services such as Cognitive Services from Microsoft promise a remedy. Instead of having to laboriously develop everything from scratch, you get easily consumable web APIs with usage-dependent costs. Is this the fast lane to the AI future for typical SaaS projects?

Ready-made AI has a limited value

The first step to answering this question begins with the availability of data. Admittedly, there are AI services like Microsoft’s Text Analytics and Computer Vision or Google’s Cloud Vision API which are completely finished. For example, to recognize the language of a text with Text Analytics, you need neither training data nor an understanding of machine learning. If you can send a text to a web API, you’re ready to go. For some applications, this may be enough as an introduction (e.g. assigning a support case to a team member who speaks the right language). In most cases, however, this isn’t enough. AI and machine learning only have real added value if they are adapted to a specific application.

Customizable AI services

If there is no ready-made AI service, that doesn’t mean that you have to do everything from scratch with libraries like TensorFlow or Microsoft Cognitive Toolkit (CNTK). There‘s a middle way: Customizable AI and ML models that you can train with your own data. Here are two examples from Microsoft’s product portfolio:

  • With the Custom Vision Service (currently as a preview) you can keyword images according to an individual logic. Instead of writing the algorithm by hand or creating a deep learning model from scratch, training data is provided in the form of correctly tagged images. They are used to train a basic model provided by Microsoft. The result is an individualized model with a Web API which can be used to index new images (prediction). With this service, it is even possible to export the trained model to run it locally.
  • The Language Understanding Service (LUIS) helps to process language. If a user formulates a request in a natural language, then it‘s not easy to recognize the user’s intention (e.g. to navigate, ordering a product, booking a trip, etc.) and any parameters (entity, e.g. travel destination, product name, date of trip) which are contained in the sentence. However, this ability is indispensable when programming a bot, for example. LUIS solves exactly this problem. Training data is made available in the form of sample sets (utterances) with correct assignment to intents and parameters (Fig. 1). The trained model can be deployed with a few clicks. The web API you get can be used directly or it can be linked to the Azure Bot Service to develop a bot.
Fig. 1: Microsoft LUIS

Fig. 1: Microsoft LUIS

Data is worth its weight in gold

These two examples show the fundamentally new approach of the “programming” of (semi)finished AI services, in comparison to the classical development of program libraries. Our role as developers is no longer to write an algorithm. We have to take care of the training data. This task is anything but trivial because the quality of the resulting deep learning model depends on the quality of the training data. If too little data is available or if the existing training data sets are incorrect, like incorrect keywords, of poor quality (for example poor image quality, photos are too similar, etc.) or not representative, meaning sample sets which no real user would ever use, then the result is useless. Additionally, just training data is not enough. More datasets are required so that the models can be tested.

SEE ALSO: Know your history — Machine learning makes some computers smarter-ish

Data is the new gold in the world of AI and ML. Prefabricated AI services in the cloud don’t change this – on the contrary. As a team that wants to enter this world, the first thing you have to ask yourself is how to get the data you need. It’s also this hurdle, which makes the market entry for start-ups so difficult. Established companies either have existing databases or can fall back on an existing community which can be motivated to test AI-based software components such as bots, give feedback and, thus, indirectly provide the necessary training data.

Iterative model development

The iterative model development is an important aspect in this sense. Customizable AI services such as the ones mentioned above contain ready-made components which can be used to check real operational data (for example, sentences that users have said about a bot or images that have been uploaded for tagging). It‘s easy to add the real data with correct metadata to the training set and thus improve the AI model step by step (Fig. 2), if classification errors are discovered.

Fig. 2: Indexing of an image in the Custom Vision Service

Fig. 2: Indexing of an image in the Custom Vision Service

In order for the iterative approach to work in practice, mechanisms must be in place to make the versioning, testing, and deployment of models simple and robust. Usually, AI services are available serverless. As a development team, you don’t have to worry in any way about the operation or scaling of the server. You can deploy the model with one click, differentiate between test and production environment, have a built-in version management, export the models to a source code management to archive it and much more (Fig. 3). The required time for administration and DevOps processes is reduced to a minimum by such functions.

Fig. 3: Deployment of a LUIS model

Fig. 3: Deployment of a LUIS model

APIs for meta programming

Another feature of AI services is important for SaaS providers: not only are all functions interactively available via a WebUI, but the exact same functions can also be automated via web APIs. When you develop your own multi-tenant SaaS solution, you often can’t lump all your end customers together. Every customer has slightly different requirements. The data models differ, workflows are customer-specific, master data is naturally different for each customer and much more. For example, if you want to offer each SaaS end customer an individual bot, the model must differ from customer to customer in order to achieve a high-quality result. The training data is different and in many cases, the models also differ structurally.

Through the APIs of AI services, it is possible for SaaS providers to practice meta-programming. This means that you write a program that is not used by the end customer, but that creates another program: in this case, an AI model using an AI service.

Challenges

It all sounds so very tempting, doesn’t it? AI and ML can be used in any project without any problems, even if there is no relevant prior knowledge and only a limited budget. This statement is basically correct, but there are some challenges to overcome in detail. The first one has already been briefly mentioned above: You need a lot of training good quality data. At the age of GDPR, this is not only a technical but also a legal hurdle. The second challenge is the risk of expecting more from the selected AI service than it can provide. As already mentioned, modern AI services offer the possibility to adapt the prefabricated models. But you can’t control all aspects. After all, it‘s precisely the strength of these services which reduces their complexity. Compared to classic SaaS and PaaS services of the cloud, however, evaluating AI services is a lot more difficult.

SEE ALSO: AI and machine learning in software development: Benefits for developers

Until now you could compare feature lists. This is no longer so easy with AI services. Suppose you want to develop a SaaS solution in which license plate recognition plays a role. Are Microsoft’s Computer Vision services suitable for this? Can you build a good solution with it, if you prepare the images for training and live operation? Would Google’s counterpart deliver better results? In my experience, these questions cannot be answered theoretically. You need to build prototypes or get help from people who have domain-specific experience with the selected AI services.

Conclusion

AI and ML projects are often adventures in which vast amounts of money and resources are used. Ready-made AI services in the cloud, which can be adapted to the respective domain, offer a shortcut in many cases and reduce the project risk. However, those who believe that such projects are trivial will be disappointed. Dealing with the data, automating the accompanying DevOps processes, evaluating the available AI services of various manufacturers and much more, force a serious examination of the topic. Otherwise, you will quickly get a result, but from the user’s point of view, it offers no real additional benefit.

Author
artificial intelligence

Rainer Stropek

Rainer Stropek has been an entrepreneur in the IT industry for more than twenty years. During this time, he founded and managed several IT service companies and is currently developing the award-winning Software time cockpit in his company software architects together with his team. Rainer holds degrees from the Technical College of MIS, Leonding (AT) and the University of Derby (UK). He is the author of several books and articles in magazines around Microsoft .NET and C#. His technical focus is on C# and the .NET framework, XAML, the Microsoft-Azure platform, SQL Server and Web development. Rainer regularly appears as a speaker and trainer at renowned conferences in Europe and the USA. In 2010, Rainer was named by Microsoft as one of the first MVPs for the Windows-Azure platform. Rainer has also been a Microsoft Regional Director since 2015.