There are many domains where ML is an indispensable ingredient, some of them are robotics, bioinformatics, and recommender systems. While nothing prevents you from writing bioinformatic software in Swift for macOS or Linux, we will restrict our practical examples in this book to more mobile-friendly domains. The apparent reason for this is that currently, iOS remains the primary target platform for most of the programmers who use Swift on a day-to-day basis.
For the sake of convenience, we'll roughly divide all ML applications of interest for mobile developers into three plus one areas, according to the datatypes they deal with most commonly:
- Digital signal processing (sensor data, audio)
- Computer vision (images, video)
- Natural language processing (texts, speech)
- Other applications and datatypes
This category includes tasks where input data types are signals, time series, and audio. The sources of the data are sensors, HealthKit, microphone, wearable devices (for example, Apple Watch, or brain-computer interfaces), and IoT devices. Examples of ML problems here include:
- Motion sensor data classification for activity recognition
- Speech recognition and synthesis
- Music recognition and synthesis
- Biological signals (ECG, EEG, and hand tremor) analysis
We will build a motion recognition app in Chapter 3, K-Nearest Neighbors Classifier.
Everything related to images and videos falls into this category. We will develop some computer vision apps in Chapter 9, Convolutional Neural Networks. Examples of computer vision tasks are:
NLP is a branch of knowledge at the intersection of linguistics, computer science, and statistics. We'll talk about most common NLP techniques in Chapter 10, Natural Language Processing. Applications of NLP include the following:
- Automated translation, spelling, grammar, and style correction
- Sentiment analysis
- Spam detection/filtering
- Document categorization
- Chatbots and question answering systems
You can come up with many more applications that are hard to categorize. ML can be done on virtually any data if you have enough of it. Some peculiar data types are:
- Spatial data: GPS location (Chapter 4, K-MeansClustering), coordinates of UI objects and touches
- Tree-like structures: hierarchy of folders and files
- Network-like data: occurrences of people together in your photos, or hyperlinks between web pages
- Application logs and user in-app activity data (Chapter 5, Association Rule Learning)
- System data: free space disk, battery level, and similar
- Survey results