Segment review#

Segment review means listening to a sample of the detections of a species and marking each one as correct or wrong. It shows how reliable the detections are at each confidence score and helps you to choose a threshold for your recordings. The work has two steps: extract short audio segments from the results of an analysis, then label them in the “Review” tab.

Prepare Audio and Result Files#

The segments tool reads the result tables of a batch analysis: Raven selection tables, CSV files and Kaleidoscope tables (table, csv and kaleidoscope on the command line). To obtain them, run the analysis in the Batch analysis tab of the GUI or on the command line; Result files describes the files.

Warning

Audacity labels name no audio file, so the segments tool reads them only as the results per recording of an analysis with Split tables by input file (--split_tables), not the combined BirdNET_AudacityLabels.txt. Use a Raven selection table, CSV or Kaleidoscope for combined results.

The segments tool does not read Parquet results, neither BirdNET_CombinedTable.parquet nor the ones per recording. Also write a Raven selection table, CSV or Kaleidoscope results when you want to extract segments.

A combined result table names each recording where it was during the analysis. If the recordings have moved since, for example because the drive got another letter or the folder was copied to another computer, select the folder that holds them now as the audio folder: the segments tool looks there for a recording it does not find, by its file name and the folders it is in. A recording that two files there match equally well is skipped.

Using the “Segments” Tool in the GUI or Command Line#

The BirdNET Analyzer provides the “segments” tool to extract short audio segments from the result files and place them into separate species-specific folders. This tool is available in the graphical user interface (GUI) under the “segments” tab or via the birdnet_analyzer.segments script in the command line.

Setting Parameters#

The GUI and command line tool allow you to set various parameters to customize the segment extraction process:

  • Minimum Confidence (min_conf): Set a minimum confidence value for predictions to be considered.

  • Maximum Confidence (max_conf): Set a maximum confidence value for predictions to be considered.

  • Maximum Number of Segments (max_segments): Specify how many segments per species should be extracted.

  • Audio Speed (audio_speed): Adjust the playback speed. Extracted segments will be saved with the adjusted speed (e.g., to listen to ultrasonic calls).

  • Segment Length (seg_length): Define how long the extracted audio segments should be. If you set to more than 3 seconds, each segment will be padded with audio from the source recording. For example, for 5-second segment length, 1 second of audio before and after each extracted segment will be included. For 7 seconds, 2 seconds will be included, and so on. The first and last segment of each audio file might be shorter than the specified length.

  • Segment Collection Mode (collection_mode): Choose how segments are selected. Following options are available:

    • random: Select segments randomly.

    • confidence: Select segments based on confidence values, starting with the highest confidence scores.

    • balanced: Select segments equally distributed across confidence values.

    • More details on segment collection modes

Extracting Segments#

After setting all parameters, start the extraction process. BirdNET will create subfolders for each identified species and save audio clips of the corresponding recordings. The progress of the process will be displayed. The resulting audio segments will be saved in the following format:

{c}_{i}_{fname}_{start}s_{end}s.wav

where:

  • {c}: confidence value of the prediction (e.g., 0.835)

  • {i}: index of the segment inside the file

  • {fname}: name of the original audio file without the extension

  • {start}: start time of the segment inside the file in seconds

  • {end}: end time of the segment inside the file in seconds

Using the Review Tab in the GUI#

The resulting audio segments can be manually reviewed to assess the accuracy of the predictions. It is important to note that BirdNET confidence values are not probabilities but a measure of the algorithm’s prediction reliability.

The review tab in the GUI allows you to systematically review and label the extracted segments. It provides tools for visualizing spectrograms, listening to audio segments, and categorizing them as positive or negative detections. The review tab can generate a logistic regression plot to visualize the relationship between confidence values and the likelihood of correct detections.

In the GUI select the “Review” tab and select the segments directory you want to review. You can now either select the parent directory containing all the different species subfolders or a specific species subfolder to review. If you select the parent directory, the GUI will automatically select the first species subfolder, but you can switch between species via a dropdown menu.

The segments of a species are played one after the other, starting with the highest confidence. Each segment will be displayed with an audio player and its spectrogram. After listening to a segment, you can either mark it as a positive detection (if you hear the species) or a negative detection (if you do not hear the species). The BirdNET Analyzer will create two directories: one for positive detections and one for negative detections, and move the marked segments accordingly. The “Undo” button allows you to revert the last action if needed.

Note

You can also use the up (positive) and down (negative) arrow keys to assign labels. The left arrow key will undo the last action and the right arrow key will skip to the next segment without labeling it.

All of the plots including the spectrogram can be downloaded as PNG files for further analysis or documentation.

Note

The review tab can be used on any directory containing audio files, not just those created by the segments tool. This allows you to review any set of audio files, including those from other sources.

Finding a threshold#

A threshold is the confidence above which you accept the detections of a species. The review gives you one in three steps:

  1. Extract segments from the whole confidence range. In the Segments tab, choose the Collection mode balanced or random, not confidence: with only the highest-scoring segments, the review cannot show where the detections start to be wrong.

  2. Review all segments of the species. The tab plays them from the highest confidence down, so a review that stops early has only covered the high-scoring segments. As soon as a species has positive and negative segments, the Regression plot shows how the share of correct detections rises with the confidence: the curve is a logistic regression through your answers.

  3. Read the threshold from the plot. Its legend marks the confidence at which a detection of this species is correct with a probability of 85, 90, 95 or 99 %, for example p=0.90 threshold>=0.62: a detection with a confidence of 0.62 is expected to be correct with a probability of 90 %, and one with a higher confidence more often. A probability that is not reached at any confidence has no entry.

Use the value you choose as Minimum confidence when you analyze for this species. The slider moves in steps of 0.05 up to 0.95: take the next higher step, or analyze with a lower value and remove the detections below your threshold from the results.

A threshold holds for one species, one model, one set of analysis settings and recordings like the ones you reviewed. Determine it again for another species, after a change of the model or of a setting that changes the scores, such as Sensitivity and Merge consecutive detections, and for recordings from other places and recorders.

Wood and Kahl (2024) describe the method and what to consider when you apply it. For R, BirdNET in R names packages that support the same workflow.

Alternative Approaches#

  • Raven Pro: BirdNET result tables can be imported into Raven Pro and reviewed using the selection review function.
  • Converting Confidence Values to Probabilities: Another approach is converting confidence values to probabilities using logistic regression in R. However, this still requires manual evaluation of predictions.

Important Notes#

  • Non-Transferability of Confidence Values: BirdNET confidence values are not easily transferable between species.
  • Audio Quality: The accuracy of results heavily depends on the quality of audio recordings, such as sample rate and microphone quality.
  • Environmental Factors: Results can be influenced by the recording environment, such as wind or rain.
  • Standardized Test Data: Using standardized test data for evaluation is important to make results comparable.

This guide summarizes the best practices for using the “segments” function of BirdNET-Analyzer and emphasizes the need for careful interpretation of the results.