Code Monkey home page Code Monkey logo

speech-classification's Introduction

A Comparison between LSTM and RNN for Speech Classification Using TensorFlow

This study is adapted from a TensorFlow tutorial, with modifications made to suit the goal of this project.

Introduction

The study aims to compare LSTM and RNN models for speech classification using TensorFlow on a dataset of eight short commands.

Methodology

The methodology used in this study involves training LSTM and RNN neural networks to classify audio files containing eight basic commands using TensorFlow.
The performance of the models is evaluated using the classification_report() function from sklearn.metric.
Python is the development environment, and TensorFlow is the main library used.
Other libraries such as matplotlib, numpy, and seaborn are also used to support the study.

Result and analysis

This study compared the accuracy, precision, recall, and F1-score of LSTM and RNN models trained on STFT and MFCC features, and found that LSTM models outperformed RNN models in all metrics.

Feature extraction comparison

This study observed that STFT features produced more dynamic and depthful spectrograms than MFCC features, and that STFT was more suitable for LSTM models while MFCC was more well-rounded for both models.

Best and worst performing models

The best performing model was the LSTM model trained on STFT features, with accuracy score of 0.9099, precision of 0.9112, recall of 0.9099 and F1-score of 0.9100.
The worst performing model was the RNN model trained on STFT features, with accuracy score of 0.1130, precision of 0.1537, recall of 0.1130 and F1-score of 0.0577.

Conclusion

LSTM and RNN models were created and trained with the mini_speech_commands audio dataset to perform simple speech command classification task using TensorFlow.
In general, LSTM models perform better as compared to RNN models for the simple speech command classification.
The best performing model at classifying the simple speech commands is the LSTM model trained on STFT extracted features, with accuracy score of 0.9099, precision of 0.9112, recall of 0.9099 and F1-score of 0.9100.
Meanwhile, the worst performing model is the RNN model trained on STFT extracted features with accuracy score of 0.1130, precision of 0.1537, recall of 0.1130 and F1-score of 0.0577.

speech-classification's People

Contributors

zl-gan avatar

Watchers

 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.