In this lab, you create a convolutional neural network (CNN) to classify speech commands. Oracle Cloud Infrastructure (OCI) Data Science service will be used to perform data preparation, and model training. An Oracle Function is used to deploy the model.
The demo follows these steps:
- You explore the audio data and the data transformations that are applied before training the neural network.
- You train a convolutional neural network (CNN) model using Keras.
- You test the create an Oracle Function endpoint and deploy a model to it. You then call this endpoint and assess the inferred value from the model.
Throughout this lab, you use the Speech Commands Dataset (Warden 2018). The raw data can be download using the instructions in notebooks/1-intro-to-audio-data.ipynb
. This obtains the data from a publicly accessible OCI Object Storage bucket. This data is just a copy of the original data.
The pre-processing of the data can be time-consuming. Alternatively, you can use the pre-processed and transformed dataset data/processed_data.pkl
. This is the data set that is used in the notebook notebooks/2-cnn-model-with-keras.ipynb
to train the model.
The notebook makes connections to other OCI resources. This is done using resource principals. If you have not configured your tenancy to use resource principals then you can do so using the instructions that are here. Alternatively, you can use API keys. The preferred method for authentication is resource principals.
Your notebook needs internet access.
- Open a Data Science Notebook session (i.e. JupyterLab).
- Open a file terminal by clicking on File -> New -> Terminal.
- In the terminal run the following commands:
odsc conda install -s mlcpuv1
to install the General Machine Learning for CPUs conda.conda activate /home/datascience/conda/mlcpuv1
to activate the conda.pip install oci
to install the OCI Python SDK.
- Copy the
notebooks
folder into the notebook session. - Copy the
data
folder into the notebook session. - Open the notebook
notebooks/1-intro-to-audio-data.ipynb
. - Change the notebook kernel to
Python [conda env:mlcpuv1]
. - Read the notebook and execute each cell.
- Open the notebook
notebooks/2-cnn-model-with-keras.ipynb
. - Change the notebook kernel to
Python [conda env:mlcpuv1]
. - Read the notebook and execute each cell.
- Open the notebook
notebooks/3-testing-model-deployment.ipynb
. - Change the notebook kernel to
Python [conda env:mlcpuv1]
. - Read the notebook and execute each cell.