天天看点

iOS11新特性 之 Core ML [机器学习]

<a href="https://developer.apple.com/documentation/coreml#topics">https://developer.apple.com/documentation/coreml#topics</a>

iOS11新特性 之 Core ML [机器学习]

是的,iphone上将会出现大批的app在客户端本地跑机器学习、深度学习的model。其实prisma, dji-go内部都有一些机器学习引擎,内置一些神经网络模型。只是现在,苹果粑粑也要来参赛了。

苹果说core ml 支持很多种模型,神经网络、集成学习、svm、广义线性模型。苹果自己也提供了四个模型,都是经典, googlenet是ilsvrc 2014的冠军,22 层卷积神经网络构成的模型,google出品。cnn 架构——残差网络,微软出品,imagenet 竞赛时达到了 3.57% 的误差率。vgg network,牛津大学出品,ilsvr(imagenet)2014的冠军。

iOS11新特性 之 Core ML [机器学习]

虽然vgg16模型的500多m大小对移动开发看起来很吓人,可以用googlenet嘛。以后客户端跑本地模型,大势所趋...想象空间好大。

不过,第三方支持有限:

modeltype

supported models

supported tools

neural networks

feedforward, convolutional, recurrent

caffe keras 1.2.2

tree ensembles

random forests,boosted trees, decision trees

scikit-learn 0.18 xgboost 0.6

support vector machines

scalar regression, multiclass classification

scikit-learn 0.18 libsvm 3.22

generalized linear models

linear regression, logistic regression

scikit-learn 0.18

feature engineering

sparse vectorization, dense vectorization, categorical processing

pipeline models

sequentially chained models

[如何在客户端本地集成core ml model](

<a href="https://developer.apple.com/documentation/coreml/integrating_a_core_ml_model_into_your_app)">https://developer.apple.com/documentation/coreml/integrating_a_core_ml_model_into_your_app)</a>

苹果提供了一个小demo,run起来看比较简单啦, 加载本地的model,只有3个feature,来预测火星探测器的价格。feature很少,模型也是逻辑回归,内存和cpu都没啥压力。

iOS11新特性 之 Core ML [机器学习]

run完的交互ui,选完特征,输出价格:

iOS11新特性 之 Core ML [机器学习]

重点关注代码:

iOS11新特性 之 Core ML [机器学习]

vision 看起来更6了。看看它的api。

<a href="https://developer.apple.com/documentation/vision">https://developer.apple.com/documentation/vision</a>

图像识别、跟踪 (想想另一个刚出来的 arkit中的跟踪是传感器跟踪,陀螺仪啦,陀螺仪跟踪消耗小容易跟丢,图像跟踪性能有挑战但更准);用于机器学习的图像特征提取、分类;文本识别;二维码检测和识别都来了。。。

core ml 号称特为移动设备做过性能优化。周末有空拿复杂的几个model和vision玩玩. 未完待续.....

继续阅读