Introducing NMMF WAMS, an open-source PAMGuard plug-in, and some pilot data for its use as a welfare acoustic monitoring system

The National Marine Mammal Foundation presents a new veterinary and animal welfare monitoring tool, WAMS (i.e., Welfare Acoustic Monitoring System) for open-source use in PAMGuard. While the use of passive acoustic monitoring systems has been invaluable in wild conservation efforts, vocal behavior is a vastly underutilized welfare biomarker for both terrestrial and aquatic species in zoos and aquaria. We describe one successful use for WAMS at the Navy Marine Mammal Program for monitoring a discrete population of dolphins’ acoustic behavior. By constantly recording both ve minute and hourly counts of acoustic detections and providing an automated comparison to historical data, WAMS can alert us to rare instances of high vocal rates relative to their typical output. Having a validated acoustic indicator for events such as agnostic social interactions and/or an instance of distress in bottlenose dolphins provides a unique opportunity for acoustic monitoring to be used as a tool for the early identication and possible prevention of rare and unexpected instances of an illness or injury.


Abstract Background
The National Marine Mammal Foundation presents a new veterinary and animal welfare monitoring tool, WAMS (i.e., Welfare Acoustic Monitoring System) for open-source use in PAMGuard. While the use of passive acoustic monitoring systems has been invaluable in wild conservation efforts, vocal behavior is a vastly underutilized welfare biomarker for both terrestrial and aquatic species in zoos and aquaria. We describe one successful use for WAMS at the Navy Marine Mammal Program for monitoring a discrete population of dolphins' acoustic behavior. By constantly recording both ve minute and hourly counts of acoustic detections and providing an automated comparison to historical data, WAMS can alert us to rare instances of high vocal rates relative to their typical output. Having a validated acoustic indicator for events such as agnostic social interactions and/or an instance of distress in bottlenose dolphins provides a unique opportunity for acoustic monitoring to be used as a tool for the early identi cation and possible prevention of rare and unexpected instances of an illness or injury.

Results
We identi ed a high success rate (82%) and low false positive rate (1%) for WAMS identi cation of whistle occurrence. Further, we identi ed time and money saving applications for use in conservation settings such as marine mammal mitigation surveys and long-term hydrophone deployments. When running in real-time, WAMS used in conjunction with other PAMGuard features saved almost 6.5 days in manual labor for every month processing data (almost 78.5 work days a year).

Conclusions
We propose that this tool could be considered for implementation at any facility that houses marine mammals and wishes to include acoustic monitoring into their preventative healthcare plans. Early identi cation of atypical social interactions and/or distress calls in both aquatic and terrestrial species can lead to early intervention, better management of social groupings, and better overall health and welfare for all animals.

Background
Methods for collecting, analyzing and classifying underwater sounds have been rapidly improving over the last 50 years. The development of compact, mobile, and often autonomous recording systems has given us unparalleled access to information on soundscapes, anthropogenic noise, and animal presence and density.
Although they are quickly becoming a major aspect of marine conservation efforts, the potential for using these methods to enhance animal welfare have not yet been implemented [1].
McLoughlin et al. [1] review the current status of animal welfare monitoring and insist that vocal behavior is an underutilized welfare indicator amongst both terrestrial and aquatic species. Brando, Broom, Acasuso-Rivero, and Clark [2] reported that the best practice wholistic study of cetacean welfare biomarkers to date was Clegg et al. [3]. While the authors provide an index of 36 welfare indicators, none of the measures consider the acoustic behavior of an individual or population.
Marine mammals largely depend on their acoustic environment and therefore the soundscape of a habitat housing animals is likely an important measure of welfare for animals in managed care. Whether animals are housed in a closed or open water system, there is likely a range of acoustic signals from many sound sources permeating their habitat. As the hearing range of marine mammals far exceeds that of humans, some of these signals may go unnoticed by human observers. At certain amplitudes and/or rates of occurrence these can cause changes in behavior or in rare cases hearing abilities [4,5].
In addition to habitat, social structure is often considered an important measure of welfare. Whether or not animals have acoustic access to one another may be as important as physical access. Dolphins have a rich and varied vocal behavior. For example, two female Tursiops truncatus were recorded for 24 hours every two weeks for a year [6] and their whistle emissions ranged from 1682 to 6793 whistles for 24 hour periods.
Ridgway [7] made further, but limited, observations on other T. truncatus suggesting that both ovulating and ill dolphins he observed tended to decrease production of sound in general.
Bottlenose dolphins are arguably the most well studied marine mammal species in terms of acoustic behavior [8]. To date, a few vocalization types have been validated to indicate the presence of important welfare related behaviors such as the occurrence of burst pulses during aggressive interactions [9], and the incessant use of signature whistles when an animal is in distress [7,[10][11][12].
Ridgway [7] reported that dolphins produce pulsed calls during periods of aggression and agitation. Overstrom [9] similarly observed that burst pulse vocalizations were typically emitted in aggressive chases, open mouthing behaviors, arched posturing, jaw clapping, and head to head encounters. Blomqvist and Amundin [13], also found that as aggressive interactions between two dolphins reached a climax, such as a physical ght, so did the production of high intensity burst pulse vocalizations.
Distress calls are emitted by many animal species in dire contexts such as danger, severe injury or illness and function to warn and/or elicit help from conspeci cs [14]. Lily [12] was the rst to report that dolphins utilize distress calls, which were repeated whistles used to elicit attention and aid from other animals. Caldwell and Caldwell [10] furthered that the whistle type emitted by a dolphin in distress was its signature whistle (i.e., a distinctive whistle contour that is used by an individual to broadcast its' identity) [10] and that the signature whistle was loud and incessant during these contexts. Kuczaj et al., [11] recorded a dying dolphin producing one stereotyped whistle contour relentlessly in its nal hour. Having a validated acoustic indicator for events such as agnostic social interactions and/or an instance of distress in bottlenose dolphins provides a unique opportunity for acoustic monitoring to be used as a tool for the early identi cation and possible prevention of rare and unexpected instances of an illness or injury.
PAMGuard is an open-source program used to collect and analyze marine mammal acoustic data [15]. PAMGuard is designed to provide a exible, module-based and user-friendly platform to assist in passive acoustic monitoring of marine mammals. The software's modular framework allows users to add components depending on needs and speci cations of different project goals, including detectors and classi ers which can be used to study various cetacean species. This structure allows 'plug-in' modules to easily be developed and integrated by the wider research community. PAMGuard is the most widely used platform for marine mammal mitigation and monitoring in the offshore seismic survey and construction industries, but its use in monitoring discrete animal populations has been minimal to date.
Here, we present to the community a new module, National Marine Mammal Foundation's Welfare Acoustic Monitoring System (NMMF WAMS), hereafter referred to as WAMS, for open-source use in PAMGuard. The modular nature of PAMGuard, combined with the user-de ned reporting options in WAMS, will provide researchers a unique tool for use in monitoring discrete populations of mammals. WAMS was developed to monitor for, identify and alert the research and veterinary teams to potential instances of abnormal acoustic behavior in this study population of twenty dolphins. For this pilot study, WAMS receives acoustic data from a four-channel modular, bottom mounted array deployed in San Diego Bay. The primary goal of this array deployment and program development is to allow researchers, veterinarians and training staff to be alerted to a sudden high whistle rate by our focal population. Previous research has suggested that if an animal were to be in distress, they might emit their signature whistles at a high rate and intensity. While this would be an extremely rare occurrence for the animals at the Navy, the Navy is committed to, and responsible for, providing these animals with the highest quality of care. The round the clock monitoring of typical and normal behavior establishes a rich baseline for a rare abnormal event to stand out against. Early detection of any abnormal event could prove to be valuable long-term tool to support that goal. In addition, we provide the parameter settings and success of whistle identi cation to aid future researchers interested in identifying whistle behavior in any context. We further suggest other potential uses for WAMS to inform animal caretakers, veterinarians, managers and conservationists to improve the health and welfare of animals in managed care worldwide.

Results
WAMS successfully enabled the acoustic monitoring of a discrete population of dolphins for whistling behavior 24 hours a day, seven days a week by improving data analyses e ciency, summarizing acoustic trends, and alerting research staff via email to potential times of interest. When running in real-time, WAMS used in conjunction with other PAMGuard features (e.g., detectors and localizers) saved almost 6.5 days in manual labor every month post-processing data (almost 78.5 work days a year). When post-processing acoustic data, WAMS performed at 4x the speed of visual observers, when considered for acoustic datasets from long-term deployments, the implementation of WAMS could save up to 57.5 work days a year (Table 1). Twenty four, 1-hour recordings were included in this dataset. The mean duration taken by a visual observer to hand mark all vocalizations compared to WAMS which post-processed the recordings. These comparisons were made for the analyses of 1 hour and of 24 hours of data. The totals were then pro-rated to describe an estimate of the time it would take a visual observer compared to WAMS to identify whistle emissions for 30 days of data and 365 days of data. *Days (d), hours (h), minutes (m), seconds (s).
Manual analyses of 24 consecutive one-hour recordings identi ed a total of 1153 whistles. Minimizing missed whistles and reducing false detections were two high priorities for this project. Table 2 describes how successful WAMS was at correctly identifying and reporting whistle detections using the parameter settings reported by [16] (also reported in Table 3). The program successfully detected 82% of whistles in a 24-hour period with only 21 out of 2573 detections being false positives of non-dolphin vocalizations. Another 55 were burst pulses with harmonic appearances on the spectrogram. We were not as concerned with false positives of burst pulses compared to non-dolphin signals.
The total number of detections was over 2x the manual total and this was largely due to the fragmenting of single whistle contours into two or more detections. Amplitude modulations across whistle contours often resulted in more than one trace across what a manual observer would identify as a single whistle. 1552 of the detections were additional detections of an already detected whistle. Our project goals prioritized relative increases in whistle production, therefore relatively consistent fragmentation of correct whistle detections was tolerated. Other projects that rely on absolute totals would need to manipulate some of their parameters to improve this value. We preferred this concession to creating a less sensitive detector that missed a high number of whistles. The harmonic detector was toggled on for these results so the multiple detections were not a result of interval harmonics of a whistle contour. The manual whistle detections were the total number of contours identi ed by researcher MB. The total WAMS detections was the nal output total reported by WAMS. The whistles detected and whistles missed by WAMS were identi ed by comparing the manual whistle detections to the WAMS traces. False positives were identi ed as any non-dolphin vocalization. Fragments of other whistle detections are the number of detections that were counted where the whistle had already been detected and was therefore counted more than once.

Discussion
Here, we present a new tool, National Marine Mammal Foundation's Welfare Acoustic Monitoring System (WAMS). WAMS uses PAMGuard open source software. We describe one successful use for WAMS at the Navy Marine Mammal Program for monitoring a discrete population of dolphins' acoustic behavior. By providing both ve minute and hourly counts of acoustic detections and automatically comparing those counts to historical data it can alert us to rare instances of high vocal rates relative to their typical output. We developed these alerts to be used as a veterinary tool for monitoring for high rates of dolphin whistles and report a high success rate (82%) and low false positive rate (1%). We prioritized these statistics and accepted a high rate of fragmentation (average ~ 1.3 whistle detections per whistle) in order to maintain sensitivity and keep whistle misses low.
The ability to manipulate settings for each array con guration, soundscape and project goal allows for extreme exibility in application. Testing of WAMS for a multitude of other welfare monitoring goals such as the occurrence of aggression and the habituation to novel experiences in bottlenose dolphins has already begun. Clegg et al. [3] and Brando et al., [2] both highlight the importance of behavioral and veterinary monitoring of bottlenose dolphins in order to maintain the highest standards of welfare. We propose that the implementation of acoustic monitoring into preventative healthcare plans can be a worthwhile endeavor for zoos and aquaria housing marine mammals. Acoustic behavior is an untapped resource for gaining insight into the health and welfare of any mammal population [17].
We further provide evidence that the use of already developed detectors and localizers being used in coordination with WAMS round-the-clock monitoring, summaries, reports, and alarm system can save time and money for projects with both real-time and long-term passive acoustic recordings. The modular nature of PAMGuard, combined with the user-de ned reporting options in WAMS, will provide researchers a unique tool for use with a multitude of different project goals.
Passive acoustic monitoring (PAM) of wild populations is a rapidly growing eld especially as human made sound from shipping, sonar, seismic exploration and wind farms continue to expand in our oceans. Marine mammal mitigation can be costly in terms of equipment and man hours but is imperative to the conservation of marine mammals worldwide. For example, on an offshore survey monitoring for the presence of cetaceans, the WAMS module can be added to the PAMGuard interface used for mitigation. With its ability to alert operators with user de ned alarm level parameters, the program can reduce the amount of screen time necessary for human operators and further reduce the cost of surveys.
It is important to calibrate each system's settings to the speci c projects goals, acoustic environment, species, and vocalizations of interest. While we provide information on the settings used in our present setup these settings will not be optimal for all studies. We highly recommend testing and validating detections and localizations in each new deployment location or for use with a new project goal.
This pilot study of WAMS provides a basis for future advancements in both software technology and hardware setup for using acoustics as a welfare tool. As the system is 'listening' in real-time 24/7, additional programs to monitor anthropogenic sounds can be implemented as well. While we currently have a separate program using the recordings from WAMS to monitor for anthropogenic noises, future development may be able to incorporate an alarm system for the presence of anthropogenic noise weighted by the species of interests' hearing curve into WAMS itself.
Acoustic monitoring for welfare does not have to be focused only on aquatic species. Automated monitoring systems are currently being developed and tested in densely populated enclosures of farm animals to improve welfare, decrease stress, and early identi cation of respiratory disease [1,18,19]. It is our hope that future projects can calibrate similar systems for zoos and aquaria with terrestrial species. Early identi cation of atypical social interactions and/or distress calls in both aquatic and terrestrial species can lead to early intervention, better management of social groupings, and better overall health and welfare for all animals.

Conclusions
In conclusion, NMMF WAMS is freely available for use within PAMGuard open-source passive acoustic monitoring software. With its modular design, user-de ned settings, and exibility of use we look forward to seeing how researchers can creatively incorporate WAMS into their own works. It is our sincere hope that WAMS can be utilized to improve the health, welfare, and conservation of animals in both the wild and in zoos and aquaria worldwide.

Hardware
Recordings were made using a four element, bottom mounted stationary hydrophone array. Four HTI-99-HF hydrophones (High-Tech Inc, 2 Hz-125 kHz frequency response with integrated preampli er) were mounted in a tetrahedral shape, with 3 hydrophones making up the base and the 4 th hydrophone raised in the center. Spacing between any pair of hydrophones was 150 mm. This volumetric shape was chosen to eliminate the right/left ambiguity common to linear and planar arrays. The frame holding the hydrophones was machined from titanium and mounted in a larger frame made of PVC pipe. The frame was lled with water and anchored to the ocean oor with diver weights. Each hydrophone cable was 150 meters long and terminated at a 4 channel SAIL DAQ card (SA Instrumentation) in a custom-built electronics enclosure with ltered power and ampli ed line-out jack. Signals were passed from the enclosure to a DELL laptop via USB cable. The SAIL DAQ unit and laptop were stored in a pelican case inside an above water hut located on a oating dock at NIWC Paci c in San Diego, California (Figure 1).

Study population
This array is in use at the U.S. Navy Marine Mammal Program (MMP) in San Diego, CA. The focal dolphins in the present study are housed in natural seawater enclosures in San Diego bay. Males and females are located in separate enclosures approximately 10 meters (m) from one another. For the day to day use of this monitoring system, the array is situated to focus on one half of the dolphin population ( Figure 2). In order to do this, an angle veto was determined. The angle veto tells the program from what angles of arrival to 'ignore' detections from, thus the inverse of the vetoed angles are the angles of interest that the program will count upon detection. The angle veto used was determined after a series of playback tests were performed to con rm the directionality of the array. Playback stimuli of whistles previously recorded from the focal group were projected with an underwater speaker and recorded with the pilot array for subsequent analyses. The speaker was placed 1 m from the array in 10 degree increments 360 degrees around the system. This determined the directionality of the array, con rmed successful localization capabilities in the present environment, and provided the angles of arrival that we used as input into the 'angle veto' of the WAMS module. For the results presented in the present manuscript, the angle veto was turned off and therefore the acoustic detections could arrive from 365 degrees surrounding the array.
The previously developed PAMGuard 'Whistle and Moan Detector' module (hereafter referred to as 'the detector') is used to detect the dolphin vocalizations. Rankin et al. [16] reported the settings used for detection of whistles off the coast of California. We used these parameters for the detector and further validated that the parameters were successful in identifying whistle behavior in this population. The only change that we made was to focus in on the frequency range from 3 kHz to 20 kHz which greatly reduced our false detections from anthropogenic noise especially in the lower frequencies. While dolphin whistles can be outside of this range we found that it had a more positive impact on minimizing false detections and rarely resulted in a missed whistle from our population.
One researcher (MB) visually identi ed all vocalizations in 24 consecutive one-hour recordings from the array using Raven Pro 1.5 (spectrogram settings Hann-window, 50% overlap, 4096 window size, 8192 DFT, 10 second x-axis, and 24 kHz y-axis; source sample rate 250 kHz). MB used the selection marquee tool to box each vocalization and we used the number of whistles and burst pulses within each hour recording for ground truthing the success of the detector settings. Next, the 24-hour recordings were run through WAMS (see Table 1 for settings). The manual whistle data was compared to the WAMS results using PAMGuard viewer mode (sample rate 250 kHz decimated to 48 kHz for processing time, 10 second x-axis, 24 kHz y-axis, Hann window, FFT size 1024). MB recorded every identi ed vocalization as a whistle hit, whistle miss, burst pulse hit, burst pulse miss and false positive (Table 3). It is imperative that each study goes through this process as recording devices, distance to the animals, species, number of animals, environmental factors, and project goals will all play a role in determining the best settings for each study [17]. These were originally established by Rankin et al., (2016) but slightly manipulated to reduce false positives of anthropogenic noise in our recordings.

Software
The WAMS plugin provides a method of logging audio detections of interest and providing both an instantaneous count in the current time period, as well as a historical mean count to compare against. The size of the time period is user-adjustable, though this study used an hourly time bin. WAMS can run in both real time and during post-processing of previously-recorded audio data, and can generate reports using operator-customized templates.
The WAMS plugin has been designed to work in conjunction with existing core PAMGuard modules. A typical PAMGuard con guration consists of the following modules: Array Manager, Sound Acquisition, Sound Recorder, FFT Engine, Whistle & Moan Detector, and WAMS plug-in. In addition, a Database module and Binary Storage module must be included in order to store output data from the detector and WAMS modules. A User Display is also typically included, to display a spectrogram of the audio signal.
The Array Manager must be con gured with details of the hydrophone array used to collect the audio data. Arrays may be stationary (such as a xed mooring) or transient (such as a towed array), and positional details of each hydrophone are subsequently used when calculating bearings of detected sounds. The WAMS plugin will work with a single hydrophone, however in order to calculate bearing to the sound source at least 2 hydrophones are required.
The Sound Acquisition module con guration determines the input sound source. This can be a real-time audio stream from a sound card or network source, or a pre-recorded audio le. The Sound Recorder module will save the audio stream to a hard drive as a.wav le. The user is able to limit the size of the.wav le by either specifying a maximum size in bytes or a maximum duration. The FFT Engine takes the audio stream and performs a Fast-Fourier transform, converting the time-domain data into frequency-domain data suitable for spectrogram display.
The detector module uses a six-stage process to detect whistles in the frequency-domain data that is output from the FFT Engine. A description of the detector's algorithms is beyond the scope of this report, but can be found in Gillespie et al [20]. When a whistle is detected, the WAMS module is noti ed and increments the count in the current time period by 1. When a time period has elapsed, the mean value is recalculated based on the most recent count combined with all historical data for that time period. Therefore, the mean of each designated time period is continually updating. The count and ancillary information are logged both to the database and a.csv le. The information can also be displayed in a User Tab in both tabular and graphical formats (see Figure 3 for an example of the real time display).
While only useful for certain project types, the PAMGuard Alarm module is a helpful addition to the con guration. In this study, the Alarm module receives information from the WAMS module. When the counts exceed a certain threshold value over a speci ed time period (e.g., 10 whistles in one minute), the Alarm module can respond by sending an output signal through the serial port, displaying a message on the screen, sounding an audible alarm, and/or sending an email alert to a speci ed email address. The alarm module was updated for optimal use with WAMS. When an alarm is triggered due to a high detection rate, not only is an email with a summary of the event sent to the designated email address, but a screenshot of the PAMGuard display window during that time period is also attached. This gives almost instantaneous feedback to an interested party that an alarm has been triggered but also allows the operator to immediately see the cause of the alarm and the bearing from which the detections are coming from. In our case, we are able to see what location in the lagoon and what whistle type is being emitted at an abnormally high rate and can respond appropriately.
The WAMS plugin provides the user with a number of options to better serve the speci c application. The WAMS plugin is able to accept noti cations from any of the detector modules (e.g., Click Detector) within PAMGuard. Many detector modules calculate bearing angles when there are 2 or more hydrophone elements in the array. The bearing for each detection is reported in the database regardless of whether it was excluded from the WAMS counts to ensure that no data is lost.
In the presence of signals with harmonic components detector will often treat the individual harmonics as separate whistle contours, in turn arti cially increasing the WAMS count (example in Figure 4). In order to minimize this, a simple Harmonic Detector can be con gured within the WAMS plugin to disregard contours with similar starting/ending points and require a minimum amount of time between contours to be considered separate detections. Turning on the harmonic detector ensures that when a burst pulse is counted as a whistle, it is only counted as one and its broadband harmonics are not also counted.
Finally, WAMS can generate reports in a Microsoft Word.docx format. The report will contain the counts and alarms during the speci ed time period and provide researchers with summary data at user-de ned intervals.

Declarations
Ethics approval and consent to participate The MMP is AAALAC-accredited and follows the national standards of the United States Public Health Service Policy on the Humane Care and Use of Laboratory Animals and the Animal Welfare Act. The MMP's animal care and use program is routinely reviewed by an institutional animal care and use committee (IACUC) and the Navy Bureau of Medicine and Surgery (BUMED). BUMED concurred with the approval of MMP IACUC protocol #130-2018 and assigned NRD#1134 to the protocol for this project.