CoreML basics

Asked on 06/16/2025

1 search

Core ML is a framework that simplifies the integration of machine learning models into apps on Apple platforms. It allows developers to use models in the Core ML format, which includes a description of the model's inputs, outputs, architecture, and learned parameters. Core ML optimizes execution across the CPU, GPU, and neural engine, making it a powerful tool for deploying models on-device.

For those new to Core ML, the process typically involves:

  1. Model Preparation: Start with a trained model, often in a format like PyTorch or TensorFlow, and convert it to the Core ML format using Core ML Tools. This conversion process can include optimizations for on-device execution, such as operation fusion and model compression.

  2. Integration with Xcode: Once in the Core ML format, the model can be integrated into an app using Xcode. Xcode provides tools to inspect the model's characteristics, visualize its architecture, and generate a type-safe Swift interface for easy integration.

  3. Execution and Optimization: Core ML automatically optimizes model execution across available hardware resources. Developers can also use additional frameworks like Metal Performance Shaders (MPS) and BNNS Graph for more control over execution, especially in scenarios involving graphics workloads or real-time processing.

For more detailed information on Core ML and its capabilities, you can refer to the session Discover machine learning & AI frameworks on Apple platforms (11:15) from WWDC 2025.