Git Product home page Git Product logo

speakerclassifier's Introduction

Speaker Age and Gender Classification

This analysis classifies a speaker according to age and gender based on an audio recording of connected speech. The speech task is to read a paragraph of the standardized rainbow passage. The best of 3 recordings is used for analysis.

Data & Preprocessing

The full data collection protocol is described by Goy, Fernandes, Pichora-Fuller, & van Lieshout (2013). Four groups of participants were used in this analysis:

  • 104 Young adult females (aged 17-27)
  • 55 Young adult males (aged 17-27)
  • 82 Older adult females (aged 62-81)
  • 51 Older adult males (aged 64-86)

Recorded speech samples were analyzed using the Sonneta app to calculate 13 "bulk" features from the recording. These features include average fundamental frequency, glottal noise measures and their standard deviations over the recording, and average sound pressure level (SPL). For the full set of speech measures, see the Sonneta documentation. The quantities SFR (dB) and SD SFR (dB) were not used as they contain information redundant with SFR (%) and SD SFR (%).

The data set is not publicly available.

Model Fitting & Validation

I compared two tree-based classifiers: random forests (RF) and gradient boosting machines (GBM). The RF models outperformed the GBM and only the RF results are tabulated below.

The random forests model has a number of hyper-parameters, 6 of which were tuned using a random search strategy (1000 parameter configurations). Once hyper-parameters were chosen, the model was validated using a jackknife method. This method, described in the python notebook, allowed me to use the small number of samples as efficiently as possible.

Results

The confusion matrix for the random forest classifier is as follows:

Confusion Matrix

 Real Group
Older Female  0.74  0.19  0.05  0.02
Young Female  0.19  0.80  0.00  0.00
  Older Male  0.10  0.00  0.69  0.20
  Young Male  0.05  0.00  0.15  0.80
              -- Predicted Groups --

In general, we see better classification on the gender axis than on the age group axis.

We can determine the importance of each feature in the model using a SHAP plot. alt text

Discussion

These results are not bad considering the simple measures that went into the analysis (no formants or unvoiced measures). This sort of classification problem usually uses Mel-frequency cepstral coefficients (MFCC) to obtain better performance. Human listeners also do a bit better than this simple approach. A re-analysis of results from Goy, Pichora-Fuller, & van Lieshout (2016) show the following confusion matrices when recordings are classified by human listeners:

Classification by young listeners:

 Real Group
Older Female  0.76  0.23  0.01  0.00
Young Female  0.02  0.98  0.00  0.00
  Older Male  0.01  0.00  0.86  0.13
  Young Male  0.01  0.01  0.09  0.89
              -- Predicted Groups --

Classification by old listeners:

 Real Group
Older Female  0.81  0.19  0.00  0.00
Young Female  0.08  0.92  0.00  0.00
  Older Male  0.03  0.00  0.90  0.07
  Young Male  0.03  0.00  0.16  0.82
              -- Predicted Groups --

Files

  • SpeakerClassifier.ipynb is a Jupyter notebook containing the classification model, training and evaluation code.

Implementation Notes

  • Tested with Python 3.6.7, Scikit-learn 0.20.3, and shap 0.28.5

speakerclassifier's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.