animal-sounds

3_classifier

Table of Contents

How does it work

To train the model using train.py the user needs have converted audio data into [features](/bioacoustics/2_feature_extraction].

Feature selection (SVM)

In the case of running SVM models using train.py, features are selected in the preprocessing steps of the script. We did a small experiment to determine an optimal number of features. With the total of 1140 acoustic features from the training samples as input, we used a Recursive Feature Elimination (RFE) technique to determine an optimal number of features. This technique yielded a broad optimum with centered a round a rough estimate of 50 features. | | |:–:| | Recursive Feature Elimination on training dataset |

In the preprocessing steps of the SVM model, we perform feature selection using Extra Trees Classifier to rank the features and select the 50 most important features. We save this ranking to select the same features for training and precition.

Training

Predicting

Software requirements

Basic usage

Train

python3.8 train.py --model=svm
            --feature_dir=../../output/features/
            --output_dir=../../output/models/svm/

Predict

python3.8 predict.py --model=svm
            --feature_dir=../../output/features/
            --trained_model_path=../../output/models/svm/svm_model.sav
            --output_dir=../../output/models/svm/predictions/

Shell script

Remarks