Skip to main content

Machine Learning with Core ML

  • Chapter
  • First Online:
Image Processing and Computer Vision in iOS

Part of the book series: SpringerBriefs in Computer Science ((BRIEFSCOMPUTER))

Abstract

This chapter introduces the Core ML API and shows how it is now possible to use contemporary machine learning models to implement intelligent image analysis and computer vision solutions, such as object detection and recognition and scene classification. It introduces a few basic concepts in machine learning and deep learning, and shows how Core ML models can be used with the Vision Framework in an image analysis workflow.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    For more on the cat vs. dog classification problem in machine learning, check the associated Kaggle challenge [16].

  2. 2.

    This is known as the head-pose estimation problem; see [38] for a survey.

  3. 3.

    The scikit-learn algorithm cheat-sheet [8] provides a (highly simplified) flowchart to help beginners navigate the space of candidate ML algorithms for a given problem.

  4. 4.

    As I mentioned in Chap. 2, it is commonly said that the history of computer vision will be written in two volumes: (1) before deep learning (1950s–2012); and (2) after deep learning (2012–present).

  5. 5.

    An updatable model is a Core ML model that is marked as updatable. To learn more about how to modify an updatable Core ML model by running an update task with labeled data, see [19].

  6. 6.

    The version numbering of Core ML became rather confusing in recent years; when you see a reference to Core ML (without a number) it might be referring to the latest version [3].

