Mobile app and artificial intelligence: how does it work?

Mobile app and artificial intelligence: how does it work?

Mobile app and artificial intelligence: how does it work?

Editorial

Editorial

8min

8min

Michael Peyrot

Technical Consulting Director

Meet Mickaël Peyrot - Technical Consulting Director

Michael Peyrot

Technical Consulting Director

Meet Mickaël Peyrot - Technical Consulting Director

Michael Peyrot

Technical Consulting Director

Meet Mickaël Peyrot - Technical Consulting Director

You can now offer mobile apps with Artificial Intelligence.

By incorporating various technologies, software, and hardware into its latest iPhone and iOS 11, available since September 2017 to hundreds of millions of users, Apple enables businesses to integrate Artificial Intelligence into their apps, provided they know how to select and train the offered predictive models. Insign looks back on these solutions and guides you through it.

↳ Artificial Intelligence: Where do we stand?

Let's clear up a few truths right away. We can't speak of actual Artificial Intelligence (strong AI) anytime soon. Journalistic fantasies and the marketing hype from companies claiming otherwise are, at best, misleading, if not downright false.
It's more accurate to discuss algorithms created by humans.

“The evolution will be about making machines think, and that's something I don't know how to do,” says Luc Julia (the creator of Siri).

Artificial Intelligence is a legitimate scientific subject, vast and already established. Strongly linked to mathematics (Cédric Villani oversees this topic for France), it quickly becomes technically challenging.

Nonetheless, some areas of Artificial Intelligence are becoming more accessible, such as Machine Learning.

Apple has recently made solutions available in iPhones and iPads to democratize its use. But what for and how?

↳ What is machine learning on smartphones?

Machine Learning is neither fortune-telling nor prophecy. Under this term lie scientific methods that rely on mathematical models, sometimes borrowed from biology. These algorithms analyze data to perform identifications and classifications.
This topic is trending, yet these algorithms have been known for several decades, and you already experience them in your daily life:

  • Estimating the price of a house based on its features on a real estate site;

  • Calculating accident risk and your insurance rates;

  • Filtering out spam emails from your software or provider.

What’s changing rapidly is the extension of these processes to new data (texts, audio, photos, location, video, IoT sensors) and the availability of immense storage and computing power to offer new, less vertical, and less "industrial" uses.
This available computing power (in the Cloud and with decreasing costs) and the abundance of data enhance the capacities and precision of a model for:

  • Defining the content of an image on the web or taken with your smartphone: distinguishing (dog or cat), identifying (café or restaurant), classifying (number, order, maps)... For us at Insign, it's the possibility on an e-commerce site to upload any photo to buy the clothes, for example;

  • Determining the risk of machine failure based on external parameters (weather, events, users, ...); very useful now with the rise of connected objects to embody your services to your clients;

  • Predicting the next word on a keyboard based on context (interlocutor and relationship history, measured emotion, ...).
    The novelty is that Apple (and Google with a different approach) provides businesses with a Machine Learning solution embedded on smartphones.
    And in this field, we see several particularly interesting usage angles of Machine Learning to follow as they are “accessible” for you.
    Beyond visual and voice recognition, the added value of Machine Learning within an app might be found in Context Aware Computing (all messages—whether audio, video, photo, textual—are adapted in real-time to the interlocutor, location, timing, context,... based on “learned” rules).
    It's about adapting a service to a whole series of environmental data: the user's known historical data, but also the clothes they wear, their face, emotions, location, temperature, surrounding people, previous actions,... All these data must first be modeled to provide the algorithm with a baseline for recognition and choosing the best response.
    Product catalog navigation: assisted search, trend selection, promotional targeting, predictive mobile downloads, image display sorting, cross and up-selling product recommendations no longer rely on business rules but rather on the observation of each customer’s usage.

↳ CoreML: The machine learning technology on iOS

Behind the name CoreML is an Apple software kit designed for optimized execution of algorithms based on Machine Learning models.

Calculations and data storage are performed on the smartphone. This allows for rapid processing time without server connection and will certainly add value to your services amidst concerns over personal data protection.

The realm of possibilities, served in the Cloud, has birthed a universal matrix that allows local analysis and rapid classification without needing a connection to massively transfer data.

Depending on the targeted applications, Apple offers the use of different types of Machine Learning models. Some are supported by default, while others can be imported.

Insign adopts the “Best of breed” approach to select the most suitable and efficient algorithm for the need.


Model type Supported models Applications Scripts Neural networks Convolutional, recurrent Image recognition, natural language processing, recommendation systems (e.g., music) Caffe v1
Keras 1.2.2+ Tree ensembles Random forests, boosted trees, decision trees Detecting population sensitivity to an offer scikit-learn 0.18
XGBoost 0.6 Support vector machines Scalar regression, multiclass classification
Categorization, classification (images), shape recognition scikit-learn 0.18
LIBSVM 3.22 Generalized linear models Linear regression, logistic regression Personalized price estimation
Detecting "Churn" scikit-learn 0.18 Feature engineering Sparse vectorization, dense vectorization, categorical processing Product design by extending an existing one scikit-learn 0.18 Pipeline models   Sequentially chained models scikit-learn 0.18


The use of existing models reduces development time. Apple offers tools to convert models for CoreML, and the models are reusable elsewhere within the company. Some ready-to-use models are also available, including for object detection in images, for instance.

Another novelty, these developments aren’t reserved for mobile developers; they’re designed in languages accessible to a broader audience (like Python or C++): therefore, developers working on websites, business apps, statistical models, ... can work with these models.

However, it is necessary to harness two other pillars of Machine Learning that Apple or Google can't offer you: humans (to set goals & parameters) and data (to train the models).

Insign assists you in identifying the improvements Machine Learning can bring to your business through an audit of your existing setup and a Data Strategy recommendation integrating model training with your data: "Train Your Model".

↳ Machine learning requires a learning phase

For a machine to make decisions, it must learn...

This technology works as follows: from "known" data, the model is trained through iterations. With each iteration, the quality of the forecasts obtained is tested (on a "control" data set). If the forecast error is significant, certain parameters of the algorithm are varied. The iterations stop when the forecast error no longer decreases, and the model is implemented in production; the machine has learned patterns and can very effectively detect similar cases.


To date, few methods allow algorithms to autonomously re-parameterize themselves later (except for Reinforcement ML which automatically determines the ideal behavior in a specific context). Regularly enriching the model's training is therefore needed; the log analysis we conduct allows this to happen.

Autonomous learning is not yet a reality. Most bots offered today “off-the-shelf” are based on pre-programmed questions.

Insign supports you in learning your algorithms because if your brand participates in conversations (conversational business), it's up to you to manage this content production.

 

Perspective

Perspective

Perspective