Class DLClassifyProcess

java.lang.Object
PamguardMVC.PamProcess
rawDeepLearningClassifier.dlClassification.DLClassifyProcess
All Implemented Interfaces:
PamObserver, ProcessAnnotator

public class DLClassifyProcess extends PamProcess
The deep learning classification process. This takes a segment of raw data from the segmenter. and passes it to a deep learning model.

All model results are added to a DLClassifiedDataBlock. This stores the probabilities for each species category.

If a binary classification is true then the raw data from the model data block is saved.

Author:
Jamie Macaulay
  • Constructor Details Link icon

  • Method Details Link icon

    • prepareProcess Link icon

      public void prepareProcess()
      Description copied from class: PamProcess
      Called for each process before any of them receive the PamStart command
      Overrides:
      prepareProcess in class PamProcess
    • setupProcess Link icon

      public void setupProcess()
      called for every process once the system model has been created. this is a good time to check out and find input data blocks and similar tasks.
      Overrides:
      setupProcess in class PamProcess
    • newData Link icon

      public void newData(PamObservable obs, PamDataUnit pamRawData)
      Overrides:
      newData in class PamProcess
    • newRawModelResult Link icon

      public void newRawModelResult(PredictionResult modelResult, GroupedRawData pamRawData)
      Create a data unit form a model result. This is called whenever data passes a prediction threshold.
      Parameters:
      modelResult - - the model result.
      pamRawData - - the raw data unit which the model result came from.
    • forceRunClassifier Link icon

      public void forceRunClassifier(PamDataUnit dataUnit)
      The classifier process works with a few buffers. The classificationBuffer saves enough raw data so that arrays of images can be sent to the deep learning model (which is faster). The next buffer involves detections - either making one because there are model results that pass threshold or saving the predictions to an existing detection. For offline processing these buffers are problematic because they are only cleared when the next data unit is added. This function can be used to bypass the buffers. Add raw data to the segmenter process and the buffers will fill. Then call this function to run the deep learning algorithm and save the detections as annotation to a data unit.
      Parameters:
      dataUnit - - the data unit to add prediction annotations to. NOT the data unit to be classified - this is is defined by adding new data to the process.
    • getBestModelResult Link icon

      public PredictionResult getBestModelResult(DLDetection dlDetection)
      Get the result with the highest score.
      Returns:
      model result with the highest score.
    • pamStart Link icon

      public void pamStart()
      Description copied from class: PamProcess
      Called for each process to tell it to start (may not be necessary for processes which are listening for data anyway).
      Specified by:
      pamStart in class PamProcess
    • pamStop Link icon

      public void pamStop()
      Description copied from class: PamProcess
      Stops the process.
      Specified by:
      pamStop in class PamProcess
    • getDLPredictionDataBlock Link icon

      public DLModelDataBlock getDLPredictionDataBlock()
      Get the data block which contains all results from the deep learning output.
      Returns:
      the data block which holds results output form the deep learning classifier.
    • getDLDetectionDatablock Link icon

      public DLDetectionDataBlock getDLDetectionDatablock()
      Get the data block which contains detections from the deep learning output.
      Returns:
      the data block which holds classified data units
    • getNumClasses Link icon

      public int getNumClasses()
      Get the number of classes the model outputs e.g. the number of species it can recognise.
      Returns:
      the number of classes.
    • getDLAnnotionType Link icon

      public DLAnnotationType getDLAnnotionType()
      Get the DL annotation type. This handles adding annotations to data units with the deep learning results.
      Returns:
      the annotation type.
    • getDLParams Link icon

      public RawDLParams getDLParams()
      Get the parameters for the raw deep learning module.
      Returns:
      the parameters object for the raw deep learning classifier.
    • getDLControl Link icon

      public DLControl getDLControl()
    • getDLGroupDetectionDataBlock Link icon

      public DLGroupDataBlock getDLGroupDetectionDataBlock()
      Get the data block which contains detections from groups of data units. E.g. when a deep learning model considers a group of clicks or whistles rather than an individual detection.
      Returns:
      the data block which holds results output from the deep learning classifier.