Class DLClassifyProcess
java.lang.Object
PamguardMVC.PamProcess
rawDeepLearningClassifier.dlClassification.DLClassifyProcess
- All Implemented Interfaces:
PamObserver,ProcessAnnotator
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
-
Field Summary
Fields inherited from class PamguardMVC.PamProcess
outputDataBlocks, parentDataBlock, processName, sampleRate -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidforceRunClassifier(PamDataUnit dataUnit) The classifier process works with a few buffers.getBestModelResult(DLDetection dlDetection) Get the result with the highest score.Get the DL annotation type.Get the data block which contains detections from the deep learning output.Get the data block which contains detections from groups of data units.Get the parameters for the raw deep learning module.Get the data block which contains all results from the deep learning output.intGet the number of classes the model outputs e.g.voidnewData(PamObservable obs, PamDataUnit pamRawData) voidnewRawModelResult(PredictionResult modelResult, GroupedRawData pamRawData) Create a data unit form a model result.voidpamStart()Called for each process to tell it to start (may not be necessary for processes which are listening for data anyway).voidpamStop()Stops the process.voidCalled for each process before any of them receive the PamStart commandvoidcalled for every process once the system model has been created.Methods inherited from class PamguardMVC.PamProcess
absMillisecondsToSamples, absSamplesToMilliseconds, addData, addMultiPlexDataBlock, addOutputDataBlock, changedThreading, clearOldData, createAnnotations, destroyProcess, dumpBufferStatus, flushDataBlockBuffers, getAncestorDataBlock, getAnnotation, getChainPosition, getCompatibleDataUnits, getCpuPercent, getFrequencyRange, getLastSourceNotificationObject, getLastSourceNotificationType, getMuiltiplexDataBlock, getNumAnnotations, getNumMuiltiplexDataBlocks, getNumOutputDataBlocks, getObserverName, getObserverObject, getOfflineData, getOfflineData, getOutputDataBlock, getOutputDataBlocks, getPamControlledUnit, getParentDataBlock, getParentDataBlocks, getParentProcess, getProcessCheck, getProcessName, getRawSourceDataBlock, getRawSourceDataBlock, getRequiredDataHistory, getSampleRate, getSourceDataBlock, getSourceProcess, hasOutputDatablock, isCanMultiThread, isExternalProcess, isMultiplex, makePamProcess, masterClockUpdate, noteNewSettings, notifyModelChanged, prepareProcessOK, processNewBuoyData, receiveSourceNotification, relMillisecondsToSamples, relSamplesToMilliseconds, removeAllDataBlocks, removeAllMultiPlexDataBlocks, removeMultiPlexDataBlock, removeObservable, removeOutputDatablock, resetDataBlocks, saveViewerData, setCanMultiThread, setExternalProcess, setMultiplex, setParentDataBlock, setParentDataBlock, setProcessCheck, setProcessName, setSampleRate, toString, updateData
-
Constructor Details
-
DLClassifyProcess
-
-
Method Details
-
prepareProcess
public void prepareProcess()Description copied from class:PamProcessCalled for each process before any of them receive the PamStart command- Overrides:
prepareProcessin classPamProcess
-
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:
setupProcessin classPamProcess
-
newData
- Overrides:
newDatain classPamProcess
-
newRawModelResult
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
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
Get the result with the highest score.- Returns:
- model result with the highest score.
-
pamStart
public void pamStart()Description copied from class:PamProcessCalled for each process to tell it to start (may not be necessary for processes which are listening for data anyway).- Specified by:
pamStartin classPamProcess
-
pamStop
public void pamStop()Description copied from class:PamProcessStops the process.- Specified by:
pamStopin classPamProcess
-
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
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
Get the DL annotation type. This handles adding annotations to data units with the deep learning results.- Returns:
- the annotation type.
-
getDLParams
Get the parameters for the raw deep learning module.- Returns:
- the parameters object for the raw deep learning classifier.
-
getDLControl
-
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.
-