Skip to content
Ally Rice edited this page Apr 3, 2023 · 1 revision

Bm-Bcall-Detector

Description

What: Automatic detector for blue whale B calls.

How: Matches spectrograms of the sound recording in Triton to a template spectrogram of a blue whale call, called the kernel. This template consists of the frequency at five time points from the third harmonic of a typical blue whale B call. The kernel must be updated within and between years.

Why: Blue whale B calls are very stereotyped calls, making them ideally suited for spectrogram correlation. Automatic detection is much faster than manual logging and precision/recall rates above 80% can often be achieved with minimal verification of the data.

Output: XML and xls files with the start times of individual B calls.

Assumed knowledge

  • MATLAB basics
  • Opening LTSAs and logging calls in Triton

Requirements

  • MATLAB 2012b (or later)
  • triton_dev_sherbert folder
  • triton1.93.20160524 - B call detector folder

Getting started

Setting up Nilus

To run this detector, you must have a file called nilus.jar in a specific place in your MATLAB path (i.e., the static path MATLAB uses to load Java classes). To automatically get this correctly configured:

  1. Close all instances of MATLAB and open a new one

  2. Remove any Triton folders from your MATLAB path

  3. Add the triton_dev_sherbert folder to the path with subfolders

  4. In the command window type dbNilusInit();

  5. If you receive the below message, you're all set and you can take a look at what you need next to run the detector

    nilusinit_Y

    If you receive the following message:

    nilusinit

    Type Y to get your path set up correctly

  6. Restart MATLAB when prompted

💡 Tip: Nilus is a standalone Java archive library. The Nilus package is an API that creates XML detection documents, which can be uploaded to the Tethys database. If you'd like a more detailed description of Nilus, read this

Getting Nilus set up can be tricky, and the above steps don't always work based on an individual's computer set up. Ultimately, dbNilusInit() is trying to create a javaclasspath.txt file in the directory 'C: \ Users \ ... \ Documents \ MATLAB', where '...' is the name of the User Account you are currently using. If you are struggling to get Nilus to function properly, you can always create the javaclasspath.txt file yourself. In javaclasspath.txt you want to place the path to the nilus.jar file, which is '... \ Orig B call detector \ triton_dev_sherbert \ java \ dependency \ nilus.jar'.

Items you will need

There a few things you need before you can jump in and run the Bm-Bcall-Detector:

  1. Groundtruth

    The groundtruth is a series of manually logged calls that you will use to optimize detector performance for a given dataset.

  2. Kernel

    The kernel is the template that the detector uses to identify B calls in a dataset

  3. Threshold

    The threshold is a parameter that the detector uses, which is based on groundtruth performance. You can't calculate a threshold without first making a groundtruth and a kernel

Run the detector

Now that you have an appropriate groundtruth, kernel, and threshold for your dataset, you can start detecting blue whale B calls!

  1. Add the triton1.93.20160524 – B call detector folder to your MATLAB path

  2. Open Example_params.m, located in triton1.93.20160524 - B call detector \ Remoras \ Blue Whale B Detector Remora

  3. Update the following:

    • Line 5: Input directory (location of xwav files you want to run the detector on)

    • Line 6: Output directory (where you want the output detection files to be located)

    • Line 9-10: Kernel values (the 5 numbers you came up with for the kernel)

      💡 Tip: The first line will have numbers 1-4 and the second line will have numbers 2-5. For example, the kernel shown below was 45.9, 45.4, 44.6, 44.1, and 43.4.

    • Line 11: Kernel name (the site/deployment # from which the kernel was made)

    • Line 18: Threshold value (the number from 25 to 45 you selected when comparing your groundtruth against the detector's performance)

      exampleparams-sm

  4. Save Example_params.m

  5. Open Triton

  6. Go to Remoras > Blue whale B detector

  7. A box will pop up requesting the path to Example_params.m. Enter or browse for the path to the file

    popup1

  8. Click continue

  9. Another box will pop up where you can verify the parameters you entered in Example_params.m. Always verify! Make sure you will run the detector on the correct data, using the correct variables

    popup2

  10. If everything looks correct, click Yes

    💡 Tip 1: If Example_params.m has the correct parameter values but they are incorrect in the pop-up window, click No and try typing which Example_params in the command window. Begin at Step 6 and the correct values should appear in the pop-up window

    💡 Tip 2: If the Project/Site/Deployment for the dataset you are trying to run is not found in the HARP database (or it’s in a different format), a box will pop up requesting you to manually enter in that information. If this happens, there will be no xml output, only xls.

  11. The detector should start running through all the xwavs in your chosen directory. You can see its progress in the command window

    running

  12. When the detector is finished you should have both XML and xls output

  13. Open the XML detection file with an XML editor (Notepad++ is a good one)

  14. Verify that the following are correct in the XML and edit if necessary:

    • Project

    • Site

    • Deployment

    • UserID

    • Start effort

    • End effort

      xmloutput

  15. Detections that occur from February to May will need to be manually checked for false detections. If your XML file has detections during those months you will need to open the LTSA for the dataset in Triton and check if there actually were calls for those detections. If you find that there is no call for a detection, delete that entry in the XML file

    xmldelete

    💡 Tip: In SOCAL, blue whales B calls are rare from February to May and so the detector does not perform as well during these months. False detections can often be attributed to anthropogenic noise sources.

  16. Save the edited XML into a new folder, regardless of whether you checked/deleted detections (you don’t want to overwrite the unedited detections)

    💡 Tip: For each automatic detection you want to have a raw detection file and a checked detection file (representing what the detector gave you and what you’re actually going to use for call count analysis, respectively).

  17. Once you have an XML file that has been checked for false calls, it can be submitted to the Tethys database

Clone this wiki locally