This repository contains a training pipeline for a Cough classification model using Various Model. It supports audio augmentation via the RIRS noise dataset for realistic room simulation.
| Model | Accuracy | Balanced Accuracy | AUC | ROC AUC | F1 Score Accuracy |
|---|---|---|---|---|---|
| LSTM | 0.87 | 0.88 | 0.95 | 0.88 | 0.87 |
| ResNet101 | 0.91 | 0.91 | 0.97 | 0.91 | 0.91 |
| InceptionV3 | 0.92 | 0.92 | 0.98 | 0.92 | 0.92 |
git clone https://github.com/arkiven4/NXSCough
cd NXSCoughInstall dependencies with:
pip install -r requirements.txtBefore training, ensure that the path to your dataset is correctly set in your config in the config/lstm.json folder:
"db_path": "/run/media/fourier/Data1/Pras/Database_ThesisNew/data/"This folder must contain:
- somedatasets.csv: includes audiopath, labels
- audiodata folder: contains the actual audio files or processed data
/run/media/fourier/Data1/Pras/Database_ThesisNew/
├── somedatasets.csv
└── audiodata/
├── file1.wav
└── file2.wav
Update the path according to your environment before running the training script.
python ztrain_nonssl.pyTraining logs will be saved to the ./logs/ directory. You can Check with this command:
tensorboard --logdir ./logs/lstm_try1Open the provided localhost link in your browser to monitor loss, accuracy, and other metrics during training.
After training is complete, please check the logs folder.
Follow the steps below to clone the repository, build the Singularity image, bind necessary folders, and execute your application.
git clone https://github.com/arkiven4/NXSCough
cd NXSCoughsingularity build nxscough.sif nxscough.defBefore training, ensure that the path to your dataset is correctly set in your config like this:
"db_path": "/mnt/data/"sudo singularity exec --bind /run/media/fourier/Data1/Pras/Database_ThesisNew/:/mnt/data --nv nxscough.sif python3 ztrain_nonssl.pyThe path /run/media/fourier/Data1/Pras/Database_ThesisNew/ replace with path on your host machine and must contain:
/run/media/fourier/Data1/Pras/Database_ThesisNew/
├── metadata_combine.csv
└── CombineData/
├── file1.wav
├── file2.wav
└── ...
metadata_combine.csv: A CSV file containing metadata about the audio files.CombineData/: A folder containing.wavfiles used for training.
These files will be mounted to /mnt/data inside the container.
To apply room impulse response (RIR) augmentation:
Download the RIRS dataset from: 👉 https://www.openslr.org/28/
Extract the contents and place them in a suitable path used by your config or augmentation script.