Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Real-Time Scream Detection System (Scream vs Non-Scream) πŸ”Š

A machine learning–based real-time audio classification system for detecting human screams using MFCC feature extraction, SVM and MLP classifiers, and emergency-aware alert logic with temporal smoothing and false-alarm control.

Python Machine Learning Audio Processing


πŸ“Œ Overview

This project implements a real-time scream detection system capable of distinguishing scream vs non-scream audio events from a microphone stream or audio files. It is designed for emergency detection, safety monitoring, and public security applications, where low latency, high recall, and controlled false alarms are critical.

The system combines:

  • Robust audio signal processing
  • Classical machine learning classifiers
  • Energy gating, confidence thresholds, and temporal smoothing
  • Immediate alert logic for single-scream emergencies

✨ Key Features

  • Binary Audio Classification: Scream vs Non-Scream
  • MFCC-based Feature Extraction
  • SVM (RBF kernel) and MLP classifiers
  • Real-time microphone inference
  • Energy-based silence filtering
  • Temporal smoothing (sliding-window voting)
  • Immediate & sustained emergency alerts
  • False alarm and detection latency evaluation
  • Ablation study for system validation
  • Fully reproducible evaluation pipeline

πŸš€ Applications

  • Emergency & Distress Detection
  • Smart Surveillance Systems
  • Women & Child Safety Solutions
  • Smart Homes and IoT Safety
  • Healthcare & Patient Monitoring
  • Public Safety Research
  • Audio Event Detection Studies

πŸ“Š Dataset & Features

Classes

  • Scream: Human screams and distress vocalizations
  • Non-Scream: Speech, silence, background noise, environmental sounds

Feature Extraction

  • MFCC (13 coefficients)
  • Statistical aggregation: mean + standard deviation
  • Fixed-length audio normalization
  • Sampling rate: 22,050 Hz

Raw audio files are not included due to size and licensing constraints. Extracted features are provided for reproducibility.


🧠 Model Details

Machine Learning Models

  • Support Vector Machine (SVM)

    • RBF kernel
    • Probability estimation enabled
  • Multi-Layer Perceptron (MLP)

    • Hidden layers: (128, 64, 32)
    • Activation: ReLU
    • Early stopping enabled

Why ML instead of Deep Learning?

  • Faster inference
  • Lower latency
  • Better stability in low-data regimes
  • Easier deployment on edge devices

🎀 Real-Time Detection Logic

The real-time pipeline includes:

  1. Microphone audio capture
  2. Energy-based silence filtering
  3. MFCC feature extraction
  4. SVM + MLP inference
  5. Confidence thresholding
  6. Sliding-window temporal smoothing
  7. Immediate alert for single high-confidence scream
  8. Sustained alert for repeated screams

This design balances recall, precision, and robustness.


πŸ“ Project Structure

Sound_Detection_Scream_NonScream/
β”‚
β”œβ”€β”€ Model/                      # Trained models
β”‚   β”œβ”€β”€ scream_svm.pkl
β”‚   β”œβ”€β”€ scream_mlp.pkl
β”‚   └── scaler.pkl
β”‚
β”œβ”€β”€ asset/                      # Evaluation assets
β”‚   β”œβ”€β”€ features.csv
β”‚   └── scream_alert_log.txt
β”‚
β”œβ”€β”€ Sound _Detection.ipynb      # Main notebook (training + evaluation)
β”œβ”€β”€ README.md
└── .gitignore

βš™οΈ Installation

Prerequisites

  • Python 3.8+
  • pip
  • Microphone (for real-time detection)

Setup

git clone https://github.com/satwik-shreshth/Sound_Detection_Scream_NonScream.git
cd Sound_Detection_Scream_NonScream
pip install -r requirements.txt

▢️ Usage

1. Training & Evaluation

Run the notebook:

jupyter notebook "Sound _Detection.ipynb"

Includes:

  • Feature extraction
  • Model training
  • Accuracy & confusion matrix
  • ROC & Precision-Recall curves
  • False alarm & latency computation
  • Ablation experiments

2. Real-Time Microphone Detection

The notebook contains sliding-window real-time scream detection using your trained models with alert logic.


πŸ“ˆ Evaluation & Results

Offline Metrics

  • Accuracy
  • Precision
  • Recall (priority metric)
  • F1-Score
  • ROC-AUC
  • Confusion Matrix

Real-Time Metrics

  • False Alarm Rate
  • Detection Latency (ms)
  • Alert Stability

Ablation Study

Validated the importance of:

  • Energy gating
  • Confidence thresholds
  • Temporal smoothing
  • Immediate alert logic

πŸ“Š Key Findings

  • High recall for scream detection
  • Low detection latency (~tens of milliseconds)
  • Significant reduction in false alarms with energy gating
  • Stable alerts with temporal smoothing
  • Suitable for real-time emergency scenarios

⚠️ Ethical Considerations

This system must be used responsibly:

  • Respect privacy laws and consent
  • Avoid unauthorized surveillance
  • Deploy strictly for safety and emergency use
  • Ensure transparency in public deployments

πŸ“Œ Future Work

  • Multi-class audio event detection
  • Emotion intensity estimation
  • Edge-device deployment (Raspberry Pi)
  • Mobile application integration
  • Adaptive thresholding
  • Cloud-based alerting systems

πŸ‘€ Author

Satwik Shreshth Research Student GitHub: https://github.com/satwik-shreshth


πŸ“„ Citation

@software{scream_detection_2026,
  author = {Satwik Shreshth},
  title = {Real-Time Scream Detection using MFCC, SVM, and MLP},
  year = {2026},
  url = {https://github.com/satwik-shreshth/Sound_Detection_Scream_NonScream}
}

⭐ If this project helped you, consider starring the repository.


About

Real-time scream detection system using MFCC features with SVM and MLP classifiers, designed for emergency aware audio monitoring with low latency, false alarm control, and temporal smoothing.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages