Explainable machine learning pipeline for early ALS detection using physiologically interpretable acoustic features from smartphone recordings — Reproduction scripts
Python scripts to reproduce the acoustic feature extraction and the training/validation of the classifier (LASSO + XGBoost) described in the article. The pipeline requires the SAND Challenge's audios (.WAV) to generate the tabular data.
.
├── features.py # Step 1: feature extraction from the audios
├── train_xgblasso.py # Step 2: selection (LASSO) + classification (XGBoost) with CV-10
├── features_training.csv # Output of Step 1 (feature matrix, 272 × 148)
├── requirements.txt # Exact dependency versions
│
└── training/ (not included, for intellectual property reasons)
├── sand_task_1.xlsx # Metadata: ID, Age, Sex, Class
├── phonationA/ … U/ # Sustained vowels (/a/,/e/,/i/,/o/,/u/)
└── rhythmPA/ TA/ KA/ # Diadochokinesis tasks (/pa/,/ta/,/ka/)
Each task folder contains one .wav per subject, named
<ID>_<task>.wav (e.g. ID000_phonationA.wav). There are 272 subjects. These audios should be requested from the SAND Challenge team; this repo includes the tabular data (CSV) extracted from the raw audios (features_training.csv) so you can run the model without the audios.
Requires Python 3.12.
pip install -r requirements.txtStep 1 — Feature extraction (processes the 8 audios of each
subject in parallel from the training file and writes features_training.csv):
python features.pyStep 2 — Training and validation (reads features_training.csv,
performs feature selection with LASSO and classification with XGBoost
under stratified 10-fold cross-validation, and prints the metrics):
python train_xgblasso.pyThe feature selection and the metrics (AUC, sensitivity, specificity, F1, accuracy and confusion matrix) are printed on the console.
- Label:
Class == 5→ healthy subject;Class ∈ {1,2,3,4}→ ALS. - Audio preprocessing: resampling to 8 kHz, silence trimming with Praat and extraction of phonation features (F0, jitter, shimmer, HNR, formants), rhythm/DDK and spectral features and global vowel-space metrics (tVSA, FCR).
- Model:
SimpleImputer(median)→StandardScaler→SelectFromModel(LogisticRegression L1, C=0.05)→XGBoost. Feature selection is performed inside each fold in order to avoid data leakage. Fixed seed (random_state=42) for reproducibility.
| Metric | Value |
|---|---|
| AUC | 0.831 |
| Sensitivity | 0.794 |
| Specificity | 0.748 |
| F1 | 0.811 |
| Accuracy | 0.776 |
Confusion matrix: [[80, 27], [34, 131]] (rows = actual Healthy/ALS).