Class DLClassifyProcess

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

public class DLClassifyProcess extends PamInstantProcess
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

  • Method Details

    • prepareProcess

      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

      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

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

      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

      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
    • getBestModelResult

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

      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

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

      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

      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

      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

      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

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

      public DLControl getDLControl()