-
Notifications
You must be signed in to change notification settings - Fork 27
Ship Detector
HOME > REMORAS > SHIP DETECTOR
The Ship Detector Remora is a repository with user-friendly interfaces to detect ship passages and weather events from Long-Term Spectral Averages (LTSAs). This package was initially developed for this Ph.D. thesis and since then has been expanded for the Sound Monitoring Project to support Marine Protected Area management, as well as additional monitoring projects.
Events are identified from Long-Term Spectral Average (LTSA). LTSAs are averaged spectra of a specified time bin and frequency range and aligned over time, resulting in a long-term spectrogram which preserves the temporal-spectral resolution of the acoustic data. The LTSA is analyzed in blocks of data (windows), where the power spectral density estimates (PSD) are averaged in three frequency bands. The three frequency bands are referred to as low-, medium-, and high-frequency bands (see Figure 1). Start and end times of the ship passages and weather events are detected and stored if the three averaged PSD meet multiple conditions:
-
Condition 1: Amplitude is above a time-dependent amplitude threshold (
). The threshold is computed using a histogram method of the averaged PSD, where the histogram is divided into two equal regions, and the mode of each region is taken as the lower and upper levels. The time-dependent threshold is calculated as the mean of the lower- and upper-levels.
-
Condition 2: The event duration above the threshold in the three bands must be longer than a specified time, referred as Close Passage Duration Threshold. Additionally, the duration in the higher band must be smaller than the medium band, which allows discarding dolphin detections. Or, the event duration above the threshold in the lower and medium band must be longer than a specified time, referred to as Distant Passage Duration Threshold. Additionally, the duration in the medium band must be smaller than the lower band, which allows discarding sperm whale detections.
-
Condition 3: Ship passages are distinguished from weather events when received levels of the event in the lower band are above a specified percentage of the overall received levels in the window.
To ensure that events on the edges of the analysis window are detected, an overlapping sliding window is applied. Sliding time and length of the window can be defined by the user to improve the performance of the detector on different acoustic data sets.
Learn how to download or clone Triton repository with the Ship Detector Remora repository at quick setup section and how to add the Remora to Triton.
In the Control Window, use Tools pull-down menu, and select Make LTSA from Directory of Files.
First, will prompt you to select file type: use 1
for WAV files or 2
for XWAV files and specify folder containing audio files. After, will prompt you to set the LTSA parameters:
- Time Average: length of time for each spectral average
- Frequency Bin Size for LTSA (Hz)
These parameters are data sample rate dependent, so setup with caution. The default parameters for broad-band HARP data sampled at 200 kHz are usually 5s averages and 200 Hz frequency bins. For lower sample rate such as Soundtrap data (i.e., 48 kHz or 96 kHz) are usually 5s averages and 48 Hz frequency bins.
After, select folder to save LTSA recommended choosing the same folder as the audio files so that the LTSA can provide a link and index to these fine-scale data files.
❗ The amount of time required to create the LTSA is over several hours, so recommended to run overnight, or time to go and enjoy a ☕.
The goal behind the use of the Interactive Detector is to test different settings to improve the performance of the detector, which will be used by the Batch Detector.
First, load the LTSA file (.ltsa
) from the Control Window, use File pull-down menu, and select Open LTSA File.
Adjust the brightness and contrast of the LTSA plot from the Control Window (i.e., usually are set to 40 dB brightness and 100% dB contrast)
After the LTSA file (.ltsa
) is loaded in Triton Plot Window, launch the Interactive Detector from the Control Window, use Remoras pull-down menu, and select Interactive detector (LTSA).
and it will display the Ship Detector Motion Control Window, where settings can be loaded from existing files, modified and/or saved.
The Ship Detector Motion Control Window contains all the adjustable parameters of the detector. You can load one of the existing settings file from Load/Save Settings pull-down menu, and select Load Detector Settings File. After, select the Refresh button to plot the results of the detector from the current LTSA window.
Based on the detector thresholds being triggered (see Detectors' Conditions), the results are displayed in different colors and symbols:
- ship passages: displayed in green
- weather events or others: displayed in blue as ambient
- events that triggered the Close Passage Duration Threshold are shown as a circle.
- events that triggered the Distant Passage Duration Threshold are shown as a cross.
Once, you have found the best parameters for your data, save the settings to a file in the Ship Detector Motion Control Window, use Load/Save Settings pull-down menu, and select Save Detector Settings File.
Run the detector on the entire LTSA file by selecting the Batch run detector from the Ship-Detector in the Remoras pull-down menu. It will display the Ship Detector Batch Window, where you can load the settings file and verify all the parameters and modify them if needed before running the detector. A common parameter to modify in this window is the transfer function, which will probably vary from LTSA files.
Then, select Run Detector button, to start the detector. The processing time can vary according to the LTSA parameters, which can be from a couple of minutes to a maximum of 20 minutes.
The detector stores a .mat
file with start and end times of the detections and the labels, in addition to the settings, used to run the detector. It also creates a .tlab
file, which contains the same information but in the format that Triton read detection labels file.