Class DLClassifyProcess
java.lang.Object
PamguardMVC.PamProcess
PamguardMVC.PamInstantProcess
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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
forceRunClassifier
(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 parameters for the raw deep learning module.Get the data block which contains all results from the deep learning output.int
Get the number of classes the model outputs e.g.void
newData
(PamObservable obs, PamDataUnit pamRawData) void
newRawModelResult
(PredictionResult modelResult, GroupedRawData pamRawData) Create a data unit form a model result.void
pamStart()
Called for each process to tell it to start (may not be necessary for processes which are listening for data anyway).void
pamStop()
Stops the process.void
Called for each process before any of them receive the PamStart commandvoid
called for every process once the system model has been created.Methods inherited from class PamguardMVC.PamInstantProcess
setParentDataBlock, setParentDataBlock
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, setProcessCheck, setProcessName, setSampleRate, toString, updateData
-
Constructor Details
-
DLClassifyProcess
-
-
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 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:
setupProcess
in classPamProcess
-
newData
- Overrides:
newData
in 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
-
getBestModelResult
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 classPamProcess
-
pamStop
public void pamStop()Description copied from class:PamProcess
Stops the process.- Specified by:
pamStop
in 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
-