Giter Club home page Giter Club logo

mind-gut-connection's Introduction

Mind-Gut-Connection

CNN and RCNN implementations to perform classification of stethoscope sounds based on different mental states.

6 Classes are considered:

  1. Anxiety
  2. Baseline
  3. Concentration
  4. Digestion
  5. Disgust
  6. Frustration

Notebooks

Jupyter notebooks are used to explore and unit test data before deploying to a model

EDA - Exploratory data analysis

Plots time series of 1m data points (fs=48,000). Signals are down sampled to 8k Hz. Calculates and displays frequencies using the Fast Fourier Transform. Plots the Short Time Fourier Transform for an interval of 3 seconds and truncates to frequencies under 1k hertz. The corresponding Mel Frequency Cepstral Coefficients are calculated as well uses 13 mel filters scaled from 0 to 4k hertz.

Downsample

Down samples all audio to 8k hertz and saves wavfiles in new directory with respective class.

Demo high pass filter and noise threshold

Applies a high pass filter of 10 Hz to the 8k hertz signal and applies a noise threshold using a moving average of 1 second. Portions of the signal to keep and discard are shown in green and red.

Calculates STFT and MFCC features

Builds STFT and MFCC features separated as 1 second intervals. A high pass filter and noise threshold are applied the the signal. Features are saved as npz files.

Input Scaling

Looks at the min and max values for each sample in either stft or mfcc directory. Considers log10(features)+6 as a lambda function transform as input to the neural network for a normal distribution.

Evaluate Subjects

Predicts accuracies for each subject in either stft or mfcc directories. Also has some results from cross validation on both ordered and unordered subjects.

Running the models

Two models are implemented. Convolutional Neural Net (CNN). Recurrent Convolutional Neural Net. (RCNN)

Arguments to model are found in main.py. Total duration should be integers of 1 second intervals. Delta time will slice the total duration into time intervals for the RCNN. (ignored for CNN)

python main.py

Shuffles each epoch. (9/1 train test split)

Swap train(args) with train_cv(args) to switch to cross validation. n_splits (10) is set in cross_validation.py

Note Check the output size of each convolution block if you are making delta time smaller. Comment out blocks if output shape into the LSTM to too small.

mind-gut-connection's People

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.