Framework

Core ML

Integrate machine learning models into your app.

Overview

With Core ML, you can integrate machine learning models into your app.

Flow diagram going from left to right. Starting on the left is a Core ML model file icon. Next, in the center is the Core ML framework icon, and on the right is a generic app icon, labeled "your app".

A model is the result of applying a machine learning algorithm to a set of training data. You can use a model to make predictions based on new input data. For example, a model trained on a region’s historical house prices may be able to predict a house’s price when given the number of bedrooms and bathrooms.

You can train a model with Create ML. Alternatively, you can use a wide variety of other machine learning libraries and then use Core ML Tools to convert the model into the Core ML format. Core ML also allows you to retrain or fine-tune an existing model on-device with MLUpdateTask, keeping your users’ data private and secure.

Core ML is the foundation for domain-specific frameworks and functionality. Core ML supports Vision for image analysis, Natural Language for natural language processing, and GameplayKit for evaluating learned decision trees. Core ML itself builds on top of low-level primitives like Accelerate and BNNS, as well as Metal Performance Shaders.

A block diagram of the machine learning stack. The top most layer is a single block labeled "your app", which spans the entire with of the block diagram. The second layer has three blocks labeled "Vision", "Natural Language", and "Gameplay Kit". The third layer down is the Core ML block, which spans the entire width. The fourth and final layer has two blocks labeled "Accelerate and BNNS", and "Metal Performance Shaders".

Core ML is optimized for on-device performance, which minimizes its memory footprint and power consumption. Running strictly on the device ensures the privacy of user data and guarantees that your app remains functional and responsive when a network connection is unavailable.

Topics

First Steps

Getting a Core ML Model

Obtain a Core ML model to use in your app.

Integrating a Core ML Model into Your App

Add a simple model to an app, pass input data to the model, and process the model’s predictions.

Converting Trained Models to Core ML

Convert trained models created with third-party machine learning tools to the Core ML model format.

Computer Vision

Classifying Images with Vision and Core ML

Preprocess photos using the Vision framework and classify them with a Core ML model.

App Size Management

Reducing the Size of Your Core ML App

Reduce the storage used by the Core ML model inside your app bundle.

Core ML API

Core ML API

Use the Core ML API directly to support custom workflows and advanced use cases.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software