GitHub
https://github.com/Earwigmoth10/stuttering-detection-classifier.git
title: SpeakFlow AI emoji: colorFrom: blue colorTo: teal sdk: docker app_port: 5000 pinned: false
SpeakFlow AI
AI-Powered Speech Stuttering Detection System
SpeakFlow AI analyzes uploaded or recorded speech audio and detects whether it contains normal speech or stuttering patterns, using MFCC feature extraction and a Random Forest classifier.
Features
- Audio upload & live in-browser recording
- ML-based stutter detection (40 MFCC features + Random Forest)
- Confidence & fluency scoring on every prediction
- Downloadable PDF report of each analysis
- Searchable analysis history
- User accounts (sign up, log in, edit profile, change password)
- Admin dashboard โ user management, analytics charts, CSV export
- Dark mode, responsive UI
Frontend
Tech Stack
Frontend: HTML5, CSS3, Vanilla JavaScript, Chart.js, jsPDF, Font Awesome Backend: Python, Flask, Flask-CORS, Librosa, Scikit-learn, NumPy, Joblib
How It Works
- User uploads or records a WAV/MP3 file
- Audio is preprocessed (noise reduction, normalization, silence trimming)
- 40 MFCCs are extracted using Librosa
- Feature vector is classified by a trained Random Forest model
- App returns Normal / Stutter prediction with a confidence score
Dataset
This model was trained using publicly available speech datasets from the following sources:
Stuttering Speech Dataset
- UCLASS Stuttered Speech Clips (SEP-28k Format)
- Source: https://www.kaggle.com/datasets/vudominhgiang/uclass-stuttered-speech-clips-sep-28k-format
Fluent (Normal) Speech Dataset
- Mozilla Common Voice
- Source: https://commonvoice.mozilla.org/
The datasets were preprocessed and combined to create a binary classification dataset for distinguishing between Fluent Speech and Stuttering Speech.
Note: The datasets are not redistributed in this repository. Please download them from their respective official sources and ensure compliance with their licenses before use.
Running This Space
This Space runs a Flask backend that serves the ML prediction API. On startup it will be available at the URL shown in the Space's embedded app window.
- Backend endpoint:
/api/predict(POST, multipart audio upload) - Health check:
/
Note: This app was originally built to run with a separate local frontend (
index.html+http.server) talking to127.0.0.1:5000. When deployed here, the frontend's API base URL points at this Space's backend instead of localhost.
Admin Access
An admin account is configured in the login flow to access the admin dashboard (user management, analytics, CSV export).
Demo project notice: User accounts, sessions, and analysis history are stored in browser
localStorage, not a real database, and passwords are not hashed. This project is for academic/demo purposes only โ not intended for production use with real user data.
Model Details
- Feature extraction: 40 MFCCs averaged over time (Librosa)
- Classifier: Random Forest (Scikit-learn)
- Classes: Normal speech vs. Stuttered speech
- Training data: 8,000+ labeled audio samples
Author
Laiba Aamir (reawigmoth)







