Skip to content

alistair0111/RespiratoryDiseaseClassifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Respiratory Disease Classifier.


The disease that can be classified are:

  • Bronchiectasis
  • Bronchiolitis
  • COPD
  • Pneumonia
  • URTI
  • Healthy

  • The model makes use of audio file recorded via a digital stethoscope.


    Model Architecture

    1. Our model is a Convolutional Neural Network (CNN) using Keras and Tensorflow backend.
    2. I have used a sequential model, with a simple model architecture, consisting of four Conv2D convolution layers, with our final output layer being a dense layer.
    3. The convolution layers are designed for feature detection.
    4. It works by sliding a filter window over the input and performing a matrix multiplication and storing the result in a feature map. This operation is known as a convolution.
    5. The filter parameter specifies the number of nodes in each layer.
    6. Each layer will increase in size from 16, 32, 64 to 128, while the kernel_size parameter specifies the size of the kernel window which in this case is 2 resulting in a 2x2 filter matrix.
    7. The first layer will receive the input shape of (40, 862, 1) where 40 is the number of MFCC's, 862 is the number of frames taking padding into account and the 1 signifying that the audio is mono.
    8. The activation function I have used for our convolutional layers is ReLU. I have used a small Dropout value of 20% on our convolutional layers.
    9. Each convolutional layer has an associated pooling layer of MaxPooling2D type with the final convolutional layer having a GlobalAveragePooling2D type.
    10. The pooling layer is to reduce the dimensionality of the model (by reducing the parameters and subsequent computation requirements) which serves to shorten the training time and reduce overfitting.
    11. The Max Pooling type takes the maximum size for each window and the Global Average Pooling type takes the average which is suitable for feeding into our dense output layer.
    12. Our output layer will have 6 nodes (num_labels) which matches the number of possible classifications.
    13. The activation for our output layer is softmax.
    14. Softmax makes the output sum up to 1 so the output can be interpreted as probabilities.
    15. The model will then make its prediction based on which option has the highest probability.

    How to get started!

    1. Run CMD/terminal and navigate to the folder where requirements.txt is located.
    2. Type in "pip install -r requirements.txt" to download the required modules/packages.
    3. Before running the project we need to create our .db file
      1. Navigate to the same folder where run.py is present
      2. Open python interpretor on cmd/terminal by typing python.
      3. Run the following commands:
        1. from projectapp.models import User,Audio
        2. from projectapp import db
        3. db.create_all()
      4. The above steps will create a site.db file which is our database.
    4. To run the WebApp type in python run.py in cmd/terminal.
    5. Open the project in any browser preferably chrome or firefox by navigating to the url displayed in the terminal which is usually localhost:5000 or 127.0.0.1:5000

    About

    No description, website, or topics provided.

    Resources

    Stars

    Watchers

    Forks

    Releases

    No releases published

    Packages

     
     
     

    Contributors