References

  1. A simple demo for Core ML in Swift. https://bit.ly/2YrQMlx. Accessed: 2020-06-23.

  2. A Simple Game developed using Core ML. https://bit.ly/3fUICs2. Accessed: 2020-06-23.

  3. Apple machine learning in 2020: What’s new? https://bit.ly/2DPY5vu. (Accessed on 2020-07-18).

  4. Apple’s Core ML 2 vs. Google’s ML Kit: What’s the difference? https://bit.ly/3dsvx7x. Accessed: 2020-06-23.

  5. Awesome Core ML Models. https://bit.ly/316FDsh. Accessed: 2020-06-23.

  6. Awesome Core ML Models. https://bit.ly/2VajOUX. Accessed: 2020-06-23.

  7. Awesome Machine Learning. https://bit.ly/31aYJxa. Accessed: 2020-06-23.

  8. Choosing the right estimator—scikit-learn documentation. https://bit.ly/2Oh3u0B. Accessed: 2020-07-11.

  9. Core ML. https://apple.co/316Pf6h. Accessed: 2020-06-23.

  10. Core ML and Vision Tutorial: On-device training on iOS. https://bit.ly/37UaA4c. Accessed: 2020-06-23.

  11. Core ML Models—Apple Developer. https://apple.co/3gJiY9Q. Accessed: 2020-07-11.

  12. Core ML Tools. https://coremltools.readme.io/docs. (Accessed on 2020-07-17).

  13. Create ML. https://apple.co/2VekAQy. Accessed: 2020-06-23.

  14. Create ML: How to Train Your Own Machine Learning Model in Xcode 10. https://bit.ly/3eC4V4p. (Accessed on 2020-07-18).

  15. Creating an Image Classifier Model. https://apple.co/2B6ExBY. Accessed: 2020-06-23.

  16. Dogs vs. Cats—Kaggle. https://bit.ly/2V9EhJe. Accessed: 2020-06-23.

  17. Machine Learning Research at Apple. https://bit.ly/mlresearchapple. Accessed: 2020-06-23.

  18. Matthijs Hollemans—Blog. https://machinethink.net/blog/. Accessed: 2020-07-11.

  19. Personalizing a model with on-device updates. https://apple.co/2WxIYxb. (Accessed on 2020-07-18).

  20. Classifying Images with Vision and Core ML. https://apple.co/3fRVpeK, 2017. Accessed: 2020-06-23.

  21. Core ML API. https://apple.co/37XzZK8, 2018. Accessed: 2020-06-23.

  22. Integrating a Core ML Model into Your App. https://apple.co/2V8HVD9, 2018. Accessed: 2020-06-23.

  23. Machine Learning—Apple Developer. https://apple.co/3dniNyY, 2018. Accessed: 2020-06-23.

  24. VNCoreMLRequest: an image analysis request that uses a Core ML model to process images. https://apple.co/37WAmVw, 2018. Accessed: 2020-06-23.

  25. J. Brownlee. Machine learning books. https://bit.ly/2B4nksT. Accessed: 2020-06-23.

  26. L.-C. Chen, G. Papandreou, I. Kokkinos, K. Murphy, and A. L. Yuille. DeepLab: Semantic Image Segmentation with Deep Convolutional Nets, Atrous Convolution, and Fully Connected CRFs, 2016.

    Google Scholar 

  27. F. Chollet. Deep learning with Python. Manning Publications Co, Shelter Island, NY, 2018.

    Google Scholar 

  28. J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. ImageNet: A Large-Scale Hierarchical Image Database. In CVPR09, 2009.

    Google Scholar 

  29. M. Geldard. Practical artificial intelligence with Swift : from fundamental theory to development of AI-driven apps. O’Reilly Media, Sebastopol, CA, 2019.

    Google Scholar 

  30. I. Goodfellow, Y. Bengio, and A. Courville. Deep learning. MIT press, 2016.

    MATH  Google Scholar 

  31. K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. CoRR, abs/1512.03385, 2015.

    Google Scholar 

  32. M. Hollemans. iOS 11: Machine Learning for everyone. https://bit.ly/2YpyiCm. Accessed: 2020-06-23.

  33. F. N. Iandola, S. Han, M. W. Moskewicz, K. Ashraf, W. J. Dally, and K. Keutzer. Squeezenet: AlexNet-level accuracy with 50x fewer parameters and <0.5 MB model size. arXiv:1602.07360, 2016.

    Google Scholar 

  34. S. Kambampati. Introduction to Core ML: Building a Simple Image Recognition App. https://bit.ly/319FYdF. Accessed: 2020-06-23.

  35. A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pages 1097–1105, 2012.

    Google Scholar 

  36. I. Laina, C. Rupprecht, V. Belagiannis, F. Tombari, and N. Navab. Deeper depth prediction with fully convolutional residual networks, 2016.

    Google Scholar 

  37. Y. LeCun, Y. Bengio, and G. Hinton. Deep learning. Nature, 521(7553):436–444, 2015.

    Article  Google Scholar 

  38. E. Murphy-Chutorian and M. M. Trivedi. Head pose estimation in computer vision: a survey. IEEE Transactions on Pattern Analysis and Machine Intelligence, 31(4):607–626, 2009.

    Article  Google Scholar 

  39. G. Papandreou, T. Zhu, N. Kanazawa, A. Toshev, J. Tompson, C. Bregler, and K. Murphy. Towards Accurate Multi-person Pose Estimation in the Wild, 2017.

    Google Scholar 

  40. J. Redmon and A. Farhadi. YOLOv3: An Incremental Improvement, 2018.

    Google Scholar 

  41. S. Russell and P. Norvig. Artificial Intelligence: A Modern Approach. Prentice Hall Series in Artificial Intelligence. Prentice Hall, 2010.

    Google Scholar 

  42. M. Sandler, A. Howard, M. Zhu, A. Zhmoginov, and L.-C. Chen. Mobilenetv2: Inverted residuals and linear bottlenecks, 2018.

    Google Scholar 

  43. M. Sweet. Creating a Simple Game With Core ML in Swift 4. https://bit.ly/31bk0ak. Accessed: 2020-06-23.

  44. A. Tam. Beginning Machine Learning with Keras & Core ML. https://bit.ly/2YoUKvk. Accessed: 2020-06-23.

  45. P. Warden. Building Mobile Applications with TensorFlow. O’Reilly.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2020 The Author(s)

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Marques, O. (2020). Machine Learning with Core ML. In: Image Processing and Computer Vision in iOS. SpringerBriefs in Computer Science. Springer, Cham. https://doi.org/10.1007/978-3-030-54032-6_4

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-54032-6_4

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-54030-2

  • Online ISBN: 978-3-030-54032-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics