Class EPR
This program runs an alternative version of Event Pattern Recognition (EPR) It can be used to detect Ground Parrots. It was developed by Michael Towsey in order to address difficulties in the original EPR algorithm - see more below. COMMAND LINE ARGUMENTS: string recordingPath = args[0]; //the recording to be scanned string iniPath = args[1]; //the initialisation file containing parameters for AED and EPR string targetName = args[2]; //prefix of name of the created output files
The program currently produces only ONE output file: an image of the recording to be scanned with an energy track and two score tracks.
- Energy track - Measure of the total energy in the user defined frequency band, one value per frame.
- Score Track 1 - Oscillation score - Requires user defined parameters to detect the repeated chirp of a Ground Parrot. Is a way to cut down the search space. Only deploy template at places where high Oscillation score.
- Score Track 2 - Template score - dB centre-surround difference of each template rectangle. Currently the dB Score is averaged over the 15 AEs in the groundparrot template.
THE EXISTING ALGORITHM:
- Convert the signal to dB spectrogram
- AED: i) noise removal ii) convert to binary using dB threshold. iii) Use spidering algorithm to marquee acoustic events. iv) Split over-size events where possible v) Remove under-size events.
- EPR: i) Align first AE of template to first 'valid' AE in spectrogram. A valid AE is one whose lower left vertex lies in the user-defined freq band. Currently align lower left vertex for groundparrot recogniser. ii) For each AE in template find closest AE in spectrogram. (Least euclidian distance) iii) For each AE in template, calculate percent overlap to closest AE in spectrogram. iv) Apply threshold to adjust the FP-FN trade-off.
PROBLEM WITH EXISTING ALGORITHM: AED: i) Major problem is that the AEs found by AED depend greatly on the user-supplied dB threshold. If threshold too low, the components of the ground parrot call get incorporated into a single larger AE. ii) The spidering algorithm (copied by Brad from MatLab into F#) is computationally expensive. EPR: i) EPR is hard coded for groundparrots. In particular the configuration of AEs in the template is hard-coded. ii) EPR is hard coded to align the template using the lower-left vertex of the first AE. This is suitable for the rising cadence of a groundparrot call - but not if descending.
POSSIBLE SOLUTIONS TO EPR AND AED AED: i) Need an approach whose result does not depend critically on the user-supplied dB threshold. SOLUTION: Try multiple thresholds starting high and dropping in 2dB steps - pick largest score. ii) Use oscillation detection (OD) to find locations where good change of ground parrot. This only works if the chirps are repeated at fixed interval. EPR: i) Instead of aligning lower-left of AEs align the centroid. ii) Only consider AEs whose centroid lies in the frequency band. iii) Only consider AEs whose area is 'similar' to first AE of template. iv) Only find overlaps for AEs 2-15 if first overlap exceeds the threshold.
############################################################################################################### TWO NEW EPR ALGORITHMS BELOW: IDEA 1: Note: NOT all the above ideas have been implemented. Just a few. The below does NOT implement AED and does not attempt noise removal to avoid the dB thresholding problem. The below uses a different EPR metric
- Convert the signal to dB spectrogram
- Detect energy oscillations in the user defined frequency band. i) Calulate the dB power in freq band of each frame.
- DCT: i) Use Discrete Cosine Transform to detect oscillations in band energy. ii) Only apply template where the DCT score exceeds a threshold (normalised). Align start of template to high dB frame.
- TEMPLATE SCORE i) Calculate dB score for first AE in template. dB score = max_dB - surround_dB where max_dB = max dB value for all pixels in first template AE. ii) Do not proceed if dB score below threshold else calculate dB score for remaining template AEs. iii) Calculate average dB score over all 15 AEs in template.
COMMENT ON NEW ALGORITHM
- It is very fast.
- Works well where call shows up as energy oscillation.
- Is not as accurate because the dB score has less discrimination than original EPR. BUT COULD COMBINE THE TWO APPROACHES.
############################################################################################################### IDEA 2: ANOTHER EPR ALGORITHM
Convert the signal to dB spectrogram
Detect energy oscillations in the user defined frequency band. i) Calulate the dB power in freq band of each frame.
DCT: OPTIONAL ONLY PROCEED IF HAVE HIGH dB SCORE and HIGH DCT SCORE
NOISE COMPENSAION Subtract modal noise but DO NOT truncate -dB values to zero.
AT POINTS THAT EXCEED dB and DCT thresholds i) loop through dB thresholds from 10dB down to 3dB in steps of 1-2dB. ii) determine valid AEs in freq band and within certain time range of current position. A valid AE has two attributes: a) entirely within freq band and time width; b) >= 70% overlap with first template AE iii) Accumulate a list of valid starting point AEs iv) Apply template to each valid start point. a) extract AEs at dB threshold apporpriate to the valid AE a) align centroid of valid AE with centroid of first template AE c) calculate the overlap score
Inherited Members
Namespace: AnalysisPrograms
Assembly: AnalysisPrograms.dll
Syntax
public class EPR
Fields
| Improve this Doc View SourceCommandName
Declaration
public const string CommandName = "EPR"
Field Value
Type | Description |
---|---|
String |
Methods
| Improve this Doc View SourceDetectEPR(List<AcousticEvent>, BaseSonogram, Double[], Double)
Declaration
public static double[] DetectEPR(List<AcousticEvent> template, BaseSonogram sonogram, double[] odScores, double odThreshold)
Parameters
Type | Name | Description |
---|---|---|
List<AcousticEvent> | template | |
BaseSonogram | sonogram | |
Double[] | odScores | |
Double | odThreshold |
Returns
Type | Description |
---|---|
Double[] |
Execute(EPR.Arguments)
Declaration
public static void Execute(EPR.Arguments arguments)
Parameters
Type | Name | Description |
---|---|---|
EPR.Arguments | arguments |
GetLocationScore(BaseSonogram, Oblong)
reutrns the difference between the maximum dB value in a retangular location and the average of the boundary dB values.
Declaration
public static double GetLocationScore(BaseSonogram sonogram, Oblong ob)
Parameters
Type | Name | Description |
---|---|---|
BaseSonogram | sonogram | |
Oblong | ob |
Returns
Type | Description |
---|---|
Double |