天天看點

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玩玩. 未完待續.....

繼續閱讀