marf.FeatureExtraction
Class FeatureExtractionAggregator

java.lang.Object
  extended by marf.Storage.StorageManager
      extended by marf.FeatureExtraction.FeatureExtraction
          extended by marf.FeatureExtraction.FeatureExtractionAggregator
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, IFeatureExtraction, IStorageManager

public class FeatureExtractionAggregator
extends FeatureExtraction

This class by itself does not do any feature extraction, but instead allows concatenation of the results of several actual feature extractors to be combined in a single result. This should give the classification modules more discriminatory power (e.g. when combining the results of FFT and F0 together).

FeatureExtractionAggregator itself still implements the FeatureExtraction API in order to be used in the main pipeline of MARF.

The aggregator expects ModuleParams to be set to the enumeration constants of a module to be invoked followed by that module's enclosed instance ModuleParams. As of this implementation, that enclosed instance of ModuleParams isn't really used, so the main limitation of the aggregator is that all the aggregated feature extractors act with their default settings. This will happen until the pipeline is re-designed a bit to include this capability.

The aggregator clones the incoming preprocessed sample for each feature extractor and runs each module in a separate thread. A the end, the results of each thread are collected in the same order as specified by the initial ModuleParams and returned as a concatenated feature vector. Some meta-information is available if needed.

$Id: FeatureExtractionAggregator.java,v 1.9 2007/12/18 03:45:40 mokhov Exp $

Since:
0.3.0.5
Version:
$Revision: 1.9 $
Author:
Serguei Mokhov
See Also:
FFT, F0, ModuleParams, FeatureExtraction, Serialized Form

Nested Class Summary
 class FeatureExtractionAggregator.FeatureExtractionThread
          A feature extraction thread simply calls its concrete encapsulated feature extraction module and collects any results or errors from its run.
 
Field Summary
static java.lang.String ERR_AGGR_MODULES_FAILED
          Error indicating the fact that one or more aggregated modules failed.
static java.lang.String ERR_MALFORMED_PARAMS
          Error message for no malformed ModuleParams data structure.
static java.lang.String ERR_NO_FEATURES
          A rare error when all feature extractors ran, but there were a total of zero features extracted.
static java.lang.String ERR_NO_MODULES
          Error message for no modules found.
protected  ExpandedThreadGroup oFeatureExtractors
          A collection of the feature extraction threads.
 
Fields inherited from class marf.FeatureExtraction.FeatureExtraction
adFeatures, oFeatureSet, oPreprocessing
 
Fields inherited from class marf.Storage.StorageManager
bDumpOnNotFound, iCurrentDumpMode, oObjectToSerialize, strFilename
 
Fields inherited from interface marf.FeatureExtraction.IFeatureExtraction
MARF_INTERFACE_CODE_REVISION
 
Fields inherited from interface marf.Storage.IStorageManager
DUMP_BINARY, DUMP_CSV_TEXT, DUMP_GZIP_BINARY, DUMP_HTML, DUMP_SQL, DUMP_XML, MARF_INTERFACE_CODE_REVISION, STORAGE_FILE_EXTENSIONS
 
Constructor Summary
FeatureExtractionAggregator(IPreprocessing poPreprocessing)
          Implementation of the feature extraction interface.
 
Method Summary
 boolean extractFeatures()
          Implementation of the feature extraction interface.
 boolean extractFeatures(double[] padSampleData)
          Implementation of the feature extraction interface.
protected  boolean extractFeaturesImplementation(double[] padSampleData)
          Performs the actual business logic of the aggregator per described algorithm.
static java.lang.String getMARFSourceCodeRevision()
          Returns source code revision information.
 
Methods inherited from class marf.FeatureExtraction.FeatureExtraction
backSynchronizeObject, clone, getFeaturesArray, getPreprocessing, setPreprocessing
 
Methods inherited from class marf.Storage.StorageManager
dump, dumpBinary, dumpCSV, dumpGzipBinary, dumpHTML, dumpSQL, dumpXML, enableDumpOnNotFound, equals, getDefaultExtension, getDefaultExtension, getDumpMode, getFilename, getObjectToSerialize, hashCode, restore, restoreBinary, restoreCSV, restoreGzipBinary, restoreHTML, restoreSQL, restoreXML, setDumpMode, setFilename, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ERR_NO_MODULES

public static final java.lang.String ERR_NO_MODULES
Error message for no modules found.

See Also:
Constant Field Values

ERR_MALFORMED_PARAMS

public static final java.lang.String ERR_MALFORMED_PARAMS
Error message for no malformed ModuleParams data structure.

See Also:
Constant Field Values

ERR_AGGR_MODULES_FAILED

public static final java.lang.String ERR_AGGR_MODULES_FAILED
Error indicating the fact that one or more aggregated modules failed. Should be suffixed with the detailed error information.

See Also:
Constant Field Values

ERR_NO_FEATURES

public static final java.lang.String ERR_NO_FEATURES
A rare error when all feature extractors ran, but there were a total of zero features extracted.

See Also:
Constant Field Values

oFeatureExtractors

protected transient ExpandedThreadGroup oFeatureExtractors
A collection of the feature extraction threads.

Constructor Detail

FeatureExtractionAggregator

public FeatureExtractionAggregator(IPreprocessing poPreprocessing)
Implementation of the feature extraction interface. Internally also instantiates the thread group for feature extractors.

Parameters:
poPreprocessing - the preprocessing module to suck the data from
Method Detail

extractFeatures

public boolean extractFeatures()
                        throws FeatureExtractionException
Implementation of the feature extraction interface. The main business logic described in the preamble of the class is implemented here.

Specified by:
extractFeatures in interface IFeatureExtraction
Overrides:
extractFeatures in class FeatureExtraction
Returns:
boolean true if there were features extracted, false otherwise
Throws:
FeatureExtractionException - if ModuleParams isn't there or is in incorrect format, there were errors while cloning, and extracting features, and other errors.
See Also:
IFeatureExtraction.extractFeatures()

extractFeatures

public boolean extractFeatures(double[] padSampleData)
                        throws FeatureExtractionException
Implementation of the feature extraction interface. The main business logic described in the preamble of the class is implemented here. The sample data is taken from the provided parameter.

Parameters:
padSampleData - the sample to extract features from
Returns:
boolean true if there were features extracted, false otherwise
Throws:
FeatureExtractionException - if ModuleParams isn't there or is in incorrect format, there were errors while cloning, and extracting features, and other errors.
Since:
0.3.0.6
See Also:
IFeatureExtraction.extractFeatures()

extractFeaturesImplementation

protected boolean extractFeaturesImplementation(double[] padSampleData)
                                         throws FeatureExtractionException
Performs the actual business logic of the aggregator per described algorithm.

Parameters:
padSampleData - the sample data to extract features from; if null IPreprocessing's sample is used
Returns:
true if the extraction was successful and there are changes
Throws:
FeatureExtractionException - in case of any exception while in the process
Since:
0.3.0.6

getMARFSourceCodeRevision

public static java.lang.String getMARFSourceCodeRevision()
Returns source code revision information.

Returns:
revision string


SourceForge Logo