ããã°ãã¼ã¿ã¨ãã®æ©æ¢°å¦ç¿éçã®èæ¯ã«ããæèãããã®æ ãæã¨ãªãã³ã³ãã¥ã¼ã¿ã®å¦çæ§è½ããèãã¦ããã¢ãã¤ã«ããã¤ã¹åãOSã¨æ©æ¢°å¦ç¿ãç´ä»ãã¦èãããã¨ããããã¨ã¯ãããããã¾ãçããããããªãã»ã»ã»ã¨ã¯æãã®ã§ããããã¯ã長くiOSだけにコミットしてきた身ã¨ãã¦ã¯ã新たに興味を持っているæ©æ¢°å¦ç¿ã¨ããåéã¨ãåæç¥ã£ããiOSã¨ããåéã®äº¤å·®ç¹ã¯ãªãã®ããªã¨èããã«ã¯ããããªãããã§ãã¦ãã
ãããªããã§ããiOS ã¨æ©æ¢°å¦ç¿ãã«ã¤ãã¦éå¤ãªåãå£ãã調ã¹ã¦ã¿ã¾ããã
iOSã§ä½¿ããæ©æ¢°å¦ç¿ã©ã¤ãã©ãª
DeepBeliefSDK
ã³ã³ããªã¥ã¼ã·ã§ãã«ãã¥ã¼ã©ã«ãããã¯ã¼ã¯ãç¨ããç»åèªèã©ã¤ãã©ãªãiOSã¨ãã®ã¢ãã¤ã«ããã¤ã¹ã§å¦çã§ãããããé«åº¦ã«æé©åãã¦ãããOpenCVã¨ä¸ç·ã«ä½¿ãã®ãç°¡åãã¨ã®ãã¨ã
ä½ã¯ã¨ããã SimpleExample ã¨ãããµã³ãã«å®è¡ãããã
é ¼ãã§ããªãã®ã«ãããªããã¼ããã½ã³ã³ãèªèãã¾ããï¼ãããï¼
SimpleExample ã®ã½ã¼ã¹ãè¦ã¦ã¿ãã¨ããã¬ã¼ã æ¯ã«å¾ããããã¯ã»ã«ãããã¡ã®å¦çã¯ãããªæãã§ããã
- (void)runCNNOnFrame: (CVPixelBufferRef) pixelBuffer { assert(pixelBuffer != NULL); OSType sourcePixelFormat = CVPixelBufferGetPixelFormatType( pixelBuffer ); int doReverseChannels; if ( kCVPixelFormatType_32ARGB == sourcePixelFormat ) { doReverseChannels = 1; } else if ( kCVPixelFormatType_32BGRA == sourcePixelFormat ) { doReverseChannels = 0; } else { assert(false); // Unknown source format } const int sourceRowBytes = (int)CVPixelBufferGetBytesPerRow( pixelBuffer ); const int width = (int)CVPixelBufferGetWidth( pixelBuffer ); const int fullHeight = (int)CVPixelBufferGetHeight( pixelBuffer ); CVPixelBufferLockBaseAddress( pixelBuffer, 0 ); unsigned char* sourceBaseAddr = CVPixelBufferGetBaseAddress( pixelBuffer ); int height; unsigned char* sourceStartAddr; if (fullHeight <= width) { height = fullHeight; sourceStartAddr = sourceBaseAddr; } else { height = width; const int marginY = ((fullHeight - width) / 2); sourceStartAddr = (sourceBaseAddr + (marginY * sourceRowBytes)); } void* cnnInput = jpcnn_create_image_buffer_from_uint8_data(sourceStartAddr, width, height, 4, sourceRowBytes, doReverseChannels, 1); float* predictions; int predictionsLength; char** predictionsLabels; int predictionsLabelsLength; struct timeval start; gettimeofday(&start, NULL); jpcnn_classify_image(network, cnnInput, JPCNN_RANDOM_SAMPLE, 0, &predictions, &predictionsLength, &predictionsLabels, &predictionsLabelsLength); struct timeval end; gettimeofday(&end, NULL); const long seconds = end.tv_sec-- start.tv_sec; const long useconds = end.tv_usec - start.tv_usec; const float duration = ((seconds) * 1000 + useconds/1000.0) + 0.5; NSLog(@"Took %f ms", duration); jpcnn_destroy_image_buffer(cnnInput); NSMutableDictionary* newValues = [NSMutableDictionary dictionary]; for (int index = 0; index < predictionsLength; index += 1) { const float predictionValue = predictions[index]; if (predictionValue > 0.05f) { char* label = predictionsLabels[index % predictionsLabelsLength]; NSString* labelObject = [NSString stringWithCString: label]; NSNumber* valueObject = [NSNumber numberWithFloat: predictionValue]; [newValues setObject: valueObject forKey: labelObject]; } } dispatch_async(dispatch_get_main_queue(), ^(void) { [self setPredictionValues: newValues]; }); }
ã»ã»ã»ã¨æ±ºãã¦ã·ã³ãã«ã¨ã¯è¨ãé£ãã§ãããããã§è¡ã£ã¦ããåé¡å¦çã®ã³ã¢ã¯ã
jpcnn_classify_image(network, cnnInput, JPCNN_RANDOM_SAMPLE, 0, &predictions, &predictionsLength, &predictionsLabels, &predictionsLabelsLength);
ãã®1è¡ã«ããã®ããªã¨ãã§ããã¨ã¯ãããã¡ã¾ããã®è«¸ã ã¨ããå¾ãããçµæã®å¦çã¨ãã
ãããããããªã®ã§ãã¾ãå¥ã®æ©ä¼ã«ã¡ããã¨è¦ã¦ã¿ããã¨æãã¾ãã
ML4iOS
iOSã§ã®æ©æ¢°å¦ç¿ãè¡ãããã®ãªã¼ãã³ã½ã¼ã¹ã©ã¤ãã©ãªãã©ã¤ã»ã³ã¹ã¯ Apache License, Version 2.0 ã
ã³ãããå±¥æ´ãè¦ãã¨ã3å¹´åï¼2012å¹´1æï¼ãããããã¤ãæè¿ãæ´æ°ããã¦ãã¾ãã
LearnKit
iOS, OS X åãæ©æ¢°å¦ç¿ãã¬ã¼ã ã¯ã¼ã¯ãã¨ã®ãã¨ã
ãµãã¼ããã¦ããã¢ã«ã´ãªãºã
- Anomaly Detection
- Collaborative Filtering
- Decision Trees
- k-Means
- k-Nearest Neighbors
- Linear Regression
- Logistic Regression
- Naive Bayes
- Neural Networks
- Principal Component Analysis
READMEã«ä¸è¨ã®ãããªãµã³ãã«ã³ã¼ãè¼ã£ã¦ãã®ã§ãä»åº¦è©¦ãã
LNKNeuralNetClassifier *classifier = [[LNKNeuralNetClassifier alloc] initWithMatrix:matrix implementationType:LNKImplementationTypeAccelerate optimizationAlgorithm:algorithm classes:[LNKClasses withRange:NSMakeRange(1, 10)]];
[classifier train]; LNKClass *someDigit = [classifier predictValueForFeatureVector:someImage length:someImageLength];
使ãããããã
mlpack-ios
mlpack ã Objective-C ããã¸ã§ã¯ãã«ãªã³ã¯ã§ããããã«ãããã®ãã¨ã®ãã¨ã
mlpack ã¨ããã®ã¯ãã¹ã±ã¼ã©ãã«ãªC++æ©æ¢°å¦ç¿ã©ã¤ãã©ãªããããã
Swift-Brain
Swiftã§æ¸ããã人工ç¥è½ï¼æ©æ¢°å¦ç¿ã©ã¤ãã©ãªããã¤ãºçè«ããã¥ã¼ã©ã«ãããã¯ã¼ã¯ããã®ä»AIãå®è£ ããã¦ããã¨ã®ãã¨ã
- Matrices
- Matrix operations
- Machine Learning algorithms
- Basic Regressions
- Neural Networks
- Support Vector Machines
- Bayesian Classifiers
- Self Organized Maps (maybe?)
- Clustering
- Statistics
- Bayes Theorem/Naive Classifier
- Kalman Filter
- Markov Model
å¦ç¿çµæãiOSã§å©ç¨
ãæ©æ¢°å¦ç¿ã«ãã£ã¦å¾ãããã¢ãã«çãiOSã§å©ç¨ãããã±ã¼ã¹ã§ãã
åé ã§ããiOSã¨æ©æ¢°å¦ç¿ãçµã³ã¤ãã¦èããã®ã¯ãã¾ãçããããããªããã¨æ¸ãã¾ãããããã®ã±ã¼ã¹ã§ã¯å¦ç¿èªä½ã¯iOSããã¤ã¹ã§ã¯ãªãããã¯ã¨ã³ãï¼ã¨ãã表ç¾ãæ£ãããã¯ä¸æï¼ã§è¡ãã®ã§ãè³æ¥µçã£å½ãã¨ãããçéãã¨ã
ç»åèªè
OpenCV for iOS ã«æ©æ¢°å¦ç¿ã§ä½æããã¢ãã«ï¼åé¡å¨ï¼ã®xmlãã¡ã¤ã«ãã¢ããªã«æãããã°ã人ã®é¡ä»¥å¤ã«ãããããªãã®ãèªèã§ãã¾ãããã¨ããè¨äºã
åé¡å¨èªä½ã¯ãã©ãããã©ã¼ã ä¾åã§ã¯ãªãã®ã§ãiOSã¨ããéå®ãå¤ãã°ããªãè²ã ã¨ãã¥ã¼ããªã¢ã«è¨äºã¨ãã¢ãã«é å¸è¨äºãã§ã¦ãã¾ãã
æåèªè
iOS ã§ä½¿ãã OCR ã©ã¤ãã©ãªã
æ©æ¢°å¦ç¿ã§ç²¾åº¦ãåä¸ãããããæ¥æ¬èªãè¦ãããããã
åèï¼画像からのテキスト抽出:tesseract-ocr - Qiita
é³å£°èªè
ãããã話ã§ããã°ãåæ§ã«ãiOSç¨ã®é³å£°èªèã¨ã³ã¸ã³ãå¦ç¿ãã¼ã¿ãç¨æãã¦ã¢ãã«ãèªä½ãããã¨ãã§ãã¾ãã
OpenEars 㯠PocketSphinx (CMU Sphinx) ã¨ããã«ã¼ãã®ã¼ã¡ãã³å¤§å¦ã«ãããªã¼ãã³ã½ã¼ã¹èªèã¨ã³ã¸ã³ã®ã©ããã¼ã©ã¤ãã©ãªã§ãããç¨ã®é³é¿ã¢ãã«ãèªä½ãããã¨ã¯ã§ãã¾ãï¼ã¨ããæ¡ä»¶ã§è©¦ãããã¨ããï¼ã
å½ç£ã®ã大èªå½é£ç¶é³å£°èªèã¨ã³ã¸ã³ Juliusãï¼iOSã§å©ç¨å¯è½ï¼ãããã¡ããå¦ç¿ã«ããã¢ãã«ãèªä½ã§ãã¾ãã
å®ä¾é
ã¹ãã¢ã«åºã¦ããã¢ããªãªã©ã
Deep Belief by Jetpac - teach your phone to recognize any object
ä¸ã§ãç´¹ä»ãããDeepBeliefSDKã使ã£ãã¢ããªã
ãã®ã¢ããªã§ãã³ãèªèãããã¢åç»ã
Deep Learning
ãã£ã¼ãã©ã¼ãã³ã°ã§ç»åãåé¡ããã¢ããªã
Summly
2011å¹´12æã¨ãã¡ãã£ã¨å¤ãè¨äºã§ãããSummlyã¨ãããã¦ã§ãã®ã³ã³ãã³ããç®æ¡æ¸ãã¨ãã¼ã¯ã¼ãã®ä¸è¦§ã«è¦ç´ãããã¢ããªã®ãã¥ã¼ã¹è¨äºã
ã¾ãã¯ãç¹å¥ãªã¢ã«ã´ãªãºã ã§HTMLå¦çã使ã£ã¦ãã¦ã§ããã¼ã¸ããããã¹ããæãåºããã¨ããå§ã¾ãããã®ããã¹ããåæãã¦ãè¨äºããé¸ã³åºããããå縮ãããé¨åããç®æ¡æ¸ãã§åãåºããSummlyã®ã¢ã«ã´ãªãºã ã¯ãããã¤ãã®æ©æ¢°å¦ç¿ã®ææ³ã¨ãéºä¼çãã¢ã«ã´ãªãºã ââé²åãã¾ããçºè¦çæ¢ç´¢æ³ââãå©ç¨ãã¦ãããè¡ã£ã¦ããã
ããã¤ã¸ãªæ°ã®ã¢ã«ã´ãªãºã ã¯ããã¾ãã¾ãªåºç社ã«ãããããããªã¿ã¤ãã®è¨äºã®ã人éã«ããè¦ç´ã調æ»ãããããã¦ãããã®è¦ç´ããSummlyãåãåºãã¹ããã®ããæ å ±ãã¥ã¬ã¼ã·ã§ã³ãè¡ã人éã®ä»äºããã¾ãçä¼¼ãããã®ãã¡ããªã¯ã¹[尺度]ã調æ´ããéã®ã¢ãã«ã¨ãã¦æ´»ç¨ããã
ãã®å¾ Yahoo! ã«è²·åãããYahoo!ã®ãã¥ã¼ã¹è¦ç´ã¨ãã¼ã½ãã©ã¤ãºè¡¨ç¤ºãåç»ãç»åæ¤ç´¢æ©è½çã«ãã®æè¡ãç¨ãããã¦ããã¨ã®ãã¨ã
Plant Recognition: Bringing Deep Learning to iOS
ãã£ã¼ãã©ã¼ãã³ã°ã§æ¤ç©ãèªèãããã¨ããè«æã
ãããã«
iOS ã¨æ©æ¢°å¦ç¿ã絡ãããä»äºããå¾ ã¡ãã¦ããã¾ãï¼