This tutorial shows how to design convolutional neural network with Neural Network Modeler (part of Watson Studio), train it using GPU cluster, deploy and finally make part of an iOS sample application.
- Watson Studio with deep learning capabilities
- Xcode 9
-
In Watson Studio project add new Modeler flow. Import this sample flow for hand written digits recognition (MNIST) using
From file
option. -
Upload train/test/validate data sets to your Cloud Object Storage. Data sets can be found here.
-
Open
Image Data
node details and specify you COS details (with uploaded files). -
Publish Training Definition
using up-arrow button (top right corner of flow editor). -
Click
train it in an experiment
link to switch to experiment studio.
- Define experiment details such as:
- name
- select COS with training data
- select existing training definition (the one publish from the flow editor) and compute plan
-
Trigger model training process by pressing
Create and run
button. -
You can monitor your training progress by clicking the training run name and next in run details
Logs
tab. -
When training is completed you can store trained model in repository by choosing from Action menu
Store model
(Completed runs section).
-
Open stored model details (click on model name under Models section).
-
In
Deployments
tab(+) Add Deployment
-
Select deployment type as
virtual
and format asCore ML
-
Specify the following parameters:
image_input_names
with value'input1'
image_scale
with value0,003921568627451
- Create Deployment
-
In deployment details you can find
download_url
that allows to get Core ML content of Deployment. Download the Core ML model. -
Clone the following sample application swift project from github.
-
Open Go-Digits.xcodeproj in Xcode 9.
-
Add Core ML model to the project. Rename it to
mnistCNN.mlmodel
-
Next build application and run it on a device or simulator with iOS 11.