Commit c5e774a3 authored by Oliver Kirsebom's avatar Oliver Kirsebom
Browse files

minor corrections to the notebook

parent 9822a94c
......@@ -11,9 +11,11 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"In this tutorial we will be using a pre-trained deep neural network to detect upcalls made by the North Atlantic right whale (NARW). The model was trained on a data set collected in the Gulf of Saint Lawrence. It consisted of approximately 6000 spectrograms, each 3s long. About half of the clips contained an upcall. These calls are characterized by an upsweep frequency from about 50 Hz to 350 Hz and a duration of about 1 second. The remaining clips did not contain upcalls, but could potentially have other sounds in addition to the ever present ambient background.\n",
"In this tutorial we will be using a pre-trained deep neural network to detect upcalls made by the North Atlantic right whale (NARW). The model was trained on audio recordings from the Gulf of Saint Lawrence. The training dataset consisted of approximately 6000 spectrograms, each of 3 seconds duration and covering the frequency range 0--500 Hz, with about half of the spectrograms containing an upcall. These calls are characterized by an upsweep frequency from about 50 Hz to 350 Hz and a duration of about 1 second.\n",
"\n",
"The model is based on a ResNet architecture. We'll start by using this pre-trained binary classifier and using it as a detector on a 30 min long file. Time permitting, we will also go over the training steps and pre-processing steps. Below you see an example of a NARW upcall recorded by DFO scientists in the Emerald Basin off the coast of Nova Scotia a few years ago. Superimposed on the upcall you also see broadband impulsive noise from nearby pile driving, which makes the detection of the upcall more challenging.\n",
"The model is based on a ResNet architecture. We will start by loading this pre-trained binary classifier and using it as a detector on a 30-minute long audio file. Time permitting, we will also go over the data pre-processing steps and training steps. \n",
"\n",
"Below you see an example of a NARW upcall recorded by DFO scientists in the Emerald Basin off the coast of Nova Scotia a few years ago. Superimposed on the upcall you also see broadband impulsive noise from nearby pile driving, which makes the detection of the upcall more challenging.\n",
"\n",
"![Example of NARW upcall](assets/upcall_example_dfo.png)"
]
......@@ -26,7 +28,7 @@
"<a id='main_menu'></a>\n",
"The tutorial is organized as follows,\n",
"\n",
"### Part I: Detection\n",
"### Part I: Loading and using the pre-trained model\n",
"\n",
" 1. [Import python modules](#step_1)\n",
" 2. [Load pre-trained neural network](#step_2)\n",
......@@ -34,18 +36,18 @@
" 4. [Obtain classification for a single spectrogram](#step_4)\n",
" 5. [Run the model through a 30 min file](#step_5)\n",
" \n",
"### Part II: TRAINING\n",
"\n",
" 6. [Select ResNet architecture](#step_6)\n",
" 7. [Configure batch generator](#step_7)\n",
" 8. [Train the network](#step_8)\n",
" \n",
"### Part III: DATA WRANGLING AND PRE-PROCESSING\n",
"### Part II: Building the training data set\n",
"\n",
" 9. [Load and view annotations](#step_9)\n",
" 10. [Load audio data](#step_10)\n",
" 11. [Compute magnitude spectrogram](#step_11)\n",
" 12. [Store data in database](#step_12)"
" 12. [Store data in database](#step_12)\n",
" \n",
"### Part III: Training the model\n",
"\n",
" 6. [Select ResNet architecture](#step_6)\n",
" 7. [Configure batch generator](#step_7)\n",
" 8. [Train the network](#step_8)"
]
},
{
......@@ -53,11 +55,11 @@
"metadata": {},
"source": [
"***\n",
"# Part I: Detection\n",
"# Part I: Loading and using the pre-trained model\n",
"\n",
"We will use a pre-trained ketos model to build a detector. The model is based on a ResNet and was trained as a binary classifier to distinguis 3 seconds spectrograms containing a NARW upcall from those containing only background noise.\n",
"We will use a pre-trained ketos model to build a NARW upcall detector. The model is based on a ResNet and was trained as a binary classifier to distinguish those spectrograms that contain a NARW upcall from those that only contain background noise. As stated at the beginning, the spectrograms are 3 s long and cover the frequency range 0-500 Hz.\n",
"\n",
"Below is a diagram of the model architecture.\n",
"Below is a diagram of the ResNet architecture.\n",
"\n",
"![model Architecture](assets/architecture.png)"
]
......@@ -74,13 +76,12 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"We start by importing what we'll use thoughout the session.\n",
"These include the the ResNet implementation in Ketos and several useful functions/classes for handling spectrograms"
"We start by importing what we will use throughout the session. This includes the the ResNet implementation in Ketos and several useful functions/classes for handling spectrograms."
]
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
......@@ -89,8 +90,7 @@
"from ketos.data_handling.data_handling import SpecProvider\n",
"from tqdm import tqdm\n",
"import numpy as np\n",
"import pandas as pd\n",
"\n"
"import pandas as pd"
]
},
{
......@@ -105,12 +105,12 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Ketos models are packaged in .kt files. These contain the model weights and also the a recipe to build the the model. In addition to the model file, we need to specify a folder that will be created and used to store any changes to the model. This is not actually relevant in our case because we won't retrain it."
"Ketos models are packaged in .kt files. These contain the model weights and also the a recipe to build the the model. In addition to the model file, we need to specify a folder that will be created and used to store any changes to the model. This is not actually relevant in our case because we will not be retraining the model."
]
},
{
"cell_type": "code",
"execution_count": 43,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
......@@ -2029,7 +2029,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
"version": "3.5.2"
}
},
"nbformat": 4,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment