Email the Author

You can use this page to email Matthijs Hollemans about Core ML Survival Guide.

Please include an email address so the author can respond to your query

This message will be sent to Matthijs Hollemans

This site is protected by reCAPTCHA and the Google  Privacy Policy and  Terms of Service apply.

About the Book

IMPORTANT: I will not be updating this book to the new features introduced with iOS 15 and macOS 12. Those new features are welcome improvements but they also make most of this book irrelevant. That being said, if you are targeting older versions of iOS or macOS, or you cannot use the new mlpackage format or the new ML Program models for some reason, the Core ML Survival Guide will still be useful. Thanks to all the readers for supporting this book over the years!

---

Last updated for iOS 14, macOS Big Sur, and coremltools 4.

Core ML has made it easier than ever to add machine learning to your iOS and macOS apps. Drag-and-drop an mlmodel file into your Xcode project, literally write two lines of code, and you’re done!

There are lots of tutorials that show how to get started with Core ML, but they only cover the very basics.

  • What if you want to do something more advanced?
  • What if you run into problems?
  • Where do you get Core ML models to begin with anyway?

Core ML may appear easy-to-use at first — but if you want to go beyond the basics, the learning curve suddenly becomes very steep. My goal with this book is to make the advanced features of Core ML accessible to everyone too.

I do machine learning on mobile for a living and I’ve been working with Core ML since it first came out. Every time I ran into a problem, I put the solution into a notes file. From posts on Stack Overflow, the Apple Developer Forums, and emails I receive from readers of my blog, it’s clear that other people are running into the same problems. So I collected my notes, cleaned them up, and put them into this book.

The Core ML Survival Guide contains pretty much everything I know about Core ML. With this book I hope to save you some time from having to figure out this stuff by yourself.

What you’ll learn:

  • How to best convert your models to Core ML. One of the biggest showstoppers happens right at the beginning: you’ve trained a model but the Core ML conversion fails. This book explains what to pay attention to when you’re training your models, and how you can convert troublesome models to Core ML anyway by writing your own converter. 
  • The mlmodel file format and what Core ML’s possibilities and limitations are. Understanding the internals of mlmodel files is useful to verify the model conversion was successful — but also for knowing how to design and train your models in the first place.
  • Model surgery. Lots of advice on how to fix problems with your mlmodel files and how to get the leanest — and fastest — Core ML models.
  • Tips for running the app on the device. It’s pretty easy to make predictions with Core ML once you have a model, but there are still some gotchas to watch out for. For example, you’ll want to verify the model really does what you expect it to! Also: how to make effective use of the new Neural Engine.
  • Working with CVPixelBuffer and MLMultiArray. When your model does more than just classification, you’ll need to understand how to read and write MLMultiArray objects. This part of the book shows effective methods for making MLMultiArray do what you want.
  • Advanced topics: Custom layers, custom models, building pipelines, working with video, using sequences, dynamic graphs, on-device training of models, and much more!

This book has 80+ chapters and is packed with tips and tricks. As I learn more about Core ML myself, I’ll keep updating the book so you’ll always have access to the most up-to-date knowledge about Core ML.

If Core ML is giving you trouble — or if you want to make the most out your Core ML models — then the Core ML Survival Guide is for you!

P.S. Also check out the chapter MobileNetV2 + SSDLite with Core ML on my blog to get a taste of what's in the book.

The source code for this book is available on GitHub.


About the Author

Matthijs Hollemans’s avatar Matthijs Hollemans

@mhollemans

Matthijs Hollemans is a professional audio programmer. In his spare time he's a hobbyist musician who really needs to learn how to play the piano properly. Matthijs wrote the best-selling book The iOS Apprentice and is a co-author of Machine Learning by Tutorials from Kodeco (formerly raywenderlich.com). Check out his audio development blog at audiodev.blog.

Logo white 96 67 2x

Publish Early, Publish Often

  • Path
  • There are many paths, but the one you're on right now on Leanpub is:
  • Coreml-survival-guide › Email Author › New
    • READERS
    • Newsletters
    • Weekly Sale
    • Monthly Sale
    • Store
    • Home
    • Redeem a Token
    • Search
    • Support
    • Leanpub FAQ
    • Leanpub Author FAQ
    • Search our Help Center
    • How to Contact Us
    • FRONTMATTER PODCAST
    • Featured Episode
    • Episode List
    • MEMBERSHIPS
    • Reader Memberships
    • Department Reader Memberships
    • Author Memberships
    • Your Membership
    • COMPANY
    • About
    • About Leanpub
    • Blog
    • Contact
    • Press
    • Essays
    • AI Services
    • Imagine a world...
    • Manifesto
    • More
    • Partner Program
    • Causes
    • Accessibility
    • AUTHORS
    • Write and Publish on Leanpub
    • Create a Book
    • Create a Bundle
    • Create a Course
    • Create a Track
    • Testimonials
    • Why Leanpub
    • Services
    • TranslateAI
    • TranslateWord
    • TranslateEPUB
    • PublishWord
    • Publish on Amazon
    • CourseAI
    • GlobalAuthor
    • Marketing Packages
    • IndexAI
    • Author Newsletter
    • The Leanpub Author Update
    • Author Support
    • Author Help Center
    • Leanpub Authors Forum
    • The Leanpub Manual
    • Supported Languages
    • The LFM Manual
    • Markua Manual
    • API Docs
    • Organizations
    • Learn More
    • Sign Up
    • LEGAL
    • Terms of Service
    • Copyright Policy
    • Privacy Policy
    • Refund Policy

*   *   *

Leanpub is copyright © 2010-2025 Ruboss Technology Corp.
All rights reserved.

This site is protected by reCAPTCHA
and the Google  Privacy Policy and  Terms of Service apply.

Leanpub requires cookies in order to provide you the best experience. Dismiss